CellwiseData< DIM > Class Template Reference

#include <CellwiseData.hpp>

Collaboration diagram for CellwiseData< DIM >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual ~CellwiseData ()
double GetValue (TissueCell *pCell, unsigned variableNumber=0)
void SetValue (double value, Node< DIM > *pNode, unsigned variableNumber=0)
void SetTissue (MeshBasedTissue< DIM > &rTissue)
MeshBasedTissue< DIM > & rGetTissue ()
void SetNumNodesAndVars (unsigned numNodes, unsigned numVars)
void SetConstantDataForTesting (std::vector< double > values)
bool IsSetUp ()
void ReallocateMemory ()

Static Public Member Functions

static CellwiseDataInstance ()
static void Destroy ()

Protected Member Functions

 CellwiseData ()

Private Member Functions

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

Private Attributes

MeshBasedTissue< DIM > * mpTissue
bool mAllocatedMemory
unsigned mNumberOfVariables
std::vector< double > mData
std::vector< double > mConstantDataForTesting
bool mUseConstantDataForTesting

Static Private Attributes

static CellwiseDatampInstance = NULL

Friends

class TestCellwiseData
class boost::serialization::access


Detailed Description

template<unsigned DIM>
class CellwiseData< DIM >

A singleton object for storing data that certain cell cycle models need to know about, e.g. nutrient concentrations computed via some PDE for use in nutrient based cell cycle models.

Definition at line 44 of file CellwiseData.hpp.


Constructor & Destructor Documentation

template<unsigned DIM>
CellwiseData< DIM >::CellwiseData (  )  [inline, protected]

Protected constuctor. Not to be called, use Instance() instead.

Definition at line 51 of file CellwiseData.cpp.

References CellwiseData< DIM >::mpInstance.

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

Destructor.

Definition at line 63 of file CellwiseData.cpp.


Member Function Documentation

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

Archive the object and its member variables.

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

Definition at line 80 of file CellwiseData.hpp.

References CellwiseData< DIM >::mAllocatedMemory, CellwiseData< DIM >::mConstantDataForTesting, CellwiseData< DIM >::mData, CellwiseData< DIM >::mNumberOfVariables, CellwiseData< DIM >::mpTissue, and CellwiseData< DIM >::mUseConstantDataForTesting.

template<unsigned DIM>
CellwiseData< DIM > * CellwiseData< DIM >::Instance (  )  [inline, static]

Get an instance of the object

Definition at line 40 of file CellwiseData.cpp.

References CellwiseData< DIM >::mpInstance.

Referenced by TissueSimulationArchiver< DIM, SIM >::Load(), and TissueSimulationArchiver< DIM, SIM >::Save().

template<unsigned DIM>
void CellwiseData< DIM >::Destroy (  )  [inline, static]

Destroy the current instance. Should be called at the end of a simulation.

Definition at line 69 of file CellwiseData.cpp.

References CellwiseData< DIM >::mpInstance.

template<unsigned DIM>
double CellwiseData< DIM >::GetValue ( TissueCell pCell,
unsigned  variableNumber = 0 
) [inline]

Get the value of CellwiseData for a given cell and variable number.

Parameters:
pCell pointer to a TissueCell
variableNumber the index of CellwiseData whose value is required (defaults to zero)
Returns:
the value of CellwiseData.

Definition at line 79 of file CellwiseData.cpp.

References CellwiseData< DIM >::IsSetUp(), CellwiseData< DIM >::mAllocatedMemory, CellwiseData< DIM >::mConstantDataForTesting, CellwiseData< DIM >::mData, CellwiseData< DIM >::mNumberOfVariables, CellwiseData< DIM >::mpTissue, and CellwiseData< DIM >::mUseConstantDataForTesting.

template<unsigned DIM>
void CellwiseData< DIM >::SetValue ( double  value,
Node< DIM > *  pNode,
unsigned  variableNumber = 0 
) [inline]

Set the value for a given node and variable number.

Parameters:
value the value to set
pNode pointer to the Node
variableNumber the index of CellwiseData whose value is set (defaults to zero)

Definition at line 99 of file CellwiseData.cpp.

References Node< SPACE_DIM >::GetIndex(), CellwiseData< DIM >::IsSetUp(), CellwiseData< DIM >::mData, and CellwiseData< DIM >::mNumberOfVariables.

