// 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);
}
}
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;
}
}
// 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,
// 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];
}
}
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);
}
}
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)
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];
}
}
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];
}
}