Nektar++
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. More...
 
 Node (const Node &pSrc)
 Copy an existing node. More...
 
 Node ()
 
 ~Node ()
 
void SetID (int pId)
 Reset the local id;. More...
 
int GetID (void)
 Get the local id;. More...
 
bool operator< (const Node &pSrc)
 Define node ordering based on ID. More...
 
bool operator== (const Node &pSrc)
 Define node equality based on coordinate. More...
 
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. More...
 

Public Attributes

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

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.

78  : m_id(pId), m_x(pX), m_y(pY), m_z(pZ), m_geom() {}
SpatialDomains::PointGeomSharedPtr m_geom
Definition: MeshElements.h:192
NekDouble m_x
X-coordinate.
Definition: MeshElements.h:185
int m_id
ID of node.
Definition: MeshElements.h:183
NekDouble m_y
Y-coordinate.
Definition: MeshElements.h:187
NekDouble m_z
Z-coordinate.
Definition: MeshElements.h:189
Nektar::Utilities::Node::Node ( const Node pSrc)
inline

Copy an existing node.

Definition at line 80 of file MeshElements.h.

81  : m_id(pSrc.m_id), m_x(pSrc.m_x), m_y(pSrc.m_y),
82  m_z(pSrc.m_z), m_geom() {}
SpatialDomains::PointGeomSharedPtr m_geom
Definition: MeshElements.h:192
NekDouble m_x
X-coordinate.
Definition: MeshElements.h:185
int m_id
ID of node.
Definition: MeshElements.h:183
NekDouble m_y
Y-coordinate.
Definition: MeshElements.h:187
NekDouble m_z
Z-coordinate.
Definition: MeshElements.h:189
Nektar::Utilities::Node::Node ( )
inline

Definition at line 83 of file MeshElements.h.

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

83 : m_id(0), m_x(0.0), m_y(0.0), m_z(0.0), m_geom() {}
SpatialDomains::PointGeomSharedPtr m_geom
Definition: MeshElements.h:192
NekDouble m_x
X-coordinate.
Definition: MeshElements.h:185
int m_id
ID of node.
Definition: MeshElements.h:183
NekDouble m_y
Y-coordinate.
Definition: MeshElements.h:187
NekDouble m_z
Z-coordinate.
Definition: MeshElements.h:189
Nektar::Utilities::Node::~Node ( )
inline

Definition at line 84 of file MeshElements.h.

84 {}

Member Function Documentation

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

Definition at line 155 of file MeshElements.h.

References m_x, m_y, and m_z.

Referenced by Nektar::Utilities::ProcessSpherigon::GenerateNormals(), Nektar::Utilities::ProcessPerAlign::Process(), and Nektar::Utilities::ProcessSpherigon::Process().

156  {
157  return m_x*m_x+m_y*m_y+m_z*m_z;
158  }
NekDouble m_x
X-coordinate.
Definition: MeshElements.h:185
NekDouble m_y
Y-coordinate.
Definition: MeshElements.h:187
NekDouble m_z
Z-coordinate.
Definition: MeshElements.h:189
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::InputStar::SortEdgeNodes(), Nektar::Utilities::InputTec::SortEdgeNodes(), Nektar::Utilities::InputStar::SortFaceNodes(), and Nektar::Utilities::InputTec::SortFaceNodes().

167  {
168  return Node(m_id, m_y*pSrc.m_z - m_z*pSrc.m_y,
169  m_z*pSrc.m_x-m_x*pSrc.m_z, m_x*pSrc.m_y-m_y*pSrc.m_x);
170  }
NekDouble m_x
X-coordinate.
Definition: MeshElements.h:185
int m_id
ID of node.
Definition: MeshElements.h:183
NekDouble m_y
Y-coordinate.
Definition: MeshElements.h:187
NekDouble m_z
Z-coordinate.
Definition: MeshElements.h:189
NekDouble Nektar::Utilities::Node::dot ( const Node pSrc) const
inline
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 Nektar::MemoryManager< DataType >::AllocateSharedPtr(), m_id, m_x, m_y, and m_z.

174  {
178 
179  return ret;
180  }
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
NekDouble m_x
X-coordinate.
Definition: MeshElements.h:185
int m_id
ID of node.
Definition: MeshElements.h:183
NekDouble m_y
Y-coordinate.
Definition: MeshElements.h:187
NekDouble m_z
Z-coordinate.
Definition: MeshElements.h:189
boost::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:60
int Nektar::Utilities::Node::GetID ( void  )
inline

