]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make it more obvious that evaluation points are not quadrature points. 14910/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Sat, 18 Mar 2023 00:13:31 +0000 (18:13 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Sat, 18 Mar 2023 00:13:31 +0000 (18:13 -0600)
examples/step-29/step-29.cc
examples/step-32/step-32.cc
examples/step-33/step-33.cc
examples/step-58/step-58.cc
examples/step-67/step-67.cc
examples/step-76/step-76.cc

index 1de9f212746a70b8f66af11a70ad8040f3c748f6..57f68cd6dd0fd1a603ffc2b065b2c9054effe24c 100644 (file)
@@ -336,15 +336,15 @@ namespace Step29
     // should return the <i>square</i> of the absolute value --
     // thereby not satisfying the properties mathematicians require of
     // something called a "norm".)
-    for (unsigned int i = 0; i < computed_quantities.size(); ++i)
+    for (unsigned int p = 0; p < computed_quantities.size(); ++p)
       {
-        AssertDimension(computed_quantities[i].size(), 1);
-        AssertDimension(inputs.solution_values[i].size(), 2);
+        AssertDimension(computed_quantities[p].size(), 1);
+        AssertDimension(inputs.solution_values[p].size(), 2);
 
-        const std::complex<double> u(inputs.solution_values[i](0),
-                                     inputs.solution_values[i](1));
+        const std::complex<double> u(inputs.solution_values[p](0),
+                                     inputs.solution_values[p](1));
 
-        computed_quantities[i](0) = std::abs(u);
+        computed_quantities[p](0) = std::abs(u);
       }
   }
 
