Nektar++
Public Member Functions | Protected Attributes | List of all members
Nektar::Utilities::Element Class Reference

Base class for element definitions. More...

#include <MeshElements.h>

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

Public Member Functions

 Element (ElmtConfig pConf, unsigned int pNumNodes, unsigned int pGotNodes)
 
unsigned int GetId () const
 Returns the ID of the element (or associated edge or face for boundary elements). More...
 
unsigned int GetDim () const
 Returns the expansion dimension of the element. More...
 
ElmtConfig GetConf () const
 Returns the configuration of the element. More...
 
std::string GetTag () const
 Returns the tag which defines the element shape. More...
 
NodeSharedPtr GetVertex (unsigned int i) const
 Access a vertex node. More...
 
EdgeSharedPtr GetEdge (unsigned int i) const
 Access an edge. More...
 
FaceSharedPtr GetFace (unsigned int i) const
 Access a face. More...
 
std::vector< NodeSharedPtrGetVertexList () const
 Access the list of vertex nodes. More...
 
std::vector< EdgeSharedPtrGetEdgeList () const
 Access the list of edges. More...
 
std::vector< FaceSharedPtrGetFaceList () const
 Access the list of faces. More...
 
std::vector< NodeSharedPtrGetVolumeNodes () const
 Access the list of volume nodes. More...
 
void SetVolumeNodes (std::vector< NodeSharedPtr > &nodes)
 
LibUtilities::PointsType GetCurveType () const
 
void SetCurveType (LibUtilities::PointsType cT)
 
unsigned int GetNodeCount () const
 Returns the total number of nodes (vertices, edge nodes and face nodes and volume nodes). More...
 
std::vector< int > GetTagList () const
 Access the list of tags associated with this element. More...
 
unsigned int GetVertexCount () const
 Returns the number of vertices. More...
 
unsigned int GetEdgeCount () const
 Returns the number of edges. More...
 
unsigned int GetFaceCount () const
 Returns the number of faces. More...
 
void SetId (unsigned int p)
 Change the ID of the element. More...
 
void SetVertex (unsigned int p, NodeSharedPtr pNew)
 Replace a vertex with another vertex object. More...
 
void SetEdge (unsigned int p, EdgeSharedPtr pNew)
 Replace an edge with another edge object. More...
 
void SetFace (unsigned int p, FaceSharedPtr pNew)
 Replace a face with another face object. More...
 
void SetEdgeLink (EdgeSharedPtr pLink)
 Set a correspondence between this element and an edge (2D boundary element). More...
 
EdgeSharedPtr GetEdgeLink ()
 Get correspondence between this element and an edge. More...
 
void SetFaceLink (FaceSharedPtr pLink)
 Set a correspondence between this element and a face (3D boundary element). More...
 
FaceSharedPtr GetFaceLink ()
 Get correspondence between this element and a face. More...
 
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...
 
int GetBoundaryLink (int i)
 Get the location of the boundary face/edge i for this element. More...
 
void SetTagList (const std::vector< int > &tags)
 Set the list of tags associated with this element. More...
 
virtual std::string GetXmlString () const
 Generate a list of vertices (1D), edges (2D), or faces (3D). More...
 
std::string GetXmlCurveString () const
 Generates a string listing the coordinates of all nodes associated with this element. More...
 
virtual SpatialDomains::GeometrySharedPtr GetGeom (int coordDim)
 Generate a Nektar++ geometry object for this element. More...
 
int GetMaxOrder ()
 Obtain the order of an element by looking at edges. More...
 
virtual void Complete (int order)
 Complete this object. More...
 
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 647 of file MeshElements.h.

Constructor & Destructor Documentation

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

Definition at line 68 of file MeshElements.cpp.

References Nektar::Utilities::ElmtConfig::m_e.

