From: Matthias Maier Date: Fri, 28 Mar 2025 21:05:39 +0000 (-0500) Subject: SolverFGMRES: also allow multiple preconditioners because why not... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7136a61c5dd39e35ee93c14dfd36cf120c592d5;p=dealii.git SolverFGMRES: also allow multiple preconditioners because why not... --- 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...); }