std::vector<std::vector<types::global_dof_index>>(n_active_cells)
.swap(indices_on_cell);
- typename DoFHandlerType::active_cell_iterator cell =
- dof_handler->begin_active(),
- endc = dof_handler->end();
-
- for (unsigned int i = 0; cell != endc; ++cell, ++i)
+ for (const auto &cell : dof_handler->active_cell_iterators())
{
+ const unsigned int i = cell->active_cell_index();
indices_on_cell[i].resize(cell->get_fe().n_dofs_per_cell());
// on each cell store the indices of the
// dofs. after refining we get the values
Vector<typename VectorType::value_type> local_values(0);
- typename DoFHandlerType::cell_iterator cell = dof_handler->begin(),
- endc = dof_handler->end();
-
typename std::map<std::pair<unsigned int, unsigned int>,
Pointerstruct>::const_iterator pointerstruct,
cell_map_end = cell_map.end();
- for (; cell != endc; ++cell)
+ for (const auto &cell : dof_handler->cell_iterators())
{
pointerstruct =
cell_map.find(std::make_pair(cell->level(), cell->index()));
Assert(prepared_for != coarsening_and_refinement,
ExcAlreadyPrepForCoarseAndRef());
+ clear();
+ n_dofs_old = dof_handler->n_dofs();
const unsigned int in_size = all_in.size();
+
+#ifdef DEBUG
Assert(in_size != 0,
ExcMessage("The array of input vectors you pass to this "
"function has no elements. This is not useful."));
-
- clear();
-
- const unsigned int n_active_cells =
- dof_handler->get_triangulation().n_active_cells();
- (void)n_active_cells;
- n_dofs_old = dof_handler->n_dofs();
-
for (unsigned int i = 0; i < in_size; ++i)
{
Assert(all_in[i].size() == n_dofs_old,
ExcDimensionMismatch(all_in[i].size(), n_dofs_old));
}
+#endif
// first count the number
// of cells that will be coarsened
else
++n_cells_to_stay_or_refine;
}
- Assert((n_cells_to_coarsen + n_cells_to_stay_or_refine) == n_active_cells,
+ Assert((n_cells_to_coarsen + n_cells_to_stay_or_refine) ==
+ dof_handler->get_triangulation().n_active_cells(),
ExcInternalError());
unsigned int n_coarsen_fathers = 0;
- for (typename DoFHandlerType::cell_iterator cell = dof_handler->begin();
- cell != dof_handler->end();
- ++cell)
+ for (const auto &cell : dof_handler->cell_iterators())
if (!cell->is_active() && cell->child(0)->coarsen_flag_set())
++n_coarsen_fathers;
Assert(n_cells_to_coarsen >= 2 * n_coarsen_fathers, ExcInternalError());
// the 'to_stay_or_refine' cells 'n_sr' and
// the 'coarsen_fathers' cells 'n_cf',
unsigned int n_sr = 0, n_cf = 0;
- for (typename DoFHandlerType::cell_iterator cell = dof_handler->begin();
- cell != dof_handler->end();
- ++cell)
+ for (const auto &cell : dof_handler->cell_iterators())
{
// CASE 1: active cell that remains as it is
if (cell->is_active() && !cell->coarsen_flag_set())
const std::vector<VectorType> &all_in,
std::vector<VectorType> & all_out) const
{
- Assert(prepared_for == coarsening_and_refinement, ExcNotPrepared());
const unsigned int size = all_in.size();
+#ifdef DEBUG
+ Assert(prepared_for == coarsening_and_refinement, ExcNotPrepared());
Assert(all_out.size() == size, ExcDimensionMismatch(all_out.size(), size));
for (unsigned int i = 0; i < size; ++i)
Assert(all_in[i].size() == n_dofs_old,
Assert(&all_in[i] != &all_out[j],
ExcMessage("Vectors cannot be used as input and output"
" at the same time!"));
+#endif
Vector<typename VectorType::value_type> local_values;
std::vector<types::global_dof_index> dofs;