48 namespace SpatialDomains
86 "Cannot call function with dim == 1");
100 Geometry2D(edges[0]->GetVertex(0)->GetCoordim()),
130 m_coordim = edges[0]->GetVertex(0)->GetCoordim();
132 "Cannot call function with dim == 1");
145 Geometry2D(edges[0]->GetVertex(0)->GetCoordim()),
173 m_coordim = edges[0]->GetVertex(0)->GetCoordim();
175 "Cannot call function with dim == 1");
194 std::list<CompToElmt>::const_iterator def;
203 for (
int i = 0; i <
kNedges; i++)
249 "Geometry is not in physical space");
254 return m_xmap->PhysEvaluate(Lcoord, tmp);
272 int i, j, vmap[4] = {-1,-1,-1,-1};
273 NekDouble x, y, z, x1, y1, z1, cx = 0.0, cy = 0.0, cz = 0.0;
279 for (i = 0; i < 4; ++i)
281 cx += (*face2[i])(0) - (*face1[i])(0);
282 cy += (*face2[i])(1) - (*face1[i])(1);
283 cz += (*face2[i])(2) - (*face1[i])(2);
292 for (i = 0; i < 4; ++i)
297 for (j = 0; j < 4; ++j)
299 x1 = (*face2[j])(0)-cx;
300 y1 = (*face2[j])(1)-cy;
301 z1 = (*face2[j])(2)-cz;
302 if (sqrt((x1-x)*(x1-x)+(y1-y)*(y1-y)+(z1-z)*(z1-z)) < 1e-8)
312 if (vmap[1] == (vmap[0]+1) % 4)
349 ASSERTL0(
false,
"unable to determine face orientation");
378 std::list<CompToElmt>::const_iterator def;
416 return m_xmap->GetBasis(i);
425 ASSERTL1(i <= 3,
"edge is out of range");
427 if (i == 0 || i == 2)
429 return m_xmap->GetBasis(0);
433 return m_xmap->GetBasis(1);
467 if((
m_xmap->GetBasisNumModes(0) != 2)||
468 (
m_xmap->GetBasisNumModes(1) != 2))
542 int nEdgePts = (int)sqrt(static_cast<NekDouble>(npts));
551 ASSERTL0(nEdgePts * nEdgePts == npts,
552 "NUMPOINTS should be a square number in"
560 "Number of edge points does not correspond to "
561 "number of face points in quadrilateral "
567 for (j = 0; j <
npts; ++j)
569 tmp[j] = (
m_curve->m_points[j]->GetPtr())[i];
574 curveKey, curveKey, tmp,
575 m_xmap->GetBasis(0)->GetPointsKey(),
576 m_xmap->GetBasis(1)->GetPointsKey(),
594 nEdgeCoeffs =
m_edges[i]->GetXmap()->GetNcoeffs();
598 for(k = 0; k < nEdgeCoeffs; k++)
601 = signArray[k]*(
m_edges[i]->GetCoeffs(j))[k];
631 orth1.
Mult(norm,dv1);
632 orth2.
Mult(norm,dv2);
639 Lcoords[0] = xin.
dot(orth2)/dv1.
dot(orth2);
640 Lcoords[0] = 2*Lcoords[0]-1;
641 Lcoords[1] = xin.
dot(orth1)/dv2.
dot(orth1);
642 Lcoords[1] = 2*Lcoords[1]-1;
667 Lcoords[0] = za[min_i%za.num_elements()];
668 Lcoords[1] = zb[min_i/za.num_elements()];
682 ASSERTL2((i >=0) && (i <= 3),
"Edge id must be between 0 and 3");
692 ASSERTL2((i >=0) && (i <= 3),
"Verted id must be between 0 and 3");
702 ASSERTL2((i >=0) && (i <= 3),
"Vertex id must be between 0 and 3");
712 ASSERTL2((i >=0) && (i <= 3),
"Edge id must be between 0 and 3");
722 ASSERTL2((i >=0) && (i <= 3),
"Edge id must be between 0 and 3");
732 ASSERTL2((i >=0) && (i <= 3),
"Edge id must be between 0 and 3");
761 for (i=0,edgeIter =
m_edges.begin(); edgeIter !=
m_edges.end(); ++edgeIter,++i)
763 if (*edgeIter == edge)
815 ASSERTL1(gloCoord.num_elements() >= 2,
816 "Two dimensional geometry expects at least two coordinates.");
819 if (stdCoord[0] >= -(1+tol) && stdCoord[1] >= -(1+tol)
820 && stdCoord[0] <= (1+tol) && stdCoord[1] <= (1+tol))
833 if (it != curvedFaces.end())
838 for (
int i = 0; i < 4; ++i)
840 m_edges[i]->Reset(curvedEdges, curvedFaces);
StdRegions::StdExpansionSharedPtr m_xmap
virtual const Geometry1DSharedPtr v_GetEdge(int i) const
#define ASSERTL0(condition, msg)
virtual int v_GetCoordim() const
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
virtual bool v_ContainsPoint(const Array< OneD, const NekDouble > &gloCoord, NekDouble tol=0.0)
std::vector< PointGeomSharedPtr > PointGeomVector
GeomFactorsSharedPtr m_geomFactors
virtual void v_SetOwnData()
Structure holding graphvertexobject id and local element facet id.
NekDouble dot(PointGeom &a)
int Imin(int n, const T *x, const int incx)
Return the index of the minimum element in x.
virtual int v_NumElmtConnected() const
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
virtual PointGeomSharedPtr v_GetVertex(int i) const
Principle Modified Functions .
void Sub(PointGeom &a, PointGeom &b)
virtual void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces)
Reset this geometry object: unset the current state and remove allocated GeomFactors.
StdRegions::StdExpansionSharedPtr GetXmap() const
GeomState m_geomFactorsState
boost::shared_ptr< Curve > CurveSharedPtr
virtual bool v_IsElmtConnected(int gvo_id, int locid) const
virtual int v_GetVid(int i) const
const LibUtilities::BasisSharedPtr GetBasis(const int i)
Return the j-th basis of the i-th co-ordinate dimension.
virtual int v_GetNumEdges() const
std::list< CompToElmt > m_elmtMap
void Interp2D(const BasisKey &fbasis0, const BasisKey &fbasis1, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, Array< OneD, NekDouble > &to)
this function interpolates a 2D function evaluated at the quadrature points of the 2D basis...
NekDouble GetCoord(const int i, const Array< OneD, const NekDouble > &Lcoord)
static StdRegions::Orientation GetFaceOrientation(const QuadGeom &face1, const QuadGeom &face2)
Get the orientation of face1.
static const NekDouble kNekZeroTol
virtual NekDouble v_GetCoord(const int i, const Array< OneD, const NekDouble > &Lcoord)
virtual void v_AddElmtConnected(int gvo_id, int locid)
boost::shared_ptr< SegGeom > SegGeomSharedPtr
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 &resid)
virtual void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces)
Reset this geometry object: unset the current state and remove allocated GeomFactors.
virtual StdRegions::Orientation v_GetCartesianEorient(const int i) const
virtual const LibUtilities::BasisSharedPtr v_GetEdgeBasis(const int i)
virtual int v_GetNumVerts() const
virtual int v_GetFid() const
Defines a specification for a set of points.
void Sadd(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Add vector y = alpha + x.
PointGeomSharedPtr GetVertex(int i) const
virtual int v_WhichEdge(SegGeomSharedPtr edge)
Return the edge number of the given edge.
void Mult(PointGeom &a, PointGeom &b)
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
virtual void v_FillGeom()
Put all quadrature information into edge structure.
Array< OneD, Array< OneD, NekDouble > > m_coeffs
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Geometry is straight-sided with constant geometric factors.
boost::shared_ptr< Geometry1D > Geometry1DSharedPtr
NekDouble GetLocCoords(const Array< OneD, const NekDouble > &coords, Array< OneD, NekDouble > &Lcoords)
LibUtilities::ShapeType m_shapeType
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)
virtual int v_GetEid(int i) const
boost::unordered_map< int, CurveSharedPtr > CurveMap
Geometric information has been generated.
void SetUpCoeffs(const int nCoeffs)
Initialise the m_coeffs array.
StdRegions::Orientation m_eorient[kNedges]
GeomFactorsSharedPtr GetMetricInfo()
GeomType
Indicates the type of element geometry.
bool m_ownData
Boolean indicating whether object owns the data.
boost::shared_ptr< Basis > BasisSharedPtr
virtual NekDouble v_GetLocCoords(const Array< OneD, const NekDouble > &coords, Array< OneD, NekDouble > &Lcoords)
GeomState m_state
enum identifier to determine if quad points are filled
virtual StdRegions::Orientation v_GetEorient(const int i) const
virtual const LibUtilities::BasisSharedPtr v_GetBasis(const int i)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Geometry is curved or has non-constant factors.
int m_coordim
coordinate dimension
Describes the specification for a Basis.
boost::shared_ptr< PointGeom > PointGeomSharedPtr
1D Gauss-Lobatto-Legendre quadrature points
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.