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

A 1-dimensional line between two vertex nodes. More...

#include <Line.h>

Inheritance diagram for Nektar::NekMeshUtils::Line:
Inheritance graph
[legend]
Collaboration diagram for Nektar::NekMeshUtils::Line:
Collaboration graph
[legend]

Public Member Functions

NEKMESHUTILS_EXPORT Line (ElmtConfig pConf, std::vector< NodeSharedPtr > pNodeList, std::vector< int > pTagList)
 Create a line element. More...
 
virtual NEKMESHUTILS_EXPORT ~Line ()
 
virtual NEKMESHUTILS_EXPORT
SpatialDomains::GeometrySharedPtr 
GetGeom (int coordDim)
 Generate a Nektar++ geometry object for this element. More...
 
- Public Member Functions inherited from Nektar::NekMeshUtils::Element
NEKMESHUTILS_EXPORT Element (ElmtConfig pConf, unsigned int pNumNodes, unsigned int pGotNodes)
 
NEKMESHUTILS_EXPORT unsigned int GetId () const
 Returns the ID of the element (or associated edge or face for boundary elements). More...
 
NEKMESHUTILS_EXPORT unsigned int GetDim () const
 Returns the expansion dimension of the element. More...
 
NEKMESHUTILS_EXPORT ElmtConfig GetConf () const
 Returns the configuration of the element. More...
 
NEKMESHUTILS_EXPORT std::string GetTag () const
 Returns the tag which defines the element shape. More...
 
NEKMESHUTILS_EXPORT NodeSharedPtr GetVertex (unsigned int i) const
 Access a vertex node. More...
 
NEKMESHUTILS_EXPORT EdgeSharedPtr GetEdge (unsigned int i) const
 Access an edge. More...
 
NEKMESHUTILS_EXPORT FaceSharedPtr GetFace (unsigned int i) const
 Access a face. More...
 
NEKMESHUTILS_EXPORT
std::vector< NodeSharedPtr
GetVertexList () const
 Access the list of vertex nodes. More...
 
NEKMESHUTILS_EXPORT
std::vector< EdgeSharedPtr
GetEdgeList () const
 Access the list of edges. More...
 
NEKMESHUTILS_EXPORT
std::vector< FaceSharedPtr
GetFaceList () const
 Access the list of faces. More...
 
NEKMESHUTILS_EXPORT
std::vector< NodeSharedPtr
GetVolumeNodes () const
 Access the list of volume nodes. More...
 
NEKMESHUTILS_EXPORT void SetVolumeNodes (std::vector< NodeSharedPtr > &nodes)
 
NEKMESHUTILS_EXPORT
LibUtilities::PointsType 
GetCurveType () const
 
NEKMESHUTILS_EXPORT void SetCurveType (LibUtilities::PointsType cT)
 
NEKMESHUTILS_EXPORT unsigned int GetNodeCount () const
 Returns the total number of nodes (vertices, edge nodes and face nodes and volume nodes). More...
 
NEKMESHUTILS_EXPORT
std::vector< int > 
GetTagList () const
 Access the list of tags associated with this element. More...
 
NEKMESHUTILS_EXPORT unsigned int GetVertexCount () const
 Returns the number of vertices. More...
 
NEKMESHUTILS_EXPORT unsigned int GetEdgeCount () const
 Returns the number of edges. More...
 
NEKMESHUTILS_EXPORT unsigned int GetFaceCount () const
 Returns the number of faces. More...
 
NEKMESHUTILS_EXPORT void SetId (unsigned int p)
 Change the ID of the element. More...
 
NEKMESHUTILS_EXPORT void SetVertex (unsigned int p, NodeSharedPtr pNew)
 Replace a vertex with another vertex object. More...
 
NEKMESHUTILS_EXPORT void SetEdge (unsigned int p, EdgeSharedPtr pNew)
 Replace an edge with another edge object. More...
 
NEKMESHUTILS_EXPORT void SetFace (unsigned int p, FaceSharedPtr pNew)
 Replace a face with another face object. More...
 
NEKMESHUTILS_EXPORT void SetEdgeLink (EdgeSharedPtr pLink)
 Set a correspondence between this element and an edge (2D boundary element). More...
 
NEKMESHUTILS_EXPORT EdgeSharedPtr GetEdgeLink ()
 Get correspondence between this element and an edge. More...
 
NEKMESHUTILS_EXPORT void SetFaceLink (FaceSharedPtr pLink)
 Set a correspondence between this element and a face (3D boundary element). More...
 
NEKMESHUTILS_EXPORT FaceSharedPtr GetFaceLink ()
 Get correspondence between this element and a face. More...
 
