47 {4, 5, 6, 7}, {1, 3, 6, 7}, {0, 2, 4, 7}, {1, 3, 4, 5}, {0, 2, 5, 6}};
61 :
Geometry3D(faces[0]->GetEdge(0)->GetVertex(0)->GetCoordim())
67 for (
int i = 0; i <
kNfaces; i++)
89 if (
m_xmap->GetBasisNumModes(0) != 2 ||
m_xmap->GetBasisNumModes(1) != 2 ||
90 m_xmap->GetBasisNumModes(2) != 2)
99 for (
int i = 0; i < 3; ++i)
147 else if (faceidx == 1 || faceidx == 3)
170 for (f = 1; f < 5; f++)
172 int nEdges =
m_faces[f]->GetNumEdges();
174 for (i = 0; i < 4; i++)
176 for (j = 0; j < nEdges; j++)
189 std::ostringstream errstrm;
190 errstrm <<
"Connected faces do not share an edge. Faces ";
197 std::ostringstream errstrm;
198 errstrm <<
"Connected faces share more than one edge. Faces ";
207 for (i = 0; i < 3; i++)
209 for (j = 0; j < 3; j++)
220 std::ostringstream errstrm;
221 errstrm <<
"Connected faces do not share an edge. Faces ";
228 std::ostringstream errstrm;
229 errstrm <<
"Connected faces share more than one edge. Faces ";
236 for (f = 1; f < 4; f++)
239 for (i = 0; i <
m_faces[f]->GetNumEdges(); i++)
241 for (j = 0; j <
m_faces[f + 1]->GetNumEdges(); j++)
254 std::ostringstream errstrm;
255 errstrm <<
"Connected faces do not share an edge. Faces ";
262 std::ostringstream errstrm;
263 errstrm <<
"Connected faces share more than one edge. Faces ";
288 std::ostringstream errstrm;
289 errstrm <<
"Connected edges do not share a vertex. Edges ";
290 errstrm <<
m_edges[0]->GetGlobalID() <<
", "
296 for (
int i = 1; i < 3; i++)
308 std::ostringstream errstrm;
309 errstrm <<
"Connected edges do not share a vertex. Edges ";
310 errstrm <<
m_edges[i]->GetGlobalID() <<
", "
311 <<
m_edges[i - 1]->GetGlobalID();
327 for (
int i = 5; i < 8; ++i)
339 std::ostringstream errstrm;
340 errstrm <<
"Connected edges do not share a vertex. Edges ";
341 errstrm <<
m_edges[3]->GetGlobalID() <<
", "
352 const unsigned int edgeVerts[
kNedges][2] = {{0, 1}, {1, 2}, {3, 2}, {0, 3},
353 {0, 4}, {1, 4}, {2, 4}, {3, 4}};
370 "Could not find matching vertex for the edge");
396 unsigned int baseVertex;
407 const unsigned int faceVerts[
kNfaces][4] = {
417 unsigned int orientation;
423 elementAaxis_length = 0.0;
424 elementBaxis_length = 0.0;
425 faceAaxis_length = 0.0;
426 faceBaxis_length = 0.0;
431 baseVertex =
m_faces[f]->GetVid(0);
448 elementAaxis[i] = (*
m_verts[faceVerts[f][1]])[i] -
449 (*
m_verts[faceVerts[f][0]])[i];
450 elementBaxis[i] = (*
m_verts[faceVerts[f][2]])[i] -
451 (*
m_verts[faceVerts[f][0]])[i];
458 elementAaxis[i] = (*
m_verts[faceVerts[f][1]])[i] -
459 (*
m_verts[faceVerts[f][0]])[i];
460 elementBaxis[i] = (*
m_verts[faceVerts[f][2]])[i] -
461 (*
m_verts[faceVerts[f][1]])[i];
468 elementAaxis[i] = (*
m_verts[faceVerts[f][1]])[i] -
469 (*
m_verts[faceVerts[f][2]])[i];
470 elementBaxis[i] = (*
m_verts[faceVerts[f][2]])[i] -
471 (*
m_verts[faceVerts[f][0]])[i];
477 "Could not find matching vertex for the face");
486 elementAaxis[i] = (*
m_verts[faceVerts[f][1]])[i] -
487 (*
m_verts[faceVerts[f][0]])[i];
488 elementBaxis[i] = (*
m_verts[faceVerts[f][3]])[i] -
489 (*
m_verts[faceVerts[f][0]])[i];
496 elementAaxis[i] = (*
m_verts[faceVerts[f][1]])[i] -
497 (*
m_verts[faceVerts[f][0]])[i];
498 elementBaxis[i] = (*
m_verts[faceVerts[f][2]])[i] -
499 (*
m_verts[faceVerts[f][1]])[i];
506 elementAaxis[i] = (*
m_verts[faceVerts[f][2]])[i] -
507 (*
m_verts[faceVerts[f][3]])[i];
508 elementBaxis[i] = (*
m_verts[faceVerts[f][2]])[i] -
509 (*
m_verts[faceVerts[f][1]])[i];
516 elementAaxis[i] = (*
m_verts[faceVerts[f][2]])[i] -
517 (*
m_verts[faceVerts[f][3]])[i];
518 elementBaxis[i] = (*
m_verts[faceVerts[f][3]])[i] -
519 (*
m_verts[faceVerts[f][0]])[i];
525 "Could not find matching vertex for the face");
533 int v =
m_faces[f]->GetNumVerts() - 1;
539 elementAaxis_length += pow(elementAaxis[i], 2);
540 elementBaxis_length += pow(elementBaxis[i], 2);
541 faceAaxis_length += pow(faceAaxis[i], 2);
542 faceBaxis_length += pow(faceBaxis[i], 2);
545 elementAaxis_length =
sqrt(elementAaxis_length);
546 elementBaxis_length =
sqrt(elementBaxis_length);
547 faceAaxis_length =
sqrt(faceAaxis_length);
548 faceBaxis_length =
sqrt(faceBaxis_length);
554 dotproduct1 += elementAaxis[i] * faceAaxis[i];
558 fabs(dotproduct1) / elementAaxis_length / faceAaxis_length;
568 if (dotproduct1 < 0.0)
576 dotproduct2 += elementBaxis[i] * faceBaxis[i];
579 norm = fabs(dotproduct2) / elementBaxis_length / faceBaxis_length;
585 "These vectors should be parallel");
590 if (dotproduct2 < 0.0)
605 dotproduct1 += elementAaxis[i] * faceBaxis[i];
608 norm = fabs(dotproduct1) / elementAaxis_length / faceBaxis_length;
612 "These vectors should be parallel");
617 if (dotproduct1 < 0.0)
626 dotproduct2 += elementBaxis[i] * faceAaxis[i];
629 norm = fabs(dotproduct2) / elementBaxis_length / faceAaxis_length;
635 "These vectors should be parallel");
638 if (dotproduct2 < 0.0)
644 orientation = orientation + 5;
650 "Orientation of triangular face (id = " +
652 ") is inconsistent with face " + std::to_string(f) +
653 " of pyramid element (id = " + std::to_string(
m_globalID) +
654 ") since Dir2 is aligned with Dir1. Mesh setup "
655 "needs investigation");
667 for (
int i = 0; i < 5; ++i)
669 m_faces[i]->Reset(curvedEdges, curvedFaces);
680 for (
int i = 0; i < 5; ++i)
689 if (
m_xmap->GetBasisNumModes(0) != 2 ||
690 m_xmap->GetBasisNumModes(1) != 2 ||
691 m_xmap->GetBasisNumModes(2) != 2)
706 std::vector<int> tmp;
713 order0 = *max_element(tmp.begin(), tmp.end());
719 order0 = *max_element(tmp.begin(), tmp.end());
728 order1 = *max_element(tmp.begin(), tmp.end());
736 order1 = *max_element(tmp.begin(), tmp.end());
740 tmp.push_back(order0);
741 tmp.push_back(order1);
746 int order2 = *max_element(tmp.begin(), tmp.end());
748 std::array<LibUtilities::BasisKey, 3> basis = {
760 LibUtilities::eGaussRadauMAlpha2Beta0))};
786 int nFaceCoeffs =
m_faces[i]->GetXmap()->GetNcoeffs();
793 m_xmap->GetTraceToElementMap(
800 m_xmap->GetTraceToElementMap(
811 for (k = 0; k < nFaceCoeffs; k++)
#define ASSERTL0(condition, msg)
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Describes the specification for a Basis.
Defines a specification for a set of points.
static std::unique_ptr< DataType, UniquePtrDeleter > AllocateUniquePtr(const Args &...args)
void v_CalculateInverseIsoParam() override
bool m_setupState
Wether or not the setup routines have been run.
GeomState m_state
Enumeration to dictate whether coefficients are filled.
void SetUpCoeffs(const int nCoeffs)
Initialise the Geometry::m_coeffs array.
int GetVid(int i) const
Returns global id of vertex i of this object.
Array< OneD, Array< OneD, NekDouble > > m_isoParameter
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.
PointGeom * GetVertex(int i) const
Returns vertex i of this object.
std::vector< Array< OneD, NekDouble > > m_coeffs
Array containing expansion coefficients of m_xmap.
LibUtilities::ShapeType m_shapeType
Type of shape.
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...
Geometry1D * GetEdge(int i) const
Returns edge i of this object.
int m_coordim
Coordinate dimension of this geometry object.
int GetEid(int i) const
Get the ID of edge i of this object.
std::array< Geometry2D *, kNfaces > m_faces
std::array< SegGeom *, kNedges > m_edges
std::array< StdRegions::Orientation, kNfaces > m_forient
GeomFactorsUniquePtr v_GenGeomFactors(LibUtilities::PointsKeyVector &keyTgt) override
Used by Expansion to generate associated GeomFactors.
void SetUpFaceOrientation()
int v_GetDir(const int faceidx, const int facedir) const override
Returns the element coordinate direction corresponding to a given face coordinate direction.
std::array< StdRegions::Orientation, kNedges > m_eorient
void SetUpEdgeOrientation()
void SetUpLocalVertices()
void SetUpXmap()
Set up the m_xmap object by determining the order of each direction from derived faces.
void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces) override
Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated Geo...
static const int kNtfaces
static const int kNqfaces
static const unsigned int EdgeNormalToFaceVert[5][4]
GeomType v_CalcGeomType() override
void v_FillGeom() override
Put all quadrature information into face/edge structure and backward transform.
std::array< PointGeom *, kNverts > m_verts
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.
A simple factory for Xmap objects that is based on the element type, the basis and quadrature selecti...
std::vector< PointsKey > PointsKeyVector
@ eGaussLobattoLegendre
1D Gauss-Lobatto-Legendre quadrature points
@ eModifiedPyr_C
Principle Modified Functions.
@ eModified_A
Principle Modified Functions .
static const NekDouble kNekZeroTol
unique_ptr_objpool< GeomFactors > GeomFactorsUniquePtr
XmapFactory< StdRegions::StdPyrExp, 3 > & GetStdPyrFactory()
std::map< int, CurveUniquePtr > 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.
@ ePtsFilled
Geometric information has been generated.
@ eDir1FwdDir2_Dir2FwdDir1
scalarT< T > sqrt(scalarT< T > in)