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);
++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);
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));
}
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);
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);
++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);
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);
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);
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);
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;
}
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)),
{
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);
}
// 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));
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 =
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 =
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 =
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));
}
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));
}
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);
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);
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);
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);
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),
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);
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);
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)) -
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);
{
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);
{
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);
// 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);
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),
// 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);
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);
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)) -
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);
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);
});
{
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);
}
{
coarse_triangulations =
MGTransferGlobalCoarseningTools::create_geometric_coarsening_sequence(
- triangulation/*,
- RepartitioningPolicyTools::MinimalGranularityPolicy<dim>(16)*/);
+ triangulation,
+ RepartitioningPolicyTools::MinimalGranularityPolicy<dim>(16));
}
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);
}
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);
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);
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);
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);
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);
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);
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);
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)) -
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);
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);
{
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);
}
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);