Nektar++
Public Member Functions | Public Attributes | Private Attributes | List of all members
Nektar::NekMeshUtils::Node Class Reference

Represents a point in the domain. More...

#include <Node.h>

Public Member Functions

NEKMESHUTILS_EXPORT Node (int pId, NekDouble pX, NekDouble pY, NekDouble pZ)
 Create a new node at a specified coordinate. More...
 
NEKMESHUTILS_EXPORT Node ()
 Copy an existing node. More...
 
NEKMESHUTILS_EXPORT ~Node ()
 
NEKMESHUTILS_EXPORT void SetID (int pId)
 Reset the local id;. More...
 
NEKMESHUTILS_EXPORT int GetID (void)
 Get the local id;. More...
 
NEKMESHUTILS_EXPORT bool operator< (const Node &pSrc)
 Define node ordering based on ID. More...
 
NEKMESHUTILS_EXPORT bool operator== (const Node &pSrc)
 Define node equality based on coordinate. More...
 
NEKMESHUTILS_EXPORT Node operator+ (const Node &pSrc) const
 
NEKMESHUTILS_EXPORT Node operator- (const Node &pSrc) const
 
NEKMESHUTILS_EXPORT Node operator* (const Node &pSrc) const
 
NEKMESHUTILS_EXPORT Node operator* (const NekDouble &alpha) const
 
NEKMESHUTILS_EXPORT Node operator/ (const NekDouble &alpha) const
 
NEKMESHUTILS_EXPORT void operator+= (const Node &pSrc)
 
NEKMESHUTILS_EXPORT void operator*= (const NekDouble &alpha)
 
NEKMESHUTILS_EXPORT void operator/= (const NekDouble &alpha)
 
NEKMESHUTILS_EXPORT NodeSharedPtr copy ()
 
NEKMESHUTILS_EXPORT NekDouble abs2 () const
 
NEKMESHUTILS_EXPORT NekDouble dot (const Node &pSrc) const
 
NEKMESHUTILS_EXPORT Node curl (const Node &pSrc) const
 
NEKMESHUTILS_EXPORT Array< OneD, NekDoubleGetLoc ()
 
NEKMESHUTILS_EXPORT SpatialDomains::PointGeomSharedPtr GetGeom (int coordDim)
 Generate a SpatialDomains::PointGeom for this node. More...
 
NEKMESHUTILS_EXPORT NekDouble Distance (NodeSharedPtr &p)
 
NEKMESHUTILS_EXPORT NekDouble Angle (NodeSharedPtr &a, NodeSharedPtr &b)
 
void SetCADCurve (CADCurveSharedPtr c, NekDouble t)
 
void SetCADSurf (CADSurfSharedPtr s, Array< OneD, NekDouble > uv)
 
NekDouble GetCADCurveInfo (int i)
 
Array< OneD, NekDoubleGetCADSurfInfo (int i)
 
std::vector< CADCurveSharedPtrGetCADCurves ()
 
std::vector< CADSurfSharedPtrGetCADSurfs ()
 
int GetNumCadCurve ()
 
int GetNumCADSurf ()
 
void Move (Array< OneD, NekDouble > l, int s, Array< OneD, NekDouble > uv)
 
void Move (NekDouble x, NekDouble y, NekDouble z, int s, Array< OneD, NekDouble > uv)
 
void Move (Array< OneD, NekDouble > l, int c, NekDouble t)
 
void Move (NekDouble x, NekDouble y, NekDouble z, int c, NekDouble t)
 
void Rotate (std::string dir, NekDouble angle)
 
NekDouble Angle (Array< OneD, NekDouble > locA, Array< OneD, NekDouble > locB, Array< OneD, NekDouble > N)
 

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...
 
std::map< int, std::pair< CADCurveSharedPtr, NekDouble > > CADCurveList
 list of cadcurves the node lies on More...
 
std::map< int, std::pair< CADSurfSharedPtr, Array< OneD, NekDouble > > > CADSurfList
 list of cadsurfs the node lies on 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 62 of file Node.h.

Constructor & Destructor Documentation

