Chaste  Release::2024.1
NodeBasedCellPopulation< DIM > Class Template Reference

#include <NodeBasedCellPopulation.hpp>

+ Inheritance diagram for NodeBasedCellPopulation< DIM >:
+ Collaboration diagram for NodeBasedCellPopulation< DIM >:

Public Member Functions

void SetNode (unsigned nodeIndex, ChastePoint< DIM > &rNewLocation)
 
 NodeBasedCellPopulation (NodesOnlyMesh< DIM > &rMesh, std::vector< CellPtr > &rCells, const std::vector< unsigned > locationIndices=std::vector< unsigned >(), bool deleteMesh=false, bool validate=true)
 
 NodeBasedCellPopulation (NodesOnlyMesh< DIM > &rMesh)
 
virtual ~NodeBasedCellPopulation ()
 
NodesOnlyMesh< DIM > & rGetMesh ()
 
const NodesOnlyMesh< DIM > & rGetMesh () const
 
virtual TetrahedralMesh< DIM, DIM > * GetTetrahedralMeshForPdeModifier ()
 
unsigned GetNumNodes ()
 
virtual CellPtr GetCellUsingLocationIndex (unsigned index)
 
Node< DIM > * GetNode (unsigned index)
 
unsigned RemoveDeadCells ()
 
void Clear ()
 
void Update (bool hasHadBirthsOrDeaths=true)
 
std::vector< std::pair< Node< DIM > *, Node< DIM > *> > & rGetNodePairs ()
 
void OutputCellPopulationParameters (out_stream &rParamsFile)
 
virtual void AcceptPopulationWriter (boost::shared_ptr< AbstractCellPopulationWriter< DIM, DIM > > pPopulationWriter)
 
virtual void AcceptPopulationCountWriter (boost::shared_ptr< AbstractCellPopulationCountWriter< DIM, DIM > > pPopulationCountWriter)
 
virtual void AcceptCellWriter (boost::shared_ptr< AbstractCellWriter< DIM, DIM > > pCellWriter, CellPtr pCell)
 
double GetMechanicsCutOffLength ()
 
bool GetUseVariableRadii ()
 
void SetUseVariableRadii (bool useVariableRadii=true)
 
void SetLoadBalanceMesh (bool loadBalanceMesh)
 
void SetLoadBalanceFrequency (unsigned loadBalanceFrequency)
 
double GetWidth (const unsigned &rDimension)
 
c_vector< double, DIM > GetSizeOfCellPopulation ()
 
std::set< unsignedGetNodesWithinNeighbourhoodRadius (unsigned index, double neighbourhoodRadius)
 
std::set< unsignedGetNeighbouringNodeIndices (unsigned index)
 
virtual CellPtr AddCell (CellPtr pNewCell, CellPtr pParentCell)
 
double GetVolumeOfCell (CellPtr pCell)
 
void SendCellsToNeighbourProcesses ()
 
void NonBlockingSendCellsToNeighbourProcesses ()
 
void GetReceivedCells ()
 
std::pair< CellPtr, Node< DIM > *> GetCellNodePair (unsigned nodeIndex)
 
void AddReceivedCells ()
 
virtual void UpdateCellProcessLocation ()
 
- Public Member Functions inherited from AbstractCentreBasedCellPopulation< DIM >
 AbstractCentreBasedCellPopulation (AbstractMesh< ELEMENT_DIM, ELEMENT_DIM > &rMesh, std::vector< CellPtr > &rCells, const std::vector< unsigned > locationIndices=std::vector< unsigned >())
 
c_vector< double, ELEMENT_DIM > GetLocationOfCellCentre (CellPtr pCell)
 
Node< ELEMENT_DIM > * GetNodeCorrespondingToCell (CellPtr pCell)
 
virtual double GetCellDataItemAtPdeNode (unsigned pdeNodeIndex, std::string &rVariableName, bool dirichletBoundaryConditionApplies=false, double dirichletBoundaryValue=0.0)
 
CellPtr AddCell (CellPtr pNewCell, CellPtr pParentCell=CellPtr())
 
std::pair< CellPtr, CellPtr > CreateCellPair (CellPtr pCell1, CellPtr pCell2)
 
bool IsMarkedSpring (const std::pair< CellPtr, CellPtr > &rCellPair)
 
void MarkSpring (std::pair< CellPtr, CellPtr > &rCellPair)
 
void UnmarkSpring (std::pair< CellPtr, CellPtr > &rCellPair)
 
bool IsCellAssociatedWithADeletedLocation (CellPtr pCell)
 
virtual std::set< unsignedGetNeighbouringLocationIndices (CellPtr pCell)
 
virtual void CheckForStepSizeException (unsigned nodeIndex, c_vector< double, ELEMENT_DIM > &rDisplacement, double dt)
 
virtual double GetDampingConstant (unsigned nodeIndex)
 
virtual bool IsGhostNode (unsigned index)
 
virtual bool IsParticle (unsigned index)
 
double GetMeinekeDivisionSeparation ()
 
void SetMeinekeDivisionSeparation (double divisionSeparation)
 
boost::shared_ptr< AbstractCentreBasedDivisionRule< ELEMENT_DIM, ELEMENT_DIM > > GetCentreBasedDivisionRule ()
 
