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

#include <PointGeom.h>

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

Public Member Functions

 PointGeom ()
 PointGeom (const int coordim, const int vid, NekDouble x, NekDouble y, NekDouble z)
 PointGeom (const PointGeom &T)
 ~PointGeom ()
void AddElmtConnected (int gvo_id, int locid)
int NumElmtConnected () const
bool IsElmtConnected (int gvo_id, int locid) const
void GetCoords (NekDouble &x, NekDouble &y, NekDouble &z)
void GetCoords (Array< OneD, NekDouble > &coords)
void UpdatePosition (NekDouble x, NekDouble y, NekDouble z)
int GetVid () const
void SetVid (const int vid)
void Mult (PointGeom &a, PointGeom &b)
void Add (PointGeom &a, PointGeom &b)
void Sub (PointGeom &a, PointGeom &b)
NekDouble dist (PointGeom &a)
NekDouble dot (PointGeom &a)
- Public Member Functions inherited from Nektar::SpatialDomains::Geometry0D
 Geometry0D ()
 Geometry0D (const int coordim)
virtual ~Geometry0D ()
- Public Member Functions inherited from Nektar::SpatialDomains::Geometry
 Geometry ()
 Geometry (int coordim)
virtual ~Geometry ()
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
PointGeomSharedPtr GetVertex (int i) 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)
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.
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 ()
- Public Member Functions inherited from Nektar::NekPoint< NekDouble >
 NekPoint ()
 NekPoint (const std::string &pointValues)
 NekPoint (typename boost::call_traits< DataType >::param_type x, typename boost::call_traits< DataType >::param_type y, typename boost::call_traits< DataType >::param_type z)
 NekPoint (typename boost::call_traits< DataType >::const_reference a)
 NekPoint (const NekPoint< DataType > &rhs)
 ~NekPoint ()
NekPoint< DataType > & operator= (const NekPoint< DataType > &rhs)
boost::call_traits< DataType >
::reference 
operator() (unsigned int i)
 Returns i^{th} element.
boost::call_traits< DataType >
::const_reference 
operator() (unsigned int i) const
boost::call_traits< DataType >
::reference 
operator[] (unsigned int i)
boost::call_traits< DataType >
::const_reference 
operator[] (unsigned int i) const
boost::call_traits< DataType >
::const_reference 
x () const
boost::call_traits< DataType >
::reference 
x ()
boost::call_traits< DataType >
::const_reference 
y () const
boost::call_traits< DataType >
::reference 
y ()
boost::call_traits< DataType >
::const_reference 
z () const
boost::call_traits< DataType >
::reference 
z ()
boost::call_traits< DataType >
::const_reference 
a () const
boost::call_traits< DataType >
::const_reference 
b () const
boost::call_traits< DataType >
::const_reference 
c () const
boost::call_traits< DataType >
::const_reference 
r () const
boost::call_traits< DataType >
::const_reference 
s () const
boost::call_traits< DataType >
::const_reference 
t () const
void SetX (typename boost::call_traits< DataType >::const_reference val)
void SetY (typename boost::call_traits< DataType >::const_reference val)
void SetZ (typename boost::call_traits< DataType >::const_reference val)
const DataTypeGetPtr () const
bool operator== (const NekPoint< DataType > &rhs) const
bool operator!= (const NekPoint< DataType > &rhs) const
void negate ()
 Arithmetic Routines.
NekPoint< DataTypeoperator- () const
NekPoint< DataType > & operator+= (const NekPoint< DataType > &rhs)
NekPoint< DataType > & operator+= (typename boost::call_traits< DataType >::param_type rhs)
NekPoint< DataType > & operator-= (const NekPoint< DataType > &rhs)
NekPoint< DataType > & operator-= (typename boost::call_traits< DataType >::param_type rhs)
NekPoint< DataType > & operator*= (typename boost::call_traits< DataType >::param_type rhs)
NekPoint< DataType > & operator/= (typename boost::call_traits< DataType >::param_type rhs)
std::string AsString () const

Static Public Member Functions

static StdRegions::Orientation GetPointOrientation (const SegGeom &edge1, const SegGeom &edge2)
 Get the orientation of point1; to be used later for normal convention.
- Static Public Member Functions inherited from Nektar::NekPoint< NekDouble >
static unsigned int dimension ()
 Returns the number of dimensions for the point.

Protected Member Functions

virtual void v_GenGeomFactors ()
virtual int v_GetVid (int id) const
virtual PointGeomSharedPtr v_GetVertex (int i) const

Protected Attributes

int m_vid
std::list< CompToElmtm_elmtMap

Private Member Functions