◆ Node() [1/2]

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

Create a new node at a specified coordinate.

Definition at line 66 of file Node.h.

67  : m_id(pId), m_x(pX), m_y(pY), m_z(pZ), m_geom()
68  {
69  }
NekDouble m_y
Y-coordinate.
Definition: Node.h:410
int m_id
ID of node.
Definition: Node.h:406
NekDouble m_x
X-coordinate.
Definition: Node.h:408
NekDouble m_z
Z-coordinate.
Definition: Node.h:412
SpatialDomains::PointGeomSharedPtr m_geom
Definition: Node.h:421

◆ Node() [2/2]

NEKMESHUTILS_EXPORT Nektar::NekMeshUtils::Node::Node ( )
inline

Copy an existing node.

create an empty node

Definition at line 75 of file Node.h.

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

75  : m_id(0), m_x(0.0), m_y(0.0), m_z(0.0), m_geom()
76  {
77  }
NekDouble m_y
Y-coordinate.
Definition: Node.h:410
int m_id
ID of node.
Definition: Node.h:406
NekDouble m_x
X-coordinate.
Definition: Node.h:408
NekDouble m_z
Z-coordinate.
Definition: Node.h:412
SpatialDomains::PointGeomSharedPtr m_geom
Definition: Node.h:421

◆ ~Node()

NEKMESHUTILS_EXPORT Nektar::NekMeshUtils::Node::~Node ( )
inline

Definition at line 78 of file Node.h.

79  {
80  }

Member Function Documentation

◆ abs2()

NEKMESHUTILS_EXPORT NekDouble Nektar::NekMeshUtils::Node::abs2 ( ) const
inline

Definition at line 156 of file Node.h.

References m_x, m_y, and m_z.

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

157  {
158  return m_x * m_x + m_y * m_y + m_z * m_z;
159  }
NekDouble m_y
Y-coordinate.
Definition: Node.h:410
NekDouble m_x
X-coordinate.
Definition: Node.h:408
NekDouble m_z
Z-coordinate.
Definition: Node.h:412

◆ Angle() [1/2]

NEKMESHUTILS_EXPORT NekDouble Nektar::NekMeshUtils::Node::Angle ( NodeSharedPtr a,
NodeSharedPtr b 
)
inline

Definition at line 199 of file Node.h.

References m_x, m_y, and m_z.

200  {
201  Array<OneD, NekDouble> va(3), vb(3), cn(3);
202  va[0] = a->m_x - m_x;
203  va[1] = a->m_y - m_y;
204  va[2] = a->m_z - m_z;
205  vb[0] = b->m_x - m_x;
206  vb[1] = b->m_y - m_y;
207  vb[2] = b->m_z - m_z;
208 
209  NekDouble lva = sqrt(va[0] * va[0] + va[1] * va[1] + va[2] * va[2]);
210  NekDouble lvb = sqrt(vb[0] * vb[0] + vb[1] * vb[1] + vb[2] * vb[2]);
211 
212  NekDouble aw = 1.0 / (lva * lvb);
213 
214  NekDouble cosw = (va[0] * vb[0] + va[1] * vb[1] + va[2] * vb[2]) * aw;
215 
216  cn[0] = vb[1] * va[2] - vb[2] * va[1];
217  cn[1] = vb[2] * va[0] - vb[0] * va[2];
218  cn[2] = vb[0] * va[1] - vb[1] * va[0];
219 
220  NekDouble lcn = sqrt(cn[0] * cn[0] + cn[1] * cn[1] + cn[2] * cn[2]);
221 
222  NekDouble sinw = aw * lcn;
223 
224  NekDouble an = atan2(sinw, cosw);
225 
226  if (an < 0)
227  an += 6.2831853071796;
228 
229  return an;
230  }
NekDouble m_y
Y-coordinate.
Definition: Node.h:410
double NekDouble
NekDouble m_x
X-coordinate.
Definition: Node.h:408
NekDouble m_z
Z-coordinate.
Definition: Node.h:412

◆ Angle() [2/2]

