36 #include "LinearSpringWithVariableSpringConstantsForce.hpp"
37 #include "MeshBasedCellPopulation.hpp"
38 #include "VanLeeuwen2009WntSwatCellCycleModelHypothesisOne.hpp"
39 #include "VanLeeuwen2009WntSwatCellCycleModelHypothesisTwo.hpp"
40 #include "ApoptoticCellProperty.hpp"
42 template<
unsigned DIM>
45 mUseEdgeBasedSpringConstant(false),
46 mUseMutantSprings(false),
49 mUseBCatSprings(false),
50 mUseApoptoticSprings(false),
51 mBetaCatSpringScaler(18.14/6.0),
52 mApoptoticSpringTensionStiffness(15.0*0.25),
53 mApoptoticSpringCompressionStiffness(15.0*0.75)
57 template<
unsigned DIM>
62 template<
unsigned DIM>
66 mUseEdgeBasedSpringConstant = useEdgeBasedSpringConstant;
69 template<
unsigned DIM>
72 mUseMutantSprings = useMutantSprings;
73 mMutantMutantMultiplier = mutantMutantMultiplier;
74 mNormalMutantMultiplier = normalMutantMultiplier;
77 template<
unsigned DIM>
80 mUseBCatSprings = useBCatSprings;
83 template<
unsigned DIM>
86 mUseApoptoticSprings = useApoptoticSprings;
89 template<
unsigned DIM>
91 unsigned nodeAGlobalIndex,
92 unsigned nodeBGlobalIndex,
94 bool isCloserThanRestLength)
100 isCloserThanRestLength);
110 if (mUseEdgeBasedSpringConstant)
113 assert(!mUseBCatSprings);
115 multiplication_factor = (
static_cast<MeshBasedCellPopulation<DIM>*
>(&rCellPopulation))->GetVoronoiEdgeLength(nodeAGlobalIndex, nodeBGlobalIndex)*sqrt(3.0);
118 if (mUseMutantSprings)
120 unsigned number_of_mutants = 0;
134 switch (number_of_mutants)
138 multiplication_factor *= mNormalMutantMultiplier;
143 multiplication_factor *= mMutantMutantMultiplier;
162 assert(!mUseEdgeBasedSpringConstant);
170 double edge_length_between_1_and_2 = p_static_cast_cell_population->
GetVoronoiEdgeLength(nodeAGlobalIndex, nodeBGlobalIndex);
172 double beta_cat_on_cell_1_edge = beta_cat_cell_1 * edge_length_between_1_and_2 / perim_cell_1;
173 double beta_cat_on_cell_2_edge = beta_cat_cell_2 * edge_length_between_1_and_2 / perim_cell_2;
175 double min_beta_Cat_of_two_cells = std::min(beta_cat_on_cell_1_edge, beta_cat_on_cell_2_edge);
177 multiplication_factor *= min_beta_Cat_of_two_cells / mBetaCatSpringScaler;
180 if (mUseApoptoticSprings)
185 if (cell_A_is_apoptotic || cell_B_is_apoptotic)
187 double spring_a_stiffness = 2.0 * this->GetMeinekeSpringStiffness();
188 double spring_b_stiffness = 2.0 * this->GetMeinekeSpringStiffness();
190 if (cell_A_is_apoptotic)
192 if (!isCloserThanRestLength)
194 spring_a_stiffness = mApoptoticSpringTensionStiffness;
198 spring_a_stiffness = mApoptoticSpringCompressionStiffness;
201 if (cell_B_is_apoptotic)
203 if (!isCloserThanRestLength)
205 spring_b_stiffness = mApoptoticSpringTensionStiffness;
209 spring_b_stiffness = mApoptoticSpringCompressionStiffness;
213 multiplication_factor /= (1.0/spring_a_stiffness + 1.0/spring_b_stiffness)*this->GetMeinekeSpringStiffness();
217 return multiplication_factor;
220 template<
unsigned DIM>
226 EXCEPTION(
"LinearSpringWithVariableSpringConstantsForce is to be used with a subclass of MeshBasedCellPopulation only");
232 spring_iterator != p_static_cast_cell_population->
SpringsEnd();
235 unsigned nodeA_global_index = spring_iterator.GetNodeA()->GetIndex();
236 unsigned nodeB_global_index = spring_iterator.GetNodeB()->GetIndex();
238 c_vector<double, DIM> force = this->CalculateForceBetweenNodes(nodeA_global_index, nodeB_global_index, rCellPopulation);
239 c_vector<double, DIM> negative_force = -1.0*force;
241 spring_iterator.GetNodeB()->AddAppliedForceContribution(negative_force);
242 spring_iterator.GetNodeA()->AddAppliedForceContribution(force);
246 template<
unsigned DIM>
249 return mBetaCatSpringScaler;
252 template<
unsigned DIM>
255 assert(betaCatSpringScaler > 0.0);
256 mBetaCatSpringScaler = betaCatSpringScaler;
259 template<
unsigned DIM>
262 return mApoptoticSpringTensionStiffness;
265 template<
unsigned DIM>
268 assert(apoptoticSpringTensionStiffness >= 0.0);
269 mApoptoticSpringTensionStiffness = apoptoticSpringTensionStiffness;
272 template<
unsigned DIM>
275 return mApoptoticSpringCompressionStiffness;
278 template<
unsigned DIM>
281 assert(apoptoticSpringCompressionStiffness >= 0.0);
282 mApoptoticSpringCompressionStiffness = apoptoticSpringCompressionStiffness;
285 template<
unsigned DIM>
288 *rParamsFile <<
"\t\t\t<UseEdgeBasedSpringConstant>" << mUseEdgeBasedSpringConstant <<
"</UseEdgeBasedSpringConstant>\n";
289 *rParamsFile <<
"\t\t\t<UseMutantSprings>" << mUseMutantSprings <<
"</UseMutantSprings>\n";
290 *rParamsFile <<
"\t\t\t<MutantMutantMultiplier>" << mMutantMutantMultiplier <<
"</MutantMutantMultiplier>\n";
291 *rParamsFile <<
"\t\t\t<NormalMutantMultiplier>" << mNormalMutantMultiplier <<
"</NormalMutantMultiplier>\n";
292 *rParamsFile <<
"\t\t\t<UseBCatSprings>" << mUseBCatSprings <<
"</UseBCatSprings>\n";
293 *rParamsFile <<
"\t\t\t<UseApoptoticSprings>" << mUseApoptoticSprings <<
"</UseApoptoticSprings>\n";
294 *rParamsFile <<
"\t\t\t<BetaCatSpringScaler>" << mBetaCatSpringScaler <<
"</BetaCatSpringScaler>\n";
295 *rParamsFile <<
"\t\t\t<ApoptoticSpringTensionStiffness>" << mApoptoticSpringTensionStiffness <<
"</ApoptoticSpringTensionStiffness>\n";
296 *rParamsFile <<
"\t\t\t<ApoptoticSpringCompressionStiffness>" << mApoptoticSpringCompressionStiffness <<
"</ApoptoticSpringCompressionStiffness>\n";
double GetSurfaceAreaOfVoronoiElement(unsigned index)
SpringIterator SpringsEnd()
double GetVoronoiEdgeLength(unsigned index1, unsigned index2)
SpringIterator SpringsBegin()
void SetApoptoticSpringTensionStiffness(double apoptoticSpringTensionStiffness)
virtual CellPtr GetCellUsingLocationIndex(unsigned index)
LinearSpringWithVariableSpringConstantsForce()
double VariableSpringConstantMultiplicationFactor(unsigned nodeAGlobalIndex, unsigned nodeBGlobalIndex, AbstractCellPopulation< DIM > &rCellPopulation, bool isCloserThanRestLength)
#define EXCEPTION(message)
double GetBetaCatSpringScaler()
virtual void OutputForceParameters(out_stream &rParamsFile)
const double DOUBLE_UNSET
double GetMembraneBoundBetaCateninLevel()
void SetApoptoticSprings(bool useApoptoticSprings)
#define EXPORT_TEMPLATE_CLASS_SAME_DIMS(CLASS)
void SetBetaCatSpringScaler(double betaCatSpringScaler)
double GetApoptoticSpringCompressionStiffness()
void AddForceContribution(AbstractCellPopulation< DIM > &rCellPopulation)
virtual ~LinearSpringWithVariableSpringConstantsForce()
virtual double VariableSpringConstantMultiplicationFactor(unsigned nodeAGlobalIndex, unsigned nodeBGlobalIndex, AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM > &rCellPopulation, bool isCloserThanRestLength)
void SetMutantSprings(bool useMutantSprings, double mutantMutantMultiplier=2, double normalMutantMultiplier=1.5)
virtual void OutputForceParameters(out_stream &rParamsFile)
void SetApoptoticSpringCompressionStiffness(double apoptoticSpringCompressionStiffness)
void SetEdgeBasedSpringConstant(bool useEdgeBasedSpringConstant)
void SetBetaCateninSprings(bool useBCatSprings)
double GetApoptoticSpringTensionStiffness()