47 namespace SpatialDomains
56 :
Geometry3D(faces[0]->GetEdge(0)->GetVertex(0)->GetCoordim())
97 if (locCoord[0] >= -(1 + tol) && locCoord[1] >= -(1 + tol) &&
98 locCoord[2] >= -(1 + tol) && locCoord[0] + locCoord[2] <= tol &&
99 locCoord[1] + locCoord[2] <= tol)
127 if (
m_xmap->GetBasisNumModes(0) != 2 ||
128 m_xmap->GetBasisNumModes(1) != 2 ||
129 m_xmap->GetBasisNumModes(2) != 2)
180 cp1030.
Mult(e10, e30);
181 cp3040.
Mult(e30, e40);
182 cp4010.
Mult(e40, e10);
196 Lcoords[0] = 2.0 * beta - 1.0;
197 Lcoords[1] = 2.0 * gamma - 1.0;
198 Lcoords[2] = 2.0 * delta - 1.0;
201 for (
int i = 0; i < 5; ++i)
212 int npts =
m_xmap->GetTotPoints();
235 ptdist = sqrt(tmp1[min_i]);
238 int qa = za.num_elements(), qb = zb.num_elements();
239 Lcoords[2] = zc[min_i / (qa * qb)];
240 min_i = min_i % (qa * qb);
241 Lcoords[1] = zb[min_i / qa];
242 Lcoords[0] = za[min_i % qa];
245 Lcoords[0] = (1.0 + Lcoords[0]) * (1.0 - Lcoords[2]) / 2 - 1.0;
246 Lcoords[1] = (1.0 + Lcoords[1]) * (1.0 - Lcoords[2]) / 2 - 1.0;
262 else if (faceidx == 1 || faceidx == 3)
282 for (f = 1; f < 5; f++)
284 int nEdges =
m_faces[f]->GetNumEdges();
286 for (i = 0; i < 4; i++)
288 for (j = 0; j < nEdges; j++)
292 edge = dynamic_pointer_cast<
SegGeom>(
302 std::ostringstream errstrm;
303 errstrm <<
"Connected faces do not share an edge. Faces ";
310 std::ostringstream errstrm;
311 errstrm <<
"Connected faces share more than one edge. Faces ";
320 for (i = 0; i < 3; i++)
322 for (j = 0; j < 3; j++)
326 edge = dynamic_pointer_cast<
SegGeom>(
335 std::ostringstream errstrm;
336 errstrm <<
"Connected faces do not share an edge. Faces ";
343 std::ostringstream errstrm;
344 errstrm <<
"Connected faces share more than one edge. Faces ";
351 for (f = 1; f < 4; f++)
354 for (i = 0; i <
m_faces[f]->GetNumEdges(); i++)
356 for (j = 0; j <
m_faces[f + 1]->GetNumEdges(); j++)
360 edge = dynamic_pointer_cast<
SegGeom>(
370 std::ostringstream errstrm;
371 errstrm <<
"Connected faces do not share an edge. Faces ";
378 std::ostringstream errstrm;
379 errstrm <<
"Connected faces share more than one edge. Faces ";
404 std::ostringstream errstrm;
405 errstrm <<
"Connected edges do not share a vertex. Edges ";
406 errstrm <<
m_edges[0]->GetGlobalID() <<
", " 412 for (
int i = 1; i < 3; i++)
424 std::ostringstream errstrm;
425 errstrm <<
"Connected edges do not share a vertex. Edges ";
426 errstrm <<
m_edges[i]->GetGlobalID() <<
", " 427 <<
m_edges[i - 1]->GetGlobalID();
443 for (
int i = 5; i < 8; ++i)
455 std::ostringstream errstrm;
456 errstrm <<
"Connected edges do not share a vertex. Edges ";
457 errstrm <<
m_edges[3]->GetGlobalID() <<
", " 468 const unsigned int edgeVerts[
kNedges][2] = {
469 {0, 1}, {1, 2}, {3, 2}, {0, 3}, {0, 4}, {1, 4}, {2, 4}, {3, 4}};
484 ASSERTL0(
false,
"Could not find matching vertex for the edge");
510 unsigned int baseVertex;
521 const unsigned int faceVerts[
kNfaces][4] = {
531 unsigned int orientation;
537 elementAaxis_length = 0.0;
538 elementBaxis_length = 0.0;
539 faceAaxis_length = 0.0;
540 faceBaxis_length = 0.0;
545 baseVertex =
m_faces[f]->GetVid(0);
562 elementAaxis[i] = (*
m_verts[faceVerts[f][1]])[i] -
563 (*
m_verts[faceVerts[f][0]])[i];
564 elementBaxis[i] = (*
m_verts[faceVerts[f][2]])[i] -
565 (*
m_verts[faceVerts[f][0]])[i];
572 elementAaxis[i] = (*
m_verts[faceVerts[f][1]])[i] -
573 (*
m_verts[faceVerts[f][0]])[i];
574 elementBaxis[i] = (*
m_verts[faceVerts[f][2]])[i] -
575 (*
m_verts[faceVerts[f][1]])[i];
582 elementAaxis[i] = (*
m_verts[faceVerts[f][1]])[i] -
583 (*
m_verts[faceVerts[f][2]])[i];
584 elementBaxis[i] = (*
m_verts[faceVerts[f][2]])[i] -
585 (*
m_verts[faceVerts[f][0]])[i];
590 ASSERTL0(
false,
"Could not find matching vertex for the face");
599 elementAaxis[i] = (*
m_verts[faceVerts[f][1]])[i] -
600 (*
m_verts[faceVerts[f][0]])[i];
601 elementBaxis[i] = (*
m_verts[faceVerts[f][3]])[i] -
602 (*
m_verts[faceVerts[f][0]])[i];
609 elementAaxis[i] = (*
m_verts[faceVerts[f][1]])[i] -
610 (*
m_verts[faceVerts[f][0]])[i];
611 elementBaxis[i] = (*
m_verts[faceVerts[f][2]])[i] -
612 (*
m_verts[faceVerts[f][1]])[i];
619 elementAaxis[i] = (*
m_verts[faceVerts[f][2]])[i] -
620 (*
m_verts[faceVerts[f][3]])[i];
621 elementBaxis[i] = (*
m_verts[faceVerts[f][2]])[i] -
622 (*
m_verts[faceVerts[f][1]])[i];
629 elementAaxis[i] = (*
m_verts[faceVerts[f][2]])[i] -
630 (*
m_verts[faceVerts[f][3]])[i];
631 elementBaxis[i] = (*
m_verts[faceVerts[f][3]])[i] -
632 (*
m_verts[faceVerts[f][0]])[i];
637 ASSERTL0(
false,
"Could not find matching vertex for the face");
645 int v =
m_faces[f]->GetNumVerts() - 1;
651 elementAaxis_length += pow(elementAaxis[i], 2);
652 elementBaxis_length += pow(elementBaxis[i], 2);
653 faceAaxis_length += pow(faceAaxis[i], 2);
654 faceBaxis_length += pow(faceBaxis[i], 2);
657 elementAaxis_length = sqrt(elementAaxis_length);
658 elementBaxis_length = sqrt(elementBaxis_length);
659 faceAaxis_length = sqrt(faceAaxis_length);
660 faceBaxis_length = sqrt(faceBaxis_length);
666 dotproduct1 += elementAaxis[i] * faceAaxis[i];
669 NekDouble norm = fabs(dotproduct1) / elementAaxis_length / faceAaxis_length;
679 if (dotproduct1 < 0.0)
687 dotproduct2 += elementBaxis[i] * faceBaxis[i];
690 norm = fabs(dotproduct2) / elementBaxis_length / faceBaxis_length;
694 "These vectors should be parallel");
698 if (dotproduct2 < 0.0)
713 dotproduct1 += elementAaxis[i] * faceBaxis[i];
716 norm = fabs(dotproduct1) / elementAaxis_length / faceBaxis_length;
718 "These vectors should be parallel");
722 if (dotproduct1 < 0.0)
731 dotproduct2 += elementBaxis[i] * faceAaxis[i];
734 norm = fabs(dotproduct2) / elementBaxis_length / faceAaxis_length;
738 "These vectors should be parallel");
740 if (dotproduct2 < 0.0)
746 orientation = orientation + 5;
757 for (
int i = 0; i < 5; ++i)
759 m_faces[i]->Reset(curvedEdges, curvedFaces);
770 for (
int i = 0; i < 5; ++i)
793 order0 = *max_element(tmp.begin(), tmp.end());
799 order0 = *max_element(tmp.begin(), tmp.end());
808 order1 = *max_element(tmp.begin(), tmp.end());
816 order1 = *max_element(tmp.begin(), tmp.end());
820 tmp.push_back(order0);
821 tmp.push_back(order1);
826 int order2 = *max_element(tmp.begin(), tmp.end());
StdRegions::StdExpansionSharedPtr m_xmap
mapping containing isoparametric transformation.
#define ASSERTL0(condition, msg)
std::vector< StdRegions::Orientation > m_eorient
int GetEid(int i) const
Get the ID of edge i of this object.
std::shared_ptr< Geometry2D > Geometry2DSharedPtr
void SetUpLocalVertices()
Principle Modified Functions .
GeomFactorsSharedPtr m_geomFactors
Geometric factors.
StdRegions::StdExpansionSharedPtr GetXmap() const
Return the mapping object Geometry::m_xmap that represents the coordinate transformation from standar...
std::unordered_map< int, CurveSharedPtr > CurveMap
bool MinMaxCheck(const Array< OneD, const NekDouble > &gloCoord)
Check if given global coord is within twice the min/max distance of the element.
NekDouble dot(PointGeom &a)
retun the dot product between this and input a
int Imin(int n, const T *x, const int incx)
Return the index of the minimum element in x.
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
Principle Modified Functions .
void Sub(PointGeom &a, PointGeom &b)
virtual void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces)
Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated Geo...
void ClampLocCoords(Array< OneD, NekDouble > &locCoord, NekDouble tol)
Clamp local coords to be within standard regions [-1, 1]^dim.
GeomState m_geomFactorsState
State of the geometric factors.
int GetGlobalID(void) const
Get the ID of this object.
std::vector< StdRegions::Orientation > m_forient
virtual void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces)
Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated Geo...
void NewtonIterationForLocCoord(const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &ptsx, const Array< OneD, const NekDouble > &ptsy, const Array< OneD, const NekDouble > &ptsz, Array< OneD, NekDouble > &Lcoords, NekDouble &resid)
static const NekDouble kNekZeroTol
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
Defines a specification for a set of points.
virtual NekDouble v_GetLocCoords(const Array< OneD, const NekDouble > &coords, Array< OneD, NekDouble > &Lcoords)
Determine the local collapsed coordinates that correspond to a given Cartesian coordinate for this ge...
bool m_setupState
Wether or not the setup routines have been run.
int GetVid(int i) const
Get the ID of vertex i of this object.
void Sadd(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Add vector y = alpha + x.
static const int kNtfaces
virtual void v_FillGeom()
Put all quadrature information into face/edge structure and backward transform.
void Mult(PointGeom &a, PointGeom &b)
_this = a x b
static const int kNqfaces
Array< OneD, Array< OneD, NekDouble > > m_coeffs
Array containing expansion coefficients of m_xmap.
Geometry is straight-sided with constant geometric factors.
Gauss Radau pinned at x=-1, .
NekDouble GetLocCoords(const Array< OneD, const NekDouble > &coords, Array< OneD, NekDouble > &Lcoords)
Determine the local collapsed coordinates that correspond to a given Cartesian coordinate for this ge...
Geometry1DSharedPtr GetEdge(int i) const
Returns edge i of this object.
LibUtilities::ShapeType m_shapeType
Type of shape.
NekDouble dist(PointGeom &a)
return distance between this and input a
void SetUpEdgeOrientation()
Geometric information has been generated.
void SetUpCoeffs(const int nCoeffs)
Initialise the Geometry::m_coeffs array.
GeomFactorsSharedPtr GetMetricInfo()
Get the geometric factors for this object.
GeomType
Indicates the type of element geometry.
void SetUpXmap()
Set up the m_xmap object by determining the order of each direction from derived faces.
void SetUpFaceOrientation()
virtual bool v_ContainsPoint(const Array< OneD, const NekDouble > &gloCoord, Array< OneD, NekDouble > &locCoord, NekDouble tol, NekDouble &resid)
virtual void v_GenGeomFactors()
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
std::shared_ptr< SegGeom > SegGeomSharedPtr
Geometry is curved or has non-constant factors.
PointGeomSharedPtr GetVertex(int i) const
Returns vertex i of this object.
int m_coordim
Coordinate dimension of this geometry object.
virtual int v_GetDir(const int faceidx, const int facedir) const
Describes the specification for a Basis.
1D Gauss-Lobatto-Legendre quadrature points
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.