Nektar++
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Attributes | List of all members
Nektar::SpatialDomains::TetGeom Class Reference

#include <TetGeom.h>

Inheritance diagram for Nektar::SpatialDomains::TetGeom:
[legend]

Public Member Functions

 TetGeom ()
 
 TetGeom (int id, TriGeom *faces[])
 
 TetGeom (int id, std::array< TriGeom *, kNfaces > faces)
 
 ~TetGeom () override=default
 
- Public Member Functions inherited from Nektar::SpatialDomains::Geometry3D
 Geometry3D ()
 
 Geometry3D (const int coordim)
 
 ~Geometry3D () override=default
 
- Public Member Functions inherited from Nektar::SpatialDomains::Geometry
 Geometry ()
 Default constructor.
 
 Geometry (int coordim)
 Constructor when supplied a coordinate dimension.
 
virtual ~Geometry ()=default
 
int GetCoordim () const
 Return the coordinate dimension of this object (i.e. the dimension of the space in which this object is embedded).
 
void SetCoordim (int coordim)
 Sets the coordinate dimension of this object (i.e. the dimension of the space in which this object is embedded).
 
GeomFactorsUniquePtr GenGeomFactors (LibUtilities::PointsKeyVector &keyTgt)
 Used by Expansion to generate associated GeomFactors.
 
LibUtilities::ShapeType GetShapeType (void)
 Get the geometric shape type of this object.
 
int GetGlobalID (void) const
 Get the ID of this object.
 
void SetGlobalID (int globalid)
 Set the ID of this object.
 
int GetVid (int i) const
 Returns global id of vertex i of this object.
 
int GetEid (int i) const
 Get the ID of edge i of this object.
 
int GetFid (int i) const
 Get the ID of face i of this object.
 
int GetTid (int i) const
 Get the ID of trace i of this object.
 
PointGeomGetVertex (int i) const
 Returns vertex i of this object.
 
Geometry1DGetEdge (int i) const
 Returns edge i of this object.
 
Geometry2DGetFace (int i) const
 Returns face i of this object.
 
StdRegions::Orientation GetEorient (const int i) const
 Returns the orientation of edge i with respect to the ordering of edges in the standard element.
 
StdRegions::Orientation GetForient (const int i) const
 Returns the orientation of face i with respect to the ordering of faces in the standard element.
 
int GetNumVerts () const
 Get the number of vertices of this object.
 
int GetNumEdges () const
 Get the number of edges of this object.
 
int GetNumFaces () const
 Get the number of faces of this object.
 
int GetShapeDim () const
 Get the object's shape dimension.
 
StdRegions::StdExpansionSharedPtr GetXmap () const
 Return the mapping object Geometry::m_xmap that represents the coordinate transformation from standard element to physical element.
 
const Array< OneD, const NekDouble > & GetCoeffs (const int i) const
 Return the coefficients of the transformation Geometry::m_xmap in coordinate direction i.
 
void FillGeom ()
 Populate the coordinate mapping Geometry::m_coeffs information from any children geometry elements.
 
std::array< NekDouble, 6 > GetBoundingBox ()
 Generates the bounding box for the element.
 
void ClearBoundingBox ()
 
bool ContainsPoint (const Array< OneD, const NekDouble > &gloCoord, NekDouble tol=0.0)
 Determine whether an element contains a particular Cartesian coordinate \((x,y,z)\).
 
bool ContainsPoint (const Array< OneD, const NekDouble > &gloCoord, Array< OneD, NekDouble > &locCoord, NekDouble tol)
 Determine whether an element contains a particular Cartesian coordinate \((x,y,z)\).
 
bool ContainsPoint (const Array< OneD, const NekDouble > &gloCoord, Array< OneD, NekDouble > &locCoord, NekDouble tol, NekDouble &dist)
 Determine whether an element contains a particular Cartesian coordinate \(\vec{x} = (x,y,z)\).
 
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 geometry object.
 
NekDouble GetCoord (const int i, const Array< OneD, const NekDouble > &Lcoord)
 Given local collapsed coordinate Lcoord, return the value of physical coordinate in direction i.
 
int PreliminaryCheck (const Array< OneD, const NekDouble > &gloCoord)
 A fast and robust check if a given global coord is outside of a deformed element. For regular elements, this check is unnecessary.
 
bool MinMaxCheck (const Array< OneD, const NekDouble > &gloCoord)
 Check if given global coord is within the BoundingBox of the element.
 
bool ClampLocCoords (Array< OneD, NekDouble > &locCoord, NekDouble tol=std::numeric_limits< NekDouble >::epsilon())
 Clamp local coords to be within standard regions [-1, 1]^dim.
 
NekDouble FindDistance (const Array< OneD, const NekDouble > &xs, Array< OneD, NekDouble > &xi)
 
int GetVertexEdgeMap (int i, int j) const
 Returns the standard element edge IDs that are connected to a given vertex.
 
int GetVertexFaceMap (int i, int j) const
 Returns the standard element face IDs that are connected to a given vertex.
 
int GetEdgeFaceMap (int i, int j) const
 Returns the standard element edge IDs that are connected to a given face.
 
int GetEdgeNormalToFaceVert (int i, int j) const
 Returns the standard lement edge IDs that are normal to a given face vertex.
 
int GetDir (const int i, const int j=0) const
 Returns the element coordinate direction corresponding to a given face coordinate direction.
 
GeomType CalcGeomType ()
 
void Reset (CurveMap &curvedEdges, CurveMap &curvedFaces)
 Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated GeomFactors.
 
void ResetNonRecursive (CurveMap &curvedEdges, CurveMap &curvedFaces)
 Reset this geometry object non-recursively: unset the current state, zero Geometry::m_coeffs and remove allocated GeomFactors.
 
void Setup ()
 

Static Public Attributes

static const int kNverts = 4
 
static const int kNedges = 6
 
static const int kNqfaces = 0
 
static const int kNtfaces = 4
 
static const int kNfaces = kNqfaces + kNtfaces
 
static const int kNfacets = kNfaces
 
static const std::string XMLElementType
 
- Static Public Attributes inherited from Nektar::SpatialDomains::Geometry3D
static const int kDim = 3
 

Protected Member Functions

int v_GetVertexEdgeMap (const int i, const int j) const override
 Returns the standard element edge IDs that are connected to a given vertex.
 
int v_GetVertexFaceMap (const int i, const int j) const override
 Returns the standard element face IDs that are connected to a given vertex.
 
int v_GetEdgeFaceMap (const int i, const int j) const override
 Returns the standard element edge IDs that are connected to a given face.
 
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.
 
int v_GetDir (const int faceidx, const int facedir) const override
 Returns the element coordinate direction corresponding to a given face coordinate direction.
 
void v_Reset (CurveMap &curvedEdges, CurveMap &curvedFaces) override
 Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated GeomFactors.
 
void v_Setup () override
 
GeomType v_CalcGeomType () override
 
