36 #include "BuskeCompressionForce.hpp"
37 #include "NodeBasedCellPopulation.hpp"
39 template<
unsigned DIM>
42 mCompressionEnergyParameter(5.0)
46 template<
unsigned DIM>
49 return mCompressionEnergyParameter;
52 template<
unsigned DIM>
55 mCompressionEnergyParameter = compressionEnergyParameter;
58 template<
unsigned DIM>
66 c_vector<double, DIM> unit_vector;
70 cell_iter != rCellPopulation.
End();
79 c_vector<double, DIM> node_i_location = p_node_i->
rGetLocation();
82 double radius_of_cell_i = p_node_i->
GetRadius();
84 double delta_V_c = 0.0;
85 c_vector<double, DIM> dVAdd_vector = zero_vector<double>(DIM);
91 for (std::set<unsigned>::iterator iter = neighbouring_node_indices.begin();
92 iter != neighbouring_node_indices.end();
98 c_vector<double, DIM> node_j_location = p_node_j->
rGetLocation();
101 unit_vector = node_j_location - node_i_location;
104 double dij = norm_2(unit_vector);
109 double radius_of_cell_j = p_node_j->
GetRadius();
112 if (dij < radius_of_cell_i + radius_of_cell_j)
115 double xij = 0.5*(radius_of_cell_i*radius_of_cell_i - radius_of_cell_j*radius_of_cell_j + dij*dij)/dij;
116 double dxijdd = 1.0 - xij/dij;
117 double dVAdd = M_PI*dxijdd*(5.0*pow(radius_of_cell_i,2.0) + 3.0*pow(xij,2.0) - 8.0*radius_of_cell_i*xij)/3.0;
119 dVAdd_vector += dVAdd*unit_vector;
122 delta_V_c += M_PI*pow(radius_of_cell_i - xij,2.0)*(2*radius_of_cell_i - xij)/3.0;
126 double V_A = 4.0/3.0*M_PI*pow(radius_of_cell_i,3.0) - delta_V_c;
136 c_vector<double, DIM> applied_force = -mCompressionEnergyParameter/V_T*(V_T - V_A)*dVAdd_vector;
141 template<
unsigned DIM>
144 *rParamsFile <<
"\t\t\t<CompressionEnergyParameter>" << mCompressionEnergyParameter <<
"</CompressionEnergyParameter>\n";
virtual Node< SPACE_DIM > * GetNode(unsigned index)=0
void SetCompressionEnergyParameter(double compressionEnergyParameter)
void OutputForceParameters(out_stream &rParamsFile)
void AddForceContribution(AbstractCellPopulation< DIM > &rCellPopulation)
double GetCompressionEnergyParameter()
unsigned GetLocationIndexUsingCell(CellPtr pCell)
void AddAppliedForceContribution(c_vector< double, SPACE_DIM > &forceContribution)
std::set< unsigned > GetNeighbouringNodeIndices(unsigned index)
#define EXPORT_TEMPLATE_CLASS_SAME_DIMS(CLASS)
const c_vector< double, SPACE_DIM > & rGetLocation() const
virtual void OutputForceParameters(out_stream &rParamsFile)=0