NekDouble Nektar::NekMeshUtils::Node::Angle ( Array< OneD, NekDouble locA,
Array< OneD, NekDouble locB,
Array< OneD, NekDouble N 
)
inline

Definition at line 371 of file Node.h.

References Nektar::LibUtilities::ang(), dot(), m_x, m_y, and m_z.

373  {
374  // calculates the angle between this node to a to this node to b
375  // Uses the CAD surface to orientate the angle
376  Array<OneD, NekDouble> A(3), B(3), CP(3);
377  A[0] = locA[0] - m_x;
378  A[1] = locA[1] - m_y;
379  A[2] = locA[2] - m_z;
380  B[0] = locB[0] - m_x;
381  B[1] = locB[1] - m_y;
382  B[2] = locB[2] - m_z;
383 
384  CP[0] = A[1] * B[2] - A[2] * B[1];
385  CP[1] = -1.0 * (A[0] * B[2] - A[2] * B[0]);
386  CP[2] = A[0] * B[1] - A[1] * B[0];
387 
388  NekDouble ang = sqrt(CP[0] * CP[0] + CP[1] * CP[1] + CP[2] * CP[2]);
389 
390  ang /= sqrt(A[0] * A[0] + A[1] * A[1] + A[2] * A[2]);
391  ang /= sqrt(B[0] * B[0] + B[1] * B[1] + B[2] * B[2]);
392 
393  NekDouble dot = N[0] * CP[0] + N[1] * CP[1] + N[2] * CP[2];
394 
395  ang = asin(ang);
396 
397  if (dot < 0.0)
398  {
399  ang = 2.0 * M_PI - ang;
400  }
401 
402  return ang;
403  }
static NekDouble ang(NekDouble x, NekDouble y)
Definition: Interpreter.cpp:91
NekDouble m_y
Y-coordinate.
Definition: Node.h:410
NEKMESHUTILS_EXPORT NekDouble dot(const Node &pSrc) const
Definition: Node.h:161
double NekDouble
NekDouble m_x
X-coordinate.
Definition: Node.h:408
NekDouble m_z
Z-coordinate.
Definition: Node.h:412

◆ copy()

NEKMESHUTILS_EXPORT NodeSharedPtr Nektar::NekMeshUtils::Node::copy ( )
inline

Definition at line 151 of file Node.h.

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

152  {
153  return std::shared_ptr<Node>(new Node(m_id, m_x, m_y, m_z));
154  }
NekDouble m_y
Y-coordinate.
Definition: Node.h:410
int m_id
ID of node.
Definition: Node.h:406
NEKMESHUTILS_EXPORT Node()
Copy an existing node.
Definition: Node.h:75
NekDouble m_x
X-coordinate.
Definition: Node.h:408
NekDouble m_z
Z-coordinate.
Definition: Node.h:412

◆ curl()

NEKMESHUTILS_EXPORT Node Nektar::NekMeshUtils::Node::curl ( const Node pSrc) const
inline

Definition at line 166 of file Node.h.

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

Referenced by Nektar::NekMeshUtils::Generator2D::MakeBL(), Nektar::Utilities::InputTec::SortEdgeNodes(), Nektar::Utilities::InputStar::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,
170  m_x * pSrc.m_y - m_y * pSrc.m_x);
171  }
NekDouble m_y
Y-coordinate.
Definition: Node.h:410
int m_id
ID of node.
Definition: Node.h:406
NEKMESHUTILS_EXPORT Node()
Copy an existing node.
Definition: Node.h:75
NekDouble m_x
X-coordinate.
Definition: Node.h:408
NekDouble m_z
Z-coordinate.
Definition: Node.h:412

◆ Distance()

NEKMESHUTILS_EXPORT NekDouble Nektar::NekMeshUtils::Node::Distance ( NodeSharedPtr p)
inline

Definition at line 192 of file Node.h.

References m_x, m_y, and m_z.

193  {
194  return sqrt((m_x - p->m_x) * (m_x - p->m_x) +
195  (m_y - p->m_y) * (m_y - p->m_y) +
196  (m_z - p->m_z) * (m_z - p->m_z));
197  }
NekDouble m_y
Y-coordinate.
Definition: Node.h:410
NekDouble m_x
X-coordinate.
Definition: Node.h:408
NekDouble m_z
Z-coordinate.
Definition: Node.h:412

