From 0a7d80321422f370cc6ebc88a3902c91160ba89a Mon Sep 17 00:00:00 2001 From: Andrea Iob Date: Fri, 7 Jun 2024 14:00:46 +0200 Subject: [PATCH 1/2] LA: fix initialization of Krylov subspace --- src/LA/system_solvers_large.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/LA/system_solvers_large.cpp b/src/LA/system_solvers_large.cpp index 504820f919..c1af592d8a 100644 --- a/src/LA/system_solvers_large.cpp +++ b/src/LA/system_solvers_large.cpp @@ -3169,9 +3169,6 @@ void SystemSolver::prepareKSP() // Set up if (setupNeeded) { - // Initialization - KSPSetFromOptions(m_KSP); - // Perform actions before preconditioner set up prePreconditionerSetupActions(); @@ -3184,6 +3181,9 @@ void SystemSolver::prepareKSP() // Perform actions before Krylov subspace method set up set up preKrylovSetupActions(); + // Initialize Krylov subspace from options + KSPSetFromOptions(m_KSP); + // Set up the Krylov subspace method setupKrylov(); From 0fe3ba70ec24366760e85a84e4e69ded2fe12a76 Mon Sep 17 00:00:00 2001 From: Andrea Iob Date: Fri, 7 Jun 2024 14:01:08 +0200 Subject: [PATCH 2/2] LA: allow to initialize preconditioner from options --- src/LA/system_solvers_large.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/LA/system_solvers_large.cpp b/src/LA/system_solvers_large.cpp index c1af592d8a..8c9db4ace1 100644 --- a/src/LA/system_solvers_large.cpp +++ b/src/LA/system_solvers_large.cpp @@ -3172,6 +3172,11 @@ void SystemSolver::prepareKSP() // Perform actions before preconditioner set up prePreconditionerSetupActions(); + // Initialize preconditioner from options + PC pc; + KSPGetPC(m_KSP, &pc); + PCSetFromOptions(pc); + // Set up preconditioner setupPreconditioner();