36 #include "BuskeElasticForce.hpp"
38 template<
unsigned DIM>
41 mDeformationEnergyParameter(4.0/(3.0*5.0))
45 template<
unsigned DIM>
48 return mDeformationEnergyParameter;
51 template<
unsigned DIM>
54 mDeformationEnergyParameter = deformationEnergyParameter;
57 template<
unsigned DIM>
59 unsigned nodeBGlobalIndex,
66 assert(nodeAGlobalIndex != nodeBGlobalIndex);
72 const c_vector<double, DIM>& r_node_a_location = p_node_a->
rGetLocation();
73 const c_vector<double, DIM>& r_node_b_location = p_node_b->
rGetLocation();
76 c_vector<double, DIM> unit_vector = r_node_b_location - r_node_a_location;
79 double distance_between_nodes = norm_2(unit_vector);
82 if (this->mUseCutOffLength)
84 if (distance_between_nodes >= this->GetCutOffLength())
86 return zero_vector<double>(DIM);
91 assert(distance_between_nodes > 0);
92 assert(!std::isnan(distance_between_nodes));
95 unit_vector /= distance_between_nodes;
98 double radius_of_cell_one = p_node_a->
GetRadius();
99 double radius_of_cell_two = p_node_b->
GetRadius();
102 c_vector<double, DIM> force_between_nodes = GetMagnitudeOfForce(distance_between_nodes,radius_of_cell_one,radius_of_cell_two) * unit_vector;
104 return force_between_nodes;
107 template<
unsigned DIM>
113 if (distanceBetweenNodes < radiusOfCellOne + radiusOfCellTwo)
115 dWDdd = -pow(radiusOfCellOne + radiusOfCellTwo - distanceBetweenNodes,1.5)
116 *pow(radiusOfCellOne*radiusOfCellTwo/(radiusOfCellOne+radiusOfCellTwo),0.5)
117 /mDeformationEnergyParameter;
127 template<
unsigned DIM>
130 *rParamsFile <<
"\t\t\t<DeformationEnergyParameter>" << mDeformationEnergyParameter <<
"</DeformationEnergyParameter>\n";
virtual Node< SPACE_DIM > * GetNode(unsigned index)=0
virtual void OutputForceParameters(out_stream &rParamsFile)
double GetDeformationEnergyParameter()
c_vector< double, DIM > CalculateForceBetweenNodes(unsigned nodeAGlobalIndex, unsigned nodeBGlobalIndex, AbstractCellPopulation< DIM > &rCellPopulation)
double GetMagnitudeOfForce(double distanceBetweenNodes, double radiusOfCellOne, double radiusOfCellTwo)
#define EXPORT_TEMPLATE_CLASS_SAME_DIMS(CLASS)
const c_vector< double, SPACE_DIM > & rGetLocation() const
void SetDeformationEnergyParameter(double deformationEnergyParameter)
virtual void OutputForceParameters(out_stream &rParamsFile)