Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
Nektar::SpatialDomains::SegGeom Class Reference

#include <SegGeom.h>

Inheritance diagram for Nektar::SpatialDomains::SegGeom:
Inheritance graph
[legend]
Collaboration diagram for Nektar::SpatialDomains::SegGeom:
Collaboration graph
[legend]

Public Member Functions

 SegGeom ()
 SegGeom (int id, const int coordim)
 SegGeom (int id, const int coordim, const PointGeomSharedPtr vertex[])
 SegGeom (int id, const int coordim, const PointGeomSharedPtr vertex[], const CurveSharedPtr &curve)
 SegGeom (const int id, const PointGeomSharedPtr &vert1, const PointGeomSharedPtr &vert2)
 SegGeom (const SegGeom &in)
SegGeomSharedPtr GenerateOneSpaceDimGeom (void)
 Generate a one dimensional space segment geometry where the vert[0] has the same x value and vert[1] is set to vert[0] plus the length of the original segment.
 ~SegGeom ()
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.
StdRegions::StdExpansion1DSharedPtr operator[] (const int i) const
- Public Member Functions inherited from Nektar::SpatialDomains::Geometry1D
 Geometry1D ()
 Geometry1D (const int coordim)
virtual ~Geometry1D ()
PointGeomSharedPtr GetVertex (const int i) const
LibUtilities::ShapeType DetShapeType () const
int GetEid () const
- Public Member Functions inherited from Nektar::SpatialDomains::Geometry
 Geometry ()
 Geometry (int coordim)
virtual ~Geometry ()
bool IsElmtConnected (int gvo_id, int locid) const
void AddElmtConnected (int gvo_id, int locid)
int NumElmtConnected () const
int GetCoordim () const
void SetCoordim (int coordim)
GeomFactorsSharedPtr GetGeomFactors ()
GeomFactorsSharedPtr GetRefGeomFactors (const Array< OneD, const LibUtilities::BasisSharedPtr > &tbasis)
GeomFactorsSharedPtr GetMetricInfo ()
LibUtilities::ShapeType GetShapeType (void)
int GetGlobalID (void)
void SetGlobalID (int globalid)
int GetVid (int i) const
int GetEid (int i) const
int GetFid (int i) const
int GetNumVerts () const
StdRegions::Orientation GetEorient (const int i) const
StdRegions::Orientation GetPorient (const int i) const
int GetNumEdges () const
int GetNumFaces () const
int GetShapeDim () const
StdRegions::StdExpansionSharedPtr GetXmap () const
const Array< OneD, const
NekDouble > & 
GetCoeffs (const int i) const
bool ContainsPoint (const Array< OneD, const NekDouble > &gloCoord, NekDouble tol=0.0)
bool ContainsPoint (const Array< OneD, const NekDouble > &gloCoord, Array< OneD, NekDouble > &locCoord, NekDouble tol)
bool ContainsPoint (const Array< OneD, const NekDouble > &gloCoord, Array< OneD, NekDouble > &locCoord, NekDouble tol, NekDouble &resid)
int GetVertexEdgeMap (int i, int j) const
int GetVertexFaceMap (int i, int j) const
 return the id of the $j^{th}$ face attached to the $ i^{th}$ vertex
int GetEdgeFaceMap (int i, int j) const
void FillGeom ()
 Put all quadrature information into face/edge structure and backward transform.
NekDouble GetLocCoords (const Array< OneD, const NekDouble > &coords, Array< OneD, NekDouble > &Lcoords)
void SetOwnData ()
const LibUtilities::BasisSharedPtr GetBasis (const int i)
 Return the j-th basis of the i-th co-ordinate dimension.
const LibUtilities::PointsKeyVector GetPointsKeys ()

Static Public Member Functions

static StdRegions::Orientation GetEdgeOrientation (const SegGeom &edge1, const SegGeom &edge2)
 Get the orientation of edge1.

Static Public Attributes

static const int kNverts = 2
static const int kNedges = 1

Protected Member Functions