Get the local id;.

Definition at line 93 of file MeshElements.h.

References m_id.

94  {
95  return m_id;
96  }
int m_id
ID of node.
Definition: MeshElements.h:183
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().

120  {
121  return Node(m_id, m_x*pSrc.m_x, m_y*pSrc.m_y, m_z*pSrc.m_z);
122  }
NekDouble m_x
X-coordinate.
Definition: MeshElements.h:185
int m_id
ID of node.
Definition: MeshElements.h:183
NekDouble m_y
Y-coordinate.
Definition: MeshElements.h:187
NekDouble m_z
Z-coordinate.
Definition: MeshElements.h:189
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().

125  {
126  return Node(m_id, alpha*m_x, alpha*m_y, alpha*m_z);
127  }
NekDouble m_x
X-coordinate.
Definition: MeshElements.h:185
int m_id
ID of node.
Definition: MeshElements.h:183
NekDouble m_y
Y-coordinate.
Definition: MeshElements.h:187
NekDouble m_z
Z-coordinate.
Definition: MeshElements.h:189
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.

142  {
143  m_x *= alpha;
144  m_y *= alpha;
145  m_z *= alpha;
146  }
NekDouble m_x
X-coordinate.
Definition: MeshElements.h:185
NekDouble m_y
Y-coordinate.
Definition: MeshElements.h:187
NekDouble m_z
Z-coordinate.
Definition: MeshElements.h:189
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().

110  {
111  return Node(m_id, m_x+pSrc.m_x, m_y+pSrc.m_y, m_z+pSrc.m_z);
112  }
NekDouble m_x
X-coordinate.
Definition: MeshElements.h:185
int m_id
ID of node.
Definition: MeshElements.h:183
NekDouble m_y
Y-coordinate.
Definition: MeshElements.h:187
NekDouble m_z
Z-coordinate.
Definition: MeshElements.h:189
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.

135  {
136  m_x += pSrc.m_x;
137  m_y += pSrc.m_y;
138  m_z += pSrc.m_z;
139  }
NekDouble m_x
X-coordinate.
Definition: MeshElements.h:185
NekDouble m_y
Y-coordinate.
Definition: MeshElements.h:187
NekDouble m_z
Z-coordinate.
Definition: MeshElements.h:189
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().

115  {
116  return Node(m_id, m_x-pSrc.m_x, m_y-pSrc.m_y, m_z-pSrc.m_z);
117  }
NekDouble m_x
X-coordinate.
Definition: MeshElements.h:185
int m_id
ID of node.
Definition: MeshElements.h:183
NekDouble m_y
Y-coordinate.
Definition: MeshElements.h:187
NekDouble m_z
Z-coordinate.
Definition: MeshElements.h:189
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().

130  {
131  return Node(m_id, m_x/alpha, m_y/alpha, m_z/alpha);
132  }
NekDouble m_x
X-coordinate.
Definition: MeshElements.h:185
int m_id
ID of node.
Definition: MeshElements.h:183
NekDouble m_y
Y-coordinate.
Definition: MeshElements.h:187
NekDouble m_z
Z-coordinate.
Definition: MeshElements.h:189
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.

149  {
150  m_x /= alpha;
151  m_y /= alpha;
152  m_z /= alpha;
153  }
NekDouble m_x
X-coordinate.
Definition: MeshElements.h:185
NekDouble m_y
Y-coordinate.
Definition: MeshElements.h:187
NekDouble m_z
Z-coordinate.
Definition: MeshElements.h:189
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.

100  {
101  return (m_id < pSrc.m_id);
102  }
int m_id
ID of node.
Definition: MeshElements.h:183
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.

105  {
106  return m_x == pSrc.m_x && m_y == pSrc.m_y && m_z == pSrc.m_z;
107  }
NekDouble m_x
X-coordinate.
Definition: MeshElements.h:185
NekDouble m_y
Y-coordinate.
Definition: MeshElements.h:187
NekDouble m_z
Z-coordinate.
Definition: MeshElements.h:189
void Nektar::Utilities::Node::SetID ( int  pId)
inline

Reset the local id;.

Definition at line 87 of file MeshElements.h.

References m_id.

88  {
89  m_id = pId;
90  }
int m_id
ID of node.
Definition: MeshElements.h:183

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