Chaste Commit::f2ff7ee04e70ac9d06c57344df8d017dbb12b97b
VertexBasedCellPopulation< DIM > Class Template Reference

#include <VertexBasedCellPopulation.hpp>

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

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, VertexBasedPopulationSrn< DIM > &rPopSrn)
 
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)
 
std::set< unsignedGetNeighbouringLocationIndices (CellPtr pCell)
 
std::set< std::pair< unsigned, unsigned > > GetNeighbouringEdgeIndices (CellPtr pCell, unsigned edgeLocalIndex)
 
unsigned AddNode (Node< DIM > *pNewNode)
 
virtual void CheckForStepSizeException (unsigned nodeIndex, c_vector< double, DIM > &rDisplacement, double dt)
 
void SetNode (unsigned index, ChastePoint< DIM > &rNewLocation)
 
VertexElement< DIM, DIM > * GetElementCorrespondingToCell (CellPtr pCell)
 
CellPtr AddCell (CellPtr pNewCell, CellPtr pParentCell=CellPtr())
 
unsigned RemoveDeadCells ()
 
bool IsCellAssociatedWithADeletedLocation (CellPtr pCell)
 
void Update (bool hasHadBirthsOrDeaths=true)
 
virtual void OpenWritersFiles (OutputFileHandler &rOutputFileHandler)
 
virtual void AcceptPopulationWriter (boost::shared_ptr< AbstractCellPopulationWriter< DIM, DIM > > pPopulationWriter)
 
virtual void AcceptPopulationCountWriter (boost::shared_ptr< AbstractCellPopulationCountWriter< DIM, DIM > > pPopulationCountWriter)
 
virtual void AcceptPopulationEventWriter (boost::shared_ptr< AbstractCellPopulationEventWriter< DIM, DIM > > pPopulationEventWriter)
 
virtual void AcceptCellWriter (boost::shared_ptr< AbstractCellWriter< DIM, DIM > > pCellWriter, CellPtr pCell)
 
unsigned GetRosetteRankOfCell (CellPtr pCell)
 
double GetVolumeOfCell (CellPtr pCell)
 
std::vector< c_vector< double, DIM > > GetLocationsOfT2Swaps ()
 
std::vector< unsignedGetCellIdsOfT2Swaps ()
 
void AddLocationOfT2Swap (c_vector< double, DIM > locationOfT2Swap)
 
void AddCellIdOfT2Swap (unsigned idOfT2Swap)
 
void ClearLocationsAndCellIdsOfT2Swaps ()
 
bool GetOutputCellRearrangementLocations ()
 
void SetOutputCellRearrangementLocations (bool outputCellRearrangementLocations)
 
void OutputCellPopulationParameters (out_stream &rParamsFile)
 
double GetWidth (const unsigned &rDimension)
 
std::set< unsignedGetNeighbouringNodeIndices (unsigned index)
 
virtual TetrahedralMesh< DIM, DIM > * GetTetrahedralMeshForPdeModifier ()
 
virtual bool IsPdeNodeAssociatedWithNonApoptoticCell (unsigned pdeNodeIndex)
 
virtual double GetCellDataItemAtPdeNode (unsigned pdeNodeIndex, std::string &rVariableName, bool dirichletBoundaryConditionApplies=false, double dirichletBoundaryValue=0.0)
 
boost::shared_ptr< AbstractVertexBasedDivisionRule< DIM > > GetVertexBasedDivisionRule ()
 
void SetVertexBasedDivisionRule (boost::shared_ptr< AbstractVertexBasedDivisionRule< DIM > > pVertexBasedDivisionRule)
 
virtual double GetDefaultTimeStep ()
 
virtual void WriteDataToVisualizerSetupFile (out_stream &pVizSetupFile)
 
virtual void SimulationSetupHook (AbstractCellBasedSimulation< DIM, DIM > *pSimulation)
 
bool GetRestrictVertexMovementBoolean ()
 
void SetRestrictVertexMovementBoolean (bool restrictVertexMovement)
 
VertexBasedPopulationSrn< DIM > & rGetVertexBasedPopulationSrn ()
 
const VertexBasedPopulationSrn< DIM > & rGetVertexBasedPopulationSrn () const
 
void SetWriteCellVtkResults (const bool new_val)
 
void SetWriteEdgeVtkResults (const bool new_val)
 
- Public Member Functions inherited from AbstractOffLatticeCellPopulation< 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 ()
 
std::list< CellPtr > & rGetCells ()
 
std::vector< unsignedGetCellMutationStateCount ()
 
std::vector< unsignedGetCellProliferativeTypeCount ()
 
