From b7136a61c5dd39e35ee93c14dfd36cf120c592d5 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Fri, 28 Mar 2025 16:05:39 -0500 Subject: [PATCH] SolverFGMRES: also allow multiple preconditioners because why not... --- include/deal.II/lac/solver_gmres.h | 31 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/include/deal.II/lac/solver_gmres.h b/include/deal.II/lac/solver_gmres.h index 42b85b5833..d7765c650c 100644 --- a/include/deal.II/lac/solver_gmres.h +++ b/include/deal.II/lac/solver_gmres.h @@ -878,19 +878,15 @@ public: /** * Solve the linear system $Ax=b$ for x. - * - * @note If you want to use more than one preconditioner, then you will - * need to supply a @p preconditioner object that switches - * preconditioners for each vmult() invocation. */ - template + template DEAL_II_CXX20_REQUIRES( (concepts::is_linear_operator_on && - concepts::is_linear_operator_on)) - void solve(const MatrixType &A, - VectorType &x, - const VectorType &b, - const PreconditionerType &preconditioner); + (concepts::is_linear_operator_on && ...))) + void solve(const MatrixType &A, + VectorType &x, + const VectorType &b, + const PreconditionerTypes &...preconditioners); }; /** @} */ @@ -2378,17 +2374,18 @@ SolverFGMRES::SolverFGMRES(SolverControl &cn, template DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector) -template +template DEAL_II_CXX20_REQUIRES( (concepts::is_linear_operator_on && - concepts::is_linear_operator_on)) -void SolverFGMRES::solve(const MatrixType &A, - VectorType &x, - const VectorType &b, - const PreconditionerType &preconditioner) + (concepts::is_linear_operator_on && ...))) +void SolverFGMRES::solve( + const MatrixType &A, + VectorType &x, + const VectorType &b, + const PreconditionerTypes &...preconditioners) { LogStream::Prefix prefix("FGMRES"); - SolverMPGMRES::solve_internal(A, x, b, preconditioner); + SolverMPGMRES::solve_internal(A, x, b, preconditioners...); } -- 2.39.5