for (unsigned int i=0; (i<data.this_thread)&&(cell != this->dofs->end()); ++i)
{
++patch;
- ++cell_number;
- cell=next_cell(cell);
+
+ // move to next cell and update
+ // cell_number making sure that we also
+ // count those cells that next_cell may
+ // have skipped
+ const typename DoFHandler<dim>::cell_iterator
+ new_cell = next_cell(cell);
+ if (new_cell != this->dofs->end())
+ cell_number += std::distance (cell, new_cell);
+ cell = new_cell;
}
// now loop over all cells and
(i<data.n_threads)&&(cell != this->dofs->end()); ++i)
{
++patch;
- ++cell_number;
- cell=next_cell(cell);
+
+ // move to next cell and update
+ // cell_number making sure that we also
+ // count those cells that next_cell may
+ // have skipped
+ const typename DoFHandler<dim>::cell_iterator
+ new_cell = next_cell(cell);
+ if (new_cell != this->dofs->end())
+ cell_number += std::distance (cell, new_cell);
+ cell = new_cell;
}
- };
+ }
}