◆ dot()

NEKMESHUTILS_EXPORT NekDouble Nektar::NekMeshUtils::Node::dot ( const Node pSrc) const
inline

◆ GetCADCurveInfo()

NekDouble Nektar::NekMeshUtils::Node::GetCADCurveInfo ( int  i)
inline

Definition at line 256 of file Node.h.

References ASSERTL0, and CADCurveList.

257  {
258  auto search = CADCurveList.find(i);
259  ASSERTL0(search != CADCurveList.end(), "node not on this curve");
260 
261  return search->second.second;
262  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
std::map< int, std::pair< CADCurveSharedPtr, NekDouble > > CADCurveList
list of cadcurves the node lies on
Definition: Node.h:415

◆ GetCADCurves()

std::vector<CADCurveSharedPtr> Nektar::NekMeshUtils::Node::GetCADCurves ( )
inline

Definition at line 272 of file Node.h.

References CADCurveList.

273  {
274  std::vector<CADCurveSharedPtr> lst;
275  for (auto &c : CADCurveList)
276  {
277  lst.push_back(c.second.first);
278  }
279  return lst;
280  }
std::map< int, std::pair< CADCurveSharedPtr, NekDouble > > CADCurveList
list of cadcurves the node lies on
Definition: Node.h:415

◆ GetCADSurfInfo()

Array<OneD, NekDouble> Nektar::NekMeshUtils::Node::GetCADSurfInfo ( int  i)
inline

Definition at line 264 of file Node.h.

References ASSERTL0, and CADSurfList.

265  {
266  auto search = CADSurfList.find(i);
267  ASSERTL0(search != CADSurfList.end(), "surface not found");
268 
269  return search->second.second;
270  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
std::map< int, std::pair< CADSurfSharedPtr, Array< OneD, NekDouble > > > CADSurfList
list of cadsurfs the node lies on
Definition: Node.h:418

◆ GetCADSurfs()

std::vector<CADSurfSharedPtr> Nektar::NekMeshUtils::Node::GetCADSurfs ( )
inline

Definition at line 282 of file Node.h.

References CADSurfList.

283  {
284  std::vector<CADSurfSharedPtr> lst;
285  for (auto &s : CADSurfList)
286  {
287  lst.push_back(s.second.first);
288  }
289  return lst;
290  }
std::map< int, std::pair< CADSurfSharedPtr, Array< OneD, NekDouble > > > CADSurfList
list of cadsurfs the node lies on
Definition: Node.h:418

◆ GetGeom()

NEKMESHUTILS_EXPORT SpatialDomains::PointGeomSharedPtr Nektar::NekMeshUtils::Node::GetGeom ( int  coordDim)
inline

Generate a SpatialDomains::PointGeom for this node.

Definition at line 183 of file Node.h.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), m_id, m_x, m_y, and m_z.

184  {
187  coordDim, m_id, m_x, m_y, m_z);
188 
189  return ret;
190  }
NekDouble m_y
Y-coordinate.
Definition: Node.h:410
int m_id
ID of node.
Definition: Node.h:406
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:59
NekDouble m_x
X-coordinate.
Definition: Node.h:408
NekDouble m_z
Z-coordinate.
Definition: Node.h:412

◆ GetID()

NEKMESHUTILS_EXPORT int Nektar::NekMeshUtils::Node::GetID ( void  )
inline

Get the local id;.

Definition at line 89 of file Node.h.

References m_id.

90  {
91  return m_id;
92  }
int m_id
ID of node.
Definition: Node.h:406

◆ GetLoc()

NEKMESHUTILS_EXPORT Array<OneD, NekDouble> Nektar::NekMeshUtils::Node::GetLoc ( )
inline

Definition at line 173 of file Node.h.

References m_x, m_y, and m_z.

