MutableMesh.hpp

00001 /*
00002 
00003 Copyright (C) University of Oxford, 2005-2009
00004 
00005 University of Oxford means the Chancellor, Masters and Scholars of the
00006 University of Oxford, having an administrative office at Wellington
00007 Square, Oxford OX1 2JD, UK.
00008 
00009 This file is part of Chaste.
00010 
00011 Chaste is free software: you can redistribute it and/or modify it
00012 under the terms of the GNU Lesser General Public License as published
00013 by the Free Software Foundation, either version 2.1 of the License, or
00014 (at your option) any later version.
00015 
00016 Chaste is distributed in the hope that it will be useful, but WITHOUT
00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
00019 License for more details. The offer of Chaste under the terms of the
00020 License is subject to the License being interpreted in accordance with
00021 English Law and subject to any action against the University of Oxford
00022 being under the jurisdiction of the English Courts.
00023 
00024 You should have received a copy of the GNU Lesser General Public License
00025 along with Chaste. If not, see <http://www.gnu.org/licenses/>.
00026 
00027 */
00028 
00029 #ifndef MUTABLEMESH_HPP_
00030 #define MUTABLEMESH_HPP_
00031 
00032 //#include <boost/serialization/access.hpp>
00033 //
00035 //#define REAL double
00036 //#define VOID void
00037 //#include "triangle.h"
00038 //#undef REAL
00039 //
00040 //#include <boost/serialization/export.hpp>
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 /*MUTABLEMESH_HPP_*/

Generated on Wed Mar 18 12:51:52 2009 for Chaste by  doxygen 1.5.5