Chaste Commit::baa90ac2819b962188b7562f2326be23c47859a7
ContactInhibitionCellCycleModel.cpp
1/*
2
3Copyright (c) 2005-2024, University of Oxford.
4All rights reserved.
5
6University of Oxford means the Chancellor, Masters and Scholars of the
7University of Oxford, having an administrative office at Wellington
8Square, Oxford OX1 2JD, UK.
9
10This file is part of Chaste.
11
12Redistribution and use in source and binary forms, with or without
13modification, are permitted provided that the following conditions are met:
14 * Redistributions of source code must retain the above copyright notice,
15 this list of conditions and the following disclaimer.
16 * Redistributions in binary form must reproduce the above copyright notice,
17 this list of conditions and the following disclaimer in the documentation
18 and/or other materials provided with the distribution.
19 * Neither the name of the University of Oxford nor the names of its
20 contributors may be used to endorse or promote products derived from this
21 software without specific prior written permission.
22
23THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
29GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
32OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
34*/
35
36#include "ContactInhibitionCellCycleModel.hpp"
37#include "CellLabel.hpp"
38#include "DifferentiatedCellProliferativeType.hpp"
39
42 mQuiescentVolumeFraction(DOUBLE_UNSET),
43 mEquilibriumVolume(DOUBLE_UNSET),
44 mCurrentQuiescentOnsetTime(SimulationTime::Instance()->GetTime()),
45 mCurrentQuiescentDuration(0.0)
46{
47}
48
51 mQuiescentVolumeFraction(rModel.mQuiescentVolumeFraction),
52 mEquilibriumVolume(rModel.mEquilibriumVolume),
53 mCurrentQuiescentOnsetTime(rModel.mCurrentQuiescentOnsetTime),
54 mCurrentQuiescentDuration(rModel.mCurrentQuiescentDuration)
55{
56 /*
57 * Initialize only those member variables defined in this class.
58 *
59 * The member variables mCurrentCellCyclePhase, mG1Duration,
60 * mMinimumGapDuration, mStemCellG1Duration, mTransitCellG1Duration,
61 * mSDuration, mG2Duration and mMDuration are initialized in the
62 * AbstractPhaseBasedCellCycleModel constructor.
63 *
64 * The member variables mBirthTime, mReadyToDivide and mDimension
65 * are initialized in the AbstractCellCycleModel constructor.
66 *
67 * Note that mG1Duration is (re)set as soon as InitialiseDaughterCell()
68 * is called on the new cell-cycle model.
69 */
70}
71
73{
75 {
76 EXCEPTION("The member variables mQuiescentVolumeFraction and mEquilibriumVolume have not yet been set.");
77 }
78
79 // Get cell volume
80 double cell_volume = mpCell->GetCellData()->GetItem("volume");
81
82 // Removes the cell label
83 mpCell->RemoveCellProperty<CellLabel>();
84
85 if (mCurrentCellCyclePhase == G_ONE_PHASE)
86 {
87 // Update G1 duration based on cell volume
89 double quiescent_volume = mEquilibriumVolume * mQuiescentVolumeFraction;
90
91 if (cell_volume < quiescent_volume)
92 {
93 // Update the duration of the current period of contact inhibition.
95 mG1Duration += dt;
96
97 /*
98 * This method is usually called within a CellBasedSimulation, after the CellPopulation
99 * has called CellPropertyRegistry::TakeOwnership(). This means that were we to call
100 * CellPropertyRegistry::Instance() here when adding the CellLabel, we would be creating
101 * a new CellPropertyRegistry. In this case the CellLabel's cell count would be incorrect.
102 * We must therefore access the CellLabel via the cell's CellPropertyCollection.
103 */
104 boost::shared_ptr<AbstractCellProperty> p_label =
105 mpCell->rGetCellPropertyCollection().GetCellPropertyRegistry()->Get<CellLabel>();
106 mpCell->AddCellProperty(p_label);
107 }
108 else
109 {
110 // Reset the cell's quiescent duration and update the time at which the onset of quiescent occurs
113 }
114 }
115
116 double time_since_birth = GetAge();
117 assert(time_since_birth >= 0);
118
119 if (mpCell->GetCellProliferativeType()->IsType<DifferentiatedCellProliferativeType>())
120 {
121 mCurrentCellCyclePhase = G_ZERO_PHASE;
122 }
123 else if (time_since_birth < GetMDuration())
124 {
125 mCurrentCellCyclePhase = M_PHASE;
126 }
127 else if (time_since_birth < GetMDuration() + mG1Duration)
128 {
129 mCurrentCellCyclePhase = G_ONE_PHASE;
130 }
131 else if (time_since_birth < GetMDuration() + mG1Duration + GetSDuration())
132 {
133 mCurrentCellCyclePhase = S_PHASE;
134 }
135 else if (time_since_birth < GetMDuration() + mG1Duration + GetSDuration() + GetG2Duration())
136 {
137 mCurrentCellCyclePhase = G_TWO_PHASE;
138 }
139}
140
145
147{
148 mQuiescentVolumeFraction = quiescentVolumeFraction;
149}
150
155
157{
158 mEquilibriumVolume = equilibriumVolume;
159}
160
165
170
175
177{
178 *rParamsFile << "\t\t\t<QuiescentVolumeFraction>" << mQuiescentVolumeFraction << "</QuiescentVolumeFraction>\n";
179 *rParamsFile << "\t\t\t<EquilibriumVolume>" << mEquilibriumVolume << "</EquilibriumVolume>\n";
180
181 // Call method on direct parent class
183}
184
185// Serialization for Boost >= 1.36
const double DOUBLE_UNSET
Definition Exception.hpp:57
#define EXCEPTION(message)
#define CHASTE_CLASS_EXPORT(T)
virtual void OutputCellCycleModelParameters(out_stream &rParamsFile)
virtual void OutputCellCycleModelParameters(out_stream &rParamsFile)
void SetEquilibriumVolume(double equilibriumVolume)
void SetQuiescentVolumeFraction(double quiescentVolumeFraction)
double GetTime() const
double GetTimeStep() const
static SimulationTime * Instance()