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::NekMeshUtils::Edge Class Reference

Represents an edge which joins two points. More...

#include <Edge.h>

Collaboration diagram for Nektar::NekMeshUtils::Edge:
Collaboration graph
[legend]

Public Member Functions

NEKMESHUTILS_EXPORT Edge (NodeSharedPtr pVertex1, NodeSharedPtr pVertex2, std::vector< NodeSharedPtr > pEdgeNodes, LibUtilities::PointsType pCurveType)
 Creates a new edge. More...
 
NEKMESHUTILS_EXPORT Edge (NodeSharedPtr pVertex1, NodeSharedPtr pVertex2)
 Creates a new linear edge. More...
 
NEKMESHUTILS_EXPORT Edge (const Edge &pSrc)
 Copies an existing edge. More...
 
NEKMESHUTILS_EXPORT ~Edge ()
 
NEKMESHUTILS_EXPORT unsigned int GetNodeCount () const
 Returns the total number of nodes defining the edge. More...
 
NEKMESHUTILS_EXPORT void GetCurvedNodes (std::vector< NodeSharedPtr > &nodeList) const
 
NEKMESHUTILS_EXPORT std::string GetXmlCurveString () const
 Creates a Nektar++ string listing the coordinates of all the nodes. More...
 
NEKMESHUTILS_EXPORT
SpatialDomains::SegGeomSharedPtr 
GetGeom (int coordDim)
 Generate a SpatialDomains::SegGeom object for this edge. More...
 

Public Attributes

unsigned int m_id
 ID of edge. More...
 
NodeSharedPtr m_n1
 First vertex node. More...
 
NodeSharedPtr m_n2
 Second vertex node. More...
 
std::vector< NodeSharedPtrm_edgeNodes
 List of control nodes between the first and second vertices. More...
 
LibUtilities::PointsType m_curveType
 Distributions of points along edge. More...
 
vector< pair< ElementSharedPtr,
int > > 
m_elLink
 Element(s) which are linked to this edge. More...
 

Private Attributes

SpatialDomains::SegGeomSharedPtr m_geom
 

Detailed Description

Represents an edge which joins two points.

An edge is defined by two nodes (vertices) and, for high-order edges, a set of control nodes defining the shape of the edge.

Definition at line 61 of file Edge.h.

Constructor & Destructor Documentation

NEKMESHUTILS_EXPORT Nektar::NekMeshUtils::Edge::Edge ( NodeSharedPtr  pVertex1,
NodeSharedPtr  pVertex2,
std::vector< NodeSharedPtr pEdgeNodes,
LibUtilities::PointsType  pCurveType 
)
inline

Creates a new edge.

Definition at line 65 of file Edge.h.

69  : m_n1(pVertex1), m_n2(pVertex2), m_edgeNodes(pEdgeNodes),
70  m_curveType(pCurveType), m_geom()
71  {
72 #ifdef NEKTAR_USE_MESHGEN
73  onCurve = false;
74 #endif
75  }
NodeSharedPtr m_n1
First vertex node.
Definition: Edge.h:175
std::vector< NodeSharedPtr > m_edgeNodes
List of control nodes between the first and second vertices.
Definition: Edge.h:179
LibUtilities::PointsType m_curveType
Distributions of points along edge.
Definition: Edge.h:181
NodeSharedPtr m_n2
Second vertex node.
Definition: Edge.h:177
SpatialDomains::SegGeomSharedPtr m_geom
Definition: Edge.h:193
NEKMESHUTILS_EXPORT Nektar::NekMeshUtils::Edge::Edge ( NodeSharedPtr  pVertex1,
NodeSharedPtr  pVertex2 
)
inline

Creates a new linear edge.

Definition at line 78 of file Edge.h.

79  : m_n1(pVertex1), m_n2(pVertex2), m_edgeNodes(), m_curveType(), m_geom()
80  {
81 #ifdef NEKTAR_USE_MESHGEN
82  onCurve = false;
83 #endif
84  }
NodeSharedPtr m_n1
First vertex node.
Definition: Edge.h:175
std::vector< NodeSharedPtr > m_edgeNodes
List of control nodes between the first and second vertices.
Definition: Edge.h:179
LibUtilities::PointsType m_curveType
Distributions of points along edge.
Definition: Edge.h:181
NodeSharedPtr m_n2
Second vertex node.
Definition: Edge.h:177
SpatialDomains::SegGeomSharedPtr m_geom
Definition: Edge.h:193
NEKMESHUTILS_EXPORT Nektar::NekMeshUtils::Edge::Edge ( const Edge pSrc)
inline

Copies an existing edge.

Definition at line 87 of file Edge.h.

88  : m_n1(pSrc.m_n1), m_n2(pSrc.m_n2), m_edgeNodes(pSrc.m_edgeNodes),
89  m_curveType(pSrc.m_curveType), m_geom(pSrc.m_geom)
90  {
91  }
NodeSharedPtr m_n1
First vertex node.
Definition: Edge.h:175
std::vector< NodeSharedPtr > m_edgeNodes
List of control nodes between the first and second vertices.
Definition: Edge.h:179
LibUtilities::PointsType m_curveType
Distributions of points along edge.
Definition: Edge.h:181
NodeSharedPtr m_n2
Second vertex node.
Definition: Edge.h:177
SpatialDomains::SegGeomSharedPtr m_geom
Definition: Edge.h:193
NEKMESHUTILS_EXPORT Nektar::NekMeshUtils::Edge::~Edge ( )
inline

Definition at line 93 of file Edge.h.

94  {
95  }

Member Function Documentation

