36#include "NodeBasedCellPopulation.hpp"
38#include "VtkMeshWriter.hpp"
42 std::vector<CellPtr>& rCells,
43 const std::vector<unsigned> locationIndices,
47 mDeleteMesh(deleteMesh),
48 mUseVariableRadii(false),
49 mLoadBalanceMesh(false),
50 mLoadBalanceFrequency(100)
64 mUseVariableRadii(false),
65 mLoadBalanceMesh(false),
66 mLoadBalanceFrequency(100)
84 return *mpNodesOnlyMesh;
90 return *mpNodesOnlyMesh;
99 std::vector<Node<DIM>*> temp_nodes;
103 node_iter != mpNodesOnlyMesh->GetNodeIteratorEnd();
106 temp_nodes.push_back(
new Node<DIM>(node_iter->GetIndex(), node_iter->rGetLocation(), node_iter->IsBoundaryNode()));
112template<
unsigned DIM>
118template<
unsigned DIM>
122 node_iter != this->mrMesh.GetNodeIteratorEnd();
127 this->GetCellUsingLocationIndex(node_iter->GetIndex());
136template<
unsigned DIM>
139 return mpNodesOnlyMesh->GetNodeOrHaloNode(index);
142template<
unsigned DIM>
145 mpNodesOnlyMesh->SetNode(nodeIndex, rNewLocation,
false);
148template<
unsigned DIM>
151 UpdateCellProcessLocation();
153 mpNodesOnlyMesh->UpdateBoxCollection();
155 if (mLoadBalanceMesh)
159 mpNodesOnlyMesh->LoadBalanceMesh();
161 UpdateCellProcessLocation();
163 mpNodesOnlyMesh->UpdateBoxCollection();
169 mpNodesOnlyMesh->CalculateInteriorNodePairs(mNodePairs);
171 AddReceivedHaloCells();
173 mpNodesOnlyMesh->CalculateBoundaryNodePairs(mNodePairs);
178 if (mUseVariableRadii)
181 cell_iter != this->End();
184 double cell_radius = cell_iter->GetCellData()->GetItem(
"Radius");
185 unsigned node_index = this->GetLocationIndexUsingCell(*cell_iter);
186 this->GetNode(node_index)->SetRadius(cell_radius);
194template<
unsigned DIM>
199 UpdateParticlesAfterReMesh(map);
203 std::map<Cell*, unsigned> old_map = this->mCellLocationMap;
206 this->mLocationCellMap.clear();
207 this->mCellLocationMap.clear();
209 for (std::list<CellPtr>::iterator it = this->mCells.begin();
210 it != this->mCells.end();
213 unsigned old_node_index = old_map[(*it).get()];
218 unsigned new_node_index = map.
GetNewIndex(old_node_index);
219 this->SetCellUsingLocationIndex(new_node_index,*it);
226template<
unsigned DIM>
229 unsigned num_removed = 0;
230 for (std::list<CellPtr>::iterator cell_iter = this->mCells.begin();
231 cell_iter != this->mCells.end();
234 if ((*cell_iter)->IsDead())
238 unsigned location_index = mpNodesOnlyMesh->SolveNodeMapping(this->GetLocationIndexUsingCell((*cell_iter)));
239 mpNodesOnlyMesh->DeleteNodePriorToReMesh(location_index);
242 unsigned location_index_of_removed_node = this->GetLocationIndexUsingCell((*cell_iter));
243 this->RemoveCellUsingLocationIndex(location_index_of_removed_node, (*cell_iter));
246 cell_iter = this->mCells.erase(cell_iter);
257template<
unsigned DIM>
260 return mpNodesOnlyMesh->AddNode(pNewNode);
263template<
unsigned DIM>
266 return mpNodesOnlyMesh->GetNumNodes();
269template<
unsigned DIM>
272 std::map<unsigned, CellPtr>::iterator iter = mLocationHaloCellMap.find(index);
273 if (iter != mLocationHaloCellMap.end())
283template<
unsigned DIM>
288template<
unsigned DIM>
294template<
unsigned DIM>
297 *rParamsFile <<
"\t\t<MechanicsCutOffLength>" << mpNodesOnlyMesh->GetMaximumInteractionDistance() <<
"</MechanicsCutOffLength>\n";
298 *rParamsFile <<
"\t\t<UseVariableRadii>" << mUseVariableRadii <<
"</UseVariableRadii>\n";
304template<
unsigned DIM>
307 pPopulationWriter->Visit(
this);
310template<
unsigned DIM>
313 pPopulationCountWriter->Visit(
this);
316template<
unsigned DIM>
319 pPopulationEventWriter->Visit(
this);
322template<
unsigned DIM>
325 pCellWriter->VisitCell(pCell,
this);
328template<
unsigned DIM>
331 return mpNodesOnlyMesh->GetMaximumInteractionDistance();
334template<
unsigned DIM>
337 return mUseVariableRadii;
340template<
unsigned DIM>
343 mUseVariableRadii = useVariableRadii;
346template<
unsigned DIM>
349 mLoadBalanceMesh = loadBalanceMesh;
352template<
unsigned DIM>
355 mLoadBalanceFrequency = loadBalanceFrequency;
358template<
unsigned DIM>
361 return mpNodesOnlyMesh->GetWidth(rDimension);
364template<
unsigned DIM>
368 c_vector<double, DIM> global_size;
370 for (
unsigned i=0; i<DIM; i++)
378template<
unsigned DIM>
382 if (neighbourhoodRadius > mpNodesOnlyMesh->GetMaximumInteractionDistance())
384 EXCEPTION(
"neighbourhoodRadius should be less than or equal to the the maximum interaction radius defined on the NodesOnlyMesh");
387 std::set<unsigned> neighbouring_node_indices;
390 Node<DIM>* p_node_i = this->GetNode(index);
391 const c_vector<double, DIM>& r_node_i_location = p_node_i->
rGetLocation();
396 EXCEPTION(
"mNodeNeighbours not set up. Call Update() before GetNodesWithinNeighbourhoodRadius()");
403 for (std::vector<unsigned>::iterator iter = near_nodes.begin();
404 iter != near_nodes.end();
408 if ((*iter) != index)
410 Node<DIM>* p_node_j = this->GetNode((*iter));
413 const c_vector<double, DIM>& r_node_j_location = p_node_j->
rGetLocation();
416 c_vector<double, DIM> node_to_node_vector = mpNodesOnlyMesh->GetVectorFromAtoB(r_node_j_location, r_node_i_location);
419 double distance_between_nodes = norm_2(node_to_node_vector);
423 if (distance_between_nodes <= neighbourhoodRadius)
426 neighbouring_node_indices.insert((*iter));
431 return neighbouring_node_indices;
434template<
unsigned DIM>
437 std::set<unsigned> neighbouring_node_indices;
440 Node<DIM>* p_node_i = this->GetNode(index);
441 const c_vector<double, DIM>& r_node_i_location = p_node_i->
rGetLocation();
442 double radius_of_cell_i = p_node_i->
GetRadius();
447 EXCEPTION(
"mNodeNeighbours not set up. Call Update() before GetNeighbouringNodeIndices()");
451 if (!(radius_of_cell_i * 2.0 <= mpNodesOnlyMesh->GetMaximumInteractionDistance()))
453 EXCEPTION(
"mpNodesOnlyMesh::mMaxInteractionDistance is smaller than twice the radius of cell " << index <<
" (" << radius_of_cell_i <<
") so interactions may be missed. Make the cut-off larger to avoid errors.");
460 for (std::vector<unsigned>::iterator iter = near_nodes.begin();
461 iter != near_nodes.end();
465 if ((*iter) != index)
467 Node<DIM>* p_node_j = this->GetNode((*iter));
470 const c_vector<double, DIM>& r_node_j_location = p_node_j->
rGetLocation();
473 c_vector<double, DIM> node_to_node_vector = mpNodesOnlyMesh->GetVectorFromAtoB(r_node_j_location, r_node_i_location);
476 double distance_between_nodes = norm_2(node_to_node_vector);
479 double radius_of_cell_j = p_node_j->
GetRadius();
482 double max_interaction_distance = radius_of_cell_i + radius_of_cell_j;
485 if (!(max_interaction_distance <= mpNodesOnlyMesh->GetMaximumInteractionDistance()))
487 EXCEPTION(
"mpNodesOnlyMesh::mMaxInteractionDistance is smaller than the sum of radius of cell " << index <<
" (" << radius_of_cell_i <<
") and cell " << (*iter) <<
" (" << radius_of_cell_j <<
"). Make the cut-off larger to avoid errors.");
489 if (distance_between_nodes <= max_interaction_distance)
492 neighbouring_node_indices.insert((*iter));
497 return neighbouring_node_indices;
500template <
unsigned DIM>
504 if constexpr ((DIM == 2) || (DIM == 3))
507 unsigned node_index = this->GetLocationIndexUsingCell(pCell);
508 Node<DIM>* p_node = this->GetNode(node_index);
511 double cell_radius = p_node->
GetRadius();
514 double averaged_cell_radius = 0.0;
515 unsigned num_cells = 0;
518 const c_vector<double, DIM>& r_node_i_location = GetNode(node_index)->rGetLocation();
521 std::set<unsigned> neighbouring_node_indices = GetNeighbouringNodeIndices(node_index);
524 unsigned num_neighbours_equil;
527 num_neighbours_equil = 6;
531 num_neighbours_equil = 12;
535 for (std::set<unsigned>::iterator iter = neighbouring_node_indices.begin();
536 iter != neighbouring_node_indices.end();
539 Node<DIM>* p_node_j = this->GetNode(*iter);
542 const c_vector<double, DIM>& r_node_j_location = p_node_j->
rGetLocation();
544 double neighbouring_cell_radius = p_node_j->
GetRadius();
547 assert(cell_radius+neighbouring_cell_radius<mpNodesOnlyMesh->GetMaximumInteractionDistance());
550 double separation = norm_2(mpNodesOnlyMesh->GetVectorFromAtoB(r_node_j_location, r_node_i_location));
552 if (separation < cell_radius+neighbouring_cell_radius)
555 averaged_cell_radius = averaged_cell_radius + cell_radius - (cell_radius+neighbouring_cell_radius-separation)/2.0;
559 if (num_cells < num_neighbours_equil)
561 averaged_cell_radius += (num_neighbours_equil-num_cells)*cell_radius;
563 averaged_cell_radius /= num_neighbours_equil;
567 averaged_cell_radius /= num_cells;
569 assert(averaged_cell_radius < mpNodesOnlyMesh->GetMaximumInteractionDistance()/2.0);
571 cell_radius = averaged_cell_radius;
576 double cell_volume = 0.0;
579 cell_volume = M_PI*cell_radius*cell_radius;
583 cell_volume = (4.0/3.0)*M_PI*cell_radius*cell_radius*cell_radius;
594template<
unsigned DIM>
599 std::stringstream time;
603 NodeMap map(1 + this->mpNodesOnlyMesh->GetMaximumNodeIndex());
604 this->mpNodesOnlyMesh->ReMesh(map);
610 auto num_nodes = GetNumNodes();
613 std::vector<unsigned> node_indices_in_cell_order;
614 for (
auto cell_iter = this->Begin(); cell_iter != this->End(); ++cell_iter)
617 unsigned global_index = this->GetLocationIndexUsingCell(*cell_iter);
618 unsigned node_index = this->rGetMesh().SolveNodeMapping(global_index);
620 node_indices_in_cell_order.emplace_back(node_index);
625 for (
auto&& p_cell_writer : this->mCellWriters)
628 if (p_cell_writer->GetOutputScalarData())
630 std::vector<double> vtk_cell_data(num_nodes);
632 unsigned loop_it = 0;
633 for (
auto cell_iter = this->Begin(); cell_iter != this->End(); ++cell_iter, ++loop_it)
635 unsigned node_idx = node_indices_in_cell_order[loop_it];
636 vtk_cell_data[node_idx] = p_cell_writer->GetCellDataForVtkOutput(*cell_iter,
this);
639 mesh_writer.
AddPointData(p_cell_writer->GetVtkCellDataName(), vtk_cell_data);
643 if (p_cell_writer->GetOutputVectorData())
645 std::vector<c_vector<double, DIM>> vtk_cell_data(num_nodes);
647 unsigned loop_it = 0;
648 for (
auto cell_iter = this->Begin(); cell_iter != this->End(); ++cell_iter, ++loop_it)
650 unsigned node_idx = node_indices_in_cell_order[loop_it];
651 vtk_cell_data[node_idx] = p_cell_writer->GetVectorCellDataForVtkOutput(*cell_iter,
this);
654 mesh_writer.
AddPointData(p_cell_writer->GetVtkVectorCellDataName(), vtk_cell_data);
660 if (this->Begin() != this->End())
662 auto num_cell_data_items = this->Begin()->GetCellData()->GetNumItems();
663 std::vector<std::string> cell_data_names = this->Begin()->GetCellData()->GetKeys();
664 std::vector<std::vector<double>> cell_data(num_cell_data_items, std::vector<double>(num_nodes));
666 std::vector<double> rank(num_nodes);
668 unsigned loop_it = 0;
669 for (
auto cell_iter = this->Begin(); cell_iter != this->End(); ++cell_iter, ++loop_it)
671 unsigned node_idx = node_indices_in_cell_order[loop_it];
673 for (
unsigned cell_data_idx = 0; cell_data_idx < num_cell_data_items; ++cell_data_idx)
675 cell_data[cell_data_idx][node_idx] = cell_iter->GetCellData()->GetItem(cell_data_names[cell_data_idx]);
683 for (
unsigned cell_data_idx = 0; cell_data_idx < num_cell_data_items; ++cell_data_idx)
685 mesh_writer.
AddPointData(cell_data_names[cell_data_idx], cell_data[cell_data_idx]);
691 *(this->mpVtkMetaFile) <<
" <DataSet timestep=\"";
693 *(this->mpVtkMetaFile) << R
"(" group="" part="0" file="results_)";
697 *(this->mpVtkMetaFile) <<
".vtu\"/>\n";
702 *(this->mpVtkMetaFile) <<
".pvtu\"/>\n";
707template<
unsigned DIM>
714 assert(p_created_cell == pNewCell);
717 unsigned parent_node_index = this->GetLocationIndexUsingCell(pParentCell);
718 Node<DIM>* p_parent_node = this->GetNode(parent_node_index);
720 unsigned new_node_index = this->GetLocationIndexUsingCell(p_created_cell);
721 Node<DIM>* p_new_node = this->GetNode(new_node_index);
726 return p_created_cell;
729template<
unsigned DIM>
733 mpNodesOnlyMesh->AddMovedNode(pNode);
736 this->mCells.push_back(pCell);
739 this->AddCellUsingLocationIndex(pNode->GetIndex(), pCell);
742template<
unsigned DIM>
745 mpNodesOnlyMesh->DeleteMovedNode(index);
748 for (std::list<CellPtr>::iterator cell_iter = this->mCells.begin();
749 cell_iter != this->mCells.end();
752 if (this->GetLocationIndexUsingCell(*cell_iter) == index)
755 this->RemoveCellUsingLocationIndex(index, (*cell_iter));
756 cell_iter = this->mCells.erase(cell_iter);
763template<
unsigned DIM>
770 boost::shared_ptr<std::vector<std::pair<CellPtr, Node<DIM>* > > > p_cells_right(&mCellsToSendRight,
null_deleter());
775 boost::shared_ptr<std::vector<std::pair<CellPtr, Node<DIM>* > > > p_cells_left(&mCellsToSendLeft,
null_deleter());
778 else if ( mpNodesOnlyMesh->GetIsPeriodicAcrossProcsFromBoxCollection() )
780 boost::shared_ptr<std::vector<std::pair<CellPtr, Node<DIM>* > > > p_cells_left(&mCellsToSendLeft,
null_deleter());
788 boost::shared_ptr<std::vector<std::pair<CellPtr, Node<DIM>* > > > p_cells_right(&mCellsToSendRight,
null_deleter());
789 mpCellsRecvRight = mRightCommunicator.SendRecvObject(p_cells_right, 0, mCellCommunicationTag, 0, mCellCommunicationTag, status);
794template<
unsigned DIM>
801 unsigned tag = 0.5*((senderI+receiverJ)*(senderI+receiverJ+1) + 2*receiverJ);
802 assert(tag < UINT_MAX);
806template<
unsigned DIM>
811 boost::shared_ptr<std::vector<std::pair<CellPtr, Node<DIM>* > > > p_cells_right(&mCellsToSendRight,
null_deleter());
818 boost::shared_ptr<std::vector<std::pair<CellPtr, Node<DIM>* > > > p_cells_left(&mCellsToSendLeft,
null_deleter());
821 else if ( mpNodesOnlyMesh->GetIsPeriodicAcrossProcsFromBoxCollection() )
824 boost::shared_ptr<std::vector<std::pair<CellPtr, Node<DIM>* > > > p_cells_left(&mCellsToSendLeft,
null_deleter());
830 boost::shared_ptr<std::vector<std::pair<CellPtr, Node<DIM>* > > > p_cells_right(&mCellsToSendRight,
null_deleter());
831 mRightCommunicator.ISendObject(p_cells_right, 0, tag);
845 else if ( mpNodesOnlyMesh->GetIsPeriodicAcrossProcsFromBoxCollection() )
853 mRightCommunicator.IRecvObject(0, tag);
857template<
unsigned DIM>
862 mpCellsRecvRight = mRightCommunicator.GetRecvObject();
866 mpCellsRecvLeft = mLeftCommunicator.GetRecvObject();
871 mpCellsRecvRight = mRightCommunicator.GetRecvObject();
875template<
unsigned DIM>
878 Node<DIM>* p_node = this->GetNode(nodeIndex);
880 CellPtr p_cell = this->GetCellUsingLocationIndex(nodeIndex);
882 std::pair<CellPtr, Node<DIM>* > new_pair(p_cell, p_node);
887template<
unsigned DIM>
890 std::pair<CellPtr, Node<DIM>* > pair = GetCellNodePair(nodeIndex);
892 mCellsToSendRight.push_back(pair);
895template<
unsigned DIM>
898 std::pair<CellPtr, Node<DIM>* > pair = GetCellNodePair(nodeIndex);
900 mCellsToSendLeft.push_back(pair);
903template<
unsigned DIM>
908 for (
typename std::vector<std::pair<CellPtr,
Node<DIM>* > >::iterator iter = mpCellsRecvLeft->begin();
909 iter != mpCellsRecvLeft->end();
913 boost::shared_ptr<Node<DIM> > p_node(iter->second);
914 AddMovedCell(iter->first, p_node);
919 for (
typename std::vector<std::pair<CellPtr,
Node<DIM>* > >::iterator iter = mpCellsRecvRight->begin();
920 iter != mpCellsRecvRight->end();
923 boost::shared_ptr<Node<DIM> > p_node(iter->second);
924 AddMovedCell(iter->first, p_node);
929template<
unsigned DIM>
932 mpNodesOnlyMesh->ResizeBoxCollection();
934 mpNodesOnlyMesh->CalculateNodesOutsideLocalDomain();
936 std::vector<unsigned> nodes_to_send_right = mpNodesOnlyMesh->rGetNodesToSendRight();
937 AddCellsToSendRight(nodes_to_send_right);
939 std::vector<unsigned> nodes_to_send_left = mpNodesOnlyMesh->rGetNodesToSendLeft();
940 AddCellsToSendLeft(nodes_to_send_left);
943 SendCellsToNeighbourProcesses();
948 for (std::vector<unsigned>::iterator iter = nodes_to_send_right.begin();
949 iter != nodes_to_send_right.end();
952 DeleteMovedCell(*iter);
955 for (std::vector<unsigned>::iterator iter = nodes_to_send_left.begin();
956 iter != nodes_to_send_left.end();
959 DeleteMovedCell(*iter);
964 NodeMap map(1 + mpNodesOnlyMesh->GetMaximumNodeIndex());
965 mpNodesOnlyMesh->ReMesh(map);
966 UpdateMapsAfterRemesh(map);
969template<
unsigned DIM>
972 mpNodesOnlyMesh->ClearHaloNodes();
975 mHaloCellLocationMap.clear();
976 mLocationHaloCellMap.clear();
978 std::vector<unsigned> halos_to_send_right = mpNodesOnlyMesh->rGetHaloNodesToSendRight();
979 AddCellsToSendRight(halos_to_send_right);
981 std::vector<unsigned> halos_to_send_left = mpNodesOnlyMesh->rGetHaloNodesToSendLeft();
982 AddCellsToSendLeft(halos_to_send_left);
984 NonBlockingSendCellsToNeighbourProcesses();
987template<
unsigned DIM>
990 mCellsToSendRight.clear();
992 for (
unsigned i=0; i < cellLocationIndices.size(); i++)
994 AddNodeAndCellToSendRight(cellLocationIndices[i]);
998template<
unsigned DIM>
1001 mCellsToSendLeft.clear();
1003 for (
unsigned i=0; i < cellLocationIndices.size(); i++)
1005 AddNodeAndCellToSendLeft(cellLocationIndices[i]);
1009template<
unsigned DIM>
1016 for (
typename std::vector<std::pair<CellPtr,
Node<DIM>* > >::iterator iter = mpCellsRecvLeft->begin();
1017 iter != mpCellsRecvLeft->end();
1020 boost::shared_ptr<Node<DIM> > p_node(iter->second);
1021 AddHaloCell(iter->first, p_node);
1027 for (
typename std::vector<std::pair<CellPtr,
Node<DIM>* > >::iterator iter = mpCellsRecvRight->begin();
1028 iter != mpCellsRecvRight->end();
1031 boost::shared_ptr<Node<DIM> > p_node(iter->second);
1032 AddHaloCell(iter->first, p_node);
1036 mpNodesOnlyMesh->AddHaloNodesToBoxes();
1039template<
unsigned DIM>
1042 mHaloCells.push_back(pCell);
1044 mpNodesOnlyMesh->AddHaloNode(pNode);
1046 mHaloCellLocationMap[pCell] = pNode->GetIndex();
1048 mLocationHaloCellMap[pNode->GetIndex()] = pCell;
#define EXCEPTION(message)
#define EXPORT_TEMPLATE_CLASS_SAME_DIMS(CLASS)
AbstractMesh< ELEMENT_DIM, SPACE_DIM > & mrMesh
virtual CellPtr GetCellUsingLocationIndex(unsigned index)
c_vector< double, SPACE_DIM > GetSizeOfCellPopulation()
virtual void OutputCellPopulationParameters(out_stream &rParamsFile)
CellPtr AddCell(CellPtr pNewCell, CellPtr pParentCell=CellPtr())
c_vector< double, DIM > GetSizeOfCellPopulation()
unsigned CalculateMessageTag(unsigned senderI, unsigned receiverJ)
void SendCellsToNeighbourProcesses()
void SetNode(unsigned nodeIndex, ChastePoint< DIM > &rNewLocation)
void AddCellsToSendRight(std::vector< unsigned > &cellLocationIndices)
void AddHaloCell(CellPtr pCell, boost::shared_ptr< Node< DIM > > pNode)
Node< DIM > * GetNode(unsigned index)
virtual void AcceptPopulationCountWriter(boost::shared_ptr< AbstractCellPopulationCountWriter< DIM, DIM > > pPopulationCountWriter)
void OutputCellPopulationParameters(out_stream &rParamsFile)
void AddNodeAndCellToSendLeft(unsigned nodeIndex)
virtual CellPtr GetCellUsingLocationIndex(unsigned index)
NodesOnlyMesh< DIM > & rGetMesh()
NodeBasedCellPopulation(NodesOnlyMesh< DIM > &rMesh, std::vector< CellPtr > &rCells, const std::vector< unsigned > locationIndices=std::vector< unsigned >(), bool deleteMesh=false, bool validate=true)
void SetUseVariableRadii(bool useVariableRadii=true)
virtual void UpdateCellProcessLocation()
std::pair< CellPtr, Node< DIM > * > GetCellNodePair(unsigned nodeIndex)
void SetLoadBalanceMesh(bool loadBalanceMesh)
virtual void WriteVtkResultsToFile(const std::string &rDirectory)
void AddCellsToSendLeft(std::vector< unsigned > &cellLocationIndices)
virtual void AcceptCellWriter(boost::shared_ptr< AbstractCellWriter< DIM, DIM > > pCellWriter, CellPtr pCell)
unsigned AddNode(Node< DIM > *pNewNode)
std::set< unsigned > GetNodesWithinNeighbourhoodRadius(unsigned index, double neighbourhoodRadius)
double GetWidth(const unsigned &rDimension)
void UpdateMapsAfterRemesh(NodeMap &map)
void DeleteMovedCell(unsigned index)
virtual TetrahedralMesh< DIM, DIM > * GetTetrahedralMeshForPdeModifier()
NodesOnlyMesh< DIM > * mpNodesOnlyMesh
void SetLoadBalanceFrequency(unsigned loadBalanceFrequency)
virtual ~NodeBasedCellPopulation()
bool GetUseVariableRadii()
unsigned RemoveDeadCells()
double GetMechanicsCutOffLength()
double GetVolumeOfCell(CellPtr pCell)
void Update(bool hasHadBirthsOrDeaths=true)
virtual CellPtr AddCell(CellPtr pNewCell, CellPtr pParentCell)
void AddNodeAndCellToSendRight(unsigned nodeIndex)
void AddMovedCell(CellPtr pCell, boost::shared_ptr< Node< DIM > > pNode)
std::set< unsigned > GetNeighbouringNodeIndices(unsigned index)
void AddReceivedHaloCells()
virtual void UpdateParticlesAfterReMesh(NodeMap &rMap)
virtual void AcceptPopulationEventWriter(boost::shared_ptr< AbstractCellPopulationEventWriter< DIM, DIM > > pPopulationEventWriter)
void NonBlockingSendCellsToNeighbourProcesses()
std::vector< std::pair< Node< DIM > *, Node< DIM > * > > & rGetNodePairs()
virtual void AcceptPopulationWriter(boost::shared_ptr< AbstractCellPopulationWriter< DIM, DIM > > pPopulationWriter)
unsigned GetNewIndex(unsigned oldIndex) const
bool IsDeleted(unsigned index)
void SetRadius(double radius)
const c_vector< double, SPACE_DIM > & rGetLocation() const
bool GetNeighboursSetUp()
std::vector< unsigned > & rGetNeighbours()
static SimulationTime * Instance()
unsigned GetTimeStepsElapsed() const
void AddPointData(std::string name, std::vector< double > data)
void SetParallelFiles(AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &rMesh)
void WriteFilesUsingMesh(AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &rMesh, bool keepOriginalElementIndexing=true)