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

Represents a point in the domain. More...

#include <MeshElements.h>

Public Member Functions

 Node (int pId, NekDouble pX, NekDouble pY, NekDouble pZ)
 Create a new node at a specified coordinate.
 Node (const Node &pSrc)
 Copy an existing node.
 Node ()
 ~Node ()
void SetID (int pId)
 Reset the local id;.
int GetID (void)
 Get the local id;.
bool operator< (const Node &pSrc)
 Define node ordering based on ID.
bool operator== (const Node &pSrc)
 Define node equality based on coordinate.
Node operator+ (const Node &pSrc) const
Node operator- (const Node &pSrc) const
Node operator* (const Node &pSrc) const
Node operator* (const NekDouble &alpha) const
Node operator/ (const NekDouble &alpha) const
void operator+= (const Node &pSrc)
void operator*= (const NekDouble &alpha)
void operator/= (const NekDouble &alpha)
NekDouble abs2 () const
NekDouble dot (const Node &pSrc) const
Node curl (const Node &pSrc) const
SpatialDomains::PointGeomSharedPtr GetGeom (int coordDim)
 Generate a SpatialDomains::PointGeom for this node.

Public Attributes

int m_id
 ID of node.
NekDouble m_x
 X-coordinate.
NekDouble m_y
 Y-coordinate.
NekDouble m_z
 Z-coordinate.

Private Attributes

SpatialDomains::PointGeomSharedPtr m_geom

Detailed Description

Represents a point in the domain.

Such points may either be element vertices, or simply control points on high-order edges/faces, although this information is not contained within this class.

Definition at line 74 of file MeshElements.h.

Constructor & Destructor Documentation

Nektar::Utilities::Node::Node ( int  pId,
NekDouble  pX,
NekDouble  pY,
NekDouble  pZ 
)
inline

Create a new node at a specified coordinate.

Definition at line 77 of file MeshElements.h.

: m_id(pId), m_x(pX), m_y(pY), m_z(pZ), m_geom() {}
Nektar::Utilities::Node::Node ( const Node pSrc)
inline

Copy an existing node.

Definition at line 80 of file MeshElements.h.

: m_id(pSrc.m_id), m_x(pSrc.m_x), m_y(pSrc.m_y),
m_z(pSrc.m_z), m_geom() {}
Nektar::Utilities::Node::Node ( )
inline

Definition at line 83 of file MeshElements.h.

Referenced by curl(), operator*(), operator+(), operator-(), and operator/().

: m_id(0), m_x(0.0), m_y(0.0), m_z(0.0), m_geom() {}
Nektar::Utilities::Node::~Node ( )
inline

Definition at line 84 of file MeshElements.h.

{}

Member Function Documentation

NekDouble Nektar::Utilities::Node::abs2 ( ) const
inline
Node Nektar::Utilities::Node::curl ( const Node pSrc) const
inline

Definition at line 166 of file MeshElements.h.

References m_id, m_x, m_y, m_z, and Node().

Referenced by Nektar::Utilities::InputTec::SortEdgeNodes(), and Nektar::Utilities::InputTec::SortFaceNodes().

{
return Node(m_id, m_y*pSrc.m_z - m_z*pSrc.m_y,
m_z*pSrc.m_x-m_x*pSrc.m_z, m_x*pSrc.m_y-m_y*pSrc.m_x);
}
NekDouble Nektar::Utilities::Node::dot ( const Node pSrc) const
inline

Definition at line 160 of file MeshElements.h.

References m_x, m_y, and m_z.

Referenced by Nektar::Utilities::ProcessSpherigon::Process(), Nektar::Utilities::InputTec::SortEdgeNodes(), and Nektar::Utilities::InputTec::SortFaceNodes().

{
return m_x*pSrc.m_x + m_y*pSrc.m_y + m_z*pSrc.m_z;
}
SpatialDomains::PointGeomSharedPtr Nektar::Utilities::Node::GetGeom ( int  coordDim)
inline