void SetCentreBasedDivisionRule (boost::shared_ptr< AbstractCentreBasedDivisionRule< ELEMENT_DIM, ELEMENT_DIM > > pCentreBasedDivisionRule)
 
virtual double GetDefaultTimeStep ()
 
- Public Member Functions inherited from AbstractOffLatticeCellPopulation< ELEMENT_DIM, SPACE_DIM >
 AbstractOffLatticeCellPopulation (AbstractMesh< ELEMENT_DIM, SPACE_DIM > &rMesh, std::vector< CellPtr > &rCells, const std::vector< unsigned > locationIndices=std::vector< unsigned >())
 
virtual unsigned AddNode (Node< SPACE_DIM > *pNewNode)=0
 
virtual void SetNode (unsigned nodeIndex, ChastePoint< SPACE_DIM > &rNewLocation)=0
 
virtual void UpdateNodeLocations (double dt)
 
virtual void CheckForStepSizeException (unsigned nodeIndex, c_vector< double, SPACE_DIM > &rDisplacement, double dt)=0
 
void SetDampingConstantNormal (double dampingConstantNormal)
 
void SetDampingConstantMutant (double dampingConstantMutant)
 
void SetAbsoluteMovementThreshold (double absoluteMovementThreshold)
 
double GetAbsoluteMovementThreshold ()
 
double GetDampingConstantNormal ()
 
double GetDampingConstantMutant ()
 
- Public Member Functions inherited from AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >
 AbstractCellPopulation (AbstractMesh< ELEMENT_DIM, SPACE_DIM > &rMesh, std::vector< CellPtr > &rCells, const std::vector< unsigned > locationIndices=std::vector< unsigned >())
 
virtual ~AbstractCellPopulation ()
 
void InitialiseCells ()
 
void SetDataOnAllCells (const std::string &rDataName, double dataValue)
 
AbstractMesh< ELEMENT_DIM, SPACE_DIM > & rGetMesh ()
 
virtual bool IsPdeNodeAssociatedWithNonApoptoticCell (unsigned pdeNodeIndex)
 
std::list< CellPtr > & rGetCells ()
 
virtual void WriteDataToVisualizerSetupFile (out_stream &pVizSetupFile)
 
std::vector< unsignedGetCellMutationStateCount ()
 
std::vector< unsignedGetCellProliferativeTypeCount ()
 
std::vector< unsignedGetCellCyclePhaseCount ()
 
unsigned GetNumRealCells ()
 
unsigned GetNumAllCells ()
 
void SetCellAncestorsToLocationIndices ()
 
std::set< unsignedGetCellAncestors ()
 
std::set< CellPtr > GetCellsUsingLocationIndex (unsigned index)
 
virtual bool IsCellAttachedToLocationIndex (unsigned index)
 
void SetCellUsingLocationIndex (unsigned index, CellPtr pCell)
 
virtual void AddCellUsingLocationIndex (unsigned index, CellPtr pCell)
 
virtual void RemoveCellUsingLocationIndex (unsigned index, CellPtr pCell)
 
void MoveCellInLocationMap (CellPtr pCell, unsigned old_index, unsigned new_index)
 
unsigned GetLocationIndexUsingCell (CellPtr pCell)
 
boost::shared_ptr< CellPropertyRegistryGetCellPropertyRegistry ()
 
void SetDefaultCellMutationStateAndProliferativeTypeOrdering ()
 
c_vector< double, SPACE_DIM > GetCentroidOfCellPopulation ()
 
virtual void OpenWritersFiles (OutputFileHandler &rOutputFileHandler)
 
void CloseWritersFiles ()
 
virtual void WriteResultsToFiles (const std::string &rDirectory)
 
virtual void AcceptPopulationWriter (boost::shared_ptr< AbstractCellPopulationWriter< ELEMENT_DIM, SPACE_DIM > > pPopulationWriter)=0
 
virtual void AcceptPopulationCountWriter (boost::shared_ptr< AbstractCellPopulationCountWriter< ELEMENT_DIM, SPACE_DIM > > pPopulationCountWriter)=0
 
virtual void AcceptCellWriter (boost::shared_ptr< AbstractCellWriter< ELEMENT_DIM, SPACE_DIM > > pCellWriter, CellPtr pCell)=0
 
void OutputCellPopulationInfo (out_stream &rParamsFile)
 
virtual void SimulationSetupHook (AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM > *pSimulation)
 
bool GetOutputResultsForChasteVisualizer ()
 
template<template< unsigned, unsigned > class T>
void AddPopulationWriter ()
 
template<template< unsigned, unsigned > class T>
void AddCellWriter ()
 
template<template< unsigned, unsigned > class T>
void AddCellPopulationCountWriter ()
 
void AddPopulationWriter (boost::shared_ptr< AbstractCellPopulationWriter< ELEMENT_DIM, SPACE_DIM > > pPopulationWriter)
 
void AddCellWriter (boost::shared_ptr< AbstractCellWriter< ELEMENT_DIM, SPACE_DIM > > pCellWriter)
 
void AddCellPopulationCountWriter (boost::shared_ptr< AbstractCellPopulationCountWriter< ELEMENT_DIM, SPACE_DIM > > pCellPopulationCountWriter)
 
template<template< unsigned, unsigned > class T>
bool HasWriter () const
 
