37#ifndef NEKTAR_SPATIALDOMAINS_GEOMETRY_H
38#define NEKTAR_SPATIALDOMAINS_GEOMETRY_H
46#include <unordered_map>
53PoolAllocator<SpatialDomains::GeomFactors>
159 NekDouble tol = std::numeric_limits<NekDouble>::epsilon());
172 const int j = 0)
const;
238 virtual int v_GetDir(
const int faceidx,
const int facedir)
const;
259 int nVert = p->GetNumVerts();
260 std::vector<unsigned int> ids(nVert);
262 for (i = 0; i < nVert; ++i)
264 ids[i] = p->GetVid(i);
266 std::sort(ids.begin(), ids.end());
336 return nDim == 1 ?
GetVid(i)
673 v_Reset(curvedEdges, curvedFaces);
#define SPATIAL_DOMAINS_EXPORT
Generic object pool allocator/deallocator.
Base class for shape geometry information.
virtual int v_GetNumEdges() const
Get the number of edges of this object.
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.
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.
LibUtilities::ShapeType GetShapeType(void)
Get the geometric shape type of this object.
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.
Array< OneD, NekDouble > m_boundingBox
Array containing bounding box.
bool m_setupState
Wether or not the setup routines have been run.
GeomState m_state
Enumeration to dictate whether coefficients are filled.
virtual void v_CalculateInverseIsoParam()
void SetUpCoeffs(const int nCoeffs)
Initialise the Geometry::m_coeffs array.
virtual int v_AllLeftCheck(const Array< OneD, const NekDouble > &gloCoord)
NekDouble GetLocCoords(const Array< OneD, const NekDouble > &coords, Array< OneD, NekDouble > &Lcoords)
Determine the local collapsed coordinates that correspond to a given Cartesian coordinate for this ge...
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 element...
virtual int v_GetEdgeNormalToFaceVert(const int i, const int j) const
Returns the standard lement edge IDs that are normal to a given face vertex.
void SetGlobalID(int globalid)
Set the ID of this object.
int GetNumFaces() const
Get the number of faces of this object.
int GetShapeDim() const
Get the object's shape dimension.
virtual void v_FillGeom()
Populate the coordinate mapping Geometry::m_coeffs information from any children geometry elements.
Geometry()
Default constructor.
virtual NekDouble v_GetLocCoords(const Array< OneD, const NekDouble > &coords, Array< OneD, NekDouble > &Lcoords)
Determine the local collapsed coordinates that correspond to a given Cartesian coordinate for this ge...
int GetVid(int i) const
Returns global id of vertex i of this object.
virtual int v_GetNumFaces() const
Get the number of faces of this object.
virtual StdRegions::StdExpansionSharedPtr v_GetXmap() const
Return the mapping object Geometry::m_xmap that represents the coordinate transformation from standar...
Array< OneD, Array< OneD, NekDouble > > m_isoParameter
Array< OneD, Array< OneD, NekDouble > > m_invIsoParam
virtual void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces)
Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated Geo...
bool ClampLocCoords(Array< OneD, NekDouble > &locCoord, NekDouble tol=std::numeric_limits< NekDouble >::epsilon())
Clamp local coords to be within standard regions [-1, 1]^dim.
const Array< OneD, const NekDouble > & GetCoeffs(const int i) const
Return the coefficients of the transformation Geometry::m_xmap in coordinate direction i.
int GetGlobalID(void) const
Get the ID of this object.
PointGeom * GetVertex(int i) const
Returns vertex i of this object.
int GetCoordim() const
Return the coordinate dimension of this object (i.e. the dimension of the space in which this object ...
int GetFid(int i) const
Get the ID of face i of this object.
std::vector< Array< OneD, NekDouble > > m_coeffs
Array containing expansion coefficients of m_xmap.
virtual int v_GetEdgeFaceMap(int i, int j) const
Returns the standard element edge IDs that are connected to a given face.
LibUtilities::ShapeType m_shapeType
Type of shape.
int GetDir(const int i, const int j=0) const
Returns the element coordinate direction corresponding to a given face coordinate direction.
void FillGeom()
Populate the coordinate mapping Geometry::m_coeffs information from any children geometry elements.
virtual ~Geometry()=default
int GetVertexEdgeMap(int i, int j) const
Returns the standard element edge IDs that are connected to a given vertex.
void ResetNonRecursive(CurveMap &curvedEdges, CurveMap &curvedFaces)
Reset this geometry object non-recursively: unset the current state, zero Geometry::m_coeffs and remo...
StdRegions::StdExpansionSharedPtr m_xmap
mapping containing isoparametric transformation.
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.
StdRegions::StdExpansionSharedPtr GetXmap() const
Return the mapping object Geometry::m_xmap that represents the coordinate transformation from standar...
NekDouble FindDistance(const Array< OneD, const NekDouble > &xs, Array< OneD, NekDouble > &xi)
virtual PointGeom * v_GetVertex(const int i) const
Returns vertex i of this object.
int GetNumEdges() const
Get the number of edges of this object.
std::array< NekDouble, 6 > GetBoundingBox()
Generates the bounding box for the element.
int GetNumVerts() const
Get the number of vertices of this object.
int GetVertexFaceMap(int i, int j) const
Returns the standard element face IDs that are connected to a given vertex.
bool ContainsPoint(const Array< OneD, const NekDouble > &gloCoord, NekDouble tol=0.0)
Determine whether an element contains a particular Cartesian coordinate .
Geometry1D * GetEdge(int i) const
Returns edge i of this object.
Geometry2D * GetFace(int i) const
Returns face i of this object.
int GetEdgeFaceMap(int i, int j) const
Returns the standard element edge IDs that are connected to a given face.
bool MinMaxCheck(const Array< OneD, const NekDouble > &gloCoord)
Check if given global coord is within the BoundingBox of the element.
virtual GeomType v_CalcGeomType()
virtual int v_GetVertexEdgeMap(int i, int j) const
Returns the standard element edge IDs that are connected to a given vertex.
virtual Geometry1D * v_GetEdge(const int i) const
Returns edge i of this object.
int GetEdgeNormalToFaceVert(int i, int j) const
Returns the standard lement edge IDs that are normal to a given face vertex.
virtual NekDouble v_FindDistance(const Array< OneD, const NekDouble > &xs, Array< OneD, NekDouble > &xi)
StdRegions::Orientation GetEorient(const int i) const
Returns the orientation of edge i with respect to the ordering of edges in the standard element.
virtual int v_GetNumVerts() const
Get the number of vertices of this object.
int m_coordim
Coordinate dimension of this geometry object.
int GetTid(int i) const
Get the ID of trace i of this object.
virtual int v_GetDir(const int faceidx, const int facedir) const
Returns the element coordinate direction corresponding to a given face coordinate direction.
virtual Geometry2D * v_GetFace(const int i) const
Returns face i of this object.
virtual int v_GetVid(int i) const
Get the ID of vertex i of this object.
void SetCoordim(int coordim)
Sets the coordinate dimension of this object (i.e. the dimension of the space in which this object is...
virtual int v_GetShapeDim() const
Get the object's shape dimension.
void Reset(CurveMap &curvedEdges, CurveMap &curvedFaces)
Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated Geo...
virtual int v_GetVertexFaceMap(int i, int j) const
Returns the standard element face IDs that are connected to a given vertex.
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 .
int GetEid(int i) const
Get the ID of edge i of this object.
StdRegions::Orientation GetForient(const int i) const
Returns the orientation of face i with respect to the ordering of faces in the standard element.
virtual GeomFactorsUniquePtr v_GenGeomFactors(LibUtilities::PointsKeyVector &keyTgt)
Used by Expansion to generate associated GeomFactors.
GeomFactorsUniquePtr GenGeomFactors(LibUtilities::PointsKeyVector &keyTgt)
Used by Expansion to generate associated GeomFactors.
std::vector< PointsKey > PointsKeyVector
bool GlobalIdEquality(const Geometry *&lhs, const Geometry *&rhs)
unique_ptr_objpool< Curve > CurveUniquePtr
bool SortByGlobalId(const Geometry *&lhs, const Geometry *&rhs)
Less than operator to sort Geometry objects by global id when sorting STL containers.
unique_ptr_objpool< GeomFactors > GeomFactorsUniquePtr
std::map< int, CurveUniquePtr > CurveMap
unique_ptr_objpool< Geometry > GeometryUniquePtr
GeomType
Indicates the type of element geometry.
GeomState
Indicates if the geometric information for an element has been populated.
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
std::size_t hash_range(Iter first, Iter last)
std::unique_ptr< T, typename ObjPoolManager< T >::UniquePtrDeleter > unique_ptr_objpool
Unary function that constructs a hash of a Geometry object, based on the vertex IDs.
std::size_t operator()(GeometryUniquePtr const &p) const