virtual int v_GetVid (int i) const
virtual PointGeomSharedPtr v_GetVertex (const int i) const
virtual int v_GetEid () const
virtual const
LibUtilities::BasisSharedPtr 
v_GetBasis (const int i)
virtual
StdRegions::StdExpansionSharedPtr 
v_GetXmap () const
virtual void v_SetOwnData ()
virtual void v_AddElmtConnected (int gvo_id, int locid)
virtual int v_NumElmtConnected () const
virtual bool v_IsElmtConnected (int gvoId, int locId) const
virtual LibUtilities::ShapeType v_DetShapeType () const
virtual NekDouble v_GetLocCoords (const Array< OneD, const NekDouble > &coords, Array< OneD, NekDouble > &Lcoords)
virtual void v_GenGeomFactors ()
 Set up GeoFac for this geometry using Coord quadrature distribution.
virtual StdRegions::Orientation v_GetPorient (const int i) const
virtual void v_FillGeom ()
 put all quadrature information into edge structure and backward transform
virtual NekDouble v_GetCoord (const int i, const Array< OneD, const NekDouble > &Lcoord)
virtual int v_GetNumVerts () const
virtual int v_GetNumEdges () const
virtual bool v_ContainsPoint (const Array< OneD, const NekDouble > &gloCoord, NekDouble tol=0.0)
 Determines if a point specified in global coordinates is located within this tetrahedral geometry.
virtual bool v_ContainsPoint (const Array< OneD, const NekDouble > &gloCoord, Array< OneD, NekDouble > &locCoord, NekDouble tol)
virtual bool v_ContainsPoint (const Array< OneD, const NekDouble > &gloCoord, Array< OneD, NekDouble > &locCoord, NekDouble tol, NekDouble &resid)
- Protected Member Functions inherited from Nektar::SpatialDomains::Geometry1D
virtual int v_GetShapeDim () const
- Protected Member Functions inherited from Nektar::SpatialDomains::Geometry
void GenGeomFactors ()
virtual int v_GetEid (int i) const
virtual int v_GetFid (int i) const
virtual StdRegions::Orientation v_GetEorient (const int i) const
virtual int v_GetNumFaces () const
virtual int v_GetCoordim () const
virtual int v_GetVertexEdgeMap (int i, int j) const
virtual int v_GetVertexFaceMap (int i, int j) const
virtual int v_GetEdgeFaceMap (int i, int j) const
void SetUpCoeffs (const int nCoeffs)

Protected Attributes

int m_eid
std::list< CompToElmtm_elmtMap
SpatialDomains::PointGeomSharedPtr m_verts [kNverts]
StdRegions::Orientation m_porient [kNverts]

Private Attributes

bool m_ownData
 Boolean indicating whether object owns the data.

Additional Inherited Members

- Static Protected Member Functions inherited from Nektar::SpatialDomains::Geometry
static GeomFactorsSharedPtr ValidateRegGeomFactor (GeomFactorsSharedPtr geomFactor)
- Static Protected Attributes inherited from Nektar::SpatialDomains::Geometry
static GeomFactorsVector m_regGeomFactorsManager

Detailed Description

Definition at line 57 of file SegGeom.h.

Constructor & Destructor Documentation

Nektar::SpatialDomains::SegGeom::SegGeom ( )
Nektar::SpatialDomains::SegGeom::SegGeom ( int  id,
const int  coordim 
)
Nektar::SpatialDomains::SegGeom::SegGeom ( int  id,
const int  coordim,
const PointGeomSharedPtr  vertex[] 
)

Definition at line 67 of file SegGeom.cpp.

References Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eModified_A, Nektar::SpatialDomains::eNotFilled, Nektar::LibUtilities::eSegment, m_eid, Nektar::SpatialDomains::Geometry::m_globalID, Nektar::SpatialDomains::Geometry::m_shapeType, Nektar::SpatialDomains::Geometry::m_state, m_verts, Nektar::SpatialDomains::Geometry::m_xmap, and Nektar::SpatialDomains::Geometry::SetUpCoeffs().

:
Geometry1D(coordim)
{
m_eid = id;
m_globalID = id;
if (coordim > 0)
{
const LibUtilities::BasisKey B(LibUtilities::eModified_A, 2,
LibUtilities::PointsKey(3,
)
);
m_xmap = MemoryManager<StdRegions::StdSegExp>::AllocateSharedPtr(B);
SetUpCoeffs(m_xmap->GetNcoeffs());
}
m_verts[0] = vertex[0];
m_verts[1] = vertex[1];
}
Nektar::SpatialDomains::SegGeom::SegGeom ( int  id,
const int  coordim,
const PointGeomSharedPtr  vertex[],
const CurveSharedPtr curve 
)

