49PoolAllocator<SpatialDomains::PointGeom>
102 int npts =
m_curve->m_points.size();
130 returnval->m_coordim = 1;
134 vert0->SetGlobalID(vert0->GetGlobalID());
135 returnval->m_verts[0] = vert0.get();
136 holder.
m_pointVec.push_back(std::move(vert0));
142 v.push_back(base[0]->GetPointsKey());
157 for (
int i = 0; i < jac.size(); ++i)
159 len += jac[i] * w0[i];
165 vert1->SetGlobalID(vert1->GetGlobalID());
167 returnval->m_verts[1] = vert1.get();
168 holder.
m_pointVec.push_back(std::move(vert1));
171 returnval->m_xmap =
m_xmap;
172 returnval->SetUpCoeffs(
m_xmap->GetNcoeffs());
191 return m_xmap->PhysEvaluate(Lcoord, tmp);
224 std::ostringstream errstrm;
225 errstrm <<
"Connected edges do not share a vertex. Edges ";
245 if (
m_xmap->GetBasisNumModes(0) != 2)
264 int npts =
m_curve->m_points.size();
273 "Vertex 0 is separated from first point by more than ";
274 std::stringstream strstrm;
277 err += strstrm.str();
285 "Vertex 1 is separated from last point by more than ";
286 std::stringstream strstrm;
289 err += strstrm.str();
301 for (
int j = 0; j < npts; ++j)
303 tmp[j] = (
m_curve->m_points[j]->GetPtr())[i];
327 CurveMap::iterator it = curvedEdges.find(
m_globalID);
329 if (it != curvedEdges.end())
380 tmp += (xs[i] - gloCoord[i]) * (xs[i] - gloCoord[i]);
396 int nq =
m_xmap->GetTotPoints();
400 for (
int i = 0; i < dim; ++i)
409 NekDouble fx_prev = std::numeric_limits<NekDouble>::max();
418 NekDouble fx = 0, fxp = 0, fxp2 = 0, xcDiff = 0;
419 for (
int j = 0; j < dim; ++j)
421 xc[j] =
m_xmap->PhysEvaluate(xi, x[j], xc_der[j], xc_der2[j]);
423 xcDiff = xc[j] - xs[j];
425 fx += xcDiff * xcDiff;
426 fxp += xc_der[j][0] * xcDiff;
427 fxp2 += xc_der2[j][0] * xcDiff + xc_der[j][0] * xc_der[j][0];
434 if (std::abs(fx - fx_prev) < 1e-12)
451 while (gamma > 1e-10)
454 xi_pk[0] = xi[0] + pk * gamma;
456 if (xi_pk[0] < -1.0 || xi_pk[0] > 1.0)
464 NekDouble fx_pk = 0, fxp_pk = 0, xc_pkDiff = 0;
465 for (
int j = 0; j < dim; ++j)
467 xc_pk[j] =
m_xmap->PhysEvaluate(xi_pk, x[j], xc_der_pk[j]);
469 xc_pkDiff = xc_pk[j] - xs[j];
470 fx_pk += xc_pkDiff * xc_pkDiff;
471 fxp_pk += xc_der_pk[j][0] * xc_pkDiff;
478 if ((fx_pk - (fx + c1 * gamma * pk * fxp)) <
479 std::numeric_limits<NekDouble>::epsilon() &&
480 (-pk * fxp_pk + c2 * pk * fxp) <
481 std::numeric_limits<NekDouble>::epsilon())
499 return sqrt(fx_prev);
503 ASSERTL0(
false,
"Geometry type unknown")
#define ASSERTL0(condition, msg)
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Describes the specification for a Basis.
Defines a specification for a set of points.
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
Array< OneD, DataType > & GetPtr()
Generic object pool allocator/deallocator.
static std::unique_ptr< DataType, UniquePtrDeleter > AllocateUniquePtr(const Args &...args)
std::vector< PointGeomUniquePtr > m_pointVec
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.
bool m_setupState
Wether or not the setup routines have been run.
GeomState m_state
Enumeration to dictate whether coefficients are filled.
void SetUpCoeffs(const int nCoeffs)
Initialise the Geometry::m_coeffs array.
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...
virtual void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces)
Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated Geo...
bool ClampLocCoords(Array< OneD, NekDouble > &locCoord, NekDouble tol=std::numeric_limits< NekDouble >::epsilon())
Clamp local coords to be within standard regions [-1, 1]^dim.
int GetGlobalID(void) const
Get the ID of this object.
PointGeom * GetVertex(int i) const
Returns vertex i of this object.
int GetCoordim() const
Return the coordinate dimension of this object (i.e. the dimension of the space in which this object ...
LibUtilities::ShapeType m_shapeType
Type of shape.
Array< OneD, Array< OneD, NekDouble > > m_coeffs
Array containing expansion coefficients of m_xmap.
GeomState m_geomFactorsState
State of the geometric factors.
StdRegions::StdExpansionSharedPtr m_xmap
mapping containing isoparametric transformation.
GeomFactorsSharedPtr m_geomFactors
Geometric factors.
int m_coordim
Coordinate dimension of this geometry object.
PointGeom * v_GetVertex(const int i) const override
Returns vertex i of this object.
std::array< SpatialDomains::PointGeom *, kNverts > m_verts
int v_GetNumVerts() const override
Get the number of vertices of this object.
virtual LibUtilities::ShapeType v_GetShapeType() const
void v_FillGeom() override
Populate the coordinate mapping Geometry::m_coeffs information from any children geometry elements.
CurveSharedPtr m_curve
Boolean indicating whether object owns the data.
void v_GenGeomFactors() override
static StdRegions::Orientation GetEdgeOrientation(const SegGeom &edge1, const SegGeom &edge2)
Get the orientation of edge1.
NekDouble v_FindDistance(const Array< OneD, const NekDouble > &xs, Array< OneD, NekDouble > &xi) override
NekDouble v_GetCoord(const int i, const Array< OneD, const NekDouble > &Lcoord) override
Given local collapsed coordinate Lcoord, return the value of physical coordinate in direction i.
SegGeomUniquePtr GenerateOneSpaceDimGeom(EntityHolder1D &holder)
Generate a one dimensional space segment geometry where the vert[0] has the same x value and vert[1] ...
void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces) override
Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated Geo...
A simple factory for Xmap objects that is based on the element type, the basis and quadrature selecti...
PointsManagerT & PointsManager(void)
std::vector< PointsKey > PointsKeyVector
@ eGaussLobattoLegendre
1D Gauss-Lobatto-Legendre quadrature points
@ eModified_A
Principle Modified Functions .
static const NekDouble kVertexTheSameDouble
static const unsigned int kNewtonIterations
XmapFactory< StdRegions::StdSegExp, 1 > & GetStdSegFactory()
std::shared_ptr< Curve > CurveSharedPtr
std::unordered_map< int, CurveSharedPtr > CurveMap
GeomType
Indicates the type of element geometry.
@ eRegular
Geometry is straight-sided with constant geometric factors.
@ eDeformed
Geometry is curved or has non-constant factors.
@ eNotFilled
Geometric information has not been generated.
@ ePtsFilled
Geometric information has been generated.
unique_ptr_objpool< SegGeom > SegGeomUniquePtr
unique_ptr_objpool< PointGeom > PointGeomUniquePtr
boost::fast_pool_allocator< DataType, boost::default_user_allocator_new_delete, boost::details::pool::null_mutex > PoolAllocator
std::shared_ptr< DNekMat > DNekMatSharedPtr
scalarT< T > sqrt(scalarT< T > in)