void SetOutputResultsForChasteVisualizer (bool outputResultsForChasteVisualizer)
 
c_vector< double, SPACE_DIM > GetSizeOfCellPopulation ()
 
virtual bool IsRoomToDivide (CellPtr pCell)
 
std::pair< unsigned, unsignedCreateOrderedPair (unsigned index1, unsigned index2)
 
Iterator Begin ()
 
Iterator End ()
 
- Public Member Functions inherited from Identifiable
virtual ~Identifiable ()
 
std::string GetIdentifier () const
 

Protected Member Functions

virtual void UpdateParticlesAfterReMesh (NodeMap &rMap)
 
virtual void Validate ()
 
- Protected Member Functions inherited from AbstractCentreBasedCellPopulation< DIM >
 AbstractCentreBasedCellPopulation (AbstractMesh< ELEMENT_DIM, ELEMENT_DIM > &rMesh)
 
virtual void AcceptCellWritersAcrossPopulation ()
 
- Protected Member Functions inherited from AbstractOffLatticeCellPopulation< ELEMENT_DIM, SPACE_DIM >
 AbstractOffLatticeCellPopulation (AbstractMesh< ELEMENT_DIM, SPACE_DIM > &rMesh)
 
- Protected Member Functions inherited from AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >
 AbstractCellPopulation (AbstractMesh< ELEMENT_DIM, SPACE_DIM > &rMesh)
 

Protected Attributes

NodesOnlyMesh< DIM > * mpNodesOnlyMesh
 
- Protected Attributes inherited from AbstractCentreBasedCellPopulation< DIM >
double mMeinekeDivisionSeparation
 
std::set< std::pair< CellPtr, CellPtr > > mMarkedSprings
 
boost::shared_ptr< AbstractCentreBasedDivisionRule< ELEMENT_DIM, ELEMENT_DIM > > mpCentreBasedDivisionRule
 
- Protected Attributes inherited from AbstractOffLatticeCellPopulation< ELEMENT_DIM, SPACE_DIM >
double mDampingConstantNormal
 
double mDampingConstantMutant
 
double mAbsoluteMovementThreshold
 
- Protected Attributes inherited from AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >
std::map< unsigned, std::set< CellPtr > > mLocationCellMap
 
std::map< Cell *, unsignedmCellLocationMap
 
AbstractMesh< ELEMENT_DIM, SPACE_DIM > & mrMesh
 
std::list< CellPtr > mCells
 
c_vector< double, SPACE_DIM > mCentroid
 
out_stream mpVtkMetaFile
 
boost::shared_ptr< CellPropertyRegistrympCellPropertyRegistry
 
bool mOutputResultsForChasteVisualizer
 
std::vector< boost::shared_ptr< AbstractCellWriter< ELEMENT_DIM, SPACE_DIM > > > mCellWriters
 
std::vector< boost::shared_ptr< AbstractCellPopulationWriter< ELEMENT_DIM, SPACE_DIM > > > mCellPopulationWriters
 
std::vector< boost::shared_ptr< AbstractCellPopulationCountWriter< ELEMENT_DIM, SPACE_DIM > > > mCellPopulationCountWriters
 

Private Member Functions

template<class Archive >
void serialize (Archive &archive, const unsigned int version)
 
unsigned AddNode (Node< DIM > *pNewNode)
 
void AddMovedCell (CellPtr pCell, boost::shared_ptr< Node< DIM > > pNode)
 
void DeleteMovedCell (unsigned index)
 
void RefreshHaloCells ()
 
void AddNodeAndCellToSendRight (unsigned nodeIndex)
 
void AddNodeAndCellToSendLeft (unsigned nodeIndex)
 
void AddCellsToSendRight (std::vector< unsigned > &cellLocationIndices)
 
void AddCellsToSendLeft (std::vector< unsigned > &cellLocationIndices)
 
void AddReceivedHaloCells ()
 
void AddHaloCell (CellPtr pCell, boost::shared_ptr< Node< DIM > > pNode)
 
void UpdateMapsAfterRemesh (NodeMap &map)
 
virtual void WriteVtkResultsToFile (const std::string &rDirectory)
 
unsigned CalculateMessageTag (unsigned senderI, unsigned receiverJ)
 

Private Attributes

c_vector< double, DIM > mMinSpatialPositions
 
c_vector< double, DIM > mMaxSpatialPositions
 
std::vector< std::pair< Node< DIM > *, Node< DIM > *> > mNodePairs
 
bool mDeleteMesh
 
bool mUseVariableRadii
 
std::vector< std::pair< CellPtr, Node< DIM > *> > mCellsToSendRight
 
std::vector< std::pair< CellPtr, Node< DIM > *> > mCellsToSendLeft
 
boost::shared_ptr< std::vector< std::pair< CellPtr, Node< DIM > *> > > mpCellsRecvRight
 
boost::shared_ptr< std::vector< std::pair< CellPtr, Node< DIM > *> > > mpCellsRecvLeft
 
ObjectCommunicator< std::vector< std::pair< CellPtr, Node< DIM > *> > > mRightCommunicator
 
ObjectCommunicator< std::vector< std::pair< CellPtr, Node< DIM > *> > > mLeftCommunicator
 
std::vector< CellPtr > mHaloCells
 
