From ca1927c7fb0e3962217dfe3cf0cfce2d0bd0991a Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 17 Mar 2023 18:13:31 -0600 Subject: [PATCH] Make it more obvious that evaluation points are not quadrature points. --- examples/step-29/step-29.cc | 12 ++++++------ examples/step-32/step-32.cc | 24 ++++++++++++------------ examples/step-33/step-33.cc | 24 ++++++++++++------------ examples/step-58/step-58.cc | 22 +++++++++++----------- examples/step-67/step-67.cc | 14 +++++++------- examples/step-76/step-76.cc | 14 +++++++------- 6 files changed, 55 insertions(+), 55 deletions(-) diff --git a/examples/step-29/step-29.cc b/examples/step-29/step-29.cc index 1de9f21274..57f68cd6dd 100644 --- a/examples/step-29/step-29.cc +++ b/examples/step-29/step-29.cc @@ -336,15 +336,15 @@ namespace Step29 // should return the square 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 u(inputs.solution_values[i](0), - inputs.solution_values[i](1)); + const std::complex 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); } } diff --git a/examples/step-32/step-32.cc b/examples/step-32/step-32.cc index b12d84da11..858dd93168 100644 --- a/examples/step-32/step-32.cc +++ b/examples/step-32/step-32.cc @@ -3058,34 +3058,34 @@ namespace Step32 const DataPostprocessorInputs::Vector &inputs, std::vector> & 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; } } diff --git a/examples/step-33/step-33.cc b/examples/step-33/step-33.cc index 727a3871fd..5a28eb6aa3 100644 --- a/examples/step-33/step-33.cc +++ b/examples/step-33/step-33.cc @@ -567,13 +567,13 @@ namespace Step33 // this because we say so in the get_needed_update_flags() // 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 // first_momentum_component and // density_component 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]; } } diff --git a/examples/step-58/step-58.cc b/examples/step-58/step-58.cc index f995e1ff68..32f55051c3 100644 --- a/examples/step-58/step-58.cc +++ b/examples/step-58/step-58.cc @@ -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 psi(inputs.solution_values[q](0), - inputs.solution_values[q](1)); - computed_quantities[q](0) = std::norm(psi); + const std::complex 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(inputs.solution_values[q](0), - inputs.solution_values[q](1)))); + std::complex(inputs.solution_values[p](0), + inputs.solution_values[p](1)))); } for (auto &output : computed_quantities) diff --git a/examples/step-67/step-67.cc b/examples/step-67/step-67.cc index a596657ca9..c76c6e09db 100644 --- a/examples/step-67/step-67.cc +++ b/examples/step-67/step-67.cc @@ -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(solution); const double pressure = euler_pressure(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]; } } diff --git a/examples/step-76/step-76.cc b/examples/step-76/step-76.cc index adb5c45cf5..79b888b576 100644 --- a/examples/step-76/step-76.cc +++ b/examples/step-76/step-76.cc @@ -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(solution); const double pressure = euler_pressure(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]; } } -- 2.39.5