35 #include "NodeBasedCellPopulationWithBuskeUpdate.hpp" 37 #include "ReplicatableVector.hpp" 38 #include "OdeLinearSystemSolver.hpp" 40 template<
unsigned DIM>
42 std::vector<CellPtr>& rCells,
43 const std::vector<unsigned> locationIndices,
49 template<
unsigned DIM>
56 template<
unsigned DIM>
75 cell_iter != this->
End();
87 const c_vector<double, DIM>& r_node_i_location = p_node_i->
rGetLocation();
90 double radius_of_cell_i = p_node_i->
GetRadius();
100 for (std::set<unsigned>::iterator iter = neighbouring_node_indices.begin();
101 iter != neighbouring_node_indices.end();
104 unsigned neighbour_node_global_index = *iter;
114 const c_vector<double, DIM>& r_node_j_location = p_node_j->
rGetLocation();
117 c_vector<double, DIM> unit_vector = r_node_j_location - r_node_i_location;
120 double dij = norm_2(unit_vector);
125 double radius_of_cell_j = p_node_j->
GetRadius();
127 if (dij < radius_of_cell_i + radius_of_cell_j)
130 double xij = 0.5*(radius_of_cell_i*radius_of_cell_i - radius_of_cell_j*radius_of_cell_j + dij*dij)/dij;
132 Aij = M_PI*(radius_of_cell_i*radius_of_cell_i - xij*xij);
135 for (
unsigned i=0; i<DIM; i++)
144 for (
unsigned i=0; i<DIM; i++)
152 c_vector<double, DIM> current_location;
153 c_vector<double, DIM> forces;
154 current_location = this->
GetNode(global_node_index)->rGetLocation();
155 forces = this->
GetNode(global_node_index)->rGetAppliedForce();
157 for (
unsigned i=0; i<DIM; i++)
174 cell_iter != this->
End();
182 c_vector<double, DIM> new_node_location;
185 for (
unsigned i=0; i<DIM; i++)
187 new_node_location(i) = soln_next_timestep_repl[DIM*node_index+i];
194 this->
SetNode(global_node_index, new_point);
201 template<
unsigned DIM>
void OutputCellPopulationParameters(out_stream &rParamsFile)
NodesOnlyMesh< DIM > & rGetMesh()
unsigned GetLocationIndexUsingCell(CellPtr pCell)
Node< DIM > * GetNode(unsigned index)
void SetNode(unsigned nodeIndex, ChastePoint< DIM > &rNewLocation)
void OutputCellPopulationParameters(out_stream &rParamsFile)
virtual void UpdateNodeLocations(double dt)
NodeBasedCellPopulationWithBuskeUpdate(NodesOnlyMesh< DIM > &rMesh, std::vector< CellPtr > &rCells, const std::vector< unsigned > locationIndices=std::vector< unsigned >(), bool deleteMesh=false)
std::set< unsigned > GetNeighbouringNodeIndices(unsigned index)
#define EXPORT_TEMPLATE_CLASS_SAME_DIMS(CLASS)
unsigned SolveNodeMapping(unsigned index) const
const c_vector< double, SPACE_DIM > & rGetLocation() const
virtual double GetDampingConstant(unsigned nodeIndex)
void SetInitialConditionVector(Vec initialConditionsVector)