Definition at line 94 of file SegGeom.cpp.

References Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eModified_A, Nektar::SpatialDomains::eNotFilled, Nektar::LibUtilities::eSegment, ErrorUtil::ewarning, Nektar::eWrapper, Nektar::NekVector< DataType >::GetPtr(), Nektar::NekConstants::kVertexTheSameDouble, Nektar::SpatialDomains::Geometry::m_coeffs, Nektar::SpatialDomains::Geometry::m_coordim, m_eid, Nektar::SpatialDomains::Geometry::m_globalID, Nektar::SpatialDomains::Geometry::m_shapeType, Nektar::SpatialDomains::Geometry::m_state, m_verts, Nektar::SpatialDomains::Geometry::m_xmap, NEKERROR, npts, Nektar::LibUtilities::PointsManager(), and Nektar::SpatialDomains::Geometry::SetUpCoeffs().

:
Geometry1D(coordim)
{
m_eid = id;
m_globalID = id;
if (coordim > 0)
{
int npts = curve->m_points.size();
LibUtilities::PointsKey pkey(npts+1,LibUtilities::eGaussLobattoLegendre);
const LibUtilities::BasisKey B(LibUtilities::eModified_A, npts, pkey);
Array<OneD,NekDouble> tmp(npts);
if(vertex[0]->dist(*(curve->m_points[0])) > NekConstants::kVertexTheSameDouble)
{
cout<<"edge="<<id<<endl;
std::string err = "Vertex 0 is separated from first point by more than ";
std::stringstream strstrm;
err += strstrm.str();
}
if(vertex[1]->dist(*(curve->m_points[npts-1])) > NekConstants::kVertexTheSameDouble)
{
cout<<"edge="<<id<<endl;
std::string err = "Vertex 1 is separated from last point by more than ";
std::stringstream strstrm;
err += strstrm.str();
}
m_xmap = MemoryManager<StdRegions::StdSegExp>::AllocateSharedPtr(B);
SetUpCoeffs(m_xmap->GetNcoeffs());
for(int i = 0; i < m_coordim; ++i)
{
// Load up coordinate values into tmp
for(int j = 0; j < npts; ++j)
{
tmp[j] = (curve->m_points[j]->GetPtr())[i];
}
// Interpolate to GLL points
LibUtilities::PointsKey fkey(npts,curve->m_ptype);
I0 = LibUtilities::PointsManager()[fkey]->GetI(pkey);
NekVector<NekDouble> in (npts, tmp, eWrapper);
NekVector<NekDouble> out(npts+1);
out = (*I0)*in;
m_xmap->FwdTrans(out.GetPtr(), m_coeffs[i]);
}
}
m_verts[0] = vertex[0];
m_verts[1] = vertex[1];
}
Nektar::SpatialDomains::SegGeom::SegGeom ( const int  id,
const PointGeomSharedPtr vert1,
const PointGeomSharedPtr vert2 
)

Definition at line 164 of file SegGeom.cpp.

References Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eModified_A, Nektar::SpatialDomains::eNotFilled, Nektar::LibUtilities::eSegment, m_eid, Nektar::SpatialDomains::Geometry::m_globalID, Nektar::SpatialDomains::Geometry::m_shapeType, Nektar::SpatialDomains::Geometry::m_state, m_verts, Nektar::SpatialDomains::Geometry::m_xmap, and Nektar::SpatialDomains::Geometry::SetUpCoeffs().

:
Geometry1D(vert1->GetCoordim())
{
m_verts[0] = vert1;
m_verts[1] = vert2;
const LibUtilities::BasisKey B(LibUtilities::eModified_A, 2,
LibUtilities::PointsKey(3,
)
);
m_eid = id;
m_globalID = id;
m_xmap = MemoryManager<StdRegions::StdSegExp>::AllocateSharedPtr(B);
SetUpCoeffs(m_xmap->GetNcoeffs());
}
Nektar::SpatialDomains::SegGeom::SegGeom ( const SegGeom in)

Definition at line 188 of file SegGeom.cpp.

