]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fix tests/meshworker/step-11-mesh_loop 4968/head
authorTimo Heister <timo.heister@gmail.com>
Sun, 27 Aug 2017 21:47:47 +0000 (17:47 -0400)
committerTimo Heister <timo.heister@gmail.com>
Sun, 27 Aug 2017 21:47:47 +0000 (17:47 -0400)
It doesn't make sense to have the face loop inside the boundary_worker.
Doh.

tests/meshworker/step-11-mesh_loop.cc

index 0a4dd4e47ab2726d60561127d41f140f328deb45..cc871f9d8af19fbd5fcaf91183c2152fd95e0d23 100644 (file)
@@ -257,27 +257,23 @@ namespace Step11
           }
     };
 
-    auto boundary_worker = [] (const Iterator &cell, const unsigned int &f, ScratchData<dim> &scratch_data, CopyData &copy_data)
+    auto boundary_worker = [] (const Iterator &cell, const unsigned int &face_no, ScratchData<dim> &scratch_data, CopyData &copy_data)
     {
       const unsigned int dofs_per_cell   = scratch_data.fe_values.get_fe().dofs_per_cell;
       const unsigned int n_face_q_points = scratch_data.fe_face_values.get_quadrature().size();
 
-      std::vector<double>         face_boundary_values (n_face_q_points);
+      std::vector<double> face_boundary_values (n_face_q_points);
       ConstantFunction<dim> boundary_values (1.0);
 
-      for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
-        if (cell->face(face)->at_boundary())
-          {
-            scratch_data.fe_face_values.reinit (cell, face);
-            boundary_values.value_list (scratch_data.fe_face_values.get_quadrature_points(),
-                                        face_boundary_values);
-
-            for (unsigned int q_point=0; q_point<n_face_q_points; ++q_point)
-              for (unsigned int i=0; i<dofs_per_cell; ++i)
-                copy_data.cell_rhs(i) -= (face_boundary_values[q_point] *
-                                          scratch_data.fe_face_values.shape_value(i,q_point) *
-                                          scratch_data.fe_face_values.JxW(q_point));
-          }
+      scratch_data.fe_face_values.reinit (cell, face_no);
+      boundary_values.value_list (scratch_data.fe_face_values.get_quadrature_points(),
+                                  face_boundary_values);
+
+      for (unsigned int q_point=0; q_point<n_face_q_points; ++q_point)
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          copy_data.cell_rhs(i) -= (face_boundary_values[q_point] *
+                                    scratch_data.fe_face_values.shape_value(i,q_point) *
+                                    scratch_data.fe_face_values.JxW(q_point));
     };
 
     auto copier = [&](const CopyData &c)

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.