NEKMESHUTILS_EXPORT void SetBoundaryLink (int i, int j)
 Set a correspondence between edge or face i and its representative boundary element m->element[expDim-1][j]. More...
 
NEKMESHUTILS_EXPORT int GetBoundaryLink (int i)
 Get the location of the boundary face/edge i for this element. More...
 
NEKMESHUTILS_EXPORT void SetTagList (const std::vector< int > &tags)
 Set the list of tags associated with this element. More...
 
virtual NEKMESHUTILS_EXPORT
std::string 
GetXmlString () const
 Generate a list of vertices (1D), edges (2D), or faces (3D). More...
 
NEKMESHUTILS_EXPORT void GetCurvedNodes (std::vector< NodeSharedPtr > &nodeList) const
 
NEKMESHUTILS_EXPORT std::string GetXmlCurveString () const
 Generates a string listing the coordinates of all nodes associated with this element. More...
 
NEKMESHUTILS_EXPORT int GetMaxOrder ()
 Obtain the order of an element by looking at edges. More...
 
virtual NEKMESHUTILS_EXPORT void Complete (int order)
 Complete this object. More...
 
NEKMESHUTILS_EXPORT void Print ()
 

Static Public Member Functions

static ElementSharedPtr create (ElmtConfig pConf, std::vector< NodeSharedPtr > pNodeList, std::vector< int > pTagList)
 Creates an instance of this class. More...
 
static NEKMESHUTILS_EXPORT
unsigned int 
GetNumNodes (ElmtConfig pConf)
 Return the number of nodes defining a line. More...
 

Static Public Attributes

static LibUtilities::ShapeType m_type
 Element type. More...
 

Additional Inherited Members

- Protected Attributes inherited from Nektar::NekMeshUtils::Element
unsigned int m_id
 ID of the element. More...
 
unsigned int m_dim
 Dimension of the element. More...
 
ElmtConfig m_conf
 Contains configuration of the element. More...
 
std::string m_tag
 Tag character describing the element. More...
 
std::vector< int > m_taglist
 List of integers specifying properties of the element. More...
 
std::vector< NodeSharedPtrm_vertex
 List of element vertex nodes. More...
 
std::vector< EdgeSharedPtrm_edge
 List of element edges. More...
 
std::vector< FaceSharedPtrm_face
 List of element faces. More...
 
std::vector< NodeSharedPtrm_volumeNodes
 List of element volume nodes. More...
 
LibUtilities::PointsType m_curveType
 Volume curve type. More...
 
EdgeSharedPtr m_edgeLink
 Pointer to the corresponding edge if element is a 2D boundary. More...
 
FaceSharedPtr m_faceLink
 Pointer to the corresponding face if element is a 3D boundary. More...
 
std::map< int, int > m_boundaryLinks
 Array mapping faces/edges to the location of the appropriate boundary elements in m->element. More...
 
SpatialDomains::GeometrySharedPtr m_geom
 Nektar++ geometry object for this element. More...
 

Detailed Description

A 1-dimensional line between two vertex nodes.

Definition at line 49 of file Line.h.

Constructor & Destructor Documentation

Nektar::NekMeshUtils::Line::Line ( ElmtConfig  pConf,
std::vector< NodeSharedPtr pNodeList,
std::vector< int >  pTagList 
)

Create a line element.

Definition at line 51 of file Line.cpp.

References Nektar::NekMeshUtils::Element::m_conf, Nektar::NekMeshUtils::Element::m_dim, Nektar::NekMeshUtils::Element::m_edge, Nektar::NekMeshUtils::ElmtConfig::m_edgeCurveType, Nektar::NekMeshUtils::ElmtConfig::m_order, Nektar::NekMeshUtils::Element::m_tag, Nektar::NekMeshUtils::Element::m_taglist, and Nektar::NekMeshUtils::Element::m_vertex.

Referenced by create().

