36 #ifndef NODEBASEDCELLPOPULATION_HPP_
37 #define NODEBASEDCELLPOPULATION_HPP_
40 #include <boost/serialization/base_object.hpp>
42 #include <boost/version.hpp>
43 #if BOOST_VERSION >= 103700
44 #include "ObjectCommunicator.hpp"
47 #include "AbstractCentreBasedCellPopulation.hpp"
48 #include "NodesOnlyMesh.hpp"
49 #include "BoxCollection.hpp"
55 template<
unsigned DIM>
58 friend class TestNodeBasedCellPopulation;
59 friend class TestNodeBasedCellPopulationParallelMethods;
60 friend class TestBoxCollection;
97 boost::shared_ptr<std::vector<std::pair<CellPtr, Node<DIM>* > > >
mpCellsRecvLeft;
134 template<
class Archive>
135 void serialize(Archive & archive,
const unsigned int version)
137 archive & boost::serialization::base_object<AbstractCentreBasedCellPopulation<DIM> >(*this);
220 #undef COVERAGE_IGNORE // Avoid prototypes being treated as code by gcov
264 std::vector<CellPtr>& rCells,
265 const std::vector<unsigned> locationIndices=std::vector<unsigned>(),
266 bool deleteMesh=
false,
337 void Update(
bool hasHadBirthsOrDeaths=
true);
419 double GetWidth(
const unsigned& rDimension);
463 virtual CellPtr
AddCell(CellPtr pNewCell,
const c_vector<double,DIM>& rCellDivisionVector, CellPtr pParentCell);
522 namespace serialization
527 template<
class Archive,
unsigned DIM>
528 inline void save_construct_data(
540 template<
class Archive,
unsigned DIM>
541 inline void load_construct_data(
void AddCellsToSendRight(std::vector< unsigned > &cellLocationIndices)
double GetMechanicsCutOffLength()
void OutputCellPopulationParameters(out_stream &rParamsFile)
std::set< unsigned > GetNodesWithinNeighbourhoodRadius(unsigned index, double neighbourhoodRadius)
NodesOnlyMesh< DIM > & rGetMesh()
bool GetUseVariableRadii()
virtual ~NodeBasedCellPopulation()
boost::shared_ptr< std::vector< std::pair< CellPtr, Node< DIM > * > > > mpCellsRecvLeft
NodeBasedCellPopulation(NodesOnlyMesh< DIM > &rMesh, std::vector< CellPtr > &rCells, const std::vector< unsigned > locationIndices=std::vector< unsigned >(), bool deleteMesh=false, bool validate=true)
unsigned mLoadBalanceFrequency
c_vector< double, DIM > GetSizeOfCellPopulation()
unsigned RemoveDeadCells()
Node< DIM > * GetNode(unsigned index)
void serialize(Archive &archive, const unsigned int version)
void AddCellsToSendLeft(std::vector< unsigned > &cellLocationIndices)
static const unsigned mCellCommunicationTag
std::map< CellPtr, unsigned > mHaloCellLocationMap
ObjectCommunicator< std::vector< std::pair< CellPtr, Node< DIM > * > > > mRightCommunicator
void SetNode(unsigned nodeIndex, ChastePoint< DIM > &rNewLocation)
std::vector< std::pair< Node< DIM > *, Node< DIM > * > > mNodePairs
void SetUseVariableRadii(bool useVariableRadii=true)
ObjectCommunicator< std::vector< std::pair< CellPtr, Node< DIM > * > > > mLeftCommunicator
std::vector< CellPtr > mHaloCells
boost::shared_ptr< std::vector< std::pair< CellPtr, Node< DIM > * > > > mpCellsRecvRight
void AddMovedCell(CellPtr pCell, boost::shared_ptr< Node< DIM > > pNode)
std::pair< CellPtr, Node< DIM > * > GetCellNodePair(unsigned nodeIndex)
void NonBlockingSendCellsToNeighbourProcesses()
double GetVolumeOfCell(CellPtr pCell)
virtual void AcceptPopulationWriter(boost::shared_ptr< AbstractCellPopulationWriter< DIM, DIM > > pPopulationWriter)
virtual void WriteVtkResultsToFile(const std::string &rDirectory)
std::vector< std::pair< CellPtr, Node< DIM > * > > mCellsToSendRight
std::set< unsigned > GetNeighbouringNodeIndices(unsigned index)
void SendCellsToNeighbourProcesses()
#define EXPORT_TEMPLATE_CLASS_SAME_DIMS(CLASS)
void UpdateMapsAfterRemesh(NodeMap &map)
void SetLoadBalanceMesh(bool loadBalanceMesh)
friend class boost::serialization::access
c_vector< double, DIM > mMaxSpatialPositions
virtual void AcceptCellWriter(boost::shared_ptr< AbstractCellWriter< DIM, DIM > > pCellWriter, CellPtr pCell)
void AddHaloCell(CellPtr pCell, boost::shared_ptr< Node< DIM > > pNode)
double GetWidth(const unsigned &rDimension)
unsigned AddNode(Node< DIM > *pNewNode)
c_vector< double, DIM > mMinSpatialPositions
std::vector< std::pair< Node< DIM > *, Node< DIM > * > > & rGetNodePairs()
virtual CellPtr GetCellUsingLocationIndex(unsigned index)
NodesOnlyMesh< DIM > * mpNodesOnlyMesh
std::map< unsigned, CellPtr > mLocationHaloCellMap
std::vector< std::pair< CellPtr, Node< DIM > * > > mCellsToSendLeft
virtual void UpdateCellProcessLocation()
void DeleteMovedCell(unsigned index)
void Update(bool hasHadBirthsOrDeaths=true)
virtual void AcceptPopulationCountWriter(boost::shared_ptr< AbstractCellPopulationCountWriter< DIM, DIM > > pPopulationCountWriter)
void SetLoadBalanceFrequency(unsigned loadBalanceFrequency)
void AddNodeAndCellToSendLeft(unsigned nodeIndex)
std::map< unsigned, std::set< unsigned > > mNodeNeighbours
void AddReceivedHaloCells()
void AddNodeAndCellToSendRight(unsigned nodeIndex)
virtual void UpdateParticlesAfterReMesh(NodeMap &rMap)
virtual CellPtr AddCell(CellPtr pNewCell, const c_vector< double, DIM > &rCellDivisionVector, CellPtr pParentCell)