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

#include <PrismGeom.h>

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

Public Member Functions

 PrismGeom ()
 
 PrismGeom (int id, std::array< Geometry2D *, PrismGeom::kNfaces > faces)
 
 ~PrismGeom () 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 = 6
 
static const int kNedges = 9
 
static const int kNqfaces = 3
 
static const int kNtfaces = 2
 
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< Geometry2D *, 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 [6][3]
 
static const unsigned int VertexFaceConnectivity [6][3]
 
static const unsigned int EdgeFaceConnectivity [9][2]
 
static const unsigned int EdgeNormalToFaceVert [5][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 PrismGeom.h.

Constructor & Destructor Documentation

◆ PrismGeom() [1/2]

Nektar::SpatialDomains::PrismGeom::PrismGeom ( )

◆ PrismGeom() [2/2]

Nektar::SpatialDomains::PrismGeom::PrismGeom ( int  id,
std::array< Geometry2D *, PrismGeom::kNfaces faces 
)

◆ ~PrismGeom()

Nektar::SpatialDomains::PrismGeom::~PrismGeom ( )
overridedefault

Member Function Documentation

◆ SetUpEdgeOrientation()

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

Definition at line 393 of file PrismGeom.cpp.

394{
395
396 // This 2D array holds the local id's of all the vertices
397 // for every edge. For every edge, they are ordered to what we
398 // define as being Forwards
399 const unsigned int edgeVerts[kNedges][2] = {
400 {0, 1}, {1, 2}, {3, 2}, {0, 3}, {0, 4}, {1, 4}, {2, 5}, {3, 5}, {4, 5}};
401
402 int i;
403 for (i = 0; i < kNedges; i++)
404 {
405 if (m_edges[i]->GetVid(0) == m_verts[edgeVerts[i][0]]->GetGlobalID())
406 {
408 }
409 else if (m_edges[i]->GetVid(0) ==
410 m_verts[edgeVerts[i][1]]->GetGlobalID())
411 {
413 }
414 else
415 {
416 ASSERTL0(false, "Could not find matching vertex for the edge");
417 }
418 }
419}
#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< PointGeom *, kNverts > m_verts
Definition PrismGeom.h:112
std::array< StdRegions::Orientation, kNedges > m_eorient
Definition PrismGeom.h:115
std::array< SegGeom *, kNedges > m_edges
Definition PrismGeom.h:113

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

◆ SetUpFaceOrientation()

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

Definition at line 421 of file PrismGeom.cpp.

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

References ASSERTL0, ASSERTL1, Nektar::StdRegions::eDir1FwdDir2_Dir2FwdDir1, 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, Nektar::SpatialDomains::Geometry::m_globalID, m_verts, and tinysimd::sqrt().

◆ SetUpLocalEdges()

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

Definition at line 185 of file PrismGeom.cpp.

186{
187 // find edge 0
188 int i, j;
189 unsigned int check;
190
191 // First set up the 4 bottom edges
192 int f; // Connected face index
193 for (f = 1; f < 5; f++)
194 {
195 int nEdges = m_faces[f]->GetNumEdges();
196 check = 0;
197 for (i = 0; i < 4; i++)
198 {
199 for (j = 0; j < nEdges; j++)
200 {
201 if (m_faces[0]->GetEid(i) == m_faces[f]->GetEid(j))
202 {
203 m_edges[f - 1] =
204 static_cast<SegGeom *>((m_faces[0])->GetEdge(i));
205 check++;
206 }
207 }
208 }
209
210 if (check < 1)
211 {
212 std::ostringstream errstrm;
213 errstrm << "Connected faces do not share an edge. Faces ";
214 errstrm << (m_faces[0])->GetGlobalID() << ", "
215 << (m_faces[f])->GetGlobalID();
216 ASSERTL0(false, errstrm.str());
217 }
218 else if (check > 1)
219 {
220 std::ostringstream errstrm;
221 errstrm << "Connected faces share more than one edge. Faces ";
222 errstrm << (m_faces[0])->GetGlobalID() << ", "
223 << (m_faces[f])->GetGlobalID();
224 ASSERTL0(false, errstrm.str());
225 }
226 }
227
228 // Then, set up the 4 vertical edges
229 check = 0;
230 for (i = 0; i < 3; i++) // Set up the vertical edge :face(1) and face(4)
231 {
232 for (j = 0; j < 4; j++)
233 {
234 if ((m_faces[1])->GetEid(i) == (m_faces[4])->GetEid(j))
235 {
236 m_edges[4] = static_cast<SegGeom *>((m_faces[1])->GetEdge(i));
237 check++;
238 }
239 }
240 }
241 if (check < 1)
242 {
243 std::ostringstream errstrm;
244 errstrm << "Connected faces do not share an edge. Faces ";
245 errstrm << (m_faces[1])->GetGlobalID() << ", "
246 << (m_faces[4])->GetGlobalID();
247 ASSERTL0(false, errstrm.str());
248 }
249 else if (check > 1)
250 {
251 std::ostringstream errstrm;
252 errstrm << "Connected faces share more than one edge. Faces ";
253 errstrm << (m_faces[1])->GetGlobalID() << ", "
254 << (m_faces[4])->GetGlobalID();
255 ASSERTL0(false, errstrm.str());
256 }
257 // Set up vertical edges: face(1) through face(4)
258 for (f = 1; f < 4; f++)
259 {
260 check = 0;
261 for (i = 0; i < m_faces[f]->GetNumEdges(); i++)
262 {
263 for (j = 0; j < m_faces[f + 1]->GetNumEdges(); j++)
264 {
265 if ((m_faces[f])->GetEid(i) == (m_faces[f + 1])->GetEid(j))
266 {
267 m_edges[f + 4] =
268 static_cast<SegGeom *>((m_faces[f])->GetEdge(i));
269 check++;
270 }
271 }
272 }
273
274 if (check < 1)
275 {
276 std::ostringstream errstrm;
277 errstrm << "Connected faces do not share an edge. Faces ";
278 errstrm << (m_faces[f])->GetGlobalID() << ", "
279 << (m_faces[f + 1])->GetGlobalID();
280 ASSERTL0(false, errstrm.str());
281 }
282 else if (check > 1)
283 {
284 std::ostringstream errstrm;
285 errstrm << "Connected faces share more than one edge. Faces ";
286 errstrm << (m_faces[f])->GetGlobalID() << ", "
287 << (m_faces[f + 1])->GetGlobalID();
288 ASSERTL0(false, errstrm.str());
289 }
290 }
291
292 // Finally, set up the 1 top edge
293 check = 0;
294 for (i = 0; i < 4; i++)
295 {
296 for (j = 0; j < 4; j++)
297 {
298 if ((m_faces[2])->GetEid(i) == (m_faces[4])->GetEid(j))
299 {
300 m_edges[8] = static_cast<SegGeom *>((m_faces[2])->GetEdge(i));
301 check++;
302 }
303 }
304 }
305
306 if (check < 1)
307 {
308 std::ostringstream errstrm;
309 errstrm << "Connected faces do not share an edge. Faces ";
310 errstrm << (m_faces[1])->GetGlobalID() << ", "
311 << (m_faces[3])->GetGlobalID();
312 ASSERTL0(false, errstrm.str());
313 }
314 else if (check > 1)
315 {
316 std::ostringstream errstrm;
317 errstrm << "Connected faces share more than one edge. Faces ";
318 errstrm << (m_faces[1])->GetGlobalID() << ", "
319 << (m_faces[3])->GetGlobalID();
320 ASSERTL0(false, errstrm.str());
321 }
322}
Geometry1D * GetEdge(int i) const
Returns edge i of this object.
Definition Geometry.h:369
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.

◆ SetUpLocalVertices()

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

Definition at line 324 of file PrismGeom.cpp.

325{
326
327 // Set up the first 2 vertices (i.e. vertex 0,1)
328 if ((m_edges[0]->GetVid(0) == m_edges[1]->GetVid(0)) ||
329 (m_edges[0]->GetVid(0) == m_edges[1]->GetVid(1)))
330 {
331 m_verts[0] = m_edges[0]->GetVertex(1);
332 m_verts[1] = m_edges[0]->GetVertex(0);
333 }
334 else if ((m_edges[0]->GetVid(1) == m_edges[1]->GetVid(0)) ||
335 (m_edges[0]->GetVid(1) == m_edges[1]->GetVid(1)))
336 {
337 m_verts[0] = m_edges[0]->GetVertex(0);
338 m_verts[1] = m_edges[0]->GetVertex(1);
339 }
340 else
341 {
342 std::ostringstream errstrm;
343 errstrm << "Connected edges do not share a vertex. Edges ";
344 errstrm << m_edges[0]->GetGlobalID() << ", "
345 << m_edges[1]->GetGlobalID();
346 ASSERTL0(false, errstrm.str());
347 }
348
349 // set up the other bottom vertices (i.e. vertex 2,3)
350 for (int i = 1; i < 3; i++)
351 {
352 if (m_edges[i]->GetVid(0) == m_verts[i]->GetGlobalID())
353 {
354 m_verts[i + 1] = m_edges[i]->GetVertex(1);
355 }
356 else if (m_edges[i]->GetVid(1) == m_verts[i]->GetGlobalID())
357 {
358 m_verts[i + 1] = m_edges[i]->GetVertex(0);
359 }
360 else
361 {
362 std::ostringstream errstrm;
363 errstrm << "Connected edges do not share a vertex. Edges ";
364 errstrm << m_edges[i]->GetGlobalID() << ", "
365 << m_edges[i - 1]->GetGlobalID();
366 ASSERTL0(false, errstrm.str());
367 }
368 }
369
370 // set up top vertices
371 // First, set up vertices 4,5
372 if ((m_edges[8]->GetVid(0) == m_edges[4]->GetVid(0)) ||
373 (m_edges[8]->GetVid(0) == m_edges[4]->GetVid(1)))
374 {
375 m_verts[4] = m_edges[8]->GetVertex(0);
376 m_verts[5] = m_edges[8]->GetVertex(1);
377 }
378 else if ((m_edges[8]->GetVid(1) == m_edges[4]->GetVid(0)) ||
379 (m_edges[8]->GetVid(1) == m_edges[4]->GetVid(1)))
380 {
381 m_verts[4] = m_edges[8]->GetVertex(1);
382 m_verts[5] = m_edges[8]->GetVertex(0);
383 }
384 else
385 {
386 std::ostringstream errstrm;
387 errstrm << "Connected edges do not share a vertex. Edges ";
388 errstrm << m_edges[8]->GetGlobalID();
389 ASSERTL0(false, errstrm.str());
390 }
391}

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

◆ SetUpXmap()

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

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

Definition at line 731 of file PrismGeom.cpp.

732{
733 std::vector<int> tmp;
734 int order0, order1;
735
736 if (m_forient[0] < 9)
737 {
738 tmp.push_back(m_faces[0]->GetXmap()->GetTraceNcoeffs(0));
739 tmp.push_back(m_faces[0]->GetXmap()->GetTraceNcoeffs(2));
740 order0 = *std::max_element(tmp.begin(), tmp.end());
741 }
742 else
743 {
744 tmp.push_back(m_faces[0]->GetXmap()->GetTraceNcoeffs(1));
745 tmp.push_back(m_faces[0]->GetXmap()->GetTraceNcoeffs(3));
746 order0 = *std::max_element(tmp.begin(), tmp.end());
747 }
748
749 if (m_forient[0] < 9)
750 {
751 tmp.clear();
752 tmp.push_back(m_faces[0]->GetXmap()->GetTraceNcoeffs(1));
753 tmp.push_back(m_faces[0]->GetXmap()->GetTraceNcoeffs(3));
754 tmp.push_back(m_faces[2]->GetXmap()->GetTraceNcoeffs(2));
755 order1 = *std::max_element(tmp.begin(), tmp.end());
756 }
757 else
758 {
759 tmp.clear();
760 tmp.push_back(m_faces[0]->GetXmap()->GetTraceNcoeffs(0));
761 tmp.push_back(m_faces[0]->GetXmap()->GetTraceNcoeffs(2));
762 tmp.push_back(m_faces[2]->GetXmap()->GetTraceNcoeffs(2));
763 order1 = *std::max_element(tmp.begin(), tmp.end());
764 }
765
766 tmp.clear();
767 tmp.push_back(order0);
768 tmp.push_back(order1);
769 tmp.push_back(m_faces[1]->GetXmap()->GetTraceNcoeffs(1));
770 tmp.push_back(m_faces[1]->GetXmap()->GetTraceNcoeffs(2));
771 tmp.push_back(m_faces[3]->GetXmap()->GetTraceNcoeffs(1));
772 tmp.push_back(m_faces[3]->GetXmap()->GetTraceNcoeffs(2));
773 int order2 = *std::max_element(tmp.begin(), tmp.end());
774
775 std::array<LibUtilities::BasisKey, 3> basis = {
776 LibUtilities::BasisKey(
778 LibUtilities::PointsKey(order0 + 1,
780 LibUtilities::BasisKey(
782 LibUtilities::PointsKey(order1 + 1,
784 LibUtilities::BasisKey(
786 LibUtilities::PointsKey(order2,
787 LibUtilities::eGaussRadauMAlpha1Beta0))};
788
789 m_xmap = GetStdPrismFactory().CreateInstance(basis);
790}
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_B
Principle Modified Functions .
Definition BasisType.h:49
@ eModified_A
Principle Modified Functions .
Definition BasisType.h:48
XmapFactory< StdRegions::StdPrismExp, 3 > & GetStdPrismFactory()
Definition PrismGeom.cpp:55

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

Referenced by v_Setup().

◆ v_FillGeom()

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

801{
802 if (m_state == ePtsFilled)
803 {
804 return;
805 }
806
807 int i, j, k;
808
809 for (i = 0; i < kNfaces; i++)
810 {
811 m_faces[i]->FillGeom();
812
813 int nFaceCoeffs = m_faces[i]->GetXmap()->GetNcoeffs();
814
815 Array<OneD, unsigned int> mapArray(nFaceCoeffs);
816 Array<OneD, int> signArray(nFaceCoeffs);
817
818 if (m_forient[i] < 9)
819 {
820 m_xmap->GetTraceToElementMap(
821 i, mapArray, signArray, m_forient[i],
822 m_faces[i]->GetXmap()->GetTraceNcoeffs(0),
823 m_faces[i]->GetXmap()->GetTraceNcoeffs(1));
824 }
825 else
826 {
827 m_xmap->GetTraceToElementMap(
828 i, mapArray, signArray, m_forient[i],
829 m_faces[i]->GetXmap()->GetTraceNcoeffs(1),
830 m_faces[i]->GetXmap()->GetTraceNcoeffs(0));
831 }
832
833 for (j = 0; j < m_coordim; j++)
834 {
835 const Array<OneD, const NekDouble> &coeffs =
836 m_faces[i]->GetCoeffs(j);
837
838 for (k = 0; k < nFaceCoeffs; k++)
839 {
840 NekDouble v = signArray[k] * coeffs[k];
841 m_coeffs[j][mapArray[k]] = v;
842 }
843 }
844 }
845
847}
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::PrismGeom::v_GenGeomFactors ( )
overrideprotectedvirtual

Implements Nektar::SpatialDomains::Geometry.

Definition at line 96 of file PrismGeom.cpp.

97{
98 if (!m_setupState)
99 {
101 }
102
104 {
105 GeomType Gtype = eRegular;
106
107 v_FillGeom();
108
109 // check to see if expansions are linear
110 m_straightEdge = 1;
111 if (m_xmap->GetBasisNumModes(0) != 2 ||
112 m_xmap->GetBasisNumModes(1) != 2 ||
113 m_xmap->GetBasisNumModes(2) != 2)
114 {
115 Gtype = eDeformed;
116 m_straightEdge = 0;
117 }
118
119 // check to see if all quadrilateral faces are parallelograms
120 if (Gtype == eRegular)
121 {
122 m_isoParameter = Array<OneD, Array<OneD, NekDouble>>(3);
123 for (int i = 0; i < 3; ++i)
124 {
125 m_isoParameter[i] = Array<OneD, NekDouble>(6, 0.);
126 NekDouble A = (*m_verts[0])(i);
127 NekDouble B = (*m_verts[1])(i);
128 NekDouble C = (*m_verts[2])(i);
129 NekDouble D = (*m_verts[3])(i);
130 NekDouble E = (*m_verts[4])(i);
131 NekDouble F = (*m_verts[5])(i);
132 m_isoParameter[i][0] = 0.25 * (B + C + E + F);
133
134 m_isoParameter[i][1] = 0.25 * (-A + B + C - D); // xi1
135 m_isoParameter[i][2] = 0.25 * (-B + C - E + F); // xi2
136 m_isoParameter[i][3] = 0.25 * (-A - D + E + F); // xi3
137
138 m_isoParameter[i][4] = 0.25 * (A - B + C - D); // xi1*xi2
139 m_isoParameter[i][5] = 0.25 * (A - D - E + F); // 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 < 6; ++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.
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::PrismGeom::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 80 of file PrismGeom.cpp.

81{
82 if (faceidx == 0)
83 {
84 return facedir;
85 }
86 else if (faceidx == 1 || faceidx == 3)
87 {
88 return 2 * facedir;
89 }
90 else
91 {
92 return 1 + facedir;
93 }
94}

◆ v_GetEdge()

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

Returns edge i of this object.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 92 of file PrismGeom.h.

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

References m_edges.

◆ v_GetEdgeFaceMap()

int Nektar::SpatialDomains::PrismGeom::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 PrismGeom.cpp.

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

References EdgeFaceConnectivity.

◆ v_GetEdgeNormalToFaceVert()

int Nektar::SpatialDomains::PrismGeom::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 PrismGeom.cpp.

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

References EdgeNormalToFaceVert.

◆ v_GetEorient()

StdRegions::Orientation Nektar::SpatialDomains::PrismGeom::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 PrismGeom.h.

103 {
104 return m_eorient[i];
105 }

References m_eorient.

◆ v_GetFace()

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

Returns face i of this object.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 97 of file PrismGeom.h.

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

References m_faces.

◆ v_GetForient()

StdRegions::Orientation Nektar::SpatialDomains::PrismGeom::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 PrismGeom.h.

108 {
109 return m_forient[i];
110 }

References m_forient.

◆ v_GetNumEdges()

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

Get the number of edges of this object.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 77 of file PrismGeom.h.

78 {
79 return kNedges;
80 }

References kNedges.

◆ v_GetNumFaces()

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

Get the number of faces of this object.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 82 of file PrismGeom.h.

83 {
84 return kNfaces;
85 }

References kNfaces.

◆ v_GetNumVerts()

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

Get the number of vertices of this object.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 72 of file PrismGeom.h.

73 {
74 return kNverts;
75 }

References kNverts.

◆ v_GetVertex()

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

Returns vertex i of this object.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 87 of file PrismGeom.h.

88 {
89 return m_verts[i];
90 }

References m_verts.

◆ v_GetVertexEdgeMap()

int Nektar::SpatialDomains::PrismGeom::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 PrismGeom.cpp.

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

References VertexEdgeConnectivity.

◆ v_GetVertexFaceMap()

int Nektar::SpatialDomains::PrismGeom::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 PrismGeom.cpp.

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

References VertexFaceConnectivity.

◆ v_Reset()

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

704{
705 Geometry::v_Reset(curvedEdges, curvedFaces);
706
707 for (int i = 0; i < 5; ++i)
708 {
709 m_faces[i]->Reset(curvedEdges, curvedFaces);
710 }
711}
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

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

◆ v_Setup()

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

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 713 of file PrismGeom.cpp.

714{
715 if (!m_setupState)
716 {
717 for (int i = 0; i < 5; ++i)
718 {
719 m_faces[i]->Setup();
720 }
721 SetUpXmap();
722 SetUpCoeffs(m_xmap->GetNcoeffs());
723 m_setupState = true;
724 }
725}
void SetUpCoeffs(const int nCoeffs)
Initialise the Geometry::m_coeffs array.
Definition Geometry.h:704
void SetUpXmap()
Set up the m_xmap object by determining the order of each direction from derived faces.

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::PrismGeom::EdgeFaceConnectivity
staticprivate
Initial value:
= {
{0, 1}, {0, 2}, {0, 3}, {0, 4}, {1, 4}, {1, 2}, {2, 3}, {3, 4}, {2, 4}}

Definition at line 127 of file PrismGeom.h.

Referenced by v_GetEdgeFaceMap().

◆ EdgeNormalToFaceVert

const unsigned int Nektar::SpatialDomains::PrismGeom::EdgeNormalToFaceVert
staticprivate
Initial value:
= {
{4, 5, 6, 7}, {1, 3, 8, -1}, {0, 2, 4, 7}, {1, 3, 8, -1}, {0, 2, 5, 6}}

Definition at line 128 of file PrismGeom.h.

Referenced by v_GetEdgeNormalToFaceVert().

◆ kNedges

const int Nektar::SpatialDomains::PrismGeom::kNedges = 9
static

Definition at line 49 of file PrismGeom.h.

Referenced by SetUpEdgeOrientation(), and v_GetNumEdges().

◆ kNfaces

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

◆ kNfacets

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

Definition at line 53 of file PrismGeom.h.

◆ kNqfaces

const int Nektar::SpatialDomains::PrismGeom::kNqfaces = 3
static

◆ kNtfaces

const int Nektar::SpatialDomains::PrismGeom::kNtfaces = 2
static

◆ kNverts

const int Nektar::SpatialDomains::PrismGeom::kNverts = 6
static

Definition at line 48 of file PrismGeom.h.

Referenced by v_GetNumVerts().

◆ m_edges

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

Definition at line 113 of file PrismGeom.h.

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

◆ m_eorient

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

Definition at line 115 of file PrismGeom.h.

Referenced by SetUpEdgeOrientation(), and v_GetEorient().

◆ m_faces

std::array<Geometry2D *, kNfaces> Nektar::SpatialDomains::PrismGeom::m_faces
protected

◆ m_forient

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

Definition at line 116 of file PrismGeom.h.

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

◆ m_verts

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

◆ VertexEdgeConnectivity

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

Definition at line 125 of file PrismGeom.h.

Referenced by v_GetVertexEdgeMap().

◆ VertexFaceConnectivity

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

Definition at line 126 of file PrismGeom.h.

Referenced by v_GetVertexFaceMap().

◆ XMLElementType

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

Definition at line 54 of file PrismGeom.h.