std::vector< unsignedGetCellCyclePhaseCount ()
 
unsigned GetNumRealCells ()
 
unsigned GetNumAllCells ()
 
void SetCellAncestorsToLocationIndices ()
 
std::set< unsignedGetCellAncestors ()
 
virtual CellPtr GetCellUsingLocationIndex (unsigned index)
 
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 UpdateCellProcessLocation ()
 
virtual 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 AcceptPopulationEventWriter (boost::shared_ptr< AbstractCellPopulationEventWriter< ELEMENT_DIM, SPACE_DIM > > pPopulationEventWriter)=0
 
virtual void AcceptCellWriter (boost::shared_ptr< AbstractCellWriter< ELEMENT_DIM, SPACE_DIM > > pCellWriter, CellPtr pCell)=0
 
std::vector< std::string > GetDivisionsInformation ()
 
void AddDivisionInformation (std::string divisionInformation)
 
void ClearDivisionsInformation ()
 
std::vector< std::string > GetRemovalsInformation ()
 
void AddRemovalInformation (std::string removalInformation)
 
void ClearRemovalsInformation ()
 
void GenerateRemovalInformation (CellPtr pCell, std::string killerInfo)
 
void KillCell (CellPtr pCell, std::string killerInfo)
 
void StartApoptosisOnCell (CellPtr pCell, std::string killerInfo)
 
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 ()
 
template<template< unsigned, unsigned > class T>
void AddCellPopulationEventWriter ()
 
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)
 
void AddCellPopulationEventWriter (boost::shared_ptr< AbstractCellPopulationEventWriter< ELEMENT_DIM, SPACE_DIM > > pCellPopulationEventWriter)
 
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
 

Private Member Functions

virtual void WriteVtkResultsToFile (const std::string &rDirectory)
 
virtual void WriteCellVtkResultsToFile (const std::string &rDirectory)
 
virtual void WriteCellEdgeVtkResultsToFile (const std::string &rDirectory)
 
template<class Archive >
void serialize (Archive &archive, const unsigned int version)
 
void Validate ()
 

Private Attributes

bool mDeleteMesh
 
MutableVertexMesh< DIM, DIM > * mpMutableVertexMesh
 
bool mOutputCellRearrangementLocations
 
boost::shared_ptr< AbstractVertexBasedDivisionRule< DIM > > mpVertexBasedDivisionRule
 
std::vector< c_vector< double, DIM > > mLocationsOfT2Swaps
 
std::vector< unsignedmCellIdsOfT2Swaps
 
bool mRestrictVertexMovement
 
bool mThrowStepSizeException = true
 
VertexBasedPopulationSrn< DIM > mPopulationSrn
 
bool mWriteCellVtkResults = true
 
bool mWriteEdgeVtkResults = true
 

Friends

class TestVertexBasedDivisionRules
 
class TestVertexBasedCellPopulation
 
class TestMutableVertexMeshOperationsWithPopulationSrn
 
class boost::serialization::access
 

Additional Inherited Members

- Protected Member Functions inherited from AbstractOffLatticeCellPopulation< 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)
 
virtual void AcceptCellWritersAcrossPopulation ()
 
- Protected Attributes inherited from AbstractOffLatticeCellPopulation< 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
 
std::vector< boost::shared_ptr< AbstractCellPopulationEventWriter< ELEMENT_DIM, SPACE_DIM > > > mCellPopulationEventWriters
 
std::vector< std::string > mDivisionsInformation
 
std::vector< std::string > mRemovalsInformation
 

Detailed Description

template<unsigned DIM>
class VertexBasedCellPopulation< DIM >

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 62 of file VertexBasedCellPopulation.hpp.

Constructor & Destructor Documentation

◆ VertexBasedCellPopulation() [1/2]

template<unsigned DIM>
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.

Parameters
rMeshreference to a
rCellsreference to a vector of CellPtrs
deleteMeshset to true if you want the cell population to free the mesh memory on destruction
validatewhether to validate the cell population when it is created (defaults to true)
locationIndicesan optional vector of location indices that correspond to real cells

Definition at line 54 of file VertexBasedCellPopulation.cpp.

References AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::AddCellUsingLocationIndex(), AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::mCells, VertexBasedCellPopulation< DIM >::mpMutableVertexMesh, VertexBasedCellPopulation< DIM >::mPopulationSrn, VertexBasedCellPopulation< DIM >::mpVertexBasedDivisionRule, AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::mrMesh, MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::SetMeshOperationTracking(), and VertexBasedCellPopulation< DIM >::Validate().

