Nektar++
Loading...
Searching...
No Matches
HexGeom.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////////////
2//
3// File: HexGeom.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: Hexahedral geometry information.
32//
33////////////////////////////////////////////////////////////////////////////////
34
35#ifndef NEKTAR_SPATIALDOMAINS_HEXGEOM_H
36#define NEKTAR_SPATIALDOMAINS_HEXGEOM_H
37
41
43{
44
45class HexGeom : public Geometry3D
46{
47public:
48 SPATIAL_DOMAINS_EXPORT static const int kNverts = 8;
49 SPATIAL_DOMAINS_EXPORT static const int kNedges = 12;
50 SPATIAL_DOMAINS_EXPORT static const int kNqfaces = 6;
51 SPATIAL_DOMAINS_EXPORT static const int kNtfaces = 0;
54 SPATIAL_DOMAINS_EXPORT static const std::string XMLElementType;
55
58 std::array<QuadGeom *, kNfaces> faces);
59 SPATIAL_DOMAINS_EXPORT ~HexGeom() override = default;
60
61protected:
62 void v_GenGeomFactors() override;
63 int v_GetVertexEdgeMap(const int i, const int j) const override;
64 int v_GetVertexFaceMap(const int i, const int j) const override;
65 int v_GetEdgeFaceMap(const int i, const int j) const override;
66 int v_GetEdgeNormalToFaceVert(const int i, const int j) const override;
67 int v_GetDir(const int faceidx, const int facedir) const override;
68 void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces) override;
69 void v_Setup() override;
70 void v_FillGeom() override;
71
72 inline int v_GetNumVerts() const final
73 {
74 return kNverts;
75 }
76
77 inline int v_GetNumEdges() const final
78 {
79 return kNedges;
80 }
81
82 inline int v_GetNumFaces() const final
83 {
84 return kNfaces;
85 }
86
87 inline PointGeom *v_GetVertex(const int i) const final
88 {
89 return m_verts[i];
90 }
91
92 inline Geometry1D *v_GetEdge(const int i) const final
93 {
94 return static_cast<Geometry1D *>(m_edges[i]);
95 }
96
97 inline Geometry2D *v_GetFace(const int i) const final
98 {
99 return static_cast<Geometry2D *>(m_faces[i]);
100 }
101
102 inline StdRegions::Orientation v_GetEorient(const int i) const final
103 {
104 return m_eorient[i];
105 }
106
107 inline StdRegions::Orientation v_GetForient(const int i) const final
108 {
109 return m_forient[i];
110 }
111
112 std::array<PointGeom *, kNverts> m_verts;
113 std::array<SegGeom *, kNedges> m_edges;
114 std::array<QuadGeom *, kNfaces> m_faces;
115 std::array<StdRegions::Orientation, kNedges> m_eorient;
116 std::array<StdRegions::Orientation, kNfaces> m_forient;
117
118private:
119 void SetUpLocalEdges();
120 void SetUpLocalVertices();
123 void SetUpXmap();
124
125 static const unsigned int VertexEdgeConnectivity[8][3];
126 static const unsigned int VertexFaceConnectivity[8][3];
127 static const unsigned int EdgeFaceConnectivity[12][2];
128 static const unsigned int EdgeNormalToFaceVert[6][4];
129};
130
131} // namespace Nektar::SpatialDomains
132
133#endif
#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
int v_GetNumEdges() const final
Get the number of edges of this object.
Definition HexGeom.h:77
int v_GetDir(const int faceidx, const int facedir) const override
Returns the element coordinate direction corresponding to a given face coordinate direction.
Definition HexGeom.cpp:185
static const unsigned int EdgeFaceConnectivity[12][2]
Definition HexGeom.h:127
std::array< QuadGeom *, kNfaces > m_faces
Definition HexGeom.h:114
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 HexGeom.h:107
static const int kNfaces
Definition HexGeom.h:52
std::array< StdRegions::Orientation, kNedges > m_eorient
Definition HexGeom.h:115
int v_GetNumVerts() const final
Get the number of vertices of this object.
Definition HexGeom.h:72
static const unsigned int VertexEdgeConnectivity[8][3]
Definition HexGeom.h:125
static const unsigned int VertexFaceConnectivity[8][3]
Definition HexGeom.h:126
void v_FillGeom() override
Put all quadrature information into face/edge structure and backward transform.
Definition HexGeom.cpp:826
static const int kNfacets
Definition HexGeom.h:53
PointGeom * v_GetVertex(const int i) const final
Returns vertex i of this object.
Definition HexGeom.h:87
static const std::string XMLElementType
Definition HexGeom.h:54
std::array< StdRegions::Orientation, kNfaces > m_forient
Definition HexGeom.h:116
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 HexGeom.cpp:688
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 HexGeom.h:102
std::array< SegGeom *, kNedges > m_edges
Definition HexGeom.h:113
int v_GetNumFaces() const final
Get the number of faces of this object.
Definition HexGeom.h:82
void v_GenGeomFactors() override
Definition HexGeom.cpp:83
std::array< PointGeom *, kNverts > m_verts
Definition HexGeom.h:112
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 HexGeom.cpp:180
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 HexGeom.cpp:175
static const int kNqfaces
Definition HexGeom.h:50
Geometry2D * v_GetFace(const int i) const final
Returns face i of this object.
Definition HexGeom.h:97
static const int kNedges
Definition HexGeom.h:49
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 HexGeom.cpp:165
static const unsigned int EdgeNormalToFaceVert[6][4]
Definition HexGeom.h:128
static const int kNverts
Definition HexGeom.h:48
Geometry1D * v_GetEdge(const int i) const final
Returns edge i of this object.
Definition HexGeom.h:92
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 HexGeom.cpp:170
void SetUpXmap()
Set up the m_xmap object by determining the order of each direction from derived faces.
Definition HexGeom.cpp:719
static const int kNtfaces
Definition HexGeom.h:51
std::unordered_map< int, CurveSharedPtr > CurveMap
Definition Curve.hpp:61