GeomFactorsUniquePtr v_GenGeomFactors (LibUtilities::PointsKeyVector &keyTgt) override
 Used by Expansion to generate associated GeomFactors.
 
void v_FillGeom () override
 Put all quadrature information into face/edge structure and backward transform.
 
int v_GetNumVerts () const final
 Get the number of vertices of this object.
 
int v_GetNumEdges () const final
 Get the number of edges of this object.
 
int v_GetNumFaces () const final
 Get the number of faces of this object.
 
PointGeomv_GetVertex (const int i) const final
 Returns vertex i of this object.
 
Geometry1Dv_GetEdge (const int i) const final
 Returns edge i of this object.
 
Geometry2Dv_GetFace (const int i) const final
 Returns face i of this object.
 
StdRegions::Orientation v_GetEorient (const int i) const final
 Returns the orientation of edge i with respect to the ordering of edges in the standard element.
 
StdRegions::Orientation v_GetForient (const int i) const final
 Returns the orientation of face i with respect to the ordering of faces in the standard element.
 
- Protected Member Functions inherited from Nektar::SpatialDomains::Geometry3D
NekDouble v_GetLocCoords (const Array< OneD, const NekDouble > &coords, Array< OneD, NekDouble > &Lcoords) override
 Determine the local collapsed coordinates that correspond to a given Cartesian coordinate for this geometry object.
 
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 &dist)
 
void NewtonIterationForLocCoord (const Array< OneD, const NekDouble > &coords, Array< OneD, NekDouble > &Lcoords)
 
NekDouble v_GetCoord (const int i, const Array< OneD, const NekDouble > &Lcoord) override
 Given local collapsed coordinate Lcoord return the value of physical coordinate in direction i.
 
void v_CalculateInverseIsoParam () override
 
int v_AllLeftCheck (const Array< OneD, const NekDouble > &gloCoord) override
 
int v_GetShapeDim () const override
 Get the object's shape dimension.
 
- Protected Member Functions inherited from Nektar::SpatialDomains::Geometry
virtual int v_GetVid (int i) const
 Get the ID of vertex i of this object.
 
virtual StdRegions::StdExpansionSharedPtr v_GetXmap () const
 Return the mapping object Geometry::m_xmap that represents the coordinate transformation from standard element to physical element.
 
virtual bool v_ContainsPoint (const Array< OneD, const NekDouble > &gloCoord, Array< OneD, NekDouble > &locCoord, NekDouble tol, NekDouble &dist)
 Determine whether an element contains a particular Cartesian coordinate \(\vec{x} = (x,y,z)\).
 
virtual NekDouble v_FindDistance (const Array< OneD, const NekDouble > &xs, Array< OneD, NekDouble > &xi)
 
void SetUpCoeffs (const int nCoeffs)
 Initialise the Geometry::m_coeffs array.
 

Protected Attributes

std::array< PointGeom *, kNvertsm_verts
 
std::array< SegGeom *, kNedgesm_edges
 
std::array< TriGeom *, kNfacesm_faces
 
std::array< StdRegions::Orientation, kNedgesm_eorient
 
std::array< StdRegions::Orientation, kNfacesm_forient
 
- Protected Attributes inherited from Nektar::SpatialDomains::Geometry3D
int m_eid
 
bool m_ownverts
 
- Protected Attributes inherited from Nektar::SpatialDomains::Geometry
int m_coordim
 Coordinate dimension of this geometry object.
 
StdRegions::StdExpansionSharedPtr m_xmap
 \(\chi\) mapping containing isoparametric transformation.
 
GeomState m_state
 Enumeration to dictate whether coefficients are filled.
 
bool m_setupState
 Wether or not the setup routines have been run.
 
LibUtilities::ShapeType m_shapeType
 Type of shape.
 
int m_globalID
 Global ID.
 
std::vector< Array< OneD, NekDouble > > m_coeffs
 Array containing expansion coefficients of m_xmap.
 
Array< OneD, NekDoublem_boundingBox
 Array containing bounding box.
 
Array< OneD, Array< OneD, NekDouble > > m_isoParameter
 
Array< OneD, Array< OneD, NekDouble > > m_invIsoParam
 
int m_straightEdge
 

Private Member Functions

void SetUpLocalEdges ()
 
void SetUpLocalVertices ()
 
void SetUpEdgeOrientation ()
 
void SetUpFaceOrientation ()
 
void SetUpXmap ()
 Set up the m_xmap object by determining the order of each direction from derived faces.
 

Static Private Attributes

static const unsigned int VertexEdgeConnectivity [4][3]
 
static const unsigned int VertexFaceConnectivity [4][3]
 
static const unsigned int EdgeFaceConnectivity [6][2]
 
static const unsigned int EdgeNormalToFaceVert [4][3]
 

Detailed Description

Definition at line 45 of file TetGeom.h.

Constructor & Destructor Documentation

◆ TetGeom() [1/3]

Nektar::SpatialDomains::TetGeom::TetGeom ( )

◆ TetGeom() [2/3]

Nektar::SpatialDomains::TetGeom::TetGeom ( int  id,
TriGeom faces[] 
)

◆ TetGeom() [3/3]

Nektar::SpatialDomains::TetGeom::TetGeom ( int  id,
std::array< TriGeom *, kNfaces faces 
)

Definition at line 64 of file TetGeom.cpp.

65 : Geometry3D(faces[0]->GetEdge(0)->GetVertex(0)->GetCoordim())
66{
68 m_globalID = id;
69 m_faces = faces;
70
75}
PointGeom * GetVertex(int i) const
Returns vertex i of this object.
Definition Geometry.h:353
int GetCoordim() const
Return the coordinate dimension of this object (i.e. the dimension of the space in which this object ...
Definition Geometry.h:277
Geometry1D * GetEdge(int i) const
Returns edge i of this object.
Definition Geometry.h:361
std::array< TriGeom *, kNfaces > m_faces
Definition TetGeom.h:118

References Nektar::LibUtilities::eTetrahedron, m_faces, Nektar::SpatialDomains::Geometry::m_globalID, Nektar::SpatialDomains::Geometry::m_shapeType, SetUpEdgeOrientation(), SetUpFaceOrientation(), SetUpLocalEdges(), and SetUpLocalVertices().

◆ ~TetGeom()

Nektar::SpatialDomains::TetGeom::~TetGeom ( )
overridedefault

Member Function Documentation

◆ SetUpEdgeOrientation()

void Nektar::SpatialDomains::TetGeom::SetUpEdgeOrientation ( )
private

Definition at line 310 of file TetGeom.cpp.

311{
312
313 // This 2D array holds the local id's of all the vertices
314 // for every edge. For every edge, they are ordered to what we
315 // define as being Forwards
316 const unsigned int edgeVerts[kNedges][2] = {{0, 1}, {1, 2}, {0, 2},
317 {0, 3}, {1, 3}, {2, 3}};
318
319 int i;
320 for (i = 0; i < kNedges; i++)
321 {
322 if (m_edges[i]->GetVid(0) == m_verts[edgeVerts[i][0]]->GetGlobalID())
323 {
325 }
326 else if (m_edges[i]->GetVid(0) ==
327 m_verts[edgeVerts[i][1]]->GetGlobalID())
328 {
330 }
331 else
332 {
334 "Could not find matching vertex for the edge");
335 }
336 }
337}
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
int GetVid(int i) const
Returns global id of vertex i of this object.
Definition Geometry.h:345
int GetGlobalID(void) const
Get the ID of this object.
Definition Geometry.h:314
std::array< SegGeom *, kNedges > m_edges
Definition TetGeom.h:117
static const int kNedges
Definition TetGeom.h:52
std::array< PointGeom *, kNverts > m_verts
Definition TetGeom.h:116
std::array< StdRegions::Orientation, kNedges > m_eorient
Definition TetGeom.h:119

