Line |
Branch |
Exec |
Source |
1 |
|
|
// ______ ______ _ _ _____ ______ |
2 |
|
|
// | ____| ____| | (_)/ ____| | ____| |
3 |
|
|
// | |__ | |__ | | _| (___ ___| |__ |
4 |
|
|
// | __| | __| | | | |\___ \ / __| __| |
5 |
|
|
// | | | |____| |____| |____) | (__| |____ |
6 |
|
|
// |_| |______|______|_|_____/ \___|______| |
7 |
|
|
// Finite Elements for Life Sciences and Engineering |
8 |
|
|
// |
9 |
|
|
// License: LGL2.1 License |
10 |
|
|
// FELiScE default license: LICENSE in root folder |
11 |
|
|
// |
12 |
|
|
// Main authors: J-F. Gerbeau |
13 |
|
|
// |
14 |
|
|
|
15 |
|
|
|
16 |
|
|
#ifndef _REF_SHAPE_HPP_ |
17 |
|
|
#define _REF_SHAPE_HPP_ |
18 |
|
|
|
19 |
|
|
// System includes |
20 |
|
|
|
21 |
|
|
// External includes |
22 |
|
|
|
23 |
|
|
// Project includes |
24 |
|
|
#include "Core/felisce.hpp" |
25 |
|
|
|
26 |
|
|
namespace felisce |
27 |
|
|
{ |
28 |
|
|
/*! |
29 |
|
|
\class RefShape |
30 |
|
|
\brief The class implementing a reference shape |
31 |
|
|
\authors J-F. Gerbeau |
32 |
|
|
*/ |
33 |
|
|
|
34 |
|
|
/// All available shapes |
35 |
|
|
enum TypeShape {NullShape,Node,Segment,Triangle,Quadrilateral,Tetrahedron,Hexahedron,Prism,Pyramid}; |
36 |
|
|
|
37 |
|
|
class RefShape { |
38 |
|
|
/// A std::string with the name: i.e. the typeShape (all uppercase) |
39 |
|
|
const std::string m_name; |
40 |
|
|
/// The dimension of the reference element: 0 for NullShape, 1 for Node and Segment, 2: for Tria and Quad, 3 for Tetra, Hexa, Prism and Pyramid |
41 |
|
|
const int m_numCoor; |
42 |
|
|
/// The number of vertices of the element |
43 |
|
|
const int m_numVertex; |
44 |
|
|
/// The number of edges of the element, including the element itself : i.e. for the Segment is equal to 1 |
45 |
|
|
const int m_numEdge; |
46 |
|
|
/// The number of faces of the element, including the element itself : i.e. for Tria and Quad is equal to 1 |
47 |
|
|
const int m_numFace; |
48 |
|
|
/// The shape of the element (same as name, but it is an enum) |
49 |
|
|
const TypeShape m_typeShape; |
50 |
|
|
|
51 |
|
|
public: |
52 |
|
|
/// This is a do-nothing constructor that simply assign the values |
53 |
|
|
RefShape(std::string name,int numCoor,int numVertex,int numEdge,int numFace,TypeShape typeShape); |
54 |
|
|
|
55 |
|
|
/// Getters for the private members |
56 |
|
20304 |
inline std::string name() const { |
57 |
|
20304 |
return m_name; |
58 |
|
|
} |
59 |
|
13536 |
inline int numCoor() const { |
60 |
|
13536 |
return m_numCoor; |
61 |
|
|
} |
62 |
|
14636 |
inline int numVertex() const { |
63 |
|
14636 |
return m_numVertex; |
64 |
|
|
} |
65 |
|
3414101 |
inline int numEdge() const { |
66 |
|
3414101 |
return m_numEdge; |
67 |
|
|
} |
68 |
|
13736 |
inline int numFace() const { |
69 |
|
13736 |
return m_numFace; |
70 |
|
|
} |
71 |
|
206171 |
inline int typeShape() const { |
72 |
|
206171 |
return m_typeShape; |
73 |
|
|
} |
74 |
|
|
// Print function (if verbose>0) |
75 |
|
|
void print(int verbose, std::ostream& c = std::cout) const; |
76 |
|
|
}; |
77 |
|
|
|
78 |
|
|
//================================================================================= |
79 |
|
|
// Extern keyword means that they are defined somewhere else. |
80 |
|
|
// In fact they are defined in definitionGlobalVariables.cpp |
81 |
|
|
extern const RefShape NULLSHAPE; |
82 |
|
|
extern const RefShape NODE; |
83 |
|
|
extern const RefShape SEGMENT; |
84 |
|
|
extern const RefShape TRIANGLE; |
85 |
|
|
extern const RefShape QUADRILATERAL; |
86 |
|
|
extern const RefShape TETRAHEDRON; |
87 |
|
|
extern const RefShape HEXAHEDRON; |
88 |
|
|
extern const RefShape PRISM; |
89 |
|
|
extern const RefShape PYRAMID; |
90 |
|
|
} |
91 |
|
|
#endif |
92 |
|
|
|