Nektar++
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Nektar::SpatialDomains::Geometry2D Class Reference

2D geometry information More...

#include <Geometry2D.h>

Inheritance diagram for Nektar::SpatialDomains::Geometry2D:
[legend]

Public Member Functions

 Geometry2D ()
 
 Geometry2D (const int coordim, CurveSharedPtr curve)
 
 ~Geometry2D () override=default
 
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
 
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 ()
 

Protected Attributes

PointGeomVector m_verts
 
SegGeomVector m_edges
 
std::vector< StdRegions::Orientationm_eorient
 
CurveSharedPtr m_curve
 
Array< OneD, int > m_manifold
 
Array< OneD, Array< OneD, NekDouble > > m_edgeNormal
 
- Protected Attributes inherited from Nektar::SpatialDomains::Geometry
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...
 
Array< OneD, NekDoublem_boundingBox
 Array containing bounding box. More...
 
Array< OneD, Array< OneD, NekDouble > > m_isoParameter
 
Array< OneD, Array< OneD, NekDouble > > m_invIsoParam
 
int m_straightEdge
 

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
 

Detailed Description

2D geometry information

Definition at line 64 of file Geometry2D.h.

Constructor & Destructor Documentation

◆ Geometry2D() [1/2]

Nektar::SpatialDomains::Geometry2D::Geometry2D ( )

Definition at line 46 of file Geometry2D.cpp.

47{
48}

◆ Geometry2D() [2/2]

Nektar::SpatialDomains::Geometry2D::Geometry2D ( const int  coordim,
CurveSharedPtr  curve 
)

Definition at line 50 of file Geometry2D.cpp.

51 : Geometry(coordim), m_curve(curve)
52{
54 "Coordinate dimension should be at least 2 for a 2D geometry");
55}
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208
Geometry()
Default constructor.
Definition: Geometry.cpp:50
int m_coordim
Coordinate dimension of this geometry object.
Definition: Geometry.h:188

References ASSERTL0, and Nektar::SpatialDomains::Geometry::m_coordim.

◆ ~Geometry2D()

Nektar::SpatialDomains::Geometry2D::~Geometry2D ( )
overridedefault

Member Function Documentation

◆ GetCurve()

CurveSharedPtr Nektar::SpatialDomains::Geometry2D::GetCurve ( )
inline

Definition at line 73 of file Geometry2D.h.

74 {
75 return m_curve;
76 }

References m_curve.

◆ NewtonIterationForLocCoord()

void Nektar::SpatialDomains::Geometry2D::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 
)
protected

Definition at line 170 of file Geometry2D.cpp.