virtual NekDouble v_GetCoord (const int i, const Array< OneD, const NekDouble > &Lcoord)
virtual NekDouble v_GetLocCoords (const Array< OneD, const NekDouble > &coords, Array< OneD, NekDouble > &Lcoords)

Friends

bool operator== (const PointGeom &x, const PointGeom &y)
 Determine equivalence by the ids. No matter what the position, if the ids are the same, then they are equivalent, and vice versa.
bool operator== (const PointGeom &x, const PointGeom *y)
bool operator== (const PointGeom *x, const PointGeom &y)
bool operator!= (const PointGeom &x, const PointGeom &y)
bool operator!= (const PointGeom &x, const PointGeom *y)
bool operator!= (const PointGeom *x, const PointGeom &y)

Additional Inherited Members

- Public Types inherited from Nektar::NekPoint< NekDouble >
typedef NekDouble DataType
typedef ThreeD dim
- 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 60 of file PointGeom.h.

Constructor & Destructor Documentation

Nektar::SpatialDomains::PointGeom::PointGeom ( )
Nektar::SpatialDomains::PointGeom::PointGeom ( const int  coordim,
const int  vid,
NekDouble  x,
NekDouble  y,
NekDouble  z 
)

Definition at line 59 of file PointGeom.cpp.

References Nektar::LibUtilities::ePoint, Nektar::SpatialDomains::Geometry::m_coordim, Nektar::SpatialDomains::Geometry::m_shapeType, and m_vid.

: NekPoint<NekDouble>(x,y,z)
{
m_coordim = coordim;
m_vid = vid;
(*this)(0) = x;
(*this)(1) = y;
(*this)(2) = z;
}
Nektar::SpatialDomains::PointGeom::PointGeom ( const PointGeom T)

Definition at line 74 of file PointGeom.cpp.

References Nektar::SpatialDomains::Geometry::m_coordim, m_elmtMap, Nektar::SpatialDomains::Geometry::m_shapeType, and m_vid.

: NekPoint<NekDouble>(T)
{
m_shapeType = T.m_shapeType;
m_vid = T.m_vid;
m_coordim = T.m_coordim;
std::list<CompToElmt>::const_iterator def;
for(def = T.m_elmtMap.begin(); def != T.m_elmtMap.end(); def++)
{
m_elmtMap.push_back(*def);
}
}
Nektar::SpatialDomains::PointGeom::~PointGeom ( )

Definition at line 88 of file PointGeom.cpp.

{
}

Member Function Documentation

void Nektar::SpatialDomains::PointGeom::Add ( PointGeom a,
PointGeom b 
)

Definition at line 157 of file PointGeom.cpp.

References Nektar::SpatialDomains::Geometry::GetCoordim(), and Nektar::SpatialDomains::Geometry::m_coordim.

{
(*this)(0) = a[0] + b[0];
(*this)(1) = a[1] + b[1];
(*this)(2) = a[2] + b[2];
m_coordim = std::max(a.GetCoordim(),b.GetCoordim());
}
void Nektar::SpatialDomains::PointGeom::AddElmtConnected ( int  gvo_id,
int  locid 
)

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 93 of file PointGeom.cpp.

References m_elmtMap.

{
CompToElmt ee(gvo_id,locid);
m_elmtMap.push_back(ee);
}
NekDouble Nektar::SpatialDomains::PointGeom::dist ( PointGeom a)
NekDouble Nektar::SpatialDomains::PointGeom::dot ( PointGeom a)
void Nektar::SpatialDomains::PointGeom::GetCoords ( NekDouble x,
NekDouble y,
NekDouble z 
)

Definition at line 120 of file PointGeom.cpp.

References Nektar::SpatialDomains::Geometry::m_coordim.

Referenced by Nektar::LocalRegions::PointExp::GetCoords(), and Nektar::LocalRegions::PointExp::v_GetCoords().

{
switch(m_coordim)
{
case 3:
z = (*this)(2);
case 2:
y = (*this)(1);
case 1:
x = (*this)(0);
break;
}
}
void Nektar::SpatialDomains::PointGeom::GetCoords ( Array< OneD, NekDouble > &  coords)

Definition at line 134 of file PointGeom.cpp.

References Nektar::SpatialDomains::Geometry::m_coordim.

{
switch(m_coordim)
{
case 3:
coords[2] = (*this)(2);
case 2:
coords[1] = (*this)(1);
case 1:
coords[0] = (*this)(0);
break;
}
}
StdRegions::Orientation Nektar::SpatialDomains::PointGeom::GetPointOrientation ( const SegGeom edge1,
const SegGeom edge2 
)
static

Get the orientation of point1; to be used later for normal convention.

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 267 of file PointGeom.cpp.

