]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use range-based for loop for FEEvaluation's quadrature point loop 15936/head
authorMartin Kronbichler <martin.kronbichler@uni-a.de>
Mon, 28 Aug 2023 14:03:51 +0000 (16:03 +0200)
committerMartin Kronbichler <martin.kronbichler@uni-a.de>
Mon, 28 Aug 2023 15:22:39 +0000 (17:22 +0200)
13 files changed:
examples/step-37/doc/results.dox
examples/step-37/step-37.cc
examples/step-48/step-48.cc
examples/step-50/step-50.cc
examples/step-59/step-59.cc
examples/step-66/doc/intro.dox
examples/step-66/step-66.cc
examples/step-67/step-67.cc
examples/step-75/step-75.cc
examples/step-76/step-76.cc
tests/performance/timing_mg_glob_coarsen.cc
tests/performance/timing_navier_stokes.cc
tests/performance/timing_step_37.cc

index d09c6ffe97909380447304e875d7ddd757b4db6d..3dfc7770cbb1cef36755944ae3be63253c3ff7d0 100644 (file)
@@ -574,7 +574,7 @@ void LaplaceProblem<dim>::assemble_rhs()
       phi.reinit(cell);
       phi.read_dof_values_plain(solution);
       phi.evaluate(EvaluationFlags::gradients);