template<unsigned DIM>
void CellwiseData< DIM >::SetTissue ( MeshBasedTissue< DIM > &  rTissue  )  [inline]

Set the Tissue. Must be called before GetValue().

Parameters:
rTissue reference to the Tissue

Definition at line 108 of file CellwiseData.cpp.

References CellwiseData< DIM >::mAllocatedMemory, and CellwiseData< DIM >::mpTissue.

template<unsigned DIM>
MeshBasedTissue< DIM > & CellwiseData< DIM >::rGetTissue (  )  [inline]

Returns:
reference to the Tissue.

Definition at line 119 of file CellwiseData.cpp.

References CellwiseData< DIM >::mpTissue.

template<unsigned DIM>
void CellwiseData< DIM >::SetNumNodesAndVars ( unsigned  numNodes,
unsigned  numVars 
) [inline]

Set the number of variables to be stored per cell. The constructor assumes 1 variable so only really needs to be called if numVars > 1.

Parameters:
numNodes number of nodes in the tissue
numVars number of variables

Definition at line 126 of file CellwiseData.cpp.

References CellwiseData< DIM >::mAllocatedMemory, CellwiseData< DIM >::mData, CellwiseData< DIM >::mNumberOfVariables, and CellwiseData< DIM >::mpTissue.

template<unsigned DIM>
void CellwiseData< DIM >::SetConstantDataForTesting ( std::vector< double >  values  )  [inline]

Force the data to return given values for all cells (only for testing).

Parameters:
values vector of CellwiseData values

Definition at line 164 of file CellwiseData.cpp.

References CellwiseData< DIM >::mConstantDataForTesting, and CellwiseData< DIM >::mUseConstantDataForTesting.

template<unsigned DIM>
bool CellwiseData< DIM >::IsSetUp (  )  [inline]

template<unsigned DIM>
void CellwiseData< DIM >::ReallocateMemory (  )  [inline]

Reallocate size of mData. Needed because of growth/death. Reallocates according to the number of nodes in the mesh in the Tissue member variable

Definition at line 150 of file CellwiseData.cpp.

References CellwiseData< DIM >::mAllocatedMemory, CellwiseData< DIM >::mData, CellwiseData< DIM >::mNumberOfVariables, and CellwiseData< DIM >::mpTissue.


Friends And Related Function Documentation

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

Needed for serialization.

Definition at line 72 of file CellwiseData.hpp.


Member Data Documentation

template<unsigned DIM>
CellwiseData< DIM > * CellwiseData< DIM >::mpInstance = NULL [inline, static, private]

The single instance of the singleton object

Pointer to the single instance

Definition at line 51 of file CellwiseData.hpp.

Referenced by CellwiseData< DIM >::CellwiseData(), CellwiseData< DIM >::Destroy(), CellwiseData< DIM >::Instance(), and CellwiseData< DIM >::IsSetUp().

template<unsigned DIM>
MeshBasedTissue<DIM>* CellwiseData< DIM >::mpTissue [private]

template<unsigned DIM>
bool CellwiseData< DIM >::mAllocatedMemory [private]

template<unsigned DIM>
unsigned CellwiseData< DIM >::mNumberOfVariables [private]

template<unsigned DIM>
std::vector<double> CellwiseData< DIM >::mData [private]

template<unsigned DIM>
std::vector<double> CellwiseData< DIM >::mConstantDataForTesting [private]

Helper member storing constant data. Used in tests.

Definition at line 66 of file CellwiseData.hpp.

Referenced by CellwiseData< DIM >::GetValue(), CellwiseData< DIM >::serialize(), and CellwiseData< DIM >::SetConstantDataForTesting().

template<unsigned DIM>
bool CellwiseData< DIM >::mUseConstantDataForTesting [private]

Helper member storing whether mConstantDataForTesting is used.

Definition at line 69 of file CellwiseData.hpp.

Referenced by CellwiseData< DIM >::GetValue(), CellwiseData< DIM >::serialize(), and CellwiseData< DIM >::SetConstantDataForTesting().


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

Generated on Tue Aug 4 16:11:06 2009 for Chaste by  doxygen 1.5.5