175{
176 // Maximum iterations for convergence
177 const int MaxIterations = NekConstants::kNewtonIterations;
178 // |x-xp|^2 < EPSILON error tolerance
179 const NekDouble Tol = 1.e-8;
180 // |r,s| > LcoordDIV stop the search
181 const NekDouble LcoordDiv = 15.0;
182
183 Array<OneD, const NekDouble> Jac =
184 m_geomFactors->GetJac(m_xmap->GetPointsKeys());
185
186 NekDouble ScaledTol =
187 Vmath::Vsum(Jac.size(), Jac, 1) / ((NekDouble)Jac.size());
188 ScaledTol *= Tol;
189
190 NekDouble xmap, ymap, F1, F2;
191 NekDouble derx_1, derx_2, dery_1, dery_2, jac;
192
193 // save intiial guess for later reference if required.
194 NekDouble init0 = Lcoords[0], init1 = Lcoords[1];
195
196 Array<OneD, NekDouble> DxD1(ptsx.size());
197 Array<OneD, NekDouble> DxD2(ptsx.size());
198 Array<OneD, NekDouble> DyD1(ptsx.size());
199 Array<OneD, NekDouble> DyD2(ptsx.size());
200
201 // Ideally this will be stored in m_geomfactors
202 m_xmap->PhysDeriv(ptsx, DxD1, DxD2);
203 m_xmap->PhysDeriv(ptsy, DyD1, DyD2);
204
205 int cnt = 0;
206 Array<OneD, DNekMatSharedPtr> I(2);
207 Array<OneD, NekDouble> eta(2);
208
209 F1 = F2 = 2000; // Starting value of Function
210 NekDouble resid = sqrt(F1 * F1 + F2 * F2);
211 while (cnt++ < MaxIterations)
212 {
213 // evaluate lagrange interpolant at Lcoords
214 m_xmap->LocCoordToLocCollapsed(Lcoords, eta);
215 I[0] = m_xmap->GetBasis(0)->GetI(eta);
216 I[1] = m_xmap->GetBasis(1)->GetI(eta + 1);
217
218 // calculate the global point `corresponding to Lcoords
219 xmap = m_xmap->PhysEvaluate(I, ptsx);
220 ymap = m_xmap->PhysEvaluate(I, ptsy);
221
222 F1 = coords[0] - xmap;
223 F2 = coords[1] - ymap;
224
225 if (F1 * F1 + F2 * F2 < ScaledTol)
226 {
227 resid = sqrt(F1 * F1 + F2 * F2);
228 break;
229 }
230
231 // Interpolate derivative metric at Lcoords
232 derx_1 = m_xmap->PhysEvaluate(I, DxD1);
233 derx_2 = m_xmap->PhysEvaluate(I, DxD2);
234 dery_1 = m_xmap->PhysEvaluate(I, DyD1);
235 dery_2 = m_xmap->PhysEvaluate(I, DyD2);
236
237 jac = dery_2 * derx_1 - dery_1 * derx_2;
238
239 // use analytical inverse of derivitives which are
240 // also similar to those of metric factors.
241 Lcoords[0] =
242 Lcoords[0] +
243 (dery_2 * (coords[0] - xmap) - derx_2 * (coords[1] - ymap)) / jac;
244
245 Lcoords[1] =
246 Lcoords[1] +
247 (-dery_1 * (coords[0] - xmap) + derx_1 * (coords[1] - ymap)) / jac;
248
249 if (!(std::isfinite(Lcoords[0]) && std::isfinite(Lcoords[1])))
250 {
251 dist = 1e16;
252 std::ostringstream ss;
253 ss << "nan or inf found in NewtonIterationForLocCoord in element "
254 << GetGlobalID();
255 WARNINGL1(false, ss.str());
256 return;
257 }
258 if (fabs(Lcoords[0]) > LcoordDiv || fabs(Lcoords[1]) > LcoordDiv)
259 {
260 break; // lcoords have diverged so stop iteration
261 }
262 }
263
264 m_xmap->LocCoordToLocCollapsed(Lcoords, eta);
265 if (ClampLocCoords(eta, 0.))
266 {
267 I[0] = m_xmap->GetBasis(0)->GetI(eta);
268 I[1] = m_xmap->GetBasis(1)->GetI(eta + 1);
269 // calculate the global point corresponding to Lcoords
270 xmap = m_xmap->PhysEvaluate(I, ptsx);
271 ymap = m_xmap->PhysEvaluate(I, ptsy);
272 F1 = coords[0] - xmap;
273 F2 = coords[1] - ymap;
274 dist = sqrt(F1 * F1 + F2 * F2);
275 }
276 else
277 {
278 dist = 0.;
279 }
280
281 if (cnt >= MaxIterations)
282 {
283 Array<OneD, NekDouble> collCoords(2);
284 m_xmap->LocCoordToLocCollapsed(Lcoords, collCoords);
285
286 // if coordinate is inside element dump error!
287 if ((collCoords[0] >= -1.0 && collCoords[0] <= 1.0) &&
288 (collCoords[1] >= -1.0 && collCoords[1] <= 1.0))
289 {
290 std::ostringstream ss;
291
292 ss << "Reached MaxIterations (" << MaxIterations
293 << ") in Newton iteration ";
294 ss << "Init value (" << std::setprecision(4) << init0 << ","
295 << init1 << ","
296 << ") ";
297 ss << "Fin value (" << Lcoords[0] << "," << Lcoords[1] << ","
298 << ") ";
299 ss << "Resid = " << resid
300 << " Tolerance = " << std::sqrt(ScaledTol);
301
302 WARNINGL1(cnt < MaxIterations, ss.str());
303 }
304 }
305}
#define WARNINGL1(condition, msg)
Definition: ErrorUtil.hpp:243
bool ClampLocCoords(Array< OneD, NekDouble > &locCoord, NekDouble tol=std::numeric_limits< NekDouble >::epsilon())
Clamp local coords to be within standard regions [-1, 1]^dim.
Definition: Geometry.cpp:530
int GetGlobalID(void) const
Get the ID of this object.
Definition: Geometry.h:326
StdRegions::StdExpansionSharedPtr m_xmap
mapping containing isoparametric transformation.
Definition: Geometry.h:194
GeomFactorsSharedPtr m_geomFactors
Geometric factors.
Definition: Geometry.h:190
static const unsigned int kNewtonIterations
double NekDouble
T Vsum(int n, const T *x, const int incx)
Subtract return sum(x)
Definition: Vmath.hpp:608
scalarT< T > sqrt(scalarT< T > in)
Definition: scalar.hpp:285

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().

