From: Wolfgang Bangerth Date: Fri, 3 May 2024 17:14:55 +0000 (+0530) Subject: Make finite element objects 'const'. X-Git-Tag: v9.6.0-rc1~318^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F16968%2Fhead;p=dealii.git Make finite element objects 'const'. --- diff --git a/examples/step-11/step-11.cc b/examples/step-11/step-11.cc index 2af4c1de48..ca7c65452d 100644 --- a/examples/step-11/step-11.cc +++ b/examples/step-11/step-11.cc @@ -83,7 +83,7 @@ namespace Step11 void write_high_order_mesh(const unsigned cycle); Triangulation triangulation; - FE_Q fe; + const FE_Q fe; DoFHandler dof_handler; MappingQ mapping; diff --git a/examples/step-12b/step-12b.cc b/examples/step-12b/step-12b.cc index 155641fb96..2bfb222e79 100644 --- a/examples/step-12b/step-12b.cc +++ b/examples/step-12b/step-12b.cc @@ -164,8 +164,8 @@ namespace Step12 // specified in the constructor). If you want to use a DG method of a // different degree the whole program stays the same, only replace 1 in // the constructor by the desired polynomial degree. - FE_DGQ fe; - DoFHandler dof_handler; + const FE_DGQ fe; + DoFHandler dof_handler; // The next four members represent the linear system to be solved. // system_matrix and right_hand_side are generated diff --git a/examples/step-15/step-15.cc b/examples/step-15/step-15.cc index b732cfcb1e..2234b03d8d 100644 --- a/examples/step-15/step-15.cc +++ b/examples/step-15/step-15.cc @@ -113,7 +113,7 @@ namespace Step15 Triangulation triangulation; DoFHandler dof_handler; - FE_Q fe; + const FE_Q fe; AffineConstraints hanging_node_constraints; diff --git a/examples/step-16/step-16.cc b/examples/step-16/step-16.cc index 72b51bd0ec..68328386ce 100644 --- a/examples/step-16/step-16.cc +++ b/examples/step-16/step-16.cc @@ -154,7 +154,7 @@ namespace Step16 void output_results(const unsigned int cycle) const; Triangulation triangulation; - FE_Q fe; + const FE_Q fe; DoFHandler dof_handler; SparsityPattern sparsity_pattern; diff --git a/examples/step-16b/step-16b.cc b/examples/step-16b/step-16b.cc index 2ed54b1599..d93f966cd5 100644 --- a/examples/step-16b/step-16b.cc +++ b/examples/step-16b/step-16b.cc @@ -183,7 +183,7 @@ namespace Step16 void output_results(const unsigned int cycle) const; Triangulation triangulation; - FE_Q fe; + const FE_Q fe; DoFHandler dof_handler; SparsityPattern sparsity_pattern; diff --git a/examples/step-17/step-17.cc b/examples/step-17/step-17.cc index 845eb626bf..3deca967ee 100644 --- a/examples/step-17/step-17.cc +++ b/examples/step-17/step-17.cc @@ -159,9 +159,9 @@ namespace Step17 // and vector types to use parallel PETSc objects instead. Note that // we do not use a separate sparsity pattern, since PETSc manages this // internally as part of its matrix data structures. - Triangulation triangulation; - FESystem fe; - DoFHandler dof_handler; + Triangulation triangulation; + const FESystem fe; + DoFHandler dof_handler; AffineConstraints hanging_node_constraints; diff --git a/examples/step-18/step-18.cc b/examples/step-18/step-18.cc index e091f86a5c..967796f2a8 100644 --- a/examples/step-18/step-18.cc +++ b/examples/step-18/step-18.cc @@ -401,7 +401,7 @@ namespace Step18 // This is the new shared Triangulation: parallel::shared::Triangulation triangulation; - FESystem fe; + const FESystem fe; DoFHandler dof_handler; diff --git a/examples/step-19/step-19.cc b/examples/step-19/step-19.cc index f7cccc82f2..5ff1429c46 100644 --- a/examples/step-19/step-19.cc +++ b/examples/step-19/step-19.cc @@ -144,7 +144,7 @@ namespace Step19 Triangulation triangulation; MappingQ mapping; - FE_Q fe; + const FE_Q fe; DoFHandler dof_handler; AffineConstraints constraints; diff --git a/examples/step-20/step-20.cc b/examples/step-20/step-20.cc index d8a6afd678..c2e52c655a 100644 --- a/examples/step-20/step-20.cc +++ b/examples/step-20/step-20.cc @@ -92,9 +92,9 @@ namespace Step20 const unsigned int degree; - Triangulation triangulation; - FESystem fe; - DoFHandler dof_handler; + Triangulation triangulation; + const FESystem fe; + DoFHandler dof_handler; // The second difference is that the sparsity pattern, the system matrix, // and solution and right hand side vectors are now blocked. What this diff --git a/examples/step-21/step-21.cc b/examples/step-21/step-21.cc index 0c3760a02e..c493828c90 100644 --- a/examples/step-21/step-21.cc +++ b/examples/step-21/step-21.cc @@ -111,9 +111,9 @@ namespace Step21 const unsigned int degree; - Triangulation triangulation; - FESystem fe; - DoFHandler dof_handler; + Triangulation triangulation; + const FESystem fe; + DoFHandler dof_handler; BlockSparsityPattern sparsity_pattern; BlockSparseMatrix system_matrix; diff --git a/examples/step-22/step-22.cc b/examples/step-22/step-22.cc index 8351f74d8e..363aafc4cf 100644 --- a/examples/step-22/step-22.cc +++ b/examples/step-22/step-22.cc @@ -127,9 +127,9 @@ namespace Step22 const unsigned int degree; - Triangulation triangulation; - FESystem fe; - DoFHandler dof_handler; + Triangulation triangulation; + const FESystem fe; + DoFHandler dof_handler; AffineConstraints constraints; diff --git a/examples/step-23/step-23.cc b/examples/step-23/step-23.cc index c4e6a2d775..8ee184339b 100644 --- a/examples/step-23/step-23.cc +++ b/examples/step-23/step-23.cc @@ -117,7 +117,7 @@ namespace Step23 void output_results() const; Triangulation triangulation; - FE_Q fe; + const FE_Q fe; DoFHandler dof_handler; AffineConstraints constraints; diff --git a/examples/step-24/step-24.cc b/examples/step-24/step-24.cc index 3a079dc69c..a9678aceea 100644 --- a/examples/step-24/step-24.cc +++ b/examples/step-24/step-24.cc @@ -75,7 +75,7 @@ namespace Step24 void output_results() const; Triangulation triangulation; - FE_Q fe; + const FE_Q fe; DoFHandler dof_handler; AffineConstraints constraints; diff --git a/examples/step-25/step-25.cc b/examples/step-25/step-25.cc index a417c54ea2..565d030235 100644 --- a/examples/step-25/step-25.cc +++ b/examples/step-25/step-25.cc @@ -112,7 +112,7 @@ namespace Step25 void output_results(const unsigned int timestep_number) const; Triangulation triangulation; - FE_Q fe; + const FE_Q fe; DoFHandler dof_handler; SparsityPattern sparsity_pattern; diff --git a/examples/step-26/step-26.cc b/examples/step-26/step-26.cc index 24b833e2e5..8260a96205 100644 --- a/examples/step-26/step-26.cc +++ b/examples/step-26/step-26.cc @@ -86,7 +86,7 @@ namespace Step26 const unsigned int max_grid_level); Triangulation triangulation; - FE_Q fe; + const FE_Q fe; DoFHandler dof_handler; AffineConstraints constraints; diff --git a/examples/step-28/step-28.cc b/examples/step-28/step-28.cc index 44a223dce6..1951221138 100644 --- a/examples/step-28/step-28.cc +++ b/examples/step-28/step-28.cc @@ -1194,7 +1194,7 @@ namespace Step28 // all energy groups: const Parameters ¶meters; const MaterialData material_data; - FE_Q fe; + const FE_Q fe; // Furthermore, we have (iv) the value of the computed eigenvalue at the // present iteration. This is, in fact, the only part of the solution that diff --git a/examples/step-29/step-29.cc b/examples/step-29/step-29.cc index 238ec4448b..6eb385e1eb 100644 --- a/examples/step-29/step-29.cc +++ b/examples/step-29/step-29.cc @@ -372,9 +372,9 @@ namespace Step29 ParameterHandler &prm; - Triangulation triangulation; - DoFHandler dof_handler; - FESystem fe; + Triangulation triangulation; + DoFHandler dof_handler; + const FESystem fe; SparsityPattern sparsity_pattern; SparseMatrix system_matrix; diff --git a/examples/step-3/step-3.cc b/examples/step-3/step-3.cc index e0bd293d6a..148c0ec855 100644 --- a/examples/step-3/step-3.cc +++ b/examples/step-3/step-3.cc @@ -105,7 +105,7 @@ private: // will specify the exact polynomial degree of the finite element in the // constructor of this class)... Triangulation<2> triangulation; - FE_Q<2> fe; + const FE_Q<2> fe; DoFHandler<2> dof_handler; // ...variables for the sparsity pattern and values of the system matrix diff --git a/examples/step-30/step-30.cc b/examples/step-30/step-30.cc index 553a7480c9..38215fd19c 100644 --- a/examples/step-30/step-30.cc +++ b/examples/step-30/step-30.cc @@ -311,7 +311,7 @@ namespace Step30 // specified in the constructor). If you want to use a DG method of a // different degree replace 1 in the constructor by the new degree. const unsigned int degree; - FE_DGQ fe; + const FE_DGQ fe; DoFHandler dof_handler; SparsityPattern sparsity_pattern; diff --git a/examples/step-31/step-31.cc b/examples/step-31/step-31.cc index 3e66bc0710..e114ee1369 100644 --- a/examples/step-31/step-31.cc +++ b/examples/step-31/step-31.cc @@ -483,7 +483,7 @@ namespace Step31 double global_Omega_diameter; const unsigned int stokes_degree; - FESystem stokes_fe; + const FESystem stokes_fe; DoFHandler stokes_dof_handler; AffineConstraints stokes_constraints; @@ -497,7 +497,7 @@ namespace Step31 const unsigned int temperature_degree; - FE_Q temperature_fe; + const FE_Q temperature_fe; DoFHandler temperature_dof_handler; AffineConstraints temperature_constraints; diff --git a/examples/step-32/step-32.cc b/examples/step-32/step-32.cc index 1e73c472e6..1bf932bca2 100644 --- a/examples/step-32/step-32.cc +++ b/examples/step-32/step-32.cc @@ -851,7 +851,7 @@ namespace Step32 TrilinosWrappers::MPI::BlockVector stokes_rhs; - FE_Q temperature_fe; + const FE_Q temperature_fe; DoFHandler temperature_dof_handler; AffineConstraints temperature_constraints; diff --git a/examples/step-34/step-34.cc b/examples/step-34/step-34.cc index 495ef24308..df9dbebcba 100644 --- a/examples/step-34/step-34.cc +++ b/examples/step-34/step-34.cc @@ -231,7 +231,7 @@ namespace Step34 // mapping can be selected in the constructor of the class. Triangulation tria; - FE_Q fe; + const FE_Q fe; DoFHandler dof_handler; MappingQ mapping; @@ -912,7 +912,7 @@ namespace Step34 Triangulation external_tria; GridGenerator::hyper_cube(external_tria, -2, 2); - FE_Q external_fe(1); + const FE_Q external_fe(1); DoFHandler external_dh(external_tria); Vector external_phi; diff --git a/examples/step-35/step-35.cc b/examples/step-35/step-35.cc index 9f4c6ff9e2..8e8e955d91 100644 --- a/examples/step-35/step-35.cc +++ b/examples/step-35/step-35.cc @@ -445,8 +445,8 @@ namespace Step35 Triangulation triangulation; - FE_Q fe_velocity; - FE_Q fe_pressure; + const FE_Q fe_velocity; + const FE_Q fe_pressure; DoFHandler dof_handler_velocity; DoFHandler dof_handler_pressure; diff --git a/examples/step-36/step-36.cc b/examples/step-36/step-36.cc index dd7f52afb9..b94348c7f1 100644 --- a/examples/step-36/step-36.cc +++ b/examples/step-36/step-36.cc @@ -80,7 +80,7 @@ namespace Step36 void output_results() const; Triangulation triangulation; - FE_Q fe; + const FE_Q fe; DoFHandler dof_handler; // With these exceptions: For our eigenvalue problem, we need both a diff --git a/examples/step-37/step-37.cc b/examples/step-37/step-37.cc index 6df45278ad..5515fcb247 100644 --- a/examples/step-37/step-37.cc +++ b/examples/step-37/step-37.cc @@ -685,7 +685,7 @@ namespace Step37 Triangulation triangulation; #endif - FE_Q fe; + const FE_Q fe; DoFHandler dof_handler; MappingQ1 mapping; diff --git a/examples/step-38/step-38.cc b/examples/step-38/step-38.cc index 6826fd0b67..401ad8d9c4 100644 --- a/examples/step-38/step-38.cc +++ b/examples/step-38/step-38.cc @@ -112,7 +112,7 @@ namespace Step38 Triangulation triangulation; - FE_Q fe; + const FE_Q fe; DoFHandler dof_handler; MappingQ mapping; diff --git a/examples/step-39/step-39.cc b/examples/step-39/step-39.cc index 16c8cb2b39..05ac60be8c 100644 --- a/examples/step-39/step-39.cc +++ b/examples/step-39/step-39.cc @@ -986,7 +986,7 @@ int main() deallog.depth_console(2); std::ofstream logfile("deallog"); deallog.attach(logfile); - FE_DGQ<2> fe1(3); + const FE_DGQ<2> fe1(3); InteriorPenaltyProblem<2> test1(fe1); test1.run(12); } diff --git a/examples/step-4/step-4.cc b/examples/step-4/step-4.cc index 472610c2e5..dabf47ba7f 100644 --- a/examples/step-4/step-4.cc +++ b/examples/step-4/step-4.cc @@ -76,7 +76,7 @@ private: void output_results() const; Triangulation triangulation; - FE_Q fe; + const FE_Q fe; DoFHandler dof_handler; SparsityPattern sparsity_pattern; diff --git a/examples/step-40/step-40.cc b/examples/step-40/step-40.cc index a0d3e51b67..4995560be9 100644 --- a/examples/step-40/step-40.cc +++ b/examples/step-40/step-40.cc @@ -172,7 +172,7 @@ namespace Step40 parallel::distributed::Triangulation triangulation; - FE_Q fe; + const FE_Q fe; DoFHandler dof_handler; IndexSet locally_owned_dofs; diff --git a/examples/step-41/step-41.cc b/examples/step-41/step-41.cc index 1a88626f04..714a10f61a 100644 --- a/examples/step-41/step-41.cc +++ b/examples/step-41/step-41.cc @@ -86,7 +86,7 @@ namespace Step41 void output_results(const unsigned int iteration) const; Triangulation triangulation; - FE_Q fe; + const FE_Q fe; DoFHandler dof_handler; AffineConstraints constraints; IndexSet active_set; diff --git a/examples/step-42/step-42.cc b/examples/step-42/step-42.cc index 0cd0ecf61c..fe502e0799 100644 --- a/examples/step-42/step-42.cc +++ b/examples/step-42/step-42.cc @@ -660,9 +660,9 @@ namespace Step42 const unsigned int n_initial_global_refinements; parallel::distributed::Triangulation triangulation; - const unsigned int fe_degree; - FESystem fe; - DoFHandler dof_handler; + const unsigned int fe_degree; + const FESystem fe; + DoFHandler dof_handler; IndexSet locally_owned_dofs; IndexSet locally_relevant_dofs; diff --git a/examples/step-43/step-43.cc b/examples/step-43/step-43.cc index b36b03bc9f..dbfdb5864e 100644 --- a/examples/step-43/step-43.cc +++ b/examples/step-43/step-43.cc @@ -504,7 +504,7 @@ namespace Step43 const unsigned int degree; const unsigned int darcy_degree; - FESystem darcy_fe; + const FESystem darcy_fe; DoFHandler darcy_dof_handler; AffineConstraints darcy_constraints; @@ -521,7 +521,7 @@ namespace Step43 const unsigned int saturation_degree; - FE_Q saturation_fe; + const FE_Q saturation_fe; DoFHandler saturation_dof_handler; AffineConstraints saturation_constraints; diff --git a/examples/step-45/step-45.cc b/examples/step-45/step-45.cc index 307aa616d6..6cb44141fd 100644 --- a/examples/step-45/step-45.cc +++ b/examples/step-45/step-45.cc @@ -87,7 +87,7 @@ namespace Step45 MPI_Comm mpi_communicator; parallel::distributed::Triangulation triangulation; - FESystem fe; + const FESystem fe; DoFHandler dof_handler; AffineConstraints constraints; diff --git a/examples/step-46/step-46.cc b/examples/step-46/step-46.cc index 31d11deb2d..d3312b4f7f 100644 --- a/examples/step-46/step-46.cc +++ b/examples/step-46/step-46.cc @@ -123,8 +123,8 @@ namespace Step46 const unsigned int elasticity_degree; Triangulation triangulation; - FESystem stokes_fe; - FESystem elasticity_fe; + const FESystem stokes_fe; + const FESystem elasticity_fe; hp::FECollection fe_collection; DoFHandler dof_handler; diff --git a/examples/step-47/step-47.cc b/examples/step-47/step-47.cc index 6f84b3294f..970db603b2 100644 --- a/examples/step-47/step-47.cc +++ b/examples/step-47/step-47.cc @@ -163,7 +163,7 @@ namespace Step47 MappingQ mapping; - FE_Q fe; + const FE_Q fe; DoFHandler dof_handler; AffineConstraints constraints; diff --git a/examples/step-48/step-48.cc b/examples/step-48/step-48.cc index a47f9e8370..9130d42433 100644 --- a/examples/step-48/step-48.cc +++ b/examples/step-48/step-48.cc @@ -307,7 +307,7 @@ namespace Step48 #else Triangulation triangulation; #endif - FE_Q fe; + const FE_Q fe; DoFHandler dof_handler; MappingQ1 mapping; diff --git a/examples/step-5/step-5.cc b/examples/step-5/step-5.cc index d2f56853ab..d56582d372 100644 --- a/examples/step-5/step-5.cc +++ b/examples/step-5/step-5.cc @@ -76,7 +76,7 @@ private: void output_results(const unsigned int cycle) const; Triangulation triangulation; - FE_Q fe; + const FE_Q fe; DoFHandler dof_handler; SparsityPattern sparsity_pattern; diff --git a/examples/step-50/step-50.cc b/examples/step-50/step-50.cc index 38a390f1db..c0a9019b4f 100644 --- a/examples/step-50/step-50.cc +++ b/examples/step-50/step-50.cc @@ -421,7 +421,7 @@ private: parallel::distributed::Triangulation triangulation; const MappingQ1 mapping; - FE_Q fe; + const FE_Q fe; DoFHandler dof_handler; diff --git a/examples/step-51/step-51.cc b/examples/step-51/step-51.cc index 570823e410..516cb1494d 100644 --- a/examples/step-51/step-51.cc +++ b/examples/step-51/step-51.cc @@ -321,17 +321,17 @@ namespace Step51 // The 'local' solutions are interior to each element. These // represent the primal solution field $u$ as well as the auxiliary // field $\mathbf{q}$. - FESystem fe_local; - DoFHandler dof_handler_local; - Vector solution_local; + const FESystem fe_local; + DoFHandler dof_handler_local; + Vector solution_local; // The new finite element type and corresponding DoFHandler are // used for the global skeleton solution that couples the element-level // local solutions. - FE_FaceQ fe; - DoFHandler dof_handler; - Vector solution; - Vector system_rhs; + const FE_FaceQ fe; + DoFHandler dof_handler; + Vector solution; + Vector system_rhs; // As stated in the introduction, HDG solutions can be post-processed to // attain superconvergence rates of $\mathcal{O}(h^{p+2})$. The @@ -339,9 +339,9 @@ namespace Step51 // representing the primal variable on the interior of each cell. We define // a FE type of degree $p+1$ to represent this post-processed solution, // which we only use for output after constructing it. - FE_DGQ fe_u_post; - DoFHandler dof_handler_u_post; - Vector solution_u_post; + const FE_DGQ fe_u_post; + DoFHandler dof_handler_u_post; + Vector solution_u_post; // The degrees of freedom corresponding to the skeleton strongly enforce // Dirichlet boundary conditions, just as in a continuous Galerkin finite diff --git a/examples/step-55/step-55.cc b/examples/step-55/step-55.cc index c12cc6d9ce..8c07ab9a5c 100644 --- a/examples/step-55/step-55.cc +++ b/examples/step-55/step-55.cc @@ -306,7 +306,7 @@ namespace Step55 double viscosity; MPI_Comm mpi_communicator; - FESystem fe; + const FESystem fe; parallel::distributed::Triangulation triangulation; DoFHandler dof_handler; diff --git a/examples/step-56/step-56.cc b/examples/step-56/step-56.cc index 518256a0f0..2c3a70f983 100644 --- a/examples/step-56/step-56.cc +++ b/examples/step-56/step-56.cc @@ -420,11 +420,11 @@ namespace Step56 const unsigned int pressure_degree; const SolverType solver_type; - Triangulation triangulation; - FESystem velocity_fe; - FESystem fe; - DoFHandler dof_handler; - DoFHandler velocity_dof_handler; + Triangulation triangulation; + const FESystem velocity_fe; + const FESystem fe; + DoFHandler dof_handler; + DoFHandler velocity_dof_handler; AffineConstraints constraints; diff --git a/examples/step-57/step-57.cc b/examples/step-57/step-57.cc index 0ac9165a60..59fb778044 100644 --- a/examples/step-57/step-57.cc +++ b/examples/step-57/step-57.cc @@ -116,9 +116,9 @@ namespace Step57 const unsigned int degree; std::vector dofs_per_block; - Triangulation triangulation; - FESystem fe; - DoFHandler dof_handler; + Triangulation triangulation; + const FESystem fe; + DoFHandler dof_handler; AffineConstraints zero_constraints; AffineConstraints nonzero_constraints; diff --git a/examples/step-58/step-58.cc b/examples/step-58/step-58.cc index e5109df230..fae086e6a6 100644 --- a/examples/step-58/step-58.cc +++ b/examples/step-58/step-58.cc @@ -73,7 +73,7 @@ namespace Step58 Triangulation triangulation; - FE_Q fe; + const FE_Q fe; DoFHandler dof_handler; AffineConstraints> constraints; diff --git a/examples/step-59/step-59.cc b/examples/step-59/step-59.cc index c9a448b956..f827de3ef0 100644 --- a/examples/step-59/step-59.cc +++ b/examples/step-59/step-59.cc @@ -924,8 +924,8 @@ namespace Step59 Triangulation triangulation; #endif - FE_DGQHermite fe; - DoFHandler dof_handler; + const FE_DGQHermite fe; + DoFHandler dof_handler; MappingQ1 mapping; diff --git a/examples/step-6/step-6.cc b/examples/step-6/step-6.cc index 4ca202f208..62f416c7a3 100644 --- a/examples/step-6/step-6.cc +++ b/examples/step-6/step-6.cc @@ -103,7 +103,7 @@ private: Triangulation triangulation; - FE_Q fe; + const FE_Q fe; DoFHandler dof_handler; diff --git a/examples/step-61/step-61.cc b/examples/step-61/step-61.cc index 24a24e3d8d..a264cf2637 100644 --- a/examples/step-61/step-61.cc +++ b/examples/step-61/step-61.cc @@ -97,8 +97,8 @@ namespace Step61 Triangulation triangulation; - FESystem fe; - DoFHandler dof_handler; + const FESystem fe; + DoFHandler dof_handler; AffineConstraints constraints; @@ -108,9 +108,9 @@ namespace Step61 Vector solution; Vector system_rhs; - FE_DGRaviartThomas fe_dgrt; - DoFHandler dof_handler_dgrt; - Vector darcy_velocity; + const FE_DGRaviartThomas fe_dgrt; + DoFHandler dof_handler_dgrt; + Vector darcy_velocity; }; diff --git a/examples/step-62/step-62.cc b/examples/step-62/step-62.cc index f8d73115a4..8ca692c73c 100644 --- a/examples/step-62/step-62.cc +++ b/examples/step-62/step-62.cc @@ -320,8 +320,8 @@ namespace step62 std::vector> quadrature_cache; - FESystem fe; - DoFHandler dof_handler; + const FESystem fe; + DoFHandler dof_handler; IndexSet locally_owned_dofs; IndexSet locally_relevant_dofs; diff --git a/examples/step-64/step-64.cc b/examples/step-64/step-64.cc index 68cb71f423..441c98ac3d 100644 --- a/examples/step-64/step-64.cc +++ b/examples/step-64/step-64.cc @@ -351,7 +351,7 @@ namespace Step64 parallel::distributed::Triangulation triangulation; - FE_Q fe; + const FE_Q fe; DoFHandler dof_handler; IndexSet locally_owned_dofs; diff --git a/examples/step-65/step-65.cc b/examples/step-65/step-65.cc index b54c94363b..9eb4466bf3 100644 --- a/examples/step-65/step-65.cc +++ b/examples/step-65/step-65.cc @@ -134,7 +134,7 @@ namespace Step65 void postprocess(const Mapping &mapping); Triangulation triangulation; - FE_Q fe; + const FE_Q fe; DoFHandler dof_handler; AffineConstraints constraints; diff --git a/examples/step-66/step-66.cc b/examples/step-66/step-66.cc index fa3b897fff..cc0d2b9155 100644 --- a/examples/step-66/step-66.cc +++ b/examples/step-66/step-66.cc @@ -410,7 +410,7 @@ namespace Step66 // As usual we then define the Lagrangian finite elements FE_Q and a // DoFHandler. - FE_Q fe; + const FE_Q fe; DoFHandler dof_handler; diff --git a/examples/step-67/step-67.cc b/examples/step-67/step-67.cc index aa3ca927a2..54d9fad1f2 100644 --- a/examples/step-67/step-67.cc +++ b/examples/step-67/step-67.cc @@ -1774,9 +1774,9 @@ namespace Euler_DG Triangulation triangulation; #endif - FESystem fe; - MappingQ mapping; - DoFHandler dof_handler; + const FESystem fe; + MappingQ mapping; + DoFHandler dof_handler; TimerOutput timer; diff --git a/examples/step-68/step-68.cc b/examples/step-68/step-68.cc index 0f759b1fa6..1e5b4373bc 100644 --- a/examples/step-68/step-68.cc +++ b/examples/step-68/step-68.cc @@ -230,7 +230,7 @@ namespace Step68 Particles::ParticleHandler particle_handler; DoFHandler fluid_dh; - FESystem fluid_fe; + const FESystem fluid_fe; MappingQ1 mapping; LinearAlgebra::distributed::Vector velocity_field; diff --git a/examples/step-7/step-7.cc b/examples/step-7/step-7.cc index 8b2ca2fda7..f80eb2c37d 100644 --- a/examples/step-7/step-7.cc +++ b/examples/step-7/step-7.cc @@ -1254,7 +1254,7 @@ int main() << std::endl << std::endl; - FE_Q fe(1); + const FE_Q fe(1); HelmholtzProblem helmholtz_problem_2d( fe, HelmholtzProblem::adaptive_refinement); @@ -1268,7 +1268,7 @@ int main() << "===========================================" << std::endl << std::endl; - FE_Q fe(1); + const FE_Q fe(1); HelmholtzProblem helmholtz_problem_2d( fe, HelmholtzProblem::global_refinement); @@ -1282,7 +1282,7 @@ int main() << "===========================================" << std::endl << std::endl; - FE_Q fe(2); + const FE_Q fe(2); HelmholtzProblem helmholtz_problem_2d( fe, HelmholtzProblem::global_refinement); @@ -1296,7 +1296,7 @@ int main() << "===========================================" << std::endl << std::endl; - FE_Q fe(2); + const FE_Q fe(2); HelmholtzProblem helmholtz_problem_2d( fe, HelmholtzProblem::adaptive_refinement); diff --git a/examples/step-70/step-70.cc b/examples/step-70/step-70.cc index 107503d419..268d57c8fb 100644 --- a/examples/step-70/step-70.cc +++ b/examples/step-70/step-70.cc @@ -995,7 +995,7 @@ namespace Step70 par.arguments_for_particle_grid); particle_insert_tria.refine_global(par.particle_insertion_refinement); - FE_Q particles_fe(1); + const FE_Q particles_fe(1); DoFHandler particles_dof_handler(particle_insert_tria); particles_dof_handler.distribute_dofs(particles_fe); diff --git a/examples/step-76/step-76.cc b/examples/step-76/step-76.cc index 1d9fdb1a99..5d9397968d 100644 --- a/examples/step-76/step-76.cc +++ b/examples/step-76/step-76.cc @@ -1201,9 +1201,9 @@ namespace Euler_DG Triangulation triangulation; #endif - FESystem fe; - MappingQ mapping; - DoFHandler dof_handler; + const FESystem fe; + MappingQ mapping; + DoFHandler dof_handler; TimerOutput timer; diff --git a/examples/step-77/step-77.cc b/examples/step-77/step-77.cc index 8376adf554..0bfb3a882e 100644 --- a/examples/step-77/step-77.cc +++ b/examples/step-77/step-77.cc @@ -109,7 +109,7 @@ namespace Step77 Triangulation triangulation; DoFHandler dof_handler; - FE_Q fe; + const FE_Q fe; AffineConstraints hanging_node_constraints; diff --git a/examples/step-78/step-78.cc b/examples/step-78/step-78.cc index be93d3cf34..8c5fac3d71 100644 --- a/examples/step-78/step-78.cc +++ b/examples/step-78/step-78.cc @@ -317,7 +317,7 @@ namespace BlackScholesSolver const double strike_price; Triangulation triangulation; - FE_Q fe; + const FE_Q fe; DoFHandler dof_handler; AffineConstraints constraints; diff --git a/examples/step-79/step-79.cc b/examples/step-79/step-79.cc index 5cca5c6f07..6a4daf3382 100644 --- a/examples/step-79/step-79.cc +++ b/examples/step-79/step-79.cc @@ -234,7 +234,7 @@ namespace SAND // factors below) as well as the filter matrix to ensure that // the design remains smooth. Triangulation triangulation; - FESystem fe; + const FESystem fe; DoFHandler dof_handler; AffineConstraints constraints; diff --git a/examples/step-8/step-8.cc b/examples/step-8/step-8.cc index f159a2cc57..2cbb46a98e 100644 --- a/examples/step-8/step-8.cc +++ b/examples/step-8/step-8.cc @@ -94,7 +94,7 @@ namespace Step8 Triangulation triangulation; DoFHandler dof_handler; - FESystem fe; + const FESystem fe; AffineConstraints constraints; diff --git a/examples/step-82/step-82.cc b/examples/step-82/step-82.cc index 67df8a7a55..ed051c8367 100644 --- a/examples/step-82/step-82.cc +++ b/examples/step-82/step-82.cc @@ -119,14 +119,14 @@ namespace Step82 const unsigned int n_refinements; - FE_DGQ fe; - DoFHandler dof_handler; + const FE_DGQ fe; + DoFHandler dof_handler; // We also need a variable that describes the finite element space // $[\mathbb{V}_h]^{d\times d}$ used for the two lifting // operators. The other member variables below are as in most of the other // tutorial programs. - FESystem fe_lift; + const FESystem fe_lift; SparsityPattern sparsity_pattern; SparseMatrix matrix; diff --git a/examples/step-87/step-87.cc b/examples/step-87/step-87.cc index b9701e973e..2e1451aebc 100644 --- a/examples/step-87/step-87.cc +++ b/examples/step-87/step-87.cc @@ -165,7 +165,7 @@ namespace Step87 Triangulation tria; GridGenerator::subdivided_hyper_cube(tria, 7); - FE_Q fe(fe_degree); + const FE_Q fe(fe_degree); DoFHandler dof_handler(tria); dof_handler.distribute_dofs(fe); @@ -303,7 +303,7 @@ namespace Step87 DistributedTriangulation tria(MPI_COMM_WORLD); GridGenerator::subdivided_hyper_cube(tria, 7); - FE_Q fe(fe_degree); + const FE_Q fe(fe_degree); DoFHandler dof_handler(tria); dof_handler.distribute_dofs(fe); @@ -465,7 +465,7 @@ namespace Step87 pcout << "Running: example 2" << std::endl; pcout << " - create system" << std::endl; - FE_Q fe(fe_degree); + const FE_Q fe(fe_degree); MappingQ1 mapping; DistributedTriangulation tria(MPI_COMM_WORLD); GridGenerator::subdivided_hyper_cube(tria, 50); @@ -736,9 +736,9 @@ namespace Step87 GridGenerator::hyper_cube(tria_background); tria_background.refine_global(5); - MappingQ1 mapping_background; - FESystem fe_background(FE_Q(degree), dim); - DoFHandler dof_handler_background(tria_background); + MappingQ1 mapping_background; + const FESystem fe_background(FE_Q(degree), dim); + DoFHandler dof_handler_background(tria_background); dof_handler_background.distribute_dofs(fe_background); // and, similarly, for the immersed surface mesh. @@ -763,9 +763,9 @@ namespace Step87 mapping_immersed.initialize(mapping_immersed_base, tria_immersed); const QGauss quadrature_immersed(degree + 1); - FE_Q fe_scalar_immersed(degree); - FESystem fe_immersed(fe_scalar_immersed, dim); - DoFHandler dof_handler_immersed(tria_immersed); + const FE_Q fe_scalar_immersed(degree); + const FESystem fe_immersed(fe_scalar_immersed, dim); + DoFHandler dof_handler_immersed(tria_immersed); dof_handler_immersed.distribute_dofs(fe_immersed); // We renumber the DoFs related to the vector-valued problem to diff --git a/examples/step-9/step-9.cc b/examples/step-9/step-9.cc index 8ee0ae0960..017b7d7354 100644 --- a/examples/step-9/step-9.cc +++ b/examples/step-9/step-9.cc @@ -278,7 +278,7 @@ namespace Step9 Triangulation triangulation; DoFHandler dof_handler; - FE_Q fe; + const FE_Q fe; AffineConstraints hanging_node_constraints;