35 #ifndef VERTEXMESH_HPP_
36 #define VERTEXMESH_HPP_
39 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
47 #include <boost/serialization/vector.hpp>
48 #include <boost/serialization/base_object.hpp>
49 #include <boost/serialization/split_member.hpp>
51 #include "AbstractMesh.hpp"
52 #include "ArchiveLocationInfo.hpp"
53 #include "VertexMeshReader.hpp"
54 #include "VertexMeshWriter.hpp"
55 #include "VertexElement.hpp"
56 #include "VertexElementMap.hpp"
57 #include "TetrahedralMesh.hpp"
73 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
76 friend class TestVertexMesh;
81 std::vector<VertexElement<ELEMENT_DIM, SPACE_DIM>*>
mElements;
160 bool ElementIncludesPoint(
const c_vector<double, SPACE_DIM>& rTestPoint,
unsigned elementIndex);
174 friend class boost::serialization::access;
183 template<
class Archive>
184 void save(Archive & archive,
const unsigned int version)
const
186 archive & boost::serialization::base_object<AbstractMesh<ELEMENT_DIM,SPACE_DIM> >(*this);
201 template<
class Archive>
202 void load(Archive & archive,
const unsigned int version)
204 archive & boost::serialization::base_object<AbstractMesh<ELEMENT_DIM,SPACE_DIM> >(*this);
209 BOOST_SERIALIZATION_SPLIT_MEMBER()
214 class VertexElementIterator;
235 std::vector<
VertexElement<ELEMENT_DIM, SPACE_DIM>*> vertexElements);
246 std::vector<
VertexElement<ELEMENT_DIM,SPACE_DIM>*> vertexElements);
340 virtual
void Clear();
380 virtual c_vector<
double, SPACE_DIM>
GetVectorFromAtoB(const c_vector<
double, SPACE_DIM>& rLocationA,
381 const c_vector<
double, SPACE_DIM>& rLocationB);
492 double GetEdgeLength(
unsigned elementIndex1,
unsigned elementIndex2);
592 class VertexElementIterator
619 inline VertexElementIterator& operator++();
633 bool skipDeletedElements=
true);
640 typename std::vector<VertexElement<ELEMENT_DIM, SPACE_DIM> *>::iterator
mElementIter;
649 inline bool IsAtEnd();
655 inline bool IsAllowedElement();
667 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
669 bool skipDeletedElements)
674 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
680 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
687 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
691 return *mElementIter;
694 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
700 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
707 while (!IsAtEnd() && !IsAllowedElement());
712 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
716 bool skipDeletedElements)
718 mElementIter(elementIter),
719 mSkipDeletedElements(skipDeletedElements)
736 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
739 return mElementIter == mrMesh.mElements.end();
742 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
745 return !(mSkipDeletedElements && (*this)->IsDeleted());
virtual c_vector< double, 3 > CalculateMomentsOfElement(unsigned index)
void ConstructFromMeshReader(AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &rMeshReader)
VertexElement< ELEMENT_DIM-1, SPACE_DIM > * GetFace(unsigned index) const
unsigned GetDelaunayNodeIndexCorrespondingToVoronoiElementIndex(unsigned elementIndex)
virtual unsigned GetNumFaces() const
VertexElement< ELEMENT_DIM, SPACE_DIM > * operator->()
VertexElement< ELEMENT_DIM, SPACE_DIM > & operator*()
virtual c_vector< double, SPACE_DIM > GetVectorFromAtoB(const c_vector< double, SPACE_DIM > &rLocationA, const c_vector< double, SPACE_DIM > &rLocationB)
std::set< unsigned > GetNeighbouringNodeIndices(unsigned nodeIndex)
virtual unsigned GetNumElements() const
static std::string GetMeshFilename()
unsigned GetNumAllElements() const
void WriteFilesUsingMesh(VertexMesh< ELEMENT_DIM, SPACE_DIM > &rMesh)
bool mSkipDeletedElements
VertexElementIterator(VertexMesh< ELEMENT_DIM, SPACE_DIM > &rMesh, typename std::vector< VertexElement< ELEMENT_DIM, SPACE_DIM > * >::iterator elementIter, bool skipDeletedElements=true)
void save(Archive &archive, const unsigned int version) const
virtual unsigned GetNumNodes() const
void GenerateVerticesFromElementCircumcentres(TetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &rMesh)
void load(Archive &archive, const unsigned int version)
c_vector< double, SPACE_DIM > GetNextEdgeGradientOfElementAtNode(VertexElement< ELEMENT_DIM, SPACE_DIM > *pElement, unsigned localIndex)
std::set< unsigned > GetNeighbouringNodeNotAlsoInElement(unsigned nodeIndex, unsigned elemIndex)
bool operator!=(const typename VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexElementIterator &rOther)
VertexElement< ELEMENT_DIM, SPACE_DIM > * GetElement(unsigned index) const
VertexElementIterator & operator++()
c_vector< double, SPACE_DIM > GetPreviousEdgeGradientOfElementAtNode(VertexElement< ELEMENT_DIM, SPACE_DIM > *pElement, unsigned localIndex)
VertexElementIterator GetElementIteratorBegin(bool skipDeletedElements=true)
double CalculateUnitNormalToFaceWithArea(VertexElement< ELEMENT_DIM-1, SPACE_DIM > *pFace, c_vector< double, SPACE_DIM > &rNormal)
virtual double CalculateAreaOfFace(VertexElement< ELEMENT_DIM-1, SPACE_DIM > *pFace)
double GetElongationShapeFactorOfElement(unsigned elementIndex)
virtual double GetVolumeOfElement(unsigned index)
#define EXPORT_TEMPLATE_CLASS_ALL_DIMS(CLASS)
std::vector< VertexElement< ELEMENT_DIM, SPACE_DIM > * > mElements
unsigned SolveNodeMapping(unsigned index) const
c_vector< double, SPACE_DIM > GetPerimeterGradientOfElementAtNode(VertexElement< ELEMENT_DIM, SPACE_DIM > *pElement, unsigned localIndex)
unsigned SolveBoundaryElementMapping(unsigned index) const
virtual c_vector< double, SPACE_DIM > GetCentroidOfElement(unsigned index)
std::set< unsigned > GetNeighbouringElementIndices(unsigned elementIndex)
std::vector< VertexElement< ELEMENT_DIM, SPACE_DIM > * >::iterator mElementIter
c_vector< double, SPACE_DIM > GetAreaGradientOfElementAtNode(VertexElement< ELEMENT_DIM, SPACE_DIM > *pElement, unsigned localIndex)
static std::string GetArchiveDirectory()
VertexElementIterator GetElementIteratorEnd()
std::vector< VertexElement< ELEMENT_DIM-1, SPACE_DIM > * > mFaces
double GetEdgeLength(unsigned elementIndex1, unsigned elementIndex2)
static std::string GetArchiveRelativePath()
unsigned GetVoronoiElementIndexCorrespondingToDelaunayNodeIndex(unsigned nodeIndex)
virtual double GetSurfaceAreaOfElement(unsigned index)
unsigned SolveElementMapping(unsigned index) const
bool ElementIncludesPoint(const c_vector< double, SPACE_DIM > &rTestPoint, unsigned elementIndex)
unsigned GetLocalIndexForElementEdgeClosestToPoint(const c_vector< double, SPACE_DIM > &rTestPoint, unsigned elementIndex)
c_vector< double, SPACE_DIM > GetShortAxisOfElement(unsigned index)
TetrahedralMesh< ELEMENT_DIM, SPACE_DIM > * mpDelaunayMesh
std::map< unsigned, unsigned > mVoronoiElementIndexMap
unsigned GetRosetteRankOfElement(unsigned index)