Nektar++
|
2D geometry information More...
#include <Geometry2D.h>
Public Member Functions | |
Geometry2D () | |
Geometry2D (const int coordim, CurveSharedPtr curve) | |
~Geometry2D () override | |
CurveSharedPtr | GetCurve () |
Public Member Functions inherited from Nektar::SpatialDomains::Geometry | |
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... | |
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)\). 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 &dist) |
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... | |
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. More... | |
bool | MinMaxCheck (const Array< OneD, const NekDouble > &gloCoord) |
Check if given global coord is within the BoundingBox of the element. More... | |
bool | ClampLocCoords (Array< OneD, NekDouble > &locCoord, NekDouble tol=std::numeric_limits< NekDouble >::epsilon()) |
Clamp local coords to be within standard regions [-1, 1]^dim. More... | |
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. 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... | |
int | GetEdgeNormalToFaceVert (int i, int j) const |
Returns the standard lement edge IDs that are normal to a given face vertex. More... | |
int | GetDir (const int i, const int j=0) const |
Returns the element coordinate direction corresponding to a given face coordinate direction. 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 | ResetNonRecursive (CurveMap &curvedEdges, CurveMap &curvedFaces) |
Reset this geometry object non-recursively: unset the current state, zero Geometry::m_coeffs and remove allocated GeomFactors. More... | |
void | Setup () |
void | GenGeomFactors () |
Handles generation of geometry factors. More... | |
Static Public Attributes | |
static const int | kDim = 2 |
Protected Member Functions | |
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. More... | |
void | NewtonIterationForLocCoord (const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &ptsx, const Array< OneD, const NekDouble > &ptsy, Array< OneD, NekDouble > &Lcoords, NekDouble &dist) |
void | SolveStraightEdgeQuad (const Array< OneD, const NekDouble > &coords, Array< OneD, NekDouble > &Lcoords) |
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. More... | |
PointGeomSharedPtr | v_GetVertex (int i) const override |
Geometry1DSharedPtr | v_GetEdge (int i) const override |
Returns edge i of this object. More... | |
int | v_GetNumVerts () const override |
Get the number of vertices of this object. More... | |
int | v_GetNumEdges () const override |
Get the number of edges of this object. More... | |
StdRegions::Orientation | v_GetEorient (const int i) const override |
Returns the orientation of edge i with respect to the ordering of edges in the standard element. More... | |
NekDouble | v_FindDistance (const Array< OneD, const NekDouble > &xs, Array< OneD, NekDouble > &xi) override |
Protected Member Functions inherited from Nektar::SpatialDomains::Geometry | |
virtual PointGeomSharedPtr | v_GetVertex (int i) const =0 |
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... | |
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 int | v_GetShapeDim () const |
Get the object's shape dimension. 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... | |
virtual void | v_FillGeom () |
Populate the coordinate mapping Geometry::m_coeffs information from any children geometry elements. More... | |
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)\). More... | |
virtual int | v_AllLeftCheck (const Array< OneD, const NekDouble > &gloCoord) |
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 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 NekDouble | v_FindDistance (const Array< OneD, const NekDouble > &xs, Array< OneD, NekDouble > &xi) |
virtual int | v_GetVertexEdgeMap (int i, int j) const |
Returns the standard element edge IDs that are connected to a given vertex. More... | |
virtual int | v_GetVertexFaceMap (int i, int j) const |
Returns the standard element face IDs that are connected to a given vertex. More... | |
virtual int | v_GetEdgeFaceMap (int i, int j) const |
Returns the standard element edge IDs that are connected to a given face. More... | |
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. More... | |
virtual int | v_GetDir (const int faceidx, const int facedir) const |
Returns the element coordinate direction corresponding to a given face coordinate direction. More... | |
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 ()=0 |
void | SetUpCoeffs (const int nCoeffs) |
Initialise the Geometry::m_coeffs array. More... | |
virtual void | v_CalculateInverseIsoParam () |
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. More... | |
Static Protected Attributes inherited from Nektar::SpatialDomains::Geometry | |
static GeomFactorsVector | m_regGeomFactorsManager |
2D geometry information
Definition at line 65 of file Geometry2D.h.
Nektar::SpatialDomains::Geometry2D::Geometry2D | ( | ) |
Definition at line 48 of file Geometry2D.cpp.
Nektar::SpatialDomains::Geometry2D::Geometry2D | ( | const int | coordim, |
CurveSharedPtr | curve | ||
) |
Definition at line 52 of file Geometry2D.cpp.
References ASSERTL0, and Nektar::SpatialDomains::Geometry::m_coordim.
|
override |
Definition at line 59 of file Geometry2D.cpp.
|
inline |
|
protected |
Definition at line 168 of file Geometry2D.cpp.
References Nektar::SpatialDomains::Geometry::ClampLocCoords(), Nektar::SpatialDomains::Geometry::GetGlobalID(), Nektar::NekConstants::kNewtonIterations, Nektar::SpatialDomains::Geometry::m_geomFactors, Nektar::SpatialDomains::Geometry::m_xmap, tinysimd::sqrt(), Vmath::Vsum(), and WARNINGL1.
Referenced by v_GetLocCoords().
|
protected |
Definition at line 141 of file Geometry2D.cpp.
References Nektar::LibUtilities::beta, Nektar::SpatialDomains::Geometry::m_isoParameter, Nektar::SpatialDomains::Geometry::m_straightEdge, and tinysimd::sqrt().
Referenced by v_GetLocCoords().
|
overrideprotectedvirtual |
Reimplemented from Nektar::SpatialDomains::Geometry.
Definition at line 63 of file Geometry2D.cpp.
References Nektar::SpatialDomains::Geometry::GetXmap(), Nektar::SpatialDomains::Geometry::m_coordim, m_edgeNormal, m_edges, m_manifold, and m_verts.
|
overrideprotectedvirtual |
Reimplemented from Nektar::SpatialDomains::Geometry.
Definition at line 626 of file Geometry2D.cpp.
References Nektar::SpatialDomains::Geometry::m_invIsoParam, and Nektar::SpatialDomains::Geometry::m_isoParameter.
Referenced by Nektar::SpatialDomains::QuadGeom::v_GenGeomFactors(), and Nektar::SpatialDomains::TriGeom::v_GenGeomFactors().
|
overrideprotectedvirtual |
Reimplemented from Nektar::SpatialDomains::Geometry.
Definition at line 400 of file Geometry2D.cpp.
References tinysimd::abs(), ASSERTL0, Nektar::SpatialDomains::Geometry::ClampLocCoords(), Nektar::SpatialDomains::eDeformed, Nektar::SpatialDomains::eRegular, Nektar::SpatialDomains::Geometry::GetCoord(), Nektar::SpatialDomains::Geometry::GetLocCoords(), Nektar::NekConstants::kNewtonIterations, Nektar::SpatialDomains::Geometry::m_coeffs, Nektar::SpatialDomains::Geometry::m_geomFactors, Nektar::SpatialDomains::Geometry::m_xmap, tinysimd::sqrt(), and Nektar::UnitTests::z().
|
overrideprotectedvirtual |
Returns edge i
of this object.
Reimplemented from Nektar::SpatialDomains::Geometry.
Definition at line 383 of file Geometry2D.cpp.
|
overrideprotectedvirtual |
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 389 of file Geometry2D.cpp.
|
overrideprotectedvirtual |
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 304 of file Geometry2D.cpp.
References Nektar::SpatialDomains::Geometry::ClampLocCoords(), Nektar::SpatialDomains::eDeformed, Nektar::SpatialDomains::eRegular, Nektar::SpatialDomains::Geometry::GetMetricInfo(), Nektar::SpatialDomains::Geometry::m_coeffs, Nektar::SpatialDomains::Geometry::m_coordim, Nektar::SpatialDomains::Geometry::m_invIsoParam, Nektar::SpatialDomains::Geometry::m_isoParameter, m_manifold, Nektar::SpatialDomains::Geometry::m_straightEdge, Nektar::SpatialDomains::Geometry::m_xmap, NewtonIterationForLocCoord(), SolveStraightEdgeQuad(), tinysimd::sqrt(), Nektar::SpatialDomains::Geometry::v_FillGeom(), and Nektar::UnitTests::z().
|
overrideprotectedvirtual |
Get the number of edges of this object.
Reimplemented from Nektar::SpatialDomains::Geometry.
Definition at line 372 of file Geometry2D.cpp.
References m_edges.
|
overrideprotectedvirtual |
Get the number of vertices of this object.
Reimplemented from Nektar::SpatialDomains::Geometry.
Definition at line 367 of file Geometry2D.cpp.
References m_verts.
|
overrideprotectedvirtual |
Get the object's shape dimension.
For example, a segment is one dimensional and quadrilateral is two dimensional.
Reimplemented from Nektar::SpatialDomains::Geometry.
Definition at line 395 of file Geometry2D.cpp.
|
overrideprotectedvirtual |
Implements Nektar::SpatialDomains::Geometry.
Definition at line 377 of file Geometry2D.cpp.
|
static |
Definition at line 72 of file Geometry2D.h.
|
protected |
Definition at line 82 of file Geometry2D.h.
Referenced by GetCurve(), Nektar::SpatialDomains::QuadGeom::v_FillGeom(), Nektar::SpatialDomains::TriGeom::v_FillGeom(), Nektar::SpatialDomains::QuadGeom::v_Reset(), and Nektar::SpatialDomains::TriGeom::v_Reset().
Definition at line 84 of file Geometry2D.h.
Referenced by v_AllLeftCheck().
|
protected |
Definition at line 80 of file Geometry2D.h.
Referenced by Nektar::SpatialDomains::QuadGeom::QuadGeom(), Nektar::SpatialDomains::QuadGeom::SetUpXmap(), Nektar::SpatialDomains::TriGeom::SetUpXmap(), Nektar::SpatialDomains::TriGeom::TriGeom(), v_AllLeftCheck(), Nektar::SpatialDomains::QuadGeom::v_FillGeom(), Nektar::SpatialDomains::TriGeom::v_FillGeom(), v_GetEdge(), v_GetNumEdges(), Nektar::SpatialDomains::QuadGeom::v_Reset(), Nektar::SpatialDomains::TriGeom::v_Reset(), Nektar::SpatialDomains::QuadGeom::v_Setup(), and Nektar::SpatialDomains::TriGeom::v_Setup().
|
protected |
Definition at line 81 of file Geometry2D.h.
Referenced by Nektar::SpatialDomains::QuadGeom::QuadGeom(), Nektar::SpatialDomains::TriGeom::TriGeom(), Nektar::SpatialDomains::QuadGeom::v_FillGeom(), Nektar::SpatialDomains::TriGeom::v_FillGeom(), and v_GetEorient().
Definition at line 83 of file Geometry2D.h.
Referenced by v_AllLeftCheck(), Nektar::SpatialDomains::QuadGeom::v_GenGeomFactors(), Nektar::SpatialDomains::TriGeom::v_GenGeomFactors(), and v_GetLocCoords().
|
protected |
Definition at line 79 of file Geometry2D.h.
Referenced by Nektar::SpatialDomains::QuadGeom::GetFaceOrientation(), Nektar::SpatialDomains::TriGeom::GetFaceOrientation(), Nektar::SpatialDomains::QuadGeom::QuadGeom(), Nektar::SpatialDomains::TriGeom::TriGeom(), v_AllLeftCheck(), Nektar::SpatialDomains::TriGeom::v_FillGeom(), Nektar::SpatialDomains::QuadGeom::v_GenGeomFactors(), Nektar::SpatialDomains::TriGeom::v_GenGeomFactors(), v_GetNumVerts(), and v_GetVertex().