45 namespace SpatialDomains
47 const unsigned int TetGeom::VertexEdgeConnectivity[4][3] = {
48 {0, 2, 3}, {0, 1, 4}, {1, 2, 5}, {3, 4, 5}};
49 const unsigned int TetGeom::VertexFaceConnectivity[4][3] = {
50 {0, 1, 3}, {0, 1, 2}, {0, 2, 3}, {1, 2, 3}};
51 const unsigned int TetGeom::EdgeFaceConnectivity[6][2] = {
52 {0, 1}, {0, 2}, {0, 3}, {1, 3}, {1, 2}, {2, 3}};
60 :
Geometry3D(faces[0]->GetEdge(0)->GetVertex(0)->GetCoordim())
88 else if (faceidx == 1)
126 std::ostringstream errstrm;
127 errstrm <<
"Local edge 0 (eid=" <<
m_faces[0]->GetEid(0);
128 errstrm <<
") on face " <<
m_faces[0]->GetGlobalID();
129 errstrm <<
" must be the same as local edge 0 (eid="
131 errstrm <<
") on face " <<
m_faces[1]->GetGlobalID();
136 for (faceConnected = 1; faceConnected < 4; faceConnected++)
139 for (i = 0; i < 3; i++)
143 edge = dynamic_pointer_cast<SegGeom>(
152 std::ostringstream errstrm;
153 errstrm <<
"Face 0 does not share an edge with first edge of "
154 "adjacent face. Faces ";
161 std::ostringstream errstrm;
162 errstrm <<
"Connected faces share more than one edge. Faces ";
171 for (i = 0; i < 3; i++)
173 for (j = 0; j < 3; j++)
177 edge = dynamic_pointer_cast<SegGeom>(
186 std::ostringstream errstrm;
187 errstrm <<
"Connected faces do not share an edge. Faces ";
194 std::ostringstream errstrm;
195 errstrm <<
"Connected faces share more than one edge. Faces ";
201 for (faceConnected = 1; faceConnected < 3; faceConnected++)
204 for (i = 0; i < 3; i++)
206 for (j = 0; j < 3; j++)
211 edge = dynamic_pointer_cast<SegGeom>(
221 std::ostringstream errstrm;
222 errstrm <<
"Connected faces do not share an edge. Faces ";
229 std::ostringstream errstrm;
230 errstrm <<
"Connected faces share more than one edge. Faces ";
256 std::ostringstream errstrm;
257 errstrm <<
"Connected edges do not share a vertex. Edges ";
258 errstrm <<
m_edges[0]->GetGlobalID() <<
", "
264 for (
int i = 1; i < 2; i++)
276 std::ostringstream errstrm;
277 errstrm <<
"Connected edges do not share a vertex. Edges ";
278 errstrm <<
m_edges[i]->GetGlobalID() <<
", "
279 <<
m_edges[i - 1]->GetGlobalID();
296 for (
int i = 4; i < 6; ++i)
308 std::ostringstream errstrm;
309 errstrm <<
"Connected edges do not share a vertex. Edges ";
310 errstrm <<
m_edges[3]->GetGlobalID() <<
", "
322 const unsigned int edgeVerts[
kNedges][2] = {
323 {0, 1}, {1, 2}, {0, 2}, {0, 3}, {1, 3}, {2, 3}};
338 ASSERTL0(
false,
"Could not find matching vertex for the edge");
367 unsigned int baseVertex;
380 {0, 1, 2}, {0, 1, 3}, {1, 2, 3}, {0, 2, 3}};
385 unsigned int orientation;
391 elementAaxis_length = 0.0;
392 elementBaxis_length = 0.0;
393 faceAaxis_length = 0.0;
394 faceBaxis_length = 0.0;
399 baseVertex =
m_faces[f]->GetVid(0);
417 elementAaxis[i] = (*
m_verts[faceVerts[f][1]])[i] -
418 (*
m_verts[faceVerts[f][0]])[i];
419 elementBaxis[i] = (*
m_verts[faceVerts[f][2]])[i] -
420 (*
m_verts[faceVerts[f][0]])[i];
427 elementAaxis[i] = (*
m_verts[faceVerts[f][1]])[i] -
428 (*
m_verts[faceVerts[f][0]])[i];
429 elementBaxis[i] = (*
m_verts[faceVerts[f][2]])[i] -
430 (*
m_verts[faceVerts[f][1]])[i];
437 elementAaxis[i] = (*
m_verts[faceVerts[f][1]])[i] -
438 (*
m_verts[faceVerts[f][2]])[i];
439 elementBaxis[i] = (*
m_verts[faceVerts[f][2]])[i] -
440 (*
m_verts[faceVerts[f][0]])[i];
445 ASSERTL0(
false,
"Could not find matching vertex for the face");
457 elementAaxis_length += pow(elementAaxis[i], 2);
458 elementBaxis_length += pow(elementBaxis[i], 2);
459 faceAaxis_length += pow(faceAaxis[i], 2);
460 faceBaxis_length += pow(faceBaxis[i], 2);
463 elementAaxis_length =
sqrt(elementAaxis_length);
464 elementBaxis_length =
sqrt(elementBaxis_length);
465 faceAaxis_length =
sqrt(faceAaxis_length);
466 faceBaxis_length =
sqrt(faceBaxis_length);
472 dotproduct1 += elementAaxis[i] * faceAaxis[i];
475 NekDouble norm = fabs(dotproduct1) / elementAaxis_length / faceAaxis_length;
485 if (dotproduct1 < 0.0)
493 dotproduct2 += elementBaxis[i] * faceBaxis[i];
496 norm = fabs(dotproduct2) / elementBaxis_length / faceBaxis_length;
500 "These vectors should be parallel");
504 if (dotproduct2 < 0.0)
519 dotproduct1 += elementAaxis[i] * faceBaxis[i];
522 norm = fabs(dotproduct1) / elementAaxis_length / faceBaxis_length;
526 "These vectors should be parallel");
530 if (dotproduct1 < 0.0)
539 dotproduct2 += elementBaxis[i] * faceAaxis[i];
542 norm = fabs(dotproduct2) / elementBaxis_length / faceAaxis_length;
546 "These vectors should be parallel");
548 if (dotproduct2 < 0.0)
554 orientation = orientation + 5;
557 "Orientation of triangular face (id = " +
559 ") is inconsistent with face "+
560 boost::lexical_cast<string>(f) +
561 " of tet element (id = "+
563 ") since Dir2 is aligned with Dir1. Mesh setup "
564 "needs investigation");
575 for (
int i = 0; i < 4; ++i)
577 m_faces[i]->Reset(curvedEdges, curvedFaces);
585 for (
int i = 0; i < 4; ++i)
614 if (
m_xmap->GetBasisNumModes(0) != 2 ||
615 m_xmap->GetBasisNumModes(1) != 2 ||
616 m_xmap->GetBasisNumModes(2) != 2)
636 int order0 = *max_element(tmp.begin(), tmp.end());
639 tmp.push_back(order0);
642 int order1 = *max_element(tmp.begin(), tmp.end());
645 tmp.push_back(order0);
646 tmp.push_back(order1);
650 int order2 = *max_element(tmp.begin(), tmp.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.
virtual void v_FillGeom()
Put all quadrature information into face/edge structure and backward transform.
std::vector< StdRegions::Orientation > m_forient
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 void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces)
Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated Geo...
static const unsigned int VertexEdgeConnectivity[4][3]
void SetUpFaceOrientation()
void SetUpEdgeOrientation()
void SetUpLocalVertices()
virtual void v_GenGeomFactors()
virtual int v_GetVertexEdgeMap(const int i, const int j) const
Returns the standard element edge IDs that are connected to a given vertex.
static const int kNqfaces
static const int kNtfaces
virtual int v_GetDir(const int faceidx, const int facedir) const
Returns the element coordinate direction corresponding to a given face coordinate direction.
void SetUpXmap()
Set up the m_xmap object by determining the order of each direction from derived faces.
virtual int v_GetVertexFaceMap(const int i, const int j) const
Returns the standard element face IDs that are connected to a given vertex.
static const unsigned int VertexFaceConnectivity[4][3]
virtual int v_GetEdgeFaceMap(const int i, const int j) const
Returns the standard element edge IDs that are connected to a given face.
static const unsigned int EdgeFaceConnectivity[6][2]
@ eGaussRadauMAlpha2Beta0
Gauss Radau pinned at x=-1, .
@ eGaussLobattoLegendre
1D Gauss-Lobatto-Legendre quadrature points
@ eGaussRadauMAlpha1Beta0
Gauss Radau pinned at x=-1, .
@ eModified_B
Principle Modified Functions .
@ eModified_C
Principle Modified Functions .
@ eModified_A
Principle Modified Functions .
static const NekDouble kNekZeroTol
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.
std::shared_ptr< TriGeom > TriGeomSharedPtr
@ eDir1FwdDir2_Dir2FwdDir1
The above copyright notice and this permission notice shall be included.
scalarT< T > sqrt(scalarT< T > in)