◆ VertexBasedCellPopulation() [2/2]

template<unsigned DIM>
VertexBasedCellPopulation< DIM >::VertexBasedCellPopulation ( MutableVertexMesh< DIM, DIM > &  rMesh,
VertexBasedPopulationSrn< DIM > &  rPopSrn 
)

Constructor for use by boost serialization ONLY!

Parameters
rMesha vertex mesh.
rPopSrna population SRN remapping helper class

Definition at line 91 of file VertexBasedCellPopulation.cpp.

References VertexBasedCellPopulation< DIM >::mpMutableVertexMesh, VertexBasedCellPopulation< DIM >::mPopulationSrn, and AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::mrMesh.

◆ ~VertexBasedCellPopulation()

template<unsigned DIM>
VertexBasedCellPopulation< DIM >::~VertexBasedCellPopulation ( )
virtual

Destructor, which frees any memory allocated by the constructor.

Definition at line 104 of file VertexBasedCellPopulation.cpp.

Member Function Documentation

◆ AcceptCellWriter()

template<unsigned DIM>
void VertexBasedCellPopulation< 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 427 of file VertexBasedCellPopulation.cpp.

◆ AcceptPopulationCountWriter()

template<unsigned DIM>
void VertexBasedCellPopulation< 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 415 of file VertexBasedCellPopulation.cpp.

◆ AcceptPopulationEventWriter()

template<unsigned DIM>
void VertexBasedCellPopulation< DIM >::AcceptPopulationEventWriter ( boost::shared_ptr< AbstractCellPopulationEventWriter< DIM, DIM > >  pPopulationEventWriter)
virtual

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

Parameters
pPopulationEventWriterthe population event writer.

Definition at line 421 of file VertexBasedCellPopulation.cpp.

◆ AcceptPopulationWriter()

template<unsigned DIM>
void VertexBasedCellPopulation< 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 409 of file VertexBasedCellPopulation.cpp.

◆ AddCell()

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

Overridden AddCell() method.

Add a new cell to the cell population.

Parameters
pNewCellthe cell to add
pParentCellpointer to a parent cell (if required)
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 >.

Definition at line 244 of file VertexBasedCellPopulation.cpp.

◆ AddCellIdOfT2Swap()

template<unsigned DIM>
void VertexBasedCellPopulation< DIM >::AddCellIdOfT2Swap ( unsigned  idOfT2Swap)

Add ID of T2 Swap.

Parameters
idOfT2SwapID of the cell undergoing a T2 swap

Definition at line 1051 of file VertexBasedCellPopulation.cpp.

◆ AddLocationOfT2Swap()

template<unsigned DIM>
void VertexBasedCellPopulation< DIM >::AddLocationOfT2Swap ( c_vector< double, DIM >  locationOfT2Swap)

Add location of T2 Swap.

Parameters
locationOfT2SwapLocation of the T2 swap

Definition at line 1045 of file VertexBasedCellPopulation.cpp.

◆ AddNode()

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

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 220 of file VertexBasedCellPopulation.cpp.

◆ CheckForStepSizeException()

template<unsigned DIM>
void VertexBasedCellPopulation< DIM >::CheckForStepSizeException ( unsigned  nodeIndex,
c_vector< double, DIM > &  rDisplacement,
double  dt 
)
virtual

Checks whether a given node displacement violates the movement threshold for this population. If so, a stepSizeException is generated that contains a warning/error message and a suggested smaller dt that should avoid the problem.

Parameters
nodeIndexIndex of the node in question (allows us to check whether this is a ghost or particle)
rDisplacementMovement vector of the node at this time step
dtCurrent time step size

Definition at line 302 of file VertexBasedCellPopulation.cpp.

◆ ClearLocationsAndCellIdsOfT2Swaps()

template<unsigned DIM>
void VertexBasedCellPopulation< DIM >::ClearLocationsAndCellIdsOfT2Swaps ( )

Clear the locations and IDs of cells undergoing T2 Swaps.

Definition at line 1057 of file VertexBasedCellPopulation.cpp.

◆ GetCellDataItemAtPdeNode()

template<unsigned DIM>
double VertexBasedCellPopulation< DIM >::GetCellDataItemAtPdeNode ( unsigned  pdeNodeIndex,
std::string &  rVariableName,
bool  dirichletBoundaryConditionApplies = false,
double  dirichletBoundaryValue = 0.0 
)
virtual

Overridden GetCellDataItemAtPdeNode() method.

