Nektar++
Loading...
Searching...
No Matches
TetGeom.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////////////
2//
3// File: TetGeom.h
4//
5// For more information, please see: http://www.nektar.info/
6//
7// The MIT License
8//
9// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10// Department of Aeronautics, Imperial College London (UK), and Scientific
11// Computing and Imaging Institute, University of Utah (USA).
12//
13// Permission is hereby granted, free of charge, to any person obtaining a
14// copy of this software and associated documentation files (the "Software"),
15// to deal in the Software without restriction, including without limitation
16// the rights to use, copy, modify, merge, publish, distribute, sublicense,
17// and/or sell copies of the Software, and to permit persons to whom the
18// Software is furnished to do so, subject to the following conditions:
19//
20// The above copyright notice and this permission notice shall be included
21// in all copies or substantial portions of the Software.
22//
23// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29// DEALINGS IN THE SOFTWARE.
30//
31// Description: Tetrahedral geometry information.
32//
33////////////////////////////////////////////////////////////////////////////////
34
35#ifndef NEKTAR_SPATIALDOMAINS_TETGEOM
36#define NEKTAR_SPATIALDOMAINS_TETGEOM
37
41
43{
44
45class TetGeom : public Geometry3D
46{
47public:
50
51 SPATIAL_DOMAINS_EXPORT static const int kNverts = 4;
52 SPATIAL_DOMAINS_EXPORT static const int kNedges = 6;
53 SPATIAL_DOMAINS_EXPORT static const int kNqfaces = 0;
54 SPATIAL_DOMAINS_EXPORT static const int kNtfaces = 4;
57 SPATIAL_DOMAINS_EXPORT static const std::string XMLElementType;
58
60 std::array<TriGeom *, kNfaces> faces);
61 SPATIAL_DOMAINS_EXPORT ~TetGeom() override = default;
62
63protected:
64 int v_GetVertexEdgeMap(const int i, const int j) const override;
65 int v_GetVertexFaceMap(const int i, const int j) const override;
66 int v_GetEdgeFaceMap(const int i, const int j) const override;
67 int v_GetEdgeNormalToFaceVert(const int i, const int j) const override;
68 int v_GetDir(const int faceidx, const int facedir) const override;
69 void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces) override;
70 void v_Setup() override;
71 GeomType v_CalcGeomType() override;
73 LibUtilities::PointsKeyVector &keyTgt) override;
74 void v_FillGeom() override;
75
76 inline int v_GetNumVerts() const final
77 {
78 return kNverts;
79 }
80
81 inline int v_GetNumEdges() const final
82 {
83 return kNedges;
84 }
85
86 inline int v_GetNumFaces() const final
87 {
88 return kNfaces;
89 }
90
91 inline PointGeom *v_GetVertex(const int i) const final
92 {
93 return m_verts[i];
94 }
95
96 inline Geometry1D *v_GetEdge(const int i) const final
97 {
98 return static_cast<Geometry1D *>(m_edges[i]);
99 }
100
101 inline Geometry2D *v_GetFace(const int i) const final
102 {
103 return static_cast<Geometry2D *>(m_faces[i]);
104 }
105
106 inline StdRegions::Orientation v_GetEorient(const int i) const final
107 {
108 return m_eorient[i];
109 }
110
111 inline StdRegions::Orientation v_GetForient(const int i) const final
112 {
113 return m_forient[i];
114 }
115
116 std::array<PointGeom *, kNverts> m_verts;
117 std::array<SegGeom *, kNedges> m_edges;
118 std::array<TriGeom *, kNfaces> m_faces;
119 std::array<StdRegions::Orientation, kNedges> m_eorient;
120 std::array<StdRegions::Orientation, kNfaces> m_forient;
121
122private:
123 void SetUpLocalEdges();
124 void SetUpLocalVertices();
127 void SetUpXmap();
128
129 static const unsigned int VertexEdgeConnectivity[4][3];
130 static const unsigned int VertexFaceConnectivity[4][3];
131 static const unsigned int EdgeFaceConnectivity[6][2];
132 static const unsigned int EdgeNormalToFaceVert[4][3];
133};
134
135} // namespace Nektar::SpatialDomains
136
137#endif // NEKTAR_SPATIALDOMAINS_TETGEOM
#define SPATIAL_DOMAINS_EXPORT
1D geometry information
Definition Geometry1D.h:49
2D geometry information
Definition Geometry2D.h:50
3D geometry information
Definition Geometry3D.h:50
std::array< SegGeom *, kNedges > m_edges
Definition TetGeom.h:117
TetGeom(int id, TriGeom *faces[])
int v_GetEdgeFaceMap(const int i, const int j) const override
Returns the standard element edge IDs that are connected to a given face.
Definition TetGeom.cpp:103
std::array< StdRegions::Orientation, kNfaces > m_forient
Definition TetGeom.h:120
GeomFactorsUniquePtr v_GenGeomFactors(LibUtilities::PointsKeyVector &keyTgt) override
Used by Expansion to generate associated GeomFactors.
Definition TetGeom.cpp:654
static const int kNverts
Definition TetGeom.h:51
int v_GetVertexFaceMap(const int i, const int j) const override
Returns the standard element face IDs that are connected to a given vertex.
Definition TetGeom.cpp:98
void v_FillGeom() override
Put all quadrature information into face/edge structure and backward transform.
Definition TetGeom.cpp:712
int v_GetVertexEdgeMap(const int i, const int j) const override
Returns the standard element edge IDs that are connected to a given vertex.
Definition TetGeom.cpp:93
static const unsigned int VertexEdgeConnectivity[4][3]
Definition TetGeom.h:129
static const unsigned int EdgeNormalToFaceVert[4][3]
Definition TetGeom.h:132
int v_GetEdgeNormalToFaceVert(const int i, const int j) const override
Returns the standard lement edge IDs that are normal to a given face vertex.
Definition TetGeom.cpp:108
std::array< TriGeom *, kNfaces > m_faces
Definition TetGeom.h:118
static const int kNfaces
Definition TetGeom.h:55
int v_GetNumEdges() const final
Get the number of edges of this object.
Definition TetGeom.h:81
static const int kNfacets
Definition TetGeom.h:56
int v_GetNumVerts() const final
Get the number of vertices of this object.
Definition TetGeom.h:76
GeomType v_CalcGeomType() override
Definition TetGeom.cpp:611
Geometry2D * v_GetFace(const int i) const final
Returns face i of this object.
Definition TetGeom.h:101
StdRegions::Orientation v_GetEorient(const int i) const final
Returns the orientation of edge i with respect to the ordering of edges in the standard element.
Definition TetGeom.h:106
void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces) override
Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated Geo...
Definition TetGeom.cpp:574
static const int kNqfaces
Definition TetGeom.h:53
static const int kNtfaces
Definition TetGeom.h:54
void SetUpXmap()
Set up the m_xmap object by determining the order of each direction from derived faces.
Definition TetGeom.cpp:667
static const int kNedges
Definition TetGeom.h:52
StdRegions::Orientation v_GetForient(const int i) const final
Returns the orientation of face i with respect to the ordering of faces in the standard element.
Definition TetGeom.h:111
int v_GetNumFaces() const final
Get the number of faces of this object.
Definition TetGeom.h:86
Geometry1D * v_GetEdge(const int i) const final
Returns edge i of this object.
Definition TetGeom.h:96
std::array< PointGeom *, kNverts > m_verts
Definition TetGeom.h:116
static const std::string XMLElementType
Definition TetGeom.h:57
int v_GetDir(const int faceidx, const int facedir) const override
Returns the element coordinate direction corresponding to a given face coordinate direction.
Definition TetGeom.cpp:77
static const unsigned int VertexFaceConnectivity[4][3]
Definition TetGeom.h:130
PointGeom * v_GetVertex(const int i) const final
Returns vertex i of this object.
Definition TetGeom.h:91
static const unsigned int EdgeFaceConnectivity[6][2]
Definition TetGeom.h:131
std::array< StdRegions::Orientation, kNedges > m_eorient
Definition TetGeom.h:119
std::vector< PointsKey > PointsKeyVector
Definition Points.h:313
unique_ptr_objpool< GeomFactors > GeomFactorsUniquePtr
Definition Geometry.h:62
std::map< int, CurveUniquePtr > CurveMap
Definition Geometry.h:71
GeomType
Indicates the type of element geometry.