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::HexGeom Class Reference

#include <HexGeom.h>

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

Public Member Functions

 HexGeom ()
 
 HexGeom (int id, std::array< QuadGeom *, kNfaces > faces)
 
 ~HexGeom () 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).
 
GeomFactorsSharedPtr GetGeomFactors ()
 Get the geometric factors for this object, generating them if required.
 
GeomFactorsSharedPtr GetRefGeomFactors (const Array< OneD, const LibUtilities::BasisSharedPtr > &tbasis)
 
GeomFactorsSharedPtr GetMetricInfo ()
 Get the geometric factors for this object.
 
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.
 
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 ()
 
void GenGeomFactors ()
 Handles generation of geometry factors.
 

Static Public Attributes

static const int kNverts = 8
 
static const int kNedges = 12
 
static const int kNqfaces = 6
 
static const int kNtfaces = 0
 
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

void v_GenGeomFactors () override
 
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
 
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< QuadGeom *, 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.
 
GeomFactorsSharedPtr m_geomFactors
 Geometric factors.
 
GeomState m_geomFactorsState
 State of the geometric factors.
 
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.
 
GeomType m_geomType
 Type of geometry.
 
LibUtilities::ShapeType m_shapeType
 Type of shape.
 
int m_globalID
 Global ID.
 
Array< OneD, 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 [8][3]
 
static const unsigned int VertexFaceConnectivity [8][3]
 
static const unsigned int EdgeFaceConnectivity [12][2]
 
static const unsigned int EdgeNormalToFaceVert [6][4]
 

Additional Inherited Members

- Static Protected Member Functions inherited from Nektar::SpatialDomains::Geometry
static GeomFactorsSharedPtr ValidateRegGeomFactor (GeomFactorsSharedPtr geomFactor)
 Check to see if a geometric factor has already been created that contains the same regular information.
 
- Static Protected Attributes inherited from Nektar::SpatialDomains::Geometry
static GeomFactorsVector m_regGeomFactorsManager
 

Detailed Description

Definition at line 45 of file HexGeom.h.

Constructor & Destructor Documentation

◆ HexGeom() [1/2]

Nektar::SpatialDomains::HexGeom::HexGeom ( )

◆ HexGeom() [2/2]

Nektar::SpatialDomains::HexGeom::HexGeom ( int  id,
std::array< QuadGeom *, kNfaces faces 
)

Definition at line 70 of file HexGeom.cpp.

