35 #include "VertexElement.hpp"
39 template<
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)
61 template<
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);
94 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
100 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
107 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
112 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
115 return mFaces.size();
118 template<
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);
146 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
149 assert(index < mFaces.size());
150 return mFaces[index];
153 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
156 assert(index < mOrientations.size());
157 return mOrientations[index];
170 template<
unsigned SPACE_DIM>
176 template<
unsigned SPACE_DIM>
182 template<
unsigned SPACE_DIM>
188 template<
unsigned SPACE_DIM>
VertexElement(unsigned index, const std::vector< VertexElement< ELEMENT_DIM-1, SPACE_DIM > * > &rFaces, const std::vector< bool > &rOrientations)
unsigned GetNodeGlobalIndex(unsigned localIndex) const
bool FaceIsOrientatedClockwise(unsigned index) const
std::vector< VertexElement< ELEMENT_DIM-1, SPACE_DIM > * > mFaces
unsigned GetNumFaces() const
std::vector< bool > mOrientations
Node< SPACE_DIM > * GetNode(unsigned localIndex) const
std::vector< Node< SPACE_DIM > * > mNodes
VertexElement< ELEMENT_DIM-1, SPACE_DIM > * GetFace(unsigned index) const
unsigned GetNumNodes() const
void AddFace(VertexElement< ELEMENT_DIM-1, SPACE_DIM > *pFace)