References Nektar::StdRegions::eBackwards, Nektar::ErrorUtil::efatal, Nektar::StdRegions::eForwards, Nektar::SpatialDomains::Geometry::GetGlobalID(), Nektar::SpatialDomains::Geometry::GetVid(), kNedges, m_edges, m_eorient, m_verts, and NEKERROR.

Referenced by TetGeom().

◆ SetUpFaceOrientation()

void Nektar::SpatialDomains::TetGeom::SetUpFaceOrientation ( )
private

Definition at line 339 of file TetGeom.cpp.

340{
341
342 int f, i;
343
344 // These arrays represent the vector of the A and B
345 // coordinate of the local elemental coordinate system
346 // where A corresponds with the coordinate direction xi_i
347 // with the lowest index i (for that particular face)
348 // Coordinate 'B' then corresponds to the other local
349 // coordinate (i.e. with the highest index)
350 Array<OneD, NekDouble> elementAaxis(m_coordim);
351 Array<OneD, NekDouble> elementBaxis(m_coordim);
352
353 // These arrays correspond to the local coordinate
354 // system of the face itself (i.e. the Geometry2D)
355 // faceAaxis correspond to the xi_0 axis
356 // faceBaxis correspond to the xi_1 axis
357 Array<OneD, NekDouble> faceAaxis(m_coordim);
358 Array<OneD, NekDouble> faceBaxis(m_coordim);
359
360 // This is the base vertex of the face (i.e. the Geometry2D)
361 // This corresponds to thevertex with local ID 0 of the
362 // Geometry2D
363 unsigned int baseVertex;
364
365 // The lenght of the vectors above
366 NekDouble elementAaxis_length;
367 NekDouble elementBaxis_length;
368 NekDouble faceAaxis_length;
369 NekDouble faceBaxis_length;
370
371 // This 2D array holds the local id's of all the vertices
372 // for every face. For every face, they are ordered in such
373 // a way that the implementation below allows a unified approach
374 // for all faces.
375 const unsigned int faceVerts[kNfaces][TriGeom::kNverts] = {
376 {0, 1, 2}, {0, 1, 3}, {1, 2, 3}, {0, 2, 3}};
377
378 NekDouble dotproduct1 = 0.0;
379 NekDouble dotproduct2 = 0.0;
380
381 unsigned int orientation;
382
383 // Loop over all the faces to set up the orientation
384 for (f = 0; f < kNqfaces + kNtfaces; f++)
385 {
386 // initialisation
387 elementAaxis_length = 0.0;
388 elementBaxis_length = 0.0;
389 faceAaxis_length = 0.0;
390 faceBaxis_length = 0.0;
391
392 dotproduct1 = 0.0;
393 dotproduct2 = 0.0;
394
395 baseVertex = m_faces[f]->GetVid(0);
396
397 // We are going to construct the vectors representing the A
398 // and B axis of every face. These vectors will be constructed
399 // as a vector-representation of the edges of the
400 // face. However, for both coordinate directions, we can
401 // represent the vectors by two different edges. That's why we
402 // need to make sure that we pick the edge to which the
403 // baseVertex of the Geometry2D-representation of the face
404 // belongs...
405
406 // Compute the length of edges on a base-face
407 if (baseVertex == m_verts[faceVerts[f][0]]->GetGlobalID())
408 {
409 for (i = 0; i < m_coordim; i++)
410 {
411 elementAaxis[i] = (*m_verts[faceVerts[f][1]])[i] -
412 (*m_verts[faceVerts[f][0]])[i];
413 elementBaxis[i] = (*m_verts[faceVerts[f][2]])[i] -
414 (*m_verts[faceVerts[f][0]])[i];
415 }
416 }
417 else if (baseVertex == m_verts[faceVerts[f][1]]->GetGlobalID())
418 {
419 for (i = 0; i < m_coordim; i++)
420 {
421 elementAaxis[i] = (*m_verts[faceVerts[f][1]])[i] -
422 (*m_verts[faceVerts[f][0]])[i];
423 elementBaxis[i] = (*m_verts[faceVerts[f][2]])[i] -
424 (*m_verts[faceVerts[f][1]])[i];
425 }
426 }
427 else if (baseVertex == m_verts[faceVerts[f][2]]->GetGlobalID())
428 {
429 for (i = 0; i < m_coordim; i++)
430 {
431 elementAaxis[i] = (*m_verts[faceVerts[f][1]])[i] -
432 (*m_verts[faceVerts[f][2]])[i];
433 elementBaxis[i] = (*m_verts[faceVerts[f][2]])[i] -
434 (*m_verts[faceVerts[f][0]])[i];
435 }
436 }
437 else
438 {
440 "Could not find matching vertex for the face");
441 }
442
443 // Now, construct the edge-vectors of the local coordinates of
444 // the Geometry2D-representation of the face
445 for (i = 0; i < m_coordim; i++)
446 {
447 faceAaxis[i] =
448 (*m_faces[f]->GetVertex(1))[i] - (*m_faces[f]->GetVertex(0))[i];
449 faceBaxis[i] =
450 (*m_faces[f]->GetVertex(2))[i] - (*m_faces[f]->GetVertex(0))[i];
451
452 elementAaxis_length += pow(elementAaxis[i], 2);
453 elementBaxis_length += pow(elementBaxis[i], 2);
454 faceAaxis_length += pow(faceAaxis[i], 2);
455 faceBaxis_length += pow(faceBaxis[i], 2);
456 }
457
458 elementAaxis_length = sqrt(elementAaxis_length);
459 elementBaxis_length = sqrt(elementBaxis_length);
460 faceAaxis_length = sqrt(faceAaxis_length);
461 faceBaxis_length = sqrt(faceBaxis_length);
462
463 // Calculate the inner product of both the A-axis
464 // (i.e. Elemental A axis and face A axis)
465 for (i = 0; i < m_coordim; i++)
466 {
467 dotproduct1 += elementAaxis[i] * faceAaxis[i];
468 }
469
470 NekDouble norm =
471 fabs(dotproduct1) / elementAaxis_length / faceAaxis_length;
472 orientation = 0;
473
474 // if the innerproduct is equal to the (absolute value of the ) products
475 // of the lengths of both vectors, then, the coordinate systems will NOT
476 // be transposed
477 if (fabs(norm - 1.0) < NekConstants::kNekZeroTol)
478 {
479 // if the inner product is negative, both A-axis point
480 // in reverse direction
481 if (dotproduct1 < 0.0)
482 {
483 orientation += 2;
484 }
485
486 // calculate the inner product of both B-axis
487 for (i = 0; i < m_coordim; i++)
488 {
489 dotproduct2 += elementBaxis[i] * faceBaxis[i];
490 }
491
492 norm = fabs(dotproduct2) / elementBaxis_length / faceBaxis_length;
493
494 // check that both these axis are indeed parallel
495 if (fabs(norm - 1.0) >= NekConstants::kNekZeroTol)
496 {
498 "These vectors should be parallel");
499 }
500
501 // if the inner product is negative, both B-axis point
502 // in reverse direction
503 if (dotproduct2 < 0.0)
504 {
505 orientation++;
506 }
507 }
508 // The coordinate systems are transposed
509 else
510 {
511 orientation = 4;
512
513 // Calculate the inner product between the elemental A-axis
514 // and the B-axis of the face (which are now the corresponding axis)
515 dotproduct1 = 0.0;
516 for (i = 0; i < m_coordim; i++)
517 {
518 dotproduct1 += elementAaxis[i] * faceBaxis[i];
519 }
520
521 norm = fabs(dotproduct1) / elementAaxis_length / faceBaxis_length;
522
523 // check that both these axis are indeed parallel
524 if (fabs(norm - 1.0) >= NekConstants::kNekZeroTol)
525 {
527 "These vectors should be parallel");
528 }
529
530 // if the result is negative, both axis point in reverse
531 // directions
532 if (dotproduct1 < 0.0)
533 {
534 orientation += 2;
535 }
536
537 // Do the same for the other two corresponding axis
538 dotproduct2 = 0.0;
539 for (i = 0; i < m_coordim; i++)
540 {
541 dotproduct2 += elementBaxis[i] * faceAaxis[i];
542 }
543
544 norm = fabs(dotproduct2) / elementBaxis_length / faceAaxis_length;
545
546 // check that both these axis are indeed parallel
547 if (fabs(norm - 1.0) >= NekConstants::kNekZeroTol)
548 {
550 "These vectors should be parallel");
551 }
552
553 if (dotproduct2 < 0.0)
554 {
555 orientation++;
556 }
557 }
558
559 orientation = orientation + 5;
560
562 "Orientation of triangular face (id = " +
563 std::to_string(m_faces[f]->GetGlobalID()) +
564 ") is inconsistent with face " + std::to_string(f) +
565 " of tet element (id = " + std::to_string(m_globalID) +
566 ") since Dir2 is aligned with Dir1. Mesh setup "
567 "needs investigation");
568
569 // Fill the m_forient array
570 m_forient[f] = (StdRegions::Orientation)orientation;
571 }
572}
#define ASSERTL0(condition, msg)
int m_coordim
Coordinate dimension of this geometry object.
Definition Geometry.h:184
std::array< StdRegions::Orientation, kNfaces > m_forient
Definition TetGeom.h:120
static const int kNfaces
Definition TetGeom.h:55
static const int kNqfaces
Definition TetGeom.h:53
static const int kNtfaces
Definition TetGeom.h:54
static const int kNverts
Definition TriGeom.h:58
static const NekDouble kNekZeroTol
scalarT< T > sqrt(scalarT< T > in)
Definition scalar.hpp:290