◆ SolveStraightEdgeQuad()

void Nektar::SpatialDomains::Geometry2D::SolveStraightEdgeQuad ( const Array< OneD, const NekDouble > &  coords,
Array< OneD, NekDouble > &  Lcoords 
)
protected

Definition at line 143 of file Geometry2D.cpp.

145{
146 int i0 = 0, i1 = 1, j1 = 0, j2 = 1;
147 if (m_straightEdge & 2)
148 {
149 i0 = 1;
150 i1 = 0;
151 }
152 if (m_straightEdge & 4)
153 {
154 j1 = 1;
155 j2 = 0;
156 }
158 NekDouble gamma = m_isoParameter[1][3];
159 NekDouble tty = (coords[i1] - gamma * coords[i0] - m_isoParameter[1][0]) *
160 m_isoParameter[1][1];
161 NekDouble denom = 1. / (m_isoParameter[0][2] + m_isoParameter[0][3] * tty);
162 NekDouble epsilon = -m_isoParameter[0][3] * beta * denom;
163 NekDouble h =
164 (m_isoParameter[0][0] + m_isoParameter[0][1] * tty - coords[i0]) *
165 denom;
166 Lcoords[j2] = -h / (0.5 + sqrt(0.25 - epsilon * h));
167 Lcoords[j1] = -beta * Lcoords[j2] + tty;
168}
Array< OneD, Array< OneD, NekDouble > > m_isoParameter
Definition: Geometry.h:209
@ beta
Gauss Radau pinned at x=-1,.
Definition: PointsType.h:59

References Nektar::LibUtilities::beta, Nektar::SpatialDomains::Geometry::m_isoParameter, Nektar::SpatialDomains::Geometry::m_straightEdge, and tinysimd::sqrt().

Referenced by v_GetLocCoords().

◆ v_AllLeftCheck()

int Nektar::SpatialDomains::Geometry2D::v_AllLeftCheck ( const Array< OneD, const NekDouble > &  gloCoord)
overrideprotectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 57 of file Geometry2D.cpp.

58{
59 int nc = 1, d0 = m_manifold[0], d1 = m_manifold[1];
60 if (0 == m_edgeNormal.size())
61 {
62 m_edgeNormal = Array<OneD, Array<OneD, NekDouble>>(m_verts.size());
63 Array<OneD, Array<OneD, NekDouble>> x(2);
64 x[0] = Array<OneD, NekDouble>(3);
65 x[1] = Array<OneD, NekDouble>(3);
66 m_verts[0]->GetCoords(x[0]);
67 int i0 = 1, i1 = 0, direction = 1;
68 for (size_t i = 0; i < m_verts.size(); ++i)
69 {
70 i0 ^= 1;
71 i1 ^= 1;
72 m_verts[(i + 1) % m_verts.size()]->GetCoords(x[i1]);
73 if (m_edges[i]->GetXmap()->GetBasis(0)->GetNumModes() > 2)
74 {
75 continue;
76 }
77 m_edgeNormal[i] = Array<OneD, NekDouble>(2);
78 m_edgeNormal[i][0] = x[i0][d1] - x[i1][d1];
79 m_edgeNormal[i][1] = x[i1][d0] - x[i0][d0];
80 }
81 if (m_coordim == 3)
82 {
83 for (size_t i = 0; i < m_verts.size(); ++i)
84 {
85 if (m_edgeNormal[i].size() == 2)
86 {
87 m_verts[i]->GetCoords(x[0]);
88 m_verts[(i + 2) % m_verts.size()]->GetCoords(x[1]);
89 if (m_edgeNormal[i][0] * (x[1][d0] - x[0][d0]) <
90 m_edgeNormal[i][1] * (x[0][d1] - x[1][d1]))
91 {
92 direction = -1;
93 }
94 break;
95 }
96 }
97 }
98 if (direction == -1)
99 {
100 for (size_t i = 0; i < m_verts.size(); ++i)
101 {
102 if (m_edgeNormal[i].size() == 2)
103 {
104 m_edgeNormal[i][0] = -m_edgeNormal[i][0];
105 m_edgeNormal[i][1] = -m_edgeNormal[i][1];
106 }
107 }
108 }
109 }
110
111 Array<OneD, NekDouble> vertex(3);
112 for (size_t i = 0; i < m_verts.size(); ++i)
113 {
114 int i1 = (i + 1) % m_verts.size();
115 if (m_verts[i]->GetVid() < m_verts[i1]->GetVid())
116 {
117 m_verts[i]->GetCoords(vertex);
118 }
119 else
120 {
121 m_verts[i1]->GetCoords(vertex);
122 }
123 if (m_edgeNormal[i].size() == 0)
124 {
125 nc = 0; // not sure
126 continue;
127 }
128 if (m_edgeNormal[i][0] * (gloCoord[d0] - vertex[d0]) <
129 m_edgeNormal[i][1] * (vertex[d1] - gloCoord[d1]))
130 {
131 return -1; // outside
132 }
133 }
134 // 3D manifold needs to check the distance
135 if (m_coordim == 3)
136 {
137 nc = 0;
138 }
139 // nc: 1 (side element), 0 (maybe inside), -1 (outside)
140 return nc;
141}
Array< OneD, int > m_manifold
Definition: Geometry2D.h:83
Array< OneD, Array< OneD, NekDouble > > m_edgeNormal
Definition: Geometry2D.h:84
int GetVid(int i) const
Get the ID of vertex i of this object.
Definition: Geometry.cpp:104
StdRegions::StdExpansionSharedPtr GetXmap() const
Return the mapping object Geometry::m_xmap that represents the coordinate transformation from standar...
Definition: Geometry.h:435