71 : Geometry3D(faces[0]->GetEdge(0)->GetVertex(0)->GetCoordim())
72{
74 m_globalID = id;
75 m_faces = faces;
76
81}
PointGeom * GetVertex(int i) const
Returns vertex i of this object.
Definition Geometry.h:361
int GetCoordim() const
Return the coordinate dimension of this object (i.e. the dimension of the space in which this object ...
Definition Geometry.h:279
Geometry1D * GetEdge(int i) const
Returns edge i of this object.
Definition Geometry.h:369
std::array< QuadGeom *, kNfaces > m_faces
Definition HexGeom.h:114

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

◆ ~HexGeom()

Nektar::SpatialDomains::HexGeom::~HexGeom ( )
overridedefault

Member Function Documentation

◆ SetUpEdgeOrientation()

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

Definition at line 659 of file HexGeom.cpp.

660{
661
662 // This 2D array holds the local id's of all the vertices
663 // for every edge. For every edge, they are ordered to what we
664 // define as being Forwards
665 const unsigned int edgeVerts[kNedges][2] = {{0, 1}, {1, 2}, {2, 3}, {3, 0},
666 {0, 4}, {1, 5}, {2, 6}, {3, 7},
667 {4, 5}, {5, 6}, {6, 7}, {7, 4}};
668
669 int i;
670 for (i = 0; i < kNedges; i++)
671 {
672 if (m_edges[i]->GetVid(0) == m_verts[edgeVerts[i][0]]->GetGlobalID())
673 {
675 }
676 else if (m_edges[i]->GetVid(0) ==
677 m_verts[edgeVerts[i][1]]->GetGlobalID())
678 {
680 }
681 else
682 {
683 ASSERTL0(false, "Could not find matching vertex for the edge");
684 }
685 }
686}
#define ASSERTL0(condition, msg)
int GetVid(int i) const
Returns global id of vertex i of this object.
Definition Geometry.h:353
int GetGlobalID(void) const
Get the ID of this object.
Definition Geometry.h:322
std::array< StdRegions::Orientation, kNedges > m_eorient
Definition HexGeom.h:115
std::array< SegGeom *, kNedges > m_edges
Definition HexGeom.h:113
std::array< PointGeom *, kNverts > m_verts
Definition HexGeom.h:112
static const int kNedges
Definition HexGeom.h:49

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

Referenced by HexGeom().

◆ SetUpFaceOrientation()

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

Definition at line 433 of file HexGeom.cpp.

434{
435 int f, i;
436
437 // These arrays represent the vector of the A and B
438 // coordinate of the local elemental coordinate system
439 // where A corresponds with the coordinate direction xi_i
440 // with the lowest index i (for that particular face)
441 // Coordinate 'B' then corresponds to the other local
442 // coordinate (i.e. with the highest index)
443 Array<OneD, NekDouble> elementAaxis(m_coordim);
444 Array<OneD, NekDouble> elementBaxis(m_coordim);
445
446 // These arrays correspond to the local coordinate
447 // system of the face itself (i.e. the Geometry2D)
448 // faceAaxis correspond to the xi_0 axis
449 // faceBaxis correspond to the xi_1 axis
450 Array<OneD, NekDouble> faceAaxis(m_coordim);
451 Array<OneD, NekDouble> faceBaxis(m_coordim);
452
453 // This is the base vertex of the face (i.e. the Geometry2D)
454 // This corresponds to thevertex with local ID 0 of the
455 // Geometry2D
456 unsigned int baseVertex;
457
458 // The lenght of the vectors above
459 NekDouble elementAaxis_length;
460 NekDouble elementBaxis_length;
461 NekDouble faceAaxis_length;
462 NekDouble faceBaxis_length;
463
464 // This 2D array holds the local id's of all the vertices
465 // for every face. For every face, they are ordered in such
466 // a way that the implementation below allows a unified approach
467 // for all faces.
468 const unsigned int faceVerts[kNfaces][QuadGeom::kNverts] = {
469 {0, 1, 2, 3}, {0, 1, 5, 4}, {1, 2, 6, 5},
470 {3, 2, 6, 7}, {0, 3, 7, 4}, {4, 5, 6, 7}};
471
472 NekDouble dotproduct1 = 0.0;
473 NekDouble dotproduct2 = 0.0;
474
475 unsigned int orientation;
476
477 // Loop over all the faces to set up the orientation
478 for (f = 0; f < kNqfaces + kNtfaces; f++)
479 {
480 // initialisation
481 elementAaxis_length = 0.0;
482 elementBaxis_length = 0.0;
483 faceAaxis_length = 0.0;
484 faceBaxis_length = 0.0;
485
486 dotproduct1 = 0.0;
487 dotproduct2 = 0.0;
488
489 baseVertex = m_faces[f]->GetVid(0);
490
491 // We are going to construct the vectors representing the A and B axis
492 // of every face. These vectors will be constructed as a
493 // vector-representation
494 // of the edges of the face. However, for both coordinate directions, we
495 // can
496 // represent the vectors by two different edges. That's why we need to
497 // make sure that
498 // we pick the edge to which the baseVertex of the
499 // Geometry2D-representation of the face
500 // belongs...
501 if (baseVertex == m_verts[faceVerts[f][0]]->GetGlobalID())
502 {
503 for (i = 0; i < m_coordim; i++)
504 {
505 elementAaxis[i] = (*m_verts[faceVerts[f][1]])[i] -
506 (*m_verts[faceVerts[f][0]])[i];
507 elementBaxis[i] = (*m_verts[faceVerts[f][3]])[i] -
508 (*m_verts[faceVerts[f][0]])[i];
509 }
510 }
511 else if (baseVertex == m_verts[faceVerts[f][1]]->GetGlobalID())
512 {
513 for (i = 0; i < m_coordim; i++)
514 {
515 elementAaxis[i] = (*m_verts[faceVerts[f][1]])[i] -
516 (*m_verts[faceVerts[f][0]])[i];
517 elementBaxis[i] = (*m_verts[faceVerts[f][2]])[i] -
518 (*m_verts[faceVerts[f][1]])[i];
519 }
520 }
521 else if (baseVertex == m_verts[faceVerts[f][2]]->GetGlobalID())
522 {
523 for (i = 0; i < m_coordim; i++)
524 {
525 elementAaxis[i] = (*m_verts[faceVerts[f][2]])[i] -
526 (*m_verts[faceVerts[f][3]])[i];
527 elementBaxis[i] = (*m_verts[faceVerts[f][2]])[i] -
528 (*m_verts[faceVerts[f][1]])[i];
529 }
530 }
531 else if (baseVertex == m_verts[faceVerts[f][3]]->GetGlobalID())
532 {
533 for (i = 0; i < m_coordim; i++)
534 {
535 elementAaxis[i] = (*m_verts[faceVerts[f][2]])[i] -
536 (*m_verts[faceVerts[f][3]])[i];
537 elementBaxis[i] = (*m_verts[faceVerts[f][3]])[i] -
538 (*m_verts[faceVerts[f][0]])[i];
539 }
540 }
541 else
542 {
543 ASSERTL0(false, "Could not find matching vertex for the face");
544 }
545
546 // Now, construct the edge-vectors of the local coordinates of
547 // the Geometry2D-representation of the face
548 for (i = 0; i < m_coordim; i++)
549 {
550 faceAaxis[i] =
551 (*m_faces[f]->GetVertex(1))[i] - (*m_faces[f]->GetVertex(0))[i];
552 faceBaxis[i] =
553 (*m_faces[f]->GetVertex(3))[i] - (*m_faces[f]->GetVertex(0))[i];
554
555 elementAaxis_length += pow(elementAaxis[i], 2);
556 elementBaxis_length += pow(elementBaxis[i], 2);
557 faceAaxis_length += pow(faceAaxis[i], 2);
558 faceBaxis_length += pow(faceBaxis[i], 2);
559 }
560
561 elementAaxis_length = std::sqrt(elementAaxis_length);
562 elementBaxis_length = std::sqrt(elementBaxis_length);
563 faceAaxis_length = std::sqrt(faceAaxis_length);
564 faceBaxis_length = std::sqrt(faceBaxis_length);
565
566 // Calculate the inner product of both the A-axis
567 // (i.e. Elemental A axis and face A axis)
568 for (i = 0; i < m_coordim; i++)
569 {
570 dotproduct1 += elementAaxis[i] * faceAaxis[i];
571 }
572
573 NekDouble norm =
574 fabs(dotproduct1) / elementAaxis_length / faceAaxis_length;
575 orientation = 0;
576
577 // if the innerproduct is equal to the (absolute value of the ) products
578 // of the lengths of both vectors, then, the coordinate systems will NOT
579 // be transposed
580 if (fabs(norm - 1.0) < NekConstants::kNekZeroTol)
581 {
582 // if the inner product is negative, both A-axis point
583 // in reverse direction
584 if (dotproduct1 < 0.0)
585 {
586 orientation += 2;
587 }
588
589 // calculate the inner product of both B-axis
590 for (i = 0; i < m_coordim; i++)
591 {
592 dotproduct2 += elementBaxis[i] * faceBaxis[i];
593 }
594
595 norm = fabs(dotproduct2) / elementBaxis_length / faceBaxis_length;
596
597 // check that both these axis are indeed parallel
598 ASSERTL1(fabs(norm - 1.0) < NekConstants::kNekZeroTol,
599 "These vectors should be parallel");
600
601 // if the inner product is negative, both B-axis point
602 // in reverse direction
603 if (dotproduct2 < 0.0)
604 {
605 orientation++;
606 }
607 }
608 // The coordinate systems are transposed
609 else
610 {
611 orientation = 4;
612
613 // Calculate the inner product between the elemental A-axis
614 // and the B-axis of the face (which are now the corresponding axis)
615 dotproduct1 = 0.0;
616 for (i = 0; i < m_coordim; i++)
617 {
618 dotproduct1 += elementAaxis[i] * faceBaxis[i];
619 }
620
621 norm = fabs(dotproduct1) / elementAaxis_length / faceBaxis_length;
622
623 // check that both these axis are indeed parallel
624 ASSERTL1(fabs(norm - 1.0) < NekConstants::kNekZeroTol,
625 "These vectors should be parallel");
626
627 // if the result is negative, both axis point in reverse
628 // directions
629 if (dotproduct1 < 0.0)
630 {
631 orientation += 2;
632 }
633
634 // Do the same for the other two corresponding axis
635 dotproduct2 = 0.0;
636 for (i = 0; i < m_coordim; i++)
637 {
638 dotproduct2 += elementBaxis[i] * faceAaxis[i];
639 }
640
641 norm = fabs(dotproduct2) / elementBaxis_length / faceAaxis_length;
642
643 // check that both these axis are indeed parallel
644 ASSERTL1(fabs(norm - 1.0) < NekConstants::kNekZeroTol,
645 "These vectors should be parallel");
646
647 if (dotproduct2 < 0.0)
648 {
649 orientation++;
650 }
651 }
652
653 orientation = orientation + 5;
654 // Fill the m_forient array
655 m_forient[f] = (StdRegions::Orientation)orientation;
656 }
657}
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
int m_coordim
Coordinate dimension of this geometry object.
Definition Geometry.h:183
static const int kNfaces
Definition HexGeom.h:52
std::array< StdRegions::Orientation, kNfaces > m_forient
Definition HexGeom.h:116
static const int kNqfaces
Definition HexGeom.h:50
static const int kNtfaces
Definition HexGeom.h:51
static const NekDouble kNekZeroTol

References ASSERTL0, ASSERTL1, Nektar::SpatialDomains::Geometry::GetGlobalID(), Nektar::SpatialDomains::Geometry::GetVertex(), Nektar::NekConstants::kNekZeroTol, kNfaces, kNqfaces, kNtfaces, Nektar::SpatialDomains::QuadGeom::kNverts, Nektar::SpatialDomains::Geometry::m_coordim, m_faces, m_forient, and m_verts.

Referenced by HexGeom().

◆ SetUpLocalEdges()

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

Definition at line 201 of file HexGeom.cpp.

202{
203 // find edge 0
204 int i, j;
205 unsigned int check;
206
207 // First set up the 4 bottom edges
208 int f;
209 for (f = 1; f < 5; f++)
210 {
211 check = 0;
212 for (i = 0; i < 4; i++)
213 {
214 for (j = 0; j < 4; j++)
215 {
216 if ((m_faces[0])->GetEid(i) == (m_faces[f])->GetEid(j))
217 {
218 m_edges[f - 1] =
219 static_cast<SegGeom *>((m_faces[0])->GetEdge(i));
220 check++;
221 }
222 }
223 }
224
225 if (check < 1)
226 {
227 std::ostringstream errstrm;
228 errstrm << "Connected faces do not share an edge. Faces ";
229 errstrm << (m_faces[0])->GetGlobalID() << ", "
230 << (m_faces[f])->GetGlobalID();
231 ASSERTL0(false, errstrm.str());
232 }
233 else if (check > 1)
234 {
235 std::ostringstream errstrm;
236 errstrm << "Connected faces share more than one edge. Faces ";
237 errstrm << (m_faces[0])->GetGlobalID() << ", "
238 << (m_faces[f])->GetGlobalID();
239 ASSERTL0(false, errstrm.str());
240 }
241 }
242
243 // Then, set up the 4 vertical edges
244 check = 0;
245 for (i = 0; i < 4; i++)
246 {
247 for (j = 0; j < 4; j++)
248 {
249 if ((m_faces[1])->GetEid(i) == (m_faces[4])->GetEid(j))
250 {
251 m_edges[4] = static_cast<SegGeom *>((m_faces[1])->GetEdge(i));
252 check++;
253 }
254 }
255 }
256 if (check < 1)
257 {
258 std::ostringstream errstrm;
259 errstrm << "Connected faces do not share an edge. Faces ";
260 errstrm << (m_faces[1])->GetGlobalID() << ", "
261 << (m_faces[4])->GetGlobalID();
262 ASSERTL0(false, errstrm.str());
263 }
264 else if (check > 1)
265 {
266 std::ostringstream errstrm;
267 errstrm << "Connected faces share more than one edge. Faces ";
268 errstrm << (m_faces[1])->GetGlobalID() << ", "
269 << (m_faces[4])->GetGlobalID();
270 ASSERTL0(false, errstrm.str());
271 }
272 for (f = 1; f < 4; f++)
273 {
274 check = 0;
275 for (i = 0; i < 4; i++)
276 {
277 for (j = 0; j < 4; j++)
278 {
279 if ((m_faces[f])->GetEid(i) == (m_faces[f + 1])->GetEid(j))
280 {
281 m_edges[f + 4] =
282 static_cast<SegGeom *>((m_faces[f])->GetEdge(i));
283 check++;
284 }
285 }
286 }
287
288 if (check < 1)
289 {
290 std::ostringstream errstrm;
291 errstrm << "Connected faces do not share an edge. Faces ";
292 errstrm << (m_faces[f])->GetGlobalID() << ", "
293 << (m_faces[f + 1])->GetGlobalID();
294 ASSERTL0(false, errstrm.str());
295 }
296 else if (check > 1)
297 {
298 std::ostringstream errstrm;
299 errstrm << "Connected faces share more than one edge. Faces ";
300 errstrm << (m_faces[f])->GetGlobalID() << ", "
301 << (m_faces[f + 1])->GetGlobalID();
302 ASSERTL0(false, errstrm.str());
303 }
304 }
305
306 // Finally, set up the 4 top vertices
307 for (f = 1; f < 5; f++)
308 {
309 check = 0;
310 for (i = 0; i < 4; i++)
311 {
312 for (j = 0; j < 4; j++)
313 {
314 if ((m_faces[5])->GetEid(i) == (m_faces[f])->GetEid(j))
315 {
316 m_edges[f + 7] =
317 static_cast<SegGeom *>((m_faces[5])->GetEdge(i));
318 check++;
319 }
320 }
321 }
322
323 if (check < 1)
324 {
325 std::ostringstream errstrm;
326 errstrm << "Connected faces do not share an edge. Faces ";
327 errstrm << (m_faces[5])->GetGlobalID() << ", "
328 << (m_faces[f])->GetGlobalID();
329 ASSERTL0(false, errstrm.str());
330 }
331 else if (check > 1)
332 {
333 std::ostringstream errstrm;
334 errstrm << "Connected faces share more than one edge. Faces ";
335 errstrm << (m_faces[5])->GetGlobalID() << ", "
336 << (m_faces[f])->GetGlobalID();
337 ASSERTL0(false, errstrm.str());
338 }
339 }
340}
int GetEid(int i) const
Get the ID of edge i of this object.
Definition Geometry.cpp:110

References ASSERTL0, Nektar::SpatialDomains::Geometry::GetEdge(), Nektar::SpatialDomains::Geometry::GetEid(), Nektar::SpatialDomains::Geometry::GetGlobalID(), m_edges, and m_faces.

Referenced by HexGeom().

◆ SetUpLocalVertices()

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

Definition at line 342 of file HexGeom.cpp.

343{
344 // Set up the first 2 vertices (i.e. vertex 0,1)
345 if ((m_edges[0]->GetVid(0) == m_edges[1]->GetVid(0)) ||
346 (m_edges[0]->GetVid(0) == m_edges[1]->GetVid(1)))
347 {
348 m_verts[0] = m_edges[0]->GetVertex(1);
349 m_verts[1] = m_edges[0]->GetVertex(0);
350 }
351 else if ((m_edges[0]->GetVid(1) == m_edges[1]->GetVid(0)) ||
352 (m_edges[0]->GetVid(1) == m_edges[1]->GetVid(1)))
353 {
354 m_verts[0] = m_edges[0]->GetVertex(0);
355 m_verts[1] = m_edges[0]->GetVertex(1);
356 }
357 else
358 {
359 std::ostringstream errstrm;
360 errstrm << "Connected edges do not share a vertex. Edges ";
361 errstrm << m_edges[0]->GetGlobalID() << ", "
362 << m_edges[1]->GetGlobalID();
363 ASSERTL0(false, errstrm.str());
364 }
365
366 // set up the other bottom vertices (i.e. vertex 2,3)
367 int i;
368 for (i = 1; i < 3; i++)
369 {
370 if (m_edges[i]->GetVid(0) == m_verts[i]->GetGlobalID())
371 {
372 m_verts[i + 1] = m_edges[i]->GetVertex(1);
373 }
374 else if (m_edges[i]->GetVid(1) == m_verts[i]->GetGlobalID())
375 {
376 m_verts[i + 1] = m_edges[i]->GetVertex(0);
377 }
378 else
379 {
380 std::ostringstream errstrm;
381 errstrm << "Connected edges do not share a vertex. Edges ";
382 errstrm << m_edges[i]->GetGlobalID() << ", "
383 << m_edges[i - 1]->GetGlobalID();
384 ASSERTL0(false, errstrm.str());
385 }
386 }
387
388 // set up top vertices
389 // First, set up vertices 4,5
390 if ((m_edges[8]->GetVid(0) == m_edges[9]->GetVid(0)) ||
391 (m_edges[8]->GetVid(0) == m_edges[9]->GetVid(1)))
392 {
393 m_verts[4] = m_edges[8]->GetVertex(1);
394 m_verts[5] = m_edges[8]->GetVertex(0);
395 }
396 else if ((m_edges[8]->GetVid(1) == m_edges[9]->GetVid(0)) ||
397 (m_edges[8]->GetVid(1) == m_edges[9]->GetVid(1)))
398 {
399 m_verts[4] = m_edges[8]->GetVertex(0);
400 m_verts[5] = m_edges[8]->GetVertex(1);
401 }
402 else
403 {
404 std::ostringstream errstrm;
405 errstrm << "Connected edges do not share a vertex. Edges ";
406 errstrm << m_edges[8]->GetGlobalID() << ", "
407 << m_edges[9]->GetGlobalID();
408 ASSERTL0(false, errstrm.str());
409 }
410
411 // set up the other top vertices (i.e. vertex 6,7)
412 for (i = 9; i < 11; i++)
413 {
414 if (m_edges[i]->GetVid(0) == m_verts[i - 4]->GetGlobalID())
415 {
416 m_verts[i - 3] = m_edges[i]->GetVertex(1);
417 }
418 else if (m_edges[i]->GetVid(1) == m_verts[i - 4]->GetGlobalID())
419 {
420 m_verts[i - 3] = m_edges[i]->GetVertex(0);
421 }
422 else
423 {
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();
428 ASSERTL0(false, errstrm.str());
429 }
430 }
431}

References ASSERTL0, Nektar::SpatialDomains::Geometry::GetGlobalID(), Nektar::SpatialDomains::Geometry::GetVid(), m_edges, and m_verts.

Referenced by HexGeom().

◆ SetUpXmap()

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

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

Definition at line 719 of file HexGeom.cpp.

720{
721 // Determine necessary order for standard region. This can almost certainly
722 // be simplified but works for now!
723 std::vector<int> tmp1;
724
725 if (m_forient[0] < 9)
726 {
727 tmp1.push_back(m_faces[0]->GetXmap()->GetTraceNcoeffs(0));
728 tmp1.push_back(m_faces[0]->GetXmap()->GetTraceNcoeffs(2));
729 }
730 else
731 {
732 tmp1.push_back(m_faces[0]->GetXmap()->GetTraceNcoeffs(1));
733 tmp1.push_back(m_faces[0]->GetXmap()->GetTraceNcoeffs(3));
734 }
735
736 if (m_forient[5] < 9)
737 {
738 tmp1.push_back(m_faces[5]->GetXmap()->GetTraceNcoeffs(0));
739 tmp1.push_back(m_faces[5]->GetXmap()->GetTraceNcoeffs(2));
740 }
741 else
742 {
743 tmp1.push_back(m_faces[5]->GetXmap()->GetTraceNcoeffs(1));
744 tmp1.push_back(m_faces[5]->GetXmap()->GetTraceNcoeffs(3));
745 }
746
747 int order0 = *std::max_element(tmp1.begin(), tmp1.end());
748
749 tmp1.clear();
750
751 if (m_forient[0] < 9)
752 {
753 tmp1.push_back(m_faces[0]->GetXmap()->GetTraceNcoeffs(1));
754 tmp1.push_back(m_faces[0]->GetXmap()->GetTraceNcoeffs(3));
755 }
756 else
757 {
758 tmp1.push_back(m_faces[0]->GetXmap()->GetTraceNcoeffs(0));
759 tmp1.push_back(m_faces[0]->GetXmap()->GetTraceNcoeffs(2));
760 }
761
762 if (m_forient[5] < 9)
763 {
764 tmp1.push_back(m_faces[5]->GetXmap()->GetTraceNcoeffs(1));
765 tmp1.push_back(m_faces[5]->GetXmap()->GetTraceNcoeffs(3));
766 }
767 else
768 {
769 tmp1.push_back(m_faces[5]->GetXmap()->GetTraceNcoeffs(0));
770 tmp1.push_back(m_faces[5]->GetXmap()->GetTraceNcoeffs(2));
771 }
772
773 int order1 = *std::max_element(tmp1.begin(), tmp1.end());
774
775 tmp1.clear();
776
777 if (m_forient[1] < 9)
778 {
779 tmp1.push_back(m_faces[1]->GetXmap()->GetTraceNcoeffs(1));
780 tmp1.push_back(m_faces[1]->GetXmap()->GetTraceNcoeffs(3));
781 }
782 else
783 {
784 tmp1.push_back(m_faces[1]->GetXmap()->GetTraceNcoeffs(0));
785 tmp1.push_back(m_faces[1]->GetXmap()->GetTraceNcoeffs(2));
786 }
787
788 if (m_forient[3] < 9)
789 {
790 tmp1.push_back(m_faces[3]->GetXmap()->GetTraceNcoeffs(1));
791 tmp1.push_back(m_faces[3]->GetXmap()->GetTraceNcoeffs(3));
792 }
793 else
794 {
795 tmp1.push_back(m_faces[3]->GetXmap()->GetTraceNcoeffs(0));
796 tmp1.push_back(m_faces[3]->GetXmap()->GetTraceNcoeffs(2));
797 }
798
799 int order2 = *std::max_element(tmp1.begin(), tmp1.end());
800
801 std::array<LibUtilities::BasisKey, 3> basis = {
802 LibUtilities::BasisKey(
804 LibUtilities::PointsKey(order0 + 1,
806 LibUtilities::BasisKey(
808 LibUtilities::PointsKey(order1 + 1,
810 LibUtilities::BasisKey(
812 LibUtilities::PointsKey(order2 + 1,
814
815 m_xmap = GetStdHexFactory().CreateInstance(basis);
816}
StdRegions::StdExpansionSharedPtr m_xmap
mapping containing isoparametric transformation.
Definition Geometry.h:189
StdRegions::StdExpansionSharedPtr GetXmap() const
Return the mapping object Geometry::m_xmap that represents the coordinate transformation from standar...
Definition Geometry.h:439
@ eGaussLobattoLegendre
1D Gauss-Lobatto-Legendre quadrature points
Definition PointsType.h:51
@ eModified_A
Principle Modified Functions .
Definition BasisType.h:48
XmapFactory< StdRegions::StdHexExp, 3 > & GetStdHexFactory()
Definition HexGeom.cpp:46

References Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eModified_A, Nektar::SpatialDomains::GetStdHexFactory(), Nektar::SpatialDomains::Geometry::GetXmap(), m_faces, m_forient, and Nektar::SpatialDomains::Geometry::m_xmap.

Referenced by v_Reset(), and v_Setup().

◆ v_FillGeom()

void Nektar::SpatialDomains::HexGeom::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 826 of file HexGeom.cpp.

827{
828 if (m_state == ePtsFilled)
829 {
830 return;
831 }
832
833 int i, j, k;
834
835 for (i = 0; i < kNfaces; i++)
836 {
837 m_faces[i]->FillGeom();
838
839 int nFaceCoeffs = m_faces[i]->GetXmap()->GetNcoeffs();
840
841 Array<OneD, unsigned int> mapArray(nFaceCoeffs);
842 Array<OneD, int> signArray(nFaceCoeffs);
843
844 if (m_forient[i] < 9)
845 {
846 m_xmap->GetTraceToElementMap(
847 i, mapArray, signArray, m_forient[i],
848 m_faces[i]->GetXmap()->GetTraceNcoeffs(0),
849 m_faces[i]->GetXmap()->GetTraceNcoeffs(1));
850 }
851 else
852 {
853 m_xmap->GetTraceToElementMap(
854 i, mapArray, signArray, m_forient[i],
855 m_faces[i]->GetXmap()->GetTraceNcoeffs(1),
856 m_faces[i]->GetXmap()->GetTraceNcoeffs(0));
857 }
858
859 for (j = 0; j < m_coordim; j++)
860 {
861 const Array<OneD, const NekDouble> &coeffs =
862 m_faces[i]->GetCoeffs(j);
863
864 for (k = 0; k < nFaceCoeffs; k++)
865 {
866 NekDouble v = signArray[k] * coeffs[k];
867 m_coeffs[j][mapArray[k]] = v;
868 }
869 }
870 }
871
873}
GeomState m_state
Enumeration to dictate whether coefficients are filled.
Definition Geometry.h:191
Array< OneD, Array< OneD, NekDouble > > m_coeffs
Array containing expansion coefficients of m_xmap.
Definition Geometry.h:201
@ 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_GenGeomFactors().

◆ v_GenGeomFactors()

void Nektar::SpatialDomains::HexGeom::v_GenGeomFactors ( )
overrideprotectedvirtual

Implements Nektar::SpatialDomains::Geometry.

Definition at line 83 of file HexGeom.cpp.

84{
85 if (!m_setupState)
86 {
88 }
89
91 {
92 GeomType Gtype = eRegular;
93
94 v_FillGeom();
95
96 // check to see if expansions are linear
98 if (m_xmap->GetBasisNumModes(0) != 2 ||
99 m_xmap->GetBasisNumModes(1) != 2 ||
100 m_xmap->GetBasisNumModes(2) != 2)
101 {
102 Gtype = eDeformed;
103 m_straightEdge = 0;
104 }
105
106 // check to see if all faces are parallelograms
107 if (Gtype == eRegular)
108 {
109 m_isoParameter = Array<OneD, Array<OneD, NekDouble>>(3);
110 for (int i = 0; i < 3; ++i)
111 {
112 m_isoParameter[i] = Array<OneD, NekDouble>(8, 0.);
113 NekDouble A = (*m_verts[0])(i);
114 NekDouble B = (*m_verts[1])(i);
115 NekDouble C = (*m_verts[2])(i);
116 NekDouble D = (*m_verts[3])(i);
117 NekDouble E = (*m_verts[4])(i);
118 NekDouble F = (*m_verts[5])(i);
119 NekDouble G = (*m_verts[6])(i);
120 NekDouble H = (*m_verts[7])(i);
121 m_isoParameter[i][0] =
122 0.125 * (A + B + C + D + E + F + G + H); // 1
123
124 m_isoParameter[i][1] =
125 0.125 * (-A + B + C - D - E + F + G - H); // xi1
126 m_isoParameter[i][2] =
127 0.125 * (-A - B + C + D - E - F + G + H); // xi2
128 m_isoParameter[i][3] =
129 0.125 * (-A - B - C - D + E + F + G + H); // xi3
130
131 m_isoParameter[i][4] =
132 0.125 * (A - B + C - D + E - F + G - H); // xi1*xi2
133 m_isoParameter[i][5] =
134 0.125 * (A + B - C - D - E - F + G + H); // xi2*xi3
135 m_isoParameter[i][6] =
136 0.125 * (A - B - C + D - E + F + G - H); // xi1*xi3
137
138 m_isoParameter[i][7] =
139 0.125 * (-A + B - C + D + E - F + G - H); // xi1*xi2*xi3
140 NekDouble tmp = fabs(m_isoParameter[i][1]) +
141 fabs(m_isoParameter[i][2]) +
142 fabs(m_isoParameter[i][3]);
144 for (int d = 4; d < 8; ++d)
145 {
146 if (fabs(m_isoParameter[i][d]) > tmp)
147 {
148 Gtype = eDeformed;
149 }
150 }
151 }
152 }
153
154 if (Gtype == eRegular)
155 {
157 }
158
160 Gtype, m_coordim, m_xmap, m_coeffs);
162 }
163}
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
bool m_setupState
Wether or not the setup routines have been run.
Definition Geometry.h:193
Array< OneD, Array< OneD, NekDouble > > m_isoParameter
Definition Geometry.h:204
GeomState m_geomFactorsState
State of the geometric factors.
Definition Geometry.h:187
GeomFactorsSharedPtr m_geomFactors
Geometric factors.
Definition Geometry.h:185
void v_FillGeom() override
Put all quadrature information into face/edge structure and backward transform.
Definition HexGeom.cpp:826
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::vector< double > d(NPUPPER *NPUPPER)

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::SpatialDomains::eDeformed, Nektar::SpatialDomains::ePtsFilled, Nektar::SpatialDomains::eRegular, Nektar::NekConstants::kNekZeroTol, Nektar::SpatialDomains::Geometry::m_coeffs, Nektar::SpatialDomains::Geometry::m_coordim, Nektar::SpatialDomains::Geometry::m_geomFactors, Nektar::SpatialDomains::Geometry::m_geomFactorsState, Nektar::SpatialDomains::Geometry::m_isoParameter, Nektar::SpatialDomains::Geometry::m_setupState, Nektar::SpatialDomains::Geometry::m_straightEdge, m_verts, Nektar::SpatialDomains::Geometry::m_xmap, Nektar::SpatialDomains::Geometry3D::v_CalculateInverseIsoParam(), v_FillGeom(), and v_Setup().

◆ v_GetDir()

int Nektar::SpatialDomains::HexGeom::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 185 of file HexGeom.cpp.

186{
187 if (faceidx == 0 || faceidx == 5)
188 {
189 return facedir;
190 }
191 else if (faceidx == 1 || faceidx == 3)
192 {
193 return 2 * facedir;
194 }
195 else
196 {
197 return 1 + facedir;
198 }
199}

◆ v_GetEdge()

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

Returns edge i of this object.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 92 of file HexGeom.h.

93 {
94 return static_cast<Geometry1D *>(m_edges[i]);
95 }

References m_edges.

◆ v_GetEdgeFaceMap()

int Nektar::SpatialDomains::HexGeom::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 175 of file HexGeom.cpp.

176{
177 return EdgeFaceConnectivity[i][j];
178}
static const unsigned int EdgeFaceConnectivity[12][2]
Definition HexGeom.h:127

References EdgeFaceConnectivity.

◆ v_GetEdgeNormalToFaceVert()

int Nektar::SpatialDomains::HexGeom::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 180 of file HexGeom.cpp.

181{
182 return EdgeNormalToFaceVert[i][j];
183}
static const unsigned int EdgeNormalToFaceVert[6][4]
Definition HexGeom.h:128

References EdgeNormalToFaceVert.

◆ v_GetEorient()

StdRegions::Orientation Nektar::SpatialDomains::HexGeom::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 102 of file HexGeom.h.

103 {
104 return m_eorient[i];
105 }

References m_eorient.

◆ v_GetFace()

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

Returns face i of this object.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 97 of file HexGeom.h.

98 {
99 return static_cast<Geometry2D *>(m_faces[i]);
100 }

References m_faces.

◆ v_GetForient()

StdRegions::Orientation Nektar::SpatialDomains::HexGeom::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 107 of file HexGeom.h.

108 {
109 return m_forient[i];
110 }

References m_forient.

◆ v_GetNumEdges()

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

Get the number of edges of this object.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 77 of file HexGeom.h.

78 {
79 return kNedges;
80 }

References kNedges.

◆ v_GetNumFaces()

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

Get the number of faces of this object.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 82 of file HexGeom.h.

83 {
84 return kNfaces;
85 }

References kNfaces.

◆ v_GetNumVerts()

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

Get the number of vertices of this object.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 72 of file HexGeom.h.

73 {
74 return kNverts;
75 }
static const int kNverts
Definition HexGeom.h:48

References kNverts.

◆ v_GetVertex()

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

Returns vertex i of this object.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 87 of file HexGeom.h.

88 {
89 return m_verts[i];
90 }

References m_verts.

◆ v_GetVertexEdgeMap()

int Nektar::SpatialDomains::HexGeom::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 165 of file HexGeom.cpp.

166{
167 return VertexEdgeConnectivity[i][j];
168}
static const unsigned int VertexEdgeConnectivity[8][3]
Definition HexGeom.h:125

References VertexEdgeConnectivity.

◆ v_GetVertexFaceMap()

int Nektar::SpatialDomains::HexGeom::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 170 of file HexGeom.cpp.

171{
172 return VertexFaceConnectivity[i][j];
173}
static const unsigned int VertexFaceConnectivity[8][3]
Definition HexGeom.h:126

References VertexFaceConnectivity.

◆ v_Reset()

void Nektar::SpatialDomains::HexGeom::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 688 of file HexGeom.cpp.

689{
690 Geometry::v_Reset(curvedEdges, curvedFaces);
691
692 for (int i = 0; i < 6; ++i)
693 {
694 m_faces[i]->Reset(curvedEdges, curvedFaces);
695 }
696
697 SetUpXmap();
698 SetUpCoeffs(m_xmap->GetNcoeffs());
699}
void SetUpCoeffs(const int nCoeffs)
Initialise the Geometry::m_coeffs array.
Definition Geometry.h:704
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:372
void SetUpXmap()
Set up the m_xmap object by determining the order of each direction from derived faces.
Definition HexGeom.cpp:719

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

◆ v_Setup()

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

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 701 of file HexGeom.cpp.

702{
703 if (!m_setupState)
704 {
705 for (int i = 0; i < 6; ++i)
706 {
707 m_faces[i]->Setup();
708 }
709 SetUpXmap();
710 SetUpCoeffs(m_xmap->GetNcoeffs());
711 m_setupState = true;
712 }
713}

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

Referenced by v_GenGeomFactors().

Member Data Documentation

◆ EdgeFaceConnectivity

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

Definition at line 127 of file HexGeom.h.

Referenced by v_GetEdgeFaceMap().

◆ EdgeNormalToFaceVert

const unsigned int Nektar::SpatialDomains::HexGeom::EdgeNormalToFaceVert
staticprivate
Initial value:
= {
{4, 5, 6, 7}, {1, 3, 9, 11}, {0, 2, 8, 10},
{1, 3, 9, 11}, {0, 2, 8, 10}, {4, 5, 6, 7}}

Definition at line 128 of file HexGeom.h.

Referenced by v_GetEdgeNormalToFaceVert().

◆ kNedges

const int Nektar::SpatialDomains::HexGeom::kNedges = 12
static

Definition at line 49 of file HexGeom.h.

Referenced by SetUpEdgeOrientation(), and v_GetNumEdges().

◆ kNfaces

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

◆ kNfacets

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

Definition at line 53 of file HexGeom.h.

◆ kNqfaces

const int Nektar::SpatialDomains::HexGeom::kNqfaces = 6
static

◆ kNtfaces

const int Nektar::SpatialDomains::HexGeom::kNtfaces = 0
static

◆ kNverts

const int Nektar::SpatialDomains::HexGeom::kNverts = 8
static

Definition at line 48 of file HexGeom.h.

Referenced by v_GetNumVerts().

◆ m_edges

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

Definition at line 113 of file HexGeom.h.

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

◆ m_eorient

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

Definition at line 115 of file HexGeom.h.

Referenced by SetUpEdgeOrientation(), and v_GetEorient().

◆ m_faces

std::array<QuadGeom *, kNfaces> Nektar::SpatialDomains::HexGeom::m_faces
protected

◆ m_forient

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

Definition at line 116 of file HexGeom.h.

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

◆ m_verts

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

◆ VertexEdgeConnectivity

const unsigned int Nektar::SpatialDomains::HexGeom::VertexEdgeConnectivity
staticprivate
Initial value:
= {
{0, 3, 4}, {0, 1, 5}, {1, 2, 6}, {2, 3, 7},
{4, 8, 11}, {5, 8, 9}, {6, 9, 10}, {7, 10, 11}}

Definition at line 125 of file HexGeom.h.

Referenced by v_GetVertexEdgeMap().

◆ VertexFaceConnectivity

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

Definition at line 126 of file HexGeom.h.

Referenced by v_GetVertexFaceMap().

◆ XMLElementType

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

Definition at line 54 of file HexGeom.h.