35#ifndef VERTEXMESH_HPP_
36#define VERTEXMESH_HPP_
39template <
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"
53#include "EdgeHelper.hpp"
54#include "ArchiveLocationInfo.hpp"
55#include "TetrahedralMesh.hpp"
56#include "VertexElement.hpp"
57#include "VertexElementMap.hpp"
58#include "VertexMeshReader.hpp"
59#include "VertexMeshWriter.hpp"
76template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
79 friend class TestVertexMesh;
84 std::vector<VertexElement<ELEMENT_DIM, SPACE_DIM>*>
mElements;
172 bool ElementIncludesPoint(
const c_vector<double, SPACE_DIM>& rTestPoint,
unsigned elementIndex);
195 template <
class Archive>
196 void save(Archive& archive,
const unsigned int version)
const
198 archive& boost::serialization::base_object<AbstractMesh<ELEMENT_DIM, SPACE_DIM> >(*this);
212 template <
class Archive>
213 void load(Archive& archive,
const unsigned int version)
215 archive& boost::serialization::base_object<AbstractMesh<ELEMENT_DIM, SPACE_DIM> >(*this);
220 BOOST_SERIALIZATION_SPLIT_MEMBER()
224 class VertexElementIterator;
245 std::vector<
VertexElement<ELEMENT_DIM, SPACE_DIM>*> vertexElements);
255 std::vector<
VertexElement<ELEMENT_DIM - 1, SPACE_DIM>*> faces,
256 std::vector<
VertexElement<ELEMENT_DIM, SPACE_DIM>*> vertexElements);
276 bool isPeriodic = false,
277 bool isBounded = false,
278 bool scaleBoundByEdgeLength = true,
279 double maxDelaunayEdgeLength = DBL_MAX,
280 bool offsetNewBoundaryNodes = false);
383 virtual
void Clear();
423 virtual c_vector<
double, SPACE_DIM>
GetVectorFromAtoB(const c_vector<
double, SPACE_DIM>& rLocationA,
424 const c_vector<
double, SPACE_DIM>& rLocationB);
535 double GetEdgeLength(
unsigned elementIndex1,
unsigned elementIndex2);
650 bool IsNearExistingNodes(c_vector<
double,SPACE_DIM> newNodeLocation, std::vector<
Node<SPACE_DIM> *> nodesToCheck,
double minClearance);
684 inline VertexElementIterator& operator++();
698 bool skipDeletedElements =
true);
705 typename std::vector<VertexElement<ELEMENT_DIM, SPACE_DIM>*>::iterator
mElementIter;
714 inline bool IsAtEnd();
720 inline bool IsAllowedElement();
731template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
733 bool skipDeletedElements)
738template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
744template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
751template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
755 return *mElementIter;
758template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
764template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
770 }
while (!IsAtEnd() && !IsAllowedElement());
775template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
779 bool skipDeletedElements)
781 mElementIter(elementIter),
782 mSkipDeletedElements(skipDeletedElements)
799template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
802 return mElementIter == mrMesh.mElements.end();
805template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
808 return !(mSkipDeletedElements && (*this)->IsDeleted());
gcov doesn't like this file...
#define EXPORT_TEMPLATE_CLASS_ALL_DIMS(CLASS)
static std::string GetMeshFilename()
static std::string GetArchiveDirectory()
static std::string GetArchiveRelativePath()
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, SPACE_DIM > * >::iterator mElementIter
VertexElementIterator & operator++()
bool operator!=(const typename VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexElementIterator &rOther)
VertexElement< ELEMENT_DIM, SPACE_DIM > & operator*()
VertexElement< ELEMENT_DIM, SPACE_DIM > * operator->()
std::vector< VertexElement< ELEMENT_DIM - 1, SPACE_DIM > * > mFaces
virtual c_vector< double, SPACE_DIM > GetVectorFromAtoB(const c_vector< double, SPACE_DIM > &rLocationA, const c_vector< double, SPACE_DIM > &rLocationB)
double CalculateUnitNormalToFaceWithArea(VertexElement< ELEMENT_DIM - 1, SPACE_DIM > *pFace, c_vector< double, SPACE_DIM > &rNormal)
VertexElement< ELEMENT_DIM - 1, SPACE_DIM > * GetFace(unsigned index) const
VertexElementIterator GetElementIteratorEnd()
virtual unsigned GetNumNodes() const
virtual double GetSurfaceAreaOfElement(unsigned index)
std::set< unsigned > GetNeighbouringNodeIndices(unsigned nodeIndex)
std::set< unsigned > GetNeighbouringNodeNotAlsoInElement(unsigned nodeIndex, unsigned elemIndex)
void GenerateEdgesFromElements(std::vector< VertexElement< ELEMENT_DIM, SPACE_DIM > * > &rElements)
virtual double CalculateAreaOfFace(VertexElement< ELEMENT_DIM - 1, SPACE_DIM > *pFace)
const EdgeHelper< SPACE_DIM > & rGetEdgeHelper() const
c_vector< double, SPACE_DIM > GetNextEdgeGradientOfElementAtNode(VertexElement< ELEMENT_DIM, SPACE_DIM > *pElement, unsigned localIndex)
virtual unsigned GetNumFaces() const
VertexElement< ELEMENT_DIM, SPACE_DIM > * GetElement(unsigned index) const
EdgeHelper< SPACE_DIM > mEdgeHelper
unsigned GetLocalIndexForElementEdgeClosestToPoint(const c_vector< double, SPACE_DIM > &rTestPoint, unsigned elementIndex)
double GetElongationShapeFactorOfElement(unsigned elementIndex)
unsigned GetNumAllElements() const
unsigned SolveNodeMapping(unsigned index) const
TetrahedralMesh< ELEMENT_DIM, SPACE_DIM > * mpDelaunayMesh
bool ElementIncludesPoint(const c_vector< double, SPACE_DIM > &rTestPoint, unsigned elementIndex)
c_vector< double, SPACE_DIM > GetAreaGradientOfElementAtNode(VertexElement< ELEMENT_DIM, SPACE_DIM > *pElement, unsigned localIndex)
bool IsNearExistingNodes(c_vector< double, SPACE_DIM > newNodeLocation, std::vector< Node< SPACE_DIM > * > nodesToCheck, double minClearance)
std::set< unsigned > GetNeighbouringElementIndices(unsigned elementIndex)
VertexElementIterator GetElementIteratorBegin(bool skipDeletedElements=true)
void save(Archive &archive, const unsigned int version) const
c_vector< double, SPACE_DIM > GetPerimeterGradientOfElementAtNode(VertexElement< ELEMENT_DIM, SPACE_DIM > *pElement, unsigned localIndex)
double GetEdgeLength(unsigned elementIndex1, unsigned elementIndex2)
c_vector< double, SPACE_DIM > GetShortAxisOfElement(unsigned index)
unsigned GetRosetteRankOfElement(unsigned index)
Edge< SPACE_DIM > * GetEdge(unsigned index) const
unsigned SolveBoundaryElementMapping(unsigned index) const
unsigned SolveElementMapping(unsigned index) const
unsigned GetVoronoiElementIndexCorrespondingToDelaunayNodeIndex(unsigned nodeIndex)
virtual c_vector< double, SPACE_DIM > GetCentroidOfElement(unsigned index)
std::map< unsigned, unsigned > mVoronoiElementIndexMap
friend class boost::serialization::access
void load(Archive &archive, const unsigned int version)
void ConstructFromMeshReader(AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &rMeshReader)
unsigned GetDelaunayNodeIndexCorrespondingToVoronoiElementIndex(unsigned elementIndex)
unsigned GetNumEdges() const
c_vector< double, SPACE_DIM > GetPreviousEdgeGradientOfElementAtNode(VertexElement< ELEMENT_DIM, SPACE_DIM > *pElement, unsigned localIndex)
std::vector< VertexElement< ELEMENT_DIM, SPACE_DIM > * > mElements
virtual c_vector< double, 3 > CalculateMomentsOfElement(unsigned index)
virtual VertexMesh< ELEMENT_DIM, SPACE_DIM > * GetMeshForVtk()
virtual double GetVolumeOfElement(unsigned index)
virtual unsigned GetNumElements() const
void GenerateVerticesFromElementCircumcentres(TetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &rMesh)