Chaste Release::3.1
|
#include <VertexBasedCellPopulation.hpp>
Public Member Functions | |
VertexBasedCellPopulation (MutableVertexMesh< DIM, DIM > &rMesh, std::vector< CellPtr > &rCells, bool deleteMesh=false, bool validate=true, const std::vector< unsigned > locationIndices=std::vector< unsigned >()) | |
VertexBasedCellPopulation (MutableVertexMesh< DIM, DIM > &rMesh) | |
virtual | ~VertexBasedCellPopulation () |
double | GetDampingConstant (unsigned nodeIndex) |
MutableVertexMesh< DIM, DIM > & | rGetMesh () |
const MutableVertexMesh< DIM, DIM > & | rGetMesh () const |
VertexElement< DIM, DIM > * | GetElement (unsigned elementIndex) |
unsigned | GetNumElements () |
unsigned | GetNumNodes () |
c_vector< double, DIM > | GetLocationOfCellCentre (CellPtr pCell) |
Node< DIM > * | GetNode (unsigned index) |
unsigned | AddNode (Node< DIM > *pNewNode) |
void | UpdateNodeLocations (const std::vector< c_vector< double, DIM > > &rNodeForces, double dt) |
void | SetNode (unsigned index, ChastePoint< DIM > &rNewLocation) |
VertexElement< DIM, DIM > * | GetElementCorrespondingToCell (CellPtr pCell) |
CellPtr | AddCell (CellPtr pNewCell, const c_vector< double, DIM > &rCellDivisionVector, CellPtr pParentCell=CellPtr()) |
unsigned | RemoveDeadCells () |
bool | IsCellAssociatedWithADeletedLocation (CellPtr pCell) |
void | Update (bool hasHadBirthsOrDeaths=true) |
void | CreateOutputFiles (const std::string &rDirectory, bool cleanOutputDirectory) |
void | CloseOutputFiles () |
void | WriteResultsToFiles () |
void | WriteCellVolumeResultsToFile () |
double | GetVolumeOfCell (CellPtr pCell) |
virtual void | GenerateCellResultsAndWriteToFiles () |
void | OutputCellPopulationParameters (out_stream &rParamsFile) |
double | GetWidth (const unsigned &rDimension) |
std::set< unsigned > | GetNeighbouringNodeIndices (unsigned index) |
Private Member Functions | |
void | WriteVtkResultsToFile () |
template<class Archive > | |
void | serialize (Archive &archive, const unsigned int version) |
void | Validate () |
Private Attributes | |
bool | mDeleteMesh |
MutableVertexMesh< DIM, DIM > * | mpMutableVertexMesh |
out_stream | mpVizElementsFile |
out_stream | mpT1SwapLocationsFile |
out_stream | mpT3SwapLocationsFile |
Friends | |
class | boost::serialization::access |
A facade class encapsulating a vertex-based cell population.
Contains a group of cells and maintains the associations between CellPtrs and elements in the MutableVertexMesh.
Definition at line 58 of file VertexBasedCellPopulation.hpp.
VertexBasedCellPopulation< DIM >::VertexBasedCellPopulation | ( | MutableVertexMesh< DIM, DIM > & | rMesh, |
std::vector< CellPtr > & | rCells, | ||
bool | deleteMesh = false , |
||
bool | validate = true , |
||
const std::vector< unsigned > | locationIndices = std::vector<unsigned>() |
||
) |
Create a new cell population facade from a mesh and collection of cells.
There must be precisely one CellPtr for each VertexElement in the mesh.
rMesh | reference to a |
rCells | reference to a vector of CellPtrs |
deleteMesh | set to true if you want the cell population to free the mesh memory on destruction |
validate | whether to validate the cell population when it is created (defaults to true) |
locationIndices | an optional vector of location indices that correspond to real cells |
Definition at line 41 of file VertexBasedCellPopulation.cpp.
References EXCEPTION, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNodeIteratorBegin(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNodeIteratorEnd(), VertexBasedCellPopulation< DIM >::mpMutableVertexMesh, AbstractCellPopulation< ELEMENT_DIM, ELEMENT_DIM >::mrMesh, and VertexBasedCellPopulation< DIM >::Validate().
VertexBasedCellPopulation< DIM >::VertexBasedCellPopulation | ( | MutableVertexMesh< DIM, DIM > & | rMesh | ) |
Constructor for use by the de-serializer.
rMesh | a vertex mesh. |
Definition at line 77 of file VertexBasedCellPopulation.cpp.
References VertexBasedCellPopulation< DIM >::mpMutableVertexMesh, and AbstractCellPopulation< ELEMENT_DIM, ELEMENT_DIM >::mrMesh.
VertexBasedCellPopulation< DIM >::~VertexBasedCellPopulation | ( | ) | [virtual] |
Destructor, which frees any memory allocated by the constructor.
Definition at line 85 of file VertexBasedCellPopulation.cpp.
CellPtr VertexBasedCellPopulation< DIM >::AddCell | ( | CellPtr | pNewCell, |
const c_vector< double, DIM > & | rCellDivisionVector, | ||
CellPtr | pParentCell = CellPtr() |
||
) |
Overridden AddCell() method.
Add a new cell to the cell population.
pNewCell | the cell to add |
rCellDivisionVector | if this vector has any non-zero component, then it is used as the axis along which the parent cell divides |
pParentCell | pointer to a parent cell (if required) |
Definition at line 184 of file VertexBasedCellPopulation.cpp.
unsigned VertexBasedCellPopulation< DIM >::AddNode | ( | Node< DIM > * | pNewNode | ) |
Overridden AddNode() method.
Add a new node to the cell population.
pNewNode | pointer to the new node |
Definition at line 160 of file VertexBasedCellPopulation.cpp.
void VertexBasedCellPopulation< DIM >::CloseOutputFiles | ( | ) | [virtual] |
Overridden CloseOutputFiles() method.
Reimplemented from AbstractCellPopulation< ELEMENT_DIM, ELEMENT_DIM >.
Definition at line 622 of file VertexBasedCellPopulation.cpp.
References AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::CloseOutputFiles().
void VertexBasedCellPopulation< DIM >::CreateOutputFiles | ( | const std::string & | rDirectory, |
bool | cleanOutputDirectory | ||
) | [virtual] |
Overridden CreateOutputFiles() method.
rDirectory | pathname of the output directory, relative to where Chaste output is stored |
cleanOutputDirectory | whether to delete the contents of the output directory prior to output file creation |
Reimplemented from AbstractCellPopulation< ELEMENT_DIM, ELEMENT_DIM >.
Definition at line 611 of file VertexBasedCellPopulation.cpp.
References AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::CreateOutputFiles(), and OutputFileHandler::OpenOutputFile().
void VertexBasedCellPopulation< DIM >::GenerateCellResultsAndWriteToFiles | ( | ) | [virtual] |
Overridden GenerateCellResultsAndWriteToFiles() method.
Implements AbstractCellPopulation< ELEMENT_DIM, ELEMENT_DIM >.
Definition at line 631 of file VertexBasedCellPopulation.cpp.
double VertexBasedCellPopulation< DIM >::GetDampingConstant | ( | unsigned | nodeIndex | ) | [virtual] |
Overridden GetDampingConstant() method.
nodeIndex | the global index of this node |
Implements AbstractOffLatticeCellPopulation< DIM >.
Definition at line 94 of file VertexBasedCellPopulation.cpp.
VertexElement< DIM, DIM > * VertexBasedCellPopulation< DIM >::GetElement | ( | unsigned | elementIndex | ) |
Get a particular VertexElement.
elementIndex | the global index of the VertexElement |
Definition at line 136 of file VertexBasedCellPopulation.cpp.
Referenced by NagaiHondaForce< DIM >::AddForceContribution().
VertexElement< DIM, DIM > * VertexBasedCellPopulation< DIM >::GetElementCorrespondingToCell | ( | CellPtr | pCell | ) |
Get a pointer to the element corresponding to a given CellPtr.
pCell | the cell |
Definition at line 172 of file VertexBasedCellPopulation.cpp.
c_vector< double, DIM > VertexBasedCellPopulation< DIM >::GetLocationOfCellCentre | ( | CellPtr | pCell | ) | [virtual] |
Overridden GetLocationOfCellCentre() method.
Find the centre of mass of a given cell (assuming uniform density). Note that, as there is no guarantee of convexity, this may lie outside the VertexElement corresponding to the cell.
pCell | a cell in the population |
Implements AbstractCellPopulation< ELEMENT_DIM, ELEMENT_DIM >.
Definition at line 148 of file VertexBasedCellPopulation.cpp.
std::set< unsigned > VertexBasedCellPopulation< DIM >::GetNeighbouringNodeIndices | ( | unsigned | index | ) | [virtual] |
Overridden GetNeighbouringNodeIndices() method.
index | the node index |
Implements AbstractCellPopulation< ELEMENT_DIM, ELEMENT_DIM >.
Definition at line 680 of file VertexBasedCellPopulation.cpp.
Node< DIM > * VertexBasedCellPopulation< DIM >::GetNode | ( | unsigned | index | ) | [virtual] |
Overridden GetNode() method.
index | global index of the specified node |
Implements AbstractCellPopulation< ELEMENT_DIM, ELEMENT_DIM >.
Definition at line 154 of file VertexBasedCellPopulation.cpp.
Referenced by NagaiHondaForce< DIM >::AddForceContribution(), and PlaneBoundaryCondition< DIM >::ImposeBoundaryCondition().
unsigned VertexBasedCellPopulation< DIM >::GetNumElements | ( | ) |
Definition at line 178 of file VertexBasedCellPopulation.cpp.
unsigned VertexBasedCellPopulation< DIM >::GetNumNodes | ( | ) | [virtual] |
Overridden GetNumNodes() method.
Implements AbstractCellPopulation< ELEMENT_DIM, ELEMENT_DIM >.
Definition at line 142 of file VertexBasedCellPopulation.cpp.
Referenced by NagaiHondaForce< DIM >::AddForceContribution(), and PlaneBoundaryCondition< DIM >::ImposeBoundaryCondition().
double VertexBasedCellPopulation< DIM >::GetVolumeOfCell | ( | CellPtr | pCell | ) | [virtual] |
Overridden GetVolumeOfCell() method.
pCell | boost shared pointer to a cell |
Implements AbstractCellPopulation< ELEMENT_DIM, ELEMENT_DIM >.
Definition at line 431 of file VertexBasedCellPopulation.cpp.
double VertexBasedCellPopulation< DIM >::GetWidth | ( | const unsigned & | rDimension | ) | [virtual] |
Overridden GetWidth() method.
Calculate the 'width' of any dimension of the cell population by calling GetWidth() on the mesh.
rDimension | a dimension (0,1 or 2) |
Implements AbstractCellPopulation< ELEMENT_DIM, ELEMENT_DIM >.
Definition at line 671 of file VertexBasedCellPopulation.cpp.
bool VertexBasedCellPopulation< DIM >::IsCellAssociatedWithADeletedLocation | ( | CellPtr | pCell | ) | [virtual] |
Overridden IsCellAssociatedWithADeletedLocation() method.
pCell | the cell |
Implements AbstractCellPopulation< ELEMENT_DIM, ELEMENT_DIM >.
Definition at line 275 of file VertexBasedCellPopulation.cpp.
void VertexBasedCellPopulation< 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 AbstractOffLatticeCellPopulation< DIM >.
Definition at line 660 of file VertexBasedCellPopulation.cpp.
References AbstractOffLatticeCellPopulation< ELEMENT_DIM, SPACE_DIM >::OutputCellPopulationParameters().
unsigned VertexBasedCellPopulation< 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, ELEMENT_DIM >.
Definition at line 213 of file VertexBasedCellPopulation.cpp.
MutableVertexMesh< DIM, DIM > & VertexBasedCellPopulation< DIM >::rGetMesh | ( | ) |
Reimplemented from AbstractCellPopulation< ELEMENT_DIM, ELEMENT_DIM >.
Definition at line 124 of file VertexBasedCellPopulation.cpp.
Referenced by VertexCryptBoundaryForce< DIM >::AddForceContribution(), WelikyOsterForce< DIM >::AddForceContribution(), NagaiHondaForce< DIM >::AddForceContribution(), and DeltaNotchOffLatticeSimulation< DIM >::UpdateCellData().
const MutableVertexMesh< DIM, DIM > & VertexBasedCellPopulation< DIM >::rGetMesh | ( | ) | const |
Definition at line 130 of file VertexBasedCellPopulation.cpp.
void VertexBasedCellPopulation< DIM >::serialize | ( | Archive & | archive, |
const unsigned int | version | ||
) | [inline, private] |
Serialize the object and its member variables.
Note that serialization of the mesh and cells is handled by load/save_construct_data.
Note also that member data related to writers is not saved - output must be set up again by the caller after a restart.
archive | the archive |
version | the current version of this class |
Reimplemented from AbstractOffLatticeCellPopulation< DIM >.
Definition at line 101 of file VertexBasedCellPopulation.hpp.
void VertexBasedCellPopulation< DIM >::SetNode | ( | unsigned | index, |
ChastePoint< DIM > & | rNewLocation | ||
) |
Overridden SetNode() method.
Move the node with a given index to a new point in space.
index | the index of the node to be moved |
rNewLocation | the new target location of the node |
Definition at line 166 of file VertexBasedCellPopulation.cpp.
void VertexBasedCellPopulation< DIM >::Update | ( | bool | hasHadBirthsOrDeaths = true | ) | [virtual] |
Remove the VertexElements which have been marked as deleted, perform any cell rearrangements if required, and update the correspondence with CellPtrs.
hasHadBirthsOrDeaths | - a bool saying whether cell population has had Births Or Deaths not needed in this cell population class |
Implements AbstractCellPopulation< ELEMENT_DIM, ELEMENT_DIM >.
Definition at line 281 of file VertexBasedCellPopulation.cpp.
void VertexBasedCellPopulation< DIM >::UpdateNodeLocations | ( | const std::vector< c_vector< double, DIM > > & | rNodeForces, |
double | dt | ||
) |
Overridden UpdateNodeLocations() method.
rNodeForces | a vector containing the force on each node in the cell population |
dt | the time step |
Definition at line 234 of file VertexBasedCellPopulation.cpp.
void VertexBasedCellPopulation< DIM >::Validate | ( | ) | [private, virtual] |
Check the consistency of internal data structures. Each VertexElement must have a CellPtr associated with it.
Implements AbstractCellPopulation< ELEMENT_DIM, ELEMENT_DIM >.
Definition at line 329 of file VertexBasedCellPopulation.cpp.
References EXCEPTION.
Referenced by VertexBasedCellPopulation< DIM >::VertexBasedCellPopulation().
void VertexBasedCellPopulation< DIM >::WriteCellVolumeResultsToFile | ( | ) | [virtual] |
Write the current index and location (of the centre) of each element in mrMesh, as well as the ID and the area (in 2D) or volume (in 3D) of its corresponding cell, to mpCellVolumesFile.
Implements AbstractCellPopulation< ELEMENT_DIM, ELEMENT_DIM >.
Definition at line 443 of file VertexBasedCellPopulation.cpp.
References SimulationTime::GetTime(), and SimulationTime::Instance().
void VertexBasedCellPopulation< DIM >::WriteResultsToFiles | ( | ) | [virtual] |
Overridden WriteResultsToFiles() method.
Reimplemented from AbstractCellPopulation< ELEMENT_DIM, ELEMENT_DIM >.
Definition at line 358 of file VertexBasedCellPopulation.cpp.
References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), SimulationTime::GetTime(), SimulationTime::Instance(), and AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::WriteResultsToFiles().
void VertexBasedCellPopulation< DIM >::WriteVtkResultsToFile | ( | ) | [private, virtual] |
Overridden WriteVtkResultsToFile() method.
Implements AbstractCellPopulation< ELEMENT_DIM, ELEMENT_DIM >.
Definition at line 491 of file VertexBasedCellPopulation.cpp.
References VertexMeshWriter< ELEMENT_DIM, SPACE_DIM >::AddCellData(), VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorBegin(), SimulationTime::GetTimeStepsElapsed(), SimulationTime::Instance(), UNSIGNED_UNSET, and VertexMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteVtkUsingMesh().
friend class boost::serialization::access [friend] |
Needed for serialization.
Reimplemented from AbstractOffLatticeCellPopulation< DIM >.
Definition at line 88 of file VertexBasedCellPopulation.hpp.
bool VertexBasedCellPopulation< DIM >::mDeleteMesh [private] |
Whether to delete the mesh when we are destroyed. Needed if this cell population has been de-serialized.
Definition at line 66 of file VertexBasedCellPopulation.hpp.
MutableVertexMesh<DIM, DIM>* VertexBasedCellPopulation< DIM >::mpMutableVertexMesh [private] |
A static cast of the Abstract mesh from `AbstractCellPopulation` for use in this class
Definition at line 72 of file VertexBasedCellPopulation.hpp.
Referenced by VertexBasedCellPopulation< DIM >::VertexBasedCellPopulation().
out_stream VertexBasedCellPopulation< DIM >::mpT1SwapLocationsFile [private] |
Results file for locations of T1Swaps.
Definition at line 78 of file VertexBasedCellPopulation.hpp.
out_stream VertexBasedCellPopulation< DIM >::mpT3SwapLocationsFile [private] |
Results file for locations of T3Swaps.
Definition at line 81 of file VertexBasedCellPopulation.hpp.
out_stream VertexBasedCellPopulation< DIM >::mpVizElementsFile [private] |
Results file for elements.
Definition at line 75 of file VertexBasedCellPopulation.hpp.