85 int npts =
m_curve->m_points.size();
113 returnval->m_coordim = 1;
117 vert0->SetGlobalID(vert0->GetGlobalID());
118 returnval->m_verts[0] = vert0;
124 v.push_back(base[0]->GetPointsKey());
139 for (
int i = 0; i < jac.size(); ++i)
141 len += jac[i] * w0[i];
147 vert1->SetGlobalID(vert1->GetGlobalID());
149 returnval->m_verts[1] = vert1;
152 returnval->m_xmap =
m_xmap;
153 returnval->SetUpCoeffs(
m_xmap->GetNcoeffs());
176 return m_xmap->PhysEvaluate(Lcoord, tmp);
209 std::ostringstream errstrm;
210 errstrm <<
"Connected edges do not share a vertex. Edges ";
230 if (
m_xmap->GetBasisNumModes(0) != 2)
249 int npts =
m_curve->m_points.size();
258 "Vertex 0 is separated from first point by more than ";
259 std::stringstream strstrm;
262 err += strstrm.str();
270 "Vertex 1 is separated from last point by more than ";
271 std::stringstream strstrm;
274 err += strstrm.str();
286 for (
int j = 0; j < npts; ++j)
288 tmp[j] = (
m_curve->m_points[j]->GetPtr())[i];
312 CurveMap::iterator it = curvedEdges.find(
m_globalID);
314 if (it != curvedEdges.end())
365 tmp += (xs[i] - gloCoord[i]) * (xs[i] - gloCoord[i]);
381 int nq =
m_xmap->GetTotPoints();
385 for (
int i = 0; i < dim; ++i)
394 NekDouble fx_prev = std::numeric_limits<NekDouble>::max();
403 NekDouble fx = 0, fxp = 0, fxp2 = 0, xcDiff = 0;
404 for (
int j = 0; j < dim; ++j)
406 xc[j] =
m_xmap->PhysEvaluate(xi, x[j], xc_der[j], xc_der2[j]);
408 xcDiff = xc[j] - xs[j];
410 fx += xcDiff * xcDiff;
411 fxp += xc_der[j][0] * xcDiff;
412 fxp2 += xc_der2[j][0] * xcDiff + xc_der[j][0] * xc_der[j][0];
436 while (gamma > 1e-10)
439 xi_pk[0] = xi[0] + pk * gamma;
441 if (xi_pk[0] < -1.0 || xi_pk[0] > 1.0)
449 NekDouble fx_pk = 0, fxp_pk = 0, xc_pkDiff = 0;
450 for (
int j = 0; j < dim; ++j)
452 xc_pk[j] =
m_xmap->PhysEvaluate(xi_pk, x[j], xc_der_pk[j]);
454 xc_pkDiff = xc_pk[j] - xs[j];
455 fx_pk += xc_pkDiff * xc_pkDiff;
456 fxp_pk += xc_der_pk[j][0] * xc_pkDiff;
463 if ((fx_pk - (fx + c1 * gamma * pk * fxp)) <
464 std::numeric_limits<NekDouble>::epsilon() &&
465 (-pk * fxp_pk + c2 * pk * fxp) <
466 std::numeric_limits<NekDouble>::epsilon())
484 return sqrt(fx_prev);
488 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()
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.
PointGeomSharedPtr GetVertex(int i) const
Returns vertex i of this object.
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.
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.
PointGeomSharedPtr v_GetVertex(const int i) const override
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.
SegGeomSharedPtr GenerateOneSpaceDimGeom(void)
Generate a one dimensional space segment geometry where the vert[0] has the same x value and vert[1] ...
CurveSharedPtr m_curve
Boolean indicating whether object owns the data.
void v_GenGeomFactors() override
SpatialDomains::PointGeomSharedPtr m_verts[kNverts]
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.
void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces) override
Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated Geo...
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
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.
std::shared_ptr< SegGeom > SegGeomSharedPtr
std::shared_ptr< PointGeom > PointGeomSharedPtr
@ eNotFilled
Geometric information has not been generated.
@ ePtsFilled
Geometric information has been generated.
std::shared_ptr< DNekMat > DNekMatSharedPtr
scalarT< T > abs(scalarT< T > in)
scalarT< T > sqrt(scalarT< T > in)