std::map< unsigned, CellPtr > mLocationHaloCellMap
 
std::map< CellPtr, unsignedmHaloCellLocationMap
 
bool mLoadBalanceMesh
 
unsigned mLoadBalanceFrequency
 

Static Private Attributes

static const unsigned mCellCommunicationTag = 123
 

Friends

class TestNodeBasedCellPopulation
 
class TestNodeBasedCellPopulationParallelMethods
 
class TestPeriodicNodeBasedCellPopulationParallelMethods
 
class boost::serialization::access
 

Detailed Description

template<unsigned DIM>
class NodeBasedCellPopulation< DIM >

A NodeBasedCellPopulation is a CellPopulation consisting of only nodes in space with associated cells. There are no elements and no mesh.

Definition at line 52 of file NodeBasedCellPopulation.hpp.

Constructor & Destructor Documentation

◆ NodeBasedCellPopulation() [1/2]

template<unsigned DIM>
NodeBasedCellPopulation< DIM >::NodeBasedCellPopulation ( NodesOnlyMesh< DIM > &  rMesh,
std::vector< CellPtr > &  rCells,
const std::vector< unsigned locationIndices = std::vector<unsigned>(),
bool  deleteMesh = false,
bool  validate = true 
)

Default constructor.

Note that the cell population will take responsibility for freeing the memory used by the nodes.

Parameters
rMesha mutable nodes-only mesh
rCellsa vector of cells
locationIndicesan optional vector of location indices that correspond to real cells
deleteMeshwhether to delete nodes-only mesh in destructor
validatewhether to call Validate() in the constructor or not

Definition at line 41 of file NodeBasedCellPopulation.cpp.

References NodeBasedCellPopulation< DIM >::mpNodesOnlyMesh, AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::mrMesh, and NodeBasedCellPopulation< DIM >::Validate().

◆ NodeBasedCellPopulation() [2/2]

template<unsigned DIM>
NodeBasedCellPopulation< DIM >::NodeBasedCellPopulation ( NodesOnlyMesh< DIM > &  rMesh)

Constructor for use by the de-serializer.

Parameters
rMesha mutable nodes-only mesh

Definition at line 61 of file NodeBasedCellPopulation.cpp.

References NodeBasedCellPopulation< DIM >::mpNodesOnlyMesh, and AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::mrMesh.

◆ ~NodeBasedCellPopulation()

Member Function Documentation

◆ AcceptCellWriter()

template<unsigned DIM>
void NodeBasedCellPopulation< DIM >::AcceptCellWriter ( boost::shared_ptr< AbstractCellWriter< DIM, DIM > >  pCellWriter,
CellPtr  pCell 
)
virtual

A virtual method to accept a cell writer so it can write data from this object to file.

Parameters
pCellWriterthe population writer.
pCellthe cell whose data are being written.

Definition at line 317 of file NodeBasedCellPopulation.cpp.

Referenced by NodeBasedCellPopulationWithParticles< DIM >::AcceptCellWritersAcrossPopulation().

◆ AcceptPopulationCountWriter()

template<unsigned DIM>
void NodeBasedCellPopulation< DIM >::AcceptPopulationCountWriter ( boost::shared_ptr< AbstractCellPopulationCountWriter< DIM, DIM > >  pPopulationCountWriter)
virtual

A virtual method to accept a cell population count writer so it can write data from this object to file.

Parameters
pPopulationCountWriterthe population count writer.

Definition at line 311 of file NodeBasedCellPopulation.cpp.

◆ AcceptPopulationWriter()

template<unsigned DIM>
void NodeBasedCellPopulation< DIM >::AcceptPopulationWriter ( boost::shared_ptr< AbstractCellPopulationWriter< DIM, DIM > >  pPopulationWriter)
virtual

A virtual method to accept a cell population writer so it can write data from this object to file.

Parameters
pPopulationWriterthe population writer.

Definition at line 305 of file NodeBasedCellPopulation.cpp.

◆ AddCell()

template<unsigned DIM>
CellPtr NodeBasedCellPopulation< DIM >::AddCell ( CellPtr  pNewCell,
CellPtr  pParentCell 
)
virtual

Overridden AddCell() method.

Add a new cell to the cell population and update the vector of cell radii in the NodesOnlyMesh.

Parameters
pNewCellthe cell to add
pParentCellpointer to a parent cell - this is required for node-based cell populations
Returns
address of cell as it appears in the cell list (internal of this method uses a copy constructor along the way)

Implements AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.

Reimplemented in NodeBasedCellPopulationWithParticles< DIM >.

Definition at line 698 of file NodeBasedCellPopulation.cpp.

References AbstractCentreBasedCellPopulation< ELEMENT_DIM, SPACE_DIM >::AddCell(), AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::GetLocationIndexUsingCell(), NodeBasedCellPopulation< DIM >::GetNode(), Node< SPACE_DIM >::GetRadius(), and Node< SPACE_DIM >::SetRadius().

◆ AddCellsToSendLeft()

template<unsigned DIM>
void NodeBasedCellPopulation< DIM >::AddCellsToSendLeft ( std::vector< unsigned > &  cellLocationIndices)
private

Add a collection of cells to send left

Parameters
cellLocationIndicesthe list of location indices of cells to send.

