From aa5ceebfa8ad4e0fad44c039df346f4c83693a69 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Sun, 17 Nov 2019 08:03:59 -0500 Subject: [PATCH] Forget 'const' in examples instead --- examples/step-13/step-13.cc | 8 ++++---- examples/step-27/step-27.cc | 2 +- examples/step-38/step-38.cc | 2 +- examples/step-4/step-4.cc | 2 +- examples/step-41/step-41.cc | 4 ++-- examples/step-61/step-61.cc | 4 ++-- examples/step-63/step-63.cc | 4 ++-- examples/step-7/step-7.cc | 6 +++--- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/examples/step-13/step-13.cc b/examples/step-13/step-13.cc index d12cc57ddf..5235bcd596 100644 --- a/examples/step-13/step-13.cc +++ b/examples/step-13/step-13.cc @@ -1357,10 +1357,10 @@ namespace Step13 Triangulation triangulation; GridGenerator::hyper_cube(triangulation, -1, 1); triangulation.refine_global(2); - const FE_Q fe(1); - const QGauss quadrature(4); - const RightHandSide rhs_function{}; - const Solution boundary_values{}; + const FE_Q fe(1); + const QGauss quadrature(4); + RightHandSide rhs_function; + Solution boundary_values; // Create a solver object of the kind indicated by the argument to this // function. If the name is not recognized, throw an exception! diff --git a/examples/step-27/step-27.cc b/examples/step-27/step-27.cc index 5d108c7e8b..354f9b9fac 100644 --- a/examples/step-27/step-27.cc +++ b/examples/step-27/step-27.cc @@ -317,7 +317,7 @@ namespace Step27 update_quadrature_points | update_JxW_values); - const RightHandSide rhs_function{}; + RightHandSide rhs_function; FullMatrix cell_matrix; Vector cell_rhs; diff --git a/examples/step-38/step-38.cc b/examples/step-38/step-38.cc index 6694241c55..27e54483f1 100644 --- a/examples/step-38/step-38.cc +++ b/examples/step-38/step-38.cc @@ -370,7 +370,7 @@ namespace Step38 std::vector rhs_values(n_q_points); std::vector local_dof_indices(dofs_per_cell); - const RightHandSide rhs{}; + RightHandSide rhs; for (const auto &cell : dof_handler.active_cell_iterators()) { diff --git a/examples/step-4/step-4.cc b/examples/step-4/step-4.cc index 9d1506db9e..7a44af84a2 100644 --- a/examples/step-4/step-4.cc +++ b/examples/step-4/step-4.cc @@ -324,7 +324,7 @@ void Step4::assemble_system() // the class declared above to generate the necessary data. Since this right // hand side object is only used locally in the present function, we declare // it here as a local variable: - const RightHandSide right_hand_side{}; + RightHandSide right_hand_side; // Compared to the previous example, in order to evaluate the non-constant // right hand side function we now also need the quadrature points on the diff --git a/examples/step-41/step-41.cc b/examples/step-41/step-41.cc index 02dd3889ad..755ff35f42 100644 --- a/examples/step-41/step-41.cc +++ b/examples/step-41/step-41.cc @@ -268,8 +268,8 @@ namespace Step41 system_matrix = 0; system_rhs = 0; - const QGauss quadrature_formula(fe.degree + 1); - const RightHandSide right_hand_side{}; + const QGauss quadrature_formula(fe.degree + 1); + RightHandSide right_hand_side; FEValues fe_values(fe, quadrature_formula, diff --git a/examples/step-61/step-61.cc b/examples/step-61/step-61.cc index 6683c339f3..a488cad572 100644 --- a/examples/step-61/step-61.cc +++ b/examples/step-61/step-61.cc @@ -419,8 +419,8 @@ namespace Step61 const unsigned int n_face_q_points = fe_face_values.get_quadrature().size(); - const RightHandSide right_hand_side{}; - std::vector right_hand_side_values(n_q_points); + RightHandSide right_hand_side; + std::vector right_hand_side_values(n_q_points); const Coefficient coefficient; std::vector> coefficient_values(n_q_points); diff --git a/examples/step-63/step-63.cc b/examples/step-63/step-63.cc index 010b16f1fa..fe35743432 100644 --- a/examples/step-63/step-63.cc +++ b/examples/step-63/step-63.cc @@ -716,8 +716,8 @@ namespace Step63 scratch_data.fe_values.reinit(cell); - const RightHandSide right_hand_side{}; - std::vector rhs_values(n_q_points); + RightHandSide right_hand_side; + std::vector rhs_values(n_q_points); right_hand_side.value_list(scratch_data.fe_values.get_quadrature_points(), rhs_values); diff --git a/examples/step-7/step-7.cc b/examples/step-7/step-7.cc index e1838cbf09..9baadeb914 100644 --- a/examples/step-7/step-7.cc +++ b/examples/step-7/step-7.cc @@ -587,8 +587,8 @@ namespace Step7 // Note that the operations we will do with the right hand side object are // only querying data, never changing the object. We can therefore declare // it const: - const RightHandSide right_hand_side{}; - std::vector rhs_values(n_q_points); + RightHandSide right_hand_side; + std::vector rhs_values(n_q_points); // Finally we define an object denoting the exact solution function. We // will use it to compute the Neumann values at the boundary from @@ -597,7 +597,7 @@ namespace Step7 // Neumann values are prescribed. We will, however, be a little bit lazy // and use what we already have in information. Real-life programs would // to go other ways here, of course. - const Solution exact_solution{}; + Solution exact_solution; // Now for the main loop over all cells. This is mostly unchanged from // previous examples, so we only comment on the things that have changed. -- 2.39.5