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);
172 std::vector<CellPtr>& rCells,
173 const std::vector<unsigned> locationIndices=std::vector<unsigned>(),
174 bool deleteMesh=
false,
281 virtual CellPtr
AddCell(CellPtr pNewCell, CellPtr pParentCell);
322 virtual void Update(
bool hasHadBirthsOrDeaths=
true);
428 double GetWidth(
const unsigned& rDimension);
595 void SetRestLength(
unsigned indexA,
unsigned indexB,
double restLength);
604 namespace serialization
609 template<
class Archive,
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
610 inline void save_construct_data(
622 template<
class Archive,
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
623 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()
virtual CellPtr AddCell(CellPtr pNewCell, CellPtr pParentCell)
SpringIterator SpringsBegin()
unsigned AddNode(Node< SPACE_DIM > *pNewNode)
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()
virtual void WriteDataToVisualizerSetupFile(out_stream &pVizSetupFile)
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)
gcov doesn't like this file...
std::map< std::pair< unsigned, unsigned >, double > mSpringRestLengths
virtual TetrahedralMesh< ELEMENT_DIM, SPACE_DIM > * GetTetrahedralMeshForPdeModifier()
virtual void OpenWritersFiles(OutputFileHandler &rOutputFileHandler)
MeshBasedCellPopulation< ELEMENT_DIM, SPACE_DIM > & mrCellPopulation
void CalculateRestLengths()