index b12d84da115ba1836487bfc0e4bbf56fcf407891..858dd931689710b47127e2c24278fc19b6dbe173 100644 (file)
@@ -3058,34 +3058,34 @@ namespace Step32
     const DataPostprocessorInputs::Vector<dim> &inputs,
     std::vector<Vector<double>> &               computed_quantities) const
   {
-    const unsigned int n_quadrature_points = inputs.solution_values.size();
-    Assert(inputs.solution_gradients.size() == n_quadrature_points,
+    const unsigned int n_evaluation_points = inputs.solution_values.size();
+    Assert(inputs.solution_gradients.size() == n_evaluation_points,
            ExcInternalError());
-    Assert(computed_quantities.size() == n_quadrature_points,
+    Assert(computed_quantities.size() == n_evaluation_points,
            ExcInternalError());
     Assert(inputs.solution_values[0].size() == dim + 2, ExcInternalError());
 
-    for (unsigned int q = 0; q < n_quadrature_points; ++q)
+    for (unsigned int p = 0; p < n_evaluation_points; ++p)
       {
         for (unsigned int d = 0; d < dim; ++d)
-          computed_quantities[q](d) = (inputs.solution_values[q](d) *
+          computed_quantities[p](d) = (inputs.solution_values[p](d) *
                                        EquationData::year_in_seconds * 100);
 
         const double pressure =
-          (inputs.solution_values[q](dim) - minimal_pressure);
-        computed_quantities[q](dim) = pressure;
+          (inputs.solution_values[p](dim) - minimal_pressure);
+        computed_quantities[p](dim) = pressure;
 
-        const double temperature        = inputs.solution_values[q](dim + 1);
-        computed_quantities[q](dim + 1) = temperature;
+        const double temperature        = inputs.solution_values[p](dim + 1);
+        computed_quantities[p](dim + 1) = temperature;
 
         Tensor<2, dim> grad_u;
         for (unsigned int d = 0; d < dim; ++d)
-          grad_u[d] = inputs.solution_gradients[q][d];
+          grad_u[d] = inputs.solution_gradients[p][d];
         const SymmetricTensor<2, dim> strain_rate = symmetrize(grad_u);
-        computed_quantities[q](dim + 2) =
+        computed_quantities[p](dim + 2) =
           2 * EquationData::eta * strain_rate * strain_rate;
 
-        computed_quantities[q](dim + 3) = partition;
+        computed_quantities[p](dim + 3) = partition;
       }
   }
 
index 727a3871fd5bec79faeb26e656a2cc0f64f024c0..5a28eb6aa392ef6ddd303d0b355f5cfd91bb97a7 100644 (file)
@@ -567,13 +567,13 @@ namespace Step33
     // this because we say so in the <code>get_needed_update_flags()</code>
     // function below). For the inner vectors, we check that at least the first
     // element of the outer vector has the correct inner size:
-    const unsigned int n_quadrature_points = inputs.solution_values.size();
+    const unsigned int n_evaluation_points = inputs.solution_values.size();
 
     if (do_schlieren_plot == true)
-      Assert(inputs.solution_gradients.size() == n_quadrature_points,
+      Assert(inputs.solution_gradients.size() == n_evaluation_points,
              ExcInternalError());
 
-    Assert(computed_quantities.size() == n_quadrature_points,
+    Assert(computed_quantities.size() == n_evaluation_points,
            ExcInternalError());
 
     Assert(inputs.solution_values[0].size() == n_components,
@@ -595,21 +595,21 @@ namespace Step33
     // variables in the input vector, using the
     // <code>first_momentum_component</code> and
     // <code>density_component</code> information:
-    for (unsigned int q = 0; q < n_quadrature_points; ++q)
+    for (unsigned int p = 0; p < n_evaluation_points; ++p)
       {
-        const double density = inputs.solution_values[q](density_component);
+        const double density = inputs.solution_values[p](density_component);
 
         for (unsigned int d = 0; d < dim; ++d)
-          computed_quantities[q](d) =
-            inputs.solution_values[q](first_momentum_component + d) / density;
+          computed_quantities[p](d) =
+            inputs.solution_values[p](first_momentum_component + d) / density;
 
-        computed_quantities[q](dim) =
-          compute_pressure(inputs.solution_values[q]);
+        computed_quantities[p](dim) =
+          compute_pressure(inputs.solution_values[p]);
 
         if (do_schlieren_plot == true)
-          computed_quantities[q](dim + 1) =
-            inputs.solution_gradients[q][density_component] *
-            inputs.solution_gradients[q][density_component];
+          computed_quantities[p](dim + 1) =
+            inputs.solution_gradients[p][density_component] *
+            inputs.solution_gradients[p][density_component];
       }
   }
 
index f995e1ff689291b0fab9ad7390cce2e20c16b58d..32f55051c3150bd94a29cd5a8f3c85fca7648978 100644 (file)
@@ -480,14 +480,14 @@ namespace Step58
       AssertDimension(computed_quantities.size(),
                       inputs.solution_values.size());
 
-      for (unsigned int q = 0; q < computed_quantities.size(); ++q)
+      for (unsigned int p = 0; p < computed_quantities.size(); ++p)
         {
-          AssertDimension(computed_quantities[q].size(), 1);
-          AssertDimension(inputs.solution_values[q].size(), 2);
+          AssertDimension(computed_quantities[p].size(), 1);
+          AssertDimension(inputs.solution_values[p].size(), 2);
 
-          const std::complex<double> psi(inputs.solution_values[q](0),
-                                         inputs.solution_values[q](1));
-          computed_quantities[q](0) = std::norm(psi);
+          const std::complex<double> psi(inputs.solution_values[p](0),
+                                         inputs.solution_values[p](1));
+          computed_quantities[p](0) = std::norm(psi);
         }
     }
 
@@ -537,16 +537,16 @@ namespace Step58
                       inputs.solution_values.size());
 
       double max_phase = -numbers::PI;
-      for (unsigned int q = 0; q < computed_quantities.size(); ++q)
+      for (unsigned int p = 0; p < computed_quantities.size(); ++p)
         {
-          AssertDimension(computed_quantities[q].size(), 1);
-          AssertDimension(inputs.solution_values[q].size(), 2);
+          AssertDimension(computed_quantities[p].size(), 1);
+          AssertDimension(inputs.solution_values[p].size(), 2);
 
           max_phase =
             std::max(max_phase,
                      std::arg(
-                       std::complex<double>(inputs.solution_values[q](0),
-                                            inputs.solution_values[q](1))));
+                       std::complex<double>(inputs.solution_values[p](0),
+                                            inputs.solution_values[p](1))));
         }
 
       for (auto &output : computed_quantities)
index a596657ca9d9d1e9d087f773477af5010884f2ef..c76c6e09db9a8cebdddf6e0bcd88ba17d81d5935 100644 (file)
@@ -1845,24 +1845,24 @@ namespace Euler_DG
              dim + 2 + (do_schlieren_plot == true ? 1 : 0),
            ExcInternalError());
 
