36#ifndef VORONOIVERTEXMESHGENERATOR_HPP_
37#define VORONOIVERTEXMESHGENERATOR_HPP_
42#include <boost/shared_ptr.hpp>
43#include "MutableVertexMesh.hpp"
44#include "Toroidal2dVertexMesh.hpp"
45#include "RandomNumberGenerator.hpp"
47#include <boost/version.hpp>
49#if BOOST_VERSION >= 105200
50#include "boost/polygon/voronoi.hpp"
60 friend class TestVoronoiVertexMeshGenerator;
65 boost::shared_ptr<MutableVertexMesh<2,2> > mpMesh;
68 boost::shared_ptr<Toroidal2dVertexMesh > mpTorMesh;
71 unsigned mNumElementsX;
74 unsigned mNumElementsY;
77 unsigned mTotalNumElements;
80 unsigned mNumRelaxationSteps;
83 unsigned mMaxNumElems;
92 double mElementTargetArea;
95 double mMultiplierInX;
98 double mMultiplierInY;
101 double mSamplingMultiplier;
111 unsigned mMaxExpectedNumSidesPerPolygon;
122 std::vector<c_vector<double, 2> > GetInitialPointLocations();
129 std::vector<c_vector<double, 2> > GetElementCentroidsFromMesh();
141 void CreateVoronoiTessellation(std::vector<c_vector<double, 2> >& rSeedLocations);
148 void ValidateInputAndSetMembers();
159 void ValidateSeedLocations(std::vector<c_vector<double, 2> >& rSeedLocations);
185 unsigned numElementsY,
186 unsigned numRelaxationSteps,
187 double elementTargetArea=1.0);
205 void GenerateVoronoiMesh();
210 virtual boost::shared_ptr<MutableVertexMesh<2,2> > GetMesh();
215 virtual boost::shared_ptr<MutableVertexMesh<2,2> > GetMeshAfterReMesh();
220 virtual boost::shared_ptr<Toroidal2dVertexMesh> GetToroidalMesh();
225 std::vector<double> GetPolygonDistribution();
233 double GetAreaCoefficientOfVariation();
240 void RefreshSeedsAndRegenerateMesh();
247 void SetMaxExpectedNumSidesPerPolygon(
unsigned maxExpectedNumSidesPerPolygon);
252 unsigned GetMaxExpectedNumSidesPerPolygon();
257#if BOOST_VERSION < 105200
VoronoiVertexMeshGenerator()