References ASSERTL0, Nektar::StdRegions::eBwd, Nektar::StdRegions::eFwd, Nektar::SpatialDomains::Geometry1D::GetEid(), and Nektar::SpatialDomains::Geometry1D::GetVertex().

{
/// Backward direction. Vertex 0 is connected to edge 2.
if ((*edge1.GetVertex(0) == *edge2.GetVertex(0)) ||
(*edge1.GetVertex(0) == *edge2.GetVertex(1)))
{
returnval = StdRegions::eBwd;
}
// 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;
}
int Nektar::SpatialDomains::PointGeom::GetVid ( ) const
inline

Definition at line 78 of file PointGeom.h.

References m_vid.

{
return m_vid;
}
bool Nektar::SpatialDomains::PointGeom::IsElmtConnected ( int  gvo_id,
int  locid 
) const

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 104 of file PointGeom.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);
}
void Nektar::SpatialDomains::PointGeom::Mult ( PointGeom a,
PointGeom b 
)
int Nektar::SpatialDomains::PointGeom::NumElmtConnected ( ) const

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 99 of file PointGeom.cpp.

References m_elmtMap.

{
return int(m_elmtMap.size());
}
void Nektar::SpatialDomains::PointGeom::SetVid ( const int  vid)
inline

Definition at line 83 of file PointGeom.h.

References m_vid.

{
m_vid = vid;
}
void Nektar::SpatialDomains::PointGeom::Sub ( PointGeom a,
PointGeom b 
)
void Nektar::SpatialDomains::PointGeom::UpdatePosition ( NekDouble  x,
NekDouble  y,
NekDouble  z 
)

Definition at line 149 of file PointGeom.cpp.

{
(*this)(0) = x;
(*this)(1) = y;
(*this)(2) = z;
}
void Nektar::SpatialDomains::PointGeom::v_GenGeomFactors ( )
protectedvirtual

Implements Nektar::SpatialDomains::Geometry.

Definition at line 291 of file PointGeom.cpp.

{
}
NekDouble Nektar::SpatialDomains::PointGeom::v_GetCoord ( const int  i,
const Array< OneD, const NekDouble > &  Lcoord 
)
privatevirtual

Definition at line 296 of file PointGeom.cpp.

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

{
return GetCoord(i,Lcoord);
}
NekDouble Nektar::SpatialDomains::PointGeom::v_GetLocCoords ( const Array< OneD, const NekDouble > &  coords,
Array< OneD, NekDouble > &  Lcoords 
)
privatevirtual

Definition at line 301 of file PointGeom.cpp.

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

{
return GetLocCoords(coords,Lcoords);
}
PointGeomSharedPtr Nektar::SpatialDomains::PointGeom::v_GetVertex ( int  i) const
protectedvirtual

Implements Nektar::SpatialDomains::Geometry.

Definition at line 242 of file PointGeom.cpp.

References ASSERTL0, and PointGeom().

{
ASSERTL0(i == 0, "Index other than 0 is meaningless.");
// shared_this_ptr() returns const PointGeom, which cannot be
// returned.
return PointGeomSharedPtr(new PointGeom(*this));
}
int Nektar::SpatialDomains::PointGeom::v_GetVid ( int  id) const
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 237 of file PointGeom.cpp.

References m_vid.

{
return m_vid;
}

Friends And Related Function Documentation

bool operator!= ( const PointGeom x,
const PointGeom y 
)
friend

Definition at line 212 of file PointGeom.cpp.

{
return (x.m_vid != y.m_vid);
}
bool operator!= ( const PointGeom x,
const PointGeom y 
)
friend

Definition at line 217 of file PointGeom.cpp.

{
return (x.m_vid != y->m_vid);
}
bool operator!= ( const PointGeom x,
const PointGeom y 
)
friend

Definition at line 222 of file PointGeom.cpp.

{
return (x->m_vid != y.m_vid);
}
bool operator== ( const PointGeom x,
const PointGeom y 
)
friend

Determine equivalence by the ids. No matter what the position, if the ids are the same, then they are equivalent, and vice versa.

Definition at line 197 of file PointGeom.cpp.

{
return (x.m_vid == y.m_vid);
}
bool operator== ( const PointGeom x,
const PointGeom y 
)
friend

Definition at line 202 of file PointGeom.cpp.

{
return (x.m_vid == y->m_vid);
}
bool operator== ( const PointGeom x,
const PointGeom y 
)
friend

Definition at line 207 of file PointGeom.cpp.

{
return (x->m_vid == y.m_vid);
}

Member Data Documentation

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

Definition at line 108 of file PointGeom.h.

Referenced by AddElmtConnected(), IsElmtConnected(), NumElmtConnected(), and PointGeom().

int Nektar::SpatialDomains::PointGeom::m_vid
protected