Definition at line 989 of file NodeBasedCellPopulation.cpp.

References NodeBasedCellPopulation< DIM >::mCellsToSendLeft.

Referenced by NodeBasedCellPopulation< DIM >::RefreshHaloCells(), and NodeBasedCellPopulation< DIM >::UpdateCellProcessLocation().

◆ AddCellsToSendRight()

template<unsigned DIM>
void NodeBasedCellPopulation< DIM >::AddCellsToSendRight ( std::vector< unsigned > &  cellLocationIndices)
private

Add a collection of cells to send right

Parameters
cellLocationIndicesthe list of location indices of cells to send.

Definition at line 978 of file NodeBasedCellPopulation.cpp.

References NodeBasedCellPopulation< DIM >::mCellsToSendRight.

Referenced by NodeBasedCellPopulation< DIM >::RefreshHaloCells(), and NodeBasedCellPopulation< DIM >::UpdateCellProcessLocation().

◆ AddHaloCell()

template<unsigned DIM>
void NodeBasedCellPopulation< DIM >::AddHaloCell ( CellPtr  pCell,
boost::shared_ptr< Node< DIM > >  pNode 
)
private

◆ AddMovedCell()

template<unsigned DIM>
void NodeBasedCellPopulation< DIM >::AddMovedCell ( CellPtr  pCell,
boost::shared_ptr< Node< DIM > >  pNode 
)
private

Add a moved cell to this process along with its node.

Parameters
pCellthe pointer to the cell that is to be added.
pNodethe pointer to the node that is to be added.

Definition at line 720 of file NodeBasedCellPopulation.cpp.

References AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::AddCellUsingLocationIndex(), NodesOnlyMesh< SPACE_DIM >::AddMovedNode(), AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::mCells, and NodeBasedCellPopulation< DIM >::mpNodesOnlyMesh.

Referenced by NodeBasedCellPopulation< DIM >::AddReceivedCells(), and NodeBasedCellPopulation< DIM >::serialize().

◆ AddNode()

template<unsigned DIM>
unsigned NodeBasedCellPopulation< DIM >::AddNode ( Node< DIM > *  pNewNode)
private

Overridden AddNode() method.

Add a new node to the cell population.

Parameters
pNewNodepointer to the new node
Returns
global index of new node in cell population

Definition at line 258 of file NodeBasedCellPopulation.cpp.

References NodesOnlyMesh< SPACE_DIM >::AddNode(), and NodeBasedCellPopulation< DIM >::mpNodesOnlyMesh.

Referenced by NodeBasedCellPopulation< DIM >::serialize().

◆ AddNodeAndCellToSendLeft()

template<unsigned DIM>
void NodeBasedCellPopulation< DIM >::AddNodeAndCellToSendLeft ( unsigned  nodeIndex)
private

Add the node and cell with index nodeIndex to the list of cells to send to the process left.

Parameters
nodeIndexthe index of the node and cell to send.

Definition at line 886 of file NodeBasedCellPopulation.cpp.

References NodeBasedCellPopulation< DIM >::GetCellNodePair(), and NodeBasedCellPopulation< DIM >::mCellsToSendLeft.

◆ AddNodeAndCellToSendRight()

template<unsigned DIM>
void NodeBasedCellPopulation< DIM >::AddNodeAndCellToSendRight ( unsigned  nodeIndex)
private

Add the node and cell with index nodeIndex to the list of cells to send to the process right.

Parameters
nodeIndexthe index of the node and cell to send.

Definition at line 878 of file NodeBasedCellPopulation.cpp.

References NodeBasedCellPopulation< DIM >::GetCellNodePair(), and NodeBasedCellPopulation< DIM >::mCellsToSendRight.

◆ AddReceivedCells()

◆ AddReceivedHaloCells()

◆ CalculateMessageTag()

template<unsigned DIM>
unsigned NodeBasedCellPopulation< DIM >::CalculateMessageTag ( unsigned  senderI,
unsigned  receiverJ 
)
private

Helper method to calculate the message tags between processors for NonBlockingSendCellsToNeighbourProcesses method Uses a Cantor pairing function

Parameters
senderIsender processor rank
receiverJreceiver processor rank
Returns
a unique tag number

Definition at line 785 of file NodeBasedCellPopulation.cpp.

Referenced by NodeBasedCellPopulation< DIM >::NonBlockingSendCellsToNeighbourProcesses().

◆ Clear()

template<unsigned DIM>
void NodeBasedCellPopulation< DIM >::Clear ( )

Reset the member variables mNodePairs and mpBoxCollection in the underlying mesh.

Definition at line 113 of file NodeBasedCellPopulation.cpp.

References NodeBasedCellPopulation< DIM >::mNodePairs.

Referenced by NodeBasedCellPopulation< DIM >::~NodeBasedCellPopulation().

◆ DeleteMovedCell()

template<unsigned DIM>
void NodeBasedCellPopulation< DIM >::DeleteMovedCell ( unsigned  index)
private

Delete a cell and its associated node that have moved off this process.

Parameters
indexthe location of the cell to be deleted

Definition at line 733 of file NodeBasedCellPopulation.cpp.

Referenced by NodeBasedCellPopulation< DIM >::serialize(), and NodeBasedCellPopulation< DIM >::UpdateCellProcessLocation().

