Debian Codegraph @

src/atlas/output/detail/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 "atlas/output/Output.h"
14 #include "atlas/util/Config.h"
15
16 namespace atlas {
17 namespace output {
18 namespace detail {
19 class GmshIO;
20 } // namespace detail
21 } // namespace output
22 } // namespace atlas
23
24 namespace atlas {
25 namespace output {
26 namespace detail {
27
28 // -----------------------------------------------------------------------------
29
30 class GmshImpl : public OutputImpl {
31 public:
32 GmshImpl(std::ostream&);
33 GmshImpl(std::ostream&, const eckit::Parametrisation&);
34
35 GmshImpl(const eckit::PathName&, const std::string& mode);
36 GmshImpl(const eckit::PathName&, const std::string& mode, const eckit::Parametrisation&);
37
38 GmshImpl(const eckit::PathName&);
39 GmshImpl(const eckit::PathName&, const eckit::Parametrisation&);
40
41 virtual ~GmshImpl();
42
43 /// Write mesh file
44 virtual void write(const Mesh&, const eckit::Parametrisation& = util::NoConfig()) const;
45
46 /// Write field to file
47 virtual void write(const Field&, const eckit::Parametrisation& = util::NoConfig()) const;
48
49 /// Write fieldset to file using FunctionSpace
50 virtual void write(const FieldSet&, const eckit::Parametrisation& = util::NoConfig()) const;
51
52 /// Write field to file using Functionspace
53 virtual void write(const Field&, const FunctionSpace&, const eckit::Parametrisation& = util::NoConfig()) const;
54
55 /// Write fieldset to file using FunctionSpace
56 virtual void write(const FieldSet&, const FunctionSpace&, const eckit::Parametrisation& = util::NoConfig()) const;
57
58 public:
59 struct Configuration {
60 bool binary;
61 bool edges;
62 bool elements;
63 bool gather;
64 bool ghost;
65 bool info;
66
67 bool configured_land_water;
68 bool land;
69 bool water;
70
71 std::vector<long> levels;
72 std::string nodes;
73 std::string file;
74 std::string openmode;
75 std::string coordinates;
76 };
77
78 static void setGmshConfiguration(detail::GmshIO&, const Configuration&);
79
80 private:
81 mutable Configuration config_;
82
83 void defaults();
84 };
85 // -----------------------------------------------------------------------------
86
87 } // namespace detail
88 } // namespace output
89 } // namespace atlas