Parameters
pdeNodeIndexindex of a node in a tetrahedral mesh for use with a PDE modifier
rVariableNamethe name of the cell data item to get
dirichletBoundaryConditionApplieswhere a Dirichlet boundary condition is used (optional; defaults to false)
dirichletBoundaryValuethe value of the Dirichlet boundary condition, if used (optional; defaults to 0.0)
Returns
the value of a CellData item (interpolated if necessary) at a node, specified by its index in a tetrahedral mesh for use with a PDE modifier. This method can be called by PDE modifier classes.
Todo:
Work out a better way to do the nodes not associated with cells

Implements AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.

Definition at line 1096 of file VertexBasedCellPopulation.cpp.

References Node< SPACE_DIM >::rGetContainingElementIndices().

◆ GetCellIdsOfT2Swaps()

template<unsigned DIM>
std::vector< unsigned > VertexBasedCellPopulation< DIM >::GetCellIdsOfT2Swaps ( )

Return all IDs of cells undergoing T2 swaps since the last sampling time step.

Returns
mLocationsOfT2Swaps

Definition at line 1039 of file VertexBasedCellPopulation.cpp.

◆ GetDampingConstant()

template<unsigned DIM>
double VertexBasedCellPopulation< DIM >::GetDampingConstant ( unsigned  nodeIndex)
virtual

Overridden GetDampingConstant() method.

Parameters
nodeIndexthe global index of this node
Returns
the average damping constant of the cells surrounding the node.

Implements AbstractOffLatticeCellPopulation< DIM >.

Definition at line 113 of file VertexBasedCellPopulation.cpp.

References EXCEPTION, and SimulationTime::Instance().

Referenced by NodeVelocityWriter< ELEMENT_DIM, SPACE_DIM >::Visit().

◆ GetDefaultTimeStep()

template<unsigned DIM>
double VertexBasedCellPopulation< DIM >::GetDefaultTimeStep ( )
virtual

Overridden GetDefaultTimeStep() method.

Returns
a default value for the time step to use when simulating the cell population.

A hard-coded value of 0.002 is returned. However, note that the time step can be reset by calling SetDt() on the simulation object used to simulate the cell population.

Implements AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.

Definition at line 1146 of file VertexBasedCellPopulation.cpp.

◆ GetElement()

template<unsigned DIM>
VertexElement< DIM, DIM > * VertexBasedCellPopulation< DIM >::GetElement ( unsigned  elementIndex)

◆ GetElementCorrespondingToCell()

template<unsigned DIM>
VertexElement< DIM, DIM > * VertexBasedCellPopulation< DIM >::GetElementCorrespondingToCell ( CellPtr  pCell)

Get a pointer to the element corresponding to a given CellPtr.

Parameters
pCellthe cell
Returns
pointer to the element.

Definition at line 232 of file VertexBasedCellPopulation.cpp.

◆ GetLocationOfCellCentre()

template<unsigned DIM>
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.

Parameters
pCella cell in the population
Returns
the location of the centre of mass of the element corresponding to this cell.

Implements AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.

Definition at line 172 of file VertexBasedCellPopulation.cpp.

◆ GetLocationsOfT2Swaps()

template<unsigned DIM>
std::vector< c_vector< double, DIM > > VertexBasedCellPopulation< DIM >::GetLocationsOfT2Swaps ( )

Return all locations of T2 swaps since the last sampling time step.

Returns
mLocationsOfT2Swaps

Definition at line 1033 of file VertexBasedCellPopulation.cpp.

◆ GetNeighbouringEdgeIndices()

template<unsigned DIM>
std::set< std::pair< unsigned, unsigned > > VertexBasedCellPopulation< DIM >::GetNeighbouringEdgeIndices ( CellPtr  pCell,
unsigned  edgeLocalIndex 
)
virtual

Overridden GetNeighbouringEdgeIndices() method. Gets the local edge index of the neighbouring element and the element index.

Parameters
pCellCell pointer
edgeLocalIndexLocal edge index
Returns
set of pairs consisting of element index neighbouring pCell and local edge index

Reimplemented from AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.

Definition at line 192 of file VertexBasedCellPopulation.cpp.

◆ GetNeighbouringLocationIndices()

template<unsigned DIM>
std::set< unsigned > VertexBasedCellPopulation< DIM >::GetNeighbouringLocationIndices ( CellPtr  pCell)
virtual

Overridden GetNeighbouringLocationIndices() method. Given a cell, returns the set of location indices corresponding to neighbouring cells.

Parameters
pCella cell
Returns
the set of neighbouring location indices.

Implements AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.

Definition at line 184 of file VertexBasedCellPopulation.cpp.

◆ GetNeighbouringNodeIndices()

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

