| 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 |
|
| 12 |
#pragma once |
| 13 |
|
| 14 |
#include "atlas/meshgenerator/MeshGenerator.h" |
| 15 |
#include "atlas/meshgenerator/detail/MeshGeneratorImpl.h" |
| 16 |
#include "atlas/util/Config.h" |
| 17 |
#include "atlas/util/Metadata.h" |
| 18 |
|
| 19 |
#ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 20 |
namespace eckit { |
| 21 |
class Parametrisation; |
| 22 |
} |
| 23 |
|
| 24 |
namespace atlas { |
| 25 |
class RegularGrid; |
| 26 |
class Mesh; |
| 27 |
template <typename T> |
| 28 |
class vector; |
| 29 |
} // namespace atlas |
| 30 |
|
| 31 |
namespace atlas { |
| 32 |
namespace grid { |
| 33 |
class Distribution; |
| 34 |
} // namespace grid |
| 35 |
} // namespace atlas |
| 36 |
#endif |
| 37 |
|
| 38 |
namespace atlas { |
| 39 |
namespace meshgenerator { |
| 40 |
|
| 41 |
//---------------------------------------------------------------------------------------------------------------------- |
| 42 |
|
| 43 |
class RegularMeshGenerator : public MeshGenerator::Implementation { |
| 44 |
public: |
| 45 |
RegularMeshGenerator(const eckit::Parametrisation& = util::NoConfig()); |
| 46 |
|
| 47 |
virtual void generate(const Grid&, const grid::Distribution&, Mesh&) const override; |
| 48 |
virtual void generate(const Grid&, Mesh&) const override; |
| 49 |
|
| 50 |
using MeshGenerator::Implementation::generate; |
| 51 |
|
| 52 |
std::string type() const override { return "regular"; } |
| 53 |
|
| 54 |
private: |
| 55 |
virtual void hash(eckit::Hash&) const override; |
| 56 |
|
| 57 |
void configure_defaults(); |
| 58 |
|
| 59 |
void generate_mesh(const RegularGrid&, const grid::Distribution& distribution, Mesh& m) const; |
| 60 |
|
| 61 |
private: |
| 62 |
util::Metadata options; |
| 63 |
}; |
| 64 |
|
| 65 |
//---------------------------------------------------------------------------------------------------------------------- |
| 66 |
|
| 67 |
} // namespace meshgenerator |
| 68 |
} // namespace atlas |