References ASSERTL0, Nektar::StdRegions::eDir1FwdDir2_Dir2FwdDir1, Nektar::ErrorUtil::efatal, Nektar::ErrorUtil::ewarning, Nektar::SpatialDomains::Geometry::GetGlobalID(), Nektar::SpatialDomains::Geometry::GetVertex(), Nektar::NekConstants::kNekZeroTol, kNfaces, kNqfaces, kNtfaces, Nektar::SpatialDomains::TriGeom::kNverts, Nektar::SpatialDomains::Geometry::m_coordim, m_faces, m_forient, Nektar::SpatialDomains::Geometry::m_globalID, m_verts, NEKERROR, and tinysimd::sqrt().

Referenced by TetGeom().

◆ SetUpLocalEdges()

void Nektar::SpatialDomains::TetGeom::SetUpLocalEdges ( )
private

Definition at line 113 of file TetGeom.cpp.

114{
115
116 // find edge 0
117 int i, j;
118 unsigned int check;
119
120 // First set up the 3 bottom edges
121
122 if (m_faces[0]->GetEid(0) != m_faces[1]->GetEid(0))
123 {
124 std::ostringstream errstrm;
125 errstrm << "Local edge 0 (eid=" << m_faces[0]->GetEid(0);
126 errstrm << ") on face " << m_faces[0]->GetGlobalID();
127 errstrm << " must be the same as local edge 0 (eid="
128 << m_faces[1]->GetEid(0);
129 errstrm << ") on face " << m_faces[1]->GetGlobalID();
130 NEKERROR(ErrorUtil::efatal, errstrm.str());
131 }
132
133 int faceConnected;
134 for (faceConnected = 1; faceConnected < 4; faceConnected++)
135 {
136 check = 0;
137 for (i = 0; i < 3; i++)
138 {
139 if ((m_faces[0])->GetEid(i) == (m_faces[faceConnected])->GetEid(0))
140 {
141 m_edges[faceConnected - 1] =
142 static_cast<SegGeom *>((m_faces[0])->GetEdge(i));
143 check++;
144 }
145 }
146
147 if (check < 1)
148 {
149 std::ostringstream errstrm;
150 errstrm << "Face 0 does not share an edge with first edge of "
151 "adjacent face. Faces ";
152 errstrm << (m_faces[0])->GetGlobalID() << ", "
153 << (m_faces[faceConnected])->GetGlobalID();
154 NEKERROR(ErrorUtil::efatal, errstrm.str());
155 }
156 else if (check > 1)
157 {
158 std::ostringstream errstrm;
159 errstrm << "Connected faces share more than one edge. Faces ";
160 errstrm << (m_faces[0])->GetGlobalID() << ", "
161 << (m_faces[faceConnected])->GetGlobalID();
162 NEKERROR(ErrorUtil::efatal, errstrm.str());
163 }
164 }
165
166 // Then, set up the 3 vertical edges
167 check = 0;
168 for (i = 0; i < 3; i++) // Set up the vertical edge :face(1) and face(3)
169 {
170 for (j = 0; j < 3; j++)
171 {
172 if ((m_faces[1])->GetEid(i) == (m_faces[3])->GetEid(j))
173 {
174 m_edges[3] = static_cast<SegGeom *>((m_faces[1])->GetEdge(i));
175 check++;
176 }
177 }
178 }
179 if (check < 1)
180 {
181 std::ostringstream errstrm;
182 errstrm << "Connected faces do not share an edge. Faces ";
183 errstrm << (m_faces[1])->GetGlobalID() << ", "
184 << (m_faces[3])->GetGlobalID();
185 NEKERROR(ErrorUtil::efatal, errstrm.str());
186 }
187 else if (check > 1)
188 {
189 std::ostringstream errstrm;
190 errstrm << "Connected faces share more than one edge. Faces ";
191 errstrm << (m_faces[1])->GetGlobalID() << ", "
192 << (m_faces[3])->GetGlobalID();
193 NEKERROR(ErrorUtil::efatal, errstrm.str());
194 }
195 // Set up vertical edges: face(1) through face(3)
196 for (faceConnected = 1; faceConnected < 3; faceConnected++)
197 {
198 check = 0;
199 for (i = 0; i < 3; i++)
200 {
201 for (j = 0; j < 3; j++)
202 {
203 if ((m_faces[faceConnected])->GetEid(i) ==
204 (m_faces[faceConnected + 1])->GetEid(j))
205 {
206 m_edges[faceConnected + 3] = static_cast<SegGeom *>(
207 (m_faces[faceConnected])->GetEdge(i));
208 check++;
209 }
210 }
211 }
212
213 if (check < 1)
214 {
215 std::ostringstream errstrm;
216 errstrm << "Connected faces do not share an edge. Faces ";
217 errstrm << (m_faces[faceConnected])->GetGlobalID() << ", "
218 << (m_faces[faceConnected + 1])->GetGlobalID();
219 NEKERROR(ErrorUtil::efatal, errstrm.str());
220 }
221 else if (check > 1)
222 {
223 std::ostringstream errstrm;
224 errstrm << "Connected faces share more than one edge. Faces ";
225 errstrm << (m_faces[faceConnected])->GetGlobalID() << ", "
226 << (m_faces[faceConnected + 1])->GetGlobalID();
227 NEKERROR(ErrorUtil::efatal, errstrm.str());
228 }
229 }
230}
int GetEid(int i) const
Get the ID of edge i of this object.
Definition Geometry.cpp:83

