| 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/functionspace/EdgeColumns.h" |
| 16 |
#include "atlas/functionspace/NodeColumns.h" |
| 17 |
#include "atlas/numerics/Method.h" |
| 18 |
|
| 19 |
namespace eckit { |
| 20 |
class Parametrisation; |
| 21 |
} |
| 22 |
namespace atlas { |
| 23 |
class Mesh; |
| 24 |
} |
| 25 |
namespace atlas { |
| 26 |
namespace mesh { |
| 27 |
class HybridElements; |
| 28 |
} |
| 29 |
} // namespace atlas |
| 30 |
namespace atlas { |
| 31 |
namespace mesh { |
| 32 |
class Nodes; |
| 33 |
} |
| 34 |
} // namespace atlas |
| 35 |
|
| 36 |
namespace atlas { |
| 37 |
namespace numerics { |
| 38 |
namespace fvm { |
| 39 |
|
| 40 |
class Method : public numerics::Method { |
| 41 |
public: |
| 42 |
Method(Mesh&, const eckit::Configuration&); |
| 43 |
Method(Mesh&, const mesh::Halo&); |
| 44 |
Method(Mesh&); |
| 45 |
|
| 46 |
virtual std::string& name() const override { |
| 47 |
static std::string _name{"fvm"}; |
| 48 |
return _name; |
| 49 |
} |
| 50 |
|
| 51 |
const atlas::Mesh& mesh() const { return mesh_; } |
| 52 |
atlas::Mesh& mesh() { return mesh_; } |
| 53 |
|
| 54 |
size_t levels() const { return levels_; } |
| 55 |
|
| 56 |
const functionspace::NodeColumns& node_columns() const { return node_columns_; } |
| 57 |
functionspace::NodeColumns& node_columns() { return node_columns_; } |
| 58 |
|
| 59 |
const functionspace::EdgeColumns& edge_columns() const { return edge_columns_; } |
| 60 |
functionspace::EdgeColumns& edge_columns() { return edge_columns_; } |
| 61 |
|
| 62 |
const double& radius() const { return radius_; } |
| 63 |
|
| 64 |
private: |
| 65 |
void setup(); |
| 66 |
|
| 67 |
private: // data |
| 68 |
Mesh mesh_; // non-const because functionspace may modify mesh |
| 69 |
size_t levels_; |
| 70 |
mesh::Halo halo_; |
| 71 |
mesh::Nodes& nodes_; |
| 72 |
mesh::HybridElements& edges_; |
| 73 |
functionspace::NodeColumns node_columns_; |
| 74 |
functionspace::EdgeColumns edge_columns_; |
| 75 |
|
| 76 |
double radius_; |
| 77 |
}; |
| 78 |
|
| 79 |
// ------------------------------------------------------------------- |
| 80 |
// C wrapper interfaces to C++ routines |
| 81 |
|
| 82 |
extern "C" { |
| 83 |
Method* atlas__numerics__fvm__Method__new(Mesh::Implementation* mesh, const eckit::Configuration* params); |
| 84 |
const functionspace::detail::NodeColumns* atlas__numerics__fvm__Method__functionspace_nodes(Method* This); |
| 85 |
const functionspace::detail::EdgeColumns* atlas__numerics__fvm__Method__functionspace_edges(Method* This); |
| 86 |
} |
| 87 |
|
| 88 |
} // namespace fvm |
| 89 |
} // namespace numerics |
| 90 |
} // namespace atlas |