References Nektar::SpatialDomains::Geometry::GetVid(), Nektar::SpatialDomains::Geometry::GetXmap(), Nektar::SpatialDomains::Geometry::m_coordim, m_edgeNormal, m_edges, m_manifold, and m_verts.

◆ v_CalculateInverseIsoParam()

void Nektar::SpatialDomains::Geometry2D::v_CalculateInverseIsoParam ( )
overrideprotectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 629 of file Geometry2D.cpp.

630{
631 NekDouble Jac = m_isoParameter[0][1] * m_isoParameter[1][2] -
632 m_isoParameter[1][1] * m_isoParameter[0][2];
633 Jac = 1. / Jac;
634 // a12, -a02, -a11, a01
635 m_invIsoParam = Array<OneD, Array<OneD, NekDouble>>(2);
636 m_invIsoParam[0] = Array<OneD, NekDouble>(2);
637 m_invIsoParam[1] = Array<OneD, NekDouble>(2);
638 m_invIsoParam[0][0] = m_isoParameter[1][2] * Jac;
639 m_invIsoParam[0][1] = -m_isoParameter[0][2] * Jac;
640 m_invIsoParam[1][0] = -m_isoParameter[1][1] * Jac;
641 m_invIsoParam[1][1] = m_isoParameter[0][1] * Jac;
642}
Array< OneD, Array< OneD, NekDouble > > m_invIsoParam
Definition: Geometry.h:210

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().

◆ v_FindDistance()

NekDouble Nektar::SpatialDomains::Geometry2D::v_FindDistance ( const Array< OneD, const NekDouble > &  xs,
Array< OneD, NekDouble > &  xi 
)
overrideprotectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 403 of file Geometry2D.cpp.

