From b9ba0b940993d250b5b2c5ab27dd827b6e5be961 Mon Sep 17 00:00:00 2001 From: danshapero Date: Thu, 23 Jun 2016 14:34:30 -0700 Subject: [PATCH] Using operator* in examples with SynchronousIterator --- examples/step-14/step-14.cc | 6 +++--- examples/step-35/step-35.cc | 8 ++++---- examples/step-9/step-9.cc | 18 +++++++++--------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/examples/step-14/step-14.cc b/examples/step-14/step-14.cc index 44c52c4df1..f59b6c90f9 100644 --- a/examples/step-14/step-14.cc +++ b/examples/step-14/step-14.cc @@ -2443,7 +2443,7 @@ namespace Step14 // First task on each cell is to compute the cell residual // contributions of this cell, and put them into the // error_indicators variable: - active_cell_iterator cell = std_cxx11::get<0>(cell_and_error.iterators); + active_cell_iterator cell = std_cxx11::get<0>(*cell_and_error); integrate_over_cell (cell_and_error, scratch_data.primal_solution, @@ -2532,7 +2532,7 @@ namespace Step14 // error estimation formula: first get the right hand side and Laplacian // of the numerical solution at the quadrature points for the cell // residual, - cell_data.fe_values.reinit (std_cxx11::get<0>(cell_and_error.iterators)); + cell_data.fe_values.reinit (std_cxx11::get<0>(*cell_and_error)); cell_data.right_hand_side ->value_list (cell_data.fe_values.get_quadrature_points(), cell_data.rhs_values); @@ -2550,7 +2550,7 @@ namespace Step14 sum += ((cell_data.rhs_values[p]+cell_data.cell_laplacians[p]) * cell_data.dual_weights[p] * cell_data.fe_values.JxW (p)); - *(std_cxx11::get<1>(cell_and_error.iterators)) += sum; + *(std_cxx11::get<1>(*cell_and_error)) += sum; } diff --git a/examples/step-35/step-35.cc b/examples/step-35/step-35.cc index f15cb5d263..54ab51e68d 100644 --- a/examples/step-35/step-35.cc +++ b/examples/step-35/step-35.cc @@ -888,11 +888,11 @@ namespace Step35 InitGradScratchData &scratch, InitGradPerTaskData &data) { - scratch.fe_val_vel.reinit (std_cxx11::get<0> (SI.iterators)); - scratch.fe_val_pres.reinit (std_cxx11::get<1> (SI.iterators)); + scratch.fe_val_vel.reinit (std_cxx11::get<0> (*SI)); + scratch.fe_val_pres.reinit (std_cxx11::get<1> (*SI)); - std_cxx11::get<0> (SI.iterators)->get_dof_indices (data.vel_local_dof_indices); - std_cxx11::get<1> (SI.iterators)->get_dof_indices (data.pres_local_dof_indices); + std_cxx11::get<0> (*SI)->get_dof_indices (data.vel_local_dof_indices); + std_cxx11::get<1> (*SI)->get_dof_indices (data.pres_local_dof_indices); data.local_grad = 0.; for (unsigned int q=0; q::faces_per_cell * GeometryInfo::max_children_per_face); - typename DoFHandler::active_cell_iterator cell_it(std_cxx11::get<0>(cell.iterators)); + typename DoFHandler::active_cell_iterator cell_it(std_cxx11::get<0>(*cell)); // First initialize the FEValues object, as well as the // Y tensor: @@ -1142,14 +1142,14 @@ namespace Step9 // neighbors, of course. active_neighbors.clear (); for (unsigned int face_no=0; face_no::faces_per_cell; ++face_no) - if (! std_cxx11::get<0>(cell.iterators)->at_boundary(face_no)) + if (! std_cxx11::get<0>(*cell)->at_boundary(face_no)) { // First define an abbreviation for the iterator to the face and // the neighbor const typename DoFHandler::face_iterator - face = std_cxx11::get<0>(cell.iterators)->face(face_no); + face = std_cxx11::get<0>(*cell)->face(face_no); const typename DoFHandler::cell_iterator - neighbor = std_cxx11::get<0>(cell.iterators)->neighbor(face_no); + neighbor = std_cxx11::get<0>(*cell)->neighbor(face_no); // Then check whether the neighbor is active. If it is, then it // is on the same level or one level coarser (if we are not in @@ -1192,7 +1192,7 @@ namespace Step9 // as an internal error. We therefore use a predefined // exception class to throw here. Assert (neighbor_child->neighbor(face_no==0 ? 1 : 0) - ==std_cxx11::get<0>(cell.iterators),ExcInternalError()); + ==std_cxx11::get<0>(*cell),ExcInternalError()); // If the check succeeded, we push the active neighbor // we just found to the stack we keep: @@ -1203,7 +1203,7 @@ namespace Step9 // `behind' the subfaces of the current face for (unsigned int subface_no=0; subface_non_children(); ++subface_no) active_neighbors.push_back ( - std_cxx11::get<0>(cell.iterators)->neighbor_child_on_subface(face_no,subface_no)); + std_cxx11::get<0>(*cell)->neighbor_child_on_subface(face_no,subface_no)); } } @@ -1305,9 +1305,9 @@ namespace Step9 // at the second element of the pair of iterators, which requires // slightly awkward syntax but is not otherwise particularly // difficult: - *(std_cxx11::get<1>(cell.iterators)) = (std::pow(std_cxx11::get<0>(cell.iterators)->diameter(), - 1+1.0*dim/2) * - std::sqrt(gradient.norm_square())); + *(std_cxx11::get<1>(*cell)) = (std::pow(std_cxx11::get<0>(*cell)->diameter(), + 1+1.0*dim/2) * + std::sqrt(gradient.norm_square())); } } -- 2.39.5