36 #ifndef MESHBASEDCELLPOPULATION_HPP_
37 #define MESHBASEDCELLPOPULATION_HPP_
40 #include "AbstractCentreBasedCellPopulation.hpp"
41 #include "MutableMesh.hpp"
42 #include "VertexMesh.hpp"
43 #include "TrianglesMeshReader.hpp"
46 #include <boost/serialization/base_object.hpp>
47 #include <boost/serialization/set.hpp>
48 #include <boost/serialization/vector.hpp>
56 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM=ELEMENT_DIM>
59 friend class TestMeshBasedCellPopulation;
62 friend class boost::serialization::access;
74 template<
class Archive>
75 void serialize(Archive & archive,
const unsigned int version)
77 archive & boost::serialization::base_object<AbstractCentreBasedCellPopulation<ELEMENT_DIM, SPACE_DIM> >(*this);
97 #define COVERAGE_IGNORE // Avoid prototypes being treated as code by gcov
148 #undef COVERAGE_IGNORE // Avoid prototypes being treated as code by gcov
164 #define COVERAGE_IGNORE // Avoid prototypes being treated as code by gcov
178 std::vector<CellPtr>& rCells,
179 const std::vector<unsigned> locationIndices=std::vector<unsigned>(),
180 bool deleteMesh=
false,
279 virtual CellPtr
AddCell(CellPtr pNewCell,
const c_vector<double,SPACE_DIM>& rCellDivisionVector, CellPtr pParentCell);
320 virtual void Update(
bool hasHadBirthsOrDeaths=
true);
426 double GetWidth(
const unsigned& rDimension);
584 void SetRestLength(
unsigned indexA,
unsigned indexB,
double restLength);
587 #undef COVERAGE_IGNORE // Avoid prototypes being treated as code by gcov
594 namespace serialization
599 template<
class Archive,
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
600 inline void save_construct_data(
612 template<
class Archive,
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
613 inline void load_construct_data(
double GetSurfaceAreaOfVoronoiElement(unsigned index)
double GetVolumeOfVoronoiElement(unsigned index)
SpringIterator SpringsEnd()
double GetWidth(const unsigned &rDimension)
double GetVoronoiEdgeLength(unsigned index1, unsigned index2)
Node< SPACE_DIM > * GetNodeA()
bool GetOutputMeshInVtk()
SpringIterator SpringsBegin()
unsigned AddNode(Node< SPACE_DIM > *pNewNode)
virtual CellPtr AddCell(CellPtr pNewCell, const c_vector< double, SPACE_DIM > &rCellDivisionVector, CellPtr pParentCell)
virtual unsigned RemoveDeadCells()
double GetDampingConstant(unsigned nodeIndex)
virtual void AcceptCellWriter(boost::shared_ptr< AbstractCellWriter< ELEMENT_DIM, SPACE_DIM > > pCellWriter, CellPtr pCell)
std::vector< std::pair< Node< SPACE_DIM > *, Node< SPACE_DIM > * > > & rGetNodePairs()
void CreateVoronoiTessellation()
virtual void AcceptPopulationCountWriter(boost::shared_ptr< AbstractCellPopulationCountWriter< ELEMENT_DIM, SPACE_DIM > > pPopulationCountWriter)
void SetNode(unsigned nodeIndex, ChastePoint< SPACE_DIM > &rNewLocation)
virtual void WriteVtkResultsToFile(const std::string &rDirectory)
Node< SPACE_DIM > * GetNodeB()
bool mHasVariableRestLength
MutableMesh< ELEMENT_DIM, SPACE_DIM > & rGetMesh()
bool operator!=(const typename MeshBasedCellPopulation< ELEMENT_DIM, SPACE_DIM >::SpringIterator &rOther)
void TessellateIfNeeded()
void serialize(Archive &archive, const unsigned int version)
double GetRestLength(unsigned indexA, unsigned indexB)
void SetWriteVtkAsPoints(bool writeVtkAsPoints)
MutableMesh< ELEMENT_DIM, SPACE_DIM >::EdgeIterator mEdgeIter
virtual ~MeshBasedCellPopulation()
MutableMesh< ELEMENT_DIM, SPACE_DIM > * mpMutableMesh
bool UseAreaBasedDampingConstant()
bool GetWriteVtkAsPoints()
void SetOutputMeshInVtk(bool outputMeshInVtk)
void DivideLongSprings(double springDivisionThreshold)
virtual void AcceptPopulationWriter(boost::shared_ptr< AbstractCellPopulationWriter< ELEMENT_DIM, SPACE_DIM > > pPopulationWriter)
bool mUseAreaBasedDampingConstant
VertexMesh< ELEMENT_DIM, SPACE_DIM > * mpVoronoiTessellation
SpringIterator(MeshBasedCellPopulation< ELEMENT_DIM, SPACE_DIM > &rCellPopulation, typename MutableMesh< ELEMENT_DIM, SPACE_DIM >::EdgeIterator edgeIter)
virtual void Update(bool hasHadBirthsOrDeaths=true)
double GetAreaBasedDampingConstantParameter()
#define EXPORT_TEMPLATE_CLASS_ALL_DIMS(CLASS)
virtual void UpdateGhostNodesAfterReMesh(NodeMap &rMap)
void SetRestLength(unsigned indexA, unsigned indexB, double restLength)
void SetAreaBasedDampingConstant(bool useAreaBasedDampingConstant)
virtual void WriteResultsToFiles(const std::string &rDirectory)
double mAreaBasedDampingConstantParameter
std::set< unsigned > GetNeighbouringNodeIndices(unsigned index)
SpringIterator & operator++()
std::set< std::set< unsigned > > mSpringsVisited
Node< SPACE_DIM > * GetNode(unsigned index)
VertexMesh< ELEMENT_DIM, SPACE_DIM > * GetVoronoiTessellation()
MeshBasedCellPopulation(MutableMesh< ELEMENT_DIM, SPACE_DIM > &rMesh, std::vector< CellPtr > &rCells, const std::vector< unsigned > locationIndices=std::vector< unsigned >(), bool deleteMesh=false, bool validate=true)
double GetVolumeOfCell(CellPtr pCell)
void OutputCellPopulationParameters(out_stream &rParamsFile)
std::vector< std::pair< Node< SPACE_DIM > *, Node< SPACE_DIM > * > > mNodePairs
void SetAreaBasedDampingConstantParameter(double areaBasedDampingConstantParameter)
std::map< std::pair< unsigned, unsigned >, double > mSpringRestLengths
virtual void OpenWritersFiles(OutputFileHandler &rOutputFileHandler)
MeshBasedCellPopulation< ELEMENT_DIM, SPACE_DIM > & mrCellPopulation
void CalculateRestLengths()