From: Wolfgang Bangerth Date: Wed, 15 Apr 2015 12:46:24 +0000 (-0500) Subject: Replace a double loop over cells and indices by a single loop and the use of cell... X-Git-Tag: v8.3.0-rc1~263^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=24fdf197d82dd7e08bb4a77d62c5ba98793c070c;p=dealii.git Replace a double loop over cells and indices by a single loop and the use of cell->active_cell_index(). --- diff --git a/source/numerics/error_estimator_1d.cc b/source/numerics/error_estimator_1d.cc index 6e95f5dad4..74e8aae9a0 100644 --- a/source/numerics/error_estimator_1d.cc +++ b/source/numerics/error_estimator_1d.cc @@ -330,9 +330,9 @@ estimate (const Mapping<1,spacedim> &mapping, // loop over all cells and do something on the cells which we're told to // work on. note that the error indicator is only a sum over the two // contributions from the two vertices of each cell. - typename DH::active_cell_iterator cell = dof_handler.begin_active(); - for (unsigned int cell_index=0; cell != dof_handler.end(); - ++cell, ++cell_index) + for (typename DH::active_cell_iterator cell = dof_handler.begin_active(); + cell != dof_handler.end(); + ++cell) if (((subdomain_id == numbers::invalid_subdomain_id) || (cell->subdomain_id() == subdomain_id)) @@ -342,7 +342,7 @@ estimate (const Mapping<1,spacedim> &mapping, (cell->material_id() == material_id))) { for (unsigned int n=0; nactive_cell_index()) = 0; // loop over the two points bounding this line. n==0 is left point, // n==1 is right point @@ -429,12 +429,12 @@ estimate (const Mapping<1,spacedim> &mapping, const double jump = ((grad_here - grad_neighbor[s](component)) * coefficient_values(component)); - (*errors[s])(cell_index) += jump*jump * cell->diameter(); + (*errors[s])(cell->active_cell_index()) += jump*jump * cell->diameter(); } } for (unsigned int s=0; sactive_cell_index()) = std::sqrt((*errors[s])(cell->active_cell_index())); } }