atlas
MeshGeneratorImpl.h
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/util/Object.h"
14 
15 namespace eckit {
16 class Hash;
17 class Parametrisation;
18 } // namespace eckit
19 
20 namespace atlas {
21 class Mesh;
22 class Grid;
23 class Projection;
24 } // namespace atlas
25 
26 namespace atlas {
27 namespace grid {
28 class Distribution;
29 class Partitioner;
30 } // namespace grid
31 } // namespace atlas
32 
33 namespace atlas {
34 namespace meshgenerator {
35 
36 //----------------------------------------------------------------------------------------------------------------------
37 
39 public:
41 
42  virtual ~MeshGeneratorImpl();
43 
44  virtual void hash( eckit::Hash& ) const = 0;
45 
46  virtual void generate( const Grid&, const grid::Partitioner&, Mesh& ) const;
47  virtual void generate( const Grid&, const grid::Distribution&, Mesh& ) const = 0;
48  virtual void generate( const Grid&, Mesh& ) const = 0;
49 
50  Mesh generate( const Grid&, const grid::Partitioner& ) const;
51  Mesh generate( const Grid&, const grid::Distribution& ) const;
52  Mesh generate( const Grid& ) const;
53 
54  Mesh operator()( const Grid&, const grid::Distribution& ) const;
55  Mesh operator()( const Grid&, const grid::Partitioner& ) const;
56  Mesh operator()( const Grid& ) const;
57 
58  virtual std::string type() const = 0;
59 
60 protected:
61  void generateGlobalElementNumbering( Mesh& mesh ) const;
62  void setProjection( Mesh&, const Projection& ) const;
63  void setGrid( Mesh&, const Grid&, const grid::Distribution& ) const;
64  void setGrid( Mesh&, const Grid&, const std::string& distribution ) const;
65 };
66 
67 //----------------------------------------------------------------------------------------------------------------------
68 
69 } // namespace meshgenerator
70 
71 //----------------------------------------------------------------------------------------------------------------------
72 
73 } // namespace atlas
Definition: MeshGeneratorImpl.h:38
Definition: Distribution.h:31
Definition: Projection.h:49
Definition: Mesh.h:55
Definition: Object.h:18
Definition: Domain.h:19
Most general grid container.
Definition: Grid.h:64
Contains all atlas classes and methods.
Definition: atlas-grids.cc:33
Definition: Partitioner.h:68