46 namespace SpatialDomains
49 const unsigned int HexGeom::VertexEdgeConnectivity[8][3] = {
50 {0, 3, 4}, {0, 1, 5}, {1, 2, 6}, {2, 3, 7},
51 {4, 8, 11}, {5, 8, 9}, {6, 9, 10}, {7, 10, 11}};
52 const unsigned int HexGeom::VertexFaceConnectivity[8][3] = {
53 {0, 1, 4}, {0, 1, 2}, {0, 2, 3}, {0, 3, 4},
54 {1, 4, 5}, {1, 2, 5}, {2, 3, 5}, {3, 4, 5}};
55 const unsigned int HexGeom::EdgeFaceConnectivity[12][2] = {
56 {0, 1}, {0, 2}, {0, 3}, {0, 4}, {1, 4}, {1, 2},
57 {2, 3}, {3, 4}, {1, 5}, {2, 5}, {3, 5}, {4, 5}};
58 const unsigned int HexGeom::EdgeNormalToFaceVert[6][4] = {
59 {4, 5, 6, 7}, {1, 3, 9, 11}, {0, 2, 8, 10},
60 {1, 3, 9, 11}, {0, 2, 8, 10}, {4, 5, 6, 7}};
68 :
Geometry3D(faces[0]->GetEdge(0)->GetVertex(0)->GetCoordim())
107 if (
m_xmap->GetBasisNumModes(0) != 2 ||
108 m_xmap->GetBasisNumModes(1) != 2 ||
109 m_xmap->GetBasisNumModes(2) != 2)
119 {0, 1, 2, 3}, {0, 1, 5, 4}, {1, 2, 6, 5},
120 {3, 2, 6, 7}, {0, 3, 7, 4}, {4, 5, 6, 7}};
127 if (fabs((*
m_verts[faceVerts[f][0]])(i) -
128 (*
m_verts[faceVerts[f][1]])(i) +
129 (*
m_verts[faceVerts[f][2]])(i) -
130 (*
m_verts[faceVerts[f][3]])(i)) >
173 if (faceidx == 0 || faceidx == 5)
177 else if (faceidx == 1 || faceidx == 3)
197 for (f = 1; f < 5; f++)
200 for (i = 0; i < 4; i++)
202 for (j = 0; j < 4; j++)
206 edge = std::dynamic_pointer_cast<SegGeom>(
216 std::ostringstream errstrm;
217 errstrm <<
"Connected faces do not share an edge. Faces ";
224 std::ostringstream errstrm;
225 errstrm <<
"Connected faces share more than one edge. Faces ";
234 for (i = 0; i < 4; i++)
236 for (j = 0; j < 4; j++)
240 edge = std::dynamic_pointer_cast<SegGeom>(
249 std::ostringstream errstrm;
250 errstrm <<
"Connected faces do not share an edge. Faces ";
257 std::ostringstream errstrm;
258 errstrm <<
"Connected faces share more than one edge. Faces ";
263 for (f = 1; f < 4; f++)
266 for (i = 0; i < 4; i++)
268 for (j = 0; j < 4; j++)
272 edge = std::dynamic_pointer_cast<SegGeom>(
282 std::ostringstream errstrm;
283 errstrm <<
"Connected faces do not share an edge. Faces ";
290 std::ostringstream errstrm;
291 errstrm <<
"Connected faces share more than one edge. Faces ";
299 for (f = 1; f < 5; f++)
302 for (i = 0; i < 4; i++)
304 for (j = 0; j < 4; j++)
308 edge = std::dynamic_pointer_cast<SegGeom>(
318 std::ostringstream errstrm;
319 errstrm <<
"Connected faces do not share an edge. Faces ";
326 std::ostringstream errstrm;
327 errstrm <<
"Connected faces share more than one edge. Faces ";
352 std::ostringstream errstrm;
353 errstrm <<
"Connected edges do not share a vertex. Edges ";
354 errstrm <<
m_edges[0]->GetGlobalID() <<
", "
361 for (i = 1; i < 3; i++)
373 std::ostringstream errstrm;
374 errstrm <<
"Connected edges do not share a vertex. Edges ";
375 errstrm <<
m_edges[i]->GetGlobalID() <<
", "
376 <<
m_edges[i - 1]->GetGlobalID();
397 std::ostringstream errstrm;
398 errstrm <<
"Connected edges do not share a vertex. Edges ";
399 errstrm <<
m_edges[8]->GetGlobalID() <<
", "
405 for (i = 9; i < 11; i++)
417 std::ostringstream errstrm;
418 errstrm <<
"Connected edges do not share a vertex. Edges ";
419 errstrm <<
m_edges[i]->GetGlobalID() <<
", "
420 <<
m_edges[i - 1]->GetGlobalID();
449 unsigned int baseVertex;
462 {0, 1, 2, 3}, {0, 1, 5, 4}, {1, 2, 6, 5},
463 {3, 2, 6, 7}, {0, 3, 7, 4}, {4, 5, 6, 7}};
468 unsigned int orientation;
474 elementAaxis_length = 0.0;
475 elementBaxis_length = 0.0;
476 faceAaxis_length = 0.0;
477 faceBaxis_length = 0.0;
482 baseVertex =
m_faces[f]->GetVid(0);
498 elementAaxis[i] = (*
m_verts[faceVerts[f][1]])[i] -
499 (*
m_verts[faceVerts[f][0]])[i];
500 elementBaxis[i] = (*
m_verts[faceVerts[f][3]])[i] -
501 (*
m_verts[faceVerts[f][0]])[i];
508 elementAaxis[i] = (*
m_verts[faceVerts[f][1]])[i] -
509 (*
m_verts[faceVerts[f][0]])[i];
510 elementBaxis[i] = (*
m_verts[faceVerts[f][2]])[i] -
511 (*
m_verts[faceVerts[f][1]])[i];
518 elementAaxis[i] = (*
m_verts[faceVerts[f][2]])[i] -
519 (*
m_verts[faceVerts[f][3]])[i];
520 elementBaxis[i] = (*
m_verts[faceVerts[f][2]])[i] -
521 (*
m_verts[faceVerts[f][1]])[i];
528 elementAaxis[i] = (*
m_verts[faceVerts[f][2]])[i] -
529 (*
m_verts[faceVerts[f][3]])[i];
530 elementBaxis[i] = (*
m_verts[faceVerts[f][3]])[i] -
531 (*
m_verts[faceVerts[f][0]])[i];
536 ASSERTL0(
false,
"Could not find matching vertex for the face");
548 elementAaxis_length += pow(elementAaxis[i], 2);
549 elementBaxis_length += pow(elementBaxis[i], 2);
550 faceAaxis_length += pow(faceAaxis[i], 2);
551 faceBaxis_length += pow(faceBaxis[i], 2);
554 elementAaxis_length =
sqrt(elementAaxis_length);
555 elementBaxis_length =
sqrt(elementBaxis_length);
556 faceAaxis_length =
sqrt(faceAaxis_length);
557 faceBaxis_length =
sqrt(faceBaxis_length);
563 dotproduct1 += elementAaxis[i] * faceAaxis[i];
567 fabs(dotproduct1) / elementAaxis_length / faceAaxis_length;
577 if (dotproduct1 < 0.0)
585 dotproduct2 += elementBaxis[i] * faceBaxis[i];
588 norm = fabs(dotproduct2) / elementBaxis_length / faceBaxis_length;
592 "These vectors should be parallel");
596 if (dotproduct2 < 0.0)
611 dotproduct1 += elementAaxis[i] * faceBaxis[i];
614 norm = fabs(dotproduct1) / elementAaxis_length / faceBaxis_length;
618 "These vectors should be parallel");
622 if (dotproduct1 < 0.0)
631 dotproduct2 += elementBaxis[i] * faceAaxis[i];
634 norm = fabs(dotproduct2) / elementBaxis_length / faceAaxis_length;
638 "These vectors should be parallel");
640 if (dotproduct2 < 0.0)
646 orientation = orientation + 5;
658 const unsigned int edgeVerts[
kNedges][2] = {{0, 1}, {1, 2}, {2, 3}, {3, 0},
659 {0, 4}, {1, 5}, {2, 6}, {3, 7},
660 {4, 5}, {5, 6}, {6, 7}, {7, 4}};
676 ASSERTL0(
false,
"Could not find matching vertex for the edge");
685 for (
int i = 0; i < 6; ++i)
687 m_faces[i]->Reset(curvedEdges, curvedFaces);
698 for (
int i = 0; i < 6; ++i)
740 int order0 = *max_element(tmp1.begin(), tmp1.end());
766 int order1 = *max_element(tmp1.begin(), tmp1.end());
792 int order2 = *max_element(tmp1.begin(), tmp1.end());
#define ASSERTL0(condition, msg)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Describes the specification for a Basis.
Defines a specification for a set of points.
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::vector< StdRegions::Orientation > m_forient
virtual void v_FillGeom() override
Put all quadrature information into face/edge structure and backward transform.
std::vector< StdRegions::Orientation > m_eorient
bool m_setupState
Wether or not the setup routines have been run.
PointGeomSharedPtr GetVertex(int i) const
Returns vertex i of this object.
void SetUpCoeffs(const int nCoeffs)
Initialise the Geometry::m_coeffs array.
Geometry1DSharedPtr GetEdge(int i) const
Returns edge i of this object.
int GetVid(int i) const
Get the ID of vertex i of this object.
virtual void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces)
Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated Geo...
int GetGlobalID(void) const
Get the ID of this object.
LibUtilities::ShapeType m_shapeType
Type of shape.
Array< OneD, Array< OneD, NekDouble > > m_coeffs
Array containing expansion coefficients of m_xmap.
GeomState m_geomFactorsState
State of the geometric factors.
StdRegions::StdExpansionSharedPtr m_xmap
mapping containing isoparametric transformation.
StdRegions::StdExpansionSharedPtr GetXmap() const
Return the mapping object Geometry::m_xmap that represents the coordinate transformation from standar...
GeomFactorsSharedPtr m_geomFactors
Geometric factors.
int m_coordim
Coordinate dimension of this geometry object.
int GetEid(int i) const
Get the ID of edge i of this object.
virtual int v_GetDir(const int faceidx, const int facedir) const override
Returns the element coordinate direction corresponding to a given face coordinate direction.
static const unsigned int EdgeFaceConnectivity[12][2]
void SetUpFaceOrientation()
static const unsigned int VertexEdgeConnectivity[8][3]
static const unsigned int VertexFaceConnectivity[8][3]
virtual void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces) override
Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated Geo...
void SetUpEdgeOrientation()
void SetUpLocalVertices()
virtual void v_GenGeomFactors() override
virtual 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.
virtual int v_GetEdgeFaceMap(const int i, const int j) const override
Returns the standard element edge IDs that are connected to a given face.
static const int kNqfaces
virtual void v_Setup() override
virtual int v_GetVertexEdgeMap(const int i, const int j) const override
Returns the standard element edge IDs that are connected to a given vertex.
static const unsigned int EdgeNormalToFaceVert[6][4]
virtual int v_GetVertexFaceMap(const int i, const int j) const override
Returns the standard element face IDs that are connected to a given vertex.
void SetUpXmap()
Set up the m_xmap object by determining the order of each direction from derived faces.
static const int kNtfaces
@ eGaussLobattoLegendre
1D Gauss-Lobatto-Legendre quadrature points
@ eModified_A
Principle Modified Functions .
static const NekDouble kNekZeroTol
std::shared_ptr< QuadGeom > QuadGeomSharedPtr
std::unordered_map< int, CurveSharedPtr > CurveMap
GeomType
Indicates the type of element geometry.
@ eRegular
Geometry is straight-sided with constant geometric factors.
@ eDeformed
Geometry is curved or has non-constant factors.
std::shared_ptr< SegGeom > SegGeomSharedPtr
@ ePtsFilled
Geometric information has been generated.
The above copyright notice and this permission notice shall be included.
scalarT< T > sqrt(scalarT< T > in)