]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix types and names in step-30. 16501/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 19 Jan 2024 00:08:57 +0000 (17:08 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 19 Jan 2024 00:08:57 +0000 (17:08 -0700)
examples/step-30/step-30.cc

index 7cb4b79a942baba1c846fd6352b16b9b92c19082..ed0381ff4b25756ca20e66518fc960210ca9c446 100644 (file)
@@ -714,8 +714,8 @@ namespace Step30
       // We only need to consider cells which are flagged for refinement.
       if (cell->refine_flag_set())
         {
-          Point<dim> jump;
-          Point<dim> area;
+          std::array<double, dim> jump_in_coordinate_direction;
+          std::array<double, dim> face_area_in_coordinate_direction;
 
           for (const auto face_no : cell->face_indices())
             {
@@ -781,11 +781,12 @@ namespace Step30
                               // second coordinate direction and so on, so we
                               // accumulate these values into vectors with
                               // <code>dim</code> components.
-                              jump[face_no / 2] +=
+                              jump_in_coordinate_direction[face_no / 2] +=
                                 std::abs(u[x] - u_neighbor[x]) * JxW[x];
                               // We also sum up the scaled weights to obtain
                               // the measure of the face.
-                              area[face_no / 2] += JxW[x];
+                              face_area_in_coordinate_direction[face_no / 2] +=
+                                JxW[x];
                             }
                         }
                     }
@@ -815,9 +816,10 @@ namespace Step30
                                x < fe_v_face.n_quadrature_points;
                                ++x)
                             {
-                              jump[face_no / 2] +=
+                              jump_in_coordinate_direction[face_no / 2] +=
                                 std::abs(u[x] - u_neighbor[x]) * JxW[x];
-                              area[face_no / 2] += JxW[x];
+                              face_area_in_coordinate_direction[face_no / 2] +=
+                                JxW[x];
                             }
                         }
                       else // i.e. neighbor is coarser than cell
@@ -859,9 +861,10 @@ namespace Step30
                                x < fe_v_face.n_quadrature_points;
                                ++x)
                             {
-                              jump[face_no / 2] +=
+                              jump_in_coordinate_direction[face_no / 2] +=
                                 std::abs(u[x] - u_neighbor[x]) * JxW[x];
-                              area[face_no / 2] += JxW[x];
+                              face_area_in_coordinate_direction[face_no / 2] +=
+                                JxW[x];
                             }
                         }
                     }
@@ -873,7 +876,8 @@ namespace Step30
           double                  sum_of_average_jumps = 0.;
           for (unsigned int i = 0; i < dim; ++i)
             {
-              average_jumps[i] = jump[i] / area[i];
+              average_jumps[i] = jump_in_coordinate_direction[i] /
+                                 face_area_in_coordinate_direction[i];
               sum_of_average_jumps += average_jumps[i];
             }
 

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.