#include <NodeBasedCellPopulation.hpp>
Inherits AbstractCentreBasedCellPopulation< DIM >.
Inherited by NodeBasedCellPopulationWithBuskeUpdate< DIM >.
Public Member Functions | |
NodeBasedCellPopulation (NodesOnlyMesh< DIM > &rMesh, std::vector< CellPtr > &rCells, const std::vector< unsigned > locationIndices=std::vector< unsigned >(), bool deleteMesh=false) | |
NodeBasedCellPopulation (NodesOnlyMesh< DIM > &rMesh) | |
~NodeBasedCellPopulation () | |
NodesOnlyMesh< DIM > & | rGetMesh () |
const NodesOnlyMesh< DIM > & | rGetMesh () const |
unsigned | GetNumNodes () |
Node< DIM > * | GetNode (unsigned index) |
unsigned | RemoveDeadCells () |
void | Clear () |
void | Update (bool hasHadBirthsOrDeaths=true) |
BoxCollection< DIM > * | GetBoxCollection () |
std::set< std::pair< Node< DIM > *, Node< DIM > * > > & | rGetNodePairs () |
void | OutputCellPopulationParameters (out_stream &rParamsFile) |
double | GetMechanicsCutOffLength () |
void | SetMechanicsCutOffLength (double mechanicsCutOffLength) |
double | GetWidth (const unsigned &rDimension) |
std::set< unsigned > | GetNeighbouringNodeIndices (unsigned index) |
virtual CellPtr | AddCell (CellPtr pNewCell, const c_vector< double, DIM > &rCellDivisionVector, CellPtr pParentCell=CellPtr()) |
Protected Member Functions | |
void | SetNode (unsigned nodeIndex, ChastePoint< DIM > &rNewLocation) |
Protected Attributes | |
NodesOnlyMesh< DIM > & | mrMesh |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &archive, const unsigned int version) |
unsigned | AddNode (Node< DIM > *pNewNode) |
void | Validate () |
void | SplitUpIntoBoxes (double cutOffLength, c_vector< double, 2 *DIM > domainSize) |
void | FindMaxAndMin () |
void | WriteCellVolumeResultsToFile () |
void | WriteVtkResultsToFile () |
Private Attributes | |
BoxCollection< DIM > * | mpBoxCollection |
c_vector< double, DIM > | mMinSpatialPositions |
c_vector< double, DIM > | mMaxSpatialPositions |
std::set< std::pair< Node< DIM > *, Node< DIM > * > > | mNodePairs |
bool | mDeleteMesh |
double | mMechanicsCutOffLength |
Friends | |
class | TestNodeBasedCellPopulation |
class | TestBoxCollection |
class | boost::serialization::access |
A NodeBasedCellPopulation is a CellPopulation consisting of only nodes in space with associated cells. There are no elements and no mesh.
Definition at line 44 of file NodeBasedCellPopulation.hpp.
NodeBasedCellPopulation< DIM >::NodeBasedCellPopulation | ( | NodesOnlyMesh< DIM > & | rMesh, | |
std::vector< CellPtr > & | rCells, | |||
const std::vector< unsigned > | locationIndices = std::vector<unsigned>() , |
|||
bool | deleteMesh = false | |||
) | [inline] |
Default constructor.
Note that the cell population will take responsibility for freeing the memory used by the nodes.
rMesh | a mutable nodes-only mesh | |
rCells | a vector of cells | |
locationIndices | an optional vector of location indices that correspond to real cells | |
deleteMesh | whether to delete nodes-only mesh in destructor |
Definition at line 34 of file NodeBasedCellPopulation.cpp.
References NodeBasedCellPopulation< DIM >::Validate().
NodeBasedCellPopulation< DIM >::NodeBasedCellPopulation | ( | NodesOnlyMesh< DIM > & | rMesh | ) | [inline] |
Constructor for use by the de-serializer.
rMesh | a mutable nodes-only mesh |
Definition at line 48 of file NodeBasedCellPopulation.cpp.
NodeBasedCellPopulation< DIM >::~NodeBasedCellPopulation | ( | ) | [inline] |
Destructor.
Frees all our node memory.
Definition at line 59 of file NodeBasedCellPopulation.cpp.
References NodeBasedCellPopulation< DIM >::Clear(), NodeBasedCellPopulation< DIM >::mDeleteMesh, and NodeBasedCellPopulation< DIM >::mrMesh.
CellPtr NodeBasedCellPopulation< DIM >::AddCell | ( | CellPtr | pNewCell, | |
const c_vector< double, DIM > & | rCellDivisionVector, | |||
CellPtr | pParentCell = CellPtr() | |||
) | [inline, virtual] |
Overridden AddCell() method.
Add a new cell to the cell population and update the vector of cell radii in the NodesOnlyMesh.
pNewCell | the cell to add | |
rCellDivisionVector | the position in space at which to put it | |
pParentCell | pointer to a parent cell - this is required for mesh-based cell populations |
Reimplemented from AbstractCentreBasedCellPopulation< DIM >.
Definition at line 553 of file NodeBasedCellPopulation.cpp.
References AbstractCellPopulation< DIM >::GetLocationIndexUsingCell(), NodeBasedCellPopulation< DIM >::mrMesh, and NodesOnlyMesh< SPACE_DIM >::SetCellRadius().
unsigned NodeBasedCellPopulation< DIM >::AddNode | ( | Node< DIM > * | pNewNode | ) | [inline, private, virtual] |
Overridden AddNode() method.
Add a new node to the cell population.
pNewNode | pointer to the new node |
Implements AbstractOffLatticeCellPopulation< DIM >.
Definition at line 276 of file NodeBasedCellPopulation.cpp.
References NodesOnlyMesh< SPACE_DIM >::AddNode(), and NodeBasedCellPopulation< DIM >::mrMesh.
void NodeBasedCellPopulation< DIM >::Clear | ( | ) | [inline] |
Reset the member variables mNodePairs and mpBoxCollection.
Definition at line 81 of file NodeBasedCellPopulation.cpp.
References NodeBasedCellPopulation< DIM >::mNodePairs, and NodeBasedCellPopulation< DIM >::mpBoxCollection.
Referenced by NodeBasedCellPopulation< DIM >::~NodeBasedCellPopulation().
void NodeBasedCellPopulation< DIM >::FindMaxAndMin | ( | ) | [inline, private] |
Loops over nodes and sets mMinSpatialPositions and mMaxSpatialPositions
Definition at line 126 of file NodeBasedCellPopulation.cpp.
References NodeBasedCellPopulation< DIM >::GetNode(), MutableMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), NodeBasedCellPopulation< DIM >::mMaxSpatialPositions, NodeBasedCellPopulation< DIM >::mMinSpatialPositions, and NodeBasedCellPopulation< DIM >::mrMesh.
Referenced by NodeBasedCellPopulation< DIM >::GetWidth(), and NodeBasedCellPopulation< DIM >::Update().
BoxCollection< DIM > * NodeBasedCellPopulation< DIM >::GetBoxCollection | ( | ) | [inline] |
Definition at line 288 of file NodeBasedCellPopulation.cpp.
References NodeBasedCellPopulation< DIM >::mpBoxCollection.
double NodeBasedCellPopulation< DIM >::GetMechanicsCutOffLength | ( | ) | [inline] |
Definition at line 320 of file NodeBasedCellPopulation.cpp.
References NodeBasedCellPopulation< DIM >::mMechanicsCutOffLength.
std::set< unsigned > NodeBasedCellPopulation< DIM >::GetNeighbouringNodeIndices | ( | unsigned | index | ) | [inline, virtual] |
Overridden GetNeighbouringNodeIndices() method.
index | the node index |
Implements AbstractCellPopulation< DIM >.
Definition at line 338 of file NodeBasedCellPopulation.cpp.
References AbstractCellPopulation< DIM >::Begin(), AbstractCellPopulation< DIM >::End(), NodesOnlyMesh< SPACE_DIM >::GetCellRadius(), AbstractCellPopulation< DIM >::GetLocationIndexUsingCell(), NodeBasedCellPopulation< DIM >::GetNode(), and NodeBasedCellPopulation< DIM >::mrMesh.
Referenced by BuskeCompressionForce< DIM >::AddForceContribution(), and NodeBasedCellPopulationWithBuskeUpdate< DIM >::UpdateNodeLocations().
Node< DIM > * NodeBasedCellPopulation< DIM >::GetNode | ( | unsigned | index | ) | [inline, virtual] |
Overridden GetNode() method.
index | global index of the specified node |
Implements AbstractCellPopulation< DIM >.
Definition at line 164 of file NodeBasedCellPopulation.cpp.
References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNode(), and NodeBasedCellPopulation< DIM >::mrMesh.
Referenced by NodeBasedCellPopulation< DIM >::FindMaxAndMin(), NodeBasedCellPopulation< DIM >::GetNeighbouringNodeIndices(), NodeBasedCellPopulation< DIM >::SplitUpIntoBoxes(), NodeBasedCellPopulationWithBuskeUpdate< DIM >::UpdateNodeLocations(), and NodeBasedCellPopulation< DIM >::WriteCellVolumeResultsToFile().
unsigned NodeBasedCellPopulation< DIM >::GetNumNodes | ( | ) | [inline, virtual] |
Implements AbstractCellPopulation< DIM >.
Definition at line 282 of file NodeBasedCellPopulation.cpp.
References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumAllNodes(), and NodeBasedCellPopulation< DIM >::mrMesh.
Referenced by NodeBasedCellPopulation< DIM >::Validate(), and NodeBasedCellPopulation< DIM >::WriteVtkResultsToFile().
double NodeBasedCellPopulation< DIM >::GetWidth | ( | const unsigned & | rDimension | ) | [inline, 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.
rDimension | a dimension (0,1 or 2) |
Implements AbstractCellPopulation< DIM >.
Definition at line 326 of file NodeBasedCellPopulation.cpp.
References NodeBasedCellPopulation< DIM >::FindMaxAndMin(), NodeBasedCellPopulation< DIM >::mMaxSpatialPositions, and NodeBasedCellPopulation< DIM >::mMinSpatialPositions.
void NodeBasedCellPopulation< DIM >::OutputCellPopulationParameters | ( | out_stream & | rParamsFile | ) | [inline, virtual] |
Outputs CellPopulation parameters to file
As this method is pure virtual, it must be overridden in subclasses.
rParamsFile | the file stream to which the parameters are output |
Reimplemented from AbstractCentreBasedCellPopulation< DIM >.
Reimplemented in NodeBasedCellPopulationWithBuskeUpdate< DIM >.
Definition at line 304 of file NodeBasedCellPopulation.cpp.
References NodeBasedCellPopulation< DIM >::mMechanicsCutOffLength.
unsigned NodeBasedCellPopulation< DIM >::RemoveDeadCells | ( | ) | [inline, 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.
Implements AbstractCellPopulation< DIM >.
Definition at line 248 of file NodeBasedCellPopulation.cpp.
References MutableMesh< ELEMENT_DIM, SPACE_DIM >::DeleteNodePriorToReMesh(), AbstractCellPopulation< DIM >::mCellLocationMap, AbstractCellPopulation< DIM >::mCells, AbstractCellPopulation< DIM >::mLocationCellMap, and NodeBasedCellPopulation< DIM >::mrMesh.
const NodesOnlyMesh< DIM > & NodeBasedCellPopulation< DIM >::rGetMesh | ( | ) | const [inline] |
Definition at line 75 of file NodeBasedCellPopulation.cpp.
References NodeBasedCellPopulation< DIM >::mrMesh.
NodesOnlyMesh< DIM > & NodeBasedCellPopulation< DIM >::rGetMesh | ( | ) | [inline] |
Definition at line 69 of file NodeBasedCellPopulation.cpp.
References NodeBasedCellPopulation< DIM >::mrMesh.
Referenced by NodeBasedCellPopulationWithBuskeUpdate< DIM >::UpdateNodeLocations().
std::set< std::pair< Node< DIM > *, Node< DIM > * > > & NodeBasedCellPopulation< DIM >::rGetNodePairs | ( | ) | [inline] |
Definition at line 294 of file NodeBasedCellPopulation.cpp.
References EXCEPTION, and NodeBasedCellPopulation< DIM >::mNodePairs.
void NodeBasedCellPopulation< DIM >::serialize | ( | Archive & | archive, | |
const unsigned int | version | |||
) | [inline, private] |
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.
archive | the archive | |
version | the current version of this class |
Reimplemented from AbstractCentreBasedCellPopulation< DIM >.
Reimplemented in NodeBasedCellPopulationWithBuskeUpdate< DIM >.
Definition at line 89 of file NodeBasedCellPopulation.hpp.
References NodeBasedCellPopulation< DIM >::mMechanicsCutOffLength, and NodeBasedCellPopulation< DIM >::Validate().
void NodeBasedCellPopulation< DIM >::SetMechanicsCutOffLength | ( | double | mechanicsCutOffLength | ) | [inline] |
Set mMechanicsCutOffLength.
mechanicsCutOffLength | the new value of mMechanicsCutOffLength |
Definition at line 313 of file NodeBasedCellPopulation.cpp.
References NodeBasedCellPopulation< DIM >::mMechanicsCutOffLength.
void NodeBasedCellPopulation< DIM >::SetNode | ( | unsigned | nodeIndex, | |
ChastePoint< DIM > & | rNewLocation | |||
) | [inline, protected, virtual] |
Move the node with a given index to a new point in space.
nodeIndex | the index of the node to be moved | |
rNewLocation | the new target location of the node |
Implements AbstractOffLatticeCellPopulation< DIM >.
Definition at line 170 of file NodeBasedCellPopulation.cpp.
References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNode(), and NodeBasedCellPopulation< DIM >::mrMesh.
Referenced by NodeBasedCellPopulationWithBuskeUpdate< DIM >::UpdateNodeLocations().
void NodeBasedCellPopulation< DIM >::SplitUpIntoBoxes | ( | double | cutOffLength, | |
c_vector< double, 2 *DIM > | domainSize | |||
) | [inline, private] |
Method for Initially Splitting up cell population into neighbouring boxes, to decrease runtime.
cutOffLength | length of spring cut off between nodes | |
domainSize | c_vector of size 2*dimension reads minX, maxX, minY, maxY, etc |
Definition at line 113 of file NodeBasedCellPopulation.cpp.
References NodeBasedCellPopulation< DIM >::GetNode(), MutableMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), NodeBasedCellPopulation< DIM >::mpBoxCollection, and NodeBasedCellPopulation< DIM >::mrMesh.
Referenced by NodeBasedCellPopulation< DIM >::Update().
void NodeBasedCellPopulation< DIM >::Update | ( | bool | hasHadBirthsOrDeaths = true |
) | [inline, virtual] |
Remove nodes that have been marked as deleted and update the node cell map.
hasHadBirthsOrDeaths | whether cell population has had Births Or Deaths |
Implements AbstractCellPopulation< DIM >.
Definition at line 176 of file NodeBasedCellPopulation.cpp.
References EXCEPTION, NodeBasedCellPopulation< DIM >::FindMaxAndMin(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumAllNodes(), MutableMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), AbstractCellPopulation< DIM >::mCellLocationMap, AbstractCellPopulation< DIM >::mCells, AbstractCellPopulation< DIM >::mLocationCellMap, NodeBasedCellPopulation< DIM >::mMaxSpatialPositions, NodeBasedCellPopulation< DIM >::mMechanicsCutOffLength, NodeBasedCellPopulation< DIM >::mMinSpatialPositions, NodeBasedCellPopulation< DIM >::mNodePairs, NodeBasedCellPopulation< DIM >::mpBoxCollection, NodeBasedCellPopulation< DIM >::mrMesh, NodesOnlyMesh< SPACE_DIM >::ReMesh(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::SetMeshHasChangedSinceLoading(), NodeBasedCellPopulation< DIM >::SplitUpIntoBoxes(), and NodeBasedCellPopulation< DIM >::Validate().
void NodeBasedCellPopulation< DIM >::Validate | ( | ) | [inline, private, virtual] |
Check consistency of our internal data structures.
Implements AbstractCellPopulation< DIM >.
Definition at line 89 of file NodeBasedCellPopulation.cpp.
References AbstractCellPopulation< DIM >::Begin(), AbstractCellPopulation< DIM >::End(), EXCEPTION, NodeBasedCellPopulation< DIM >::GetNumNodes(), and AbstractCellPopulation< DIM >::mCellLocationMap.
Referenced by NodeBasedCellPopulation< DIM >::NodeBasedCellPopulation(), NodeBasedCellPopulation< DIM >::serialize(), and NodeBasedCellPopulation< DIM >::Update().
void NodeBasedCellPopulation< DIM >::WriteCellVolumeResultsToFile | ( | ) | [inline, private, virtual] |
Overridden WriteCellVolumeResultsToFile() method.
Implements AbstractCellPopulation< DIM >.
Definition at line 383 of file NodeBasedCellPopulation.cpp.
References AbstractCellPopulation< DIM >::Begin(), AbstractCellPopulation< DIM >::End(), NodesOnlyMesh< SPACE_DIM >::GetCellRadius(), AbstractCellPopulation< DIM >::GetLocationIndexUsingCell(), NodeBasedCellPopulation< DIM >::GetNode(), SimulationTime::GetTime(), SimulationTime::Instance(), AbstractCellPopulation< DIM >::mpCellVolumesFile, and NodeBasedCellPopulation< DIM >::mrMesh.
void NodeBasedCellPopulation< DIM >::WriteVtkResultsToFile | ( | ) | [inline, private, virtual] |
Overridden WriteVtkResultsToFile() method.
Implements AbstractCentreBasedCellPopulation< DIM >.
Definition at line 431 of file NodeBasedCellPopulation.cpp.
References AbstractCellPopulation< DIM >::Begin(), AbstractCellPopulation< DIM >::End(), NodesOnlyMesh< SPACE_DIM >::GetCellRadius(), AbstractCellPopulation< DIM >::GetLocationIndexUsingCell(), NodeBasedCellPopulation< DIM >::GetNumNodes(), CellwiseData< DIM >::GetNumVariables(), SimulationTime::GetTimeStepsElapsed(), CellwiseData< DIM >::GetValue(), SimulationTime::Instance(), AbstractCellPopulation< DIM >::mDirPath, AbstractCellPopulation< DIM >::mOutputCellAges, AbstractCellPopulation< DIM >::mOutputCellAncestors, AbstractCellPopulation< DIM >::mOutputCellCyclePhases, AbstractCellPopulation< DIM >::mOutputCellMutationStates, AbstractCellPopulation< DIM >::mOutputCellProliferativeTypes, AbstractCellPopulation< DIM >::mOutputCellVolumes, AbstractCellPopulation< DIM >::mpVtkMetaFile, NodeBasedCellPopulation< DIM >::mrMesh, and UNSIGNED_UNSET.
friend class boost::serialization::access [friend] |
Needed for serialization.
Reimplemented from AbstractCentreBasedCellPopulation< DIM >.
Reimplemented in NodeBasedCellPopulationWithBuskeUpdate< DIM >.
Definition at line 78 of file NodeBasedCellPopulation.hpp.
bool NodeBasedCellPopulation< DIM >::mDeleteMesh [private] |
Whether to delete the nodes-only mesh (taken in one of the constructors, defaults to false).
Definition at line 69 of file NodeBasedCellPopulation.hpp.
Referenced by NodeBasedCellPopulation< DIM >::~NodeBasedCellPopulation().
c_vector<double, DIM> NodeBasedCellPopulation< DIM >::mMaxSpatialPositions [private] |
Vector of maximal spatial positions in each dimension.
Definition at line 63 of file NodeBasedCellPopulation.hpp.
Referenced by NodeBasedCellPopulation< DIM >::FindMaxAndMin(), NodeBasedCellPopulation< DIM >::GetWidth(), and NodeBasedCellPopulation< DIM >::Update().
double NodeBasedCellPopulation< DIM >::mMechanicsCutOffLength [private] |
Mechanics cut off length. Used in order to calculate the BoxCollection.
Definition at line 75 of file NodeBasedCellPopulation.hpp.
Referenced by NodeBasedCellPopulation< DIM >::GetMechanicsCutOffLength(), NodeBasedCellPopulation< DIM >::OutputCellPopulationParameters(), NodeBasedCellPopulation< DIM >::serialize(), NodeBasedCellPopulation< DIM >::SetMechanicsCutOffLength(), and NodeBasedCellPopulation< DIM >::Update().
c_vector<double, DIM> NodeBasedCellPopulation< DIM >::mMinSpatialPositions [private] |
Vector of minimal spatial positions in each dimension.
Definition at line 60 of file NodeBasedCellPopulation.hpp.
Referenced by NodeBasedCellPopulation< DIM >::FindMaxAndMin(), NodeBasedCellPopulation< DIM >::GetWidth(), and NodeBasedCellPopulation< DIM >::Update().
std::set< std::pair<Node<DIM>*, Node<DIM>* > > NodeBasedCellPopulation< DIM >::mNodePairs [private] |
Node pairs for force calculations.
Definition at line 66 of file NodeBasedCellPopulation.hpp.
Referenced by NodeBasedCellPopulation< DIM >::Clear(), NodeBasedCellPopulation< DIM >::rGetNodePairs(), and NodeBasedCellPopulation< DIM >::Update().
BoxCollection<DIM>* NodeBasedCellPopulation< DIM >::mpBoxCollection [private] |
Pointer to a Node box collection.
Definition at line 57 of file NodeBasedCellPopulation.hpp.
Referenced by NodeBasedCellPopulation< DIM >::Clear(), NodeBasedCellPopulation< DIM >::GetBoxCollection(), NodeBasedCellPopulation< DIM >::SplitUpIntoBoxes(), and NodeBasedCellPopulation< DIM >::Update().
NodesOnlyMesh<DIM>& NodeBasedCellPopulation< DIM >::mrMesh [protected] |
Reference to the mesh.
Definition at line 52 of file NodeBasedCellPopulation.hpp.
Referenced by NodeBasedCellPopulation< DIM >::AddCell(), NodeBasedCellPopulation< DIM >::AddNode(), NodeBasedCellPopulation< DIM >::FindMaxAndMin(), NodeBasedCellPopulation< DIM >::GetNeighbouringNodeIndices(), NodeBasedCellPopulation< DIM >::GetNode(), NodeBasedCellPopulation< DIM >::GetNumNodes(), NodeBasedCellPopulation< DIM >::RemoveDeadCells(), NodeBasedCellPopulation< DIM >::rGetMesh(), NodeBasedCellPopulation< DIM >::SetNode(), NodeBasedCellPopulation< DIM >::SplitUpIntoBoxes(), NodeBasedCellPopulation< DIM >::Update(), NodeBasedCellPopulation< DIM >::WriteCellVolumeResultsToFile(), NodeBasedCellPopulation< DIM >::WriteVtkResultsToFile(), and NodeBasedCellPopulation< DIM >::~NodeBasedCellPopulation().