36 #include "BuskeAdhesiveForce.hpp"
38 template<
unsigned DIM>
41 mAdhesionEnergyParameter(0.2)
45 template<
unsigned DIM>
48 return mAdhesionEnergyParameter;
51 template<
unsigned DIM>
54 mAdhesionEnergyParameter = adhesionEnergyParameter;
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;
97 double radius_of_cell_one = p_node_a->
GetRadius();
98 double radius_of_cell_two = p_node_b->
GetRadius();
101 c_vector<double, DIM> force_between_nodes = GetMagnitudeOfForce(distance_between_nodes,radius_of_cell_one,radius_of_cell_two) * unit_vector;
103 return force_between_nodes;
106 template<
unsigned DIM>
112 if (distanceBetweenNodes < radiusOfCellOne + radiusOfCellTwo)
115 double xij = 0.5*(radiusOfCellOne*radiusOfCellOne - radiusOfCellTwo*radiusOfCellTwo + distanceBetweenNodes*distanceBetweenNodes)/distanceBetweenNodes;
116 double dxijdd = 1.0 - xij/distanceBetweenNodes;
117 dWAdd = 2.0*mAdhesionEnergyParameter*M_PI*xij*dxijdd;
123 template<
unsigned DIM>
126 *rParamsFile <<
"\t\t\t<AdhesionEnergyParameter>" << mAdhesionEnergyParameter <<
"</AdhesionEnergyParameter>\n";
virtual Node< SPACE_DIM > * GetNode(unsigned index)=0
virtual void OutputForceParameters(out_stream &rParamsFile)
virtual void OutputForceParameters(out_stream &rParamsFile)
c_vector< double, DIM > CalculateForceBetweenNodes(unsigned nodeAGlobalIndex, unsigned nodeBGlobalIndex, AbstractCellPopulation< DIM > &rCellPopulation)
double GetMagnitudeOfForce(double distanceBetweenNodes, double radiusOfCellOne, double radiusOfCellTwo)
void SetAdhesionEnergyParameter(double adhesionEnergyParameter)
#define EXPORT_TEMPLATE_CLASS_SAME_DIMS(CLASS)
const c_vector< double, SPACE_DIM > & rGetLocation() const
double GetAdhesionEnergyParameter()