Debian Codegraph @

src/atlas/mesh/elementtypes/Classification.h

raw
1 /*
2 * (C) Copyright 1996-2016 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 nor
8 * does it submit to any jurisdiction.
9 */
10
11 /// @author Willem Deconinck
12 /// @date October 2015
13
14 #pragma once
15
16 #include "atlas/mesh/ElementType.h"
17
18 namespace atlas {
19 namespace mesh {
20 namespace elementtypes {
21
22 //-------------------------------------------------------------------
23
24 class Volume : public ElementType
25 {
26 public:
27 enum { DIMENSIONALITY=3 };
28 virtual size_t dimensionality() const { return DIMENSIONALITY; }
29 };
30
31 //-------------------------------------------------------------------
32
33 class Face : public ElementType
34 {
35 public:
36 enum { DIMENSIONALITY=2 };
37 enum { FACES=1 };
38 virtual size_t dimensionality() const { return DIMENSIONALITY; }
39 virtual size_t nb_faces() const { return FACES; }
40 };
41
42 //-------------------------------------------------------------------
43
44 class Edge: public ElementType
45 {
46 public:
47 enum { DIMENSIONALITY=1 };
48 enum { FACES=0 };
49 enum { EDGES=1 };
50 virtual size_t dimensionality() const { return DIMENSIONALITY; }
51 virtual size_t nb_faces() const { return FACES; }
52 virtual size_t nb_edges() const { return EDGES; }
53 };
54
55 //-------------------------------------------------------------------
56
57 class Vertex: public ElementType
58 {
59 public:
60 enum { DIMENSIONALITY=0 };
61 enum { FACES=0 };
62 enum { EDGES=0 };
63 enum { VERTICES=1 };
64 virtual size_t dimensionality() const { return DIMENSIONALITY; }
65 virtual size_t nb_faces() const { return FACES; }
66 virtual size_t nb_edges() const { return EDGES; }
67 virtual size_t nb_vertices() const { return VERTICES; }
68 };
69
70 //-------------------------------------------------------------------
71
72 } // namespace elementtypes
73 } // namespace mesh
74 } // namespace atlas