AbstractTissue< DIM > Class Template Reference

#include <AbstractTissue.hpp>

Inheritance diagram for AbstractTissue< DIM >:

Inheritance graph
[legend]
Collaboration diagram for AbstractTissue< DIM >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 AbstractTissue (const std::vector< TissueCell > &rCells, const std::vector< unsigned > locationIndices=std::vector< unsigned >())
 AbstractTissue ()
virtual ~AbstractTissue ()
void InitialiseCells ()
std::list< TissueCell > & rGetCells ()
bool HasMesh ()
virtual unsigned GetNumNodes ()=0
virtual c_vector< double, DIM > GetLocationOfCellCentre (TissueCell *pCell)=0
virtual Node< DIM > * GetNode (unsigned index)=0
virtual unsigned AddNode (Node< DIM > *pNewNode)=0
virtual void SetNode (unsigned nodeIndex, ChastePoint< DIM > &rNewLocation)=0
virtual bool IsCellAssociatedWithADeletedNode (TissueCell &rCell)=0
virtual void UpdateNodeLocations (const std::vector< c_vector< double, DIM > > &rNodeForces, double dt)=0
virtual double GetDampingConstant (unsigned nodeIndex)=0
virtual TissueCellAddCell (TissueCell &rNewCell, c_vector< double, DIM > newLocation, TissueCell *pParentCell=NULL)=0
virtual unsigned RemoveDeadCells ()=0
virtual void Update (bool hasHadBirthsOrDeaths=true)=0
c_vector< unsigned,
NUM_CELL_MUTATION_STATES > 
GetCellMutationStateCount ()
c_vector< unsigned,
NUM_CELL_TYPES > 
GetCellTypeCount ()
c_vector< unsigned, 5 > GetCellCyclePhaseCount ()
virtual bool IsGhostNode (unsigned index)
unsigned GetNumRealCells ()
void SetCellAncestorsToNodeIndices ()
void WriteCellIdDataToFile ()
std::set< unsigned > GetCellAncestors ()
TissueCellrGetCellUsingLocationIndex (unsigned index)
unsigned GetLocationIndexUsingCell (TissueCell *pCell)
virtual void CreateOutputFiles (const std::string &rDirectory, bool cleanOutputDirectory)
virtual void WriteResultsToFiles ()
void WriteTimeAndNodeResultsToFiles (std::vector< unsigned > &rCellTypeCounter, std::vector< unsigned > &rCellMutationStateCounter, std::vector< unsigned > &rCellCyclePhaseCounter)
virtual void GenerateCellResultsAndWriteToFiles (std::vector< unsigned > &rCellTypeCounter, std::vector< unsigned > &rCellMutationStateCounter, std::vector< unsigned > &rCellCyclePhaseCounter)
void GenerateCellResults (unsigned locationIndex, std::vector< unsigned > &rCellTypeCounter, std::vector< unsigned > &rCellMutationStateCounter, std::vector< unsigned > &rCellCyclePhaseCounter)
void WriteCellResultsToFiles (std::vector< unsigned > &rCellTypeCounter, std::vector< unsigned > &rCellMutationStateCounter, std::vector< unsigned > &rCellCyclePhaseCounter)
virtual void CloseOutputFiles ()
Iterator Begin ()
Iterator End ()

Protected Member Functions

virtual void Validate ()=0

Protected Attributes

std::list< TissueCellmCells
std::map< unsigned, TissueCell * > mLocationCellMap
std::map< TissueCell *, unsigned > mCellLocationMap
c_vector< unsigned,
NUM_CELL_MUTATION_STATES > 
mCellMutationStateCount
c_vector< unsigned,
NUM_CELL_TYPES > 
mCellTypeCount
c_vector< unsigned, 5 > mCellCyclePhaseCount
out_stream mpVizNodesFile
out_stream mpVizCellTypesFile
out_stream mpCellMutationStatesFile
out_stream mpCellAncestorsFile
out_stream mpCellTypesFile
out_stream mpCellCyclePhasesFile
out_stream mpCellVariablesFile
out_stream mpCellAgesFile
out_stream mpCellIdFile
bool mTissueContainsMesh

