From adcdd4b206cfed9f7c15da8dc0c5a7d3ccf16e2c Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Mon, 7 Oct 2024 17:37:24 +0200 Subject: [PATCH] Simplify MGCoarseGridIterativeSolver --- include/deal.II/multigrid/mg_coarse.h | 69 +++++++-------------------- 1 file changed, 17 insertions(+), 52 deletions(-) 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_; + } } -- 2.39.5