Debian Codegraph @

src/atlas/meshgenerator/MeshGenerator.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 <string>
14
15 #include "atlas/library/config.h"
16 #include "atlas/util/Config.h"
17 #include "atlas/util/ObjectHandle.h"
18
19 namespace eckit {
20 class Hash;
21 class Parametrisation;
22 } // namespace eckit
23
24 namespace atlas {
25 class Mesh;
26 class Grid;
27 class Projection;
28 } // namespace atlas
29
30 namespace atlas {
31 namespace grid {
32 class Distribution;
33 class Partitioner;
34 } // namespace grid
35 } // namespace atlas
36
37 namespace atlas {
38 namespace meshgenerator {
39 class MeshGeneratorImpl;
40 }
41
42 //----------------------------------------------------------------------------------------------------------------------
43
44 class MeshGenerator : DOXYGEN_HIDE(public util::ObjectHandle<meshgenerator::MeshGeneratorImpl>) {
45 public:
46 using Parameters = atlas::util::Config;
47
48 public:
49 using Handle::Handle;
50 MeshGenerator(const std::string&, const eckit::Parametrisation& = util::NoConfig());
51 MeshGenerator(const eckit::Parametrisation&);
52
53 void hash(eckit::Hash&) const;
54
55 Mesh generate(const Grid&, const grid::Distribution&) const;
56 Mesh generate(const Grid&, const grid::Partitioner&) const;
57 Mesh generate(const Grid&) const;
58
59 Mesh operator()(const Grid&, const grid::Distribution&) const;
60 Mesh operator()(const Grid&, const grid::Partitioner&) const;
61 Mesh operator()(const Grid&) const;
62
63 std::string type() const;
64 };
65
66 //----------------------------------------------------------------------------------------------------------------------
67
68 // Shorthands
69 class StructuredMeshGenerator : public MeshGenerator {
70 public:
71 StructuredMeshGenerator(const eckit::Parametrisation& config = util::NoConfig()):
72 MeshGenerator("structured", config) {}
73 };
74
75 //----------------------------------------------------------------------------------------------------------------------
76
77 } // namespace atlas