-    for (unsigned int q = 0; q < n_evaluation_points; ++q)
+    for (unsigned int p = 0; p < n_evaluation_points; ++p)
       {
         Tensor<1, dim + 2> solution;
         for (unsigned int d = 0; d < dim + 2; ++d)
-          solution[d] = inputs.solution_values[q](d);
+          solution[d] = inputs.solution_values[p](d);
 
         const double         density  = solution[0];
         const Tensor<1, dim> velocity = euler_velocity<dim>(solution);
         const double         pressure = euler_pressure<dim>(solution);
 
         for (unsigned int d = 0; d < dim; ++d)
-          computed_quantities[q](d) = velocity[d];
-        computed_quantities[q](dim)     = pressure;
-        computed_quantities[q](dim + 1) = std::sqrt(gamma * pressure / density);
+          computed_quantities[p](d) = velocity[d];
+        computed_quantities[p](dim)     = pressure;
+        computed_quantities[p](dim + 1) = std::sqrt(gamma * pressure / density);
 
         if (do_schlieren_plot == true)
-          computed_quantities[q](dim + 2) =
-            inputs.solution_gradients[q][0] * inputs.solution_gradients[q][0];
+          computed_quantities[p](dim + 2) =
+            inputs.solution_gradients[p][0] * inputs.solution_gradients[p][0];
       }
   }
 
index adb5c45cf5aad778b1278498bdaf2df5cf3ca0fd..79b888b576175c670bf607586e17e5bfb5b590e7 100644 (file)
@@ -1262,24 +1262,24 @@ namespace Euler_DG
              dim + 2 + (do_schlieren_plot == true ? 1 : 0),
            ExcInternalError());
 
-    for (unsigned int q = 0; q < n_evaluation_points; ++q)
+    for (unsigned int p = 0; p < n_evaluation_points; ++p)
       {
         Tensor<1, dim + 2> solution;
         for (unsigned int d = 0; d < dim + 2; ++d)
-          solution[d] = inputs.solution_values[q](d);
+          solution[d] = inputs.solution_values[p](d);
 
         const double         density  = solution[0];
         const Tensor<1, dim> velocity = euler_velocity<dim>(solution);
         const double         pressure = euler_pressure<dim>(solution);
 
         for (unsigned int d = 0; d < dim; ++d)
-          computed_quantities[q](d) = velocity[d];
-        computed_quantities[q](dim)     = pressure;
-        computed_quantities[q](dim + 1) = std::sqrt(gamma * pressure / density);
+          computed_quantities[p](d) = velocity[d];
+        computed_quantities[p](dim)     = pressure;
+        computed_quantities[p](dim + 1) = std::sqrt(gamma * pressure / density);
 
         if (do_schlieren_plot == true)
-          computed_quantities[q](dim + 2) =
-            inputs.solution_gradients[q][0] * inputs.solution_gradients[q][0];
+          computed_quantities[p](dim + 2) =
+            inputs.solution_gradients[p][0] * inputs.solution_gradients[p][0];
       }
   }
 

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.