Skip to content

Commit 74c1271

Browse files
fix bug gmres (#452)
Solves issue #451.
1 parent 5ff3884 commit 74c1271

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

psydac/linalg/solvers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ def solve(self, b, out=None):
10071007
pp += rp
10081008

10091009
# new residual norm
1010-
res_sqr = r.dot(r)
1010+
res_sqr = r.dot(r).real
10111011

10121012
niter += 1
10131013

@@ -1804,6 +1804,10 @@ def solve(self, b, out=None):
18041804
r -= b
18051805

18061806
am = sqrt(r.dot(r).real)
1807+
if am < tol:
1808+
self._info = {'niter': 1, 'success': am < tol, 'res_norm': am }
1809+
return x
1810+
18071811
beta.append(am)
18081812
r *= - 1 / am
18091813

0 commit comments

Comments
 (0)