References Nektar::ErrorUtil::efatal, Nektar::SpatialDomains::Geometry::GetEdge(), Nektar::SpatialDomains::Geometry::GetEid(), Nektar::SpatialDomains::Geometry::GetGlobalID(), m_edges, m_faces, and NEKERROR.

Referenced by TetGeom().

◆ SetUpLocalVertices()

void Nektar::SpatialDomains::TetGeom::SetUpLocalVertices ( )
private

Definition at line 232 of file TetGeom.cpp.

233{
234
235 // Set up the first 2 vertices (i.e. vertex 0,1)
236 if ((m_edges[0]->GetVid(0) == m_edges[1]->GetVid(0)) ||
237 (m_edges[0]->GetVid(0) == m_edges[1]->GetVid(1)))
238 {
239 m_verts[0] = m_edges[0]->GetVertex(1);
240 m_verts[1] = m_edges[0]->GetVertex(0);
241 }
242 else if ((m_edges[0]->GetVid(1) == m_edges[1]->GetVid(0)) ||
243 (m_edges[0]->GetVid(1) == m_edges[1]->GetVid(1)))
244 {
245 m_verts[0] = m_edges[0]->GetVertex(0);
246 m_verts[1] = m_edges[0]->GetVertex(1);
247 }
248 else
249 {
250 std::ostringstream errstrm;
251 errstrm << "Connected edges do not share a vertex. Edges ";
252 errstrm << m_edges[0]->GetGlobalID() << ", "
253 << m_edges[1]->GetGlobalID();
254 NEKERROR(ErrorUtil::efatal, errstrm.str());
255 }
256
257 // set up the other bottom vertices (i.e. vertex 2)
258 for (int i = 1; i < 2; i++)
259 {
260 if (m_edges[i]->GetVid(0) == m_verts[i]->GetGlobalID())
261 {
262 m_verts[2] = m_edges[i]->GetVertex(1);
263 }
264 else if (m_edges[i]->GetVid(1) == m_verts[i]->GetGlobalID())
265 {
266 m_verts[2] = m_edges[i]->GetVertex(0);
267 }
268 else
269 {
270 std::ostringstream errstrm;
271 errstrm << "Connected edges do not share a vertex. Edges ";
272 errstrm << m_edges[i]->GetGlobalID() << ", "
273 << m_edges[i - 1]->GetGlobalID();
274 NEKERROR(ErrorUtil::efatal, errstrm.str());
275 }
276 }
277
278 // set up top vertex
279 if (m_edges[3]->GetVid(0) == m_verts[0]->GetGlobalID())
280 {
281 m_verts[3] = m_edges[3]->GetVertex(1);
282 }
283 else
284 {
285 m_verts[3] = m_edges[3]->GetVertex(0);
286 }
287
288 // Check the other edges match up.
289 int check = 0;
290 for (int i = 4; i < 6; ++i)
291 {
292 if ((m_edges[i]->GetVid(0) == m_verts[i - 3]->GetGlobalID() &&
293 m_edges[i]->GetVid(1) == m_verts[3]->GetGlobalID()) ||
294 (m_edges[i]->GetVid(1) == m_verts[i - 3]->GetGlobalID() &&
295 m_edges[i]->GetVid(0) == m_verts[3]->GetGlobalID()))
296 {
297 check++;
298 }
299 }
300 if (check != 2)
301 {
302 std::ostringstream errstrm;
303 errstrm << "Connected edges do not share a vertex. Edges ";
304 errstrm << m_edges[3]->GetGlobalID() << ", "
305 << m_edges[2]->GetGlobalID();
306 NEKERROR(ErrorUtil::efatal, errstrm.str());
307 }
308}

References Nektar::ErrorUtil::efatal, Nektar::SpatialDomains::Geometry::GetGlobalID(), Nektar::SpatialDomains::Geometry::GetVid(), m_edges, m_verts, and NEKERROR.

Referenced by TetGeom().

◆ SetUpXmap()

void Nektar::SpatialDomains::TetGeom::SetUpXmap ( )
private

Set up the m_xmap object by determining the order of each direction from derived faces.

Definition at line 667 of file TetGeom.cpp.

