From: Wolfgang Bangerth Date: Wed, 16 Nov 2022 21:58:27 +0000 (-0700) Subject: Simplify code. X-Git-Tag: v9.5.0-rc1~841^2~5 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=efe83d062c4ca1f426711e481b3efad45f86e852;p=dealii.git Simplify code. --- diff --git a/tests/slepc/step-36_parallel.cc b/tests/slepc/step-36_parallel.cc index 0b3bb37dd8..61cac41df3 100644 --- a/tests/slepc/step-36_parallel.cc +++ b/tests/slepc/step-36_parallel.cc @@ -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(), diff --git a/tests/slepc/step-36_parallel_02.cc b/tests/slepc/step-36_parallel_02.cc index 759eb7eb91..676c5144fe 100644 --- a/tests/slepc/step-36_parallel_02.cc +++ b/tests/slepc/step-36_parallel_02.cc @@ -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(), diff --git a/tests/slepc/step-36_parallel_03.cc b/tests/slepc/step-36_parallel_03.cc index 88465c9e58..20cde958a2 100644 --- a/tests/slepc/step-36_parallel_03.cc +++ b/tests/slepc/step-36_parallel_03.cc @@ -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(),