36 #include "ChemotacticForce.hpp"
37 #include "CellwiseDataGradient.hpp"
39 template<
unsigned DIM>
45 template<
unsigned DIM>
50 template<
unsigned DIM>
57 template<
unsigned DIM>
64 cell_iter != rCellPopulation.
End();
68 if (cell_iter->template HasCellProperty<CellLabel>())
72 c_vector<double,DIM>& r_gradient = gradients.
rGetGradient(node_global_index);
73 double nutrient_concentration = cell_iter->GetCellData()->GetItem(
"nutrient");
74 double magnitude_of_gradient = norm_2(r_gradient);
76 double force_magnitude = GetChemotacticForceMagnitude(nutrient_concentration, magnitude_of_gradient);
79 if (magnitude_of_gradient > 0)
81 c_vector<double,DIM> force = (force_magnitude/magnitude_of_gradient)*r_gradient;
82 rCellPopulation.
GetNode(node_global_index)->AddAppliedForceContribution(force);
89 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