36 #include "WelikyOsterForce.hpp" 38 template<
unsigned DIM>
41 mWelikyOsterAreaParameter(1.0),
42 mWelikyOsterPerimeterParameter(1.0)
46 template<
unsigned DIM>
51 template<
unsigned DIM>
60 EXCEPTION(
"WelikyOsterForce is to be used with a VertexBasedCellPopulation only");
76 unsigned element_index = element_iter->GetIndex();
96 unsigned num_nodes = element_iter->GetNumNodes();
97 for (
unsigned node_local_index = 0; node_local_index < num_nodes; node_local_index++)
99 unsigned node_global_index = element_iter->GetNodeGlobalIndex(node_local_index);
101 c_vector<double, DIM> current_node = element_iter->GetNodeLocation(node_local_index);
102 c_vector<double, DIM> next_node = element_iter->GetNodeLocation((node_local_index + 1)%(element_iter->GetNumNodes()));
103 c_vector<double, DIM> previous_node = element_iter->GetNodeLocation((node_local_index + element_iter->GetNumNodes() - 1)%(element_iter->GetNumNodes()));
105 c_vector<double, DIM> clockwise_unit_vector = p_cell_population->
rGetMesh().
GetVectorFromAtoB(current_node, previous_node);
106 clockwise_unit_vector /= norm_2(clockwise_unit_vector);
108 c_vector<double, DIM> anti_clockwise_unit_vector = p_cell_population->
rGetMesh().
GetVectorFromAtoB(current_node, next_node);
109 anti_clockwise_unit_vector /= norm_2(anti_clockwise_unit_vector);
112 c_vector<double, DIM> outward_normal = -0.5*clockwise_unit_vector - 0.5*anti_clockwise_unit_vector;
113 outward_normal /= norm_2(outward_normal);
115 c_vector<double, DIM> deformation_contribution = deformation_coefficient * outward_normal;
117 c_vector<double, DIM> membrane_surface_tension_contribution = membrane_surface_tension_coefficient * (clockwise_unit_vector + anti_clockwise_unit_vector);
119 c_vector<double, DIM> force_on_node = deformation_contribution + membrane_surface_tension_contribution;
121 p_cell_population->
GetNode(node_global_index)->AddAppliedForceContribution(force_on_node);
126 template<
unsigned DIM>
132 template<
unsigned DIM>
138 template<
unsigned DIM>
144 template<
unsigned DIM>
150 template<
unsigned DIM>
virtual c_vector< double, SPACE_DIM > GetVectorFromAtoB(const c_vector< double, SPACE_DIM > &rLocationA, const c_vector< double, SPACE_DIM > &rLocationB)
double mWelikyOsterAreaParameter
double GetWelikyOsterAreaParameter()
double mWelikyOsterPerimeterParameter
#define EXCEPTION(message)
void SetWelikyOsterPerimeterParameter(double welikyOsterPerimeterParameter)
MutableVertexMesh< DIM, DIM > & rGetMesh()
VertexElementIterator GetElementIteratorBegin(bool skipDeletedElements=true)
#define EXPORT_TEMPLATE_CLASS_SAME_DIMS(CLASS)
Node< DIM > * GetNode(unsigned index)
void SetWelikyOsterAreaParameter(double welikyOsterAreaParameter)
virtual double GetVolumeOfElement(unsigned index)
void AddForceContribution(AbstractCellPopulation< DIM > &rCellPopulation)
VertexElementIterator GetElementIteratorEnd()
virtual double GetSurfaceAreaOfElement(unsigned index)
double GetWelikyOsterPerimeterParameter()
virtual void OutputForceParameters(out_stream &rParamsFile)=0
void OutputForceParameters(out_stream &rParamsFile)