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++)
245 "Geometry is not in physical space");
250 return m_xmap->PhysEvaluate(Lcoord, tmp);
268 int i, j, vmap[4] = {-1,-1,-1,-1};
269 NekDouble x, y, z, x1, y1, z1, cx = 0.0, cy = 0.0, cz = 0.0;
275 for (i = 0; i < 4; ++i)
277 cx += (*face2[i])(0) - (*face1[i])(0);
278 cy += (*face2[i])(1) - (*face1[i])(1);
279 cz += (*face2[i])(2) - (*face1[i])(2);
288 for (i = 0; i < 4; ++i)
293 for (j = 0; j < 4; ++j)
295 x1 = (*face2[j])(0)-cx;
296 y1 = (*face2[j])(1)-cy;
297 z1 = (*face2[j])(2)-cz;
298 if (sqrt((x1-x)*(x1-x)+(y1-y)*(y1-y)+(z1-z)*(z1-z)) < 1e-8)
308 if (vmap[1] == (vmap[0]+1) % 4)
345 ASSERTL0(
false,
"unable to determine face orientation");
374 std::list<CompToElmt>::const_iterator def;
412 return m_xmap->GetBasis(i);
421 ASSERTL1(i <= 3,
"edge is out of range");
423 if (i == 0 || i == 2)
425 return m_xmap->GetBasis(0);
429 return m_xmap->GetBasis(1);
463 if((
m_xmap->GetBasisNumModes(0) != 2)||
464 (
m_xmap->GetBasisNumModes(1) != 2))
538 int nEdgePts = (int)sqrt(static_cast<NekDouble>(npts));
547 ASSERTL0(nEdgePts * nEdgePts == npts,
548 "NUMPOINTS should be a square number in"
556 "Number of edge points does not correspond to "
557 "number of face points in quadrilateral "
563 for (j = 0; j <
npts; ++j)
565 tmp[j] = (
m_curve->m_points[j]->GetPtr())[i];
570 curveKey, curveKey, tmp,
571 m_xmap->GetBasis(0)->GetPointsKey(),
572 m_xmap->GetBasis(1)->GetPointsKey(),
590 nEdgeCoeffs =
m_edges[i]->GetXmap()->GetNcoeffs();
594 for(k = 0; k < nEdgeCoeffs; k++)
597 = signArray[k]*(
m_edges[i]->GetCoeffs(j))[k];
627 orth1.
Mult(norm,dv1);
628 orth2.
Mult(norm,dv2);
635 Lcoords[0] = xin.
dot(orth2)/dv1.
dot(orth2);
636 Lcoords[0] = 2*Lcoords[0]-1;
637 Lcoords[1] = xin.
dot(orth1)/dv2.
dot(orth1);
638 Lcoords[1] = 2*Lcoords[1]-1;
663 Lcoords[0] = za[min_i%za.num_elements()];
664 Lcoords[1] = zb[min_i/za.num_elements()];
678 ASSERTL2((i >=0) && (i <= 3),
"Edge id must be between 0 and 3");
688 ASSERTL2((i >=0) && (i <= 3),
"Verted id must be between 0 and 3");
698 ASSERTL2((i >=0) && (i <= 3),
"Vertex id must be between 0 and 3");
708 ASSERTL2((i >=0) && (i <= 3),
"Edge id must be between 0 and 3");
718 ASSERTL2((i >=0) && (i <= 3),
"Edge id must be between 0 and 3");
728 ASSERTL2((i >=0) && (i <= 3),
"Edge id must be between 0 and 3");
757 for (i=0,edgeIter =
m_edges.begin(); edgeIter !=
m_edges.end(); ++edgeIter,++i)
759 if (*edgeIter == edge)
811 ASSERTL1(gloCoord.num_elements() >= 2,
812 "Two dimensional geometry expects at least two coordinates.");
815 if (stdCoord[0] >= -(1+tol) && stdCoord[1] >= -(1+tol)
816 && stdCoord[0] <= (1+tol) && stdCoord[1] <= (1+tol))
829 if (it != curvedFaces.end())
834 for (
int i = 0; i < 4; ++i)
836 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.