71  : m_conf(pConf),
73  m_geom()
74  {
75  if (pNumNodes != pGotNodes)
76  {
77  cerr << "Number of modes mismatch for type "
78  << pConf.m_e << "! Should be " << pNumNodes
79  << " but got " << pGotNodes << " nodes." << endl;
80  abort();
81  }
82  }
LibUtilities::PointsType m_curveType
Volume curve type.
Definition: MeshElements.h:994
SpatialDomains::GeometrySharedPtr m_geom
Nektar++ geometry object for this element.
1D Evenly-spaced points using Lagrange polynomial
Definition: PointsType.h:63
ElmtConfig m_conf
Contains configuration of the element.
Definition: MeshElements.h:980

Member Function Documentation

virtual void Nektar::Utilities::Element::Complete ( int  order)
inlinevirtual

Complete this object.

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

Definition at line 945 of file MeshElements.h.

References ASSERTL0.

946  {
947  ASSERTL0(false, "This function should be implemented at a shape level.");
948  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:161
int Nektar::Utilities::Element::GetBoundaryLink ( int  i)
inline

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

Definition at line 785 of file MeshElements.h.

References Nektar::iterator.

785  {
787  if (it == m_boundaryLinks.end())
788  {
789  return -1;
790  }
791  else
792  {
793  return it->second;
794  }
795  }
std::map< int, int > m_boundaryLinks
Array mapping faces/edges to the location of the appropriate boundary elements in m->element...
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
ElmtConfig Nektar::Utilities::Element::GetConf ( ) const
inline

Returns the configuration of the element.

Definition at line 665 of file MeshElements.h.

665  {
666  return m_conf;
667  }
ElmtConfig m_conf
Contains configuration of the element.
Definition: MeshElements.h:980
LibUtilities::PointsType Nektar::Utilities::Element::GetCurveType ( ) const
inline

Definition at line 705 of file MeshElements.h.

References Nektar::Utilities::Face::m_curveType.

705  {
706  return m_curveType;
707  }
LibUtilities::PointsType m_curveType
Volume curve type.
Definition: MeshElements.h:994
unsigned int Nektar::Utilities::Element::GetDim ( ) const
inline

Returns the expansion dimension of the element.

Definition at line 661 of file MeshElements.h.

661  {
662  return m_dim;
663  }
unsigned int m_dim
Dimension of the element.
Definition: MeshElements.h:978
EdgeSharedPtr Nektar::Utilities::Element::GetEdge ( unsigned int  i) const
inline

Access an edge.

Definition at line 679 of file MeshElements.h.

679  {
680  return m_edge[i];
681  }
std::vector< EdgeSharedPtr > m_edge
List of element edges.
Definition: MeshElements.h:988
unsigned int Nektar::Utilities::Element::GetEdgeCount ( ) const
inline

Returns the number of edges.

Definition at line 744 of file MeshElements.h.

744  {
745  return m_edge.size();
746  }
std::vector< EdgeSharedPtr > m_edge
List of element edges.
Definition: MeshElements.h:988
EdgeSharedPtr Nektar::Utilities::Element::GetEdgeLink ( )
inline

Get correspondence between this element and an edge.

Definition at line 767 of file MeshElements.h.

767  {
768  return m_edgeLink;
769  }
EdgeSharedPtr m_edgeLink
Pointer to the corresponding edge if element is a 2D boundary.
Definition: MeshElements.h:996
std::vector<EdgeSharedPtr> Nektar::Utilities::Element::GetEdgeList ( ) const
inline

Access the list of edges.

Definition at line 691 of file MeshElements.h.

691  {
692  return m_edge;
693  }
std::vector< EdgeSharedPtr > m_edge
List of element edges.
Definition: MeshElements.h:988
FaceSharedPtr Nektar::Utilities::Element::GetFace ( unsigned int  i) const
inline

Access a face.

Definition at line 683 of file MeshElements.h.

683  {
684  return m_face[i];
685  }
std::vector< FaceSharedPtr > m_face
List of element faces.
Definition: MeshElements.h:990
unsigned int Nektar::Utilities::Element::GetFaceCount ( ) const
inline

Returns the number of faces.

Definition at line 748 of file MeshElements.h.

748  {
749  return m_face.size();
750  }
std::vector< FaceSharedPtr > m_face
List of element faces.
Definition: MeshElements.h:990
FaceSharedPtr Nektar::Utilities::Element::GetFaceLink ( )
inline

Get correspondence between this element and a face.

Definition at line 776 of file MeshElements.h.

776  {
777  return m_faceLink;
778  }
FaceSharedPtr m_faceLink
Pointer to the corresponding face if element is a 3D boundary.
Definition: MeshElements.h:998
std::vector<FaceSharedPtr> Nektar::Utilities::Element::GetFaceList ( ) const
inline

Access the list of faces.

Definition at line 695 of file MeshElements.h.

695  {
696  return m_face;
697  }
std::vector< FaceSharedPtr > m_face
List of element faces.
Definition: MeshElements.h:990
virtual SpatialDomains::GeometrySharedPtr Nektar::Utilities::Element::GetGeom ( int  coordDim)
inlinevirtual

Generate a Nektar++ geometry object for this element.

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

Definition at line 938 of file MeshElements.h.

References ASSERTL0.

939  {
940  ASSERTL0(false, "This function should be implemented at a shape level.");
941  return boost::shared_ptr<SpatialDomains::Geometry>();
942  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:161
unsigned int Nektar::Utilities::Element::GetId ( ) const
inline

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

Definition at line 655 of file MeshElements.h.

References Nektar::Utilities::Face::m_id.

655  {
656  if (m_faceLink.get() != 0) return m_faceLink->m_id;
657  if (m_edgeLink.get() != 0) return m_edgeLink->m_id;
658  return m_id;
659  }
EdgeSharedPtr m_edgeLink
Pointer to the corresponding edge if element is a 2D boundary.
Definition: MeshElements.h:996
unsigned int m_id
ID of the element.
Definition: MeshElements.h:976
FaceSharedPtr m_faceLink
Pointer to the corresponding face if element is a 3D boundary.
Definition: MeshElements.h:998
int Element::GetMaxOrder ( )

Obtain the order of an element by looking at edges.

Definition at line 308 of file MeshElements.cpp.

References m_edge.

309  {
310  int i, ret = 1;
311 
312  for (i = 0; i < m_edge.size(); ++i)
313  {
314  int edgeOrder = m_edge[i]->GetNodeCount()-1;
315  if (edgeOrder > ret)
316  {
317  ret = edgeOrder;
318  }
319  }
320 
321  return ret;
322  }
std::vector< EdgeSharedPtr > m_edge
List of element edges.
Definition: MeshElements.h:988
unsigned int Nektar::Utilities::Element::GetNodeCount ( ) const
inline

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

Definition at line 713 of file MeshElements.h.

714  {
715  unsigned int n = m_volumeNodes.size();
716  if (m_dim == 1)
717  {
718  n += 2;
719  }
720  else if (m_dim == 2)
721  {
722  for (int i = 0; i < m_edge.size(); ++i)
723  {
724  n += m_edge[i]->GetNodeCount();
725  }
726  n -= m_vertex.size();
727  }
728  else
729  {
730  cerr << "Not supported." << endl;
731  exit(1);
732  }
733  return n;
734  }
std::vector< NodeSharedPtr > m_volumeNodes
List of element volume nodes.
Definition: MeshElements.h:992
unsigned int m_dim
Dimension of the element.
Definition: MeshElements.h:978
std::vector< NodeSharedPtr > m_vertex
List of element vertex nodes.
Definition: MeshElements.h:986
std::vector< EdgeSharedPtr > m_edge
List of element edges.
Definition: MeshElements.h:988
std::string Nektar::Utilities::Element::GetTag ( ) const
inline

Returns the tag which defines the element shape.

Definition at line 669 of file MeshElements.h.

669  {
670  if (m_faceLink.get() != 0) return "F";
671  if (m_edgeLink.get() != 0) return "E";
672  return m_tag;
673  }
EdgeSharedPtr m_edgeLink
Pointer to the corresponding edge if element is a 2D boundary.
Definition: MeshElements.h:996
std::string m_tag
Tag character describing the element.
Definition: MeshElements.h:982
FaceSharedPtr m_faceLink
Pointer to the corresponding face if element is a 3D boundary.
Definition: MeshElements.h:998
std::vector<int> Nektar::Utilities::Element::GetTagList ( ) const
inline

Access the list of tags associated with this element.

Definition at line 736 of file MeshElements.h.

736  {
737  return m_taglist;
738  }
std::vector< int > m_taglist
List of integers specifying properties of the element.
Definition: MeshElements.h:984
NodeSharedPtr Nektar::Utilities::Element::GetVertex ( unsigned int  i) const
inline

Access a vertex node.

Definition at line 675 of file MeshElements.h.

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

675  {
676  return m_vertex[i];
677  }
std::vector< NodeSharedPtr > m_vertex
List of element vertex nodes.
Definition: MeshElements.h:986
unsigned int Nektar::Utilities::Element::GetVertexCount ( ) const
inline

Returns the number of vertices.

Definition at line 740 of file MeshElements.h.

740  {
741  return m_vertex.size();
742  }
std::vector< NodeSharedPtr > m_vertex
List of element vertex nodes.
Definition: MeshElements.h:986
std::vector<NodeSharedPtr> Nektar::Utilities::Element::GetVertexList ( ) const
inline

Access the list of vertex nodes.

Definition at line 687 of file MeshElements.h.

687  {
688  return m_vertex;
689  }
std::vector< NodeSharedPtr > m_vertex
List of element vertex nodes.
Definition: MeshElements.h:986
std::vector<NodeSharedPtr> Nektar::Utilities::Element::GetVolumeNodes ( ) const
inline

Access the list of volume nodes.

Definition at line 699 of file MeshElements.h.

699  {
700  return m_volumeNodes;
701  }
std::vector< NodeSharedPtr > m_volumeNodes
List of element volume nodes.
Definition: MeshElements.h:992
std::string Nektar::Utilities::Element::GetXmlCurveString ( ) const
inline

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

Definition at line 831 of file MeshElements.h.

832  {
833  // Temporary node list for reordering
834  std::vector<NodeSharedPtr> nodeList;
835 
836  // Node orderings are different for different elements.
837  // Triangle
838  if (m_vertex.size() == 2)
839  {
840  nodeList.push_back(m_vertex[0]);
841  for (int i = 0; i < m_volumeNodes.size(); ++i)
842  {
843  nodeList.push_back(m_volumeNodes[i]);
844  }
845  nodeList.push_back(m_vertex[1]);
846  }
847  else if (m_vertex.size() == 3)
848  {
849  int n = m_edge[0]->GetNodeCount();
850  nodeList.resize(n*(n+1)/2);
851 
852  // Populate nodelist
853  std::copy(m_vertex.begin(), m_vertex.end(), nodeList.begin());
854  for (int i = 0; i < 3; ++i)
855  {
856  std::copy(m_edge[i]->m_edgeNodes.begin(),
857  m_edge[i]->m_edgeNodes.end(),
858  nodeList.begin() + 3 + i*(n-2));
859  if (m_edge[i]->m_n1 != m_vertex[i])
860  {
861  // If edge orientation is reversed relative to node
862  // ordering, we need to reverse order of nodes.
863  std::reverse(nodeList.begin() + 3 + i*(n-2),
864  nodeList.begin() + 3 + (i+1)*(n-2));
865  }
866  }
867 
868  // Copy volume nodes.
869  std::copy(m_volumeNodes.begin(), m_volumeNodes.end(),
870  nodeList.begin() + 3*(n-1));
871  }
872  // Quad
873  else if (m_dim == 2 && m_vertex.size() == 4)
874  {
875  int n = m_edge[0]->GetNodeCount();
876  nodeList.resize(n*n);
877 
878  // Write vertices
879  nodeList[0] = m_vertex[0];
880  nodeList[n-1] = m_vertex[1];
881  nodeList[n*n-1] = m_vertex[2];
882  nodeList[n*(n-1)] = m_vertex[3];
883 
884  // Write edge-interior
885  int skips[4][2] = {{0,1}, {n-1,n}, {n*n-1,-1}, {n*(n-1),-n}};
886  for (int i = 0; i < 4; ++i)
887  {
888  bool reverseEdge = m_edge[i]->m_n1 == m_vertex[i];
889 
890  if (!reverseEdge)
891  {
892  for (int j = 1; j < n-1; ++j)
893  {
894  nodeList[skips[i][0] + j*skips[i][1]] =
895  m_edge[i]->m_edgeNodes[n-2-j];
896  }
897  }
898  else
899  {
900  for (int j = 1; j < n-1; ++j)
901  {
902  nodeList[skips[i][0] + j*skips[i][1]] =
903  m_edge[i]->m_edgeNodes[j-1];
904  }
905  }
906  }
907 
908  // Write interior
909  for (int i = 1; i < n-1; ++i)
910  {
911  for (int j = 1; j < n-1; ++j)
912  {
913  nodeList[i*n+j] = m_volumeNodes[(i-1)*(n-2)+(j-1)];
914  }
915  }
916  }
917  else
918  {
919  cerr << "GetXmlCurveString for a " << m_vertex.size()
920  << "-vertex element is not yet implemented." << endl;
921  }
922 
923  // Finally generate the XML string corresponding to our new
924  // node reordering.
925  std::stringstream s;
926  std::string str;
927  for (int k = 0; k < nodeList.size(); ++k)
928  {
929  s << std::scientific << std::setprecision(8) << " "
930  << nodeList[k]->m_x << " " << nodeList[k]->m_y
931  << " " << nodeList[k]->m_z << " ";
932 
933  }
934  return s.str();
935  }
std::vector< NodeSharedPtr > m_volumeNodes
List of element volume nodes.
Definition: MeshElements.h:992
unsigned int m_dim
Dimension of the element.
Definition: MeshElements.h:978
std::vector< NodeSharedPtr > m_vertex
List of element vertex nodes.
Definition: MeshElements.h:986
std::vector< EdgeSharedPtr > m_edge
List of element edges.
Definition: MeshElements.h:988
virtual std::string Nektar::Utilities::Element::GetXmlString ( ) const
inlinevirtual

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

Definition at line 802 of file MeshElements.h.

803  {
804  std::stringstream s;
805  switch (m_dim)
806  {
807  case 1:
808  for(int j=0; j< m_vertex.size(); ++j)
809  {
810  s << std::setw(5) << m_vertex[j]->m_id << " ";
811  }
812  break;
813  case 2:
814  for(int j=0; j< m_edge.size(); ++j)
815  {
816  s << std::setw(5) << m_edge[j]->m_id << " ";
817  }
818  break;
819  case 3:
820  for(int j=0; j< m_face.size(); ++j)
821  {
822  s << std::setw(5) << m_face[j]->m_id << " ";
823  }
824  break;
825  }
826  return s.str();
827  }
std::vector< FaceSharedPtr > m_face
List of element faces.
Definition: MeshElements.h:990
unsigned int m_dim
Dimension of the element.
Definition: MeshElements.h:978
std::vector< NodeSharedPtr > m_vertex
List of element vertex nodes.
Definition: MeshElements.h:986
std::vector< EdgeSharedPtr > m_edge
List of element edges.
Definition: MeshElements.h:988
void Nektar::Utilities::Element::Print ( )
inline

Definition at line 949 of file MeshElements.h.

950  {
951  int i, j;
952  for (i = 0; i < m_vertex.size(); ++i)
953  {
954  cout << m_vertex[i]->m_x << " " << m_vertex[i]->m_y << " " << m_vertex[i]->m_z << endl;
955  }
956  for (i = 0; i < m_edge.size(); ++i)
957  {
958  for (j = 0; j < m_edge[i]->m_edgeNodes.size(); ++j)
959  {
960  NodeSharedPtr n = m_edge[i]->m_edgeNodes[j];
961  cout << n->m_x << " " << n->m_y << " " << n->m_z << endl;
962  }
963  }
964  for (i = 0; i < m_face.size(); ++i)
965  {
966  for (j = 0; j < m_face[i]->m_faceNodes.size(); ++j)
967  {
968  NodeSharedPtr n = m_face[i]->m_faceNodes[j];
969  cout << n->m_x << " " << n->m_y << " " << n->m_z << endl;
970  }
971  }
972  }
std::vector< FaceSharedPtr > m_face
List of element faces.
Definition: MeshElements.h:990
boost::shared_ptr< Node > NodeSharedPtr
Shared pointer to a Node.
Definition: MeshElements.h:195
std::vector< NodeSharedPtr > m_vertex
List of element vertex nodes.
Definition: MeshElements.h:986
std::vector< EdgeSharedPtr > m_edge
List of element edges.
Definition: MeshElements.h:988
void Nektar::Utilities::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 781 of file MeshElements.h.

781  {
782  m_boundaryLinks[i] = j;
783  }
std::map< int, int > m_boundaryLinks
Array mapping faces/edges to the location of the appropriate boundary elements in m->element...
void Nektar::Utilities::Element::SetCurveType ( LibUtilities::PointsType  cT)
inline

Definition at line 708 of file MeshElements.h.

References Nektar::Utilities::Face::m_curveType.

708  {
709  m_curveType = cT;
710  }
LibUtilities::PointsType m_curveType
Volume curve type.
Definition: MeshElements.h:994
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 276 of file MeshElements.cpp.

References m_edge, and m_face.

277  {
278  EdgeSharedPtr vOld = m_edge[p];
279  m_edge[p] = pNew;
280  for (unsigned int i = 0; i < m_face.size(); ++i)
281  {
282  for (unsigned int j = 0; j < m_face[i]->m_edgeList.size(); ++j)
283  {
284  if (m_face[i]->m_edgeList[j] == vOld)
285  {
286  m_face[i]->m_edgeList[j] = pNew;
287  }
288  }
289  }
290  }
boost::shared_ptr< Edge > EdgeSharedPtr
Shared pointer to an edge.
Definition: MeshElements.h:318
std::vector< FaceSharedPtr > m_face
List of element faces.
Definition: MeshElements.h:990
std::vector< EdgeSharedPtr > m_edge
List of element edges.
Definition: MeshElements.h:988
void Nektar::Utilities::Element::SetEdgeLink ( EdgeSharedPtr  pLink)
inline

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

Definition at line 763 of file MeshElements.h.

763  {
764  m_edgeLink = pLink;
765  }
EdgeSharedPtr m_edgeLink
Pointer to the corresponding edge if element is a 2D boundary.
Definition: MeshElements.h:996
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 300 of file MeshElements.cpp.

References m_face.

301  {
302  m_face[p] = pNew;
303  }
std::vector< FaceSharedPtr > m_face
List of element faces.
Definition: MeshElements.h:990
void Nektar::Utilities::Element::SetFaceLink ( FaceSharedPtr  pLink)
inline

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

Definition at line 772 of file MeshElements.h.

772  {
773  m_faceLink = pLink;
774  }
FaceSharedPtr m_faceLink
Pointer to the corresponding face if element is a 3D boundary.
Definition: MeshElements.h:998
void Nektar::Utilities::Element::SetId ( unsigned int  p)
inline

Change the ID of the element.

Definition at line 752 of file MeshElements.h.

References Nektar::Utilities::Face::m_id.

752  {
753  m_id = p;
754  }
unsigned int m_id
ID of the element.
Definition: MeshElements.h:976
void Nektar::Utilities::Element::SetTagList ( const std::vector< int > &  tags)
inline

Set the list of tags associated with this element.

Definition at line 797 of file MeshElements.h.

798  {
799  m_taglist = tags;
800  }
std::vector< int > m_taglist
List of integers specifying properties of the element.
Definition: MeshElements.h:984
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 228 of file MeshElements.cpp.

References m_edge, m_face, and m_vertex.

229  {
230  NodeSharedPtr vOld = m_vertex[p];
231  m_vertex[p] = pNew;
232  for (unsigned int i = 0; i < m_edge.size(); ++i)
233  {
234  if (m_edge[i]->m_n1 == vOld)
235  {
236  m_edge[i]->m_n1 = pNew;
237  }
238  else if (m_edge[i]->m_n2 == vOld)
239  {
240  m_edge[i]->m_n2 = pNew;
241  }
242  }
243  for (unsigned int i = 0; i < m_face.size(); ++i)
244  {
245  // Replace vertices in faces
246  for (unsigned int j = 0; j < m_face[i]->m_vertexList.size(); ++j)
247  {
248  if (m_face[i]->m_vertexList[j] == vOld)
249  {
250  m_face[i]->m_vertexList[j] = pNew;
251  }
252  }
253  for (unsigned int j = 0; j < m_face[i]->m_edgeList.size(); ++j)
254  {
255  if (m_face[i]->m_edgeList[j]->m_n1 == vOld)
256  {
257  m_face[i]->m_edgeList[j]->m_n1 = pNew;
258  }
259  else if (m_face[i]->m_edgeList[j]->m_n2 == vOld)
260  {
261  m_face[i]->m_edgeList[j]->m_n2 = pNew;
262  }
263  }
264  }
265  }
std::vector< FaceSharedPtr > m_face
List of element faces.
Definition: MeshElements.h:990
boost::shared_ptr< Node > NodeSharedPtr
Shared pointer to a Node.
Definition: MeshElements.h:195
std::vector< NodeSharedPtr > m_vertex
List of element vertex nodes.
Definition: MeshElements.h:986
std::vector< EdgeSharedPtr > m_edge
List of element edges.
Definition: MeshElements.h:988
void Nektar::Utilities::Element::SetVolumeNodes ( std::vector< NodeSharedPtr > &  nodes)
inline

Definition at line 702 of file MeshElements.h.

702  {
703  m_volumeNodes = nodes;
704  }
std::vector< NodeSharedPtr > m_volumeNodes
List of element volume nodes.
Definition: MeshElements.h:992

Member Data Documentation

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

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

Definition at line 1001 of file MeshElements.h.

ElmtConfig Nektar::Utilities::Element::m_conf
protected
LibUtilities::PointsType Nektar::Utilities::Element::m_curveType
protected

Volume curve type.

Definition at line 994 of file MeshElements.h.

Referenced by Nektar::Utilities::Line::GetGeom(), and Nektar::Utilities::Triangle::Triangle().

unsigned int Nektar::Utilities::Element::m_dim
protected
std::vector<EdgeSharedPtr> Nektar::Utilities::Element::m_edge
protected
EdgeSharedPtr Nektar::Utilities::Element::m_edgeLink
protected

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

Definition at line 996 of file MeshElements.h.

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

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

Definition at line 998 of file MeshElements.h.

SpatialDomains::GeometrySharedPtr Nektar::Utilities::Element::m_geom
protected

Nektar++ geometry object for this element.

Definition at line 1003 of file MeshElements.h.

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

unsigned int Nektar::Utilities::Element::m_id
protected
std::string Nektar::Utilities::Element::m_tag
protected
std::vector<int> Nektar::Utilities::Element::m_taglist
protected
std::vector<NodeSharedPtr> Nektar::Utilities::Element::m_vertex
protected
std::vector<NodeSharedPtr> Nektar::Utilities::Element::m_volumeNodes
protected