Private Member Functions

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

Friends

class boost::serialization::access

Classes

class  Iterator


Detailed Description

template<unsigned DIM>
class AbstractTissue< DIM >

An abstract facade class encapsulating a tissue.

Contains a group of cells and associated methods.

Definition at line 50 of file AbstractTissue.hpp.


Constructor & Destructor Documentation

template<unsigned DIM>
AbstractTissue< DIM >::AbstractTissue ( const std::vector< TissueCell > &  rCells,
const std::vector< unsigned >  locationIndices = std::vector<unsigned>() 
) [inline]

Default constructor.

Parameters:
rCells a vector of cells
locationIndices an optional vector of location indices that correspond to real cells

Definition at line 34 of file AbstractTissue.cpp.

References AbstractTissue< DIM >::mCellCyclePhaseCount, AbstractTissue< DIM >::mCellLocationMap, AbstractTissue< DIM >::mCellMutationStateCount, AbstractTissue< DIM >::mCells, AbstractTissue< DIM >::mCellTypeCount, and AbstractTissue< DIM >::mLocationCellMap.

template<unsigned DIM>
AbstractTissue< DIM >::AbstractTissue (  )  [inline]

Constructor for use by archiving - doesn't take in cells, since these are dealt with by the serialize method.

Definition at line 140 of file AbstractTissue.hpp.

template<unsigned DIM>
virtual AbstractTissue< DIM >::~AbstractTissue (  )  [inline, virtual]

Base class with virtual methods needs a virtual destructor.

Definition at line 146 of file AbstractTissue.hpp.


Member Function Documentation

template<unsigned DIM>
template<class Archive>
void AbstractTissue< DIM >::serialize ( Archive &  archive,
const unsigned int  version 
) [inline, private]

Serialize the object and its member variables.

Parameters:
archive the archive
version the current version of this class

Reimplemented in AbstractCellCentreBasedTissue< DIM >, MeshBasedTissue< DIM >, MeshBasedTissueWithGhostNodes< DIM >, NodeBasedTissue< DIM >, MeshBasedTissue< 2 >, and MeshBasedTissueWithGhostNodes< 2 >.

Definition at line 62 of file AbstractTissue.hpp.

template<unsigned DIM>
virtual void AbstractTissue< DIM >::Validate (  )  [protected, pure virtual]

template<unsigned DIM>
void AbstractTissue< DIM >::InitialiseCells (  )  [inline]

Initialise each cell's cell cycle model.

Definition at line 83 of file AbstractTissue.cpp.

References AbstractTissue< DIM >::mCells.

template<unsigned DIM>
std::list< TissueCell > & AbstractTissue< DIM >::rGetCells (  )  [inline]

Returns:
reference to mCells.

Definition at line 94 of file AbstractTissue.cpp.

References AbstractTissue< DIM >::mCells.

Referenced by AbstractTissue< DIM >::Iterator::IsAtEnd(), and AbstractTissue< DIM >::Iterator::Iterator().

template<unsigned DIM>
bool AbstractTissue< DIM >::HasMesh (  )  [inline]

template<unsigned DIM>
virtual unsigned AbstractTissue< DIM >::GetNumNodes (  )  [pure virtual]

As this method is pure virtual, it must be overridden in subclasses.

Returns:
the number of nodes in the tissue.

Implemented in MeshBasedTissue< DIM >, NodeBasedTissue< DIM >, and MeshBasedTissue< 2 >.

Referenced by AbstractCellCentreBasedTissue< DIM >::AddCell(), and AbstractTissue< DIM >::WriteTimeAndNodeResultsToFiles().

template<unsigned DIM>
virtual c_vector<double, DIM> AbstractTissue< DIM >::GetLocationOfCellCentre ( TissueCell pCell  )  [pure virtual]

Find where a given cell is in space.

Parameters:
pCell pointer to the cell
Returns:
the location of the cell

Implemented in AbstractCellCentreBasedTissue< DIM >.

