From 6261cbd77d9506bc1fc1c87154e381417e881387 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 15 Apr 2015 11:10:29 -0500 Subject: [PATCH] Replace a double loop over cells and indices by a single loop and the use of cell->active_cell_index(). --- include/deal.II/numerics/vector_tools.templates.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/include/deal.II/numerics/vector_tools.templates.h b/include/deal.II/numerics/vector_tools.templates.h index 0a41091f16..8a8453c451 100644 --- a/include/deal.II/numerics/vector_tools.templates.h +++ b/include/deal.II/numerics/vector_tools.templates.h @@ -6376,9 +6376,8 @@ namespace VectorTools IDScratchData data(mapping, fe_collection, q, update_flags); // loop over all cells - typename DH::active_cell_iterator cell = dof.begin_active(), - endc = dof.end(); - for (unsigned int index=0; cell != endc; ++cell, ++index) + for (typename DH::active_cell_iterator cell = dof.begin_active(); + cell != dof.end(); ++cell) if (cell->is_locally_owned()) { // initialize for this cell @@ -6393,7 +6392,7 @@ namespace VectorTools if (update_flags & update_gradients) fe_values.get_function_gradients (fe_function, data.function_grads); - difference(index) = + difference(cell->active_cell_index()) = integrate_difference_inner (exact_solution, norm, weight, update_flags, exponent, n_components, data); @@ -6401,7 +6400,7 @@ namespace VectorTools else // the cell is a ghost cell or is artificial. write a zero into the // corresponding value of the returned vector - difference(index) = 0; + difference(cell->active_cell_index()) = 0; } } // namespace internal -- 2.39.5