36 #ifndef POTTSMESH_HPP_
37 #define POTTSMESH_HPP_
40 template<
unsigned DIM>
48 #include <boost/serialization/vector.hpp>
49 #include <boost/serialization/set.hpp>
50 #include <boost/serialization/base_object.hpp>
51 #include <boost/serialization/split_member.hpp>
53 #include "AbstractMesh.hpp"
54 #include "ArchiveLocationInfo.hpp"
55 #include "PottsMeshReader.hpp"
56 #include "PottsMeshWriter.hpp"
57 #include "PottsElement.hpp"
62 template<
unsigned DIM>
65 friend class TestPottsMesh;
111 friend class boost::serialization::access;
120 template<
class Archive>
121 void save(Archive & archive,
const unsigned int version)
const
127 archive & boost::serialization::base_object<AbstractMesh<DIM, DIM> >(*this);
142 template<
class Archive>
143 void load(Archive & archive,
const unsigned int version)
149 archive & boost::serialization::base_object<AbstractMesh<DIM, DIM> >(*this);
154 BOOST_SERIALIZATION_SPLIT_MEMBER()
163 class PottsElementIterator;
191 std::vector< std::set<
unsigned> > vonNeumannNeighbouringNodeIndices,
192 std::vector< std::set<
unsigned> > mooreNeighbouringNodeIndices);
247 virtual
void Clear();
319 bool placeOriginalElementBelow=false);
350 class PottsElementIterator
379 inline PottsElementIterator& operator++();
393 bool skipDeletedElements=
true);
408 inline bool IsAtEnd();
413 inline bool IsAllowedElement();
424 template<
unsigned DIM>
426 bool skipDeletedElements)
431 template<
unsigned DIM>
436 template<
unsigned DIM>
443 template<
unsigned DIM>
447 return *mElementIter;
450 template<
unsigned DIM>
456 template<
unsigned DIM>
463 while (!IsAtEnd() && !IsAllowedElement());
468 template<
unsigned DIM>
472 bool skipDeletedElements)
474 mElementIter(elementIter),
475 mSkipDeletedElements(skipDeletedElements)
477 if (
mrMesh.mElements.empty())
492 template<
unsigned DIM>
495 return mElementIter == mrMesh.mElements.end();
498 template<
unsigned DIM>
501 return !(mSkipDeletedElements && (*this)->IsDeleted());
unsigned AddElement(PottsElement< DIM > *pNewElement)
unsigned SolveBoundaryElementMapping(unsigned index) const
void DeleteNode(unsigned index)
void DeleteElement(unsigned index)
virtual double GetVolumeOfElement(unsigned index)
static std::string GetMeshFilename()
void load(Archive &archive, const unsigned int version)
void ConstructFromMeshReader(AbstractMeshReader< DIM, DIM > &rMeshReader)
std::vector< std::set< unsigned > > mMooreNeighbouringNodeIndices
void RemoveDeletedElements()
std::set< unsigned > GetVonNeumannNeighbouringNodeIndices(unsigned nodeIndex)
unsigned GetNumAllElements() const
void WriteFilesUsingMesh(PottsMesh< SPACE_DIM > &rMesh)
std::vector< PottsElement< DIM > * > mElements
void save(Archive &archive, const unsigned int version) const
std::set< unsigned > GetMooreNeighbouringNodeIndices(unsigned nodeIndex)
unsigned SolveElementMapping(unsigned index) const
unsigned DivideElement(PottsElement< DIM > *pElement, bool placeOriginalElementBelow=false)
PottsElement< DIM > * operator->()
virtual c_vector< double, DIM > GetCentroidOfElement(unsigned index)
PottsElementIterator(PottsMesh< DIM > &rMesh, typename std::vector< PottsElement< DIM > * >::iterator elementIter, bool skipDeletedElements=true)
PottsElementIterator GetElementIteratorBegin(bool skipDeletedElements=true)
virtual unsigned GetNumNodes() const
#define EXPORT_TEMPLATE_CLASS_SAME_DIMS(CLASS)
bool operator!=(const typename PottsMesh< DIM >::PottsElementIterator &rOther)
virtual double GetSurfaceAreaOfElement(unsigned index)
bool mSkipDeletedElements
PottsElementIterator GetElementIteratorEnd()
std::set< unsigned > GetNeighbouringElementIndices(unsigned elementIndex)
std::vector< unsigned > mDeletedElementIndices
PottsElement< DIM > * GetElement(unsigned index) const
PottsElement< DIM > & operator*()
std::vector< PottsElement< DIM > * >::iterator mElementIter
virtual unsigned GetNumElements() const
PottsMesh< DIM > & mrMesh
unsigned SolveNodeMapping(unsigned index) const
static std::string GetArchiveDirectory()
static std::string GetArchiveRelativePath()
std::vector< std::set< unsigned > > mVonNeumannNeighbouringNodeIndices
PottsElementIterator & operator++()