Referenced by AbstractTissue< DIM >::GenerateCellResults(), SloughingCellKiller< DIM >::TestAndLabelCellsForApoptosisOrDeath(), and AbstractTissue< DIM >::WriteCellIdDataToFile().

template<unsigned DIM>
virtual Node<DIM>* AbstractTissue< DIM >::GetNode ( unsigned  index  )  [pure virtual]

template<unsigned DIM>
virtual unsigned AbstractTissue< DIM >::AddNode ( Node< DIM > *  pNewNode  )  [pure virtual]

Add a new node to the tissue.

As this method is pure virtual, it must be overridden in subclasses.

Parameters:
pNewNode pointer to the new node
Returns:
global index of new node in tissue.

Implemented in MeshBasedTissue< DIM >, NodeBasedTissue< DIM >, and MeshBasedTissue< 2 >.

Referenced by AbstractCellCentreBasedTissue< DIM >::AddCell().

template<unsigned DIM>
virtual void AbstractTissue< DIM >::SetNode ( unsigned  nodeIndex,
ChastePoint< DIM > &  rNewLocation 
) [pure virtual]

Move the node with a given index to a new point in space.

As this method is pure virtual, it must be overridden in subclasses.

Parameters:
nodeIndex the index of the node to be moved
rNewLocation the new target location of the node

Implemented in MeshBasedTissue< DIM >, NodeBasedTissue< DIM >, and MeshBasedTissue< 2 >.

Referenced by AbstractCellCentreBasedTissue< DIM >::UpdateNodeLocations().

template<unsigned DIM>
virtual bool AbstractTissue< DIM >::IsCellAssociatedWithADeletedNode ( TissueCell rCell  )  [pure virtual]

Helper method for establishing if a cell is real.

As this method is pure virtual, it must be overridden in subclasses.

Parameters:
rCell the cell
Returns:
whether a given cell is associated with a deleted node.

Implemented in AbstractCellCentreBasedTissue< DIM >.

Referenced by AbstractTissue< DIM >::Iterator::IsRealCell().

template<unsigned DIM>
virtual void AbstractTissue< DIM >::UpdateNodeLocations ( const std::vector< c_vector< double, DIM > > &  rNodeForces,
double  dt 
) [pure virtual]

Update the location of each node in the tissue given a vector of forces on nodes and a time step over which to integrate the equations of motion.

As this method is pure virtual, it must be overridden in subclasses.

Parameters:
rNodeForces forces on nodes
dt time step

Implemented in AbstractCellCentreBasedTissue< DIM >, MeshBasedTissueWithGhostNodes< DIM >, and MeshBasedTissueWithGhostNodes< 2 >.

template<unsigned DIM>
virtual double AbstractTissue< DIM >::GetDampingConstant ( unsigned  nodeIndex  )  [pure virtual]

Get the damping constant for this node - ie d in drdt = F/d.

As this method is pure virtual, it must be overridden in subclasses.

Parameters:
nodeIndex the global index of this node
Returns:
the damping constant at the node.

Implemented in AbstractCellCentreBasedTissue< DIM >, MeshBasedTissue< DIM >, and MeshBasedTissue< 2 >.

template<unsigned DIM>
virtual TissueCell* AbstractTissue< DIM >::AddCell ( TissueCell rNewCell,
c_vector< double, DIM >  newLocation,
TissueCell pParentCell = NULL 
) [pure virtual]

Add a new cell to the tissue.

As this method is pure virtual, it must be overridden in subclasses.

Parameters:
rNewCell the cell to add
newLocation the position in space at which to put it
pParentCell pointer 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).

Implemented in AbstractCellCentreBasedTissue< DIM >, MeshBasedTissue< DIM >, MeshBasedTissueWithGhostNodes< DIM >, MeshBasedTissue< 2 >, and MeshBasedTissueWithGhostNodes< 2 >.

template<unsigned DIM>
virtual unsigned AbstractTissue< DIM >::RemoveDeadCells (  )  [pure virtual]

Remove all cells labelled as dead.