References Nektar::SpatialDomains::Geometry::m_coordim, m_eid, m_elmtMap, Nektar::SpatialDomains::Geometry::m_globalID, Nektar::SpatialDomains::Geometry::m_shapeType, Nektar::SpatialDomains::Geometry::m_state, m_verts, Nektar::SpatialDomains::Geometry::m_xmap, and Nektar::SpatialDomains::Geometry::SetUpCoeffs().

{
// From Geometry class
m_shapeType = in.m_shapeType;
// info from EdgeComponent class
m_eid = in.m_eid;
m_globalID = in.m_globalID;
std::list<CompToElmt>::const_iterator def;
for(def = in.m_elmtMap.begin(); def != in.m_elmtMap.end(); def++)
{
m_elmtMap.push_back(*def);
}
m_xmap = in.m_xmap;
SetUpCoeffs(m_xmap->GetNcoeffs());
// info from SegGeom class
m_coordim = in.m_coordim;
m_verts[0] = in.m_verts[0];
m_verts[1] = in.m_verts[1];
m_state = in.m_state;
}
Nektar::SpatialDomains::SegGeom::~SegGeom ( )

Definition at line 274 of file SegGeom.cpp.

{
}

Member Function Documentation

SegGeomSharedPtr Nektar::SpatialDomains::SegGeom::GenerateOneSpaceDimGeom ( void  )

Generate a one dimensional space segment geometry where the vert[0] has the same x value and vert[1] is set to vert[0] plus the length of the original segment.

Definition at line 219 of file SegGeom.cpp.

References Nektar::SpatialDomains::eNotFilled, Nektar::SpatialDomains::Geometry::GetVid(), m_eid, m_elmtMap, Nektar::SpatialDomains::Geometry::m_geomFactors, Nektar::SpatialDomains::Geometry::m_globalID, m_verts, Nektar::SpatialDomains::Geometry::m_xmap, and v_GenGeomFactors().

{
SegGeomSharedPtr returnval = MemoryManager<SegGeom>::AllocateSharedPtr();
// info about numbering
returnval->m_eid = m_eid;
returnval->m_globalID = m_globalID;
returnval->m_elmtMap = m_elmtMap;
// geometric information.
returnval->m_coordim = 1;
NekDouble x0 = (*m_verts[0])[0];
PointGeomSharedPtr vert0 = MemoryManager<PointGeom>::AllocateSharedPtr(1,m_verts[0]->GetVid(),x0,0.0,0.0);
vert0->SetGlobalID(vert0->GetVid());
returnval->m_verts[0] = vert0;
// Get information to calculate length.
const Array<OneD, const LibUtilities::BasisSharedPtr> base = m_xmap->GetBase();
v.push_back(base[0]->GetPointsKey());
const Array<OneD, const NekDouble> jac = m_geomFactors->GetJac(v);
NekDouble len;
if(jac.num_elements() == 1)
{
len = jac[0]*2.0;
}
else
{
Array<OneD, const NekDouble> w0 = base[0]->GetW();
for(int i = 0; i < jac.num_elements(); ++i)
{
len += jac[i]*w0[i];
}
}
// Set up second vertex.
PointGeomSharedPtr vert1 = MemoryManager<PointGeom>::AllocateSharedPtr(1,m_verts[1]->GetVid(),x0+len,0.0,0.0);
vert0->SetGlobalID(vert1->GetVid());
returnval->m_verts[1] = vert1;
// at present just use previous m_xmap[0];
returnval->m_xmap = m_xmap;
returnval->SetUpCoeffs(m_xmap->GetNcoeffs());
returnval->m_state = eNotFilled;
return returnval;
}
NekDouble Nektar::SpatialDomains::SegGeom::GetCoord ( const int  i,
const Array< OneD, const NekDouble > &  Lcoord 
)

Given local collapsed coordinate Lcoord return the value of physical coordinate in direction i.

Reimplemented from Nektar::SpatialDomains::Geometry.

StdRegions::Orientation Nektar::SpatialDomains::SegGeom::GetEdgeOrientation ( const SegGeom edge1,
const SegGeom edge2 
)
static

Get the orientation of edge1.

If edge1 is connected to edge2 in the same direction as the points comprising edge1 then it is forward, otherwise it is backward.