174  {
175  Array<OneD, NekDouble> out(3);
176  out[0] = m_x;
177  out[1] = m_y;
178  out[2] = m_z;
179  return out;
180  }
NekDouble m_y
Y-coordinate.
Definition: Node.h:410
NekDouble m_x
X-coordinate.
Definition: Node.h:408
NekDouble m_z
Z-coordinate.
Definition: Node.h:412

◆ GetNumCadCurve()

int Nektar::NekMeshUtils::Node::GetNumCadCurve ( )
inline

Definition at line 292 of file Node.h.

References CADCurveList.

293  {
294  return CADCurveList.size();
295  }
std::map< int, std::pair< CADCurveSharedPtr, NekDouble > > CADCurveList
list of cadcurves the node lies on
Definition: Node.h:415

◆ GetNumCADSurf()

int Nektar::NekMeshUtils::Node::GetNumCADSurf ( )
inline

Definition at line 297 of file Node.h.

References CADSurfList.

298  {
299  return CADSurfList.size();
300  }
std::map< int, std::pair< CADSurfSharedPtr, Array< OneD, NekDouble > > > CADSurfList
list of cadsurfs the node lies on
Definition: Node.h:418

◆ Move() [1/4]

void Nektar::NekMeshUtils::Node::Move ( Array< OneD, NekDouble l,
int  s,
Array< OneD, NekDouble uv 
)
inline

Definition at line 302 of file Node.h.

References CADSurfList, m_x, m_y, m_z, and SetCADSurf().

303  {
304  m_x = l[0];
305  m_y = l[1];
306  m_z = l[2];
307  CADSurfSharedPtr su = CADSurfList[s].first;
308  SetCADSurf(su, uv);
309  }
std::shared_ptr< CADSurf > CADSurfSharedPtr
Definition: CADCurve.h:51
NekDouble m_y
Y-coordinate.
Definition: Node.h:410
void SetCADSurf(CADSurfSharedPtr s, Array< OneD, NekDouble > uv)
Definition: Node.h:245
std::map< int, std::pair< CADSurfSharedPtr, Array< OneD, NekDouble > > > CADSurfList
list of cadsurfs the node lies on
Definition: Node.h:418
NekDouble m_x
X-coordinate.
Definition: Node.h:408
NekDouble m_z
Z-coordinate.
Definition: Node.h:412

◆ Move() [2/4]

void Nektar::NekMeshUtils::Node::Move ( NekDouble  x,
NekDouble  y,
NekDouble  z,
int  s,
Array< OneD, NekDouble uv 
)
inline

Definition at line 311 of file Node.h.

References CADSurfList, m_x, m_y, m_z, and SetCADSurf().

313  {
314  m_x = x;
315  m_y = y;
316  m_z = z;
317  CADSurfSharedPtr su = CADSurfList[s].first;
318  SetCADSurf(su, uv);
319  }
std::shared_ptr< CADSurf > CADSurfSharedPtr
Definition: CADCurve.h:51
NekDouble m_y
Y-coordinate.
Definition: Node.h:410
void SetCADSurf(CADSurfSharedPtr s, Array< OneD, NekDouble > uv)
Definition: Node.h:245
std::map< int, std::pair< CADSurfSharedPtr, Array< OneD, NekDouble > > > CADSurfList
list of cadsurfs the node lies on
Definition: Node.h:418
NekDouble m_x
X-coordinate.
Definition: Node.h:408
NekDouble m_z
Z-coordinate.
Definition: Node.h:412

◆ Move() [3/4]

void Nektar::NekMeshUtils::Node::Move ( Array< OneD, NekDouble l,
int  c,
NekDouble  t 
)
inline

Definition at line 321 of file Node.h.

References CADCurveList, m_x, m_y, m_z, and SetCADCurve().

322  {
323  m_x = l[0];
324  m_y = l[1];
325  m_z = l[2];
326  CADCurveSharedPtr cu = CADCurveList[c].first;
327  SetCADCurve(cu, t);
328  }
NekDouble m_y
Y-coordinate.
Definition: Node.h:410
void SetCADCurve(CADCurveSharedPtr c, NekDouble t)
Definition: Node.h:234
std::shared_ptr< CADCurve > CADCurveSharedPtr
Definition: CADCurve.h:219
NekDouble m_x
X-coordinate.
Definition: Node.h:408
std::map< int, std::pair< CADCurveSharedPtr, NekDouble > > CADCurveList
list of cadcurves the node lies on
Definition: Node.h:415
NekDouble m_z
Z-coordinate.
Definition: Node.h:412

