36 #include "BuskeElasticForce.hpp"
39 template<
unsigned DIM>
42 mDeformationEnergyParameter(4.0/(3.0*5.0))
46 template<
unsigned DIM>
49 return mDeformationEnergyParameter;
52 template<
unsigned DIM>
55 mDeformationEnergyParameter = deformationEnergyParameter;
58 template<
unsigned DIM>
60 unsigned nodeBGlobalIndex,
67 assert(nodeAGlobalIndex != nodeBGlobalIndex);
73 c_vector<double, DIM> node_a_location = p_node_a->
rGetLocation();
74 c_vector<double, DIM> node_b_location = p_node_b->
rGetLocation();
77 c_vector<double, DIM> unit_vector = node_b_location - node_a_location;
80 double distance_between_nodes = norm_2(unit_vector);
83 if (this->mUseCutOffLength)
85 if (distance_between_nodes >= this->GetCutOffLength())
87 return zero_vector<double>(DIM);
92 assert(distance_between_nodes > 0);
93 assert(!std::isnan(distance_between_nodes));
96 unit_vector /= distance_between_nodes;
99 double radius_of_cell_one = p_node_a->
GetRadius();
100 double radius_of_cell_two = p_node_b->
GetRadius();
103 c_vector<double, DIM> force_between_nodes = GetMagnitudeOfForce(distance_between_nodes,radius_of_cell_one,radius_of_cell_two) * unit_vector;
105 return force_between_nodes;
108 template<
unsigned DIM>
114 if (distanceBetweenNodes < radiusOfCellOne + radiusOfCellTwo)
116 dWDdd = -pow(radiusOfCellOne + radiusOfCellTwo - distanceBetweenNodes,1.5)
117 *pow(radiusOfCellOne*radiusOfCellTwo/(radiusOfCellOne+radiusOfCellTwo),0.5)
118 /mDeformationEnergyParameter;
128 template<
unsigned DIM>
131 *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)