For example, assume edge1 is comprised of points 1 and 2, and edge2 is comprised of points 2 and 3, then edge1 is forward.

If edge1 is comprised of points 2 and 1 and edge2 is comprised of points 3 and 2, then edge1 is backward.

Since both edges are passed, it does not need any information from the EdgeComponent instance.

Backward direction. Vertex 0 is connected to edge 2.

Definition at line 337 of file SegGeom.cpp.

References ASSERTL0, Nektar::StdRegions::eBackwards, Nektar::StdRegions::eForwards, Nektar::SpatialDomains::Geometry1D::GetEid(), and Nektar::SpatialDomains::Geometry1D::GetVertex().

Referenced by Nektar::Utilities::Face::GetGeom(), Nektar::Utilities::Triangle::GetGeom(), Nektar::Utilities::Quadrilateral::GetGeom(), Nektar::SpatialDomains::MeshGraph2D::ReadElements(), and Nektar::SpatialDomains::MeshGraph3D::ReadFaces().

{
/// Backward direction. Vertex 0 is connected to edge 2.
if ((*edge1.GetVertex(0) == *edge2.GetVertex(0)) ||
(*edge1.GetVertex(0) == *edge2.GetVertex(1)))
{
}
// Not forward either, then we have a problem.
else if ((*edge1.GetVertex(1) != *edge2.GetVertex(0)) &&
(*edge1.GetVertex(1) != *edge2.GetVertex(1)))
{
std::ostringstream errstrm;
errstrm << "Connected edges do not share a vertex. Edges ";
errstrm << edge1.GetEid() << ", " << edge2.GetEid();
ASSERTL0(false, errstrm.str());
}
return returnval;
}
StdRegions::StdExpansion1DSharedPtr Nektar::SpatialDomains::SegGeom::operator[] ( const int  i) const
void Nektar::SpatialDomains::SegGeom::v_AddElmtConnected ( int  gvo_id,
int  locid 
)
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 293 of file SegGeom.cpp.

References m_elmtMap.

{
CompToElmt ee(gvo_id,locid);
m_elmtMap.push_back(ee);
}
bool Nektar::SpatialDomains::SegGeom::v_ContainsPoint ( const Array< OneD, const NekDouble > &  gloCoord,
NekDouble  tol = 0.0 
)
protectedvirtual

Determines if a point specified in global coordinates is located within this tetrahedral geometry.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 442 of file SegGeom.cpp.

References Nektar::SpatialDomains::Geometry::GetCoordim().

Referenced by v_ContainsPoint().

{
Array<OneD,NekDouble> locCoord(GetCoordim(),0.0);
return v_ContainsPoint(gloCoord,locCoord,tol);
}
bool Nektar::SpatialDomains::SegGeom::v_ContainsPoint ( const Array< OneD, const NekDouble > &  gloCoord,
Array< OneD, NekDouble > &  locCoord,
NekDouble  tol 
)
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 450 of file SegGeom.cpp.

References v_ContainsPoint().

{
NekDouble resid;
return v_ContainsPoint(gloCoord,stdCoord,tol,resid);
}
bool Nektar::SpatialDomains::SegGeom::v_ContainsPoint ( const Array< OneD, const NekDouble > &  gloCoord,
Array< OneD, NekDouble > &  locCoord,
NekDouble  tol,
NekDouble resid 
)
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 459 of file SegGeom.cpp.

References Nektar::SpatialDomains::Geometry::GetLocCoords().

{
resid = GetLocCoords(gloCoord, stdCoord);
if (stdCoord[0] >= -(1+tol) && stdCoord[0] <= 1+tol)
{
return true;
}
return false;
}
LibUtilities::ShapeType Nektar::SpatialDomains::SegGeom::v_DetShapeType ( ) const
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry1D.

Definition at line 527 of file SegGeom.cpp.

References Nektar::LibUtilities::eSegment.

void Nektar::SpatialDomains::SegGeom::v_FillGeom ( )
protectedvirtual

put all quadrature information into edge structure and backward transform

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 385 of file SegGeom.cpp.

References Nektar::SpatialDomains::ePtsFilled, Nektar::SpatialDomains::Geometry::m_coeffs, Nektar::SpatialDomains::Geometry::m_coordim, Nektar::SpatialDomains::Geometry::m_state, and m_verts.