Generate a SpatialDomains::PointGeom for this node.

Definition at line 173 of file MeshElements.h.

References m_id, m_x, m_y, and m_z.

{
MemoryManager<SpatialDomains::PointGeom>
::AllocateSharedPtr(coordDim,m_id,m_x,m_y,m_z);
return ret;
}
int Nektar::Utilities::Node::GetID ( void  )
inline

Get the local id;.

Definition at line 93 of file MeshElements.h.

References m_id.

{
return m_id;
}
Node Nektar::Utilities::Node::operator* ( const Node pSrc) const
inline

Definition at line 119 of file MeshElements.h.

References m_id, m_x, m_y, m_z, and Node().

{
return Node(m_id, m_x*pSrc.m_x, m_y*pSrc.m_y, m_z*pSrc.m_z);
}
Node Nektar::Utilities::Node::operator* ( const NekDouble alpha) const
inline

Definition at line 124 of file MeshElements.h.

References m_id, m_x, m_y, m_z, and Node().

{
return Node(m_id, alpha*m_x, alpha*m_y, alpha*m_z);
}
void Nektar::Utilities::Node::operator*= ( const NekDouble alpha)
inline

Definition at line 141 of file MeshElements.h.

References m_x, m_y, and m_z.

{
m_x *= alpha;
m_y *= alpha;
m_z *= alpha;
}
Node Nektar::Utilities::Node::operator+ ( const Node pSrc) const
inline

Definition at line 109 of file MeshElements.h.

References m_id, m_x, m_y, m_z, and Node().

{
return Node(m_id, m_x+pSrc.m_x, m_y+pSrc.m_y, m_z+pSrc.m_z);
}
void Nektar::Utilities::Node::operator+= ( const Node pSrc)
inline

Definition at line 134 of file MeshElements.h.

References m_x, m_y, and m_z.

{
m_x += pSrc.m_x;
m_y += pSrc.m_y;
m_z += pSrc.m_z;
}
Node Nektar::Utilities::Node::operator- ( const Node pSrc) const
inline

Definition at line 114 of file MeshElements.h.

References m_id, m_x, m_y, m_z, and Node().

{
return Node(m_id, m_x-pSrc.m_x, m_y-pSrc.m_y, m_z-pSrc.m_z);
}
Node Nektar::Utilities::Node::operator/ ( const NekDouble alpha) const
inline

Definition at line 129 of file MeshElements.h.

References m_id, m_x, m_y, m_z, and Node().

{
return Node(m_id, m_x/alpha, m_y/alpha, m_z/alpha);
}
void Nektar::Utilities::Node::operator/= ( const NekDouble alpha)
inline

Definition at line 148 of file MeshElements.h.

References m_x, m_y, and m_z.

{
m_x /= alpha;
m_y /= alpha;
m_z /= alpha;
}
bool Nektar::Utilities::Node::operator< ( const Node pSrc)
inline

Define node ordering based on ID.

Definition at line 99 of file MeshElements.h.

References m_id.

{
return (m_id < pSrc.m_id);
}
bool Nektar::Utilities::Node::operator== ( const Node pSrc)
inline

Define node equality based on coordinate.

Definition at line 104 of file MeshElements.h.

References m_x, m_y, and m_z.

{
return m_x == pSrc.m_x && m_y == pSrc.m_y && m_z == pSrc.m_z;
}
void Nektar::Utilities::Node::SetID ( int  pId)
inline

Reset the local id;.

Definition at line 87 of file MeshElements.h.

References m_id.

{
m_id = pId;
}

Member Data Documentation

SpatialDomains::PointGeomSharedPtr Nektar::Utilities::Node::m_geom
private

Definition at line 192 of file MeshElements.h.

int Nektar::Utilities::Node::m_id
NekDouble Nektar::Utilities::Node::m_x
NekDouble Nektar::Utilities::Node::m_y
NekDouble Nektar::Utilities::Node::m_z