◆ Move() [4/4]

void Nektar::NekMeshUtils::Node::Move ( NekDouble  x,
NekDouble  y,
NekDouble  z,
int  c,
NekDouble  t 
)
inline

Definition at line 330 of file Node.h.

References CADCurveList, m_x, m_y, m_z, and SetCADCurve().

331  {
332  m_x = x;
333  m_y = y;
334  m_z = z;
335  CADCurveSharedPtr cu = CADCurveList[c].first;
336  SetCADCurve(cu, t);
337  }
NekDouble m_y
Y-coordinate.
Definition: Node.h:410
void SetCADCurve(CADCurveSharedPtr c, NekDouble t)
Definition: Node.h:234
std::shared_ptr< CADCurve > CADCurveSharedPtr
Definition: CADCurve.h:219
NekDouble m_x
X-coordinate.
Definition: Node.h:408
std::map< int, std::pair< CADCurveSharedPtr, NekDouble > > CADCurveList
list of cadcurves the node lies on
Definition: Node.h:415
NekDouble m_z
Z-coordinate.
Definition: Node.h:412

◆ operator*() [1/2]

NEKMESHUTILS_EXPORT Node Nektar::NekMeshUtils::Node::operator* ( const Node pSrc) const
inline

Definition at line 115 of file Node.h.

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

116  {
117  return Node(m_id, m_x * pSrc.m_x, m_y * pSrc.m_y, m_z * pSrc.m_z);
118  }
NekDouble m_y
Y-coordinate.
Definition: Node.h:410
int m_id
ID of node.
Definition: Node.h:406
NEKMESHUTILS_EXPORT Node()
Copy an existing node.
Definition: Node.h:75
NekDouble m_x
X-coordinate.
Definition: Node.h:408
NekDouble m_z
Z-coordinate.
Definition: Node.h:412

◆ operator*() [2/2]

NEKMESHUTILS_EXPORT Node Nektar::NekMeshUtils::Node::operator* ( const NekDouble alpha) const
inline

Definition at line 120 of file Node.h.

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

121  {
122  return Node(m_id, alpha * m_x, alpha * m_y, alpha * m_z);
123  }
NekDouble m_y
Y-coordinate.
Definition: Node.h:410
int m_id
ID of node.
Definition: Node.h:406
NEKMESHUTILS_EXPORT Node()
Copy an existing node.
Definition: Node.h:75
NekDouble m_x
X-coordinate.
Definition: Node.h:408
NekDouble m_z
Z-coordinate.
Definition: Node.h:412

◆ operator*=()

NEKMESHUTILS_EXPORT void Nektar::NekMeshUtils::Node::operator*= ( const NekDouble alpha)
inline

Definition at line 137 of file Node.h.

References m_x, m_y, and m_z.

138  {
139  m_x *= alpha;
140  m_y *= alpha;
141  m_z *= alpha;
142  }
NekDouble m_y
Y-coordinate.
Definition: Node.h:410
NekDouble m_x
X-coordinate.
Definition: Node.h:408
NekDouble m_z
Z-coordinate.
Definition: Node.h:412

◆ operator+()

NEKMESHUTILS_EXPORT Node Nektar::NekMeshUtils::Node::operator+ ( const Node pSrc) const
inline

Definition at line 105 of file Node.h.

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

106  {
107  return Node(m_id, m_x + pSrc.m_x, m_y + pSrc.m_y, m_z + pSrc.m_z);
108  }
NekDouble m_y
Y-coordinate.
Definition: Node.h:410
int m_id
ID of node.
Definition: Node.h:406
NEKMESHUTILS_EXPORT Node()
Copy an existing node.
Definition: Node.h:75
NekDouble m_x
X-coordinate.
Definition: Node.h:408
NekDouble m_z
Z-coordinate.
Definition: Node.h:412

