Nektar++
|
#include <SegGeom.h>
Public Member Functions | |
SegGeom () | |
SegGeom (int id, const int coordim, const PointGeomSharedPtr vertex[], const CurveSharedPtr curve=CurveSharedPtr()) | |
SegGeom (const SegGeom &in) | |
SegGeomSharedPtr | GenerateOneSpaceDimGeom (void) |
Generate a one dimensional space segment geometry where the vert[0] has the same x value and vert[1] is set to vert[0] plus the length of the original segment. More... | |
~SegGeom () | |
CurveSharedPtr | GetCurve () |
![]() | |
Geometry1D () | |
Geometry1D (const int coordim) | |
virtual | ~Geometry1D () |
![]() | |
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 Member Functions | |
static StdRegions::Orientation | GetEdgeOrientation (const SegGeom &edge1, const SegGeom &edge2) |
Get the orientation of edge1 . More... | |
Static Public Attributes | |
static const int | kNverts = 2 |
static const int | kNedges = 1 |
![]() | |
static const int | kDim = 1 |
Protected Member Functions | |
virtual PointGeomSharedPtr | v_GetVertex (const int i) const |
virtual LibUtilities::ShapeType | v_GetShapeType () const |
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 void | v_GenGeomFactors () |
virtual void | v_FillGeom () |
Populate the coordinate mapping Geometry::m_coeffs information from any children geometry elements. 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 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_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 bool | v_ContainsPoint (const Array< OneD, const NekDouble > &gloCoord, Array< OneD, NekDouble > &locCoord, NekDouble tol, NekDouble &resid) |
![]() | |
virtual int | v_GetShapeDim () const |
Get the object's shape dimension. More... | |
![]() | |
void | GenGeomFactors () |
Handles generation of geometry factors. More... | |
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_GetNumFaces () const |
Get the number of faces of this object. 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 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... | |
void | SetUpCoeffs (const int nCoeffs) |
Initialise the Geometry::m_coeffs array. More... | |
Protected Attributes | |
SpatialDomains::PointGeomSharedPtr | m_verts [kNverts] |
StdRegions::Orientation | m_porient [kNverts] |
![]() | |
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... | |
Private Member Functions | |
void | SetUpXmap () |
Private Attributes | |
CurveSharedPtr | m_curve |
Boolean indicating whether object owns the data. More... | |
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... | |
![]() | |
static GeomFactorsVector | m_regGeomFactorsManager |
Nektar::SpatialDomains::SegGeom::SegGeom | ( | ) |
Definition at line 47 of file SegGeom.cpp.
References Nektar::LibUtilities::eSegment, and Nektar::SpatialDomains::Geometry::m_shapeType.
Nektar::SpatialDomains::SegGeom::SegGeom | ( | int | id, |
const int | coordim, | ||
const PointGeomSharedPtr | vertex[], | ||
const CurveSharedPtr | curve = CurveSharedPtr() |
||
) |
Definition at line 52 of file SegGeom.cpp.
References Nektar::SpatialDomains::eNotFilled, Nektar::LibUtilities::eSegment, m_curve, Nektar::SpatialDomains::Geometry::m_globalID, Nektar::SpatialDomains::Geometry::m_shapeType, Nektar::SpatialDomains::Geometry::m_state, and m_verts.
Nektar::SpatialDomains::SegGeom::SegGeom | ( | const SegGeom & | in | ) |
Definition at line 67 of file SegGeom.cpp.
References Nektar::SpatialDomains::Geometry::m_coordim, Nektar::SpatialDomains::Geometry::m_globalID, Nektar::SpatialDomains::Geometry::m_shapeType, Nektar::SpatialDomains::Geometry::m_state, m_verts, Nektar::SpatialDomains::Geometry::m_xmap, and Nektar::SpatialDomains::Geometry::SetUpCoeffs().
Nektar::SpatialDomains::SegGeom::~SegGeom | ( | ) |
Definition at line 165 of file SegGeom.cpp.
SegGeomSharedPtr Nektar::SpatialDomains::SegGeom::GenerateOneSpaceDimGeom | ( | void | ) |
Generate a one dimensional space segment geometry where the vert[0] has the same x value and vert[1] is set to vert[0] plus the length of the original segment.
Definition at line 111 of file SegGeom.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::SpatialDomains::eNotFilled, Nektar::SpatialDomains::Geometry::GetGlobalID(), Nektar::SpatialDomains::Geometry::m_geomFactors, Nektar::SpatialDomains::Geometry::m_globalID, m_verts, Nektar::SpatialDomains::Geometry::m_xmap, and v_GenGeomFactors().
|
inline |
Definition at line 73 of file SegGeom.h.
References m_curve.
Referenced by export_GeomElements().
|
static |
Get the orientation of edge1
.
If edge1
is connected to edge2
in the same direction as the points comprising edge1
then it is forward, otherwise it is backward.
For example, assume edge1
is comprised of points 1 and 2, and edge2
is comprised of points 2 and 3, then edge1
is forward.
If edge1
is comprised of points 2 and 1 and edge2
is comprised of points 3 and 2, then edge1
is backward.
Since both edges are passed, it does not need any information from the EdgeComponent instance.
Definition at line 200 of file SegGeom.cpp.
References ASSERTL0, Nektar::StdRegions::eBackwards, Nektar::StdRegions::eForwards, Nektar::SpatialDomains::Geometry::GetGlobalID(), and Nektar::SpatialDomains::Geometry::GetVertex().
Referenced by Nektar::SpatialDomains::QuadGeom::QuadGeom(), and Nektar::SpatialDomains::TriGeom::TriGeom().
|
private |
Definition at line 86 of file SegGeom.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eModified_A, m_curve, and Nektar::SpatialDomains::Geometry::m_xmap.
Referenced by v_Reset(), and v_Setup().
|
protectedvirtual |
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.
The parameter tol
which is by default 0, can be used to expand the coordinate range of the standard element from \([-1,1]^d\) to \([-1-\epsilon,1+\epsilon\) to handle challenging edge cases. The function also returns the local coordinates corresponding to gloCoord
that can be used to speed up subsequent searches.
gloCoord | The coordinate \( (x,y,z) \). |
locCoord | On exit, this is the local coordinate \(\vec{\xi}\) such that \(\chi(\vec{\xi}) = \vec{x}\). |
tol | The tolerance used to dictate the bounding box of the standard coordinates \(\vec{\xi}\). |
resid | On exit, returns the minimum distance between gloCoord and the quadrature points inside the element. |
true
if the coordinate gloCoord
is contained in the element; false otherwise.Reimplemented from Nektar::SpatialDomains::Geometry.
Definition at line 372 of file SegGeom.cpp.
References Nektar::SpatialDomains::Geometry::ClampLocCoords(), Nektar::SpatialDomains::eRegular, Nektar::SpatialDomains::Geometry::GetLocCoords(), Nektar::SpatialDomains::Geometry::GetMetricInfo(), and Nektar::SpatialDomains::Geometry::MinMaxCheck().
|
protectedvirtual |
Populate the coordinate mapping Geometry::m_coeffs information from any children geometry elements.
Reimplemented from Nektar::SpatialDomains::Geometry.
Definition at line 247 of file SegGeom.cpp.
References Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::SpatialDomains::ePtsFilled, Nektar::ErrorUtil::ewarning, Nektar::eWrapper, Nektar::NekVector< DataType >::GetPtr(), Nektar::NekConstants::kVertexTheSameDouble, Nektar::SpatialDomains::Geometry::m_coeffs, Nektar::SpatialDomains::Geometry::m_coordim, m_curve, Nektar::SpatialDomains::Geometry::m_globalID, Nektar::SpatialDomains::Geometry::m_state, m_verts, Nektar::SpatialDomains::Geometry::m_xmap, NEKERROR, and Nektar::LibUtilities::PointsManager().
Referenced by v_GenGeomFactors(), and v_GetLocCoords().
|
protectedvirtual |
Implements Nektar::SpatialDomains::Geometry.
Definition at line 224 of file SegGeom.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, v_FillGeom(), and v_Setup().
Referenced by GenerateOneSpaceDimGeom().
|
protectedvirtual |
Given local collapsed coordinate Lcoord
, return the value of physical coordinate in direction i
.
Reimplemented from Nektar::SpatialDomains::Geometry.
Definition at line 174 of file SegGeom.cpp.
References ASSERTL1, Nektar::SpatialDomains::ePtsFilled, Nektar::SpatialDomains::Geometry::m_coeffs, Nektar::SpatialDomains::Geometry::m_state, and Nektar::SpatialDomains::Geometry::m_xmap.
|
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 339 of file SegGeom.cpp.
References Nektar::ErrorUtil::efatal, Nektar::SpatialDomains::eRegular, Nektar::SpatialDomains::Geometry::GetMetricInfo(), Nektar::SpatialDomains::Geometry::m_coeffs, Nektar::SpatialDomains::Geometry::m_coordim, Nektar::SpatialDomains::Geometry::m_xmap, NEKERROR, and v_FillGeom().
|
protectedvirtual |
Get the number of edges of this object.
Reimplemented from Nektar::SpatialDomains::Geometry.
Definition at line 417 of file SegGeom.cpp.
References kNedges.
|
protectedvirtual |
Get the number of vertices of this object.
Reimplemented from Nektar::SpatialDomains::Geometry.
Definition at line 412 of file SegGeom.cpp.
References kNverts.
|
protectedvirtual |
Definition at line 169 of file SegGeom.cpp.
References Nektar::LibUtilities::eSegment.
|
protectedvirtual |
Implements Nektar::SpatialDomains::Geometry.
Definition at line 400 of file SegGeom.cpp.
References kNverts, and m_verts.
|
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 315 of file SegGeom.cpp.
References m_curve, Nektar::SpatialDomains::Geometry::m_globalID, Nektar::SpatialDomains::Geometry::m_xmap, Nektar::SpatialDomains::Geometry::SetUpCoeffs(), SetUpXmap(), and Nektar::SpatialDomains::Geometry::v_Reset().
|
protectedvirtual |
Reimplemented from Nektar::SpatialDomains::Geometry.
Definition at line 329 of file SegGeom.cpp.
References Nektar::SpatialDomains::Geometry::m_setupState, Nektar::SpatialDomains::Geometry::m_xmap, Nektar::SpatialDomains::Geometry::SetUpCoeffs(), and SetUpXmap().
Referenced by v_GenGeomFactors().
|
static |
Definition at line 79 of file SegGeom.h.
Referenced by v_GetNumEdges().
|
static |
Definition at line 78 of file SegGeom.h.
Referenced by v_GetNumVerts(), and v_GetVertex().
|
private |
Boolean indicating whether object owns the data.
Definition at line 107 of file SegGeom.h.
Referenced by GetCurve(), SegGeom(), SetUpXmap(), v_FillGeom(), and v_Reset().
|
protected |
|
protected |
Definition at line 82 of file SegGeom.h.
Referenced by GenerateOneSpaceDimGeom(), SegGeom(), v_FillGeom(), and v_GetVertex().