#include <CellwiseData.hpp>
Public Member Functions | |
virtual | ~CellwiseData () |
double | GetValue (CellPtr pCell, unsigned variableNumber=0) |
void | SetValue (double value, unsigned locationIndex, unsigned variableNumber=0) |
void | SetCellPopulation (AbstractCellPopulation< DIM > *pCellPopulation) |
AbstractCellPopulation< DIM > & | rGetCellPopulation () |
void | SetNumCellsAndVars (unsigned numCells, unsigned numVars) |
void | SetConstantDataForTesting (std::vector< double > &rValues) |
bool | IsSetUp () |
void | ReallocateMemory () |
unsigned | GetNumVariables () |
Static Public Member Functions | |
static CellwiseData * | Instance () |
static void | Destroy () |
Protected Member Functions | |
CellwiseData () | |
Private Member Functions | |
template<class Archive> | |
void | serialize (Archive &archive, const unsigned int version) |
Private Attributes | |
AbstractCellPopulation< DIM > * | mpCellPopulation |
bool | mAllocatedMemory |
unsigned | mNumberOfVariables |
std::vector< double > | mData |
std::vector< double > | mConstantDataForTesting |
bool | mUseConstantDataForTesting |
Static Private Attributes | |
static CellwiseData * | mpInstance = NULL |
Friends | |
class | TestCellwiseData |
class | boost::serialization::access |
Definition at line 43 of file CellwiseData.hpp.
CellwiseData< DIM >::CellwiseData | ( | ) | [inline, protected] |
Protected constuctor. Not to be called, use Instance() instead.
Definition at line 48 of file CellwiseData.cpp.
References CellwiseData< DIM >::mpInstance.
CellwiseData< DIM >::~CellwiseData | ( | ) | [inline, virtual] |
Destructor.
Definition at line 60 of file CellwiseData.cpp.
void CellwiseData< DIM >::serialize | ( | Archive & | archive, | |
const unsigned int | version | |||
) | [inline, private] |
Archive the object and its member variables.
archive | the archive | |
version | the current version of this class |
Definition at line 79 of file CellwiseData.hpp.
References CellwiseData< DIM >::mAllocatedMemory, CellwiseData< DIM >::mConstantDataForTesting, CellwiseData< DIM >::mData, CellwiseData< DIM >::mNumberOfVariables, CellwiseData< DIM >::mpCellPopulation, and CellwiseData< DIM >::mUseConstantDataForTesting.
CellwiseData< DIM > * CellwiseData< DIM >::Instance | ( | ) | [inline, static] |
Get an instance of the object
Definition at line 37 of file CellwiseData.cpp.
References CellwiseData< DIM >::mpInstance.
Referenced by ChemotacticForce< DIM >::AddForceContribution(), Alarcon2004OxygenBasedCellCycleModel::AdjustOdeParameters(), CellBasedSimulationArchiver< DIM, SIM >::Load(), CellBasedSimulationArchiver< DIM, SIM >::Save(), CellwiseDataGradient< DIM >::SetupGradients(), CellBasedSimulationWithPdes< DIM >::SolvePde(), CellBasedSimulationWithPdes< DIM >::SolvePdeUsingCoarseMesh(), SimpleOxygenBasedCellCycleModel::UpdateCellCyclePhase(), SimpleOxygenBasedCellCycleModel::UpdateHypoxicDuration(), CellBasedSimulationWithPdes< DIM >::WriteAverageRadialPdeSolution(), CellBasedSimulationWithPdes< DIM >::WritePdeSolution(), VertexBasedCellPopulation< DIM >::WriteVtkResultsToFile(), NodeBasedCellPopulation< DIM >::WriteVtkResultsToFile(), MeshBasedCellPopulationWithGhostNodes< DIM >::WriteVtkResultsToFile(), and MeshBasedCellPopulation< DIM >::WriteVtkResultsToFile().
void CellwiseData< DIM >::Destroy | ( | ) | [inline, static] |
Destroy the current instance. Should be called at the end of a simulation.
Definition at line 66 of file CellwiseData.cpp.
References CellwiseData< DIM >::mpInstance.
double CellwiseData< DIM >::GetValue | ( | CellPtr | pCell, | |
unsigned | variableNumber = 0 | |||
) | [inline] |
Get the value of CellwiseData for a given cell and variable number.
pCell | the cell | |
variableNumber | the index of CellwiseData whose value is required (defaults to zero) |
Definition at line 77 of file CellwiseData.cpp.
References EXCEPTION, CellwiseData< DIM >::IsSetUp(), CellwiseData< DIM >::mAllocatedMemory, CellwiseData< DIM >::mConstantDataForTesting, CellwiseData< DIM >::mData, CellwiseData< DIM >::mNumberOfVariables, CellwiseData< DIM >::mpCellPopulation, and CellwiseData< DIM >::mUseConstantDataForTesting.
Referenced by ChemotacticForce< DIM >::AddForceContribution(), Alarcon2004OxygenBasedCellCycleModel::AdjustOdeParameters(), CellwiseDataGradient< DIM >::SetupGradients(), SimpleOxygenBasedCellCycleModel::UpdateCellCyclePhase(), SimpleOxygenBasedCellCycleModel::UpdateHypoxicDuration(), CellBasedSimulationWithPdes< DIM >::WriteAverageRadialPdeSolution(), CellBasedSimulationWithPdes< DIM >::WritePdeSolution(), VertexBasedCellPopulation< DIM >::WriteVtkResultsToFile(), NodeBasedCellPopulation< DIM >::WriteVtkResultsToFile(), MeshBasedCellPopulationWithGhostNodes< DIM >::WriteVtkResultsToFile(), and MeshBasedCellPopulation< DIM >::WriteVtkResultsToFile().
void CellwiseData< DIM >::SetValue | ( | double | value, | |
unsigned | locationIndex, | |||
unsigned | variableNumber = 0 | |||
) | [inline] |
Set the value for a given location index and variable number.
value | the value to set | |
locationIndex | the location index | |
variableNumber | the index of CellwiseData whose value is set (defaults to zero) |
Definition at line 101 of file CellwiseData.cpp.
References EXCEPTION, CellwiseData< DIM >::IsSetUp(), CellwiseData< DIM >::mData, and CellwiseData< DIM >::mNumberOfVariables.
Referenced by CellBasedSimulationWithPdes< DIM >::SolvePde(), and CellBasedSimulationWithPdes< DIM >::SolvePdeUsingCoarseMesh().
void CellwiseData< DIM >::SetCellPopulation | ( | AbstractCellPopulation< DIM > * | pCellPopulation | ) | [inline] |
Set the CellPopulation. Must be called before GetValue().
pCellPopulation | pointer to the CellPopulation |
Definition at line 115 of file CellwiseData.cpp.
References EXCEPTION, CellwiseData< DIM >::mAllocatedMemory, and CellwiseData< DIM >::mpCellPopulation.
AbstractCellPopulation< DIM > & CellwiseData< DIM >::rGetCellPopulation | ( | ) | [inline] |
Definition at line 127 of file CellwiseData.cpp.
References CellwiseData< DIM >::mpCellPopulation.
Referenced by CellwiseDataGradient< DIM >::SetupGradients().
void CellwiseData< DIM >::SetNumCellsAndVars | ( | unsigned | numCells, | |
unsigned | numVars | |||
) | [inline] |
Set the number of cells and number of variables to be stored per cell. The constructor assumes 1 variable so this method only really needs to be called if numVars > 1.
numCells | number of cells in the cell population | |
numVars | number of variables |
Definition at line 134 of file CellwiseData.cpp.
References EXCEPTION, CellwiseData< DIM >::mAllocatedMemory, CellwiseData< DIM >::mData, CellwiseData< DIM >::mNumberOfVariables, and CellwiseData< DIM >::mpCellPopulation.
void CellwiseData< DIM >::SetConstantDataForTesting | ( | std::vector< double > & | rValues | ) | [inline] |
Force the data to return given values for all cells (only for testing).
rValues | vector of CellwiseData values |
Definition at line 175 of file CellwiseData.cpp.
References CellwiseData< DIM >::mConstantDataForTesting, CellwiseData< DIM >::mNumberOfVariables, and CellwiseData< DIM >::mUseConstantDataForTesting.
bool CellwiseData< DIM >::IsSetUp | ( | ) | [inline] |
Is the instance in existence and fully set up
Definition at line 153 of file CellwiseData.cpp.
References CellwiseData< DIM >::mAllocatedMemory, CellwiseData< DIM >::mpCellPopulation, and CellwiseData< DIM >::mpInstance.
Referenced by CellwiseData< DIM >::GetValue(), CellBasedSimulationArchiver< DIM, SIM >::Save(), and CellwiseData< DIM >::SetValue().
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 CellPopulation member variable
Definition at line 160 of file CellwiseData.cpp.
References CellwiseData< DIM >::mAllocatedMemory, CellwiseData< DIM >::mData, CellwiseData< DIM >::mNumberOfVariables, and CellwiseData< DIM >::mpCellPopulation.
Referenced by CellBasedSimulationWithPdes< DIM >::SolvePde(), and CellBasedSimulationWithPdes< DIM >::SolvePdeUsingCoarseMesh().
unsigned CellwiseData< DIM >::GetNumVariables | ( | ) | [inline] |
Definition at line 184 of file CellwiseData.cpp.
References CellwiseData< DIM >::mNumberOfVariables.
Referenced by VertexBasedCellPopulation< DIM >::WriteVtkResultsToFile(), NodeBasedCellPopulation< DIM >::WriteVtkResultsToFile(), MeshBasedCellPopulationWithGhostNodes< DIM >::WriteVtkResultsToFile(), and MeshBasedCellPopulation< DIM >::WriteVtkResultsToFile().
friend class boost::serialization::access [friend] |
Needed for serialization.
Definition at line 71 of file CellwiseData.hpp.
CellwiseData< DIM > * CellwiseData< DIM >::mpInstance = NULL [inline, static, private] |
The single instance of the singleton object
Definition at line 50 of file CellwiseData.hpp.
Referenced by CellwiseData< DIM >::CellwiseData(), CellwiseData< DIM >::Destroy(), CellwiseData< DIM >::Instance(), and CellwiseData< DIM >::IsSetUp().
AbstractCellPopulation<DIM>* CellwiseData< DIM >::mpCellPopulation [private] |
A pointer to a CellPopulation so a cell's node can be found
Definition at line 53 of file CellwiseData.hpp.
Referenced by CellwiseData< DIM >::GetValue(), CellwiseData< DIM >::IsSetUp(), CellwiseData< DIM >::ReallocateMemory(), CellwiseData< DIM >::rGetCellPopulation(), CellwiseData< DIM >::serialize(), CellwiseData< DIM >::SetCellPopulation(), and CellwiseData< DIM >::SetNumCellsAndVars().
bool CellwiseData< DIM >::mAllocatedMemory [private] |
Allocated memory for mData object
Definition at line 56 of file CellwiseData.hpp.
Referenced by CellwiseData< DIM >::GetValue(), CellwiseData< DIM >::IsSetUp(), CellwiseData< DIM >::ReallocateMemory(), CellwiseData< DIM >::serialize(), CellwiseData< DIM >::SetCellPopulation(), and CellwiseData< DIM >::SetNumCellsAndVars().
unsigned CellwiseData< DIM >::mNumberOfVariables [private] |
Number of variables per node to be stored
Definition at line 59 of file CellwiseData.hpp.
Referenced by CellwiseData< DIM >::GetNumVariables(), CellwiseData< DIM >::GetValue(), CellwiseData< DIM >::ReallocateMemory(), CellwiseData< DIM >::serialize(), CellwiseData< DIM >::SetConstantDataForTesting(), CellwiseData< DIM >::SetNumCellsAndVars(), and CellwiseData< DIM >::SetValue().
std::vector<double> CellwiseData< DIM >::mData [private] |
Store of the data
Definition at line 62 of file CellwiseData.hpp.
Referenced by CellwiseData< DIM >::GetValue(), CellwiseData< DIM >::ReallocateMemory(), CellwiseData< DIM >::serialize(), CellwiseData< DIM >::SetNumCellsAndVars(), and CellwiseData< DIM >::SetValue().
std::vector<double> CellwiseData< DIM >::mConstantDataForTesting [private] |
Helper member storing constant data. Used in tests.
Definition at line 65 of file CellwiseData.hpp.
Referenced by CellwiseData< DIM >::GetValue(), CellwiseData< DIM >::serialize(), and CellwiseData< DIM >::SetConstantDataForTesting().
bool CellwiseData< DIM >::mUseConstantDataForTesting [private] |
Helper member storing whether mConstantDataForTesting is used.
Definition at line 68 of file CellwiseData.hpp.
Referenced by CellwiseData< DIM >::GetValue(), CellwiseData< DIM >::serialize(), and CellwiseData< DIM >::SetConstantDataForTesting().