◆ operator+=()

NEKMESHUTILS_EXPORT void Nektar::NekMeshUtils::Node::operator+= ( const Node pSrc)
inline

Definition at line 130 of file Node.h.

References m_x, m_y, and m_z.

131  {
132  m_x += pSrc.m_x;
133  m_y += pSrc.m_y;
134  m_z += pSrc.m_z;
135  }
NekDouble m_y
Y-coordinate.
Definition: Node.h:410
NekDouble m_x
X-coordinate.
Definition: Node.h:408
NekDouble m_z
Z-coordinate.
Definition: Node.h:412

◆ operator-()

NEKMESHUTILS_EXPORT Node Nektar::NekMeshUtils::Node::operator- ( const Node pSrc) const
inline

Definition at line 110 of file Node.h.

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

111  {
112  return Node(m_id, m_x - pSrc.m_x, m_y - pSrc.m_y, m_z - pSrc.m_z);
113  }
NekDouble m_y
Y-coordinate.
Definition: Node.h:410
int m_id
ID of node.
Definition: Node.h:406
NEKMESHUTILS_EXPORT Node()
Copy an existing node.
Definition: Node.h:75
NekDouble m_x
X-coordinate.
Definition: Node.h:408
NekDouble m_z
Z-coordinate.
Definition: Node.h:412

◆ operator/()

NEKMESHUTILS_EXPORT Node Nektar::NekMeshUtils::Node::operator/ ( const NekDouble alpha) const
inline

Definition at line 125 of file Node.h.

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

126  {
127  return Node(m_id, m_x / alpha, m_y / alpha, m_z / alpha);
128  }
NekDouble m_y
Y-coordinate.
Definition: Node.h:410
int m_id
ID of node.
Definition: Node.h:406
NEKMESHUTILS_EXPORT Node()
Copy an existing node.
Definition: Node.h:75
NekDouble m_x
X-coordinate.
Definition: Node.h:408
NekDouble m_z
Z-coordinate.
Definition: Node.h:412

◆ operator/=()

NEKMESHUTILS_EXPORT void Nektar::NekMeshUtils::Node::operator/= ( const NekDouble alpha)
inline

Definition at line 144 of file Node.h.

References m_x, m_y, and m_z.

145  {
146  m_x /= alpha;
147  m_y /= alpha;
148  m_z /= alpha;
149  }
NekDouble m_y
Y-coordinate.
Definition: Node.h:410
NekDouble m_x
X-coordinate.
Definition: Node.h:408
NekDouble m_z
Z-coordinate.
Definition: Node.h:412

◆ operator<()

NEKMESHUTILS_EXPORT bool Nektar::NekMeshUtils::Node::operator< ( const Node pSrc)
inline

Define node ordering based on ID.

Definition at line 95 of file Node.h.

References m_id.

96  {
97  return (m_id < pSrc.m_id);
98  }
int m_id
ID of node.
Definition: Node.h:406

◆ operator==()

NEKMESHUTILS_EXPORT bool Nektar::NekMeshUtils::Node::operator== ( const Node pSrc)
inline

Define node equality based on coordinate.

Definition at line 100 of file Node.h.

References m_x, m_y, and m_z.

101  {
102  return m_x == pSrc.m_x && m_y == pSrc.m_y && m_z == pSrc.m_z;
103  }
NekDouble m_y
Y-coordinate.
Definition: Node.h:410
NekDouble m_x
X-coordinate.
Definition: Node.h:408
NekDouble m_z
Z-coordinate.
Definition: Node.h:412

◆ Rotate()

void Nektar::NekMeshUtils::Node::Rotate ( std::string  dir,
NekDouble  angle 
)
inline

Definition at line 339 of file Node.h.

References ASSERTL0, m_x, m_y, and m_z.

Referenced by Nektar::Utilities::ProcessPerAlign::Process().

