Nektar++
|
#include <TetGeom.h>
Public Member Functions | |
TetGeom () | |
TetGeom (int id, const TriGeomSharedPtr faces[]) | |
~TetGeom () | |
![]() | |
Geometry3D () | |
Geometry3D (const int coordim) | |
virtual | ~Geometry3D () |
int | GetDir (const int faceidx, const int facedir) const |
Returns the element coordinate direction corresponding to a given face coordinate direction. More... | |
![]() | |
Geometry () | |
Default constructor. More... | |
Geometry (int coordim) | |
Constructor when supplied a coordinate dimension. More... | |
virtual | ~Geometry () |
Default destructor. More... | |
int | GetCoordim () const |
Return the coordinate dimension of this object (i.e. the dimension of the space in which this object is embedded). More... | |
void | SetCoordim (int coordim) |
Sets the coordinate dimension of this object (i.e. the dimension of the space in which this object is embedded). More... | |
GeomFactorsSharedPtr | GetGeomFactors () |
Get the geometric factors for this object, generating them if required. More... | |
GeomFactorsSharedPtr | GetRefGeomFactors (const Array< OneD, const LibUtilities::BasisSharedPtr > &tbasis) |
GeomFactorsSharedPtr | GetMetricInfo () |
Get the geometric factors for this object. More... | |
LibUtilities::ShapeType | GetShapeType (void) |
Get the geometric shape type of this object. More... | |
int | GetGlobalID (void) const |
Get the ID of this object. More... | |
void | SetGlobalID (int globalid) |
Set the ID of this object. More... | |
int | GetVid (int i) const |
Get the ID of vertex i of this object. More... | |
int | GetEid (int i) const |
Get the ID of edge i of this object. More... | |
int | GetFid (int i) const |
Get the ID of face i of this object. More... | |
int | GetTid (int i) const |
Get the ID of trace i of this object. More... | |
PointGeomSharedPtr | GetVertex (int i) const |
Returns vertex i of this object. More... | |
Geometry1DSharedPtr | GetEdge (int i) const |
Returns edge i of this object. More... | |
Geometry2DSharedPtr | GetFace (int i) const |
Returns face i of this object. More... | |
StdRegions::Orientation | GetEorient (const int i) const |
Returns the orientation of edge i with respect to the ordering of edges in the standard element. More... | |
StdRegions::Orientation | GetForient (const int i) const |
Returns the orientation of face i with respect to the ordering of faces in the standard element. More... | |
int | GetNumVerts () const |
Get the number of vertices of this object. More... | |
int | GetNumEdges () const |
Get the number of edges of this object. More... | |
int | GetNumFaces () const |
Get the number of faces of this object. More... | |
int | GetShapeDim () const |
Get the object's shape dimension. More... | |
StdRegions::StdExpansionSharedPtr | GetXmap () const |
Return the mapping object Geometry::m_xmap that represents the coordinate transformation from standard element to physical element. More... | |
const Array< OneD, const NekDouble > & | GetCoeffs (const int i) const |
Return the coefficients of the transformation Geometry::m_xmap in coordinate direction i . More... | |
void | FillGeom () |
Populate the coordinate mapping Geometry::m_coeffs information from any children geometry elements. More... | |
std::array< NekDouble, 6 > | GetBoundingBox () |
Generates the bounding box for the element. More... | |
bool | ContainsPoint (const Array< OneD, const NekDouble > &gloCoord, NekDouble tol=0.0) |
Determine whether an element contains a particular Cartesian coordinate \((x,y,z)\). More... | |
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)\). More... | |
bool | ContainsPoint (const Array< OneD, const NekDouble > &gloCoord, Array< OneD, NekDouble > &locCoord, NekDouble tol, NekDouble &resid) |
Determine whether an element contains a particular Cartesian coordinate \(\vec{x} = (x,y,z)\). More... | |
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. More... | |
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 . More... | |
bool | MinMaxCheck (const Array< OneD, const NekDouble > &gloCoord) |
Check if given global coord is within twice the min/max distance of the element. More... | |
void | ClampLocCoords (Array< OneD, NekDouble > &locCoord, NekDouble tol) |
Clamp local coords to be within standard regions [-1, 1]^dim. More... | |
int | GetVertexEdgeMap (int i, int j) const |
Returns the standard element edge IDs that are connected to a given vertex. More... | |
int | GetVertexFaceMap (int i, int j) const |
Returns the standard element face IDs that are connected to a given vertex. More... | |
int | GetEdgeFaceMap (int i, int j) const |
Returns the standard element edge IDs that are connected to a given face. More... | |
void | Reset (CurveMap &curvedEdges, CurveMap &curvedFaces) |
Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated GeomFactors. More... | |
void | Setup () |
Static Public Attributes | |
static const int | kNverts = 4 |
static const int | kNedges = 6 |
static const int | kNqfaces = 0 |
static const int | kNtfaces = 4 |
static const int | kNfaces = kNqfaces + kNtfaces |
static const std::string | XMLElementType |
![]() | |
static const int | kDim = 3 |
Protected Member Functions | |
virtual NekDouble | v_GetLocCoords (const Array< OneD, const NekDouble > &coords, Array< OneD, NekDouble > &Lcoords) |
Determine the local collapsed coordinates that correspond to a given Cartesian coordinate for this geometry object. More... | |
virtual bool | v_ContainsPoint (const Array< OneD, const NekDouble > &gloCoord, Array< OneD, NekDouble > &locCoord, NekDouble tol, NekDouble &resid) |
Determines if a point specified in global coordinates is located within this tetrahedral geometry and return local caretsian coordinates. More... | |
virtual int | v_GetVertexEdgeMap (const int i, const int j) const |
Returns the standard element edge IDs that are connected to a given vertex. More... | |
virtual int | v_GetVertexFaceMap (const int i, const int j) const |
Returns the standard element face IDs that are connected to a given vertex. More... | |
virtual int | v_GetEdgeFaceMap (const int i, const int j) const |
Returns the standard element edge IDs that are connected to a given face. More... | |
virtual int | v_GetDir (const int faceidx, const int facedir) const |
virtual void | v_Reset (CurveMap &curvedEdges, CurveMap &curvedFaces) |
Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated GeomFactors. More... | |
virtual void | v_Setup () |
virtual void | v_GenGeomFactors () |
![]() | |
void | NewtonIterationForLocCoord (const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &ptsx, const Array< OneD, const NekDouble > &ptsy, const Array< OneD, const NekDouble > &ptsz, Array< OneD, NekDouble > &Lcoords, NekDouble &resid) |
virtual void | v_FillGeom () |
Put all quadrature information into face/edge structure and backward transform. More... | |
virtual NekDouble | v_GetCoord (const int i, const Array< OneD, const NekDouble > &Lcoord) |
Given local collapsed coordinate Lcoord return the value of physical coordinate in direction i. More... | |
virtual int | v_GetShapeDim () const |
Get the object's shape dimension. More... | |
virtual int | v_GetNumVerts () const |
Get the number of vertices of this object. More... | |
virtual int | v_GetNumEdges () const |
Get the number of edges of this object. More... | |
virtual int | v_GetNumFaces () const |
Get the number of faces of this object. More... | |
virtual PointGeomSharedPtr | v_GetVertex (int i) const |
virtual Geometry1DSharedPtr | v_GetEdge (int i) const |
Returns edge i of this object. More... | |
virtual Geometry2DSharedPtr | v_GetFace (int i) const |
Returns face i of this object. More... | |
virtual StdRegions::Orientation | v_GetEorient (const int i) const |
Returns the orientation of edge i with respect to the ordering of edges in the standard element. More... | |
virtual StdRegions::Orientation | v_GetForient (const int i) const |
Returns the orientation of face i with respect to the ordering of faces in the standard element. More... | |
![]() | |
void | GenGeomFactors () |
Handles generation of geometry factors. More... | |
virtual StdRegions::StdExpansionSharedPtr | v_GetXmap () const |
Return the mapping object Geometry::m_xmap that represents the coordinate transformation from standard element to physical element. More... | |
void | SetUpCoeffs (const int nCoeffs) |
Initialise the Geometry::m_coeffs array. More... | |
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. More... | |
Static Private Attributes | |
static const unsigned int | VertexEdgeConnectivity [4][3] |
static const unsigned int | VertexFaceConnectivity [4][3] |
static const unsigned int | EdgeFaceConnectivity [6][2] |
Additional Inherited Members | |
![]() | |
static GeomFactorsSharedPtr | ValidateRegGeomFactor (GeomFactorsSharedPtr geomFactor) |
Check to see if a geometric factor has already been created that contains the same regular information. More... | |
![]() | |
PointGeomVector | m_verts |
SegGeomVector | m_edges |
Geometry2DVector | m_faces |
std::vector< StdRegions::Orientation > | m_eorient |
std::vector< StdRegions::Orientation > | m_forient |
int | m_eid |
bool | m_ownverts |
![]() | |
int | m_coordim |
Coordinate dimension of this geometry object. More... | |
GeomFactorsSharedPtr | m_geomFactors |
Geometric factors. More... | |
GeomState | m_geomFactorsState |
State of the geometric factors. More... | |
StdRegions::StdExpansionSharedPtr | m_xmap |
\(\chi\) mapping containing isoparametric transformation. More... | |
GeomState | m_state |
Enumeration to dictate whether coefficients are filled. More... | |
bool | m_setupState |
Wether or not the setup routines have been run. More... | |
GeomType | m_geomType |
Type of geometry. More... | |
LibUtilities::ShapeType | m_shapeType |
Type of shape. More... | |
int | m_globalID |
Global ID. More... | |
Array< OneD, Array< OneD, NekDouble > > | m_coeffs |
Array containing expansion coefficients of m_xmap . More... | |
![]() | |
static GeomFactorsVector | m_regGeomFactorsManager |
Nektar::SpatialDomains::TetGeom::TetGeom | ( | ) |
Definition at line 54 of file TetGeom.cpp.
References Nektar::LibUtilities::eTetrahedron.
Nektar::SpatialDomains::TetGeom::TetGeom | ( | int | id, |
const TriGeomSharedPtr | faces[] | ||
) |
Copy the face shared pointers
Set up orientation vectors with correct amount of elements.
Definition at line 59 of file TetGeom.cpp.
References Nektar::LibUtilities::eTetrahedron, kNedges, kNfaces, Nektar::SpatialDomains::Geometry3D::m_eorient, Nektar::SpatialDomains::Geometry3D::m_faces, Nektar::SpatialDomains::Geometry3D::m_forient, Nektar::SpatialDomains::Geometry::m_globalID, Nektar::SpatialDomains::Geometry::m_shapeType, SetUpEdgeOrientation(), SetUpFaceOrientation(), SetUpLocalEdges(), and SetUpLocalVertices().
Nektar::SpatialDomains::TetGeom::~TetGeom | ( | ) |
Definition at line 78 of file TetGeom.cpp.
|
private |
Definition at line 441 of file TetGeom.cpp.
References ASSERTL0, Nektar::StdRegions::eBackwards, Nektar::StdRegions::eForwards, Nektar::SpatialDomains::Geometry::GetGlobalID(), Nektar::SpatialDomains::Geometry::GetVid(), kNedges, Nektar::SpatialDomains::Geometry3D::m_edges, Nektar::SpatialDomains::Geometry3D::m_eorient, and Nektar::SpatialDomains::Geometry3D::m_verts.
Referenced by TetGeom().
|
private |
Definition at line 468 of file TetGeom.cpp.
References ASSERTL0, ASSERTL1, Nektar::SpatialDomains::Geometry::GetGlobalID(), Nektar::SpatialDomains::Geometry::GetVertex(), Nektar::NekConstants::kNekZeroTol, kNfaces, kNqfaces, kNtfaces, Nektar::SpatialDomains::TriGeom::kNverts, Nektar::SpatialDomains::Geometry::m_coordim, Nektar::SpatialDomains::Geometry3D::m_faces, Nektar::SpatialDomains::Geometry3D::m_forient, and Nektar::SpatialDomains::Geometry3D::m_verts.
Referenced by TetGeom().
|
private |
Definition at line 238 of file TetGeom.cpp.
References ASSERTL0, Nektar::SpatialDomains::Geometry::GetEdge(), Nektar::SpatialDomains::Geometry::GetEid(), Nektar::SpatialDomains::Geometry::GetGlobalID(), Nektar::SpatialDomains::Geometry3D::m_edges, and Nektar::SpatialDomains::Geometry3D::m_faces.
Referenced by TetGeom().
|
private |
Definition at line 363 of file TetGeom.cpp.
References ASSERTL0, Nektar::SpatialDomains::Geometry::GetGlobalID(), Nektar::SpatialDomains::Geometry::GetVertex(), Nektar::SpatialDomains::Geometry::GetVid(), Nektar::SpatialDomains::Geometry3D::m_edges, and Nektar::SpatialDomains::Geometry3D::m_verts.
Referenced by TetGeom().
|
private |
Set up the m_xmap object by determining the order of each direction from derived faces.
Definition at line 747 of file TetGeom.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eGaussRadauMAlpha1Beta0, Nektar::LibUtilities::eGaussRadauMAlpha2Beta0, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModified_B, Nektar::LibUtilities::eModified_C, Nektar::SpatialDomains::Geometry::GetXmap(), Nektar::SpatialDomains::Geometry3D::m_faces, and Nektar::SpatialDomains::Geometry::m_xmap.
Referenced by v_Setup().
|
protectedvirtual |
Determines if a point specified in global coordinates is located within this tetrahedral geometry and return local caretsian coordinates.
Reimplemented from Nektar::SpatialDomains::Geometry.
Definition at line 87 of file TetGeom.cpp.
References Nektar::SpatialDomains::Geometry::ClampLocCoords(), Nektar::SpatialDomains::eRegular, Nektar::SpatialDomains::Geometry::GetLocCoords(), Nektar::SpatialDomains::Geometry::GetMetricInfo(), and Nektar::SpatialDomains::Geometry::MinMaxCheck().
|
protectedvirtual |
Generate the geometry factors for this element.
Implements Nektar::SpatialDomains::Geometry.
Definition at line 713 of file TetGeom.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::SpatialDomains::eDeformed, Nektar::SpatialDomains::ePtsFilled, Nektar::SpatialDomains::eRegular, Nektar::SpatialDomains::Geometry::m_coeffs, Nektar::SpatialDomains::Geometry::m_coordim, Nektar::SpatialDomains::Geometry::m_geomFactors, Nektar::SpatialDomains::Geometry::m_geomFactorsState, Nektar::SpatialDomains::Geometry::m_setupState, Nektar::SpatialDomains::Geometry::m_xmap, Nektar::SpatialDomains::Geometry3D::v_FillGeom(), and v_Setup().
|
protectedvirtual |
Implements Nektar::SpatialDomains::Geometry3D.
Definition at line 207 of file TetGeom.cpp.
|
protectedvirtual |
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.
i | The edge to query connectivity for. |
j | The local face index between 0 and 1 connected to this element. |
Reimplemented from Nektar::SpatialDomains::Geometry.
Definition at line 233 of file TetGeom.cpp.
References EdgeFaceConnectivity.
|
protectedvirtual |
Determine the local collapsed coordinates that correspond to a given Cartesian coordinate for this geometry object.
For curvilinear and non-affine elements (i.e. where the Jacobian varies as a function of the standard element coordinates), this is a non-linear optimisation problem that requires the use of a Newton iteration. Note therefore that this can be an expensive operation.
Note that, clearly, the provided Cartesian coordinate lie outside the element. The function therefore returns the minimum distance from some position in the element to . Lcoords
will also be constrained to fit within the range \([-1,1]^d\) where \( d \) is the dimension of the element.
coords | Input Cartesian global coordinates |
Lcoords | Corresponding local coordinates |
Reimplemented from Nektar::SpatialDomains::Geometry.
Definition at line 118 of file TetGeom.cpp.
References Nektar::SpatialDomains::PointGeom::dist(), Nektar::SpatialDomains::PointGeom::dot(), Nektar::SpatialDomains::eRegular, Nektar::SpatialDomains::Geometry::GetMetricInfo(), Vmath::Imin(), Nektar::SpatialDomains::Geometry::m_coeffs, Nektar::SpatialDomains::Geometry::m_coordim, Nektar::SpatialDomains::Geometry3D::m_verts, Nektar::SpatialDomains::Geometry::m_xmap, Nektar::SpatialDomains::PointGeom::Mult(), Nektar::SpatialDomains::Geometry3D::NewtonIterationForLocCoord(), Vmath::Sadd(), Nektar::SpatialDomains::PointGeom::Sub(), Nektar::SpatialDomains::Geometry3D::v_FillGeom(), Vmath::Vmul(), and Vmath::Vvtvp().
|
protectedvirtual |
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.
i | The vertex to query connectivity for. |
j | The local edge index between 0 and 2 connected to this element. |
Reimplemented from Nektar::SpatialDomains::Geometry.
Definition at line 223 of file TetGeom.cpp.
References VertexEdgeConnectivity.
|
protectedvirtual |
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.
i | The vertex to query connectivity for. |
j | The local face index between 0 and 2 connected to this element. |
Reimplemented from Nektar::SpatialDomains::Geometry.
Definition at line 228 of file TetGeom.cpp.
References VertexFaceConnectivity.
|
protectedvirtual |
Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated GeomFactors.
Reimplemented from Nektar::SpatialDomains::Geometry.
Definition at line 686 of file TetGeom.cpp.
References Nektar::SpatialDomains::Geometry3D::m_faces, and Nektar::SpatialDomains::Geometry::v_Reset().
|
protectedvirtual |
Reimplemented from Nektar::SpatialDomains::Geometry.
Definition at line 696 of file TetGeom.cpp.
References Nektar::SpatialDomains::Geometry3D::m_faces, Nektar::SpatialDomains::Geometry::m_setupState, Nektar::SpatialDomains::Geometry::m_xmap, Nektar::SpatialDomains::Geometry::SetUpCoeffs(), and SetUpXmap().
Referenced by v_GenGeomFactors().
|
staticprivate |
Definition at line 85 of file TetGeom.h.
Referenced by v_GetEdgeFaceMap().
|
static |
Definition at line 55 of file TetGeom.h.
Referenced by SetUpEdgeOrientation(), and TetGeom().
Definition at line 58 of file TetGeom.h.
Referenced by SetUpFaceOrientation(), and TetGeom().
|
static |
Definition at line 56 of file TetGeom.h.
Referenced by SetUpFaceOrientation().
|
static |
Definition at line 57 of file TetGeom.h.
Referenced by SetUpFaceOrientation().
|
static |
|
staticprivate |
Definition at line 83 of file TetGeom.h.
Referenced by v_GetVertexEdgeMap().
|
staticprivate |
Definition at line 84 of file TetGeom.h.
Referenced by v_GetVertexFaceMap().