36 #include "ChemotacticForce.hpp"
38 #include "CellwiseDataGradient.hpp"
39 #include "CellLabel.hpp"
41 template<
unsigned DIM>
47 template<
unsigned DIM>
52 template<
unsigned DIM>
59 template<
unsigned DIM>
66 cell_iter != rCellPopulation.
End();
70 if (cell_iter->template HasCellProperty<CellLabel>())
74 c_vector<double,DIM>& r_gradient = gradients.
rGetGradient(node_global_index);
75 double nutrient_concentration = cell_iter->GetCellData()->GetItem(
"nutrient");
76 double magnitude_of_gradient = norm_2(r_gradient);
78 double force_magnitude = GetChemotacticForceMagnitude(nutrient_concentration, magnitude_of_gradient);
81 if (magnitude_of_gradient > 0)
83 c_vector<double,DIM> force = (force_magnitude/magnitude_of_gradient)*r_gradient;
84 rCellPopulation.
GetNode(node_global_index)->AddAppliedForceContribution(force);
91 template<
unsigned DIM>
virtual Node< SPACE_DIM > * GetNode(unsigned index)=0
void OutputForceParameters(out_stream &rParamsFile)
unsigned GetLocationIndexUsingCell(CellPtr pCell)
void AddForceContribution(AbstractCellPopulation< DIM > &rCellPopulation)
void SetupGradients(AbstractCellPopulation< DIM > &rCellPopulation, const std::string &rItemName)
#define EXPORT_TEMPLATE_CLASS_SAME_DIMS(CLASS)
c_vector< double, DIM > & rGetGradient(unsigned nodeIndex)
double GetChemotacticForceMagnitude(const double concentration, const double concentrationGradientMagnitude)
virtual void OutputForceParameters(out_stream &rParamsFile)=0