36 #include "BuskeAdhesiveForce.hpp"
39 template<
unsigned DIM>
42 mAdhesionEnergyParameter(0.2)
46 template<
unsigned DIM>
49 return mAdhesionEnergyParameter;
52 template<
unsigned DIM>
55 mAdhesionEnergyParameter = adhesionEnergyParameter;
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;
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)
116 double xij = 0.5*(radiusOfCellOne*radiusOfCellOne - radiusOfCellTwo*radiusOfCellTwo + distanceBetweenNodes*distanceBetweenNodes)/distanceBetweenNodes;
117 double dxijdd = 1.0 - xij/distanceBetweenNodes;
118 dWAdd = 2.0*mAdhesionEnergyParameter*M_PI*xij*dxijdd;
124 template<
unsigned DIM>
127 *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()