]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Simplify code.
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 16 Nov 2022 21:58:27 +0000 (14:58 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 17 Nov 2022 15:44:39 +0000 (08:44 -0700)
tests/slepc/step-36_parallel.cc
tests/slepc/step-36_parallel_02.cc
tests/slepc/step-36_parallel_03.cc

index 0b3bb37dd8e347708ef5e02f96e8a4068bb2a344..61cac41df3bf28b317880e988d497d8976d187f8 100644 (file)
@@ -217,7 +217,7 @@ test(std::string solver_name, std::string preconditioner_name)
 
   // test SLEPc by
   {
-    PETScWrappers::PreconditionBase *preconditioner;
+    PETScWrappers::PreconditionBase *preconditioner = nullptr;
 
     dealii::deallog << preconditioner_name << std::endl;
     if (preconditioner_name == "Jacobi")
@@ -240,11 +240,7 @@ test(std::string solver_name, std::string preconditioner_name)
       }
     else
       {
-        AssertThrow(false, ExcMessage("not supported preconditioner"));
-
-        // make compiler happy
-        preconditioner =
-          new PETScWrappers::PreconditionJacobi(mpi_communicator);
+        AssertThrow(false, ExcMessage("Unsupported preconditioner"));
       }
 
     dealii::SolverControl   linear_solver_control(dof_handler.n_dofs(),
index 759eb7eb917e76e590dd370d9b8051e32e8af1c4..676c5144fece5bbeb1af151e11b46bf6a0c2f218 100644 (file)
@@ -217,7 +217,7 @@ test(std::string solver_name, std::string preconditioner_name)
 
   // test SLEPc by
   {
-    PETScWrappers::PreconditionBase *preconditioner;
+    PETScWrappers::PreconditionBase *preconditioner = nullptr;
 
     dealii::deallog << preconditioner_name << std::endl;
     if (preconditioner_name == "Jacobi")
@@ -240,11 +240,7 @@ test(std::string solver_name, std::string preconditioner_name)
       }
     else
       {
-        AssertThrow(false, ExcMessage("not supported preconditioner"));
-
-        // make compiler happy
-        preconditioner =
-          new PETScWrappers::PreconditionJacobi(mpi_communicator);
+        AssertThrow(false, ExcMessage("Unsupported preconditioner"));
       }
 
     dealii::SolverControl   linear_solver_control(dof_handler.n_dofs(),
index 88465c9e588f320a10c3f23ffab642cf81a17361..20cde958a264c712b0521a57d464f31e5c805703 100644 (file)
@@ -217,7 +217,7 @@ test(std::string solver_name, std::string preconditioner_name)
 
   // test SLEPc by
   {
-    PETScWrappers::PreconditionBase *preconditioner;
+    PETScWrappers::PreconditionBase *preconditioner = nullptr;
 
     dealii::deallog << preconditioner_name << std::endl;
     if (preconditioner_name == "Jacobi")
@@ -240,11 +240,7 @@ test(std::string solver_name, std::string preconditioner_name)
       }
     else
       {
-        AssertThrow(false, ExcMessage("not supported preconditioner"));
-
-        // make compiler happy
-        preconditioner =
-          new PETScWrappers::PreconditionJacobi(mpi_communicator);
+        AssertThrow(false, ExcMessage("Unsupported preconditioner"));
       }
 
     dealii::SolverControl   linear_solver_control(dof_handler.n_dofs(),

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.