NEKMESHUTILS_EXPORT void Nektar::NekMeshUtils::Edge::GetCurvedNodes ( std::vector< NodeSharedPtr > &  nodeList) const
inline

Definition at line 103 of file Edge.h.

References m_edgeNodes, m_n1, and m_n2.

Referenced by GetXmlCurveString().

105  {
106  nodeList.push_back(m_n1);
107  for (int k = 0; k < m_edgeNodes.size(); ++k)
108  {
109  nodeList.push_back(m_edgeNodes[k]);
110  }
111  nodeList.push_back(m_n2);
112  }
NodeSharedPtr m_n1
First vertex node.
Definition: Edge.h:175
std::vector< NodeSharedPtr > m_edgeNodes
List of control nodes between the first and second vertices.
Definition: Edge.h:179
NodeSharedPtr m_n2
Second vertex node.
Definition: Edge.h:177
NEKMESHUTILS_EXPORT SpatialDomains::SegGeomSharedPtr Nektar::NekMeshUtils::Edge::GetGeom ( int  coordDim)
inline

Generate a SpatialDomains::SegGeom object for this edge.

Definition at line 137 of file Edge.h.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), m_curveType, m_edgeNodes, m_id, m_n1, and m_n2.

138  {
139  // Create edge vertices.
142 
143  p[0] = m_n1->GetGeom(coordDim);
144  p[1] = m_n2->GetGeom(coordDim);
145 
146  // Create a curve if high-order information exists.
147  if (m_edgeNodes.size() > 0)
148  {
151  m_id, m_curveType);
152 
153  c->m_points.push_back(p[0]);
154  for (int i = 0; i < m_edgeNodes.size(); ++i)
155  {
156  c->m_points.push_back(m_edgeNodes[i]->GetGeom(coordDim));
157  }
158  c->m_points.push_back(p[1]);
159 
161  m_id, coordDim, p, c);
162  }
163  else
164  {
166  m_id, coordDim, p);
167  }
168 
169  return ret;
170  }
NodeSharedPtr m_n1
First vertex node.
Definition: Edge.h:175
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
boost::shared_ptr< Curve > CurveSharedPtr
Definition: Curve.hpp:62
std::vector< NodeSharedPtr > m_edgeNodes
List of control nodes between the first and second vertices.
Definition: Edge.h:179
unsigned int m_id
ID of edge.
Definition: Edge.h:173
boost::shared_ptr< SegGeom > SegGeomSharedPtr
Definition: Geometry2D.h:60
NEKMESHUTILS_EXPORT SpatialDomains::SegGeomSharedPtr GetGeom(int coordDim)
Generate a SpatialDomains::SegGeom object for this edge.
Definition: Edge.h:137
LibUtilities::PointsType m_curveType
Distributions of points along edge.
Definition: Edge.h:181
NodeSharedPtr m_n2
Second vertex node.
Definition: Edge.h:177
boost::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:60
NEKMESHUTILS_EXPORT unsigned int Nektar::NekMeshUtils::Edge::GetNodeCount ( ) const
inline

Returns the total number of nodes defining the edge.

Definition at line 98 of file Edge.h.

References m_edgeNodes.

99  {
100  return m_edgeNodes.size() + 2;
101  }
std::vector< NodeSharedPtr > m_edgeNodes
List of control nodes between the first and second vertices.
Definition: Edge.h:179
NEKMESHUTILS_EXPORT std::string Nektar::NekMeshUtils::Edge::GetXmlCurveString ( ) const
inline

Creates a Nektar++ string listing the coordinates of all the nodes.

Definition at line 116 of file Edge.h.

References GetCurvedNodes().

117  {
118  std::vector<NodeSharedPtr> nodeList;
119 
120  GetCurvedNodes(nodeList);
121 
122  std::stringstream s;
123  std::string str;
124 
125  // put them into a string and return
126  for (int k = 0; k < nodeList.size(); ++k)
127  {
128  s << std::scientific << std::setprecision(8) << " "
129  << nodeList[k]->m_x << " " << nodeList[k]->m_y << " "
130  << nodeList[k]->m_z << " ";
131  }
132 
133  return s.str();
134  }
NEKMESHUTILS_EXPORT void GetCurvedNodes(std::vector< NodeSharedPtr > &nodeList) const
Definition: Edge.h:103

Member Data Documentation

LibUtilities::PointsType Nektar::NekMeshUtils::Edge::m_curveType

Distributions of points along edge.

Definition at line 181 of file Edge.h.

Referenced by GetGeom().

std::vector<NodeSharedPtr> Nektar::NekMeshUtils::Edge::m_edgeNodes

List of control nodes between the first and second vertices.

Definition at line 179 of file Edge.h.

Referenced by GetCurvedNodes(), GetGeom(), and GetNodeCount().

vector<pair<ElementSharedPtr, int> > Nektar::NekMeshUtils::Edge::m_elLink

Element(s) which are linked to this edge.

Definition at line 183 of file Edge.h.

SpatialDomains::SegGeomSharedPtr Nektar::NekMeshUtils::Edge::m_geom
private

Definition at line 193 of file Edge.h.

unsigned int Nektar::NekMeshUtils::Edge::m_id

ID of edge.

Definition at line 173 of file Edge.h.

Referenced by GetGeom().

NodeSharedPtr Nektar::NekMeshUtils::Edge::m_n1

First vertex node.

Definition at line 175 of file Edge.h.

Referenced by GetCurvedNodes(), and GetGeom().

NodeSharedPtr Nektar::NekMeshUtils::Edge::m_n2

Second vertex node.

Definition at line 177 of file Edge.h.

Referenced by GetCurvedNodes(), and GetGeom().