405{
406 if (m_geomFactors->GetGtype() == eRegular)
407 {
408 xiOut = Array<OneD, NekDouble>(2, 0.0);
409
410 GetLocCoords(xs, xiOut);
411 ClampLocCoords(xiOut);
412
413 Array<OneD, NekDouble> gloCoord(3);
414 gloCoord[0] = GetCoord(0, xiOut);
415 gloCoord[1] = GetCoord(1, xiOut);
416 gloCoord[2] = GetCoord(2, xiOut);
417
418 return sqrt((xs[0] - gloCoord[0]) * (xs[0] - gloCoord[0]) +
419 (xs[1] - gloCoord[1]) * (xs[1] - gloCoord[1]) +
420 (xs[2] - gloCoord[2]) * (xs[2] - gloCoord[2]));
421 }
422 // If deformed edge then the inverse mapping is non-linear so need to
423 // numerically solve for the local coordinate
424 else if (m_geomFactors->GetGtype() == eDeformed)
425 {
426 // Choose starting based on closest quad
427 Array<OneD, NekDouble> xi(2, 0.0), eta(2, 0.0);
428 m_xmap->LocCollapsedToLocCoord(eta, xi);
429
430 // Armijo constants:
431 // https://en.wikipedia.org/wiki/Backtracking_line_search
432 const NekDouble c1 = 1e-4, c2 = 0.9;
433
434 int nq = m_xmap->GetTotPoints();
435
436 Array<OneD, NekDouble> x(nq), y(nq), z(nq);
437 m_xmap->BwdTrans(m_coeffs[0], x);
438 m_xmap->BwdTrans(m_coeffs[1], y);
439 m_xmap->BwdTrans(m_coeffs[2], z);
440
441 Array<OneD, NekDouble> xderxi1(nq, 0.0), yderxi1(nq, 0.0),
442 zderxi1(nq, 0.0), xderxi2(nq, 0.0), yderxi2(nq, 0.0),
443 zderxi2(nq, 0.0), xderxi1xi1(nq, 0.0), yderxi1xi1(nq, 0.0),
444 zderxi1xi1(nq, 0.0), xderxi1xi2(nq, 0.0), yderxi1xi2(nq, 0.0),
445 zderxi1xi2(nq, 0.0), xderxi2xi1(nq, 0.0), yderxi2xi1(nq, 0.0),
446 zderxi2xi1(nq, 0.0), xderxi2xi2(nq, 0.0), yderxi2xi2(nq, 0.0),
447 zderxi2xi2(nq, 0.0);
448
449 // Get first & second derivatives & partial derivatives of x,y,z values
450 std::array<NekDouble, 3> xc_derxi, yc_derxi, zc_derxi;
451
452 m_xmap->PhysDeriv(x, xderxi1, xderxi2);
453 m_xmap->PhysDeriv(y, yderxi1, yderxi2);
454 m_xmap->PhysDeriv(z, zderxi1, zderxi2);
455
456 m_xmap->PhysDeriv(xderxi1, xderxi1xi1, xderxi1xi2);
457 m_xmap->PhysDeriv(yderxi1, yderxi1xi1, yderxi1xi2);
458 m_xmap->PhysDeriv(zderxi1, zderxi1xi1, zderxi1xi2);
459
460 m_xmap->PhysDeriv(yderxi2, yderxi2xi1, yderxi2xi2);
461 m_xmap->PhysDeriv(xderxi2, xderxi2xi1, xderxi2xi2);
462 m_xmap->PhysDeriv(zderxi2, zderxi2xi1, zderxi2xi2);
463
464 // Minimisation loop (Quasi-newton method)
465 NekDouble fx_prev = std::numeric_limits<NekDouble>::max();
466 for (int i = 0; i < NekConstants::kNewtonIterations; ++i)
467 {
468 // Compute the objective function, f(x_k) and its derivatives
469 NekDouble xc = m_xmap->PhysEvaluate(xi, x, xc_derxi);
470 NekDouble yc = m_xmap->PhysEvaluate(xi, y, yc_derxi);
471 NekDouble zc = m_xmap->PhysEvaluate(xi, z, zc_derxi);
472
473 NekDouble xc_derxi1xi1 = m_xmap->PhysEvaluate(xi, xderxi1xi1);
474 NekDouble yc_derxi1xi1 = m_xmap->PhysEvaluate(xi, yderxi1xi1);
475 NekDouble zc_derxi1xi1 = m_xmap->PhysEvaluate(xi, zderxi1xi1);
476
477 NekDouble xc_derxi1xi2 = m_xmap->PhysEvaluate(xi, xderxi1xi2);
478 NekDouble yc_derxi1xi2 = m_xmap->PhysEvaluate(xi, yderxi1xi2);
479 NekDouble zc_derxi1xi2 = m_xmap->PhysEvaluate(xi, zderxi1xi2);
480
481 NekDouble xc_derxi2xi2 = m_xmap->PhysEvaluate(xi, xderxi2xi2);
482 NekDouble yc_derxi2xi2 = m_xmap->PhysEvaluate(xi, yderxi2xi2);
483 NekDouble zc_derxi2xi2 = m_xmap->PhysEvaluate(xi, zderxi2xi2);
484
485 // Objective function is the distance to the search point
486 NekDouble xdiff = xc - xs[0];
487 NekDouble ydiff = yc - xs[1];
488 NekDouble zdiff = zc - xs[2];
489
490 NekDouble fx = xdiff * xdiff + ydiff * ydiff + zdiff * zdiff;
491
492 NekDouble fx_derxi1 = 2.0 * xdiff * xc_derxi[0] +
493 2.0 * ydiff * yc_derxi[0] +
494 2.0 * zdiff * zc_derxi[0];
495
496 NekDouble fx_derxi2 = 2.0 * xdiff * xc_derxi[1] +
497 2.0 * ydiff * yc_derxi[1] +
498 2.0 * zdiff * zc_derxi[1];
499
500 NekDouble fx_derxi1xi1 =
501 2.0 * xdiff * xc_derxi1xi1 + 2.0 * xc_derxi[0] * xc_derxi[0] +
502 2.0 * ydiff * yc_derxi1xi1 + 2.0 * yc_derxi[0] * yc_derxi[0] +
503 2.0 * zdiff * zc_derxi1xi1 + 2.0 * zc_derxi[0] * zc_derxi[0];
504
505 NekDouble fx_derxi1xi2 =
506 2.0 * xdiff * xc_derxi1xi2 + 2.0 * xc_derxi[1] * xc_derxi[0] +
507 2.0 * ydiff * yc_derxi1xi2 + 2.0 * yc_derxi[1] * yc_derxi[0] +
508 2.0 * zdiff * zc_derxi1xi2 + 2.0 * zc_derxi[1] * zc_derxi[0];
509
510 NekDouble fx_derxi2xi2 =
511 2.0 * xdiff * xc_derxi2xi2 + 2.0 * xc_derxi[1] * xc_derxi[1] +
512 2.0 * ydiff * yc_derxi2xi2 + 2.0 * yc_derxi[1] * yc_derxi[1] +
513 2.0 * zdiff * zc_derxi2xi2 + 2.0 * zc_derxi[1] * zc_derxi[1];
514
515 // Jacobian
516 NekDouble jac[2];
517 jac[0] = fx_derxi1;
518 jac[1] = fx_derxi2;
519
520 // Inverse of 2x2 hessian
521 NekDouble hessInv[2][2];
522
523 NekDouble det =
524 1 / (fx_derxi1xi1 * fx_derxi2xi2 - fx_derxi1xi2 * fx_derxi1xi2);
525 hessInv[0][0] = det * fx_derxi2xi2;
526 hessInv[0][1] = det * -fx_derxi1xi2;
527 hessInv[1][0] = det * -fx_derxi1xi2;
528 hessInv[1][1] = det * fx_derxi1xi1;
529
530 // Check for convergence
531 if (abs(fx - fx_prev) < 1e-12)
532 {
533 fx_prev = fx;
534 break;
535 }
536 else
537 {
538 fx_prev = fx;
539 }
540
541 NekDouble gamma = 1.0;
542 bool conv = false;
543
544 // Search direction: Newton's method
545 NekDouble pk[2];
546 pk[0] = -(hessInv[0][0] * jac[0] + hessInv[1][0] * jac[1]);
547 pk[1] = -(hessInv[0][1] * jac[0] + hessInv[1][1] * jac[1]);
548
549 // Backtracking line search
550 while (gamma > 1e-10)
551 {
552 Array<OneD, NekDouble> xi_pk(2);
553 xi_pk[0] = xi[0] + pk[0] * gamma;
554 xi_pk[1] = xi[1] + pk[1] * gamma;
555
556 Array<OneD, NekDouble> eta_pk(2, 0.0);
557 m_xmap->LocCoordToLocCollapsed(xi_pk, eta_pk);
558
559 if (eta_pk[0] <
560 (-1 - std::numeric_limits<NekDouble>::epsilon()) ||
561 eta_pk[0] >
562 (1 + std::numeric_limits<NekDouble>::epsilon()) ||
563 eta_pk[1] <
564 (-1 - std::numeric_limits<NekDouble>::epsilon()) ||
565 eta_pk[1] > (1 + std::numeric_limits<NekDouble>::epsilon()))
566 {
567 gamma /= 2.0;
568 continue;
569 }
570
571 std::array<NekDouble, 3> xc_pk_derxi, yc_pk_derxi, zc_pk_derxi;
572
573 NekDouble xc_pk = m_xmap->PhysEvaluate(xi_pk, x, xc_pk_derxi);
574 NekDouble yc_pk = m_xmap->PhysEvaluate(xi_pk, y, yc_pk_derxi);
575 NekDouble zc_pk = m_xmap->PhysEvaluate(xi_pk, z, zc_pk_derxi);
576
577 NekDouble xc_pk_diff = xc_pk - xs[0];
578 NekDouble yc_pk_diff = yc_pk - xs[1];
579 NekDouble zc_pk_diff = zc_pk - xs[2];
580
581 NekDouble fx_pk = xc_pk_diff * xc_pk_diff +
582 yc_pk_diff * yc_pk_diff +
583 zc_pk_diff * zc_pk_diff;
584
585 NekDouble fx_pk_derxi1 = 2.0 * xc_pk_diff * xc_pk_derxi[0] +
586 2.0 * yc_pk_diff * yc_pk_derxi[0] +
587 2.0 * zc_pk_diff * zc_pk_derxi[0];
588
589 NekDouble fx_pk_derxi2 = 2.0 * xc_pk_diff * xc_pk_derxi[1] +
590 2.0 * yc_pk_diff * yc_pk_derxi[1] +
591 2.0 * zc_pk_diff * zc_pk_derxi[1];
592
593 // Check Wolfe conditions using Armijo constants
594 // https://en.wikipedia.org/wiki/Wolfe_conditions
595 NekDouble tmp = pk[0] * fx_derxi1 + pk[1] * fx_derxi2;
596 NekDouble tmp2 = pk[0] * fx_pk_derxi1 + pk[1] * fx_pk_derxi2;
597 if ((fx_pk - (fx + c1 * gamma * tmp)) <
598 std::numeric_limits<NekDouble>::epsilon() &&
599 (-tmp2 - (-c2 * tmp)) <
600 std::numeric_limits<NekDouble>::epsilon())
601 {
602 conv = true;
603 break;
604 }
605
606 gamma /= 2.0;
607 }
608
609 if (!conv)
610 {
611 break;
612 }
613
614 xi[0] += gamma * pk[0];
615 xi[1] += gamma * pk[1];
616 }
617
618 xiOut = xi;
619 return sqrt(fx_prev);
620 }
621 else
622 {
623 ASSERTL0(false, "Geometry type unknown")
624 }
625
626 return -1.0;
627}
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.
Definition: Geometry.h:554
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...
Definition: Geometry.h:544
Array< OneD, Array< OneD, NekDouble > > m_coeffs
Array containing expansion coefficients of m_xmap.
Definition: Geometry.h:206
@ eRegular
Geometry is straight-sided with constant geometric factors.
@ eDeformed
Geometry is curved or has non-constant factors.
std::vector< double > z(NPUPPER)
scalarT< T > abs(scalarT< T > in)
Definition: scalar.hpp:289

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().