668{
669 std::vector<int> tmp;
670 tmp.push_back(m_faces[0]->GetXmap()->GetTraceNcoeffs(0));
671 int order0 = *std::max_element(tmp.begin(), tmp.end());
672
673 tmp.clear();
674 tmp.push_back(order0);
675 tmp.push_back(m_faces[0]->GetXmap()->GetTraceNcoeffs(1));
676 tmp.push_back(m_faces[0]->GetXmap()->GetTraceNcoeffs(2));
677 int order1 = *std::max_element(tmp.begin(), tmp.end());
678
679 tmp.clear();
680 tmp.push_back(order0);
681 tmp.push_back(order1);
682 tmp.push_back(m_faces[1]->GetXmap()->GetTraceNcoeffs(1));
683 tmp.push_back(m_faces[1]->GetXmap()->GetTraceNcoeffs(2));
684 tmp.push_back(m_faces[3]->GetXmap()->GetTraceNcoeffs(1));
685 int order2 = *std::max_element(tmp.begin(), tmp.end());
686
687 std::array<LibUtilities::BasisKey, 3> basis = {
688 LibUtilities::BasisKey(
690 LibUtilities::PointsKey(order0 + 1,
692 LibUtilities::BasisKey(
694 LibUtilities::PointsKey(order1,
695 LibUtilities::eGaussRadauMAlpha1Beta0)),
696 LibUtilities::BasisKey(
698 LibUtilities::PointsKey(order2,
699 LibUtilities::eGaussRadauMAlpha2Beta0))};
700
701 m_xmap = GetStdTetFactory().CreateInstance(basis);
702}
StdRegions::StdExpansionSharedPtr m_xmap
mapping containing isoparametric transformation.
Definition Geometry.h:186
StdRegions::StdExpansionSharedPtr GetXmap() const
Return the mapping object Geometry::m_xmap that represents the coordinate transformation from standar...
Definition Geometry.h:440
@ eGaussLobattoLegendre
1D Gauss-Lobatto-Legendre quadrature points
Definition PointsType.h:51
@ eModified_B
Principle Modified Functions .
Definition BasisType.h:49
@ eModified_C
Principle Modified Functions .
Definition BasisType.h:50
@ eModified_A
Principle Modified Functions .
Definition BasisType.h:48
XmapFactory< StdRegions::StdTetExp, 3 > & GetStdTetFactory()
Definition TetGeom.cpp:53

References Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModified_B, Nektar::LibUtilities::eModified_C, Nektar::SpatialDomains::GetStdTetFactory(), Nektar::SpatialDomains::Geometry::GetXmap(), m_faces, and Nektar::SpatialDomains::Geometry::m_xmap.

Referenced by v_Setup().

◆ v_CalcGeomType()

GeomType Nektar::SpatialDomains::TetGeom::v_CalcGeomType ( )
overrideprotectedvirtual

Generate the geometry factors for this element.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 611 of file TetGeom.cpp.

612{
613 if (!m_setupState)
614 {
616 }
617 v_FillGeom();
618
619 GeomType Gtype = eRegular;
620
621 // check to see if expansions are linear
622 if (m_xmap->GetBasisNumModes(0) != 2 || m_xmap->GetBasisNumModes(1) != 2 ||
623 m_xmap->GetBasisNumModes(2) != 2)
624 {
625 Gtype = eDeformed;
626 }
627
628 if (Gtype == eRegular)
629 {
630 m_isoParameter = Array<OneD, Array<OneD, NekDouble>>(3);
631 for (int i = 0; i < 3; ++i)
632 {
633 m_isoParameter[i] = Array<OneD, NekDouble>(4, 0.);
634 NekDouble A = (*m_verts[0])(i);
635 NekDouble B = (*m_verts[1])(i);
636 NekDouble C = (*m_verts[2])(i);
637 NekDouble D = (*m_verts[3])(i);
638 m_isoParameter[i][0] = 0.5 * (-A + B + C + D);
639
640 m_isoParameter[i][1] = 0.5 * (-A + B); // xi1
641 m_isoParameter[i][2] = 0.5 * (-A + C); // xi2
642 m_isoParameter[i][3] = 0.5 * (-A + D); // xi3
643 }
644 }
645
646 if (Gtype == eRegular)
647 {
649 }
650
651 return Gtype;
652}
bool m_setupState
Wether or not the setup routines have been run.
Definition Geometry.h:190
Array< OneD, Array< OneD, NekDouble > > m_isoParameter
Definition Geometry.h:199
void v_FillGeom() override
Put all quadrature information into face/edge structure and backward transform.
Definition TetGeom.cpp:712
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.

References Nektar::SpatialDomains::eDeformed, Nektar::SpatialDomains::eRegular, Nektar::SpatialDomains::Geometry::m_isoParameter, Nektar::SpatialDomains::Geometry::m_setupState, m_verts, Nektar::SpatialDomains::Geometry::m_xmap, Nektar::SpatialDomains::Geometry3D::v_CalculateInverseIsoParam(), v_FillGeom(), and v_Setup().

◆ v_FillGeom()

void Nektar::SpatialDomains::TetGeom::v_FillGeom ( )
overrideprotectedvirtual

Put all quadrature information into face/edge structure and backward transform.

Note verts, edges, and faces are listed according to anticlockwise convention but points in _coeffs have to be in array format from left to right.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 712 of file TetGeom.cpp.

713{
714 if (m_state == ePtsFilled)
715 {
716 return;
717 }
718
719 int i, j, k;
720
721 for (i = 0; i < kNfaces; i++)
722 {
723 m_faces[i]->FillGeom();
724
725 int nFaceCoeffs = m_faces[i]->GetXmap()->GetNcoeffs();
726
727 Array<OneD, unsigned int> mapArray(nFaceCoeffs);
728 Array<OneD, int> signArray(nFaceCoeffs);
729
730 if (m_forient[i] < 9)
731 {
732 m_xmap->GetTraceToElementMap(
733 i, mapArray, signArray, m_forient[i],
734 m_faces[i]->GetXmap()->GetTraceNcoeffs(0),
735 m_faces[i]->GetXmap()->GetTraceNcoeffs(1));
736 }
737 else
738 {
739 m_xmap->GetTraceToElementMap(
740 i, mapArray, signArray, m_forient[i],
741 m_faces[i]->GetXmap()->GetTraceNcoeffs(1),
742 m_faces[i]->GetXmap()->GetTraceNcoeffs(0));
743 }
744
745 for (j = 0; j < m_coordim; j++)
746 {
747 const Array<OneD, const NekDouble> &coeffs =
748 m_faces[i]->GetCoeffs(j);
749
750 for (k = 0; k < nFaceCoeffs; k++)
751 {
752 NekDouble v = signArray[k] * coeffs[k];
753 m_coeffs[j][mapArray[k]] = v;
754 }
755 }
756 }
757
759}
GeomState m_state
Enumeration to dictate whether coefficients are filled.
Definition Geometry.h:188
std::vector< Array< OneD, NekDouble > > m_coeffs
Array containing expansion coefficients of m_xmap.
Definition Geometry.h:196
@ ePtsFilled
Geometric information has been generated.

References Nektar::SpatialDomains::ePtsFilled, Nektar::SpatialDomains::Geometry::GetXmap(), kNfaces, Nektar::SpatialDomains::Geometry::m_coeffs, Nektar::SpatialDomains::Geometry::m_coordim, m_faces, m_forient, Nektar::SpatialDomains::Geometry::m_state, and Nektar::SpatialDomains::Geometry::m_xmap.

Referenced by v_CalcGeomType().

◆ v_GenGeomFactors()

GeomFactorsUniquePtr Nektar::SpatialDomains::TetGeom::v_GenGeomFactors ( LibUtilities::PointsKeyVector keyTgt)
overrideprotectedvirtual

Used by Expansion to generate associated GeomFactors.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 654 of file TetGeom.cpp.

656{
657 GeomType Gtype = CalcGeomType();
658
660 Gtype, m_coordim, m_xmap, m_coeffs, keyTgt);
661}
static std::unique_ptr< DataType, UniquePtrDeleter > AllocateUniquePtr(const Args &...args)

References Nektar::ObjPoolManager< DataType >::AllocateUniquePtr(), Nektar::SpatialDomains::Geometry::CalcGeomType(), Nektar::SpatialDomains::Geometry::m_coeffs, Nektar::SpatialDomains::Geometry::m_coordim, and Nektar::SpatialDomains::Geometry::m_xmap.

◆ v_GetDir()

int Nektar::SpatialDomains::TetGeom::v_GetDir ( const int  i,
const int  j 
) const
overrideprotectedvirtual

Returns the element coordinate direction corresponding to a given face coordinate direction.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 77 of file TetGeom.cpp.

78{
79 if (faceidx == 0)
80 {
81 return facedir;
82 }
83 else if (faceidx == 1)
84 {
85 return 2 * facedir;
86 }
87 else
88 {
89 return 1 + facedir;
90 }
91}

◆ v_GetEdge()

Geometry1D * Nektar::SpatialDomains::TetGeom::v_GetEdge ( const int  i) const
inlinefinalprotectedvirtual

Returns edge i of this object.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 96 of file TetGeom.h.

97 {
98 return static_cast<Geometry1D *>(m_edges[i]);
99 }

References m_edges.

◆ v_GetEdgeFaceMap()

int Nektar::SpatialDomains::TetGeom::v_GetEdgeFaceMap ( const int  i,
const int  j 
) const
overrideprotectedvirtual

Returns the standard element edge IDs that are connected to a given face.

For example, on a prism, edge 0 is connnected to faces 0 and 1; GetEdgeFaceMap(0,j) would therefore return the values 0 and 1 respectively. We assume that j runs between 0 and 1 inclusive, since every face is connected to precisely two faces for all 3D elements.

This function is used in the construction of the low-energy preconditioner.

Parameters
iThe edge to query connectivity for.
jThe local face index between 0 and 1 connected to this element.
See also
MultiRegions::PreconditionerLowEnergy

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 103 of file TetGeom.cpp.

104{
105 return EdgeFaceConnectivity[i][j];
106}
static const unsigned int EdgeFaceConnectivity[6][2]
Definition TetGeom.h:131

References EdgeFaceConnectivity.

◆ v_GetEdgeNormalToFaceVert()

int Nektar::SpatialDomains::TetGeom::v_GetEdgeNormalToFaceVert ( const int  i,
const int  j 
) const
overrideprotectedvirtual

Returns the standard lement edge IDs that are normal to a given face vertex.

For example, on a hexahedron, on face 0 at vertices 0,1,2,3 the edges normal to that face are 4,5,6,7, ; so GetEdgeNormalToFaceVert(0,j) would therefore return the values 4, 5, 6 and 7 respectively. We assume that j runs between 0 and 3 inclusive on a quadrilateral face and between 0 and 2 inclusive on a triangular face.

This is used to help set up a length scale normal to an face

Parameters
iThe face to query for the normal edge
jThe local vertex index between 0 and nverts on this face

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 108 of file TetGeom.cpp.

109{
110 return EdgeNormalToFaceVert[i][j];
111}
static const unsigned int EdgeNormalToFaceVert[4][3]
Definition TetGeom.h:132

References EdgeNormalToFaceVert.

◆ v_GetEorient()

StdRegions::Orientation Nektar::SpatialDomains::TetGeom::v_GetEorient ( const int  i) const
inlinefinalprotectedvirtual

Returns the orientation of edge i with respect to the ordering of edges in the standard element.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 106 of file TetGeom.h.

107 {
108 return m_eorient[i];
109 }

References m_eorient.

◆ v_GetFace()

Geometry2D * Nektar::SpatialDomains::TetGeom::v_GetFace ( const int  i) const
inlinefinalprotectedvirtual

Returns face i of this object.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 101 of file TetGeom.h.

102 {
103 return static_cast<Geometry2D *>(m_faces[i]);
104 }

References m_faces.

◆ v_GetForient()

StdRegions::Orientation Nektar::SpatialDomains::TetGeom::v_GetForient ( const int  i) const
inlinefinalprotectedvirtual

Returns the orientation of face i with respect to the ordering of faces in the standard element.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 111 of file TetGeom.h.

112 {
113 return m_forient[i];
114 }

References m_forient.

◆ v_GetNumEdges()

int Nektar::SpatialDomains::TetGeom::v_GetNumEdges ( ) const
inlinefinalprotectedvirtual

Get the number of edges of this object.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 81 of file TetGeom.h.

82 {
83 return kNedges;
84 }

References kNedges.

◆ v_GetNumFaces()

int Nektar::SpatialDomains::TetGeom::v_GetNumFaces ( ) const
inlinefinalprotectedvirtual

Get the number of faces of this object.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 86 of file TetGeom.h.

87 {
88 return kNfaces;
89 }

References kNfaces.

◆ v_GetNumVerts()

int Nektar::SpatialDomains::TetGeom::v_GetNumVerts ( ) const
inlinefinalprotectedvirtual

Get the number of vertices of this object.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 76 of file TetGeom.h.

77 {
78 return kNverts;
79 }
static const int kNverts
Definition TetGeom.h:51

References kNverts.

◆ v_GetVertex()

PointGeom * Nektar::SpatialDomains::TetGeom::v_GetVertex ( const int  i) const
inlinefinalprotectedvirtual

Returns vertex i of this object.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 91 of file TetGeom.h.

92 {
93 return m_verts[i];
94 }

References m_verts.

◆ v_GetVertexEdgeMap()

int Nektar::SpatialDomains::TetGeom::v_GetVertexEdgeMap ( const int  i,
const int  j 
) const
overrideprotectedvirtual

Returns the standard element edge IDs that are connected to a given vertex.

For example, on a prism, vertex 0 is connnected to edges 0, 3, and 4; GetVertexEdgeMap(0,j) would therefore return the values 0, 1 and 4 respectively. We assume that j runs between 0 and 2 inclusive, which is true for every 3D element asides from the pyramid.

This function is used in the construction of the low-energy preconditioner.

Parameters
iThe vertex to query connectivity for.
jThe local edge index between 0 and 2 connected to this element.
Todo:
Expand to work with pyramid elements.
See also
MultiRegions::PreconditionerLowEnergy

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 93 of file TetGeom.cpp.

94{
95 return VertexEdgeConnectivity[i][j];
96}
static const unsigned int VertexEdgeConnectivity[4][3]
Definition TetGeom.h:129

References VertexEdgeConnectivity.

◆ v_GetVertexFaceMap()

int Nektar::SpatialDomains::TetGeom::v_GetVertexFaceMap ( const int  i,
const int  j 
) const
overrideprotectedvirtual

Returns the standard element face IDs that are connected to a given vertex.

For example, on a hexahedron, vertex 0 is connnected to faces 0, 1, and 4; GetVertexFaceMap(0,j) would therefore return the values 0, 1 and 4 respectively. We assume that j runs between 0 and 2 inclusive, which is true for every 3D element asides from the pyramid.

This is used in the construction of the low-energy preconditioner.

Parameters
iThe vertex to query connectivity for.
jThe local face index between 0 and 2 connected to this element.
Todo:
Expand to work with pyramid elements.
See also
MultiRegions::PreconditionerLowEnergy

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 98 of file TetGeom.cpp.

99{
100 return VertexFaceConnectivity[i][j];
101}
static const unsigned int VertexFaceConnectivity[4][3]
Definition TetGeom.h:130

References VertexFaceConnectivity.

◆ v_Reset()

void Nektar::SpatialDomains::TetGeom::v_Reset ( CurveMap curvedEdges,
CurveMap curvedFaces 
)
overrideprotectedvirtual

Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated GeomFactors.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 574 of file TetGeom.cpp.

575{
576 Geometry::v_Reset(curvedEdges, curvedFaces);
577
578 for (int i = 0; i < 4; ++i)
579 {
580 m_faces[i]->Reset(curvedEdges, curvedFaces);
581 }
582}
virtual void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces)
Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated Geo...
Definition Geometry.cpp:366

