Debian Codegraph @

src/atlas/mesh/ElementType.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 /// @file ElementType.h
12 /// @author Willem Deconinck
13 /// @date October 2015
14
15 #pragma once
16
17 #include <string>
18
19 #include "atlas/library/config.h"
20 #include "atlas/util/Object.h"
21
22 namespace atlas {
23 namespace mesh {
24
25 /**
26 * \brief ElementType class (abstract) that provides access to geometric
27 * information of an element
28 */
29 class ElementType : public util::Object {
30 public: // methods
31 static ElementType* create(const std::string&);
32
33 //-- Constructors
34
35 ElementType();
36
37 ~ElementType() = 0;
38
39 virtual const std::string& name() const = 0;
40
41 virtual size_t dimensionality() const = 0;
42
43 virtual size_t nb_vertices() const = 0;
44
45 virtual size_t nb_edges() const = 0;
46
47 virtual size_t nb_faces() const = 0;
48
49 virtual size_t nb_nodes() const = 0;
50
51 virtual bool parametric() const = 0;
52
53 virtual bool simplex() const = 0;
54
55 };
56
57 extern "C"
58 {
59 ElementType* atlas__mesh__ElementType__create(const char* name);
60 void atlas__mesh__ElementType__delete(ElementType* This);
61 idx_t atlas__mesh__ElementType__nb_nodes(const ElementType* This);
62 idx_t atlas__mesh__ElementType__nb_edges(const ElementType* This);
63 int atlas__mesh__ElementType__parametric(const ElementType* This);
64 const char* atlas__mesh__ElementType__name(const ElementType* This);
65 }
66
67 //------------------------------------------------------------------------------------------------------
68
69 } // namespace mesh
70 } // namespace atlas
71
72 // Following includes are added for backwards compatibility with temporary elementtypes.
73 // They contain deprecation warnings.
74 // When deprecation is final, these lines can be removed.
75 #include "atlas/mesh/elementtypes/Quadrilateral.h"
76 #include "atlas/mesh/elementtypes/Triangle.h"
77 #include "atlas/mesh/elementtypes/Line.h"