@@ -209,8 +209,6 @@ template <int dim, typename number>
209
209
void
210
210
NavierStokesOperatorBase<dim, number>::compute_element_size()
211
211
{
212
- FECellIntegrator phi (matrix_free);
213
-
214
212
const unsigned int n_cells =
215
213
matrix_free.n_cell_batches () + matrix_free.n_ghost_cell_batches ();
216
214
element_size.resize (n_cells);
@@ -447,25 +445,25 @@ NavierStokesOperatorBase<dim, number>::evaluate_non_linear_term(
447
445
const VectorType &newton_step)
448
446
{
449
447
const unsigned int n_cells = matrix_free.n_cell_batches ();
450
- FECellIntegrator phi (matrix_free);
448
+ FECellIntegrator integrator (matrix_free);
451
449
452
- nonlinear_previous_values.reinit (n_cells, phi .n_q_points );
453
- nonlinear_previous_gradient.reinit (n_cells, phi .n_q_points );
454
- nonlinear_previous_hessian_diagonal.reinit (n_cells, phi .n_q_points );
450
+ nonlinear_previous_values.reinit (n_cells, integrator .n_q_points );
451
+ nonlinear_previous_gradient.reinit (n_cells, integrator .n_q_points );
452
+ nonlinear_previous_hessian_diagonal.reinit (n_cells, integrator .n_q_points );
455
453
456
454
for (unsigned int cell = 0 ; cell < n_cells; ++cell)
457
455
{
458
- phi .reinit (cell);
459
- phi .read_dof_values_plain (newton_step);
460
- phi .evaluate (EvaluationFlags::values | EvaluationFlags::gradients |
461
- EvaluationFlags::hessians);
456
+ integrator .reinit (cell);
457
+ integrator .read_dof_values_plain (newton_step);
458
+ integrator .evaluate (EvaluationFlags::values | EvaluationFlags::gradients |
459
+ EvaluationFlags::hessians);
462
460
463
- for (unsigned int q = 0 ; q < phi. n_q_points ; ++q )
461
+ for (const auto q : integrator. quadrature_point_indices () )
464
462
{
465
- nonlinear_previous_values (cell, q) = phi .get_value (q);
466
- nonlinear_previous_gradient (cell, q) = phi .get_gradient (q);
463
+ nonlinear_previous_values (cell, q) = integrator .get_value (q);
464
+ nonlinear_previous_gradient (cell, q) = integrator .get_gradient (q);
467
465
nonlinear_previous_hessian_diagonal (cell, q) =
468
- phi .get_hessian_diagonal (q);
466
+ integrator .get_hessian_diagonal (q);
469
467
}
470
468
}
471
469
}
@@ -477,17 +475,17 @@ NavierStokesOperatorBase<dim, number>::
477
475
const VectorType &time_derivative_previous_solutions)
478
476
{
479
477
const unsigned int n_cells = matrix_free.n_cell_batches ();
480
- FECellIntegrator phi (matrix_free);
478
+ FECellIntegrator integrator (matrix_free);
481
479
482
- time_derivatives_previous_solutions.reinit (n_cells, phi .n_q_points );
480
+ time_derivatives_previous_solutions.reinit (n_cells, integrator .n_q_points );
483
481
484
482
for (unsigned int cell = 0 ; cell < n_cells; ++cell)
485
483
{
486
- phi .reinit (cell);
487
- phi .read_dof_values_plain (time_derivative_previous_solutions);
488
- phi .evaluate (EvaluationFlags::values);
489
- for (unsigned int q = 0 ; q < phi. n_q_points ; ++q )
490
- time_derivatives_previous_solutions (cell, q) += phi .get_value (q);
484
+ integrator .reinit (cell);
485
+ integrator .read_dof_values_plain (time_derivative_previous_solutions);
486
+ integrator .evaluate (EvaluationFlags::values);
487
+ for (const auto q : integrator. quadrature_point_indices () )
488
+ time_derivatives_previous_solutions (cell, q) += integrator .get_value (q);
491
489
}
492
490
}
493
491
@@ -591,7 +589,7 @@ NavierStokesSUPGPSPGOperator<dim, number>::do_cell_integral_local(
591
589
592
590
const auto h = integrator.read_cell_data (this ->get_element_size ());
593
591
594
- for (unsigned int q = 0 ; q < integrator.n_q_points ; ++q )
592
+ for (const auto q : integrator.quadrature_point_indices () )
595
593
{
596
594
// Evaluate source term function
597
595
Tensor<1 , dim + 1 , VectorizedArray<number>> source_value;
@@ -731,7 +729,7 @@ NavierStokesSUPGPSPGOperator<dim, number>::local_evaluate_residual(
731
729
732
730
const auto h = integrator.read_cell_data (this ->get_element_size ());
733
731
734
- for (unsigned int q = 0 ; q < integrator.n_q_points ; ++q )
732
+ for (const auto q : integrator.quadrature_point_indices () )
735
733
{
736
734
// Evaluate source term function
737
735
Tensor<1 , dim + 1 , VectorizedArray<number>> source_value;
@@ -864,7 +862,7 @@ NavierStokesTransientSUPGPSPGOperator<dim, number>::do_cell_integral_local(
864
862
const double sdt = 1 . / dt;
865
863
Vector<double > bdf_coefs = bdf_coefficients (method, time_steps_vector);
866
864
867
- for (unsigned int q = 0 ; q < integrator.n_q_points ; ++q )
865
+ for (const auto q : integrator.quadrature_point_indices () )
868
866
{
869
867
// Evaluate source term function
870
868
Tensor<1 , dim + 1 , VectorizedArray<number>> source_value;
@@ -1023,7 +1021,7 @@ NavierStokesTransientSUPGPSPGOperator<dim, number>::local_evaluate_residual(
1023
1021
const double sdt = 1 . / dt;
1024
1022
Vector<double > bdf_coefs = bdf_coefficients (method, time_steps_vector);
1025
1023
1026
- for (unsigned int q = 0 ; q < integrator.n_q_points ; ++q )
1024
+ for (const auto q : integrator.quadrature_point_indices () )
1027
1025
{
1028
1026
// Evaluate source term function
1029
1027
Tensor<1 , dim + 1 , VectorizedArray<number>> source_value;
0 commit comments