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

Base class for element definitions. More...

#include <Element.h>

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

Public Member Functions

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
LibUtilities::ShapeType 
GetShapeType () const
 returns the shapetype 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 ()
 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, bool descend=true)
 Replace a vertex in the element. More...
 
NEKMESHUTILS_EXPORT void SetEdge (unsigned int p, EdgeSharedPtr pNew, bool descend=true)
 Replace an edge in the element. More...
 
NEKMESHUTILS_EXPORT void SetFace (unsigned int p, FaceSharedPtr pNew)
 Replace a face in the element. 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 ()
 Generate a list of vertices (1D), edges (2D), or faces (3D). More...
 
virtual NEKMESHUTILS_EXPORT void GetCurvedNodes (std::vector< NodeSharedPtr > &nodeList) const
 get list of volume interior nodes More...
 
NEKMESHUTILS_EXPORT std::string GetXmlCurveString ()
 Generates a string listing the coordinates of all nodes associated with this element. More...
 
virtual NEKMESHUTILS_EXPORT
SpatialDomains::GeometrySharedPtr 
GetGeom (int coordDim)
 Generate a Nektar++ geometry object for this element. More...
 
NEKMESHUTILS_EXPORT int GetMaxOrder ()
 Obtain the order of an element by looking at edges. More...
 
virtual NEKMESHUTILS_EXPORT void MakeOrder (int order, SpatialDomains::GeometrySharedPtr geom, LibUtilities::PointsType edgeType, int coordDim, int &id, bool justConfig=false)
 Insert interior (i.e. volume) points into this element to make the geometry an order order representation. More...
 
virtual NEKMESHUTILS_EXPORT
StdRegions::Orientation 
GetEdgeOrient (int edgeId, EdgeSharedPtr edge)
 Get the edge orientation of edge with respect to the local element, which lies at edge index edgeId. More...
 
virtual NEKMESHUTILS_EXPORT int GetFaceVertex (int i, int j)
 Returns the local index of vertex j of face i. More...
 
NEKMESHUTILS_EXPORT void Print ()
 
virtual NEKMESHUTILS_EXPORT
Array< OneD, NekDouble
Normal (bool inward=false)
 returns the normal to the element More...
 

Public Attributes

CADObjectSharedPtr m_parentCAD
 

Protected Attributes

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

Base class for element definitions.

An element is defined by a list of vertices, edges and faces (depending on the dimension of the problem). This base class provides the underlying structure.

Definition at line 59 of file Element.h.

Constructor & Destructor Documentation

Element::Element ( ElmtConfig  pConf,
unsigned int  pNumNodes,
unsigned int  pGotNodes 
)

Definition at line 54 of file Element.cpp.

References Nektar::NekMeshUtils::ElmtConfig::m_e.

57 {
58  if (pNumNodes != pGotNodes)
59  {
60  cerr << "Number of modes mismatch for type " << pConf.m_e
61  << "! Should be " << pNumNodes << " but got " << pGotNodes
62  << " nodes." << endl;
63  abort();
64  }
65 }
ElmtConfig m_conf
Contains configuration of the element.
Definition: Element.h:380
1D Evenly-spaced points using Lagrange polynomial
Definition: PointsType.h:65
SpatialDomains::GeometrySharedPtr m_geom
Nektar++ geometry object for this element.
Definition: Element.h:403
LibUtilities::PointsType m_curveType
Volume curve type.
Definition: Element.h:394

Member Function Documentation

NEKMESHUTILS_EXPORT int Nektar::NekMeshUtils::Element::GetBoundaryLink ( int  i)
inline

Get the location of the boundary face/edge i for this element.

Definition at line 239 of file Element.h.

References Nektar::iterator, and m_boundaryLinks.

240  {
242  if (it == m_boundaryLinks.end())
243  {
244  return -1;
245  }
246  else
247  {
248  return it->second;
249  }
250  }
std::map< int, int > m_boundaryLinks
Array mapping faces/edges to the location of the appropriate boundary elements in m->element...
Definition: Element.h:401
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
NEKMESHUTILS_EXPORT ElmtConfig Nektar::NekMeshUtils::Element::GetConf ( ) const
inline

