54 if (mPreviousLocations.size() != rCellPopulation.
GetNumNodes())
56 mPreviousLocations.resize(rCellPopulation.
GetNumNodes());
57 UpdatePreviousLocations(rCellPopulation);
64 auto condition_satisfied = [&rCellPopulation](
const std::pair<Node<DIM>*,
Node<DIM>*>& pair) ->
bool
67 if (pair.first->GetRegion() == LAMINA_REGION || pair.second->GetRegion() == LAMINA_REGION)
72 if (*(pair.first->ContainingElementsBegin()) == *(pair.second->ContainingElementsBegin()))
81 for (
auto&& pair : rNodePairs)
83 if (condition_satisfied(pair))
90 mPreviousLocations[p_node_b->
GetIndex()]);
95 c_vector<double, DIM> unit_perp;
96 double relative_vel_comp = CalculateRelativeVelocityComponent(previous_disp, current_disp, unit_perp);
104 double elem_spacing = 0.5 * (node_a_elem_spacing + node_b_elem_spacing);
106 double eff_spring_const = mSpringConst * elem_spacing / rCellPopulation.
GetIntrinsicSpacing();
113 c_vector<double, DIM> force = unit_perp * (relative_vel_comp * eff_spring_const);
115 c_vector<double, DIM> force_on_b = force * (elem_spacing / node_a_elem_spacing);
118 c_vector<double, DIM> force_on_a = force * (-1.0 * elem_spacing / node_b_elem_spacing);
123 UpdatePreviousLocations(rCellPopulation);
125 if (this->mAdditiveNormalNoise)
127 this->AddNormalNoiseToNodes(rCellPopulation);
133 const c_vector<double, DIM>& rPreviousDisp,
134 const c_vector<double, DIM>& rCurrentDisp,
135 c_vector<double, DIM>& rUnitPerp)
138 rUnitPerp = Create_c_vector(-rPreviousDisp[1], rPreviousDisp[0]);
139 rUnitPerp /= norm_2(rUnitPerp);