As this method is pure virtual, it must be overridden in subclasses.

Returns:
number of cells removed

Implemented in MeshBasedTissue< DIM >, NodeBasedTissue< DIM >, and MeshBasedTissue< 2 >.

template<unsigned DIM>
virtual void AbstractTissue< DIM >::Update ( bool  hasHadBirthsOrDeaths = true  )  [pure virtual]

Remove the Nodes (for cell-centre) or VertexElements (for cell-vertex) which have been marked as deleted and update the correspondence with TissueCells.

Parameters:
hasHadBirthsOrDeaths - a bool saying whether tissue has had Births Or Deaths

Implemented in MeshBasedTissue< DIM >, NodeBasedTissue< DIM >, and MeshBasedTissue< 2 >.

template<unsigned DIM>
c_vector< unsigned, NUM_CELL_MUTATION_STATES > AbstractTissue< DIM >::GetCellMutationStateCount (  )  [inline]

Find out how many cells of each mutation state there are

Returns:
The number of cells of each mutation state (evaluated at each visualizer output) [0] = healthy count [1] = labelled cells [2] = APC one hit [3] = APC two hit [4] = beta catenin one hit

Definition at line 137 of file AbstractTissue.cpp.

References TissueConfig::Instance(), and AbstractTissue< DIM >::mCellMutationStateCount.

template<unsigned DIM>
c_vector< unsigned, NUM_CELL_TYPES > AbstractTissue< DIM >::GetCellTypeCount (  )  [inline]

Find out how many cells of each type there are

Returns:
The number of cells of each type (evaluated at each visualizer output) [0] = STEM [1] = TRANSIT [2] = DIFFERENTIATED [3] = APOPTOTIC

Definition at line 147 of file AbstractTissue.cpp.

References TissueConfig::Instance(), and AbstractTissue< DIM >::mCellTypeCount.

template<unsigned DIM>
c_vector< unsigned, 5 > AbstractTissue< DIM >::GetCellCyclePhaseCount (  )  [inline]

Find out how many cells in each cell cycle phase there are

Returns:
The number of cells of each phase (evaluated at each visualizer output) [0] = G_ZERO_PHASE [1] = G_ONE_PHASE [2] = S_PHASE [3] = G_TWO_PHASE [4] = M_PHASE

Definition at line 157 of file AbstractTissue.cpp.

References TissueConfig::Instance(), and AbstractTissue< DIM >::mCellCyclePhaseCount.

template<unsigned DIM>
bool AbstractTissue< DIM >::IsGhostNode ( unsigned  index  )  [inline, virtual]

Find if a given node is a ghost node. The abstract method always returns false but is overridden in subclasses.

Parameters:
index the global index of a specified node
Returns:
whether the node is a ghost node

Reimplemented in MeshBasedTissue< DIM >, MeshBasedTissueWithGhostNodes< DIM >, MeshBasedTissue< 2 >, and MeshBasedTissueWithGhostNodes< 2 >.

Definition at line 167 of file AbstractTissue.cpp.

Referenced by GeneralisedLinearSpringForce< DIM >::CalculateForceBetweenNodes(), and AbstractTissue< DIM >::GenerateCellResults().

template<unsigned DIM>
unsigned AbstractTissue< DIM >::GetNumRealCells (  )  [inline]

Get the number of real cells.

Definition at line 106 of file AbstractTissue.cpp.

References AbstractTissue< DIM >::Begin(), and AbstractTissue< DIM >::End().

template<unsigned DIM>
void AbstractTissue< DIM >::SetCellAncestorsToNodeIndices (  )  [inline]

Sets the Ancestor index of all the cells at this time to be the same as their node index, can be used to trace clonal populations.

Definition at line 117 of file AbstractTissue.cpp.

References AbstractTissue< DIM >::Begin(), AbstractTissue< DIM >::End(), and AbstractTissue< DIM >::mCellLocationMap.

template<unsigned DIM>
void AbstractTissue< DIM >::WriteCellIdDataToFile (  )  [inline]

