37 #ifndef NEKTAR_SPATIALDOMAINS_GEOMETRY_H 38 #define NEKTAR_SPATIALDOMAINS_GEOMETRY_H 44 #include <unordered_map> 50 namespace SpatialDomains
69 typedef std::unordered_map<int, CurveSharedPtr>
CurveMap;
75 const std::shared_ptr<Geometry> &
lhs,
76 const std::shared_ptr<Geometry> &
rhs);
79 const std::shared_ptr<Geometry> &
lhs,
80 const std::shared_ptr<Geometry> &
rhs);
174 CurveMap &curvedFaces);
209 virtual PointGeomSharedPtr
v_GetVertex(
int i)
const = 0;
210 virtual Geometry1DSharedPtr
v_GetEdge(
int i)
const;
211 virtual Geometry2DSharedPtr
v_GetFace(
int i)
const;
236 virtual void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces);
247 struct GeometryHash : std::unary_function<GeometrySharedPtr, std::size_t>
253 int nVert = p->GetNumVerts();
254 std::vector<unsigned int> ids(nVert);
256 for (i = 0; i < nVert; ++i)
258 ids[i] = p->GetVid(i);
260 std::sort(ids.begin(), ids.end());
337 nDim == 3 ?
GetFid(i) : 0;
622 v_Reset(curvedEdges, curvedFaces);
656 #endif // NEKTAR_SPATIALDOMAINS_GEOMETRY_H StdRegions::StdExpansionSharedPtr m_xmap
mapping containing isoparametric transformation.
void GenGeomFactors()
Handles generation of geometry factors.
static CurveMap NullCurveMap
std::size_t hash_range(Iter first, Iter last)
GeomFactorsSharedPtr GetRefGeomFactors(const Array< OneD, const LibUtilities::BasisSharedPtr > &tbasis)
virtual Geometry2DSharedPtr v_GetFace(int i) const
Returns face i of this object.
int GetShapeDim() const
Get the object's shape dimension.
int GetTid(int i) const
Get the ID of trace 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.
virtual PointGeomSharedPtr v_GetVertex(int i) const =0
virtual int v_GetEdgeFaceMap(int i, int j) const
Returns the standard element edge IDs that are connected to a given face.
virtual bool v_ContainsPoint(const Array< OneD, const NekDouble > &gloCoord, Array< OneD, NekDouble > &locCoord, NekDouble tol, NekDouble &resid)
std::shared_ptr< Geometry2D > Geometry2DSharedPtr
void SetGlobalID(int globalid)
Set the ID of this object.
Base class for shape geometry information.
GeomFactorsSharedPtr m_geomFactors
Geometric factors.
StdRegions::StdExpansionSharedPtr GetXmap() const
Return the mapping object Geometry::m_xmap that represents the coordinate transformation from standar...
Geometry2DSharedPtr GetFace(int i) const
Returns face i of this object.
std::unordered_map< int, CurveSharedPtr > CurveMap
std::shared_ptr< GeomFactors > GeomFactorsSharedPtr
Pointer to a GeomFactors object.
bool MinMaxCheck(const Array< OneD, const NekDouble > &gloCoord)
Check if given global coord is within twice the min/max distance of the element.
static GeomFactorsSharedPtr ValidateRegGeomFactor(GeomFactorsSharedPtr geomFactor)
Check to see if a geometric factor has already been created that contains the same regular informatio...
std::vector< GeometrySharedPtr > GeometryVector
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...
GeomFactorsSharedPtr GetGeomFactors()
Get the geometric factors for this object, generating them if required.
virtual void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces)
Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated Geo...
int GetVertexEdgeMap(int i, int j) const
Returns the standard element edge IDs that are connected to a given vertex.
void ClampLocCoords(Array< OneD, NekDouble > &locCoord, NekDouble tol)
Clamp local coords to be within standard regions [-1, 1]^dim.
int GetVertexFaceMap(int i, int j) const
Returns the standard element face IDs that are connected to a given vertex.
static GeomFactorsVector m_regGeomFactorsManager
void Reset(CurveMap &curvedEdges, CurveMap &curvedFaces)
Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated Geo...
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...
GeomState m_geomFactorsState
State of the geometric factors.
int GetGlobalID(void) const
Get the ID of this object.
std::size_t operator()(GeometrySharedPtr const &p) const
virtual int v_GetNumFaces() const
Get the number of faces of this object.
virtual int v_GetShapeDim() const
Get the object's shape dimension.
int GetNumFaces() const
Get the number of faces of this object.
virtual void v_GenGeomFactors()=0
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
int GetCoordim() const
Return the coordinate dimension of this object (i.e. the dimension of the space in which 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...
std::vector< GeomFactorsSharedPtr > GeomFactorsVector
A vector of GeomFactor pointers.
std::shared_ptr< Geometry > GeometrySharedPtr
bool ContainsPoint(const Array< OneD, const NekDouble > &gloCoord, NekDouble tol=0.0)
Determine whether an element contains a particular Cartesian coordinate .
virtual StdRegions::StdExpansionSharedPtr v_GetXmap() const
Return the mapping object Geometry::m_xmap that represents the coordinate transformation from standar...
std::unordered_set< GeometrySharedPtr > GeometrySet
GeomState
Indicates if the geometric information for an element has been populated.
bool GlobalIdEquality(const std::shared_ptr< Geometry > &lhs, const std::shared_ptr< Geometry > &rhs)
void FillGeom()
Populate the coordinate mapping Geometry::m_coeffs information from any children geometry elements...
std::shared_ptr< PointGeom > PointGeomSharedPtr
bool m_setupState
Wether or not the setup routines have been run.
int GetVid(int i) const
Get the ID of vertex i of this object.
int GetNumVerts() const
Get the number of vertices of this object.
const Array< OneD, const NekDouble > & GetCoeffs(const int i) const
Return the coefficients of the transformation Geometry::m_xmap in coordinate direction i...
std::shared_ptr< GeometryVector > GeometryVectorSharedPtr
Array< OneD, Array< OneD, NekDouble > > m_coeffs
Array containing expansion coefficients of m_xmap.
virtual int v_GetNumVerts() const
Get the number of vertices of this object.
std::shared_ptr< Curve > CurveSharedPtr
int GetEdgeFaceMap(int i, int j) const
Returns the standard element edge IDs that are connected to a given face.
GeomType m_geomType
Type of geometry.
int 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 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...
Geometry1DSharedPtr GetEdge(int i) const
Returns edge i of this object.
LibUtilities::ShapeType m_shapeType
Type of shape.
std::shared_ptr< Geometry1D > Geometry1DSharedPtr
StdRegions::Orientation GetForient(const int i) const
Returns the orientation of face i with respect to the ordering of faces in the standard element...
void SetUpCoeffs(const int nCoeffs)
Initialise the Geometry::m_coeffs array.
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...
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs
virtual int v_GetNumEdges() const
Get the number of edges of this object.
GeomFactorsSharedPtr GetMetricInfo()
Get the geometric factors for this object.
GeomType
Indicates the type of element geometry.
GeomState m_state
Enumeration to dictate whether coefficients are filled.
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...
virtual int v_GetVertexFaceMap(int i, int j) const
Returns the standard element face IDs that are connected to a given vertex.
virtual ~Geometry()
Default destructor.
virtual void v_FillGeom()
Populate the coordinate mapping Geometry::m_coeffs information from any children geometry elements...
virtual int v_GetVertexEdgeMap(int i, int j) const
Returns the standard element edge IDs that are connected to a given vertex.
bool SortByGlobalId(const std::shared_ptr< Geometry > &lhs, const std::shared_ptr< Geometry > &rhs)
Less than operator to sort Geometry objects by global id when sorting STL containers.
virtual Geometry1DSharedPtr v_GetEdge(int i) const
Returns edge i of this object.
PointGeomSharedPtr GetVertex(int i) const
Returns vertex i of this object.
int m_coordim
Coordinate dimension of this geometry object.
Geometry()
Default constructor.
std::array< NekDouble, 6 > GetBoundingBox()
Generates the bounding box for the element.
LibUtilities::ShapeType GetShapeType(void)
Get the geometric shape type of this object.
#define SPATIAL_DOMAINS_EXPORT
void SetCoordim(int coordim)
Sets the coordinate dimension of this object (i.e. the dimension of the space in which this object is...
Unary function that constructs a hash of a Geometry object, based on the vertex IDs.