Referenced by v_GenGeomFactors(), and v_GetLocCoords().

{
{
int i;
for (i = 0; i < m_coordim; ++i)
{
m_coeffs[i][0] = (*m_verts[0])[i];
m_coeffs[i][1] = (*m_verts[1])[i];
}
}
}
void Nektar::SpatialDomains::SegGeom::v_GenGeomFactors ( )
protectedvirtual

Set up GeoFac for this geometry using Coord quadrature distribution.

Implements Nektar::SpatialDomains::Geometry.

Definition at line 363 of file SegGeom.cpp.

References Nektar::SpatialDomains::eDeformed, Nektar::SpatialDomains::ePtsFilled, Nektar::SpatialDomains::eRegular, Nektar::SpatialDomains::Geometry::m_coeffs, Nektar::SpatialDomains::Geometry::m_coordim, Nektar::SpatialDomains::Geometry::m_geomFactors, Nektar::SpatialDomains::Geometry::m_geomFactorsState, Nektar::SpatialDomains::Geometry::m_xmap, and v_FillGeom().

Referenced by GenerateOneSpaceDimGeom().

{
{
if(m_xmap->GetBasisNumModes(0)!=2)
{
gType = eDeformed;
}
m_geomFactors = MemoryManager<GeomFactors>::AllocateSharedPtr(
}
}
const LibUtilities::BasisSharedPtr Nektar::SpatialDomains::SegGeom::v_GetBasis ( const int  i)
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 496 of file SegGeom.cpp.

References Nektar::SpatialDomains::Geometry::m_xmap.

{
return m_xmap->GetBasis(i);
}
NekDouble Nektar::SpatialDomains::SegGeom::v_GetCoord ( const int  i,
const Array< OneD, const NekDouble > &  Lcoord 
)
protectedvirtual

given local collapsed coordinate Lcoord return the value of physical coordinate in direction i

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 280 of file SegGeom.cpp.

References ASSERTL1, Nektar::SpatialDomains::ePtsFilled, Nektar::SpatialDomains::Geometry::m_coeffs, Nektar::SpatialDomains::Geometry::m_state, and Nektar::SpatialDomains::Geometry::m_xmap.

{
"Geometry is not in physical space");
Array<OneD, NekDouble> tmp(m_xmap->GetTotPoints());
m_xmap->BwdTrans(m_coeffs[i], tmp);
return m_xmap->PhysEvaluate(Lcoord, tmp);
}
int Nektar::SpatialDomains::SegGeom::v_GetEid ( ) const
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry1D.

Definition at line 491 of file SegGeom.cpp.

References m_eid.

{
return m_eid;
}
NekDouble Nektar::SpatialDomains::SegGeom::v_GetLocCoords ( const Array< OneD, const NekDouble > &  coords,
Array< OneD, NekDouble > &  Lcoords 
)
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 401 of file SegGeom.cpp.

References ErrorUtil::efatal, Nektar::SpatialDomains::eRegular, Nektar::SpatialDomains::Geometry::GetMetricInfo(), Nektar::SpatialDomains::Geometry::m_coeffs, Nektar::SpatialDomains::Geometry::m_coordim, Nektar::SpatialDomains::Geometry::m_xmap, NEKERROR, npts, and v_FillGeom().

{
int i;
NekDouble resid = 0.0;
// calculate local coordinate for coord
if(GetMetricInfo()->GetGtype() == eRegular)
{
NekDouble len = 0.0;
NekDouble xi = 0.0;
const int npts = m_xmap->GetTotPoints();
Array<OneD, NekDouble> pts(npts);
for(i = 0; i < m_coordim; ++i)
{
m_xmap->BwdTrans(m_coeffs[i], pts);
len += (pts[npts-1]-pts[0])*(pts[npts-1]-pts[0]);
xi += (coords[i]-pts[0])*(coords[i]-pts[0]);
}
len = sqrt(len);
xi = sqrt(xi);
Lcoords[0] = 2*xi/len-1.0;
}
else
{
"inverse mapping must be set up to use this call");
}
return resid;
}
int Nektar::SpatialDomains::SegGeom::v_GetNumEdges ( ) const
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 537 of file SegGeom.cpp.

