Chaste Release::3.1
|
#include <NodeBasedCellPopulation.hpp>
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 |
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) |
bool | GetUseVariableRadii () |
void | SetUseVariableRadii (bool useVariableRadii=true) |
double | GetWidth (const unsigned &rDimension) |
std::set< unsigned > | GetNeighbouringNodeIndices (unsigned index) |
virtual CellPtr | AddCell (CellPtr pNewCell, const c_vector< double, DIM > &rCellDivisionVector, CellPtr pParentCell) |
double | GetVolumeOfCell (CellPtr pCell) |
Protected Member Functions | |
virtual void | UpdateParticlesAfterReMesh (NodeMap &rMap) |
virtual void | Validate () |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &archive, const unsigned int version) |
unsigned | AddNode (Node< DIM > *pNewNode) |
void | SplitUpIntoBoxes (double cutOffLength, c_vector< double, 2 *DIM > domainSize) |
void | FindMaxAndMin () |
void | WriteCellVolumeResultsToFile () |
void | WriteVtkResultsToFile () |
Private Attributes | |
NodesOnlyMesh< DIM > * | mpNodesOnlyMesh |
c_vector< double, DIM > | mMinSpatialPositions |
c_vector< double, DIM > | mMaxSpatialPositions |
std::set< std::pair< Node< DIM > *, Node< DIM > * > > | mNodePairs |
std::map< unsigned, std::set < unsigned > > | mNodeNeighbours |
bool | mDeleteMesh |
double | mMechanicsCutOffLength |
bool | mUseVariableRadii |
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 51 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 , |
||
bool | validate = true |
||
) |
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 |
validate | whether to call Validate() in the constructor or not |
Definition at line 40 of file NodeBasedCellPopulation.cpp.
References NodeBasedCellPopulation< DIM >::mpNodesOnlyMesh, AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::mrMesh, and NodeBasedCellPopulation< DIM >::Validate().
NodeBasedCellPopulation< DIM >::NodeBasedCellPopulation | ( | NodesOnlyMesh< DIM > & | rMesh | ) |
Constructor for use by the de-serializer.
rMesh | a mutable nodes-only mesh |
Definition at line 58 of file NodeBasedCellPopulation.cpp.
References NodeBasedCellPopulation< DIM >::mpNodesOnlyMesh, and AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::mrMesh.
NodeBasedCellPopulation< DIM >::~NodeBasedCellPopulation | ( | ) | [virtual] |
CellPtr NodeBasedCellPopulation< DIM >::AddCell | ( | CellPtr | pNewCell, |
const c_vector< double, DIM > & | rCellDivisionVector, | ||
CellPtr | pParentCell | ||
) | [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 node-based cell populations |
Reimplemented in NodeBasedCellPopulationWithParticles< DIM >.
Definition at line 664 of file NodeBasedCellPopulation.cpp.
References AbstractCentreBasedCellPopulation< ELEMENT_DIM, SPACE_DIM >::AddCell().
unsigned NodeBasedCellPopulation< DIM >::AddNode | ( | Node< DIM > * | pNewNode | ) | [private] |
Overridden AddNode() method.
Add a new node to the cell population.
pNewNode | pointer to the new node |
Definition at line 285 of file NodeBasedCellPopulation.cpp.
void NodeBasedCellPopulation< DIM >::Clear | ( | ) |
Reset the member variables mNodePairs and mpBoxCollection in the underlying mesh.
Definition at line 91 of file NodeBasedCellPopulation.cpp.
void NodeBasedCellPopulation< DIM >::FindMaxAndMin | ( | ) | [private] |
Loops over nodes and sets mMinSpatialPositions and mMaxSpatialPositions
Definition at line 127 of file NodeBasedCellPopulation.cpp.
BoxCollection< DIM > * NodeBasedCellPopulation< DIM >::GetBoxCollection | ( | ) |
Definition at line 302 of file NodeBasedCellPopulation.cpp.
double NodeBasedCellPopulation< DIM >::GetMechanicsCutOffLength | ( | ) |
Definition at line 336 of file NodeBasedCellPopulation.cpp.
std::set< unsigned > NodeBasedCellPopulation< DIM >::GetNeighbouringNodeIndices | ( | unsigned | index | ) | [virtual] |
Overridden GetNeighbouringNodeIndices() method.
Only returns nodes that are strictly touching each other.
index | the node index |
Implements AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.
Definition at line 366 of file NodeBasedCellPopulation.cpp.
References EXCEPTION.
Referenced by BuskeCompressionForce< DIM >::AddForceContribution().
Node< DIM > * NodeBasedCellPopulation< DIM >::GetNode | ( | unsigned | index | ) | [virtual] |
Overridden GetNode() method.
index | global index of the specified node |
Implements AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.
Definition at line 165 of file NodeBasedCellPopulation.cpp.
Referenced by NodeBasedCellPopulationWithParticles< DIM >::NodeBasedCellPopulationWithParticles().
unsigned NodeBasedCellPopulation< DIM >::GetNumNodes | ( | ) | [virtual] |
Implements AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.
Definition at line 291 of file NodeBasedCellPopulation.cpp.
Referenced by NodeBasedCellPopulationWithParticles< DIM >::NodeBasedCellPopulationWithParticles().
bool NodeBasedCellPopulation< DIM >::GetUseVariableRadii | ( | ) |
Definition at line 342 of file NodeBasedCellPopulation.cpp.
double NodeBasedCellPopulation< DIM >::GetVolumeOfCell | ( | CellPtr | pCell | ) | [virtual] |
Overridden GetVolumeOfCell() method.
pCell | boost shared pointer to a cell |
Implements AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.
Definition at line 430 of file NodeBasedCellPopulation.cpp.
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.
rDimension | a dimension (0,1 or 2) |
Implements AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.
Definition at line 354 of file NodeBasedCellPopulation.cpp.
void NodeBasedCellPopulation< DIM >::OutputCellPopulationParameters | ( | out_stream & | rParamsFile | ) | [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 >, and NodeBasedCellPopulationWithParticles< DIM >.
Definition at line 318 of file NodeBasedCellPopulation.cpp.
References AbstractCentreBasedCellPopulation< ELEMENT_DIM, SPACE_DIM >::OutputCellPopulationParameters().
Referenced by NodeBasedCellPopulationWithParticles< DIM >::OutputCellPopulationParameters(), and NodeBasedCellPopulationWithBuskeUpdate< DIM >::OutputCellPopulationParameters().
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.
Implements AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.
Definition at line 258 of file NodeBasedCellPopulation.cpp.
NodesOnlyMesh< DIM > & NodeBasedCellPopulation< DIM >::rGetMesh | ( | ) |
Reimplemented from AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.
Definition at line 79 of file NodeBasedCellPopulation.cpp.
const NodesOnlyMesh< DIM > & NodeBasedCellPopulation< DIM >::rGetMesh | ( | ) | const |
Definition at line 85 of file NodeBasedCellPopulation.cpp.
std::set< std::pair< Node< DIM > *, Node< DIM > * > > & NodeBasedCellPopulation< DIM >::rGetNodePairs | ( | ) | [virtual] |
Overridden rGetNodePairs method
Implements AbstractCentreBasedCellPopulation< DIM >.
Definition at line 308 of file NodeBasedCellPopulation.cpp.
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 >, and NodeBasedCellPopulationWithParticles< DIM >.
Definition at line 99 of file NodeBasedCellPopulation.hpp.
References NodeBasedCellPopulation< DIM >::mMechanicsCutOffLength, NodeBasedCellPopulation< DIM >::mUseVariableRadii, and NodeBasedCellPopulation< DIM >::Validate().
void NodeBasedCellPopulation< DIM >::SetMechanicsCutOffLength | ( | double | mechanicsCutOffLength | ) |
Set mMechanicsCutOffLength.
mechanicsCutOffLength | the new value of mMechanicsCutOffLength |
Definition at line 329 of file NodeBasedCellPopulation.cpp.
void NodeBasedCellPopulation< DIM >::SetNode | ( | unsigned | nodeIndex, |
ChastePoint< DIM > & | rNewLocation | ||
) |
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 |
Definition at line 171 of file NodeBasedCellPopulation.cpp.
void NodeBasedCellPopulation< DIM >::SetUseVariableRadii | ( | bool | useVariableRadii = true | ) |
Set mUseVariableRadii.
useVariableRadii | the new value of mUseVariableRadii |
Definition at line 348 of file NodeBasedCellPopulation.cpp.
void NodeBasedCellPopulation< DIM >::SplitUpIntoBoxes | ( | double | cutOffLength, |
c_vector< double, 2 *DIM > | domainSize | ||
) | [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 121 of file NodeBasedCellPopulation.cpp.
void NodeBasedCellPopulation< DIM >::Update | ( | bool | hasHadBirthsOrDeaths = true | ) | [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< ELEMENT_DIM, SPACE_DIM >.
Definition at line 177 of file NodeBasedCellPopulation.cpp.
References EXCEPTION.
void NodeBasedCellPopulation< DIM >::UpdateParticlesAfterReMesh | ( | NodeMap & | rMap | ) | [protected, virtual] |
Update mIsParticle if required by a remesh.
rMap | A map between node indices before and after remesh |
Reimplemented in NodeBasedCellPopulationWithParticles< DIM >.
Definition at line 297 of file NodeBasedCellPopulation.cpp.
void NodeBasedCellPopulation< DIM >::Validate | ( | ) | [protected, virtual] |
Check consistency of our internal data structures.
Implements AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.
Reimplemented in NodeBasedCellPopulationWithParticles< DIM >.
Definition at line 97 of file NodeBasedCellPopulation.cpp.
References EXCEPTION.
Referenced by NodeBasedCellPopulation< DIM >::NodeBasedCellPopulation(), and NodeBasedCellPopulation< DIM >::serialize().
void NodeBasedCellPopulation< DIM >::WriteCellVolumeResultsToFile | ( | ) | [private, virtual] |
Overridden WriteCellVolumeResultsToFile() method.
Implements AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.
Definition at line 500 of file NodeBasedCellPopulation.cpp.
References SimulationTime::GetTime(), and SimulationTime::Instance().
void NodeBasedCellPopulation< DIM >::WriteVtkResultsToFile | ( | ) | [private, virtual] |
Overridden WriteVtkResultsToFile() method.
Implements AbstractCentreBasedCellPopulation< DIM >.
Reimplemented in NodeBasedCellPopulationWithParticles< DIM >.
Definition at line 537 of file NodeBasedCellPopulation.cpp.
References CellPropertyCollection::GetProperties(), CellPropertyCollection::GetProperty(), CellPropertyCollection::GetSize(), SimulationTime::GetTimeStepsElapsed(), SimulationTime::Instance(), and UNSIGNED_UNSET.
friend class boost::serialization::access [friend] |
Needed for serialization.
Reimplemented from AbstractCentreBasedCellPopulation< DIM >.
Reimplemented in NodeBasedCellPopulationWithBuskeUpdate< DIM >, and NodeBasedCellPopulationWithParticles< DIM >.
Definition at line 88 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 74 of file NodeBasedCellPopulation.hpp.
c_vector<double, DIM> NodeBasedCellPopulation< DIM >::mMaxSpatialPositions [private] |
Vector of maximal spatial positions in each dimension.
Definition at line 65 of file NodeBasedCellPopulation.hpp.
double NodeBasedCellPopulation< DIM >::mMechanicsCutOffLength [private] |
Mechanics cut off length. Used in order to calculate the BoxCollection.
Definition at line 80 of file NodeBasedCellPopulation.hpp.
Referenced by NodeBasedCellPopulation< DIM >::serialize().
c_vector<double, DIM> NodeBasedCellPopulation< DIM >::mMinSpatialPositions [private] |
Vector of minimal spatial positions in each dimension.
Definition at line 62 of file NodeBasedCellPopulation.hpp.
std::map<unsigned, std::set<unsigned> > NodeBasedCellPopulation< DIM >::mNodeNeighbours [private] |
Indices of neighbours of local nodes.
Definition at line 71 of file NodeBasedCellPopulation.hpp.
std::set< std::pair<Node<DIM>*, Node<DIM>* > > NodeBasedCellPopulation< DIM >::mNodePairs [private] |
Node pairs for force calculations.
Definition at line 68 of file NodeBasedCellPopulation.hpp.
NodesOnlyMesh<DIM>* NodeBasedCellPopulation< DIM >::mpNodesOnlyMesh [private] |
Static cast of the mesh from AbstractCellPopulation.
Definition at line 59 of file NodeBasedCellPopulation.hpp.
Referenced by NodeBasedCellPopulation< DIM >::NodeBasedCellPopulation().
bool NodeBasedCellPopulation< DIM >::mUseVariableRadii [private] |
Whether or not to have cell radii updated from CellData defaults to false.
Definition at line 85 of file NodeBasedCellPopulation.hpp.
Referenced by NodeBasedCellPopulation< DIM >::serialize().