◆ v_GetEdge()

Geometry1DSharedPtr Nektar::SpatialDomains::Geometry2D::v_GetEdge ( int  i) const
overrideprotectedvirtual

Returns edge i of this object.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 386 of file Geometry2D.cpp.

387{
388 ASSERTL2(i >= 0 && i < m_edges.size(), "Index out of range");
389 return m_edges[i];
390}
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed to...
Definition: ErrorUtil.hpp:265

References ASSERTL2, and m_edges.

◆ v_GetEorient()

StdRegions::Orientation Nektar::SpatialDomains::Geometry2D::v_GetEorient ( const int  i) const
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 392 of file Geometry2D.cpp.

393{
394 ASSERTL2(i >= 0 && i < m_eorient.size(), "Index out of range");
395 return m_eorient[i];
396}
std::vector< StdRegions::Orientation > m_eorient
Definition: Geometry2D.h:81

References ASSERTL2, and m_eorient.

◆ v_GetLocCoords()

NekDouble Nektar::SpatialDomains::Geometry2D::v_GetLocCoords ( const Array< OneD, const NekDouble > &  coords,
Array< OneD, NekDouble > &  Lcoords 
)
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.

Parameters
coordsInput Cartesian global coordinates
LcoordsCorresponding local coordinates
Returns
Distance between obtained coordinates and provided ones.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 307 of file Geometry2D.cpp.

