Debian Codegraph @

src/atlas/output/GmshImpl.h

raw
1 /*
2 * (C) Copyright 2013 ECMWF.
3 *
4 * This software is licensed under the terms of the Apache Licence Version 2.0
5 * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6 * In applying this licence, ECMWF does not waive the privileges and immunities
7 * granted to it by virtue of its status as an intergovernmental organisation
8 * nor does it submit to any jurisdiction.
9 */
10
11 #pragma once
12
13 #include <fstream>
14
15 #include "atlas/output/Output.h"
16 #include "atlas/parallel/mpi/mpi.h"
17 #include "atlas/util/Config.h"
18
19 namespace atlas {
20 namespace output {
21 namespace detail {
22 class GmshIO;
23 }
24 } // namespace output
25 } // namespace atlas
26
27 namespace atlas {
28 namespace output {
29 namespace detail {
30
31 // -----------------------------------------------------------------------------
32
33 class GmshImpl : public OutputImpl {
34 public:
35 GmshImpl(std::ostream&);
36 GmshImpl(std::ostream&, const eckit::Parametrisation&);
37
38 GmshImpl(const eckit::PathName&, const std::string& mode);
39 GmshImpl(const eckit::PathName&, const std::string& mode, const eckit::Parametrisation&);
40
41 GmshImpl(const eckit::PathName&);
42 GmshImpl(const eckit::PathName&, const eckit::Parametrisation&);
43
44 virtual ~GmshImpl();
45
46 /// Write mesh file
47 virtual void write(const Mesh&, const eckit::Parametrisation& = util::NoConfig()) const;
48
49 /// Write field to file
50 virtual void write(const Field&, const eckit::Parametrisation& = util::NoConfig()) const;
51
52 /// Write fieldset to file using FunctionSpace
53 virtual void write(const FieldSet&, const eckit::Parametrisation& = util::NoConfig()) const;
54
55 /// Write field to file using Functionspace
56 virtual void write(const Field&, const FunctionSpace&, const eckit::Parametrisation& = util::NoConfig()) const;
57
58 /// Write fieldset to file using FunctionSpace
59 virtual void write(const FieldSet&, const FunctionSpace&, const eckit::Parametrisation& = util::NoConfig()) const;
60
61 public:
62 struct Configuration {
63 bool binary;
64 bool edges;
65 bool elements;
66 bool gather;
67 bool ghost;
68 bool info;
69 std::vector<long> levels;
70 std::string nodes;
71 std::string file;
72 std::string openmode;
73 std::string coordinates;
74 };
75
76 static void setGmshConfiguration(detail::GmshIO&, const Configuration&);
77
78 private:
79 mutable Configuration config_;
80
81 void defaults();
82 };
83
84 // -----------------------------------------------------------------------------
85
86 } // namespace detail
87 } // namespace output
88 } // namespace atlas