References m_faces, and Nektar::SpatialDomains::Geometry::v_Reset().

◆ v_Setup()

void Nektar::SpatialDomains::TetGeom::v_Setup ( )
overrideprotectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 584 of file TetGeom.cpp.

585{
586 if (!m_setupState)
587 {
588 for (int i = 0; i < 4; ++i)
589 {
590 m_faces[i]->Setup();
591 }
592 SetUpXmap();
593 SetUpCoeffs(m_xmap->GetNcoeffs());
594
595 // check to see if expansions are linear
596 m_straightEdge = 1;
597 if (m_xmap->GetBasisNumModes(0) != 2 ||
598 m_xmap->GetBasisNumModes(1) != 2 ||
599 m_xmap->GetBasisNumModes(2) != 2)
600 {
601 m_straightEdge = 0;
602 }
603
604 m_setupState = true;
605 }
606}
void SetUpCoeffs(const int nCoeffs)
Initialise the Geometry::m_coeffs array.
Definition Geometry.h:694
void SetUpXmap()
Set up the m_xmap object by determining the order of each direction from derived faces.
Definition TetGeom.cpp:667

References m_faces, Nektar::SpatialDomains::Geometry::m_setupState, Nektar::SpatialDomains::Geometry::m_straightEdge, Nektar::SpatialDomains::Geometry::m_xmap, Nektar::SpatialDomains::Geometry::SetUpCoeffs(), and SetUpXmap().

