Nektar++
Loading...
Searching...
No Matches
Geometry.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////////////
2//
3// File: Geometry.h
4//
5// For more information, please see: http://www.nektar.info/
6//
7// The MIT License
8//
9// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10// Department of Aeronautics, Imperial College London (UK), and Scientific
11// Computing and Imaging Institute, University of Utah (USA).
12//
13// Permission is hereby granted, free of charge, to any person obtaining a
14// copy of this software and associated documentation files (the "Software"),
15// to deal in the Software without restriction, including without limitation
16// the rights to use, copy, modify, merge, publish, distribute, sublicense,
17// and/or sell copies of the Software, and to permit persons to whom the
18// Software is furnished to do so, subject to the following conditions:
19//
20// The above copyright notice and this permission notice shall be included
21// in all copies or substantial portions of the Software.
22//
23// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29// DEALINGS IN THE SOFTWARE.
30//
31// Description: This file contains the base class specification for the
32// Geometry class.
33//
34//
35////////////////////////////////////////////////////////////////////////////////
36
37#ifndef NEKTAR_SPATIALDOMAINS_GEOMETRY_H
38#define NEKTAR_SPATIALDOMAINS_GEOMETRY_H
39
44
45#include <array>
46#include <unordered_map>
47
48namespace Nektar
49{
50// Forward declarations for allocation pools that are defined within
51// MeshGraph.cpp compilation unit.
52template <>
53PoolAllocator<SpatialDomains::GeomFactors>
55} // namespace Nektar
56
58{
59
60class Geometry; // Forward declaration for typedef.
63
64class Geometry1D;
65class Geometry2D;
66
67class PointGeom;
68
69struct Curve;
71typedef std::map<int, CurveUniquePtr> CurveMap;
72// static CurveMap NullCurveMap;
73
74/// \brief Less than operator to sort Geometry objects by global id when sorting
75/// STL containers.
77 const Geometry *&rhs);
78
80 const Geometry *&rhs);
81
82/// Base class for shape geometry information
84{
85public:
88 SPATIAL_DOMAINS_EXPORT virtual ~Geometry() = default;
89
90 //---------------------------------------
91 // Helper functions
92 //---------------------------------------
93
94 SPATIAL_DOMAINS_EXPORT inline int GetCoordim() const;
95 SPATIAL_DOMAINS_EXPORT inline void SetCoordim(int coordim);
99
100 //---------------------------------------
101 // Set and get ID
102 //---------------------------------------
103 SPATIAL_DOMAINS_EXPORT inline int GetGlobalID(void) const;
104 SPATIAL_DOMAINS_EXPORT inline void SetGlobalID(int globalid);
105
106 //---------------------------------------
107 // Vertex, edge and face access
108 //---------------------------------------
109 SPATIAL_DOMAINS_EXPORT inline int GetVid(int i) const;
110 SPATIAL_DOMAINS_EXPORT int GetEid(int i) const;
111 SPATIAL_DOMAINS_EXPORT int GetFid(int i) const;
112 SPATIAL_DOMAINS_EXPORT inline int GetTid(int i) const;
113 SPATIAL_DOMAINS_EXPORT inline PointGeom *GetVertex(int i) const;
114 SPATIAL_DOMAINS_EXPORT inline Geometry1D *GetEdge(int i) const;
115 SPATIAL_DOMAINS_EXPORT inline Geometry2D *GetFace(int i) const;
117 const int i) const;
119 const int i) const;
120 SPATIAL_DOMAINS_EXPORT inline int GetNumVerts() const;
121 SPATIAL_DOMAINS_EXPORT inline int GetNumEdges() const;
122 SPATIAL_DOMAINS_EXPORT inline int GetNumFaces() const;
123 SPATIAL_DOMAINS_EXPORT inline int GetShapeDim() const;
124
125 //---------------------------------------
126 // \chi mapping access
127 //---------------------------------------
129 const;
131 const int i) const;
132 SPATIAL_DOMAINS_EXPORT inline void FillGeom();
133
134 //---------------------------------------
135 // Point lookups
136 //---------------------------------------
137 SPATIAL_DOMAINS_EXPORT std::array<NekDouble, 6> GetBoundingBox();
139
141 const Array<OneD, const NekDouble> &gloCoord, NekDouble tol = 0.0);
143 const Array<OneD, const NekDouble> &gloCoord,
144 Array<OneD, NekDouble> &locCoord, NekDouble tol);
146 const Array<OneD, const NekDouble> &gloCoord,
147 Array<OneD, NekDouble> &locCoord, NekDouble tol, NekDouble &dist);
149 const Array<OneD, const NekDouble> &coords,
150 Array<OneD, NekDouble> &Lcoords);
152 const int i, const Array<OneD, const NekDouble> &Lcoord);
154 const Array<OneD, const NekDouble> &gloCoord);
156 const Array<OneD, const NekDouble> &gloCoord);
158 Array<OneD, NekDouble> &locCoord,
159 NekDouble tol = std::numeric_limits<NekDouble>::epsilon());
162
163 //---------------------------------------
164 // Misc. helper functions
165 //---------------------------------------
166 SPATIAL_DOMAINS_EXPORT inline int GetVertexEdgeMap(int i, int j) const;
167 SPATIAL_DOMAINS_EXPORT inline int GetVertexFaceMap(int i, int j) const;
168 SPATIAL_DOMAINS_EXPORT inline int GetEdgeFaceMap(int i, int j) const;
170 int j) const;
171 SPATIAL_DOMAINS_EXPORT inline int GetDir(const int i,
172 const int j = 0) const;
174
175 SPATIAL_DOMAINS_EXPORT inline void Reset(CurveMap &curvedEdges,
176 CurveMap &curvedFaces);
177 SPATIAL_DOMAINS_EXPORT inline void ResetNonRecursive(CurveMap &curvedEdges,
178 CurveMap &curvedFaces);
179
180 SPATIAL_DOMAINS_EXPORT inline void Setup();
181
182protected:
183 /// Coordinate dimension of this geometry object.
185 /// \f$\chi\f$ mapping containing isoparametric transformation.
187 /// Enumeration to dictate whether coefficients are filled.
189 /// Wether or not the setup routines have been run
191 /// Type of shape.
193 /// Global ID
195 /// Array containing expansion coefficients of @p m_xmap
196 std::vector<Array<OneD, NekDouble>> m_coeffs;
197 /// Array containing bounding box
202
203 //---------------------------------------
204 // Helper functions
205 //---------------------------------------
206 virtual int v_GetVid(int i) const;
207 virtual PointGeom *v_GetVertex(const int i) const;
208 virtual Geometry1D *v_GetEdge(const int i) const;
209 virtual Geometry2D *v_GetFace(const int i) const;
210 virtual StdRegions::Orientation v_GetEorient(const int i) const;
211 virtual StdRegions::Orientation v_GetForient(const int i) const;
212 virtual int v_GetNumVerts() const;
213 virtual int v_GetNumEdges() const;
214 virtual int v_GetNumFaces() const;
215 virtual int v_GetShapeDim() const;
216
220 virtual void v_FillGeom();
221
222 virtual bool v_ContainsPoint(const Array<OneD, const NekDouble> &gloCoord,
223 Array<OneD, NekDouble> &locCoord,
224 NekDouble tol, NekDouble &dist);
225 virtual int v_AllLeftCheck(const Array<OneD, const NekDouble> &gloCoord);
226
227 virtual NekDouble v_GetCoord(const int i,
228 const Array<OneD, const NekDouble> &Lcoord);
230 Array<OneD, NekDouble> &Lcoords);
233
234 virtual int v_GetVertexEdgeMap(int i, int j) const;
235 virtual int v_GetVertexFaceMap(int i, int j) const;
236 virtual int v_GetEdgeFaceMap(int i, int j) const;
237 virtual int v_GetEdgeNormalToFaceVert(const int i, const int j) const;
238 virtual int v_GetDir(const int faceidx, const int facedir) const;
239
240 virtual GeomType v_CalcGeomType();
241 virtual void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces);
242
243 virtual void v_Setup();
244
245 inline void SetUpCoeffs(const int nCoeffs);
246 virtual void v_CalculateInverseIsoParam();
247}; // class Geometry
248
249/**
250 * @brief Unary function that constructs a hash of a Geometry object, based on
251 * the vertex IDs.
252 */
254{
255 std::size_t operator()(GeometryUniquePtr const &p) const
256 {
257 int i;
258 size_t seed = 0;
259 int nVert = p->GetNumVerts();
260 std::vector<unsigned int> ids(nVert);
261
262 for (i = 0; i < nVert; ++i)
263 {
264 ids[i] = p->GetVid(i);
265 }
266 std::sort(ids.begin(), ids.end());
267 hash_range(seed, ids.begin(), ids.end());
268
269 return seed;
270 }
271};
272
273/**
274 * @brief Return the coordinate dimension of this object (i.e. the dimension of
275 * the space in which this object is embedded).
276 */
277inline int Geometry::GetCoordim() const
278{
279 return m_coordim;
280}
281
282/**
283 * @brief Sets the coordinate dimension of this object (i.e. the dimension of
284 * the space in which this object is embedded).
285 */
286inline void Geometry::SetCoordim(int dim)
287{
288 m_coordim = dim;
289}
290
291/**
292 * @brief Get the geometric shape type of this object.
293 */
298
299/**
300 * A geometric shape is considered regular if it has constant geometric
301 * information, and deformed if this information changes throughout the
302 * shape.
303 * @returns The type of geometry.
304 * @see GeomType
305 */
307{
308 return v_CalcGeomType();
309}
310
311/**
312 * @brief Get the ID of this object.
313 */
314inline int Geometry::GetGlobalID(void) const
315{
316 return m_globalID;
317}
318
319/**
320 * @brief Set the ID of this object.
321 */
322inline void Geometry::SetGlobalID(int globalid)
323{
324 m_globalID = globalid;
325}
326
327/**
328 * @brief Get the ID of trace @p i of this object.
329 *
330 * The trace element is the facet one dimension lower than the object; for
331 * example, a quadrilateral has four trace segments forming its boundary.
332 */
333inline int Geometry::GetTid(int i) const
334{
335 const int nDim = GetShapeDim();
336 return nDim == 1 ? GetVid(i)
337 : nDim == 2 ? GetEid(i)
338 : nDim == 3 ? GetFid(i)
339 : 0;
340}
341
342/**
343 * @brief Returns global id of vertex @p i of this object.
344 */
345inline int Geometry::GetVid(int i) const
346{
347 return v_GetVid(i);
348}
349
350/**
351 * @brief Returns vertex @p i of this object.
352 */
353inline PointGeom *Geometry::GetVertex(int i) const
354{
355 return v_GetVertex(i);
356}
357
358/**
359 * @brief Returns edge @p i of this object.
360 */
361inline Geometry1D *Geometry::GetEdge(int i) const
362{
363 return v_GetEdge(i);
364}
365
366/**
367 * @brief Returns face @p i of this object.
368 */
369inline Geometry2D *Geometry::GetFace(int i) const
370{
371 return v_GetFace(i);
372}
373
374/**
375 * @brief Returns the orientation of edge @p i with respect to the ordering of
376 * edges in the standard element.
377 */
379{
380 return v_GetEorient(i);
381}
382
383/**
384 * @brief Returns the orientation of face @p i with respect to the ordering of
385 * faces in the standard element.
386 */
388{
389 return v_GetForient(i);
390}
391
392/**
393 * @brief Get the number of vertices of this object.
394 */
395inline int Geometry::GetNumVerts() const
396{
397 return v_GetNumVerts();
398}
399
400/**
401 * @brief Get the number of edges of this object.
402 */
403inline int Geometry::GetNumEdges() const
404{
405 return v_GetNumEdges();
406}
407
408/**
409 * @brief Get the number of faces of this object.
410 */
411inline int Geometry::GetNumFaces() const
412{
413 return v_GetNumFaces();
414}
415
416/**
417 * @brief Get the object's shape dimension.
418 *
419 * For example, a segment is one dimensional and quadrilateral is two
420 * dimensional.
421 */
422inline int Geometry::GetShapeDim() const
423{
424 return v_GetShapeDim();
425}
426
427/**
428 * @brief Used by Expansion to generate associated GeomFactors.
429 */
435
436/**
437 * @brief Return the mapping object Geometry::m_xmap that represents the
438 * coordinate transformation from standard element to physical element.
439 */
441{
442 return v_GetXmap();
443}
444
445/**
446 * @brief Return the coefficients of the transformation Geometry::m_xmap in
447 * coordinate direction @p i.
448 */
450 const int i) const
451{
452 return m_coeffs[i];
453}
454
455/**
456 * @brief Populate the coordinate mapping Geometry::m_coeffs information from
457 * any children geometry elements.
458 *
459 * @see v_FillGeom()
460 */
462{
463 v_FillGeom();
464}
465
466/**
467 * @brief Determine whether an element contains a particular Cartesian
468 * coordinate \f$(x,y,z)\f$.
469 *
470 * @see Geometry::ContainsPoint
471 */
473 const Array<OneD, const NekDouble> &gloCoord, NekDouble tol)
474{
475 Array<OneD, NekDouble> locCoord(GetCoordim(), 0.0);
476 NekDouble dist;
477 return v_ContainsPoint(gloCoord, locCoord, tol, dist);
478}
479
480/**
481 * @brief Determine whether an element contains a particular Cartesian
482 * coordinate \f$(x,y,z)\f$.
483 *
484 * @see Geometry::ContainsPoint
485 */
487 const Array<OneD, const NekDouble> &gloCoord,
488 Array<OneD, NekDouble> &locCoord, NekDouble tol)
489{
490 NekDouble dist;
491 return v_ContainsPoint(gloCoord, locCoord, tol, dist);
492}
493
494/**
495 * @brief Determine whether an element contains a particular Cartesian
496 * coordinate \f$\vec{x} = (x,y,z)\f$.
497 *
498 * For curvilinear and non-affine elements (i.e. where the Jacobian varies as a
499 * function of the standard element coordinates), this is a non-linear
500 * optimisation problem that requires the use of a Newton iteration. Note
501 * therefore that this can be an expensive operation.
502 *
503 * The parameter @p tol which is by default 0, can be used to expand the
504 * coordinate range of the standard element from \f$[-1,1]^d\f$ to
505 * \f$[-1-\epsilon,1+\epsilon\f$ to handle challenging edge cases. The function
506 * also returns the local coordinates corresponding to @p gloCoord that can be
507 * used to speed up subsequent searches.
508 *
509 * @param gloCoord The coordinate \f$ (x,y,z) \f$.
510 * @param locCoord On exit, this is the local coordinate \f$\vec{\xi}\f$ such
511 * that \f$\chi(\vec{\xi}) = \vec{x}\f$.
512 * @param tol The tolerance used to dictate the bounding box of the
513 * standard coordinates \f$\vec{\xi}\f$.
514 * @param dist On exit, returns the minimum distance between @p gloCoord
515 * and the quadrature points inside the element.
516 *
517 * @return `true` if the coordinate @p gloCoord is contained in the element;
518 * false otherwise.
519 *
520 * @see Geometry::GetLocCoords.
521 */
523 const Array<OneD, const NekDouble> &gloCoord,
524 Array<OneD, NekDouble> &locCoord, NekDouble tol, NekDouble &dist)
525{
526 return v_ContainsPoint(gloCoord, locCoord, tol, dist);
527}
528
529/**
530 * @brief Determine the local collapsed coordinates that correspond to a
531 * given Cartesian coordinate for this geometry object.
532 *
533 * For curvilinear and non-affine elements (i.e. where the Jacobian varies as a
534 * function of the standard element coordinates), this is a non-linear
535 * optimisation problem that requires the use of a Newton iteration. Note
536 * therefore that this can be an expensive operation.
537 *
538 * Note that, clearly, the provided Cartesian coordinate lie outside the
539 * element. The function therefore returns the minimum distance from some
540 * position in the element to . @p Lcoords will also be constrained to fit
541 * within the range \f$[-1,1]^d\f$ where \f$ d \f$ is the dimension of the
542 * element.
543 *
544 * @param coords Input Cartesian global coordinates
545 * @param Lcoords Corresponding local coordinates
546 *
547 * @return Distance between obtained coordinates and provided ones.
548 */
551{
552 return v_GetLocCoords(coords, Lcoords);
553}
554
555/**
556 * @brief Given local collapsed coordinate @p Lcoord, return the value of
557 * physical coordinate in direction @p i.
558 */
559inline NekDouble Geometry::GetCoord(const int i,
560 const Array<OneD, const NekDouble> &Lcoord)
561{
562 return v_GetCoord(i, Lcoord);
563}
564
570
571/**
572 * @brief Returns the standard element edge IDs that are connected to a given
573 * vertex.
574 *
575 * For example, on a prism, vertex 0 is connnected to edges 0, 3, and 4;
576 * `GetVertexEdgeMap(0,j)` would therefore return the values 0, 1 and 4
577 * respectively. We assume that @p j runs between 0 and 2 inclusive, which is
578 * true for every 3D element asides from the pyramid.
579 *
580 * This function is used in the construction of the low-energy preconditioner.
581 *
582 * @param i The vertex to query connectivity for.
583 * @param j The local edge index between 0 and 2 connected to this element.
584 *
585 * @todo Expand to work with pyramid elements.
586 * @see MultiRegions::PreconditionerLowEnergy
587 */
588inline int Geometry::GetVertexEdgeMap(int i, int j) const
589{
590 return v_GetVertexEdgeMap(i, j);
591}
592
593/**
594 * @brief Returns the standard element face IDs that are connected to a given
595 * vertex.
596 *
597 * For example, on a hexahedron, vertex 0 is connnected to faces 0, 1, and 4;
598 * `GetVertexFaceMap(0,j)` would therefore return the values 0, 1 and 4
599 * respectively. We assume that @p j runs between 0 and 2 inclusive, which is
600 * true for every 3D element asides from the pyramid.
601 *
602 * This is used in the construction of the low-energy preconditioner.
603 *
604 * @param i The vertex to query connectivity for.
605 * @param j The local face index between 0 and 2 connected to this element.
606 *
607 * @todo Expand to work with pyramid elements.
608 * @see MultiRegions::PreconditionerLowEnergy
609 */
610inline int Geometry::GetVertexFaceMap(int i, int j) const
611{
612 return v_GetVertexFaceMap(i, j);
613}
614
615/**
616 * @brief Returns the standard element edge IDs that are connected to a given
617 * face.
618 *
619 * For example, on a prism, edge 0 is connnected to faces 0 and 1;
620 * `GetEdgeFaceMap(0,j)` would therefore return the values 0 and 1
621 * respectively. We assume that @p j runs between 0 and 1 inclusive, since every
622 * face is connected to precisely two faces for all 3D elements.
623 *
624 * This function is used in the construction of the low-energy preconditioner.
625 *
626 * @param i The edge to query connectivity for.
627 * @param j The local face index between 0 and 1 connected to this element.
628 *
629 * @see MultiRegions::PreconditionerLowEnergy
630 */
631inline int Geometry::GetEdgeFaceMap(int i, int j) const
632{
633 return v_GetEdgeFaceMap(i, j);
634}
635
636/**
637 * @brief Returns the standard lement edge IDs that are normal to a given face
638 * vertex.
639 *
640 * For example, on a hexahedron, on face 0 at vertices 0,1,2,3 the
641 * edges normal to that face are 4,5,6,7, ; so
642 * `GetEdgeNormalToFaceVert(0,j)` would therefore return the values 4,
643 * 5, 6 and 7 respectively. We assume that @p j runs between 0 and 3
644 * inclusive on a quadrilateral face and between 0 and 2 inclusive on
645 * a triangular face.
646 *
647 * This is used to help set up a length scale normal to an face
648 *
649 * @param i The face to query for the normal edge
650 * @param j The local vertex index between 0 and nverts on this face
651 *
652 */
653inline int Geometry::GetEdgeNormalToFaceVert(int i, int j) const
654{
655 return v_GetEdgeNormalToFaceVert(i, j);
656}
657
658/**
659 * @brief Returns the element coordinate direction corresponding to a given face
660 * coordinate direction
661 */
662inline int Geometry::GetDir(const int faceidx, const int facedir) const
663{
664 return v_GetDir(faceidx, facedir);
665}
666
667/**
668 * @brief Reset this geometry object: unset the current state, zero
669 * Geometry::m_coeffs and remove allocated GeomFactors.
670 */
671inline void Geometry::Reset(CurveMap &curvedEdges, CurveMap &curvedFaces)
672{
673 v_Reset(curvedEdges, curvedFaces);
674}
675
676/**
677 * @brief Reset this geometry object non-recursively: unset the current state,
678 * zero Geometry::m_coeffs and remove allocated GeomFactors.
679 */
680inline void Geometry::ResetNonRecursive(CurveMap &curvedEdges,
681 CurveMap &curvedFaces)
682{
683 Geometry::v_Reset(curvedEdges, curvedFaces);
684}
685
686inline void Geometry::Setup()
687{
688 v_Setup();
689}
690
691/**
692 * @brief Initialise the Geometry::m_coeffs array.
693 */
694inline void Geometry::SetUpCoeffs(const int nCoeffs)
695{
696 m_coeffs = std::vector<Array<OneD, NekDouble>>(m_coordim);
697
698 for (int i = 0; i < m_coordim; ++i)
699 {
700 m_coeffs[i] = Array<OneD, NekDouble>(nCoeffs, 0.0);
701 }
702}
703
704} // namespace Nektar::SpatialDomains
705
706#endif // NEKTAR_SPATIALDOMAINS_GEOMETRY_H
#define SPATIAL_DOMAINS_EXPORT
Generic object pool allocator/deallocator.
1D geometry information
Definition Geometry1D.h:49
2D geometry information
Definition Geometry2D.h:50
Base class for shape geometry information.
Definition Geometry.h:84
virtual int v_GetNumEdges() const
Get the number of edges of this object.
Definition Geometry.cpp:161
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.
Definition Geometry.cpp:150
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:559
LibUtilities::ShapeType GetShapeType(void)
Get the geometric shape type of this object.
Definition Geometry.h:294
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.
Definition Geometry.cpp:333
Array< OneD, NekDouble > m_boundingBox
Array containing bounding box.
Definition Geometry.h:198
bool m_setupState
Wether or not the setup routines have been run.
Definition Geometry.h:190
GeomState m_state
Enumeration to dictate whether coefficients are filled.
Definition Geometry.h:188
virtual void v_CalculateInverseIsoParam()
Definition Geometry.cpp:211
void SetUpCoeffs(const int nCoeffs)
Initialise the Geometry::m_coeffs array.
Definition Geometry.h:694
virtual int v_AllLeftCheck(const Array< OneD, const NekDouble > &gloCoord)
Definition Geometry.cpp:205
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:549
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 element...
Definition Geometry.cpp:477
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.
Definition Geometry.cpp:311
void SetGlobalID(int globalid)
Set the ID of this object.
Definition Geometry.h:322
int GetNumFaces() const
Get the number of faces of this object.
Definition Geometry.h:411
int GetShapeDim() const
Get the object's shape dimension.
Definition Geometry.h:422
virtual void v_FillGeom()
Populate the coordinate mapping Geometry::m_coeffs information from any children geometry elements.
Definition Geometry.cpp:357
Geometry()
Default constructor.
Definition Geometry.cpp:47
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...
Definition Geometry.cpp:345
int GetVid(int i) const
Returns global id of vertex i of this object.
Definition Geometry.h:345
virtual int v_GetNumFaces() const
Get the number of faces of this object.
Definition Geometry.cpp:169
virtual StdRegions::StdExpansionSharedPtr v_GetXmap() const
Return the mapping object Geometry::m_xmap that represents the coordinate transformation from standar...
Definition Geometry.cpp:220
Array< OneD, Array< OneD, NekDouble > > m_isoParameter
Definition Geometry.h:199
Array< OneD, Array< OneD, NekDouble > > m_invIsoParam
Definition Geometry.h:200
virtual void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces)
Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated Geo...
Definition Geometry.cpp:366
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:525
const Array< OneD, const NekDouble > & GetCoeffs(const int i) const
Return the coefficients of the transformation Geometry::m_xmap in coordinate direction i.
Definition Geometry.h:449
int GetGlobalID(void) const
Get the ID of this object.
Definition Geometry.h:314
PointGeom * GetVertex(int i) const
Returns vertex i of this object.
Definition Geometry.h:353
int GetCoordim() const
Return the coordinate dimension of this object (i.e. the dimension of the space in which this object ...
Definition Geometry.h:277
int GetFid(int i) const
Get the ID of face i of this object.
Definition Geometry.cpp:91
std::vector< Array< OneD, NekDouble > > m_coeffs
Array containing expansion coefficients of m_xmap.
Definition Geometry.h:196
virtual int v_GetEdgeFaceMap(int i, int j) const
Returns the standard element edge IDs that are connected to a given face.
Definition Geometry.cpp:300
LibUtilities::ShapeType m_shapeType
Type of shape.
Definition Geometry.h:192
int GetDir(const int i, const int j=0) const
Returns the element coordinate direction corresponding to a given face coordinate direction.
Definition Geometry.h:662
void FillGeom()
Populate the coordinate mapping Geometry::m_coeffs information from any children geometry elements.
Definition Geometry.h:461
int GetVertexEdgeMap(int i, int j) const
Returns the standard element edge IDs that are connected to a given vertex.
Definition Geometry.h:588
void ResetNonRecursive(CurveMap &curvedEdges, CurveMap &curvedFaces)
Reset this geometry object non-recursively: unset the current state, zero Geometry::m_coeffs and remo...
Definition Geometry.h:680
StdRegions::StdExpansionSharedPtr m_xmap
mapping containing isoparametric transformation.
Definition Geometry.h:186
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.
Definition Geometry.cpp:139
StdRegions::StdExpansionSharedPtr GetXmap() const
Return the mapping object Geometry::m_xmap that represents the coordinate transformation from standar...
Definition Geometry.h:440
NekDouble FindDistance(const Array< OneD, const NekDouble > &xs, Array< OneD, NekDouble > &xi)
Definition Geometry.h:565
virtual PointGeom * v_GetVertex(const int i) const
Returns vertex i of this object.
Definition Geometry.cpp:99
int GetNumEdges() const
Get the number of edges of this object.
Definition Geometry.h:403
std::array< NekDouble, 6 > GetBoundingBox()
Generates the bounding box for the element.
Definition Geometry.cpp:388
int GetNumVerts() const
Get the number of vertices of this object.
Definition Geometry.h:395
int GetVertexFaceMap(int i, int j) const
Returns the standard element face IDs that are connected to a given vertex.
Definition Geometry.h:610
bool ContainsPoint(const Array< OneD, const NekDouble > &gloCoord, NekDouble tol=0.0)
Determine whether an element contains a particular Cartesian coordinate .
Definition Geometry.h:472
Geometry1D * GetEdge(int i) const
Returns edge i of this object.
Definition Geometry.h:361
Geometry2D * GetFace(int i) const
Returns face i of this object.
Definition Geometry.h:369
int GetEdgeFaceMap(int i, int j) const
Returns the standard element edge IDs that are connected to a given face.
Definition Geometry.h:631
bool MinMaxCheck(const Array< OneD, const NekDouble > &gloCoord)
Check if given global coord is within the BoundingBox of the element.
Definition Geometry.cpp:502
virtual GeomType v_CalcGeomType()
Definition Geometry.cpp:187
virtual int v_GetVertexEdgeMap(int i, int j) const
Returns the standard element edge IDs that are connected to a given vertex.
Definition Geometry.cpp:278
virtual Geometry1D * v_GetEdge(const int i) const
Returns edge i of this object.
Definition Geometry.cpp:109
int GetEdgeNormalToFaceVert(int i, int j) const
Returns the standard lement edge IDs that are normal to a given face vertex.
Definition Geometry.h:653
virtual NekDouble v_FindDistance(const Array< OneD, const NekDouble > &xs, Array< OneD, NekDouble > &xi)
Definition Geometry.cpp:266
StdRegions::Orientation GetEorient(const int i) const
Returns the orientation of edge i with respect to the ordering of edges in the standard element.
Definition Geometry.h:378
virtual int v_GetNumVerts() const
Get the number of vertices of this object.
Definition Geometry.cpp:129
int m_coordim
Coordinate dimension of this geometry object.
Definition Geometry.h:184
int GetTid(int i) const
Get the ID of trace i of this object.
Definition Geometry.h:333
virtual int v_GetDir(const int faceidx, const int facedir) const
Returns the element coordinate direction corresponding to a given face coordinate direction.
Definition Geometry.cpp:322
virtual Geometry2D * v_GetFace(const int i) const
Returns face i of this object.
Definition Geometry.cpp:119
virtual int v_GetVid(int i) const
Get the ID of vertex i of this object.
Definition Geometry.cpp:75
void SetCoordim(int coordim)
Sets the coordinate dimension of this object (i.e. the dimension of the space in which this object is...
Definition Geometry.h:286
virtual int v_GetShapeDim() const
Get the object's shape dimension.
Definition Geometry.cpp:177
void Reset(CurveMap &curvedEdges, CurveMap &curvedFaces)
Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated Geo...
Definition Geometry.h:671
virtual int v_GetVertexFaceMap(int i, int j) const
Returns the standard element face IDs that are connected to a given vertex.
Definition Geometry.cpp:289
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 .
Definition Geometry.cpp:231
int GetEid(int i) const
Get the ID of edge i of this object.
Definition Geometry.cpp:83
StdRegions::Orientation GetForient(const int i) const
Returns the orientation of face i with respect to the ordering of faces in the standard element.
Definition Geometry.h:387
virtual GeomFactorsUniquePtr v_GenGeomFactors(LibUtilities::PointsKeyVector &keyTgt)
Used by Expansion to generate associated GeomFactors.
Definition Geometry.cpp:197
GeomFactorsUniquePtr GenGeomFactors(LibUtilities::PointsKeyVector &keyTgt)
Used by Expansion to generate associated GeomFactors.
Definition Geometry.h:430
std::vector< PointsKey > PointsKeyVector
Definition Points.h:313
bool GlobalIdEquality(const Geometry *&lhs, const Geometry *&rhs)
Definition Geometry.cpp:67
unique_ptr_objpool< Curve > CurveUniquePtr
Definition Geometry.h:70
bool SortByGlobalId(const Geometry *&lhs, const Geometry *&rhs)
Less than operator to sort Geometry objects by global id when sorting STL containers.
Definition Geometry.cpp:62
unique_ptr_objpool< GeomFactors > GeomFactorsUniquePtr
Definition Geometry.h:62
std::map< int, CurveUniquePtr > CurveMap
Definition Geometry.h:71
unique_ptr_objpool< Geometry > GeometryUniquePtr
Definition Geometry.h:61
GeomType
Indicates the type of element geometry.
GeomState
Indicates if the geometric information for an element has been populated.
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
std::size_t hash_range(Iter first, Iter last)
Definition HashUtils.hpp:64
std::unique_ptr< T, typename ObjPoolManager< T >::UniquePtrDeleter > unique_ptr_objpool
Unary function that constructs a hash of a Geometry object, based on the vertex IDs.
Definition Geometry.h:254
std::size_t operator()(GeometryUniquePtr const &p) const
Definition Geometry.h:255