◆ GetCellNodePair()

template<unsigned DIM>
std::pair< CellPtr, Node< DIM > *> NodeBasedCellPopulation< DIM >::GetCellNodePair ( unsigned  nodeIndex)

Helper method to find and pack up nodes and cells together

Parameters
nodeIndexthe global index of the node.
Returns
the pair.

Definition at line 866 of file NodeBasedCellPopulation.cpp.

References NodeBasedCellPopulation< DIM >::GetCellUsingLocationIndex(), and NodeBasedCellPopulation< DIM >::GetNode().

Referenced by NodeBasedCellPopulation< DIM >::AddNodeAndCellToSendLeft(), and NodeBasedCellPopulation< DIM >::AddNodeAndCellToSendRight().

◆ GetCellUsingLocationIndex()

template<unsigned DIM>
CellPtr NodeBasedCellPopulation< DIM >::GetCellUsingLocationIndex ( unsigned  index)
virtual

Overridden method from AbstractCellPopulation so that we can access halo cells through this method.

Parameters
indexthe global index of the node assocaited with a cell
Returns
the (set of) cells to which the node is attached.

Reimplemented from AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.

Definition at line 270 of file NodeBasedCellPopulation.cpp.

Referenced by NodeBasedCellPopulationWithParticles< DIM >::AcceptCellWritersAcrossPopulation(), NodeBasedCellPopulation< DIM >::GetCellNodePair(), NodeBasedCellPopulation< DIM >::Validate(), NodeVelocityWriter< ELEMENT_DIM, SPACE_DIM >::Visit(), and NodeBasedCellPopulationWithParticles< DIM >::WriteVtkResultsToFile().

◆ GetMechanicsCutOffLength()

template<unsigned DIM>
double NodeBasedCellPopulation< DIM >::GetMechanicsCutOffLength ( )
Returns
the maximum interaction distance between cells, defined in NodesOnlyMesh.

Definition at line 323 of file NodeBasedCellPopulation.cpp.

References NodesOnlyMesh< SPACE_DIM >::GetMaximumInteractionDistance(), and NodeBasedCellPopulation< DIM >::mpNodesOnlyMesh.

◆ GetNeighbouringNodeIndices()

template<unsigned DIM>
std::set< unsigned > NodeBasedCellPopulation< DIM >::GetNeighbouringNodeIndices ( unsigned  index)
virtual

Overridden GetNeighbouringNodeIndices() method.

Not that this method only returns node indices for cells that are strictly touching each other.

Parameters
indexthe node index
Returns
the set of neighbouring node indices.

Implements AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.

Definition at line 429 of file NodeBasedCellPopulation.cpp.

Referenced by BuskeCompressionForce< DIM >::AddForceContribution(), NodeBasedCellPopulation< DIM >::GetVolumeOfCell(), NodeBasedCellPopulationWithBuskeUpdate< DIM >::UpdateNodeLocations(), and HeterotypicBoundaryLengthWriter< ELEMENT_DIM, SPACE_DIM >::Visit().

◆ GetNode()

◆ GetNodesWithinNeighbourhoodRadius()

template<unsigned DIM>
std::set< unsigned > NodeBasedCellPopulation< DIM >::GetNodesWithinNeighbourhoodRadius ( unsigned  index,
double  neighbourhoodRadius 
)

Method to return nodes within a given radius of a node. Note this is independent of cell radius and returns all nodes within a given radius.

Parameters
indexthe node index
neighbourhoodRadiusthe radius to find neighbours in. Note must be less than the MaximumInteractionDistance in the NodesOnlyMesh
Returns
the set of neighbouring node indices within neighbourhoodRadius of the specified node.

Definition at line 373 of file NodeBasedCellPopulation.cpp.

◆ GetNumNodes()

◆ GetReceivedCells()

◆ GetSizeOfCellPopulation()

template<unsigned DIM>
c_vector< double, DIM > NodeBasedCellPopulation< DIM >::GetSizeOfCellPopulation ( )

Overridden GetSizeOfCellPopulation to work in parallel.

Returns
the size of the cell population.

Definition at line 359 of file NodeBasedCellPopulation.cpp.

References AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::GetSizeOfCellPopulation().

◆ GetTetrahedralMeshForPdeModifier()

template<unsigned DIM>
TetrahedralMesh< DIM, DIM > * NodeBasedCellPopulation< DIM >::GetTetrahedralMeshForPdeModifier ( )
virtual

◆ GetUseVariableRadii()

template<unsigned DIM>
bool NodeBasedCellPopulation< DIM >::GetUseVariableRadii ( )
Returns
mUseVariableRadii

Definition at line 329 of file NodeBasedCellPopulation.cpp.

References NodeBasedCellPopulation< DIM >::mUseVariableRadii.

◆ GetVolumeOfCell()

◆ GetWidth()

template<unsigned DIM>
double NodeBasedCellPopulation< DIM >::GetWidth ( const unsigned rDimension)
virtual

Overridden GetWidth() method.

Calculate the 'width' of any dimension of the cell population by computing the maximum distance between any nodes in this dimension.

Parameters
rDimensiona dimension (0,1 or 2)
Returns
The maximum distance between any nodes in this dimension.

Implements AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.

Definition at line 353 of file NodeBasedCellPopulation.cpp.

