84 bool is_not_on_base =
IsNodeOnBase(parent_node_index,static_cast_mesh);
103 std::set<unsigned>::iterator neighbour_iter = neighbouring_node_indices.begin();
104 for (
unsigned i=0; i<direction; i++)
108 assert(neighbour_iter != neighbouring_node_indices.end());
110 unsigned daughter_node_index = *neighbour_iter;
112 assert(daughter_node_index < static_cast_mesh->GetNumNodes());
117 std::list<std::pair<unsigned,unsigned> > cell_moves;
119 bool is_neighbour_occupied =
true;
121 unsigned current_node_index = parent_node_index;
122 unsigned target_node_index = daughter_node_index;
123 while (is_neighbour_occupied)
125 current_node_index = target_node_index;
128 unsigned num_neighbours = neighbouring_node_indices.size();
134 std::set<unsigned>::iterator neighbour_iter = neighbouring_node_indices.begin();
135 for (
unsigned i=0; i<num_neighbours-1; i++)
139 assert(neighbour_iter != neighbouring_node_indices.end());
141 target_node_index = *neighbour_iter;
143 std::pair<unsigned, unsigned> new_move(current_node_index, target_node_index);
145 cell_moves.push_back(new_move);
150 is_neighbour_occupied =
false;
154 current_node_index = target_node_index;
158 for (std::list<std::pair<unsigned, unsigned> >::reverse_iterator reverse_iter = cell_moves.rbegin();
159 reverse_iter != cell_moves.rend();
162 assert(rCellPopulation.
IsSiteAvailable(reverse_iter->second, pNewCell));
163 assert(!(rCellPopulation.
IsSiteAvailable(reverse_iter->first, pNewCell)));
170 assert(rCellPopulation.
IsSiteAvailable(daughter_node_index, pNewCell));
173 return daughter_node_index;