Referenced by v_CalcGeomType().

Member Data Documentation

◆ EdgeFaceConnectivity

const unsigned int Nektar::SpatialDomains::TetGeom::EdgeFaceConnectivity
staticprivate
Initial value:
= {
{0, 1}, {0, 2}, {0, 3}, {1, 3}, {1, 2}, {2, 3}}

Definition at line 131 of file TetGeom.h.

Referenced by v_GetEdgeFaceMap().

◆ EdgeNormalToFaceVert

const unsigned int Nektar::SpatialDomains::TetGeom::EdgeNormalToFaceVert
staticprivate
Initial value:
= {
{3, 4, 5}, {1, 2, 5}, {0, 2, 3}, {0, 1, 4}}

Definition at line 132 of file TetGeom.h.

Referenced by v_GetEdgeNormalToFaceVert().

◆ kNedges

const int Nektar::SpatialDomains::TetGeom::kNedges = 6
static

Definition at line 52 of file TetGeom.h.

Referenced by SetUpEdgeOrientation(), and v_GetNumEdges().

◆ kNfaces

const int Nektar::SpatialDomains::TetGeom::kNfaces = kNqfaces + kNtfaces
static

◆ kNfacets

const int Nektar::SpatialDomains::TetGeom::kNfacets = kNfaces
static

Definition at line 56 of file TetGeom.h.

◆ kNqfaces

const int Nektar::SpatialDomains::TetGeom::kNqfaces = 0
static

◆ kNtfaces

const int Nektar::SpatialDomains::TetGeom::kNtfaces = 4
static

◆ kNverts

const int Nektar::SpatialDomains::TetGeom::kNverts = 4
static

Definition at line 51 of file TetGeom.h.

Referenced by v_GetNumVerts().

◆ m_edges

std::array<SegGeom *, kNedges> Nektar::SpatialDomains::TetGeom::m_edges
protected

Definition at line 117 of file TetGeom.h.

Referenced by SetUpEdgeOrientation(), SetUpLocalEdges(), SetUpLocalVertices(), and v_GetEdge().

◆ m_eorient

std::array<StdRegions::Orientation, kNedges> Nektar::SpatialDomains::TetGeom::m_eorient
protected

Definition at line 119 of file TetGeom.h.

Referenced by SetUpEdgeOrientation(), and v_GetEorient().

◆ m_faces

std::array<TriGeom *, kNfaces> Nektar::SpatialDomains::TetGeom::m_faces
protected

◆ m_forient

std::array<StdRegions::Orientation, kNfaces> Nektar::SpatialDomains::TetGeom::m_forient
protected

Definition at line 120 of file TetGeom.h.

Referenced by SetUpFaceOrientation(), v_FillGeom(), and v_GetForient().

◆ m_verts

std::array<PointGeom *, kNverts> Nektar::SpatialDomains::TetGeom::m_verts
protected

◆ VertexEdgeConnectivity

const unsigned int Nektar::SpatialDomains::TetGeom::VertexEdgeConnectivity
staticprivate
Initial value:
= {
{0, 2, 3}, {0, 1, 4}, {1, 2, 5}, {3, 4, 5}}

Definition at line 129 of file TetGeom.h.

Referenced by v_GetVertexEdgeMap().

◆ VertexFaceConnectivity

const unsigned int Nektar::SpatialDomains::TetGeom::VertexFaceConnectivity
staticprivate
Initial value:
= {
{0, 1, 3}, {0, 1, 2}, {0, 2, 3}, {1, 2, 3}}

Definition at line 130 of file TetGeom.h.

Referenced by v_GetVertexFaceMap().

◆ XMLElementType

const std::string Nektar::SpatialDomains::TetGeom::XMLElementType
static

Definition at line 57 of file TetGeom.h.