36 #include "LinearSpringWithVariableSpringConstantsForce.hpp"
37 #include "MeshBasedCellPopulation.hpp"
38 #include "VanLeeuwen2009WntSwatCellCycleModelHypothesisOne.hpp"
39 #include "VanLeeuwen2009WntSwatCellCycleModelHypothesisTwo.hpp"
40 #include "ApoptoticCellProperty.hpp"
41 #include "BetaCateninOneHitCellMutationState.hpp"
42 #include "ApcTwoHitCellMutationState.hpp"
44 template<
unsigned DIM>
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)
59 template<
unsigned DIM>
64 template<
unsigned DIM>
68 mUseEdgeBasedSpringConstant = useEdgeBasedSpringConstant;
71 template<
unsigned DIM>
74 mUseMutantSprings = useMutantSprings;
75 mMutantMutantMultiplier = mutantMutantMultiplier;
76 mNormalMutantMultiplier = normalMutantMultiplier;
79 template<
unsigned DIM>
82 mUseBCatSprings = useBCatSprings;
85 template<
unsigned DIM>
88 mUseApoptoticSprings = useApoptoticSprings;
91 template<
unsigned DIM>
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;
222 template<
unsigned DIM>
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);
248 template<
unsigned DIM>
251 return mBetaCatSpringScaler;
254 template<
unsigned DIM>
257 assert(betaCatSpringScaler > 0.0);
258 mBetaCatSpringScaler = betaCatSpringScaler;
261 template<
unsigned DIM>
264 return mApoptoticSpringTensionStiffness;
267 template<
unsigned DIM>
270 assert(apoptoticSpringTensionStiffness >= 0.0);
271 mApoptoticSpringTensionStiffness = apoptoticSpringTensionStiffness;
274 template<
unsigned DIM>
277 return mApoptoticSpringCompressionStiffness;
280 template<
unsigned DIM>
283 assert(apoptoticSpringCompressionStiffness >= 0.0);
284 mApoptoticSpringCompressionStiffness = apoptoticSpringCompressionStiffness;
287 template<
unsigned DIM>
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";
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()