template<unsigned DIM>
std::set< unsigned > AbstractTissue< DIM >::GetCellAncestors (  )  [inline]

Loops over cells and makes a list of the ancestors that are part of the tissue.

Returns:
remaining_ancestors The size of this set tells you how many clonal populations remain.

Definition at line 126 of file AbstractTissue.cpp.

References AbstractTissue< DIM >::Begin(), and AbstractTissue< DIM >::End().

template<unsigned DIM>
TissueCell & AbstractTissue< DIM >::rGetCellUsingLocationIndex ( unsigned  index  )  [inline]

Get the cell corresponding to a given location index.

Currently assumes there is one cell for each location index, and they are ordered identically in their vectors. An assertion fails if not.

Parameters:
index the location index
Returns:
the cell.

Definition at line 173 of file AbstractTissue.cpp.

References AbstractTissue< DIM >::mLocationCellMap.

Referenced by GeneralisedLinearSpringForce< DIM >::CalculateForceBetweenNodes(), MeshBasedTissue< DIM >::CheckTissueCellPointers(), AbstractCellCentreBasedTissue< DIM >::GetDampingConstant(), and LinearSpringWithVariableSpringConstantsForce< DIM >::VariableSpringConstantMultiplicationFactor().

template<unsigned DIM>
unsigned AbstractTissue< DIM >::GetLocationIndexUsingCell ( TissueCell pCell  )  [inline]

Get the location index corresponding to a given cell.

Currently assumes there is one cell for each location index, and they are ordered identically in their vectors. An assertion fails if not.

Parameters:
pCell the cell
Returns:
the location index.

Definition at line 186 of file AbstractTissue.cpp.

References AbstractTissue< DIM >::mCellLocationMap.

Referenced by CryptSimulation2d::ApplyTissueBoundaryConditions(), CryptSimulation2d::CalculateDividingCellCentreLocations(), AbstractTissue< DIM >::GenerateCellResultsAndWriteToFiles(), MeshBasedTissue< DIM >::Validate(), and CryptSimulation2d::WriteBetaCatenin().

template<unsigned DIM>
void AbstractTissue< DIM >::CreateOutputFiles ( const std::string &  rDirectory,
bool  cleanOutputDirectory 
) [inline, virtual]

Use an output file handler to create output files for visualizer and post-processing.

Parameters:
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 in MeshBasedTissue< DIM >, and MeshBasedTissue< 2 >.

Definition at line 198 of file AbstractTissue.cpp.

References TissueConfig::Instance(), AbstractTissue< DIM >::mpCellAgesFile, AbstractTissue< DIM >::mpCellAncestorsFile, AbstractTissue< DIM >::mpCellCyclePhasesFile, AbstractTissue< DIM >::mpCellIdFile, AbstractTissue< DIM >::mpCellMutationStatesFile, AbstractTissue< DIM >::mpCellTypesFile, AbstractTissue< DIM >::mpCellVariablesFile, AbstractTissue< DIM >::mpVizCellTypesFile, AbstractTissue< DIM >::mpVizNodesFile, and OutputFileHandler::OpenOutputFile().

Referenced by MeshBasedTissue< DIM >::CreateOutputFiles().

template<unsigned DIM>
void AbstractTissue< DIM >::WriteResultsToFiles (  )  [inline, virtual]

template<unsigned DIM>
void AbstractTissue< DIM >::WriteTimeAndNodeResultsToFiles ( std::vector< unsigned > &  rCellTypeCounter,
std::vector< unsigned > &  rCellMutationStateCounter,
std::vector< unsigned > &  rCellCyclePhaseCounter 
) [inline]

template<unsigned DIM>
void AbstractTissue< DIM >::GenerateCellResultsAndWriteToFiles ( std::vector< unsigned > &  rCellTypeCounter,
std::vector< unsigned > &  rCellMutationStateCounter,
std::vector< unsigned > &  rCellCyclePhaseCounter 
) [inline, virtual]

Call GenerateCellResults() on each cell then call WriteCellResultsToFiles().