Overridden GetNeighbouringNodeIndices() method.

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

Implements AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.

Definition at line 877 of file VertexBasedCellPopulation.cpp.

◆ GetNode()

template<unsigned DIM>
Node< DIM > * VertexBasedCellPopulation< DIM >::GetNode ( unsigned  index)
virtual

Overridden GetNode() method.

Parameters
indexglobal index of the specified node
Returns
a pointer to the node.

Implements AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.

Definition at line 178 of file VertexBasedCellPopulation.cpp.

Referenced by FarhadifarForce< DIM >::AddForceContribution(), NagaiHondaForce< DIM >::AddForceContribution(), and WelikyOsterForce< DIM >::AddForceContribution().

◆ GetNumElements()

template<unsigned DIM>
unsigned VertexBasedCellPopulation< DIM >::GetNumElements ( )
Returns
the number of VertexElements in the cell population.

Definition at line 238 of file VertexBasedCellPopulation.cpp.

Referenced by FarhadifarForce< DIM >::AddForceContribution(), and NagaiHondaForce< DIM >::AddForceContribution().

◆ GetNumNodes()

template<unsigned DIM>
unsigned VertexBasedCellPopulation< DIM >::GetNumNodes ( )
virtual

Overridden GetNumNodes() method.

Returns
the number of nodes in the cell population.

Implements AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.

Definition at line 166 of file VertexBasedCellPopulation.cpp.

Referenced by FarhadifarForce< DIM >::AddForceContribution(), and NagaiHondaForce< DIM >::AddForceContribution().

◆ GetOutputCellRearrangementLocations()

template<unsigned DIM>
bool VertexBasedCellPopulation< DIM >::GetOutputCellRearrangementLocations ( )
Returns
mOutputCellRearrangementLocations

Definition at line 839 of file VertexBasedCellPopulation.cpp.

◆ GetRestrictVertexMovementBoolean()

template<unsigned DIM>
bool VertexBasedCellPopulation< DIM >::GetRestrictVertexMovementBoolean ( )

Get the value of the mRestrictVertexMovement boolean.

Returns
True if vertex movement is restricted at each timestep.

Definition at line 1169 of file VertexBasedCellPopulation.cpp.

◆ GetRosetteRankOfCell()

template<unsigned DIM>
unsigned VertexBasedCellPopulation< DIM >::GetRosetteRankOfCell ( CellPtr  pCell)

Get the "rosette rank" of a cell.

This is defined as the maximum number of cells shared by any node in the cell's corresponding element.

Parameters
pCellboost shared pointer to a cell
Returns
rosette rank via associated mesh element

Definition at line 433 of file VertexBasedCellPopulation.cpp.

Referenced by CellRosetteRankWriter< ELEMENT_DIM, SPACE_DIM >::GetCellDataForVtkOutput().

◆ GetTetrahedralMeshForPdeModifier()

◆ GetVertexBasedDivisionRule()

template<unsigned DIM>
boost::shared_ptr< AbstractVertexBasedDivisionRule< DIM > > VertexBasedCellPopulation< DIM >::GetVertexBasedDivisionRule ( )
Returns
The Vertex division rule that is currently being used.

Definition at line 883 of file VertexBasedCellPopulation.cpp.

◆ GetVolumeOfCell()

template<unsigned DIM>
double VertexBasedCellPopulation< DIM >::GetVolumeOfCell ( CellPtr  pCell)
virtual

Overridden GetVolumeOfCell() method.

Parameters
pCellboost shared pointer to a cell
Returns
volume via associated mesh element

Implements AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.

Definition at line 445 of file VertexBasedCellPopulation.cpp.

◆ GetWidth()

template<unsigned DIM>
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.

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 868 of file VertexBasedCellPopulation.cpp.

◆ IsCellAssociatedWithADeletedLocation()

template<unsigned DIM>
bool VertexBasedCellPopulation< DIM >::IsCellAssociatedWithADeletedLocation ( CellPtr  pCell)
virtual

Overridden IsCellAssociatedWithADeletedLocation() method.

Parameters
pCellthe cell
Returns
whether a given cell is associated with a deleted element.

Implements AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.

Definition at line 329 of file VertexBasedCellPopulation.cpp.

◆ IsPdeNodeAssociatedWithNonApoptoticCell()

template<unsigned DIM>
bool VertexBasedCellPopulation< DIM >::IsPdeNodeAssociatedWithNonApoptoticCell ( unsigned  pdeNodeIndex)
virtual

Overridden IsPdeNodeAssociatedWithNonApoptoticCell() method.