309{
310 NekDouble dist = std::numeric_limits<double>::max();
311 Array<OneD, NekDouble> tmpcoords(2);
312 tmpcoords[0] = coords[m_manifold[0]];
313 tmpcoords[1] = coords[m_manifold[1]];
314 if (GetMetricInfo()->GetGtype() == eRegular)
315 {
316 tmpcoords[0] -= m_isoParameter[0][0];
317 tmpcoords[1] -= m_isoParameter[1][0];
318 Lcoords[0] = m_invIsoParam[0][0] * tmpcoords[0] +
319 m_invIsoParam[0][1] * tmpcoords[1];
320 Lcoords[1] = m_invIsoParam[1][0] * tmpcoords[0] +
321 m_invIsoParam[1][1] * tmpcoords[1];
322 }
323 else if (m_straightEdge)
324 {
325 SolveStraightEdgeQuad(tmpcoords, Lcoords);
326 }
327 else if (GetMetricInfo()->GetGtype() == eDeformed)
328 {
329 v_FillGeom();
330 // Determine nearest point of coords to values in m_xmap
331 int npts = m_xmap->GetTotPoints();
332 Array<OneD, NekDouble> ptsx(npts), ptsy(npts);
333 Array<OneD, NekDouble> tmpx(npts), tmpy(npts);
334
335 // Determine 3D manifold orientation
336 m_xmap->BwdTrans(m_coeffs[m_manifold[0]], ptsx);
337 m_xmap->BwdTrans(m_coeffs[m_manifold[1]], ptsy);
338
339 Array<OneD, NekDouble> eta(2, 0.);
340 m_xmap->LocCoordToLocCollapsed(Lcoords, eta);
341 ClampLocCoords(eta, 0.);
342
343 m_xmap->LocCollapsedToLocCoord(eta, Lcoords);
344
345 // Perform newton iteration to find local coordinates
346 NewtonIterationForLocCoord(tmpcoords, ptsx, ptsy, Lcoords, dist);
347 }
348 if (m_coordim == 3)
349 {
350 Array<OneD, NekDouble> eta(2, 0.), xi(2, 0.);
351 m_xmap->LocCoordToLocCollapsed(Lcoords, eta);
352 ClampLocCoords(eta, 0.);
353 m_xmap->LocCollapsedToLocCoord(eta, xi);
354 int npts = m_xmap->GetTotPoints();
355 Array<OneD, NekDouble> ptsz(npts);
356 m_xmap->BwdTrans(m_coeffs[m_manifold[2]], ptsz);
357 NekDouble z = m_xmap->PhysEvaluate(xi, ptsz) - coords[m_manifold[2]];
358 if (GetMetricInfo()->GetGtype() == eDeformed)
359 {
360 dist = sqrt(z * z + dist * dist);
361 }
362 else
363 {
364 dist = fabs(z);
365 }
366 }
367 return dist;
368}
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)
Definition: Geometry2D.cpp:170
void SolveStraightEdgeQuad(const Array< OneD, const NekDouble > &coords, Array< OneD, NekDouble > &Lcoords)
Definition: Geometry2D.cpp:143
virtual void v_FillGeom()
Populate the coordinate mapping Geometry::m_coeffs information from any children geometry elements.
Definition: Geometry.cpp:355
GeomFactorsSharedPtr GetMetricInfo()
Get the geometric factors for this object.
Definition: Geometry.h:310

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().

