From: Peter Munch Date: Mon, 7 Oct 2024 15:37:24 +0000 (+0200) Subject: Simplify MGCoarseGridIterativeSolver X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F17756%2Fhead;p=dealii.git Simplify MGCoarseGridIterativeSolver --- diff --git a/include/deal.II/multigrid/mg_coarse.h b/include/deal.II/multigrid/mg_coarse.h index b9d98289ba..dc234f9baf 100644 --- a/include/deal.II/multigrid/mg_coarse.h +++ b/include/deal.II/multigrid/mg_coarse.h @@ -356,56 +356,6 @@ MGCoarseGridIterativeSolver, - VectorType> * = nullptr> - void - solve(SolverType &solver, - const MatrixType &matrix, - const PreconditionerType &preconditioner, - VectorType &dst, - const VectorType &src) - { - solver.solve(matrix, dst, src, preconditioner); - } - - template , - VectorType> * = nullptr> - void - solve(SolverType &solver, - const MatrixType &matrix, - const PreconditionerType &preconditioner, - VectorType &dst, - const VectorType &src) - { - typename SolverType::vector_type src_; - typename SolverType::vector_type dst_; - - src_ = src; - dst_ = dst; - - solver.solve(matrix, dst_, src_, preconditioner); - - dst = dst_; - } - } // namespace MGCoarseGridIterativeSolver -} // namespace internal - - - template ) + { + solver->solve(*matrix, dst, src, *preconditioner); + } + else + { + typename SolverType::vector_type src_; + typename SolverType::vector_type dst_; + + src_ = src; + dst_ = dst; + + solver->solve(*matrix, dst_, src_, *preconditioner); + + dst = dst_; + } }