Skip to content

Commit

Permalink
Sped up generation of preconditioner for quench problem
Browse files Browse the repository at this point in the history
  • Loading branch information
brownbaerchen committed Oct 20, 2023
1 parent 8a29f48 commit a19b181
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pySDC/implementations/problem_classes/Quench.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import numpy as np
import scipy.sparse as sp
from scipy.sparse.linalg import spsolve, gmres, inv
from scipy.sparse.linalg import spsolve, gmres
from scipy.linalg import inv

from pySDC.core.Errors import ProblemError
from pySDC.core.Problem import ptype, WorkCounter
Expand Down Expand Up @@ -310,7 +311,7 @@ def solve_system(self, rhs, factor, u0, t):

# construct a preconditioner for the space solver
if not self.direct_solver:
M = inv(self.Id - factor * self.A)
M = inv((self.Id - factor * self.A).toarray())

for n in range(0, self.newton_maxiter):
# assemble G such that G(u) = 0 at the solution of the step
Expand Down
1 change: 1 addition & 0 deletions pySDC/projects/Resilience/quench.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def run_quench(

problem_params = {
'newton_tol': 1e-9,
'direct_solver': False,
}

# initialize step parameters
Expand Down

0 comments on commit a19b181

Please sign in to comment.