37 #include <boost/core/ignore_unused.hpp> 45 namespace SpatialDomains
98 if (geomFactor->GetGtype() ==
eRegular)
104 if (**iter == *geomFactor)
115 returnval = geomFactor;
123 const std::shared_ptr<Geometry> &
rhs)
125 return lhs->GetGlobalID() < rhs->GetGlobalID();
129 const std::shared_ptr<Geometry> &
rhs)
131 return lhs->GetGlobalID() == rhs->GetGlobalID();
147 return GetEdge(i)->GetGlobalID();
155 return GetFace(i)->GetGlobalID();
163 boost::ignore_unused(i);
165 "This function is only valid for shape type geometries");
174 boost::ignore_unused(i);
176 "This function is only valid for shape type geometries");
186 "This function is only valid for shape type geometries");
195 boost::ignore_unused(i);
197 "This function is not valid for this geometry.");
206 boost::ignore_unused(i);
208 "This function is not valid for this geometry.");
218 "This function is only valid for shape type geometries");
228 "This function is only valid for shape type geometries");
238 "This function is only valid for shape type geometries");
260 boost::ignore_unused(gloCoord, locCoord, tol, resid);
262 "This function has not been defined for this geometry");
271 boost::ignore_unused(i, j);
273 "This function has not been defined for this geometry");
282 boost::ignore_unused(i, j);
284 "This function has not been defined for this geometry");
293 boost::ignore_unused(i, j);
295 "This function has not been defined for this geometry");
305 boost::ignore_unused(i, Lcoord);
307 "This function is only valid for expansion type geometries");
317 boost::ignore_unused(coords, Lcoords);
319 "This function is only valid for expansion type geometries");
329 "This function is only valid for expansion type geometries");
337 boost::ignore_unused(curvedEdges, curvedFaces);
350 "This function is only valid for expansion type geometries");
371 p->GetCoords(x[0], x[1], x[2]);
372 for (
int j = 0; j < 3; ++j)
380 p->GetCoords(x[0], x[1], x[2]);
381 for (
int j = 0; j < 3; ++j)
383 min[j] = (x[j] < min[j] ? x[j] : min[j]);
384 max[j] = (x[j] > max[j] ? x[j] : max[j]);
390 const int nq =
GetXmap()->GetTotPoints();
392 for (
int j = 0; j < 3; ++j)
400 for (
int j = 0; j < 3; ++j)
402 for (
int i = 0; i < nq; ++i)
404 min[j] = (x[j][i] < min[j] ? x[j][i] : min[j]);
405 max[j] = (x[j][i] > max[j] ? x[j][i] : max[j]);
416 for (
int j = 0; j < 3; ++j)
424 return {{ min[0], min[1], min[2], max[0], max[1], max[2] }};
439 "Expects number of global coordinates supplied to be greater than " 440 "or equal to the mesh dimension.");
448 const int npts =
m_xmap->GetTotPoints();
454 mincoord[i] =
Vmath::Vmin(pts.num_elements(), pts, 1);
455 maxcoord[i] =
Vmath::Vmax(pts.num_elements(), pts, 1);
457 diff = std::max(maxcoord[i] - mincoord[i], diff);
462 if ((gloCoord[i] < mincoord[i] - 0.2 * diff) ||
463 (gloCoord[i] > maxcoord[i] + 0.2 * diff))
483 "Expects same number of local coordinates as shape dimension.");
491 if (locCoord[i] < -(1 + tol))
493 locCoord[i] = -(1 + tol);
496 if (locCoord[i] > (1 + tol))
498 locCoord[i] = 1 + tol;
StdRegions::StdExpansionSharedPtr m_xmap
mapping containing isoparametric transformation.
virtual Geometry2DSharedPtr v_GetFace(int i) const
Returns face i of this object.
int GetShapeDim() const
Get the object's shape dimension.
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mod...
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 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
GeomFactorsSharedPtr m_geomFactors
Geometric factors.
StdRegions::StdExpansionSharedPtr GetXmap() const
Return the mapping object Geometry::m_xmap that represents the coordinate transformation from standar...
T Vmax(int n, const T *x, const int incx)
Return the maximum element in x – called vmax to avoid conflict with max.
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.
T Vmin(int n, const T *x, const int incx)
Return the minimum element in x - called vmin to avoid conflict with min.
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...
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...
void ClampLocCoords(Array< OneD, NekDouble > &locCoord, NekDouble tol)
Clamp local coords to be within standard regions [-1, 1]^dim.
static GeomFactorsVector m_regGeomFactorsManager
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.
virtual int v_GetNumFaces() const
Get the number of faces of this object.
virtual int v_GetShapeDim() const
Get the object's shape dimension.
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 ...
Geometric information has not been generated.
std::vector< GeomFactorsSharedPtr > GeomFactorsVector
A vector of GeomFactor pointers.
virtual StdRegions::StdExpansionSharedPtr v_GetXmap() const
Return the mapping object Geometry::m_xmap that represents the coordinate transformation from standar...
bool GlobalIdEquality(const std::shared_ptr< Geometry > &lhs, const std::shared_ptr< Geometry > &rhs)
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.
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.
Geometry is straight-sided with constant geometric factors.
static const NekDouble kGeomFactorsTol
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...
Geometry1DSharedPtr GetEdge(int i) const
Returns edge i of this object.
LibUtilities::ShapeType m_shapeType
Type of shape.
std::shared_ptr< Geometry1D > Geometry1DSharedPtr
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs
virtual int v_GetNumEdges() const
Get the number of edges of this object.
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.
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
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.