-      for (unsigned int q = 0; q < phi.n_q_points; ++q)
+      for (const unsigned int q : phi.quadrature_point_indices())
         {
           phi.submit_gradient(-coefficient(cell, q) * phi.get_gradient(q), q);
           phi.submit_value(make_vectorized_array<double>(1.0), q);
@@ -659,7 +659,7 @@ void LaplaceProblem<dim>::assemble_rhs()
        ++cell)
     {
       phi.reinit(cell);
-      for (unsigned int q = 0; q < phi.n_q_points; ++q)
+      for (const unsigned int q : phi.quadrature_point_indices())
         phi.submit_value(make_vectorized_array<double>(1.0), q);
       phi.integrate(EvaluationFlags::values);
       phi.distribute_local_to_global(system_rhs);
index e9bd5a3aa0718f17242a1d9cd81faaa7432df25a..0ac0ca5aca865869fd8823242367c0dcde702302 100644 (file)
@@ -289,7 +289,7 @@ namespace Step37
     for (unsigned int cell = 0; cell < n_cells; ++cell)
       {
         phi.reinit(cell);
-        for (unsigned int q = 0; q < phi.n_q_points; ++q)
+        for (const unsigned int q : phi.quadrature_point_indices())
           coefficient(cell, q) =
             coefficient_function.value(phi.quadrature_point(q));
       }
@@ -405,7 +405,7 @@ namespace Step37
         phi.reinit(cell);
         phi.read_dof_values(src);
         phi.evaluate(EvaluationFlags::gradients);
-        for (unsigned int q = 0; q < phi.n_q_points; ++q)
+        for (const unsigned int q : phi.quadrature_point_indices())
           phi.submit_gradient(coefficient(cell, q) * phi.get_gradient(q), q);
         phi.integrate(EvaluationFlags::gradients);
         phi.distribute_local_to_global(dst);
@@ -633,7 +633,7 @@ namespace Step37
             phi.submit_dof_value(make_vectorized_array<number>(1.), i);
 
             phi.evaluate(EvaluationFlags::gradients);
-            for (unsigned int q = 0; q < phi.n_q_points; ++q)
+            for (const unsigned int q : phi.quadrature_point_indices())
               phi.submit_gradient(coefficient(cell, q) * phi.get_gradient(q),
                                   q);
             phi.integrate(EvaluationFlags::gradients);
@@ -907,7 +907,7 @@ namespace Step37
          ++cell)
       {
         phi.reinit(cell);
-        for (unsigned int q = 0; q < phi.n_q_points; ++q)
+        for (const unsigned int q : phi.quadrature_point_indices())
           phi.submit_value(make_vectorized_array<double>(1.0), q);
         phi.integrate(EvaluationFlags::values);
         phi.distribute_local_to_global(system_rhs);
index 9d27a84018c1456378c067f76c22327dd755fe21..1f6092f991e2271c7f930f6f0a1e937332683e32 100644 (file)
@@ -127,12 +127,11 @@ namespace Step48
     data.initialize_dof_vector(inv_mass_matrix);
 
     FEEvaluation<dim, fe_degree> fe_eval(data);
-    const unsigned int           n_q_points = fe_eval.n_q_points;
 
     for (unsigned int cell = 0; cell < data.n_cell_batches(); ++cell)
       {
         fe_eval.reinit(cell);
-        for (unsigned int q = 0; q < n_q_points; ++q)
+        for (const unsigned int q : fe_eval.quadrature_point_indices())
           fe_eval.submit_value(make_vectorized_array(1.), q);
         fe_eval.integrate(EvaluationFlags::values);
         fe_eval.distribute_local_to_global(inv_mass_matrix);
@@ -203,7 +202,7 @@ namespace Step48
         current.evaluate(EvaluationFlags::values | EvaluationFlags::gradients);
         old.evaluate(EvaluationFlags::values);
 
-        for (unsigned int q = 0; q < current.n_q_points; ++q)
+        for (const unsigned int q : current.quadrature_point_indices())
           {
             const VectorizedArray<double> current_value = current.get_value(q);
             const VectorizedArray<double> old_value     = old.get_value(q);
index 3a011521ee5ea8936dfac9214a775eb73c1fd3fa..8a3a1805664bd41503472bfcecb56a5f8a88ac7b 100644 (file)
@@ -249,8 +249,7 @@ Coefficient<dim>::make_coefficient_table(
 
   FEEvaluation<dim, -1, 0, 1, number> fe_eval(mf_storage);
 
-  const unsigned int n_cells    = mf_storage.n_cell_batches();
-  const unsigned int n_q_points = fe_eval.n_q_points;
+  const unsigned int n_cells = mf_storage.n_cell_batches();
 
   coefficient_table->reinit(n_cells, 1);
 
@@ -259,9 +258,9 @@ Coefficient<dim>::make_coefficient_table(
       fe_eval.reinit(cell);
 
       VectorizedArray<number> average_value = 0.;
-      for (unsigned int q = 0; q < n_q_points; ++q)
+      for (const unsigned int q : fe_eval.quadrature_point_indices())
         average_value += value(fe_eval.quadrature_point(q));
-      average_value /= n_q_points;
+      average_value /= fe_eval.n_q_points;
 
       (*coefficient_table)(cell, 0) = average_value;
     }
@@ -948,7 +947,7 @@ void LaplaceProblem<dim, degree>::assemble_rhs()
       phi.read_dof_values_plain(solution_copy);
       phi.evaluate(EvaluationFlags::gradients);
 
-      for (unsigned int q = 0; q < phi.n_q_points; ++q)
+      for (const unsigned int q : phi.quadrature_point_indices())
         {
           phi.submit_gradient(-1.0 *
                                 (coefficient(cell, 0) * phi.get_gradient(q)),
index 32a4d8f971e880e9abebb1923e1e8730c623d89a..426d61a217bbc307acf46342d5bd8b6976d111be 100644 (file)
@@ -484,7 +484,7 @@ namespace Step59
       {
         phi.reinit(cell);
         phi.gather_evaluate(src, EvaluationFlags::gradients);
-        for (unsigned int q = 0; q < phi.n_q_points; ++q)
+        for (const unsigned int q : phi.quadrature_point_indices())
           phi.submit_gradient(phi.get_gradient(q), q);
         phi.integrate_scatter(EvaluationFlags::gradients, dst);
       }
@@ -600,7 +600,7 @@ namespace Step59
         // accordance with its relation to the primal consistency term that
         // gets the factor of one half due to the average in the test function
         // slot.
-        for (unsigned int q = 0; q < phi_inner.n_q_points; ++q)
+        for (const unsigned int q : phi_inner.quadrature_point_indices())
           {
             const VectorizedArray<number> solution_jump =
               (phi_inner.get_value(q) - phi_outer.get_value(q));
@@ -687,7 +687,7 @@ namespace Step59
 
         const bool is_dirichlet = (data.get_boundary_id(face) == 0);
 
-        for (unsigned int q = 0; q < phi_inner.n_q_points; ++q)
+        for (const unsigned int q : phi_inner.quadrature_point_indices())
           {
             const VectorizedArray<number> u_inner = phi_inner.get_value(q);
             const VectorizedArray<number> u_outer =
@@ -1085,7 +1085,7 @@ namespace Step59
     for (unsigned int cell = 0; cell < data.n_cell_batches(); ++cell)
       {
         phi.reinit(cell);
-        for (unsigned int q = 0; q < phi.n_q_points; ++q)
+        for (const unsigned int q : phi.quadrature_point_indices())
           {
             VectorizedArray<double> rhs_val = VectorizedArray<double>();
             Point<dim, VectorizedArray<double>> point_batch =
@@ -1138,7 +1138,7 @@ namespace Step59
         const VectorizedArray<double> sigma =
           inverse_length_normal_to_face * system_matrix.get_penalty_factor();
 
-        for (unsigned int q = 0; q < phi_face.n_q_points; ++q)
+        for (const unsigned int q : phi_face.quadrature_point_indices())
           {
             VectorizedArray<double> test_value = VectorizedArray<double>(),
                                     test_normal_derivative =
index 5536ac010196ee1731fe683664c75943bfeb2245..e0026d4671d1aa24325e4ded8d4df61164802993 100644 (file)
@@ -265,7 +265,7 @@ void JacobianOperator<dim, fe_degree, number>::evaluate_newton_step(
       phi.read_dof_values_plain(newton_step);
       phi.evaluate(EvaluationFlags::values);
 
-      for (unsigned int q = 0; q < phi.n_q_points; ++q)
+      for (const unsigned int q : phi.quadrature_point_indices())
         {
           nonlinear_values(cell, q) = std::exp(phi.get_value(q));
         }
index fca5ca204e83eb7d8b13aa7c6f9edb43325da4a1..e407742ed4a17071dd4c03b47a9f14bde3fd8e39 100644 (file)
@@ -208,7 +208,7 @@ namespace Step66
         phi.read_dof_values_plain(newton_step);
         phi.evaluate(EvaluationFlags::values);
 
-        for (unsigned int q = 0; q < phi.n_q_points; ++q)
+        for (const unsigned int q : phi.quadrature_point_indices())
           {
             nonlinear_values(cell, q) = std::exp(phi.get_value(q));
           }
@@ -250,7 +250,7 @@ namespace Step66
                             EvaluationFlags::values |
                               EvaluationFlags::gradients);
 
-        for (unsigned int q = 0; q < phi.n_q_points; ++q)
+        for (const unsigned int q : phi.quadrature_point_indices())
           {
             phi.submit_value(-nonlinear_values(cell, q) * phi.get_value(q), q);
             phi.submit_gradient(phi.get_gradient(q), q);
@@ -295,7 +295,7 @@ namespace Step66
 
     phi.evaluate(EvaluationFlags::values | EvaluationFlags::gradients);
 
-    for (unsigned int q = 0; q < phi.n_q_points; ++q)
+    for (const unsigned int q : phi.quadrature_point_indices())
       {
         phi.submit_value(-nonlinear_values(cell, q) * phi.get_value(q), q);
         phi.submit_gradient(phi.get_gradient(q), q);
@@ -687,7 +687,7 @@ namespace Step66
         phi.read_dof_values_plain(src);
         phi.evaluate(EvaluationFlags::values | EvaluationFlags::gradients);
 
-        for (unsigned int q = 0; q < phi.n_q_points; ++q)
+        for (const unsigned int q : phi.quadrature_point_indices())
           {
             phi.submit_value(-std::exp(phi.get_value(q)), q);
             phi.submit_gradient(phi.get_gradient(q), q);
index a85d7ddc1163059048ab5a96ba79e26f47e48beb..fce6cada782e696db974459fd17580ea2a7fd05a 100644 (file)
@@ -1031,7 +1031,7 @@ namespace Euler_DG
         phi.reinit(cell);
         phi.gather_evaluate(src, EvaluationFlags::values);
 
-        for (unsigned int q = 0; q < phi.n_q_points; ++q)
+        for (const unsigned int q : phi.quadrature_point_indices())
           {
             const auto w_q = phi.get_value(q);
             phi.submit_gradient(euler_flux<dim>(w_q), q);
@@ -1120,7 +1120,7 @@ namespace Euler_DG
         phi_m.reinit(face);
         phi_m.gather_evaluate(src, EvaluationFlags::values);
 
-        for (unsigned int q = 0; q < phi_m.n_q_points; ++q)
+        for (const unsigned int q : phi_m.quadrature_point_indices())
           {
             const auto numerical_flux =
               euler_numerical_flux<dim>(phi_m.get_value(q),
@@ -1202,7 +1202,7 @@ namespace Euler_DG
         phi.reinit(face);
         phi.gather_evaluate(src, EvaluationFlags::values);
 
-        for (unsigned int q = 0; q < phi.n_q_points; ++q)
+        for (const unsigned int q : phi.quadrature_point_indices())
           {
             const auto w_m    = phi.get_value(q);
             const auto normal = phi.normal_vector(q);
@@ -1546,7 +1546,7 @@ namespace Euler_DG
     for (unsigned int cell = 0; cell < data.n_cell_batches(); ++cell)
       {
         phi.reinit(cell);
-        for (unsigned int q = 0; q < phi.n_q_points; ++q)
+        for (const unsigned int q : phi.quadrature_point_indices())
           phi.submit_dof_value(evaluate_function(function,
                                                  phi.quadrature_point(q)),
                                q);
@@ -1596,7 +1596,7 @@ namespace Euler_DG
         phi.reinit(cell);
         phi.gather_evaluate(solution, EvaluationFlags::values);
         VectorizedArray<Number> local_errors_squared[3] = {};
-        for (unsigned int q = 0; q < phi.n_q_points; ++q)
+        for (const unsigned int q : phi.quadrature_point_indices())
           {
             const auto error =
               evaluate_function(function, phi.quadrature_point(q)) -
@@ -1678,7 +1678,7 @@ namespace Euler_DG
         phi.reinit(cell);
         phi.gather_evaluate(solution, EvaluationFlags::values);
         VectorizedArray<Number> local_max = 0.;
-        for (unsigned int q = 0; q < phi.n_q_points; ++q)
+        for (const unsigned int q : phi.quadrature_point_indices())
           {
             const auto solution = phi.get_value(q);
             const auto velocity = euler_velocity<dim>(solution);
index f4e3fc794b8beafa2ab29cb6e98184cceb55f4dc..0700a382c85ee41b164305c41148a313921b4f27 100644 (file)
@@ -490,7 +490,7 @@ namespace Step75
   {
     integrator.evaluate(EvaluationFlags::gradients);
 
-    for (unsigned int q = 0; q < integrator.n_q_points; ++q)
+    for (const unsigned int q : integrator.quadrature_point_indices())
       integrator.submit_gradient(integrator.get_gradient(q), q);
 
     integrator.integrate(EvaluationFlags::gradients);
@@ -507,7 +507,7 @@ namespace Step75
   {
     integrator.gather_evaluate(src, EvaluationFlags::gradients);
 
-    for (unsigned int q = 0; q < integrator.n_q_points; ++q)
+    for (const unsigned int q : integrator.quadrature_point_indices())
       integrator.submit_gradient(integrator.get_gradient(q), q);
 
     integrator.integrate_scatter(EvaluationFlags::gradients, dst);
index 333c8c245ed3884c1ceefddedb735d2c1463d8ff..f08dfd4c14a7fc515a86ff8251ad556f292d8f72 100644 (file)
@@ -709,7 +709,7 @@ namespace Euler_DG
             // Apply the cell integral at the cell quadrature points. See also
             // the function <code>EulerOperator::local_apply_cell()</code> from
             // step-67:
-            for (unsigned int q = 0; q < phi.n_q_points; ++q)
+            for (const unsigned int q : phi.quadrature_point_indices())
               {
                 const auto w_q = phi.get_value(q);
                 phi.submit_gradient(euler_flux<dim>(w_q), q);
@@ -807,7 +807,8 @@ namespace Euler_DG
                     phi_p.reinit(cell, face);
                     phi_p.gather_evaluate(src, EvaluationFlags::values);
 
-                    for (unsigned int q = 0; q < phi_m.n_q_points; ++q)
+                    for (const unsigned int q :
+                         phi_m.quadrature_point_indices())
                       {
                         const auto numerical_flux =
                           euler_numerical_flux<dim>(phi_m.get_value(q),
@@ -822,7 +823,8 @@ namespace Euler_DG
                     // are a copy of the function
                     // <code>EulerDG::EulerOperator::local_apply_boundary_face</code>
                     // from step-67:
-                    for (unsigned int q = 0; q < phi_m.n_q_points; ++q)
+                    for (const unsigned int q :
+                         phi_m.quadrature_point_indices())
                       {
                         const auto w_m    = phi_m.get_value(q);
                         const auto normal = phi_m.normal_vector(q);
@@ -1057,7 +1059,7 @@ namespace Euler_DG
     for (unsigned int cell = 0; cell < data.n_cell_batches(); ++cell)
       {
         phi.reinit(cell);
-        for (unsigned int q = 0; q < phi.n_q_points; ++q)
+        for (const unsigned int q : phi.quadrature_point_indices())
           phi.submit_dof_value(evaluate_function(function,
                                                  phi.quadrature_point(q)),
                                q);
@@ -1085,7 +1087,7 @@ namespace Euler_DG
         phi.reinit(cell);
         phi.gather_evaluate(solution, EvaluationFlags::values);
         VectorizedArrayType local_errors_squared[3] = {};
-        for (unsigned int q = 0; q < phi.n_q_points; ++q)
+        for (const unsigned int q : phi.quadrature_point_indices())
           {
             const auto error =
               evaluate_function(function, phi.quadrature_point(q)) -
@@ -1128,7 +1130,7 @@ namespace Euler_DG
         phi.reinit(cell);
         phi.gather_evaluate(solution, EvaluationFlags::values);
         VectorizedArrayType local_max = 0.;
-        for (unsigned int q = 0; q < phi.n_q_points; ++q)
+        for (const unsigned int q : phi.quadrature_point_indices())
           {
             const auto solution = phi.get_value(q);
             const auto velocity = euler_velocity<dim>(solution);
index b7bea87b8eb9030f0942d8d663e9ff1c1341b43b..255edc3cf07d520160b842cc72203a392eb18a19 100644 (file)
@@ -195,7 +195,7 @@ public:
       compute_diagonal<dim, -1, 0, 1, number, VectorizedArray<number>>(
         data, inverse_diagonal_entries->get_vector(), [](auto &eval) {
           eval.evaluate(EvaluationFlags::gradients);
-          for (unsigned int q = 0; q < eval.n_q_points; ++q)
+          for (const unsigned int q : eval.quadrature_point_indices())
             eval.submit_gradient(eval.get_gradient(q), q);
           eval.integrate(EvaluationFlags::gradients);
         });
@@ -232,7 +232,7 @@ private:
       {
         eval.reinit(cell);
         eval.gather_evaluate(src, EvaluationFlags::gradients);
-        for (unsigned int q = 0; q < eval.n_q_points; ++q)
+        for (const unsigned int q : eval.quadrature_point_indices())
           eval.submit_gradient(eval.get_gradient(q), q);
         eval.integrate_scatter(EvaluationFlags::gradients, dst);
       }
@@ -462,8 +462,8 @@ LaplaceProblem<dim>::create_coarse_triangulations()
 {
   coarse_triangulations =
     MGTransferGlobalCoarseningTools::create_geometric_coarsening_sequence(
-      triangulation/*,
-                     RepartitioningPolicyTools::MinimalGranularityPolicy<dim>(16)*/);
+      triangulation,
+      RepartitioningPolicyTools::MinimalGranularityPolicy<dim>(16));
 }
 
 
@@ -662,7 +662,7 @@ LaplaceProblem<dim>::compute_rhs()
           eval.reinit(cell);
           dg_eval.reinit(cell);
           dg_eval.gather_evaluate(dg_rhs, EvaluationFlags::values);
-          for (unsigned int q = 0; q < eval.n_q_points; ++q)
+          for (const unsigned int q : eval.quadrature_point_indices())
             eval.submit_value(dg_eval.get_value(q), q);
           eval.integrate_scatter(EvaluationFlags::values, rhs);
         }
index 8050242eaa4b053a1be2d7d47781a5816ff2216f..6eaee3aeaa00649d9adccd1dc336d15ebbf111ef 100644 (file)
@@ -723,7 +723,7 @@ namespace NavierStokes_DG
         for (unsigned int i = 0; i < phi.static_n_q_points * (dim + 2); ++i)
           buffer[i] = phi.begin_values()[i];
 
-        for (unsigned int q = 0; q < phi.n_q_points; ++q)
+        for (const unsigned int q : phi.quadrature_point_indices())
           {
             const auto w_q      = phi.get_value(q);
             const auto grad_w_q = phi.get_gradient(q);
@@ -854,7 +854,7 @@ namespace NavierStokes_DG
                              phi_p.inverse_jacobian(0))[dim - 1])) *
                   Number(viscosity * (degree + 1) * (degree + 1));
 
-                for (unsigned int q = 0; q < phi_m.n_q_points; ++q)
+                for (const unsigned int q : phi_m.quadrature_point_indices())
                   {
                     const auto w_m    = phi_m.get_value(q);
                     const auto w_p    = phi_p.get_value(q);
@@ -889,7 +889,7 @@ namespace NavierStokes_DG
                             phi_m.inverse_jacobian(0))[dim - 1]) *
                   Number(2. * viscosity * (degree + 1) * (degree + 1));
 
-                for (unsigned int q = 0; q < phi_m.n_q_points; ++q)
+                for (const unsigned int q : phi_m.quadrature_point_indices())
                   {
                     const auto w_m      = phi_m.get_value(q);
                     const auto normal   = phi_m.normal_vector(q);
@@ -1163,7 +1163,7 @@ namespace NavierStokes_DG
                             EvaluationFlags::values |
                               EvaluationFlags::gradients);
 
-        for (unsigned int q = 0; q < phi.n_q_points; ++q)
+        for (const unsigned int q : quadrature_point_indices())
           {
             const auto w_q      = phi.get_value(q);
             const auto grad_w_q = phi.get_gradient(q);
@@ -1234,7 +1234,7 @@ namespace NavierStokes_DG
                                        phi_p.inverse_jacobian(0))[dim - 1])) *
                             Number(viscosity * (degree + 1) * (degree + 1));
 
-        for (unsigned int q = 0; q < phi_m.n_q_points; ++q)
+        for (const unsigned int q : phi_m.quadrature_point_indices())
           {
             const auto w_m      = phi_m.get_value(q);
             const auto w_p      = phi_p.get_value(q);
@@ -1302,7 +1302,7 @@ namespace NavierStokes_DG
 
         const auto boundary_id = data.get_boundary_id(face);
 
-        for (unsigned int q = 0; q < phi_m.n_q_points; ++q)
+        for (const unsigned int q : phi_m.quadrature_point_indices())
           {
             const auto w_m      = phi_m.get_value(q);
             const auto normal   = phi_m.normal_vector(q);
@@ -1507,7 +1507,7 @@ namespace NavierStokes_DG
     for (unsigned int cell = 0; cell < data.n_cell_batches(); ++cell)
       {
         phi.reinit(cell);
-        for (unsigned int q = 0; q < phi.n_q_points; ++q)
+        for (const unsigned int q : phi.quadrature_point_indices())
           phi.submit_dof_value(evaluate_function(function,
                                                  phi.quadrature_point(q)),
                                q);
@@ -1535,7 +1535,7 @@ namespace NavierStokes_DG
         phi.reinit(cell);
         phi.gather_evaluate(solution, EvaluationFlags::values);
         VectorizedArrayType local_errors_squared[3] = {};
-        for (unsigned int q = 0; q < phi.n_q_points; ++q)
+        for (const unsigned int q : phi.quadrature_point_indices())
           {
             const auto error =
               evaluate_function(function, phi.quadrature_point(q)) -
@@ -1580,7 +1580,7 @@ namespace NavierStokes_DG
                             EvaluationFlags::values |
                               EvaluationFlags::gradients);
         VectorizedArrayType local_squared[2] = {};
-        for (unsigned int q = 0; q < phi.n_q_points; ++q)
+        for (const unsigned int q : phi.quadrature_point_indices())
           {
             const auto JxW      = phi.JxW(q);
             const auto w_q      = phi.get_value(q);
@@ -1622,7 +1622,7 @@ namespace NavierStokes_DG
         phi.reinit(cell);
         phi.gather_evaluate(solution, EvaluationFlags::values);
         VectorizedArrayType local_max = 0.;
-        for (unsigned int q = 0; q < phi.n_q_points; ++q)
+        for (const unsigned int q : phi.quadrature_point_indices())
           {
             const auto solution = phi.get_value(q);
             const auto velocity = fluid_velocity<dim>(solution);
index 49e00d68953cc1c963c34755482e57e6039fd604..4fffa02e321be2a5f16c10b8b5e7eb0a4faa6364 100644 (file)
@@ -147,7 +147,7 @@ LaplaceOperator<dim, fe_degree, number>::local_apply(
     {
       phi.reinit(cell);
       phi.gather_evaluate(src, EvaluationFlags::gradients);
-      for (unsigned int q = 0; q < phi.n_q_points; ++q)
+      for (const unsigned int q : phi.quadrature_point_indices())
         phi.submit_gradient(phi.get_gradient(q), q);
       phi.integrate_scatter(EvaluationFlags::gradients, dst);
     }
@@ -252,7 +252,7 @@ LaplaceOperator<dim, fe_degree, number>::local_compute_diagonal(
           phi.submit_dof_value(make_vectorized_array<number>(1.), i);
 
           phi.evaluate(EvaluationFlags::gradients);
-          for (unsigned int q = 0; q < phi.n_q_points; ++q)
+          for (const unsigned int q : phi.quadrature_point_indices())
             phi.submit_gradient(phi.get_gradient(q), q);
           phi.integrate(EvaluationFlags::gradients);
           diagonal[i] = phi.get_dof_value(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.