]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Using operator* in examples with SynchronousIterator
authordanshapero <shapero.daniel@gmail.com>
Thu, 23 Jun 2016 21:34:30 +0000 (14:34 -0700)
committerdanshapero <shapero.daniel@gmail.com>
Fri, 24 Jun 2016 22:11:18 +0000 (15:11 -0700)
examples/step-14/step-14.cc
examples/step-35/step-35.cc
examples/step-9/step-9.cc

index 44c52c4df1d5680a8ea5e6c99d5985bb3ceb1dec..f59b6c90f9e422d7e9e62e5043ef2a7e36b6d72d 100644 (file)
@@ -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
       // <code>error_indicators</code> 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;
     }
 
 
index f15cb5d2631753f44a98bfb896e849f385161253..54ab51e68d361250fb81ddb115f9b4905706c680 100644 (file)
@@ -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<scratch.nqp; ++q)
index 2598e2beee4aad577dd351d0099961b080be9e95..ce697b777d061389e4378c9201c152829a330081 100644 (file)
@@ -1107,7 +1107,7 @@ namespace Step9
     active_neighbors.reserve (GeometryInfo<dim>::faces_per_cell *
                               GeometryInfo<dim>::max_children_per_face);
 
-    typename DoFHandler<dim>::active_cell_iterator cell_it(std_cxx11::get<0>(cell.iterators));
+    typename DoFHandler<dim>::active_cell_iterator cell_it(std_cxx11::get<0>(*cell));
 
     // First initialize the <code>FEValues</code> object, as well as the
     // <code>Y</code> tensor:
@@ -1142,14 +1142,14 @@ namespace Step9
     // neighbors, of course.
     active_neighbors.clear ();
     for (unsigned int face_no=0; face_no<GeometryInfo<dim>::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<dim>::face_iterator
-          face = std_cxx11::get<0>(cell.iterators)->face(face_no);
+          face = std_cxx11::get<0>(*cell)->face(face_no);
           const typename DoFHandler<dim>::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_no<face->n_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()));
 
   }
 }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.