35#include "VertexElement.hpp"
39template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
42 const std::vector<bool>& rOrientations,
46 mOrientations(rOrientations)
49 assert(SPACE_DIM == 3);
54 if (SPACE_DIM == ELEMENT_DIM)
61template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
64 const std::vector<bool>& rOrientations)
67 mOrientations(rOrientations)
73 std::set<Node<SPACE_DIM>* > nodes_set;
74 for (
unsigned face_index=0; face_index<
mFaces.size(); face_index++)
76 for (
unsigned node_index=0; node_index<
mFaces[face_index]->GetNumNodes(); node_index++)
83 for (
typename std::set<
Node<SPACE_DIM>* >::iterator node_iter = nodes_set.begin();
84 node_iter != nodes_set.end();
87 this->
mNodes.push_back(*node_iter);
94template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
100template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
107template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
112template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
115 return mFaces.size();
118template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
122 this->mFaces.push_back(pFace);
125 std::set<unsigned> node_indices;
126 for (
unsigned local_index=0; local_index<this->GetNumNodes(); local_index++)
128 node_indices.insert(this->GetNodeGlobalIndex(local_index));
132 unsigned end_index = this->GetNumNodes()-1;
133 for (
unsigned local_index=0; local_index<pFace->
GetNumNodes(); local_index++)
137 if (node_indices.find(global_index) == node_indices.end())
140 this->AddNode(pFace->
GetNode(local_index), end_index);
146template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
149 assert(index < mFaces.size());
150 return mFaces[index];
153template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
156 assert(index < mOrientations.size());
157 return mOrientations[index];
170template<
unsigned SPACE_DIM>
176template<
unsigned SPACE_DIM>
182template<
unsigned SPACE_DIM>
188template<
unsigned SPACE_DIM>
Node< SPACE_DIM > * GetNode(unsigned localIndex) const
unsigned GetNumNodes() const
unsigned GetNodeGlobalIndex(unsigned localIndex) const
std::vector< Node< SPACE_DIM > * > mNodes
VertexElement< ELEMENT_DIM-1, SPACE_DIM > * GetFace(unsigned index) const
std::vector< bool > mOrientations
void AddFace(VertexElement< ELEMENT_DIM-1, SPACE_DIM > *pFace)
VertexElement(unsigned index, const std::vector< VertexElement< ELEMENT_DIM-1, SPACE_DIM > * > &rFaces, const std::vector< bool > &rOrientations)
std::vector< VertexElement< ELEMENT_DIM-1, SPACE_DIM > * > mFaces
bool FaceIsOrientatedClockwise(unsigned index) const
unsigned GetNumFaces() const