References NodesOnlyMesh< SPACE_DIM >::GetWidth(), and NodeBasedCellPopulation< DIM >::mpNodesOnlyMesh.

◆ NonBlockingSendCellsToNeighbourProcesses()

◆ OutputCellPopulationParameters()

template<unsigned DIM>
void NodeBasedCellPopulation< DIM >::OutputCellPopulationParameters ( out_stream &  rParamsFile)
virtual

◆ RefreshHaloCells()

◆ RemoveDeadCells()

template<unsigned DIM>
unsigned NodeBasedCellPopulation< DIM >::RemoveDeadCells ( )
virtual

Remove all cells labelled as dead.

Note that after calling this method the cell population will be in an inconsistent state until the equivalent of a 'remesh' is performed! So don't try iterating over cells or anything like that.

Returns
number of cells removed

Implements AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.

Definition at line 227 of file NodeBasedCellPopulation.cpp.

References MutableMesh< ELEMENT_DIM, SPACE_DIM >::DeleteNodePriorToReMesh(), AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::GetLocationIndexUsingCell(), AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::mCells, NodeBasedCellPopulation< DIM >::mpNodesOnlyMesh, AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::RemoveCellUsingLocationIndex(), and NodesOnlyMesh< SPACE_DIM >::SolveNodeMapping().

◆ rGetMesh() [1/2]

◆ rGetMesh() [2/2]

template<unsigned DIM>
const NodesOnlyMesh< DIM > & NodeBasedCellPopulation< DIM >::rGetMesh ( ) const
Returns
const reference to mrMesh (used in archiving).

Definition at line 88 of file NodeBasedCellPopulation.cpp.

References NodeBasedCellPopulation< DIM >::mpNodesOnlyMesh.

◆ rGetNodePairs()

template<unsigned DIM>
std::vector< std::pair< Node< DIM > *, Node< DIM > *> > & NodeBasedCellPopulation< DIM >::rGetNodePairs ( )
virtual

Overridden rGetNodePairs method

Returns
Node pairs for force calculation.

Implements AbstractCentreBasedCellPopulation< DIM >.

Definition at line 289 of file NodeBasedCellPopulation.cpp.

References NodeBasedCellPopulation< DIM >::mNodePairs.

◆ SendCellsToNeighbourProcesses()

◆ serialize()

template<unsigned DIM>
template<class Archive >
void NodeBasedCellPopulation< DIM >::serialize ( Archive &  archive,
const unsigned int  version 
)
inlineprivate

Serialize the object and its member variables.

Note that serialization of the nodes is handled by load/save_construct_data, so we don't actually have to do anything here except delegate to the base class.

Parameters
archivethe archive
versionthe current version of this class

Definition at line 128 of file NodeBasedCellPopulation.hpp.

References NodeBasedCellPopulation< DIM >::AddMovedCell(), NodeBasedCellPopulation< DIM >::AddNode(), NodeBasedCellPopulation< DIM >::DeleteMovedCell(), NodeBasedCellPopulation< DIM >::mUseVariableRadii, and NodeBasedCellPopulation< DIM >::Validate().

◆ SetLoadBalanceFrequency()

template<unsigned DIM>
void NodeBasedCellPopulation< DIM >::SetLoadBalanceFrequency ( unsigned  loadBalanceFrequency)

Set the freqeuncy, in number of time steps, with which the underlying mesh should be load balanced.

Parameters
loadBalanceFrequencythe frequency for load balancing.

Definition at line 347 of file NodeBasedCellPopulation.cpp.

References NodeBasedCellPopulation< DIM >::mLoadBalanceFrequency.

◆ SetLoadBalanceMesh()

template<unsigned DIM>
void NodeBasedCellPopulation< DIM >::SetLoadBalanceMesh ( bool  loadBalanceMesh)

Set whether to carry out the dynamic load balance algorithm on this mesh when it is updated

Parameters
loadBalanceMeshwhether to do dynamic load balancing.

Definition at line 341 of file NodeBasedCellPopulation.cpp.

References NodeBasedCellPopulation< DIM >::mLoadBalanceMesh.

◆ SetNode()

template<unsigned DIM>
void NodeBasedCellPopulation< DIM >::SetNode ( unsigned  nodeIndex,
ChastePoint< DIM > &  rNewLocation 
)

Move the node with a given index to a new point in space.

Parameters
nodeIndexthe index of the node to be moved
rNewLocationthe new target location of the node

Definition at line 143 of file NodeBasedCellPopulation.cpp.

References NodeBasedCellPopulation< DIM >::mpNodesOnlyMesh, and NodesOnlyMesh< SPACE_DIM >::SetNode().

◆ SetUseVariableRadii()

template<unsigned DIM>
void NodeBasedCellPopulation< DIM >::SetUseVariableRadii ( bool  useVariableRadii = true)

Set mUseVariableRadii.

Parameters
useVariableRadiithe new value of mUseVariableRadii

Definition at line 335 of file NodeBasedCellPopulation.cpp.

References NodeBasedCellPopulation< DIM >::mUseVariableRadii.

◆ Update()

◆ UpdateCellProcessLocation()

◆ UpdateMapsAfterRemesh()

◆ UpdateParticlesAfterReMesh()

