47namespace SpatialDomains
50 {4, 5, 6, 7}, {1, 3, 6, 7}, {0, 2, 4, 7}, {1, 3, 4, 5}, {0, 2, 5, 6}};
58 :
Geometry3D(faces[0]->GetEdge(0)->GetVertex(0)->GetCoordim())
95 if (
m_xmap->GetBasisNumModes(0) != 2 ||
96 m_xmap->GetBasisNumModes(1) != 2 ||
97 m_xmap->GetBasisNumModes(2) != 2)
107 for (
int i = 0; i < 3; ++i)
150 else if (faceidx == 1 || faceidx == 3)
175 for (f = 1; f < 5; f++)
177 int nEdges =
m_faces[f]->GetNumEdges();
179 for (i = 0; i < 4; i++)
181 for (j = 0; j < nEdges; j++)
195 std::ostringstream errstrm;
196 errstrm <<
"Connected faces do not share an edge. Faces ";
203 std::ostringstream errstrm;
204 errstrm <<
"Connected faces share more than one edge. Faces ";
213 for (i = 0; i < 3; i++)
215 for (j = 0; j < 3; j++)
227 std::ostringstream errstrm;
228 errstrm <<
"Connected faces do not share an edge. Faces ";
235 std::ostringstream errstrm;
236 errstrm <<
"Connected faces share more than one edge. Faces ";
243 for (f = 1; f < 4; f++)
246 for (i = 0; i <
m_faces[f]->GetNumEdges(); i++)
248 for (j = 0; j <
m_faces[f + 1]->GetNumEdges(); j++)
262 std::ostringstream errstrm;
263 errstrm <<
"Connected faces do not share an edge. Faces ";
270 std::ostringstream errstrm;
271 errstrm <<
"Connected faces share more than one edge. Faces ";
296 std::ostringstream errstrm;
297 errstrm <<
"Connected edges do not share a vertex. Edges ";
298 errstrm <<
m_edges[0]->GetGlobalID() <<
", "
304 for (
int i = 1; i < 3; i++)
316 std::ostringstream errstrm;
317 errstrm <<
"Connected edges do not share a vertex. Edges ";
318 errstrm <<
m_edges[i]->GetGlobalID() <<
", "
319 <<
m_edges[i - 1]->GetGlobalID();
335 for (
int i = 5; i < 8; ++i)
347 std::ostringstream errstrm;
348 errstrm <<
"Connected edges do not share a vertex. Edges ";
349 errstrm <<
m_edges[3]->GetGlobalID() <<
", "
360 const unsigned int edgeVerts[
kNedges][2] = {{0, 1}, {1, 2}, {3, 2}, {0, 3},
361 {0, 4}, {1, 4}, {2, 4}, {3, 4}};
377 ASSERTL0(
false,
"Could not find matching vertex for the edge");
403 unsigned int baseVertex;
414 const unsigned int faceVerts[
kNfaces][4] = {
424 unsigned int orientation;
430 elementAaxis_length = 0.0;
431 elementBaxis_length = 0.0;
432 faceAaxis_length = 0.0;
433 faceBaxis_length = 0.0;
438 baseVertex =
m_faces[f]->GetVid(0);
455 elementAaxis[i] = (*
m_verts[faceVerts[f][1]])[i] -
456 (*
m_verts[faceVerts[f][0]])[i];
457 elementBaxis[i] = (*
m_verts[faceVerts[f][2]])[i] -
458 (*
m_verts[faceVerts[f][0]])[i];
465 elementAaxis[i] = (*
m_verts[faceVerts[f][1]])[i] -
466 (*
m_verts[faceVerts[f][0]])[i];
467 elementBaxis[i] = (*
m_verts[faceVerts[f][2]])[i] -
468 (*
m_verts[faceVerts[f][1]])[i];
475 elementAaxis[i] = (*
m_verts[faceVerts[f][1]])[i] -
476 (*
m_verts[faceVerts[f][2]])[i];
477 elementBaxis[i] = (*
m_verts[faceVerts[f][2]])[i] -
478 (*
m_verts[faceVerts[f][0]])[i];
483 ASSERTL0(
false,
"Could not find matching vertex for the face");
492 elementAaxis[i] = (*
m_verts[faceVerts[f][1]])[i] -
493 (*
m_verts[faceVerts[f][0]])[i];
494 elementBaxis[i] = (*
m_verts[faceVerts[f][3]])[i] -
495 (*
m_verts[faceVerts[f][0]])[i];
502 elementAaxis[i] = (*
m_verts[faceVerts[f][1]])[i] -
503 (*
m_verts[faceVerts[f][0]])[i];
504 elementBaxis[i] = (*
m_verts[faceVerts[f][2]])[i] -
505 (*
m_verts[faceVerts[f][1]])[i];
512 elementAaxis[i] = (*
m_verts[faceVerts[f][2]])[i] -
513 (*
m_verts[faceVerts[f][3]])[i];
514 elementBaxis[i] = (*
m_verts[faceVerts[f][2]])[i] -
515 (*
m_verts[faceVerts[f][1]])[i];
522 elementAaxis[i] = (*
m_verts[faceVerts[f][2]])[i] -
523 (*
m_verts[faceVerts[f][3]])[i];
524 elementBaxis[i] = (*
m_verts[faceVerts[f][3]])[i] -
525 (*
m_verts[faceVerts[f][0]])[i];
530 ASSERTL0(
false,
"Could not find matching vertex for the face");
538 int v =
m_faces[f]->GetNumVerts() - 1;
544 elementAaxis_length += pow(elementAaxis[i], 2);
545 elementBaxis_length += pow(elementBaxis[i], 2);
546 faceAaxis_length += pow(faceAaxis[i], 2);
547 faceBaxis_length += pow(faceBaxis[i], 2);
550 elementAaxis_length =
sqrt(elementAaxis_length);
551 elementBaxis_length =
sqrt(elementBaxis_length);
552 faceAaxis_length =
sqrt(faceAaxis_length);
553 faceBaxis_length =
sqrt(faceBaxis_length);
559 dotproduct1 += elementAaxis[i] * faceAaxis[i];
563 fabs(dotproduct1) / elementAaxis_length / faceAaxis_length;
573 if (dotproduct1 < 0.0)
581 dotproduct2 += elementBaxis[i] * faceBaxis[i];
584 norm = fabs(dotproduct2) / elementBaxis_length / faceBaxis_length;
588 "These vectors should be parallel");
592 if (dotproduct2 < 0.0)
607 dotproduct1 += elementAaxis[i] * faceBaxis[i];
610 norm = fabs(dotproduct1) / elementAaxis_length / faceBaxis_length;
612 "These vectors should be parallel");
616 if (dotproduct1 < 0.0)
625 dotproduct2 += elementBaxis[i] * faceAaxis[i];
628 norm = fabs(dotproduct2) / elementBaxis_length / faceAaxis_length;
632 "These vectors should be parallel");
634 if (dotproduct2 < 0.0)
640 orientation = orientation + 5;
646 "Orientation of triangular face (id = " +
648 ") is inconsistent with face " +
649 boost::lexical_cast<string>(f) +
650 " of pyramid element (id = " +
652 ") since Dir2 is aligned with Dir1. Mesh setup "
653 "needs investigation");
665 for (
int i = 0; i < 5; ++i)
667 m_faces[i]->Reset(curvedEdges, curvedFaces);
678 for (
int i = 0; i < 5; ++i)
701 order0 = *max_element(tmp.begin(), tmp.end());
707 order0 = *max_element(tmp.begin(), tmp.end());
716 order1 = *max_element(tmp.begin(), tmp.end());
724 order1 = *max_element(tmp.begin(), tmp.end());
728 tmp.push_back(order0);
729 tmp.push_back(order1);
734 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.
std::vector< StdRegions::Orientation > m_forient
virtual void v_CalculateInverseIsoParam() override
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.
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.
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.
void SetUpFaceOrientation()
void SetUpEdgeOrientation()
void SetUpLocalVertices()
void SetUpXmap()
Set up the m_xmap object by determining the order of each direction from derived faces.
virtual int v_GetDir(const int faceidx, const int facedir) const
Returns the element coordinate direction corresponding to a given face coordinate direction.
virtual int v_GetEdgeNormalToFaceVert(const int i, const int j) const
Returns the standard lement edge IDs that are normal to a given face vertex.
static const int kNtfaces
static const int kNqfaces
static const unsigned int EdgeNormalToFaceVert[5][4]
virtual void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces)
Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated Geo...
virtual void v_GenGeomFactors()
@ eGaussLobattoLegendre
1D Gauss-Lobatto-Legendre quadrature points
@ eModifiedPyr_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
std::shared_ptr< Geometry2D > Geometry2DSharedPtr
@ ePtsFilled
Geometric information has been generated.
@ eDir1FwdDir2_Dir2FwdDir1
The above copyright notice and this permission notice shall be included.
scalarT< T > sqrt(scalarT< T > in)