Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | 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 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...
 
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 Complete (int order)
 Complete this object. More...
 
NEKMESHUTILS_EXPORT void Print ()
 

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 115 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:496
1D Evenly-spaced points using Lagrange polynomial
Definition: PointsType.h:63
SpatialDomains::GeometrySharedPtr m_geom
Nektar++ geometry object for this element.
Definition: Element.h:519
LibUtilities::PointsType m_curveType
Volume curve type.
Definition: Element.h:510

Member Function Documentation

virtual NEKMESHUTILS_EXPORT void Nektar::NekMeshUtils::Element::Complete ( int  order)
inlinevirtual

Complete this object.

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

Definition at line 453 of file Element.h.

References ASSERTL0.

454  {
455  ASSERTL0(false,
456  "This function should be implemented at a shape level.");
457  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:161
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 281 of file Element.h.

References Nektar::iterator, and m_boundaryLinks.

282  {
284  if (it == m_boundaryLinks.end())
285  {
286  return -1;
287  }
288  else
289  {
290  return it->second;
291  }
292  }
std::map< int, int > m_boundaryLinks
Array mapping faces/edges to the location of the appropriate boundary elements in m->element...
Definition: Element.h:517
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 137 of file Element.h.

References m_conf.

138  {
139  return m_conf;
140  }
ElmtConfig m_conf
Contains configuration of the element.
Definition: Element.h:496
NEKMESHUTILS_EXPORT void Nektar::NekMeshUtils::Element::GetCurvedNodes ( std::vector< NodeSharedPtr > &  nodeList) const
inline

Definition at line 326 of file Element.h.

References m_dim, m_edge, m_vertex, and m_volumeNodes.

Referenced by GetXmlCurveString().

328  {
329  // Node orderings are different for different elements.
330  // Triangle
331  if (m_vertex.size() == 2)
332  {
333  nodeList.push_back(m_vertex[0]);
334  for (int i = 0; i < m_volumeNodes.size(); ++i)
335  {
336  nodeList.push_back(m_volumeNodes[i]);
337  }
338  nodeList.push_back(m_vertex[1]);
339  }
340  else if (m_vertex.size() == 3)
341  {
342  int n = m_edge[0]->GetNodeCount();
343  nodeList.resize(n * (n + 1) / 2);
344 
345  // Populate nodelist
346  std::copy(m_vertex.begin(), m_vertex.end(), nodeList.begin());
347  for (int i = 0; i < 3; ++i)
348  {
349  std::copy(m_edge[i]->m_edgeNodes.begin(),
350  m_edge[i]->m_edgeNodes.end(),
351  nodeList.begin() + 3 + i * (n - 2));
352  if (m_edge[i]->m_n1 != m_vertex[i])
353  {
354  // If edge orientation is reversed relative to node
355  // ordering, we need to reverse order of nodes.
356  std::reverse(nodeList.begin() + 3 + i * (n - 2),
357  nodeList.begin() + 3 + (i + 1) * (n - 2));
358  }
359  }
360 
361  // Copy volume nodes.
362  std::copy(m_volumeNodes.begin(),
363  m_volumeNodes.end(),
364  nodeList.begin() + 3 * (n - 1));
365  }
366  // Quad
367  else if (m_dim == 2 && m_vertex.size() == 4)
368  {
369  int n = m_edge[0]->GetNodeCount();
370  nodeList.resize(n * n);
371 
372  // Write vertices
373  nodeList[0] = m_vertex[0];
374  nodeList[n - 1] = m_vertex[1];
375  nodeList[n * n - 1] = m_vertex[2];
376  nodeList[n * (n - 1)] = m_vertex[3];
377 
378  // Write edge-interior
379  int skips[4][2] = {
380  {0, 1}, {n - 1, n}, {n * n - 1, -1}, {n * (n - 1), -n}};
381  for (int i = 0; i < 4; ++i)
382  {
383  bool reverseEdge = m_edge[i]->m_n1 == m_vertex[i];
384 
385  if (!reverseEdge)
386  {
387  for (int j = 1; j < n - 1; ++j)
388  {
389  nodeList[skips[i][0] + j * skips[i][1]] =
390  m_edge[i]->m_edgeNodes[n - 2 - j];
391  }
392  }
393  else
394  {
395  for (int j = 1; j < n - 1; ++j)
396  {
397  nodeList[skips[i][0] + j * skips[i][1]] =
398  m_edge[i]->m_edgeNodes[j - 1];
399  }
400  }
401  }
402 
403  // Write interior
404  for (int i = 1; i < n - 1; ++i)
405  {
406  for (int j = 1; j < n - 1; ++j)
407  {
408  nodeList[i * n + j] =
409  m_volumeNodes[(i - 1) * (n - 2) + (j - 1)];
410  }
411  }
412  }
413  else
414  {
415  std::cerr << "GetXmlCurveString for a " << m_vertex.size()
416  << "-vertex element is not yet implemented."
417  << std::endl;
418  }
419  }
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::vector< NodeSharedPtr > m_volumeNodes
List of element volume nodes.
Definition: Element.h:508
NEKMESHUTILS_EXPORT LibUtilities::PointsType Nektar::NekMeshUtils::Element::GetCurveType ( ) const
inline

Definition at line 189 of file Element.h.

References m_curveType.

190  {
191  return m_curveType;
192  }
LibUtilities::PointsType m_curveType
Volume curve type.
Definition: Element.h:510
NEKMESHUTILS_EXPORT unsigned int Nektar::NekMeshUtils::Element::GetDim ( ) const
inline

Returns the expansion dimension of the element.

Definition at line 132 of file Element.h.

References m_dim.

133  {
134  return m_dim;
135  }
unsigned int m_dim
Dimension of the element.
Definition: Element.h:494
NEKMESHUTILS_EXPORT EdgeSharedPtr Nektar::NekMeshUtils::Element::GetEdge ( unsigned int  i) const
inline

Access an edge.

Definition at line 156 of file Element.h.

References m_edge.

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

Returns the number of edges.

Definition at line 232 of file Element.h.

References m_edge.

233  {
234  return m_edge.size();
235  }
std::vector< EdgeSharedPtr > m_edge
List of element edges.
Definition: Element.h:504
NEKMESHUTILS_EXPORT EdgeSharedPtr Nektar::NekMeshUtils::Element::GetEdgeLink ( )
inline

Get correspondence between this element and an edge.

Definition at line 259 of file Element.h.

References m_edgeLink.

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

Access the list of edges.

Definition at line 171 of file Element.h.

References m_edge.

172  {
173  return m_edge;
174  }
std::vector< EdgeSharedPtr > m_edge
List of element edges.
Definition: Element.h:504
NEKMESHUTILS_EXPORT FaceSharedPtr Nektar::NekMeshUtils::Element::GetFace ( unsigned int  i) const
inline

Access a face.

Definition at line 161 of file Element.h.

References m_face.

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

Returns the number of faces.

Definition at line 237 of file Element.h.

References m_face.

238  {
239  return m_face.size();
240  }
std::vector< FaceSharedPtr > m_face
List of element faces.
Definition: Element.h:506
NEKMESHUTILS_EXPORT FaceSharedPtr Nektar::NekMeshUtils::Element::GetFaceLink ( )
inline

Get correspondence between this element and a face.

Definition at line 270 of file Element.h.

References m_faceLink.

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

Access the list of faces.

Definition at line 176 of file Element.h.

References m_face.

177  {
178  return m_face;
179  }
std::vector< FaceSharedPtr > m_face
List of element faces.
Definition: Element.h:506
virtual NEKMESHUTILS_EXPORT SpatialDomains::GeometrySharedPtr Nektar::NekMeshUtils::Element::GetGeom ( int  coordDim)
inlinevirtual

Generate a Nektar++ geometry object for this element.

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

Definition at line 444 of file Element.h.

References ASSERTL0.

446  {
447  ASSERTL0(false,
448  "This function should be implemented at a shape level.");
449  return boost::shared_ptr<SpatialDomains::Geometry>();
450  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:161
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 123 of file Element.h.

References m_edgeLink, m_faceLink, and m_id.

124  {
125  if (m_faceLink.get() != 0)
126  return m_faceLink->m_id;
127  if (m_edgeLink.get() != 0)
128  return m_edgeLink->m_id;
129  return m_id;
130  }
FaceSharedPtr m_faceLink
Pointer to the corresponding face if element is a 3D boundary.
Definition: Element.h:514
EdgeSharedPtr m_edgeLink
Pointer to the corresponding edge if element is a 2D boundary.
Definition: Element.h:512
unsigned int m_id
ID of the element.
Definition: Element.h:492
int Element::GetMaxOrder ( )

Obtain the order of an element by looking at edges.

Definition at line 157 of file Element.cpp.

References m_edge.

158 {
159  int i, ret = 1;
160 
161  for (i = 0; i < m_edge.size(); ++i)
162  {
163  int edgeOrder = m_edge[i]->GetNodeCount() - 1;
164  if (edgeOrder > ret)
165  {
166  ret = edgeOrder;
167  }
168  }
169 
170  return ret;
171 }
std::vector< EdgeSharedPtr > m_edge
List of element edges.
Definition: Element.h:504
NEKMESHUTILS_EXPORT unsigned int Nektar::NekMeshUtils::Element::GetNodeCount ( ) const
inline

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

Definition at line 199 of file Element.h.

References m_dim, m_edge, m_vertex, and m_volumeNodes.

200  {
201  unsigned int n = m_volumeNodes.size();
202  if (m_dim == 1)
203  {
204  n += 2;
205  }
206  else if (m_dim == 2)
207  {
208  for (int i = 0; i < m_edge.size(); ++i)
209  {
210  n += m_edge[i]->GetNodeCount();
211  }
212  n -= m_vertex.size();
213  }
214  else
215  {
216  std::cerr << "Not supported." << std::endl;
217  exit(1);
218  }
219  return n;
220  }
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::vector< NodeSharedPtr > m_volumeNodes
List of element volume nodes.
Definition: Element.h:508
NEKMESHUTILS_EXPORT std::string Nektar::NekMeshUtils::Element::GetTag ( ) const
inline

Returns the tag which defines the element shape.

Definition at line 142 of file Element.h.

References m_edgeLink, m_faceLink, and m_tag.

143  {
144  if (m_faceLink.get() != 0)
145  return "F";
146  if (m_edgeLink.get() != 0)
147  return "E";
148  return m_tag;
149  }
FaceSharedPtr m_faceLink
Pointer to the corresponding face if element is a 3D boundary.
Definition: Element.h:514
EdgeSharedPtr m_edgeLink
Pointer to the corresponding edge if element is a 2D boundary.
Definition: Element.h:512
std::string m_tag
Tag character describing the element.
Definition: Element.h:498
NEKMESHUTILS_EXPORT std::vector<int> Nektar::NekMeshUtils::Element::GetTagList ( ) const
inline

Access the list of tags associated with this element.

Definition at line 222 of file Element.h.

References m_taglist.

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

Access a vertex node.

Definition at line 151 of file Element.h.

References m_vertex.

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

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

Returns the number of vertices.

Definition at line 227 of file Element.h.

References m_vertex.

228  {
229  return m_vertex.size();
230  }
std::vector< NodeSharedPtr > m_vertex
List of element vertex nodes.
Definition: Element.h:502
NEKMESHUTILS_EXPORT std::vector<NodeSharedPtr> Nektar::NekMeshUtils::Element::GetVertexList ( ) const
inline

Access the list of vertex nodes.

Definition at line 166 of file Element.h.

References m_vertex.

167  {
168  return m_vertex;
169  }
std::vector< NodeSharedPtr > m_vertex
List of element vertex nodes.
Definition: Element.h:502
NEKMESHUTILS_EXPORT std::vector<NodeSharedPtr> Nektar::NekMeshUtils::Element::GetVolumeNodes ( ) const
inline

Access the list of volume nodes.

Definition at line 181 of file Element.h.

References m_volumeNodes.

182  {
183  return m_volumeNodes;
184  }
std::vector< NodeSharedPtr > m_volumeNodes
List of element volume nodes.
Definition: Element.h:508
NEKMESHUTILS_EXPORT std::string Nektar::NekMeshUtils::Element::GetXmlCurveString ( ) const
inline

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

Definition at line 423 of file Element.h.

References GetCurvedNodes().

424  {
425  // Temporary node list for reordering
426  std::vector<NodeSharedPtr> nodeList;
427 
428  GetCurvedNodes(nodeList);
429 
430  // Finally generate the XML string corresponding to our new
431  // node reordering.
432  std::stringstream s;
433  std::string str;
434  for (int k = 0; k < nodeList.size(); ++k)
435  {
436  s << std::scientific << std::setprecision(8) << " "
437  << nodeList[k]->m_x << " " << nodeList[k]->m_y << " "
438  << nodeList[k]->m_z << " ";
439  }
440  return s.str();
441  }
NEKMESHUTILS_EXPORT void GetCurvedNodes(std::vector< NodeSharedPtr > &nodeList) const
Definition: Element.h:326
virtual NEKMESHUTILS_EXPORT std::string Nektar::NekMeshUtils::Element::GetXmlString ( ) const
inlinevirtual

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

Definition at line 299 of file Element.h.

References m_dim, m_edge, m_face, and m_vertex.

300  {
301  std::stringstream s;
302  switch (m_dim)
303  {
304  case 1:
305  for (int j = 0; j < m_vertex.size(); ++j)
306  {
307  s << std::setw(5) << m_vertex[j]->m_id << " ";
308  }
309  break;
310  case 2:
311  for (int j = 0; j < m_edge.size(); ++j)
312  {
313  s << std::setw(5) << m_edge[j]->m_id << " ";
314  }
315  break;
316  case 3:
317  for (int j = 0; j < m_face.size(); ++j)
318  {
319  s << std::setw(5) << m_face[j]->m_id << " ";
320  }
321  break;
322  }
323  return s.str();
324  }
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::vector< FaceSharedPtr > m_face
List of element faces.
Definition: Element.h:506
NEKMESHUTILS_EXPORT void Nektar::NekMeshUtils::Element::Print ( )
inline

Definition at line 458 of file Element.h.

References m_edge, m_face, and m_vertex.

459  {
460  int i, j;
461  for (i = 0; i < m_vertex.size(); ++i)
462  {
463  std::cout << m_vertex[i]->m_x << " " << m_vertex[i]->m_y << " "
464  << m_vertex[i]->m_z << std::endl;
465  }
466  for (i = 0; i < m_edge.size(); ++i)
467  {
468  for (j = 0; j < m_edge[i]->m_edgeNodes.size(); ++j)
469  {
470  NodeSharedPtr n = m_edge[i]->m_edgeNodes[j];
471  std::cout << n->m_x << " " << n->m_y << " " << n->m_z
472  << std::endl;
473  }
474  }
475  for (i = 0; i < m_face.size(); ++i)
476  {
477  for (j = 0; j < m_face[i]->m_faceNodes.size(); ++j)
478  {
479  NodeSharedPtr n = m_face[i]->m_faceNodes[j];
480  std::cout << n->m_x << " " << n->m_y << " " << n->m_z
481  << std::endl;
482  }
483  }
484  }
std::vector< NodeSharedPtr > m_vertex
List of element vertex nodes.
Definition: Element.h:502
std::vector< EdgeSharedPtr > m_edge
List of element edges.
Definition: Element.h:504
boost::shared_ptr< Node > NodeSharedPtr
Definition: Node.h:50
std::vector< FaceSharedPtr > m_face
List of element faces.
Definition: Element.h:506
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 276 of file Element.h.

References m_boundaryLinks.

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

Definition at line 193 of file Element.h.

References m_curveType.

194  {
195  m_curveType = cT;
196  }
LibUtilities::PointsType m_curveType
Volume curve type.
Definition: Element.h:510
void Element::SetEdge ( unsigned int  p,
EdgeSharedPtr  pNew 
)

Replace an edge with another edge object.

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.

Definition at line 125 of file Element.cpp.

References m_edge, and m_face.

126 {
127  EdgeSharedPtr vOld = m_edge[p];
128  m_edge[p] = pNew;
129  for (unsigned int i = 0; i < m_face.size(); ++i)
130  {
131  for (unsigned int j = 0; j < m_face[i]->m_edgeList.size(); ++j)
132  {
133  if (m_face[i]->m_edgeList[j] == vOld)
134  {
135  m_face[i]->m_edgeList[j] = pNew;
136  }
137  }
138  }
139 }
std::vector< EdgeSharedPtr > m_edge
List of element edges.
Definition: Element.h:504
boost::shared_ptr< Edge > EdgeSharedPtr
Shared pointer to an edge.
Definition: Edge.h:196
std::vector< FaceSharedPtr > m_face
List of element faces.
Definition: Element.h:506
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 254 of file Element.h.

References m_edgeLink.

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

Replace a face with another face object.

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 149 of file Element.cpp.

References m_face.

150 {
151  m_face[p] = pNew;
152 }
std::vector< FaceSharedPtr > m_face
List of element faces.
Definition: Element.h:506
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 265 of file Element.h.

References m_faceLink.

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

Change the ID of the element.

Definition at line 242 of file Element.h.

References m_id.

243  {
244  m_id = p;
245  }
unsigned int m_id
ID of the element.
Definition: Element.h:492
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 294 of file Element.h.

References m_taglist.

295  {
296  m_taglist = tags;
297  }
std::vector< int > m_taglist
List of integers specifying properties of the element.
Definition: Element.h:500
void Element::SetVertex ( unsigned int  p,
NodeSharedPtr  pNew 
)

Replace a vertex with another vertex object.

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.

Definition at line 77 of file Element.cpp.

References m_edge, m_face, and m_vertex.

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

Definition at line 185 of file Element.h.

References m_volumeNodes.

186  {
187  m_volumeNodes = nodes;
188  }
std::vector< NodeSharedPtr > m_volumeNodes
List of element volume nodes.
Definition: Element.h:508

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 517 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 512 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 514 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 519 of file Element.h.

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

unsigned int Nektar::NekMeshUtils::Element::m_id
protected
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