template<unsigned DIM>
void NodeBasedCellPopulation< DIM >::UpdateParticlesAfterReMesh ( NodeMap rMap)
protectedvirtual

Update mIsParticle if required by a remesh.

Parameters
rMapA map between node indices before and after remesh

Reimplemented in NodeBasedCellPopulationWithParticles< DIM >.

Definition at line 284 of file NodeBasedCellPopulation.cpp.

Referenced by NodeBasedCellPopulation< DIM >::UpdateMapsAfterRemesh().

◆ Validate()

◆ WriteVtkResultsToFile()

Friends And Related Function Documentation

◆ boost::serialization::access

template<unsigned DIM>
friend class boost::serialization::access
friend

Needed for serialization.

Definition at line 117 of file NodeBasedCellPopulation.hpp.

Member Data Documentation

◆ mCellCommunicationTag

template<unsigned DIM>
const unsigned NodeBasedCellPopulation< DIM >::mCellCommunicationTag = 123
staticprivate

The tag used to send and recieve cell information

Definition at line 99 of file NodeBasedCellPopulation.hpp.

Referenced by NodeBasedCellPopulation< DIM >::SendCellsToNeighbourProcesses().

◆ mCellsToSendLeft

◆ mCellsToSendRight

◆ mDeleteMesh

template<unsigned DIM>
bool NodeBasedCellPopulation< DIM >::mDeleteMesh
private

Whether to delete the nodes-only mesh (taken in one of the constructors, defaults to false).

Definition at line 75 of file NodeBasedCellPopulation.hpp.

Referenced by NodeBasedCellPopulation< DIM >::~NodeBasedCellPopulation().

◆ mHaloCellLocationMap

template<unsigned DIM>
std::map<CellPtr, unsigned> NodeBasedCellPopulation< DIM >::mHaloCellLocationMap
private

Map halo cells back to location indices

Definition at line 108 of file NodeBasedCellPopulation.hpp.

Referenced by NodeBasedCellPopulation< DIM >::AddHaloCell(), and NodeBasedCellPopulation< DIM >::RefreshHaloCells().

◆ mHaloCells

template<unsigned DIM>
std::vector<CellPtr> NodeBasedCellPopulation< DIM >::mHaloCells
private

◆ mLeftCommunicator

template<unsigned DIM>
ObjectCommunicator<std::vector<std::pair<CellPtr, Node<DIM>* > > > NodeBasedCellPopulation< DIM >::mLeftCommunicator
private

◆ mLoadBalanceFrequency

template<unsigned DIM>
unsigned NodeBasedCellPopulation< DIM >::mLoadBalanceFrequency
private

The frequency at which the mesh is rebalanced

Definition at line 114 of file NodeBasedCellPopulation.hpp.

Referenced by NodeBasedCellPopulation< DIM >::SetLoadBalanceFrequency(), and NodeBasedCellPopulation< DIM >::Update().

◆ mLoadBalanceMesh

template<unsigned DIM>
bool NodeBasedCellPopulation< DIM >::mLoadBalanceMesh
private

Whether to load balance the underlying mesh dynamically

Definition at line 111 of file NodeBasedCellPopulation.hpp.

Referenced by NodeBasedCellPopulation< DIM >::SetLoadBalanceMesh(), and NodeBasedCellPopulation< DIM >::Update().

◆ mLocationHaloCellMap

template<unsigned DIM>
std::map<unsigned, CellPtr> NodeBasedCellPopulation< DIM >::mLocationHaloCellMap
private

Map location indices back to halo cells

Definition at line 105 of file NodeBasedCellPopulation.hpp.

Referenced by NodeBasedCellPopulation< DIM >::AddHaloCell(), and NodeBasedCellPopulation< DIM >::RefreshHaloCells().

◆ mMaxSpatialPositions

template<unsigned DIM>
c_vector<double, DIM> NodeBasedCellPopulation< DIM >::mMaxSpatialPositions
private

Vector of maximal spatial positions in each dimension.

Definition at line 69 of file NodeBasedCellPopulation.hpp.

◆ mMinSpatialPositions

template<unsigned DIM>
c_vector<double, DIM> NodeBasedCellPopulation< DIM >::mMinSpatialPositions
private

Vector of minimal spatial positions in each dimension.

Definition at line 66 of file NodeBasedCellPopulation.hpp.

◆ mNodePairs

template<unsigned DIM>
std::vector< std::pair<Node<DIM>*, Node<DIM>* > > NodeBasedCellPopulation< DIM >::mNodePairs
private

◆ mpCellsRecvLeft

template<unsigned DIM>
boost::shared_ptr<std::vector<std::pair<CellPtr, Node<DIM>* > > > NodeBasedCellPopulation< DIM >::mpCellsRecvLeft
private

◆ mpCellsRecvRight

template<unsigned DIM>
boost::shared_ptr<std::vector<std::pair<CellPtr, Node<DIM>* > > > NodeBasedCellPopulation< DIM >::mpCellsRecvRight
private

◆ mpNodesOnlyMesh

◆ mRightCommunicator

template<unsigned DIM>
ObjectCommunicator<std::vector<std::pair<CellPtr, Node<DIM>* > > > NodeBasedCellPopulation< DIM >::mRightCommunicator
private

◆ mUseVariableRadii


The documentation for this class was generated from the following files: