#include <NodeBasedCellPopulation.hpp>
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) |
std::vector< Node< DIM > * > & | rGetNodes () |
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) |
void | SetOutputCellVolumes (bool outputCellVolumes) |
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 | SetNode (unsigned nodeIndex, ChastePoint< DIM > &rNewLocation) |
void | Validate () |
void | SplitUpIntoBoxes (double cutOffLength, c_vector< double, 2 *DIM > domainSize) |
void | FindMaxAndMin () |
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 |
Definition at line 47 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 33 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 47 of file NodeBasedCellPopulation.cpp.
NodeBasedCellPopulation< DIM >::~NodeBasedCellPopulation | ( | ) | [inline] |
Destructor.
Frees all our node memory.
Definition at line 58 of file NodeBasedCellPopulation.cpp.
References NodeBasedCellPopulation< DIM >::Clear(), NodeBasedCellPopulation< DIM >::mDeleteMesh, and NodeBasedCellPopulation< DIM >::mrMesh.
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 >.
Definition at line 92 of file NodeBasedCellPopulation.hpp.
References NodeBasedCellPopulation< DIM >::mMechanicsCutOffLength, and NodeBasedCellPopulation< DIM >::Validate().
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 AbstractCellPopulation< DIM >.
Definition at line 275 of file NodeBasedCellPopulation.cpp.
References MutableMesh< ELEMENT_DIM, SPACE_DIM >::AddNode(), and NodeBasedCellPopulation< DIM >::mrMesh.
void NodeBasedCellPopulation< DIM >::SetNode | ( | unsigned | nodeIndex, | |
ChastePoint< DIM > & | rNewLocation | |||
) | [inline, private, 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 AbstractCellPopulation< DIM >.
Definition at line 171 of file NodeBasedCellPopulation.cpp.
References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNode(), and NodeBasedCellPopulation< DIM >::mrMesh.
void NodeBasedCellPopulation< DIM >::Validate | ( | ) | [inline, private, virtual] |
Check consistency of our internal data structures.
Implements AbstractCellPopulation< DIM >.
Definition at line 88 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 >::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 114 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 >::FindMaxAndMin | ( | ) | [inline, private] |
Loops over nodes and sets mMinSpatialPositions and mMaxSpatialPositions
Definition at line 127 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().
void NodeBasedCellPopulation< DIM >::WriteVtkResultsToFile | ( | ) | [inline, private, virtual] |
Overridden WriteVtkResultsToFile() method.
Implements AbstractCentreBasedCellPopulation< DIM >.
Definition at line 339 of file NodeBasedCellPopulation.cpp.
References AbstractCellPopulation< DIM >::Begin(), AbstractCellPopulation< DIM >::End(), AbstractCellPopulation< DIM >::GetLocationIndexUsingCell(), NodeBasedCellPopulation< DIM >::GetNumNodes(), CellwiseData< DIM >::GetNumVariables(), SimulationTime::GetTimeStepsElapsed(), CellwiseData< DIM >::GetValue(), CellwiseData< DIM >::Instance(), SimulationTime::Instance(), AbstractCellPopulation< DIM >::mDirPath, AbstractCellPopulation< DIM >::mOutputCellAges, AbstractCellPopulation< DIM >::mOutputCellAncestors, AbstractCellPopulation< DIM >::mOutputCellCyclePhases, AbstractCellPopulation< DIM >::mOutputCellMutationStates, AbstractCellPopulation< DIM >::mOutputCellProliferativeTypes, AbstractCellPopulation< DIM >::mpVtkMetaFile, NodeBasedCellPopulation< DIM >::mrMesh, and UNSIGNED_UNSET.
NodesOnlyMesh< DIM > & NodeBasedCellPopulation< DIM >::rGetMesh | ( | ) | [inline] |
Definition at line 68 of file NodeBasedCellPopulation.cpp.
References NodeBasedCellPopulation< DIM >::mrMesh.
const NodesOnlyMesh< DIM > & NodeBasedCellPopulation< DIM >::rGetMesh | ( | ) | const [inline] |
Definition at line 74 of file NodeBasedCellPopulation.cpp.
References NodeBasedCellPopulation< DIM >::mrMesh.
unsigned NodeBasedCellPopulation< DIM >::GetNumNodes | ( | ) | [inline, virtual] |
Implements AbstractCellPopulation< DIM >.
Definition at line 281 of file NodeBasedCellPopulation.cpp.
References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumAllNodes(), and NodeBasedCellPopulation< DIM >::mrMesh.
Referenced by NodeBasedCellPopulation< DIM >::Validate(), and NodeBasedCellPopulation< DIM >::WriteVtkResultsToFile().
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 165 of file NodeBasedCellPopulation.cpp.
References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNode(), and NodeBasedCellPopulation< DIM >::mrMesh.
Referenced by NodeBasedCellPopulation< DIM >::FindMaxAndMin(), and NodeBasedCellPopulation< DIM >::SplitUpIntoBoxes().
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 247 of file NodeBasedCellPopulation.cpp.
References MutableMesh< ELEMENT_DIM, SPACE_DIM >::DeleteNodePriorToReMesh(), AbstractCellPopulation< DIM >::mCellLocationMap, AbstractCellPopulation< DIM >::mCells, AbstractCellPopulation< DIM >::mLocationCellMap, and NodeBasedCellPopulation< DIM >::mrMesh.
void NodeBasedCellPopulation< DIM >::Clear | ( | ) | [inline] |
Reset the member variables mNodePairs and mpBoxCollection.
Definition at line 80 of file NodeBasedCellPopulation.cpp.
References NodeBasedCellPopulation< DIM >::mNodePairs, and NodeBasedCellPopulation< DIM >::mpBoxCollection.
Referenced by NodeBasedCellPopulation< DIM >::~NodeBasedCellPopulation().
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 177 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().
std::vector<Node<DIM>*>& NodeBasedCellPopulation< DIM >::rGetNodes | ( | ) |
Method for getting all nodes in the cell population.
BoxCollection< DIM > * NodeBasedCellPopulation< DIM >::GetBoxCollection | ( | ) | [inline] |
Definition at line 287 of file NodeBasedCellPopulation.cpp.
References NodeBasedCellPopulation< DIM >::mpBoxCollection.
std::set< std::pair< Node< DIM > *, Node< DIM > * > > & NodeBasedCellPopulation< DIM >::rGetNodePairs | ( | ) | [inline] |
Definition at line 293 of file NodeBasedCellPopulation.cpp.
References EXCEPTION, and NodeBasedCellPopulation< DIM >::mNodePairs.
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 >.
Definition at line 303 of file NodeBasedCellPopulation.cpp.
References NodeBasedCellPopulation< DIM >::mMechanicsCutOffLength, and AbstractCentreBasedCellPopulation< DIM >::OutputCellPopulationParameters().
double NodeBasedCellPopulation< DIM >::GetMechanicsCutOffLength | ( | ) | [inline] |
Definition at line 321 of file NodeBasedCellPopulation.cpp.
References NodeBasedCellPopulation< DIM >::mMechanicsCutOffLength.
void NodeBasedCellPopulation< DIM >::SetMechanicsCutOffLength | ( | double | mechanicsCutOffLength | ) | [inline] |
Set mMechanicsCutOffLength.
mechanicsCutOffLength | the new value of mMechanicsCutOffLength |
Definition at line 314 of file NodeBasedCellPopulation.cpp.
References NodeBasedCellPopulation< DIM >::mMechanicsCutOffLength.
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 327 of file NodeBasedCellPopulation.cpp.
References NodeBasedCellPopulation< DIM >::FindMaxAndMin(), NodeBasedCellPopulation< DIM >::mMaxSpatialPositions, and NodeBasedCellPopulation< DIM >::mMinSpatialPositions.
void NodeBasedCellPopulation< DIM >::SetOutputCellVolumes | ( | bool | outputCellVolumes | ) | [inline, virtual] |
Overridden SetOutputCellVolumes() method.
Currently there is no facility for computing the volume associated with each cell in a NodeBasedCellPopulation, so if this method is called with outputCellVolumes = true, an exception is thrown.
outputCellVolumes | the new value of mOutputCellVolumes |
Reimplemented from AbstractCellPopulation< DIM >.
Definition at line 451 of file NodeBasedCellPopulation.cpp.
References EXCEPTION.
friend class boost::serialization::access [friend] |
Needed for serialization.
Reimplemented from AbstractCentreBasedCellPopulation< DIM >.
Definition at line 81 of file NodeBasedCellPopulation.hpp.
NodesOnlyMesh<DIM>& NodeBasedCellPopulation< DIM >::mrMesh [protected] |
Reference to the mesh.
Definition at line 55 of file NodeBasedCellPopulation.hpp.
Referenced by NodeBasedCellPopulation< DIM >::AddNode(), NodeBasedCellPopulation< DIM >::FindMaxAndMin(), NodeBasedCellPopulation< DIM >::GetNode(), NodeBasedCellPopulation< DIM >::GetNumNodes(), NodeBasedCellPopulation< DIM >::RemoveDeadCells(), NodeBasedCellPopulation< DIM >::rGetMesh(), NodeBasedCellPopulation< DIM >::SetNode(), NodeBasedCellPopulation< DIM >::SplitUpIntoBoxes(), NodeBasedCellPopulation< DIM >::Update(), NodeBasedCellPopulation< DIM >::WriteVtkResultsToFile(), and NodeBasedCellPopulation< DIM >::~NodeBasedCellPopulation().
BoxCollection<DIM>* NodeBasedCellPopulation< DIM >::mpBoxCollection [private] |
Pointer to a Node box collection.
Definition at line 60 of file NodeBasedCellPopulation.hpp.
Referenced by NodeBasedCellPopulation< DIM >::Clear(), NodeBasedCellPopulation< DIM >::GetBoxCollection(), NodeBasedCellPopulation< DIM >::SplitUpIntoBoxes(), and NodeBasedCellPopulation< DIM >::Update().
c_vector<double, DIM> NodeBasedCellPopulation< DIM >::mMinSpatialPositions [private] |
Vector of minimal 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().
c_vector<double, DIM> NodeBasedCellPopulation< DIM >::mMaxSpatialPositions [private] |
Vector of maximal spatial positions in each dimension.
Definition at line 66 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 69 of file NodeBasedCellPopulation.hpp.
Referenced by NodeBasedCellPopulation< DIM >::Clear(), NodeBasedCellPopulation< DIM >::rGetNodePairs(), and NodeBasedCellPopulation< DIM >::Update().
bool NodeBasedCellPopulation< DIM >::mDeleteMesh [private] |
Whether to delete the nodes-only mesh (taken in one of the constructors, defaults to false).
Definition at line 72 of file NodeBasedCellPopulation.hpp.
Referenced by NodeBasedCellPopulation< DIM >::~NodeBasedCellPopulation().
double NodeBasedCellPopulation< DIM >::mMechanicsCutOffLength [private] |
Mechanics cut off length. Used in order to calculate the BoxCollection.
Definition at line 78 of file NodeBasedCellPopulation.hpp.
Referenced by NodeBasedCellPopulation< DIM >::GetMechanicsCutOffLength(), NodeBasedCellPopulation< DIM >::OutputCellPopulationParameters(), NodeBasedCellPopulation< DIM >::serialize(), NodeBasedCellPopulation< DIM >::SetMechanicsCutOffLength(), and NodeBasedCellPopulation< DIM >::Update().