Parameters
pdeNodeIndexinedx of a node in a tetrahedral mesh for use with a PDE modifier
Returns
if a node, specified by its index in a tetrahedral mesh for use with a PDE modifier, is associated with a non-apoptotic cell. This method can be called by PDE classes.

Reimplemented from AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.

Definition at line 1064 of file VertexBasedCellPopulation.cpp.

◆ OpenWritersFiles()

template<unsigned DIM>
void VertexBasedCellPopulation< DIM >::OpenWritersFiles ( OutputFileHandler rOutputFileHandler)
virtual

Overridden OpenWritersFiles() method.

Open all files in mCellPopulationWriters and mCellWriters for writing (not appending).

Parameters
rOutputFileHandlerhandler for the directory in which to open this file.

Reimplemented from AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.

Definition at line 805 of file VertexBasedCellPopulation.cpp.

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

◆ OutputCellPopulationParameters()

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

Overridden OutputCellPopulationParameters() method.

Parameters
rParamsFilethe file stream to which the parameters are output

Reimplemented from AbstractOffLatticeCellPopulation< DIM >.

Definition at line 851 of file VertexBasedCellPopulation.cpp.

References AbstractOffLatticeCellPopulation< ELEMENT_DIM, SPACE_DIM >::OutputCellPopulationParameters().

◆ RemoveDeadCells()

template<unsigned DIM>
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.