Returns the configuration of the element.

Definition at line 81 of file Element.h.

References m_conf.

82  {
83  return m_conf;
84  }
ElmtConfig m_conf
Contains configuration of the element.
Definition: Element.h:380
virtual NEKMESHUTILS_EXPORT void Nektar::NekMeshUtils::Element::GetCurvedNodes ( std::vector< NodeSharedPtr > &  nodeList) const
inlinevirtual

get list of volume interior nodes

Reimplemented in Nektar::NekMeshUtils::Triangle, Nektar::NekMeshUtils::Prism, Nektar::NekMeshUtils::Quadrilateral, Nektar::NekMeshUtils::Tetrahedron, and Nektar::NekMeshUtils::Line.

Definition at line 259 of file Element.h.

References ASSERTL0.

Referenced by GetXmlCurveString().

261  {
262  ASSERTL0(false,
263  "This function should be implemented at a shape level.");
264  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:198
NEKMESHUTILS_EXPORT LibUtilities::PointsType Nektar::NekMeshUtils::Element::GetCurveType ( ) const
inline

Definition at line 138 of file Element.h.

References m_curveType.

139  {
140  return m_curveType;
141  }
LibUtilities::PointsType m_curveType
Volume curve type.
Definition: Element.h:394
NEKMESHUTILS_EXPORT unsigned int Nektar::NekMeshUtils::Element::GetDim ( ) const
inline

Returns the expansion dimension of the element.

Definition at line 76 of file Element.h.

References m_dim.

77  {
78  return m_dim;
79  }
unsigned int m_dim
Dimension of the element.
Definition: Element.h:378
NEKMESHUTILS_EXPORT EdgeSharedPtr Nektar::NekMeshUtils::Element::GetEdge ( unsigned int  i) const
inline

Access an edge.

Definition at line 105 of file Element.h.

References m_edge.

106  {
107  return m_edge[i];
108  }
std::vector< EdgeSharedPtr > m_edge
List of element edges.
Definition: Element.h:388
NEKMESHUTILS_EXPORT unsigned int Nektar::NekMeshUtils::Element::GetEdgeCount ( ) const
inline

Returns the number of edges.

Definition at line 160 of file Element.h.

References m_edge.

161  {
162  return m_edge.size();
163  }
std::vector< EdgeSharedPtr > m_edge
List of element edges.
Definition: Element.h:388
NEKMESHUTILS_EXPORT EdgeSharedPtr Nektar::NekMeshUtils::Element::GetEdgeLink ( )
inline

Get correspondence between this element and an edge.

Definition at line 217 of file Element.h.

References m_edgeLink.

218  {
219  return m_edgeLink;
220  }
EdgeSharedPtr m_edgeLink
Pointer to the corresponding edge if element is a 2D boundary.
Definition: Element.h:396
NEKMESHUTILS_EXPORT std::vector<EdgeSharedPtr> Nektar::NekMeshUtils::Element::GetEdgeList ( ) const
inline

Access the list of edges.

Definition at line 120 of file Element.h.

References m_edge.

121  {
122  return m_edge;
123  }
std::vector< EdgeSharedPtr > m_edge
List of element edges.
Definition: Element.h:388
virtual NEKMESHUTILS_EXPORT StdRegions::Orientation Nektar::NekMeshUtils::Element::GetEdgeOrient ( int  edgeId,
EdgeSharedPtr  edge 
)
inlinevirtual

Get the edge orientation of edge with respect to the local element, which lies at edge index edgeId.

Reimplemented in Nektar::NekMeshUtils::Hexahedron, Nektar::NekMeshUtils::Triangle, Nektar::NekMeshUtils::Prism, Nektar::NekMeshUtils::Quadrilateral, and Nektar::NekMeshUtils::Tetrahedron.

Definition at line 316 of file Element.h.

References ASSERTL0, and Nektar::StdRegions::eNoOrientation.

318  {
319  ASSERTL0(false,
320  "This function should be implemented at a shape level.");
322  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:198
NEKMESHUTILS_EXPORT FaceSharedPtr Nektar::NekMeshUtils::Element::GetFace ( unsigned int  i) const
inline

Access a face.

Definition at line 110 of file Element.h.

References m_face.

111  {
112  return m_face[i];
113  }
std::vector< FaceSharedPtr > m_face
List of element faces.
Definition: Element.h:390
NEKMESHUTILS_EXPORT unsigned int Nektar::NekMeshUtils::Element::GetFaceCount ( ) const
inline

Returns the number of faces.

Definition at line 165 of file Element.h.

References m_face.

166  {
167  return m_face.size();
168  }
std::vector< FaceSharedPtr > m_face
List of element faces.
Definition: Element.h:390
NEKMESHUTILS_EXPORT FaceSharedPtr Nektar::NekMeshUtils::Element::GetFaceLink ( )
inline

Get correspondence between this element and a face.

Definition at line 228 of file Element.h.

References m_faceLink.

229  {
230  return m_faceLink;
231  }
FaceSharedPtr m_faceLink
Pointer to the corresponding face if element is a 3D boundary.
Definition: Element.h:398
NEKMESHUTILS_EXPORT std::vector<FaceSharedPtr> Nektar::NekMeshUtils::Element::GetFaceList ( ) const
inline

Access the list of faces.

Definition at line 125 of file Element.h.

References m_face.

126  {
127  return m_face;
128  }
std::vector< FaceSharedPtr > m_face
List of element faces.
Definition: Element.h:390
virtual NEKMESHUTILS_EXPORT int Nektar::NekMeshUtils::Element::GetFaceVertex ( int  i,
int  j 
)
inlinevirtual

Returns the local index of vertex j of face i.

Reimplemented in Nektar::NekMeshUtils::Hexahedron, Nektar::NekMeshUtils::Prism, Nektar::NekMeshUtils::Tetrahedron, and Nektar::NekMeshUtils::Pyramid.

Definition at line 327 of file Element.h.

References ASSERTL0.

328  {
329  ASSERTL0(false,
330  "This function should be implemented at a shape level.");
331  return 0;
332  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:198
virtual NEKMESHUTILS_EXPORT SpatialDomains::GeometrySharedPtr Nektar::NekMeshUtils::Element::GetGeom ( int  coordDim)
inlinevirtual

Generate a Nektar++ geometry object for this element.

Reimplemented in Nektar::NekMeshUtils::Hexahedron, Nektar::NekMeshUtils::Triangle, Nektar::NekMeshUtils::Line, Nektar::NekMeshUtils::Prism, Nektar::NekMeshUtils::Quadrilateral, Nektar::NekMeshUtils::Tetrahedron, and Nektar::NekMeshUtils::Pyramid.

Definition at line 270 of file Element.h.

References ASSERTL0.

272  {
273  ASSERTL0(false,
274  "This function should be implemented at a shape level.");
275  return boost::shared_ptr<SpatialDomains::Geometry>();
276  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:198
NEKMESHUTILS_EXPORT unsigned int Nektar::NekMeshUtils::Element::GetId ( ) const
inline

Returns the ID of the element (or associated edge or face for boundary elements).

Definition at line 67 of file Element.h.

References m_edgeLink, m_faceLink, and m_id.

68  {
69  if (m_faceLink.get() != 0)
70  return m_faceLink->m_id;
71  if (m_edgeLink.get() != 0)
72  return m_edgeLink->m_id;
73  return m_id;
74  }
FaceSharedPtr m_faceLink
Pointer to the corresponding face if element is a 3D boundary.
Definition: Element.h:398
EdgeSharedPtr m_edgeLink
Pointer to the corresponding edge if element is a 2D boundary.
Definition: Element.h:396
unsigned int m_id
ID of the element.
Definition: Element.h:376
int Element::GetMaxOrder ( )

Obtain the order of an element by looking at edges.

Definition at line 139 of file Element.cpp.

References m_edge.

140 {
141  int i, ret = 1;
142 
143  for (i = 0; i < m_edge.size(); ++i)
144  {
145  int edgeOrder = m_edge[i]->GetNodeCount() - 1;
146  if (edgeOrder > ret)
147  {
148  ret = edgeOrder;
149  }
150  }
151 
152  return ret;
153 }
std::vector< EdgeSharedPtr > m_edge
List of element edges.
Definition: Element.h:388
unsigned int Element::GetNodeCount ( )

Returns the total number of nodes (vertices, edge nodes and face nodes and volume nodes).

Definition at line 155 of file Element.cpp.

References m_dim, m_edge, m_face, m_vertex, and m_volumeNodes.

156 {
157  unsigned int n = m_volumeNodes.size();
158  if (m_dim == 1)
159  {
160  n += 2;
161  }
162  else if (m_dim == 2)
163  {
164  for (int i = 0; i < m_edge.size(); ++i)
165  {
166  n += m_edge[i]->GetNodeCount();
167  }
168  n -= m_vertex.size();
169  }
170  else
171  {
172  for (int i = 0; i < m_face.size(); ++i)
173  {
174  n += m_face[i]->GetNodeCount();
175  }
176  for (int i = 0; i < m_edge.size(); ++i)
177  {
178  n -= m_edge[i]->GetNodeCount();
179  }
180  n += m_vertex.size();
181  std::cerr << "Not supported." << std::endl;
182  exit(1);
183  }
184  return n;
185 }
std::vector< NodeSharedPtr > m_vertex
List of element vertex nodes.
Definition: Element.h:386
unsigned int m_dim
Dimension of the element.
Definition: Element.h:378
std::vector< EdgeSharedPtr > m_edge
List of element edges.
Definition: Element.h:388
std::vector< NodeSharedPtr > m_volumeNodes
List of element volume nodes.
Definition: Element.h:392
std::vector< FaceSharedPtr > m_face
List of element faces.
Definition: Element.h:390
NEKMESHUTILS_EXPORT LibUtilities::ShapeType Nektar::NekMeshUtils::Element::GetShapeType ( void  ) const
inline

returns the shapetype

Definition at line 86 of file Element.h.

References m_conf, and Nektar::NekMeshUtils::ElmtConfig::m_e.

87  {
88  return m_conf.m_e;
89  }
ElmtConfig m_conf
Contains configuration of the element.
Definition: Element.h:380
LibUtilities::ShapeType m_e
Element type (e.g. triangle, quad, etc).
Definition: ElementConfig.h:77
NEKMESHUTILS_EXPORT std::string Nektar::NekMeshUtils::Element::GetTag ( ) const
inline

Returns the tag which defines the element shape.

Definition at line 91 of file Element.h.

References m_edgeLink, m_faceLink, and m_tag.

92  {
93  if (m_faceLink.get() != 0)
94  return "F";
95  if (m_edgeLink.get() != 0)
96  return "E";
97  return m_tag;
98  }
FaceSharedPtr m_faceLink
Pointer to the corresponding face if element is a 3D boundary.
Definition: Element.h:398
EdgeSharedPtr m_edgeLink
Pointer to the corresponding edge if element is a 2D boundary.
Definition: Element.h:396
std::string m_tag
Tag character describing the element.
Definition: Element.h:382
NEKMESHUTILS_EXPORT std::vector<int> Nektar::NekMeshUtils::Element::GetTagList ( ) const
inline

Access the list of tags associated with this element.

Definition at line 150 of file Element.h.

References m_taglist.

151  {
152  return m_taglist;
153  }
std::vector< int > m_taglist
List of integers specifying properties of the element.
Definition: Element.h:384
NEKMESHUTILS_EXPORT NodeSharedPtr Nektar::NekMeshUtils::Element::GetVertex ( unsigned int  i) const
inline

Access a vertex node.

Definition at line 100 of file Element.h.

References m_vertex.

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

101  {
102  return m_vertex[i];
103  }
std::vector< NodeSharedPtr > m_vertex
List of element vertex nodes.
Definition: Element.h:386
NEKMESHUTILS_EXPORT unsigned int Nektar::NekMeshUtils::Element::GetVertexCount ( ) const
inline

Returns the number of vertices.

Definition at line 155 of file Element.h.

References m_vertex.

156  {
157  return m_vertex.size();
158  }
std::vector< NodeSharedPtr > m_vertex
List of element vertex nodes.
Definition: Element.h:386
NEKMESHUTILS_EXPORT std::vector<NodeSharedPtr> Nektar::NekMeshUtils::Element::GetVertexList ( ) const
inline

Access the list of vertex nodes.

Definition at line 115 of file Element.h.

References m_vertex.

116  {
117  return m_vertex;
118  }
std::vector< NodeSharedPtr > m_vertex
List of element vertex nodes.
Definition: Element.h:386
NEKMESHUTILS_EXPORT std::vector<NodeSharedPtr> Nektar::NekMeshUtils::Element::GetVolumeNodes ( ) const
inline

Access the list of volume nodes.

Definition at line 130 of file Element.h.

References m_volumeNodes.

131  {
132  return m_volumeNodes;
133  }
std::vector< NodeSharedPtr > m_volumeNodes
List of element volume nodes.
Definition: Element.h:392
string Element::GetXmlCurveString ( )

Generates a string listing the coordinates of all nodes associated with this element.

Definition at line 214 of file Element.cpp.

References GetCurvedNodes().

215 {
216  // Temporary node list for reordering
217  std::vector<NodeSharedPtr> nodeList;
218 
219  GetCurvedNodes(nodeList);
220 
221  // Finally generate the XML string corresponding to our new
222  // node reordering.
223  std::stringstream s;
224  std::string str;
225  for (int k = 0; k < nodeList.size(); ++k)
226  {
227  s << std::scientific << std::setprecision(8) << " "
228  << nodeList[k]->m_x << " " << nodeList[k]->m_y << " "
229  << nodeList[k]->m_z << " ";
230  }
231  return s.str();
232 }
virtual NEKMESHUTILS_EXPORT void GetCurvedNodes(std::vector< NodeSharedPtr > &nodeList) const
get list of volume interior nodes
Definition: Element.h:259
string Element::GetXmlString ( )
virtual

Generate a list of vertices (1D), edges (2D), or faces (3D).

Definition at line 187 of file Element.cpp.

References m_dim, m_edge, m_face, and m_vertex.

188 {
189  std::stringstream s;
190  switch (m_dim)
191  {
192  case 1:
193  for (int j = 0; j < m_vertex.size(); ++j)
194  {
195  s << std::setw(5) << m_vertex[j]->m_id << " ";
196  }
197  break;
198  case 2:
199  for (int j = 0; j < m_edge.size(); ++j)
200  {
201  s << std::setw(5) << m_edge[j]->m_id << " ";
202  }
203  break;
204  case 3:
205  for (int j = 0; j < m_face.size(); ++j)
206  {
207  s << std::setw(5) << m_face[j]->m_id << " ";
208  }
209  break;
210  }
211  return s.str();
212 }
std::vector< NodeSharedPtr > m_vertex
List of element vertex nodes.
Definition: Element.h:386
unsigned int m_dim
Dimension of the element.
Definition: Element.h:378
std::vector< EdgeSharedPtr > m_edge
List of element edges.
Definition: Element.h:388
std::vector< FaceSharedPtr > m_face
List of element faces.
Definition: Element.h:390
virtual NEKMESHUTILS_EXPORT void Nektar::NekMeshUtils::Element::MakeOrder ( int  order,
SpatialDomains::GeometrySharedPtr  geom,
LibUtilities::PointsType  edgeType,
int  coordDim,
int &  id,
bool  justConfig = false 
)
inlinevirtual

Insert interior (i.e. volume) points into this element to make the geometry an order order representation.

Parameters
orderThe desired polynomial order.
geomThe geometry object used to describe the curvature mapping.
edgeTypeThe points distribution to use on the volume.
coordDimThe coordinate (i.e. space) dimension.
idCounter which should be incremented to supply consistent vertex IDs.
justConfigIf true, then the configuration Element::m_conf will be updated but no nodes will be generated. This is used when considering boundary elements, which just require copying of face or edge interior nodes.

Reimplemented in Nektar::NekMeshUtils::Hexahedron, Nektar::NekMeshUtils::Triangle, Nektar::NekMeshUtils::Prism, Nektar::NekMeshUtils::Quadrilateral, Nektar::NekMeshUtils::Tetrahedron, and Nektar::NekMeshUtils::Line.

Definition at line 300 of file Element.h.

References ASSERTL0.

307  {
308  ASSERTL0(false,
309  "This function should be implemented at a shape level.");
310  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:198
virtual NEKMESHUTILS_EXPORT Array<OneD, NekDouble> Nektar::NekMeshUtils::Element::Normal ( bool  inward = false)
inlinevirtual

returns the normal to the element

Reimplemented in Nektar::NekMeshUtils::Triangle.

Definition at line 365 of file Element.h.

References ASSERTL0.

366  {
367  ASSERTL0(false,
368  "This function should be implemented at a shape level.");
369  return Array<OneD, NekDouble>();
370  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:198
NEKMESHUTILS_EXPORT void Nektar::NekMeshUtils::Element::Print ( )
inline

Definition at line 334 of file Element.h.

References m_edge, m_face, and m_vertex.

335  {
336  int i, j;
337  for (i = 0; i < m_vertex.size(); ++i)
338  {
339  std::cout << m_vertex[i]->m_x << " " << m_vertex[i]->m_y << " "
340  << m_vertex[i]->m_z << std::endl;
341  }
342  for (i = 0; i < m_edge.size(); ++i)
343  {
344  for (j = 0; j < m_edge[i]->m_edgeNodes.size(); ++j)
345  {
346  NodeSharedPtr n = m_edge[i]->m_edgeNodes[j];
347  std::cout << n->m_x << " " << n->m_y << " " << n->m_z
348  << std::endl;
349  }
350  }
351  for (i = 0; i < m_face.size(); ++i)
352  {
353  for (j = 0; j < m_face[i]->m_faceNodes.size(); ++j)
354  {
355  NodeSharedPtr n = m_face[i]->m_faceNodes[j];
356  std::cout << n->m_x << " " << n->m_y << " " << n->m_z
357  << std::endl;
358  }
359  }
360  }
std::vector< NodeSharedPtr > m_vertex
List of element vertex nodes.
Definition: Element.h:386
std::vector< EdgeSharedPtr > m_edge
List of element edges.
Definition: Element.h:388
boost::shared_ptr< Node > NodeSharedPtr
Definition: Node.h:50
std::vector< FaceSharedPtr > m_face
List of element faces.
Definition: Element.h:390
NEKMESHUTILS_EXPORT void Nektar::NekMeshUtils::Element::SetBoundaryLink ( int  i,
int  j 
)
inline

Set a correspondence between edge or face i and its representative boundary element m->element[expDim-1][j].

Definition at line 234 of file Element.h.

References m_boundaryLinks.

235  {
236  m_boundaryLinks[i] = j;
237  }
std::map< int, int > m_boundaryLinks
Array mapping faces/edges to the location of the appropriate boundary elements in m->element...
Definition: Element.h:401
NEKMESHUTILS_EXPORT void Nektar::NekMeshUtils::Element::SetCurveType ( LibUtilities::PointsType  cT)
inline

Definition at line 142 of file Element.h.

References m_curveType.

143  {
144  m_curveType = cT;
145  }
LibUtilities::PointsType m_curveType
Volume curve type.
Definition: Element.h:394
void Element::SetEdge ( unsigned int  p,
EdgeSharedPtr  pNew,
bool  descend = true 
)

Replace an edge in the element.

When an edge is replaced, the element faces are also searched and the corresponding face edges are updated to maintain consistency.

Parameters
pIndex of the edge to replace.
pNewNew edge.
descendIf true, we loop over faces and replace the corresponding face edge with pNew.

Definition at line 112 of file Element.cpp.

References m_edge, m_face, and CellMLToNektar.cellml_metadata::p.

113 {
114  EdgeSharedPtr vOld = m_edge[p];
115  m_edge[p] = pNew;
116 
117  if (!descend)
118  {
119  return;
120  }
121 
122  for (unsigned int i = 0; i < m_face.size(); ++i)
123  {
124  for (unsigned int j = 0; j < m_face[i]->m_edgeList.size(); ++j)
125  {
126  if (m_face[i]->m_edgeList[j] == vOld)
127  {
128  m_face[i]->m_edgeList[j] = pNew;
129  }
130  }
131  }
132 }
std::vector< EdgeSharedPtr > m_edge
List of element edges.
Definition: Element.h:388
boost::shared_ptr< Edge > EdgeSharedPtr
Shared pointer to an edge.
Definition: Edge.h:135
std::vector< FaceSharedPtr > m_face
List of element faces.
Definition: Element.h:390
NEKMESHUTILS_EXPORT void Nektar::NekMeshUtils::Element::SetEdgeLink ( EdgeSharedPtr  pLink)
inline

Set a correspondence between this element and an edge (2D boundary element).

Definition at line 212 of file Element.h.

References m_edgeLink.

213  {
214  m_edgeLink = pLink;
215  }
EdgeSharedPtr m_edgeLink
Pointer to the corresponding edge if element is a 2D boundary.
Definition: Element.h:396
void Element::SetFace ( unsigned int  p,
FaceSharedPtr  pNew 
)

Replace a face in the element.

When a face is replaced, no other consistency checks are required.

Parameters
pIndex of the face to replace.
pNewNew face.

Definition at line 134 of file Element.cpp.

References m_face, and CellMLToNektar.cellml_metadata::p.

135 {
136  m_face[p] = pNew;
137 }
std::vector< FaceSharedPtr > m_face
List of element faces.
Definition: Element.h:390
NEKMESHUTILS_EXPORT void Nektar::NekMeshUtils::Element::SetFaceLink ( FaceSharedPtr  pLink)
inline

Set a correspondence between this element and a face (3D boundary element).

Definition at line 223 of file Element.h.

References m_faceLink.

224  {
225  m_faceLink = pLink;
226  }
FaceSharedPtr m_faceLink
Pointer to the corresponding face if element is a 3D boundary.
Definition: Element.h:398
NEKMESHUTILS_EXPORT void Nektar::NekMeshUtils::Element::SetId ( unsigned int  p)
inline

Change the ID of the element.

Definition at line 170 of file Element.h.

References m_id, and CellMLToNektar.cellml_metadata::p.

171  {
172  m_id = p;
173  }
unsigned int m_id
ID of the element.
Definition: Element.h:376
NEKMESHUTILS_EXPORT void Nektar::NekMeshUtils::Element::SetTagList ( const std::vector< int > &  tags)
inline

Set the list of tags associated with this element.

Definition at line 252 of file Element.h.

References m_taglist.

253  {
254  m_taglist = tags;
255  }
std::vector< int > m_taglist
List of integers specifying properties of the element.
Definition: Element.h:384
void Element::SetVertex ( unsigned int  p,
NodeSharedPtr  pNew,
bool  descend = true 
)

Replace a vertex in the element.

When a vertex is replaced, the element edges and faces are also searched and the corresponding edge/face nodes are updated to maintain consistency.

Parameters
pIndex of the vertex to replace.
pNewNew vertex.
descendIf true, we loop over edges and faces and replace the corresponding vertices with pNew.

Definition at line 67 of file Element.cpp.

References m_edge, m_face, m_vertex, and CellMLToNektar.cellml_metadata::p.

68 {
69  NodeSharedPtr vOld = m_vertex[p];
70  m_vertex[p] = pNew;
71 
72  if (!descend)
73  {
74  return;
75  }
76 
77  for (unsigned int i = 0; i < m_edge.size(); ++i)
78  {
79  if (m_edge[i]->m_n1 == vOld)
80  {
81  m_edge[i]->m_n1 = pNew;
82  }
83  else if (m_edge[i]->m_n2 == vOld)
84  {
85  m_edge[i]->m_n2 = pNew;
86  }
87  }
88  for (unsigned int i = 0; i < m_face.size(); ++i)
89  {
90  // Replace vertices in faces
91  for (unsigned int j = 0; j < m_face[i]->m_vertexList.size(); ++j)
92  {
93  if (m_face[i]->m_vertexList[j] == vOld)
94  {
95  m_face[i]->m_vertexList[j] = pNew;
96  }
97  }
98  for (unsigned int j = 0; j < m_face[i]->m_edgeList.size(); ++j)
99  {
100  if (m_face[i]->m_edgeList[j]->m_n1 == vOld)
101  {
102  m_face[i]->m_edgeList[j]->m_n1 = pNew;
103  }
104  else if (m_face[i]->m_edgeList[j]->m_n2 == vOld)
105  {
106  m_face[i]->m_edgeList[j]->m_n2 = pNew;
107  }
108  }
109  }
110 }
std::vector< NodeSharedPtr > m_vertex
List of element vertex nodes.
Definition: Element.h:386
std::vector< EdgeSharedPtr > m_edge
List of element edges.
Definition: Element.h:388
boost::shared_ptr< Node > NodeSharedPtr
Definition: Node.h:50
std::vector< FaceSharedPtr > m_face
List of element faces.
Definition: Element.h:390
NEKMESHUTILS_EXPORT void Nektar::NekMeshUtils::Element::SetVolumeNodes ( std::vector< NodeSharedPtr > &  nodes)
inline

Definition at line 134 of file Element.h.

References m_volumeNodes.

135  {
136  m_volumeNodes = nodes;
137  }
std::vector< NodeSharedPtr > m_volumeNodes
List of element volume nodes.
Definition: Element.h:392

Member Data Documentation

std::map<int, int> Nektar::NekMeshUtils::Element::m_boundaryLinks
protected

Array mapping faces/edges to the location of the appropriate boundary elements in m->element.

Definition at line 401 of file Element.h.

Referenced by GetBoundaryLink(), and SetBoundaryLink().

ElmtConfig Nektar::NekMeshUtils::Element::m_conf
protected
LibUtilities::PointsType Nektar::NekMeshUtils::Element::m_curveType
protected
unsigned int Nektar::NekMeshUtils::Element::m_dim
protected
std::vector<EdgeSharedPtr> Nektar::NekMeshUtils::Element::m_edge
protected
EdgeSharedPtr Nektar::NekMeshUtils::Element::m_edgeLink
protected

Pointer to the corresponding edge if element is a 2D boundary.

Definition at line 396 of file Element.h.

Referenced by GetEdgeLink(), GetId(), GetTag(), and SetEdgeLink().

std::vector<FaceSharedPtr> Nektar::NekMeshUtils::Element::m_face
protected
FaceSharedPtr Nektar::NekMeshUtils::Element::m_faceLink
protected

Pointer to the corresponding face if element is a 3D boundary.

Definition at line 398 of file Element.h.

Referenced by GetFaceLink(), GetId(), GetTag(), and SetFaceLink().

SpatialDomains::GeometrySharedPtr Nektar::NekMeshUtils::Element::m_geom
protected

Nektar++ geometry object for this element.

Definition at line 403 of file Element.h.

Referenced by Nektar::NekMeshUtils::Pyramid::GetGeom().

unsigned int Nektar::NekMeshUtils::Element::m_id
protected
CADObjectSharedPtr Nektar::NekMeshUtils::Element::m_parentCAD

Definition at line 372 of file Element.h.

Referenced by Nektar::NekMeshUtils::Triangle::Normal().

std::string Nektar::NekMeshUtils::Element::m_tag
protected
std::vector<int> Nektar::NekMeshUtils::Element::m_taglist
protected
std::vector<NodeSharedPtr> Nektar::NekMeshUtils::Element::m_vertex
protected
std::vector<NodeSharedPtr> Nektar::NekMeshUtils::Element::m_volumeNodes
protected