340  {
341  if (dir == "x")
342  {
343  NekDouble yrot = cos(angle) * m_y - sin(angle) * m_z;
344  NekDouble zrot = sin(angle) * m_y + cos(angle) * m_z;
345 
346  m_y = yrot;
347  m_z = zrot;
348  }
349  else if (dir == "y")
350  {
351  NekDouble zrot = cos(angle) * m_z - sin(angle) * m_x;
352  NekDouble xrot = sin(angle) * m_z + cos(angle) * m_x;
353 
354  m_z = zrot;
355  m_x = xrot;
356  }
357  else if (dir == "z")
358  {
359  NekDouble xrot = cos(angle) * m_x - sin(angle) * m_y;
360  NekDouble yrot = sin(angle) * m_x + cos(angle) * m_y;
361 
362  m_x = xrot;
363  m_y = yrot;
364  }
365  else
366  {
367  ASSERTL0(false, "Unrecognised rotational direction: " + dir);
368  }
369  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
NekDouble m_y
Y-coordinate.
Definition: Node.h:410
double NekDouble
NekDouble m_x
X-coordinate.
Definition: Node.h:408
NekDouble m_z
Z-coordinate.
Definition: Node.h:412

◆ SetCADCurve()

void Nektar::NekMeshUtils::Node::SetCADCurve ( CADCurveSharedPtr  c,
NekDouble  t 
)
inline

Definition at line 234 of file Node.h.

References CADCurveList.

Referenced by Move().

235  {
236  auto it = CADCurveList.find(c->GetId());
237  if (it != CADCurveList.end())
238  {
239  // already in list so remove it
240  CADCurveList.erase(it);
241  }
242  CADCurveList.insert(make_pair(c->GetId(), make_pair(c, t)));
243  }
std::map< int, std::pair< CADCurveSharedPtr, NekDouble > > CADCurveList
list of cadcurves the node lies on
Definition: Node.h:415

◆ SetCADSurf()

void Nektar::NekMeshUtils::Node::SetCADSurf ( CADSurfSharedPtr  s,
Array< OneD, NekDouble uv 
)
inline

Definition at line 245 of file Node.h.

References CADSurfList.

Referenced by Move().

246  {
247  auto it = CADSurfList.find(s->GetId());
248  if (it != CADSurfList.end())
249  {
250  // already in list so remove it
251  CADSurfList.erase(it);
252  }
253  CADSurfList.insert(make_pair(s->GetId(), make_pair(s, uv)));
254  }
std::map< int, std::pair< CADSurfSharedPtr, Array< OneD, NekDouble > > > CADSurfList
list of cadsurfs the node lies on
Definition: Node.h:418

◆ SetID()

NEKMESHUTILS_EXPORT void Nektar::NekMeshUtils::Node::SetID ( int  pId)
inline

Reset the local id;.

Definition at line 83 of file Node.h.

References m_id.

84  {
85  m_id = pId;
86  }
int m_id
ID of node.
Definition: Node.h:406

Member Data Documentation

◆ CADCurveList

std::map<int, std::pair<CADCurveSharedPtr, NekDouble> > Nektar::NekMeshUtils::Node::CADCurveList

list of cadcurves the node lies on

Definition at line 415 of file Node.h.

Referenced by GetCADCurveInfo(), GetCADCurves(), GetNumCadCurve(), Move(), and SetCADCurve().

◆ CADSurfList

std::map<int, std::pair<CADSurfSharedPtr, Array<OneD, NekDouble> > > Nektar::NekMeshUtils::Node::CADSurfList

list of cadsurfs the node lies on

Definition at line 418 of file Node.h.

Referenced by GetCADSurfInfo(), GetCADSurfs(), GetNumCADSurf(), Move(), and SetCADSurf().

◆ m_geom

SpatialDomains::PointGeomSharedPtr Nektar::NekMeshUtils::Node::m_geom
private

Definition at line 421 of file Node.h.

◆ m_id

int Nektar::NekMeshUtils::Node::m_id

◆ m_x

NekDouble Nektar::NekMeshUtils::Node::m_x

◆ m_y

NekDouble Nektar::NekMeshUtils::Node::m_y

◆ m_z

NekDouble Nektar::NekMeshUtils::Node::m_z