Returns
number of cells removed
Todo:
(#2489) this should cause an error - we should fix this!

Implements AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.

Definition at line 267 of file VertexBasedCellPopulation.cpp.

◆ rGetMesh() [1/2]

◆ rGetMesh() [2/2]

template<unsigned DIM>
const MutableVertexMesh< DIM, DIM > & VertexBasedCellPopulation< DIM >::rGetMesh ( ) const
Returns
const reference to mrMesh (used in archiving).

Definition at line 154 of file VertexBasedCellPopulation.cpp.

◆ rGetVertexBasedPopulationSrn() [1/2]

template<unsigned DIM>
VertexBasedPopulationSrn< DIM > & VertexBasedCellPopulation< DIM >::rGetVertexBasedPopulationSrn ( )

Get VertexBasedPopulationSrn object. Used e.g. in TestMutableVertexMeshRemeshWithPopulationSrn.

Returns
reference to mPopulationSrn

Definition at line 1181 of file VertexBasedCellPopulation.cpp.

◆ rGetVertexBasedPopulationSrn() [2/2]

template<unsigned DIM>
const VertexBasedPopulationSrn< DIM > & VertexBasedCellPopulation< DIM >::rGetVertexBasedPopulationSrn ( ) const
Returns
const reference to mPopulationSrn (used in archiving).

Definition at line 1187 of file VertexBasedCellPopulation.cpp.

◆ serialize()

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

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.

Parameters
archivethe archive
versionthe current version of this class

Definition at line 168 of file VertexBasedCellPopulation.hpp.

References VertexBasedCellPopulation< DIM >::mOutputCellRearrangementLocations, VertexBasedCellPopulation< DIM >::mpVertexBasedDivisionRule, and VertexBasedCellPopulation< DIM >::mRestrictVertexMovement.

◆ SetNode()

template<unsigned DIM>
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.

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

Definition at line 226 of file VertexBasedCellPopulation.cpp.

◆ SetOutputCellRearrangementLocations()

template<unsigned DIM>
void VertexBasedCellPopulation< DIM >::SetOutputCellRearrangementLocations ( bool  outputCellRearrangementLocations)

Set mOutputCellRearrangementLocations.

Parameters
outputCellRearrangementLocationsthe new value of mOutputCellRearrangementLocations

Definition at line 845 of file VertexBasedCellPopulation.cpp.

◆ SetRestrictVertexMovementBoolean()

template<unsigned DIM>
void VertexBasedCellPopulation< DIM >::SetRestrictVertexMovementBoolean ( bool  restrictVertexMovement)

Set the value of the mRestrictVertexMovement boolean.

Parameters
restrictVertexMovementwhether to restrict vertex movement in this simulation.

Definition at line 1175 of file VertexBasedCellPopulation.cpp.

◆ SetVertexBasedDivisionRule()

template<unsigned DIM>
void VertexBasedCellPopulation< DIM >::SetVertexBasedDivisionRule ( boost::shared_ptr< AbstractVertexBasedDivisionRule< DIM > >  pVertexBasedDivisionRule)

Set the division rule for this population.

Parameters
pVertexBasedDivisionRulepointer to the new division rule

Definition at line 889 of file VertexBasedCellPopulation.cpp.

◆ SetWriteCellVtkResults()

template<unsigned DIM>
void VertexBasedCellPopulation< DIM >::SetWriteCellVtkResults ( const bool  new_val)

Set whether to write cell vtk results

Parameters
new_valwhether to write cell vtk

Definition at line 1193 of file VertexBasedCellPopulation.cpp.

◆ SetWriteEdgeVtkResults()

template<unsigned DIM>
void VertexBasedCellPopulation< DIM >::SetWriteEdgeVtkResults ( const bool  new_val)

Set whether to write cell vtk results

Parameters
new_valwhether to write cell vtk

Definition at line 1199 of file VertexBasedCellPopulation.cpp.

◆ SimulationSetupHook()

template<unsigned DIM>
void VertexBasedCellPopulation< DIM >::SimulationSetupHook ( AbstractCellBasedSimulation< DIM, DIM > *  pSimulation)
virtual

Overridden SimulationSetupHook() method.

Hook method to add a T2SwapCellKiller to a simulation object, which is always required in the case of a VertexBasedCellPopulation. This functionality avoids the need for static or dynamic casts to specific cell population types within simulation methods.

Note: In order to inhibit T2 swaps, the user needs to set the threshold for T2 swaps in the MutableVertexMesh object mrMesh to 0, using the SetT2Threshold() method.

Parameters
pSimulationpointer to a cell-based simulation object

Definition at line 1161 of file VertexBasedCellPopulation.cpp.

References AbstractCellBasedSimulation< ELEMENT_DIM, SPACE_DIM >::AddCellKiller(), and MAKE_PTR_ARGS.

◆ Update()

template<unsigned DIM>
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.

Parameters
hasHadBirthsOrDeaths- a bool saying whether cell population has had Births Or Deaths not needed in this cell population class
Todo:
We want to make these maps private, so we need a better way of doing the code below.

Implements AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.

Definition at line 335 of file VertexBasedCellPopulation.cpp.

References VertexElementMap::GetNewIndex(), VertexElementMap::IsDeleted(), VertexElementMap::IsIdentityMap(), and VertexElementMap::ResetToIdentity().

Referenced by HeterotypicBoundaryLengthWriter< ELEMENT_DIM, SPACE_DIM >::Visit().

◆ Validate()

template<unsigned DIM>
void VertexBasedCellPopulation< DIM >::Validate ( )
privatevirtual

Check the consistency of internal data structures. Each VertexElement must have a CellPtr associated with it.

Implements AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.

Definition at line 381 of file VertexBasedCellPopulation.cpp.

References EXCEPTION, and SimulationTime::Instance().

Referenced by VertexBasedCellPopulation< DIM >::VertexBasedCellPopulation().

◆ WriteCellEdgeVtkResultsToFile()

template<unsigned DIM>
void VertexBasedCellPopulation< DIM >::WriteCellEdgeVtkResultsToFile ( const std::string &  rDirectory)
privatevirtual

Writes an edge-based representation of the cells to file. Each cell is divided into a number of triangles equaling the number of edges.

Cell ID property is added by default so individual cells can still be differentiated.

Parameters
rDirectory

Definition at line 574 of file VertexBasedCellPopulation.cpp.

References TrapezoidEdgeVertexMeshWriter< ELEMENT_DIM, SPACE_DIM >::AddCellData(), VertexMeshWriter< ELEMENT_DIM, SPACE_DIM >::AddCellData(), SimulationTime::GetTimeStepsElapsed(), SimulationTime::Instance(), TrapezoidEdgeVertexMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteVtkUsingMesh(), and VertexMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteVtkUsingMesh().

◆ WriteCellVtkResultsToFile()

template<unsigned DIM>
void VertexBasedCellPopulation< DIM >::WriteCellVtkResultsToFile ( const std::string &  rDirectory)
privatevirtual

◆ WriteDataToVisualizerSetupFile()

template<unsigned DIM>
void VertexBasedCellPopulation< DIM >::WriteDataToVisualizerSetupFile ( out_stream &  pVizSetupFile)
virtual

Overridden WriteDataToVisualizerSetupFile() method. Write any data necessary to a visualization setup file. Used by AbstractCellBasedSimulation::WriteVisualizerSetupFile().

Parameters
pVizSetupFilea visualization setup file

Reimplemented from AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.

Definition at line 1152 of file VertexBasedCellPopulation.cpp.

◆ WriteVtkResultsToFile()

template<unsigned DIM>
void VertexBasedCellPopulation< DIM >::WriteVtkResultsToFile ( const std::string &  rDirectory)
privatevirtual

Overridden WriteVtkResultsToFile() method. If the first cell uses the SrnCellModel, the WriteCellEdgeVtkResultsToFile() is used which outputs an edge-based representation of the cell, otherwise WriteCellVtkResultsToFile() is used to represent entire cells.

Parameters
rDirectorypathname of the output directory, relative to where Chaste output is stored

Implements AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >.

Definition at line 457 of file VertexBasedCellPopulation.cpp.

Friends And Related Symbol Documentation

◆ boost::serialization::access

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

Definition at line 155 of file VertexBasedCellPopulation.hpp.

◆ TestMutableVertexMeshOperationsWithPopulationSrn

template<unsigned DIM>
friend class TestMutableVertexMeshOperationsWithPopulationSrn
friend

Definition at line 71 of file VertexBasedCellPopulation.hpp.

◆ TestVertexBasedCellPopulation

template<unsigned DIM>
friend class TestVertexBasedCellPopulation
friend

Definition at line 70 of file VertexBasedCellPopulation.hpp.

◆ TestVertexBasedDivisionRules

template<unsigned DIM>
friend class TestVertexBasedDivisionRules
friend

This test uses the private constructor to simplify testing.

Definition at line 69 of file VertexBasedCellPopulation.hpp.

Member Data Documentation

◆ mCellIdsOfT2Swaps

template<unsigned DIM>
std::vector< unsigned > VertexBasedCellPopulation< DIM >::mCellIdsOfT2Swaps
private

The Ids of cells that have undergone T2 swaps, stored so they can be accessed and output by the cell killer and population writer classes. The Ids are stored until they are cleared by ClearLocationsAndCellIdsOfT2Swaps().

Definition at line 102 of file VertexBasedCellPopulation.hpp.

◆ mDeleteMesh

template<unsigned DIM>
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 77 of file VertexBasedCellPopulation.hpp.

◆ mLocationsOfT2Swaps

template<unsigned DIM>
std::vector< c_vector<double, DIM> > VertexBasedCellPopulation< DIM >::mLocationsOfT2Swaps
private

Locations of T2 swaps (the centre of the removed triangle), stored so they can be accessed and output by the cell killer and population writer classes. The locations are stored until they are cleared by ClearLocationsAndCellIdsOfT2Swaps().

Definition at line 96 of file VertexBasedCellPopulation.hpp.

◆ mOutputCellRearrangementLocations

template<unsigned DIM>
bool VertexBasedCellPopulation< DIM >::mOutputCellRearrangementLocations
private

Whether to output the locations of T1 swaps and T3 swaps to files. Defaults to true.

Definition at line 86 of file VertexBasedCellPopulation.hpp.

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

◆ mpMutableVertexMesh

template<unsigned DIM>
MutableVertexMesh<DIM, DIM>* VertexBasedCellPopulation< DIM >::mpMutableVertexMesh
private

◆ mPopulationSrn

◆ mpVertexBasedDivisionRule

template<unsigned DIM>
boost::shared_ptr<AbstractVertexBasedDivisionRule<DIM> > VertexBasedCellPopulation< DIM >::mpVertexBasedDivisionRule
private

A pointer to a division rule that is used to generate the axis when dividing cells. This is a specialisation for Vertex models.

Definition at line 90 of file VertexBasedCellPopulation.hpp.

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

◆ mRestrictVertexMovement

template<unsigned DIM>
bool VertexBasedCellPopulation< DIM >::mRestrictVertexMovement
private

Whether to restrict the vertex movement if vertex displacement is larger than the cell rearrangement threshold.

Definition at line 108 of file VertexBasedCellPopulation.hpp.

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

◆ mThrowStepSizeException

template<unsigned DIM>
bool VertexBasedCellPopulation< DIM >::mThrowStepSizeException = true
private

Whether to throw StepSizeExceptions, which defaults to true but is made false after the first StepSizeException is thrown. In vertex based cell populations a StepSizeException is not considered terminal, so there is no need to throw more than one (as the numerical method uses WARN_ONCE_ONLY).

Definition at line 115 of file VertexBasedCellPopulation.hpp.

◆ mWriteCellVtkResults

template<unsigned DIM>
bool VertexBasedCellPopulation< DIM >::mWriteCellVtkResults = true
private

Whether to write cell vtk results. True by default

Definition at line 125 of file VertexBasedCellPopulation.hpp.

◆ mWriteEdgeVtkResults

template<unsigned DIM>
bool VertexBasedCellPopulation< DIM >::mWriteEdgeVtkResults = true
private

Whether to write edge vtk results. True by default

Definition at line 130 of file VertexBasedCellPopulation.hpp.


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