◆ v_GetNumEdges()

int Nektar::SpatialDomains::Geometry2D::v_GetNumEdges ( ) const
overrideprotectedvirtual

Get the number of edges of this object.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 375 of file Geometry2D.cpp.

376{
377 return m_edges.size();
378}

References m_edges.

◆ v_GetNumVerts()

int Nektar::SpatialDomains::Geometry2D::v_GetNumVerts ( ) const
overrideprotectedvirtual

Get the number of vertices of this object.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 370 of file Geometry2D.cpp.

371{
372 return m_verts.size();
373}

References m_verts.

◆ v_GetShapeDim()

int Nektar::SpatialDomains::Geometry2D::v_GetShapeDim ( ) const
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 398 of file Geometry2D.cpp.

399{
400 return 2;
401}

◆ v_GetVertex()

PointGeomSharedPtr Nektar::SpatialDomains::Geometry2D::v_GetVertex ( int  i) const
overrideprotectedvirtual

Implements Nektar::SpatialDomains::Geometry.

Definition at line 380 of file Geometry2D.cpp.

381{
382 ASSERTL2(i >= 0 && i < m_verts.size(), "Index out of range");
383 return m_verts[i];
384}

References ASSERTL2, and m_verts.

Member Data Documentation

◆ kDim

const int Nektar::SpatialDomains::Geometry2D::kDim = 2
static

Definition at line 71 of file Geometry2D.h.

◆ m_curve

CurveSharedPtr Nektar::SpatialDomains::Geometry2D::m_curve
protected

◆ m_edgeNormal

Array<OneD, Array<OneD, NekDouble> > Nektar::SpatialDomains::Geometry2D::m_edgeNormal
protected

Definition at line 84 of file Geometry2D.h.

Referenced by v_AllLeftCheck().

◆ m_edges

SegGeomVector Nektar::SpatialDomains::Geometry2D::m_edges
protected

◆ m_eorient

std::vector<StdRegions::Orientation> Nektar::SpatialDomains::Geometry2D::m_eorient
protected

◆ m_manifold

Array<OneD, int> Nektar::SpatialDomains::Geometry2D::m_manifold
protected

◆ m_verts

PointGeomVector Nektar::SpatialDomains::Geometry2D::m_verts
protected