47 mUseEdgeBasedSpringConstant(false),
48 mUseMutantSprings(false),
51 mUseBCatSprings(false),
52 mUseApoptoticSprings(false),
53 mBetaCatSpringScaler(18.14/6.0),
54 mApoptoticSpringTensionStiffness(15.0*0.25),
55 mApoptoticSpringCompressionStiffness(15.0*0.75)
93 unsigned nodeAGlobalIndex,
94 unsigned nodeBGlobalIndex,
96 bool isCloserThanRestLength)
102 isCloserThanRestLength);
112 if (mUseEdgeBasedSpringConstant)
115 assert(!mUseBCatSprings);
117 multiplication_factor = (
static_cast<MeshBasedCellPopulation<DIM>*
>(&rCellPopulation))->GetVoronoiEdgeLength(nodeAGlobalIndex, nodeBGlobalIndex)*sqrt(3.0);
120 if (mUseMutantSprings)
122 unsigned number_of_mutants = 0;
136 switch (number_of_mutants)
140 multiplication_factor *= mNormalMutantMultiplier;
145 multiplication_factor *= mMutantMutantMultiplier;
164 assert(!mUseEdgeBasedSpringConstant);
172 double edge_length_between_1_and_2 = p_static_cast_cell_population->
GetVoronoiEdgeLength(nodeAGlobalIndex, nodeBGlobalIndex);
174 double beta_cat_on_cell_1_edge = beta_cat_cell_1 * edge_length_between_1_and_2 / perim_cell_1;
175 double beta_cat_on_cell_2_edge = beta_cat_cell_2 * edge_length_between_1_and_2 / perim_cell_2;
177 double min_beta_Cat_of_two_cells = std::min(beta_cat_on_cell_1_edge, beta_cat_on_cell_2_edge);
179 multiplication_factor *= min_beta_Cat_of_two_cells / mBetaCatSpringScaler;
182 if (mUseApoptoticSprings)
187 if (cell_A_is_apoptotic || cell_B_is_apoptotic)
189 double spring_a_stiffness = 2.0 * this->GetMeinekeSpringStiffness();
190 double spring_b_stiffness = 2.0 * this->GetMeinekeSpringStiffness();
192 if (cell_A_is_apoptotic)
194 if (!isCloserThanRestLength)
196 spring_a_stiffness = mApoptoticSpringTensionStiffness;
200 spring_a_stiffness = mApoptoticSpringCompressionStiffness;
203 if (cell_B_is_apoptotic)
205 if (!isCloserThanRestLength)
207 spring_b_stiffness = mApoptoticSpringTensionStiffness;
211 spring_b_stiffness = mApoptoticSpringCompressionStiffness;
215 multiplication_factor /= (1.0/spring_a_stiffness + 1.0/spring_b_stiffness)*this->GetMeinekeSpringStiffness();
219 return multiplication_factor;
228 EXCEPTION(
"LinearSpringWithVariableSpringConstantsForce is to be used with a subclass of MeshBasedCellPopulation only");
234 spring_iterator != p_static_cast_cell_population->
SpringsEnd();
237 unsigned nodeA_global_index = spring_iterator.GetNodeA()->GetIndex();
238 unsigned nodeB_global_index = spring_iterator.GetNodeB()->GetIndex();
240 c_vector<double, DIM> force = this->CalculateForceBetweenNodes(nodeA_global_index, nodeB_global_index, rCellPopulation);
241 c_vector<double, DIM> negative_force = -1.0*force;
243 spring_iterator.GetNodeB()->AddAppliedForceContribution(negative_force);
244 spring_iterator.GetNodeA()->AddAppliedForceContribution(force);
290 *rParamsFile <<
"\t\t\t<UseEdgeBasedSpringConstant>" << mUseEdgeBasedSpringConstant <<
"</UseEdgeBasedSpringConstant>\n";
291 *rParamsFile <<
"\t\t\t<UseMutantSprings>" << mUseMutantSprings <<
"</UseMutantSprings>\n";
292 *rParamsFile <<
"\t\t\t<MutantMutantMultiplier>" << mMutantMutantMultiplier <<
"</MutantMutantMultiplier>\n";
293 *rParamsFile <<
"\t\t\t<NormalMutantMultiplier>" << mNormalMutantMultiplier <<
"</NormalMutantMultiplier>\n";
294 *rParamsFile <<
"\t\t\t<UseBCatSprings>" << mUseBCatSprings <<
"</UseBCatSprings>\n";
295 *rParamsFile <<
"\t\t\t<UseApoptoticSprings>" << mUseApoptoticSprings <<
"</UseApoptoticSprings>\n";
296 *rParamsFile <<
"\t\t\t<BetaCatSpringScaler>" << mBetaCatSpringScaler <<
"</BetaCatSpringScaler>\n";
297 *rParamsFile <<
"\t\t\t<ApoptoticSpringTensionStiffness>" << mApoptoticSpringTensionStiffness <<
"</ApoptoticSpringTensionStiffness>\n";
298 *rParamsFile <<
"\t\t\t<ApoptoticSpringCompressionStiffness>" << mApoptoticSpringCompressionStiffness <<
"</ApoptoticSpringCompressionStiffness>\n";