]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Mark FEValuesExtrator objects as 'const'. 12934/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 11 Nov 2021 22:01:35 +0000 (15:01 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 11 Nov 2021 22:01:35 +0000 (15:01 -0700)
examples/step-18/step-18.cc
examples/step-22/step-22.cc
examples/step-31/step-31.cc
examples/step-32/step-32.cc
examples/step-43/step-43.cc
examples/step-45/step-45.cc
examples/step-47/step-47.cc
examples/step-51/step-51.cc
examples/step-55/step-55.cc
examples/step-57/step-57.cc
examples/step-70/step-70.cc

index de93a76b2cfd454a1e7a00537037172b0989d396..1b491be1bee8cfb0a3a40d09aeddc2ebe9292ca6 100644 (file)
@@ -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<types::global_dof_index, double> boundary_values;
     VectorTools::interpolate_boundary_values(dof_handler,
                                              0,
index e9d9d4ade666a056850b01cdd80d00f6520d9859..16ccdf001537ba4a73d74020ae5d963ef427f56c 100644 (file)
@@ -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<float> estimated_error_per_cell(triangulation.n_active_cells());
 
-    FEValuesExtractors::Scalar pressure(dim);
+    const FEValuesExtractors::Scalar pressure(dim);
     KellyErrorEstimator<dim>::estimate(
       dof_handler,
       QGauss<dim - 1>(degree + 1),
index 4ab27fac424aa50f1d2b7cea8967c09644dcb097..7d6463e33c69430819bf8194f9b9f951ef714462 100644 (file)
@@ -1133,8 +1133,8 @@ namespace Step31
 
     Amg_preconditioner = std::make_shared<TrilinosWrappers::PreconditionAMG>();
 
-    std::vector<std::vector<bool>> constant_modes;
-    FEValuesExtractors::Vector     velocity_components(0);
+    std::vector<std::vector<bool>>   constant_modes;
+    const FEValuesExtractors::Vector velocity_components(0);
     DoFTools::extract_constant_modes(stokes_dof_handler,
                                      stokes_fe.component_mask(
                                        velocity_components),
index 3562caa8a93c41a7afe94d0a23248b00ec8153c2..9fd86ff02d9977aa2d9bbe6a09e3f49ee6a86d46 100644 (file)
@@ -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<std::vector<bool>> constant_modes;
-    FEValuesExtractors::Vector     velocity_components(0);
+    std::vector<std::vector<bool>>   constant_modes;
+    const FEValuesExtractors::Vector velocity_components(0);
     DoFTools::extract_constant_modes(stokes_dof_handler,
                                      stokes_fe.component_mask(
                                        velocity_components),
index f44a9c8de5725dc71758c755682269844b5f2aee..7af90f333e98c9fff2fef63b252a166e6692131b 100644 (file)
@@ -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);
index cf9e2806e21bea5f75bbd29d9ddcb97c23c94cc7..488b526bc97f0683666b32515e33dd200ddf64f1 100644 (file)
@@ -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<float> estimated_error_per_cell(triangulation.n_active_cells());
 
-    FEValuesExtractors::Scalar pressure(dim);
+    const FEValuesExtractors::Scalar pressure(dim);
     KellyErrorEstimator<dim>::estimate(
       dof_handler,
       QGauss<dim - 1>(degree + 1),
index 85e7a536131a9a1d8457b9fbdfc19a7d7f7248f7..44dfb405b96b8028fbc2bc637a0e3540bb1fcae6 100644 (file)
@@ -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<SymmetricTensor<2, dim>> exact_hessians(n_q_points);
       std::vector<Tensor<2, dim>>          hessians(n_q_points);
index d707fb089871610033f9930808f119ee37610c59..60ec5c89019cdbc85e3fe3aa6a42c6ad0b9a4599 100644 (file)
@@ -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<float> estimated_error_per_cell(
                 triangulation.n_active_cells());
 
-              FEValuesExtractors::Scalar scalar(dim);
+              const FEValuesExtractors::Scalar scalar(dim);
               std::map<types::boundary_id, const Function<dim> *>
                 neumann_boundary;
               KellyErrorEstimator<dim>::estimate(dof_handler_local,
index 9f60ae8343f5fe42718f5b732f028d2c1b7d45d1..ce24b41f2b4845af06d05f34ab1dad0e949bee80 100644 (file)
@@ -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,
index d932aa48b346d3fa3c4e1e24863b4c88793a2ea1..2ffc4d98cdc8aadad54f32161b5422ebd72f49ee 100644 (file)
@@ -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<dim>::refine_mesh()
   {
     Vector<float> estimated_error_per_cell(triangulation.n_active_cells());
-    FEValuesExtractors::Vector velocity(0);
+    const FEValuesExtractors::Vector velocity(0);
     KellyErrorEstimator<dim>::estimate(
       dof_handler,
       QGauss<dim - 1>(degree + 1),
index 3e2d0360e9cec1f3e58ad7b4ac70afcc03c35172..1833fc9618772c437f254fa33bf3cceed826ad91 100644 (file)
@@ -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,

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.