35 #ifndef VERTEXMESH_HPP_
36 #define VERTEXMESH_HPP_
39 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
46 #include <boost/serialization/base_object.hpp>
47 #include <boost/serialization/split_member.hpp>
48 #include <boost/serialization/vector.hpp>
51 #include "AbstractMesh.hpp"
52 #include "ArchiveLocationInfo.hpp"
53 #include "TetrahedralMesh.hpp"
54 #include "VertexElement.hpp"
55 #include "VertexElementMap.hpp"
56 #include "VertexMeshReader.hpp"
57 #include "VertexMeshWriter.hpp"
73 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
76 friend class TestVertexMesh;
80 std::vector<VertexElement<ELEMENT_DIM, SPACE_DIM>*>
mElements;
159 bool ElementIncludesPoint(
const c_vector<double, SPACE_DIM>& rTestPoint,
unsigned elementIndex);
173 friend class boost::serialization::access;
182 template <
class Archive>
183 void save(Archive& archive,
const unsigned int version)
const
185 archive& boost::serialization::base_object<AbstractMesh<ELEMENT_DIM, SPACE_DIM> >(*this);
200 template <
class Archive>
201 void load(Archive& archive,
const unsigned int version)
203 archive& boost::serialization::base_object<AbstractMesh<ELEMENT_DIM, SPACE_DIM> >(*this);
208 BOOST_SERIALIZATION_SPLIT_MEMBER()
212 class VertexElementIterator;
233 std::vector<
VertexElement<ELEMENT_DIM, SPACE_DIM>*> vertexElements);
243 std::vector<
VertexElement<ELEMENT_DIM - 1, SPACE_DIM>*> faces,
244 std::vector<
VertexElement<ELEMENT_DIM, SPACE_DIM>*> vertexElements);
342 virtual
void Clear();
382 virtual c_vector<
double, SPACE_DIM>
GetVectorFromAtoB(const c_vector<
double, SPACE_DIM>& rLocationA,
383 const c_vector<
double, SPACE_DIM>& rLocationB);
494 double GetEdgeLength(
unsigned elementIndex1,
unsigned elementIndex2);
604 class VertexElementIterator
631 inline VertexElementIterator& operator++();
645 bool skipDeletedElements =
true);
652 typename std::vector<VertexElement<ELEMENT_DIM, SPACE_DIM>*>::iterator
mElementIter;
661 inline bool IsAtEnd();
667 inline bool IsAllowedElement();
678 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
680 bool skipDeletedElements)
685 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
691 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
698 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
702 return *mElementIter;
705 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
711 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
717 }
while (!IsAtEnd() && !IsAllowedElement());
722 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
726 bool skipDeletedElements)
728 mElementIter(elementIter),
729 mSkipDeletedElements(skipDeletedElements)
746 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
749 return mElementIter == mrMesh.mElements.end();
752 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
755 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)
std::vector< VertexElement< ELEMENT_DIM-1, SPACE_DIM > * > mFaces
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)
std::vector< VertexElement< ELEMENT_DIM, SPACE_DIM > * >::iterator mElementIter
unsigned SolveBoundaryElementMapping(unsigned index) const
virtual c_vector< double, SPACE_DIM > GetCentroidOfElement(unsigned index)
std::set< unsigned > GetNeighbouringElementIndices(unsigned elementIndex)
c_vector< double, SPACE_DIM > GetAreaGradientOfElementAtNode(VertexElement< ELEMENT_DIM, SPACE_DIM > *pElement, unsigned localIndex)
virtual VertexMesh< ELEMENT_DIM, SPACE_DIM > * GetMeshForVtk()
static std::string GetArchiveDirectory()
VertexElementIterator GetElementIteratorEnd()
double GetEdgeLength(unsigned elementIndex1, unsigned elementIndex2)
static std::string GetArchiveRelativePath()
unsigned GetVoronoiElementIndexCorrespondingToDelaunayNodeIndex(unsigned nodeIndex)
virtual double GetSurfaceAreaOfElement(unsigned index)
gcov doesn't like this file...
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)