35 #include "MutableElement.hpp" 36 #include "RandomNumberGenerator.hpp" 40 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
46 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
51 if (SPACE_DIM == ELEMENT_DIM)
57 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
62 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
65 for (
unsigned i=0; i<this->
mNodes.size(); i++)
71 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
84 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
95 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
98 assert(rIndex < this->
mNodes.size());
104 this->
mNodes[rIndex] = pNode;
110 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
113 assert(rIndex < this->
mNodes.size());
122 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
133 this->
mNodes.push_back(pNode);
140 assert(rIndex < this->
mNodes.size());
143 this->
mNodes.insert(this->
mNodes.begin() + rIndex+1, pNode);
150 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
153 unsigned local_index = UINT_MAX;
154 for (
unsigned i=0; i<this->
mNodes.size(); i++)
164 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
167 bool is_element_on_boundary =
false;
168 for (
unsigned i=0; i<this->
mNodes.size(); i++)
170 if (this->
GetNode(i)->IsBoundaryNode())
172 is_element_on_boundary =
true;
176 return is_element_on_boundary;
189 template<
unsigned SPACE_DIM>
194 assert(this->
mNodes.size() == 2);
195 assert(SPACE_DIM > 0);
198 template<
unsigned SPACE_DIM>
203 template<
unsigned SPACE_DIM>
206 for (
unsigned i=0; i<this->
mNodes.size(); i++)
212 template<
unsigned SPACE_DIM>
225 template <
unsigned SPACE_DIM>
236 template<
unsigned SPACE_DIM>
239 assert(rIndex < this->
mNodes.size());
245 this->
mNodes[rIndex] = pNode;
251 template<
unsigned SPACE_DIM>
254 assert(rIndex < this->
mNodes.size());
263 template<
unsigned SPACE_DIM>
266 assert(rIndex < this->
mNodes.size());
269 this->
mNodes.insert(this->
mNodes.begin() + rIndex+1, pNode);
275 template<
unsigned SPACE_DIM>
278 unsigned local_index = UINT_MAX;
279 for (
unsigned i=0; i<this->
mNodes.size(); i++)
289 template<
unsigned SPACE_DIM>
292 bool is_element_on_boundary =
false;
293 for (
unsigned i=0; i<this->
mNodes.size(); i++)
295 if (this->
GetNode(i)->IsBoundaryNode())
297 is_element_on_boundary =
true;
301 return is_element_on_boundary;
void UpdateNode(const unsigned &rIndex, Node< SPACE_DIM > *pNode)
unsigned GetNodeGlobalIndex(unsigned localIndex) const
Node< SPACE_DIM > * GetNode(unsigned localIndex) const
void ResetIndex(unsigned index)
std::vector< Node< SPACE_DIM > * > mNodes
void AddNode(Node< SPACE_DIM > *pNode, const unsigned &rIndex)
unsigned GetNumNodes() const
MutableElement(unsigned index)
virtual bool IsElementOnBoundary() const
void DeleteNode(const unsigned &rIndex)
unsigned GetNodeLocalIndex(unsigned globalIndex) const
virtual ~MutableElement()