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 #ifndef MUTABLEMESH_HPP_
00030 #define MUTABLEMESH_HPP_
00031
00032
00033
00035
00036
00037
00038
00039
00040
00041
00042 #include "TetrahedralMesh.hpp"
00043
00044 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00045 class MutableMesh : public TetrahedralMesh<ELEMENT_DIM, SPACE_DIM>
00046 {
00047 protected:
00048
00051 std::vector<unsigned> mDeletedElementIndices;
00052 std::vector<unsigned> mDeletedBoundaryElementIndices;
00053 std::vector<unsigned> mDeletedNodeIndices;
00054 bool mAddedNodes;
00055
00056
00057 private:
00058
00065 #define COVERAGE_IGNORE
00066 bool CheckVoronoi(Element<ELEMENT_DIM, SPACE_DIM> *pElement, double maxPenetration);
00067 #undef COVERAGE_IGNORE
00068
00069 public:
00070 MutableMesh();
00071 MutableMesh(std::vector<Node<SPACE_DIM> *> nodes);
00072
00073 virtual ~MutableMesh();
00074
00075 void Clear();
00076
00077 unsigned GetNumNodes() const;
00078 unsigned GetNumElements() const;
00079 unsigned GetNumBoundaryElements() const;
00081
00082 void RescaleMeshFromBoundaryNode(ChastePoint<1> updatedPoint, unsigned boundaryNodeIndex);
00083
00090 virtual unsigned AddNode(Node<SPACE_DIM> *pNewNode);
00091
00092 virtual void SetNode(unsigned index, ChastePoint<SPACE_DIM> point, bool concreteMove=true);
00093 void MoveMergeNode(unsigned index, unsigned targetIndex, bool concreteMove=true);
00094
00095 #define COVERAGE_IGNORE
00096 void DeleteNode(unsigned index);
00097 #undef COVERAGE_IGNORE
00098
00099 #define COVERAGE_IGNORE
00100 void DeleteNodePriorToReMesh(unsigned index);
00101 #undef COVERAGE_IGNORE
00102
00103 unsigned RefineElement(Element<ELEMENT_DIM,SPACE_DIM>* pElement, ChastePoint<SPACE_DIM> Point);
00104
00117 void DeleteBoundaryNodeAt(unsigned index);
00118
00122 #define COVERAGE_IGNORE
00123 void ReIndex(NodeMap& map);
00124 #undef COVERAGE_IGNORE
00125
00131 #define COVERAGE_IGNORE
00132 virtual void ReMesh(NodeMap& map);
00133 #undef COVERAGE_IGNORE
00134
00139 #define COVERAGE_IGNORE
00140 void ReMesh();
00141 #undef COVERAGE_IGNORE
00142
00150 #define COVERAGE_IGNORE
00151 bool CheckVoronoi(double maxPenetration=0.0);
00152 #undef COVERAGE_IGNORE
00153 };
00154
00155
00156 #endif