References kNedges.

{
return kNedges;
}
int Nektar::SpatialDomains::SegGeom::v_GetNumVerts ( ) const
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 532 of file SegGeom.cpp.

References kNverts.

{
return kNverts;
}
StdRegions::Orientation Nektar::SpatialDomains::SegGeom::v_GetPorient ( const int  i) const
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 511 of file SegGeom.cpp.

References ASSERTL2, Nektar::StdRegions::eBwd, and Nektar::StdRegions::eFwd.

{
//cout << "StdRegions::PointOrientation GetPorient"<<endl;
ASSERTL2((i >=0) && (i <= 1),"Point id must be between 0 and 1");
if (i % 2 == 0)
{
}
else
{
}
}
PointGeomSharedPtr Nektar::SpatialDomains::SegGeom::v_GetVertex ( const int  i) const
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry1D.

Definition at line 479 of file SegGeom.cpp.

References kNverts, and m_verts.

{
PointGeomSharedPtr returnval;
if (i >= 0 && i < kNverts)
{
returnval = m_verts[i];
}
return returnval;
}
int Nektar::SpatialDomains::SegGeom::v_GetVid ( int  i) const
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry1D.

Definition at line 473 of file SegGeom.cpp.

References ASSERTL2, and m_verts.

{
ASSERTL2((i >=0) && (i <= 1),"Verted id must be between 0 and 1");
return m_verts[i]->GetVid();
}
StdRegions::StdExpansionSharedPtr Nektar::SpatialDomains::SegGeom::v_GetXmap ( ) const
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 501 of file SegGeom.cpp.

References Nektar::SpatialDomains::Geometry::m_xmap.

{
return m_xmap;
}
bool Nektar::SpatialDomains::SegGeom::v_IsElmtConnected ( int  gvoId,
int  locId 
) const
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 304 of file SegGeom.cpp.

References Nektar::StdRegions::find(), and m_elmtMap.

{
std::list<CompToElmt>::const_iterator def;
CompToElmt ee(gvo_id,locid);
def = find(m_elmtMap.begin(),m_elmtMap.end(),ee);
// Found the element connectivity object in the list
if(def != m_elmtMap.end())
{
return(true);
}
return(false);
}
int Nektar::SpatialDomains::SegGeom::v_NumElmtConnected ( ) const
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 299 of file SegGeom.cpp.

References m_elmtMap.

{
return int(m_elmtMap.size());
}
void Nektar::SpatialDomains::SegGeom::v_SetOwnData ( )
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 506 of file SegGeom.cpp.

References m_ownData.

{
m_ownData = true;
}

Member Data Documentation

const int Nektar::SpatialDomains::SegGeom::kNedges = 1
static

Definition at line 99 of file SegGeom.h.

Referenced by v_GetNumEdges().

const int Nektar::SpatialDomains::SegGeom::kNverts = 2
static

Definition at line 98 of file SegGeom.h.

Referenced by v_GetNumVerts(), and v_GetVertex().

int Nektar::SpatialDomains::SegGeom::m_eid
protected

Definition at line 102 of file SegGeom.h.

Referenced by GenerateOneSpaceDimGeom(), SegGeom(), and v_GetEid().

std::list<CompToElmt> Nektar::SpatialDomains::SegGeom::m_elmtMap
protected

Definition at line 103 of file SegGeom.h.

Referenced by GenerateOneSpaceDimGeom(), SegGeom(), v_AddElmtConnected(), v_IsElmtConnected(), and v_NumElmtConnected().

bool Nektar::SpatialDomains::SegGeom::m_ownData
private

Boolean indicating whether object owns the data.

Definition at line 169 of file SegGeom.h.

Referenced by v_SetOwnData().

StdRegions::Orientation Nektar::SpatialDomains::SegGeom::m_porient[kNverts]
protected

Definition at line 105 of file SegGeom.h.

SpatialDomains::PointGeomSharedPtr Nektar::SpatialDomains::SegGeom::m_verts[kNverts]
protected

Definition at line 104 of file SegGeom.h.

Referenced by GenerateOneSpaceDimGeom(), SegGeom(), v_FillGeom(), v_GetVertex(), and v_GetVid().