]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Modernize step-59 8025/head
authorDaniel Arndt <arndtd@ornl.gov>
Tue, 7 May 2019 03:01:09 +0000 (23:01 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Tue, 7 May 2019 03:18:02 +0000 (23:18 -0400)
examples/step-59/step-59.cc

index 5627107ffb5700b6f2f03ffd81df26eef19794ea..5ee5c41e72493e64bf41ea97daccf8e01df84415 100644 (file)
@@ -1018,8 +1018,8 @@ namespace Step59
       additional_data.mapping_update_flags_boundary_faces =
         (update_gradients | update_JxW_values | update_normal_vectors |
          update_quadrature_points);
-      std::shared_ptr<MatrixFree<dim, double>> system_mf_storage(
-        new MatrixFree<dim, double>());
+      const auto system_mf_storage =
+        std::make_shared<MatrixFree<dim, double>>();
       system_mf_storage->reinit(dof_handler,
                                 dummy,
                                 QGauss<1>(fe.degree + 1),
@@ -1050,8 +1050,8 @@ namespace Step59
         additional_data.mapping_update_flags_boundary_faces =
           (update_gradients | update_JxW_values);
         additional_data.level_mg_handler = level;
-        std::shared_ptr<MatrixFree<dim, float>> mg_mf_storage_level(
-          new MatrixFree<dim, float>());
+        const auto mg_mf_storage_level =
+          std::make_shared<MatrixFree<dim, float>>();
         mg_mf_storage_level->reinit(dof_handler,
                                     dummy,
                                     QGauss<1>(fe.degree + 1),
@@ -1244,8 +1244,8 @@ namespace Step59
             smoother_data[0].degree          = numbers::invalid_unsigned_int;
             smoother_data[0].eig_cg_n_iterations = mg_matrices[0].m();
           }
-        smoother_data[level].preconditioner.reset(
-          new PreconditionBlockJacobi<dim, fe_degree, float>());
+        smoother_data[level].preconditioner =
+          std::make_shared<PreconditionBlockJacobi<dim, fe_degree, float>>();
         smoother_data[level].preconditioner->initialize(mg_matrices[level]);
       }
     mg_smoother.initialize(mg_matrices, smoother_data);

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.