From: Wolfgang Bangerth Date: Thu, 11 Nov 2021 22:01:35 +0000 (-0700) Subject: Mark FEValuesExtrator objects as 'const'. X-Git-Tag: v9.4.0-rc1~846^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F12934%2Fhead;p=dealii.git Mark FEValuesExtrator objects as 'const'. --- diff --git a/examples/step-18/step-18.cc b/examples/step-18/step-18.cc index de93a76b2c..1b491be1be 100644 --- a/examples/step-18/step-18.cc +++ b/examples/step-18/step-18.cc @@ -1052,7 +1052,7 @@ namespace Step18 // which vector components it should apply to; this is a vector of bools // for each vector component and because we only want to restrict vertical // motion, it has only its last component set: - FEValuesExtractors::Scalar z_component(dim - 1); + const FEValuesExtractors::Scalar z_component(dim - 1); std::map boundary_values; VectorTools::interpolate_boundary_values(dof_handler, 0, diff --git a/examples/step-22/step-22.cc b/examples/step-22/step-22.cc index e9d9d4ade6..16ccdf0015 100644 --- a/examples/step-22/step-22.cc +++ b/examples/step-22/step-22.cc @@ -475,7 +475,7 @@ namespace Step22 { constraints.clear(); - FEValuesExtractors::Vector velocities(0); + const FEValuesExtractors::Vector velocities(0); DoFTools::make_hanging_node_constraints(dof_handler, constraints); VectorTools::interpolate_boundary_values(dof_handler, 1, @@ -961,7 +961,7 @@ namespace Step22 { Vector estimated_error_per_cell(triangulation.n_active_cells()); - FEValuesExtractors::Scalar pressure(dim); + const FEValuesExtractors::Scalar pressure(dim); KellyErrorEstimator::estimate( dof_handler, QGauss(degree + 1), diff --git a/examples/step-31/step-31.cc b/examples/step-31/step-31.cc index 4ab27fac42..7d6463e33c 100644 --- a/examples/step-31/step-31.cc +++ b/examples/step-31/step-31.cc @@ -1133,8 +1133,8 @@ namespace Step31 Amg_preconditioner = std::make_shared(); - std::vector> constant_modes; - FEValuesExtractors::Vector velocity_components(0); + std::vector> constant_modes; + const FEValuesExtractors::Vector velocity_components(0); DoFTools::extract_constant_modes(stokes_dof_handler, stokes_fe.component_mask( velocity_components), diff --git a/examples/step-32/step-32.cc b/examples/step-32/step-32.cc index 3562caa8a9..9fd86ff02d 100644 --- a/examples/step-32/step-32.cc +++ b/examples/step-32/step-32.cc @@ -1894,7 +1894,7 @@ namespace Step32 DoFTools::make_hanging_node_constraints(stokes_dof_handler, stokes_constraints); - FEValuesExtractors::Vector velocity_components(0); + const FEValuesExtractors::Vector velocity_components(0); VectorTools::interpolate_boundary_values( stokes_dof_handler, 0, @@ -2162,8 +2162,8 @@ namespace Step32 assemble_stokes_preconditioner(); - std::vector> constant_modes; - FEValuesExtractors::Vector velocity_components(0); + std::vector> constant_modes; + const FEValuesExtractors::Vector velocity_components(0); DoFTools::extract_constant_modes(stokes_dof_handler, stokes_fe.component_mask( velocity_components), diff --git a/examples/step-43/step-43.cc b/examples/step-43/step-43.cc index f44a9c8de5..7af90f333e 100644 --- a/examples/step-43/step-43.cc +++ b/examples/step-43/step-43.cc @@ -676,7 +676,7 @@ namespace Step43 { darcy_preconditioner_constraints.clear(); - FEValuesExtractors::Scalar pressure(dim); + const FEValuesExtractors::Scalar pressure(dim); DoFTools::make_hanging_node_constraints(darcy_dof_handler, darcy_preconditioner_constraints); diff --git a/examples/step-45/step-45.cc b/examples/step-45/step-45.cc index cf9e2806e2..488b526bc9 100644 --- a/examples/step-45/step-45.cc +++ b/examples/step-45/step-45.cc @@ -384,7 +384,7 @@ namespace Step45 constraints.clear(); constraints.reinit(locally_relevant_dofs); - FEValuesExtractors::Vector velocities(0); + const FEValuesExtractors::Vector velocities(0); DoFTools::make_hanging_node_constraints(dof_handler, constraints); VectorTools::interpolate_boundary_values(mapping, @@ -734,7 +734,7 @@ namespace Step45 { Vector estimated_error_per_cell(triangulation.n_active_cells()); - FEValuesExtractors::Scalar pressure(dim); + const FEValuesExtractors::Scalar pressure(dim); KellyErrorEstimator::estimate( dof_handler, QGauss(degree + 1), diff --git a/examples/step-47/step-47.cc b/examples/step-47/step-47.cc index 85e7a53613..44dfb405b9 100644 --- a/examples/step-47/step-47.cc +++ b/examples/step-47/step-47.cc @@ -831,8 +831,8 @@ namespace Step47 update_values | update_hessians | update_quadrature_points | update_JxW_values); - FEValuesExtractors::Scalar scalar(0); - const unsigned int n_q_points = quadrature_formula.size(); + const FEValuesExtractors::Scalar scalar(0); + const unsigned int n_q_points = quadrature_formula.size(); std::vector> exact_hessians(n_q_points); std::vector> hessians(n_q_points); diff --git a/examples/step-51/step-51.cc b/examples/step-51/step-51.cc index d707fb0898..60ec5c8901 100644 --- a/examples/step-51/step-51.cc +++ b/examples/step-51/step-51.cc @@ -1136,8 +1136,8 @@ namespace Step51 scratch.fe_values_local.reinit(loc_cell); scratch.fe_values.reinit(cell); - FEValuesExtractors::Vector fluxes(0); - FEValuesExtractors::Scalar scalar(dim); + const FEValuesExtractors::Vector fluxes(0); + const FEValuesExtractors::Scalar scalar(dim); const unsigned int n_q_points = scratch.fe_values.get_quadrature().size(); const unsigned int dofs_per_cell = scratch.fe_values.dofs_per_cell; @@ -1316,7 +1316,7 @@ namespace Step51 Vector estimated_error_per_cell( triangulation.n_active_cells()); - FEValuesExtractors::Scalar scalar(dim); + const FEValuesExtractors::Scalar scalar(dim); std::map *> neumann_boundary; KellyErrorEstimator::estimate(dof_handler_local, diff --git a/examples/step-55/step-55.cc b/examples/step-55/step-55.cc index 9f60ae8343..ce24b41f2b 100644 --- a/examples/step-55/step-55.cc +++ b/examples/step-55/step-55.cc @@ -390,7 +390,7 @@ namespace Step55 { constraints.reinit(locally_relevant_dofs); - FEValuesExtractors::Vector velocities(0); + const FEValuesExtractors::Vector velocities(0); DoFTools::make_hanging_node_constraints(dof_handler, constraints); VectorTools::interpolate_boundary_values(dof_handler, 0, diff --git a/examples/step-57/step-57.cc b/examples/step-57/step-57.cc index d932aa48b3..2ffc4d98cd 100644 --- a/examples/step-57/step-57.cc +++ b/examples/step-57/step-57.cc @@ -299,7 +299,7 @@ namespace Step57 // remain satisfied during Newton's iteration, zero boundary conditions are // used for the update $\delta u^k$. Therefore we set up two different // constraint objects. - FEValuesExtractors::Vector velocities(0); + const FEValuesExtractors::Vector velocities(0); { nonzero_constraints.clear(); @@ -563,7 +563,7 @@ namespace Step57 void StationaryNavierStokes::refine_mesh() { Vector estimated_error_per_cell(triangulation.n_active_cells()); - FEValuesExtractors::Vector velocity(0); + const FEValuesExtractors::Vector velocity(0); KellyErrorEstimator::estimate( dof_handler, QGauss(degree + 1), diff --git a/examples/step-70/step-70.cc b/examples/step-70/step-70.cc index 3e2d0360e9..1833fc9618 100644 --- a/examples/step-70/step-70.cc +++ b/examples/step-70/step-70.cc @@ -1240,7 +1240,7 @@ namespace Step70 { constraints.reinit(locally_relevant_dofs); - FEValuesExtractors::Vector velocities(0); + const FEValuesExtractors::Vector velocities(0); DoFTools::make_hanging_node_constraints(fluid_dh, constraints); VectorTools::interpolate_boundary_values( fluid_dh,