00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef _BOUNDARYELEMENT_HPP_
00031 #define _BOUNDARYELEMENT_HPP_
00032
00033 #include "AbstractTetrahedralElement.hpp"
00034
00035 template <unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00036 class BoundaryElement : public AbstractTetrahedralElement<ELEMENT_DIM, SPACE_DIM>
00037 {
00038
00039 public:
00040 BoundaryElement(unsigned index, std::vector<Node<SPACE_DIM>*> nodes)
00041 : AbstractTetrahedralElement<ELEMENT_DIM, SPACE_DIM>(index, nodes)
00042 {
00043 RegisterWithNodes();
00044 }
00045
00051 BoundaryElement(unsigned index,
00052 Node<SPACE_DIM> *node)
00053 : AbstractTetrahedralElement<ELEMENT_DIM,SPACE_DIM>(index)
00054 {
00055 assert (ELEMENT_DIM == 0);
00056
00057
00058 this->mNodes.push_back(node);
00059
00060
00061
00062
00063
00064
00065 RegisterWithNodes();
00066 }
00067
00068 void RegisterWithNodes()
00069 {
00070 for (unsigned i=0; i<this->mNodes.size(); i++)
00071 {
00072 this->mNodes[i]->AddBoundaryElement(this->mIndex);
00073 }
00074 }
00075
00076 void ResetIndex(unsigned index)
00077 {
00078 for (unsigned i=0; i<this->GetNumNodes(); i++)
00079 {
00080 this->mNodes[i]->RemoveBoundaryElement(this->mIndex);
00081 }
00082 this->mIndex=index;
00083 RegisterWithNodes();
00084 }
00085
00086 void MarkAsDeleted()
00087 {
00088 this->mIsDeleted = true;
00089
00090
00091 for (unsigned i=0; i<this->GetNumNodes(); i++)
00092 {
00093 this->mNodes[i]->RemoveBoundaryElement(this->mIndex);
00094 }
00095 }
00100 void UpdateNode(const unsigned& rIndex, Node<SPACE_DIM>* pNode)
00101 {
00102 assert(rIndex < this->mNodes.size());
00103
00104
00105 this->mNodes[rIndex]->RemoveBoundaryElement(this->mIndex);
00106
00107
00108 this->mNodes[rIndex] = pNode;
00109
00110
00111 this->mNodes[rIndex]->AddBoundaryElement(this->mIndex);
00112 }
00113
00114 };
00115
00116
00117
00118 #endif //_BOUNDARYELEMENT_HPP_
00119