]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Forget 'const' in examples instead 9051/head
authorDaniel Arndt <arndtd@ornl.gov>
Sun, 17 Nov 2019 13:03:59 +0000 (08:03 -0500)
committerDaniel Arndt <arndtd@ornl.gov>
Mon, 18 Nov 2019 02:42:26 +0000 (21:42 -0500)
examples/step-13/step-13.cc
examples/step-27/step-27.cc
examples/step-38/step-38.cc
examples/step-4/step-4.cc
examples/step-41/step-41.cc
examples/step-61/step-61.cc
examples/step-63/step-63.cc
examples/step-7/step-7.cc

index d12cc57ddfcedbdca39f7bc9a2c41fd683517f06..5235bcd596c6388188ae7dca9dc48b0676b561d5 100644 (file)
@@ -1357,10 +1357,10 @@ namespace Step13
     Triangulation<dim> triangulation;
     GridGenerator::hyper_cube(triangulation, -1, 1);
     triangulation.refine_global(2);
-    const FE_Q<dim>          fe(1);
-    const QGauss<dim>        quadrature(4);
-    const RightHandSide<dim> rhs_function{};
-    const Solution<dim>      boundary_values{};
+    const FE_Q<dim>    fe(1);
+    const QGauss<dim>  quadrature(4);
+    RightHandSide<dim> rhs_function;
+    Solution<dim>      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!
index 5d108c7e8b6a59219178719d594d900ff19220fe..354f9b9fac0bade40d25358bd7cca3ef4c00dd85 100644 (file)
@@ -317,7 +317,7 @@ namespace Step27
                                      update_quadrature_points |
                                      update_JxW_values);
 
-    const RightHandSide<dim> rhs_function{};
+    RightHandSide<dim> rhs_function;
 
     FullMatrix<double> cell_matrix;
     Vector<double>     cell_rhs;
index 6694241c55e3797e3d7fd0668bb84437f4668119..27e54483f156ce41621629a071f4144501150b05 100644 (file)
@@ -370,7 +370,7 @@ namespace Step38
     std::vector<double>                  rhs_values(n_q_points);
     std::vector<types::global_dof_index> local_dof_indices(dofs_per_cell);
 
-    const RightHandSide<spacedim> rhs{};
+    RightHandSide<spacedim> rhs;
 
     for (const auto &cell : dof_handler.active_cell_iterators())
       {
index 9d1506db9e802119bf647c2b0fbeaabecd63e14c..7a44af84a28bbf59c0e45a5945cd92c74cf3b841 100644 (file)
@@ -324,7 +324,7 @@ void Step4<dim>::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<dim> right_hand_side{};
+  RightHandSide<dim> 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
index 02dd3889ad5bed3e700f22ecab2a1d11707eeabd..755ff35f42eade30601a214c3a4ef95777d77176 100644 (file)
@@ -268,8 +268,8 @@ namespace Step41
     system_matrix = 0;
     system_rhs    = 0;
 
-    const QGauss<dim>        quadrature_formula(fe.degree + 1);
-    const RightHandSide<dim> right_hand_side{};
+    const QGauss<dim>  quadrature_formula(fe.degree + 1);
+    RightHandSide<dim> right_hand_side;
 
     FEValues<dim> fe_values(fe,
                             quadrature_formula,
index 6683c339f3693c97bf3b25acab9d6a99d37a7ad4..a488cad572d89fe0a70a8cd08a6d1047f7794d42 100644 (file)
@@ -419,8 +419,8 @@ namespace Step61
 
     const unsigned int n_face_q_points = fe_face_values.get_quadrature().size();
 
-    const RightHandSide<dim> right_hand_side{};
-    std::vector<double>      right_hand_side_values(n_q_points);
+    RightHandSide<dim>  right_hand_side;
+    std::vector<double> right_hand_side_values(n_q_points);
 
     const Coefficient<dim>      coefficient;
     std::vector<Tensor<2, dim>> coefficient_values(n_q_points);
index 010b16f1fa6e23ee3c604eac1f0233fab426c6c6..fe35743432ab0829ec8ec3f9d6fa13506ef6b0dc 100644 (file)
@@ -716,8 +716,8 @@ namespace Step63
 
     scratch_data.fe_values.reinit(cell);
 
-    const RightHandSide<dim> right_hand_side{};
-    std::vector<double>      rhs_values(n_q_points);
+    RightHandSide<dim>  right_hand_side;
+    std::vector<double> rhs_values(n_q_points);
 
     right_hand_side.value_list(scratch_data.fe_values.get_quadrature_points(),
                                rhs_values);
index e1838cbf091c3691f48236a4eea7bb37b5fc7527..9baadeb9142c6c9c144c97f79cd187466c92b8a7 100644 (file)
@@ -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 <code>const</code>:
-    const RightHandSide<dim> right_hand_side{};
-    std::vector<double>      rhs_values(n_q_points);
+    RightHandSide<dim>  right_hand_side;
+    std::vector<double> 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<dim> exact_solution{};
+    Solution<dim> 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.

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.