Parameters:
rCellTypeCounter cell type counter
rCellMutationStateCounter cell mutation state counter
rCellCyclePhaseCounter cell cycle phase counter

Reimplemented in MeshBasedTissueWithGhostNodes< DIM >, and MeshBasedTissueWithGhostNodes< 2 >.

Definition at line 433 of file AbstractTissue.cpp.

References AbstractTissue< DIM >::Begin(), AbstractTissue< DIM >::End(), AbstractTissue< DIM >::GenerateCellResults(), AbstractTissue< DIM >::GetLocationIndexUsingCell(), and AbstractTissue< DIM >::WriteCellResultsToFiles().

Referenced by AbstractTissue< DIM >::WriteResultsToFiles().

template<unsigned DIM>
void AbstractTissue< DIM >::GenerateCellResults ( unsigned  locationIndex,
std::vector< unsigned > &  rCellTypeCounter,
std::vector< unsigned > &  rCellMutationStateCounter,
std::vector< unsigned > &  rCellCyclePhaseCounter 
) [inline]

template<unsigned DIM>
void AbstractTissue< DIM >::WriteCellResultsToFiles ( std::vector< unsigned > &  rCellTypeCounter,
std::vector< unsigned > &  rCellMutationStateCounter,
std::vector< unsigned > &  rCellCyclePhaseCounter 
) [inline]

template<unsigned DIM>
void AbstractTissue< DIM >::CloseOutputFiles (  )  [inline, virtual]

template<unsigned DIM>
AbstractTissue< DIM >::Iterator AbstractTissue< DIM >::Begin (  )  [inline]

template<unsigned DIM>
AbstractTissue< DIM >::Iterator AbstractTissue< DIM >::End (  )  [inline]


Friends And Related Function Documentation

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


Member Data Documentation

template<unsigned DIM>
std::list<TissueCell> AbstractTissue< DIM >::mCells [protected]

template<unsigned DIM>
std::map<unsigned, TissueCell*> AbstractTissue< DIM >::mLocationCellMap [protected]

template<unsigned DIM>
std::map<TissueCell*, unsigned> AbstractTissue< DIM >::mCellLocationMap [protected]

template<unsigned DIM>
c_vector<unsigned, NUM_CELL_MUTATION_STATES> AbstractTissue< DIM >::mCellMutationStateCount [protected]

template<unsigned DIM>
c_vector<unsigned, NUM_CELL_TYPES> AbstractTissue< DIM >::mCellTypeCount [protected]

template<unsigned DIM>
c_vector<unsigned, 5> AbstractTissue< DIM >::mCellCyclePhaseCount [protected]

template<unsigned DIM>
out_stream AbstractTissue< DIM >::mpVizNodesFile [protected]

template<unsigned DIM>
out_stream AbstractTissue< DIM >::mpVizCellTypesFile [protected]

template<unsigned DIM>
out_stream AbstractTissue< DIM >::mpCellMutationStatesFile [protected]

template<unsigned DIM>
out_stream AbstractTissue< DIM >::mpCellAncestorsFile [protected]

template<unsigned DIM>
out_stream AbstractTissue< DIM >::mpCellTypesFile [protected]

template<unsigned DIM>
out_stream AbstractTissue< DIM >::mpCellCyclePhasesFile [protected]

template<unsigned DIM>
out_stream AbstractTissue< DIM >::mpCellVariablesFile [protected]

template<unsigned DIM>
out_stream AbstractTissue< DIM >::mpCellAgesFile [protected]

template<unsigned DIM>
out_stream AbstractTissue< DIM >::mpCellIdFile [protected]

template<unsigned DIM>
bool AbstractTissue< DIM >::mTissueContainsMesh [protected]

Whether the tissue contains a mesh

Definition at line 118 of file AbstractTissue.hpp.

Referenced by AbstractTissue< DIM >::HasMesh(), MeshBasedTissue< DIM >::MeshBasedTissue(), and AbstractTissue< SPACE_DIM >::serialize().


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

Generated on Tue Aug 4 16:10:48 2009 for Chaste by  doxygen 1.5.5