54  : Element(pConf, GetNumNodes(pConf), pNodeList.size())
55 {
56  m_tag = "S";
57  m_dim = 1;
58  m_taglist = pTagList;
59  int n = m_conf.m_order - 1;
60 
61  // Add vertices
62  for (int i = 0; i < 2; ++i)
63  {
64  m_vertex.push_back(pNodeList[i]);
65  }
66  vector<NodeSharedPtr> edgeNodes;
67  if (m_conf.m_order > 1)
68  {
69  for (int j = 0; j < n; ++j)
70  {
71  edgeNodes.push_back(pNodeList[2 + j]);
72  }
73  }
74  m_edge.push_back(boost::shared_ptr<Edge>(new Edge(
75  pNodeList[0], pNodeList[1], edgeNodes, m_conf.m_edgeCurveType)));
76 }
ElmtConfig m_conf
Contains configuration of the element.
Definition: Element.h:496
std::vector< int > m_taglist
List of integers specifying properties of the element.
Definition: Element.h:500
LibUtilities::PointsType m_edgeCurveType
Distribution of points in edges.
Definition: Element.h:101
unsigned int m_order
Order of the element.
Definition: Element.h:96
static NEKMESHUTILS_EXPORT unsigned int GetNumNodes(ElmtConfig pConf)
Return the number of nodes defining a line.
Definition: Line.cpp:115
std::vector< NodeSharedPtr > m_vertex
List of element vertex nodes.
Definition: Element.h:502
unsigned int m_dim
Dimension of the element.
Definition: Element.h:494
std::vector< EdgeSharedPtr > m_edge
List of element edges.
Definition: Element.h:504
std::string m_tag
Tag character describing the element.
Definition: Element.h:498
NEKMESHUTILS_EXPORT Element(ElmtConfig pConf, unsigned int pNumNodes, unsigned int pGotNodes)
Definition: Element.cpp:54
virtual NEKMESHUTILS_EXPORT Nektar::NekMeshUtils::Line::~Line ( )
inlinevirtual

Definition at line 65 of file Line.h.

66  {
67  }

Member Function Documentation

static ElementSharedPtr Nektar::NekMeshUtils::Line::create ( ElmtConfig  pConf,
std::vector< NodeSharedPtr pNodeList,
std::vector< int >  pTagList 
)
inlinestatic

Creates an instance of this class.

Definition at line 53 of file Line.h.

References Line().

56  {
57  return boost::shared_ptr<Element>(new Line(pConf, pNodeList, pTagList));
58  }
NEKMESHUTILS_EXPORT Line(ElmtConfig pConf, std::vector< NodeSharedPtr > pNodeList, std::vector< int > pTagList)
Create a line element.
Definition: Line.cpp:51
SpatialDomains::GeometrySharedPtr Nektar::NekMeshUtils::Line::GetGeom ( int  coordDim)
virtual

Generate a Nektar++ geometry object for this element.

Reimplemented from Nektar::NekMeshUtils::Element.

Definition at line 78 of file Line.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::NekMeshUtils::Element::m_curveType, Nektar::NekMeshUtils::Element::m_edge, Nektar::NekMeshUtils::Element::m_id, and Nektar::NekMeshUtils::Element::m_vertex.

79 {
80  // Create edge vertices.
83 
84  p[0] = m_vertex[0]->GetGeom(coordDim);
85  p[1] = m_vertex[1]->GetGeom(coordDim);
86 
87  if (m_edge[0]->m_edgeNodes.size() > 0)
88  {
91  m_id, m_edge[0]->m_curveType);
92 
93  c->m_points.push_back(p[0]);
94  for (int i = 0; i < m_edge[0]->m_edgeNodes.size(); ++i)
95  {
96  c->m_points.push_back(m_edge[0]->m_edgeNodes[i]->GetGeom(coordDim));
97  }
98  c->m_points.push_back(p[1]);
99 
101  m_id, 2, p, c);
102  }
103  else
104  {
106  m_id, 2, p);
107  }
108 
109  return ret;
110 }
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_vertex
List of element vertex nodes.
Definition: Element.h:502
boost::shared_ptr< SegGeom > SegGeomSharedPtr
Definition: Geometry2D.h:60
std::vector< EdgeSharedPtr > m_edge
List of element edges.
Definition: Element.h:504
virtual NEKMESHUTILS_EXPORT SpatialDomains::GeometrySharedPtr GetGeom(int coordDim)
Generate a Nektar++ geometry object for this element.
Definition: Line.cpp:78
unsigned int m_id
ID of the element.
Definition: Element.h:492
LibUtilities::PointsType m_curveType
Volume curve type.
Definition: Element.h:510
boost::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:60
unsigned int Nektar::NekMeshUtils::Line::GetNumNodes ( ElmtConfig  pConf)
static

Return the number of nodes defining a line.

Definition at line 115 of file Line.cpp.

References Nektar::NekMeshUtils::ElmtConfig::m_order.

Referenced by Nektar::Utilities::InputGmsh::GetNnodes().

116 {
117  return pConf.m_order + 1;
118 }

Member Data Documentation

LibUtilities::ShapeType Nektar::NekMeshUtils::Line::m_type
static
Initial value:

Element type.

Definition at line 60 of file Line.h.