Skip to content

Commit

Permalink
update tol to rtol
Browse files Browse the repository at this point in the history
  • Loading branch information
mscroggs committed Sep 30, 2024
1 parent 9587da2 commit 8c57ca0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions bempp/api/assembly/discrete_boundary_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class _ScaledDiscreteOperator(_DiscreteOperatorBase):
"""Return a scaled operator."""

def __init__(self, op, alpha):
dtype = _np.result_type([op.dtype], [type(alpha)])
dtype = _np.result_type(op.dtype, type(alpha))
self._op = op
self._alpha = alpha
super().__init__(dtype, op.shape)
Expand Down Expand Up @@ -105,7 +105,7 @@ def __init__(self, op1, op2):
self._op1 = op1
self._op2 = op2

dtype = _np.result_type([op1.dtype, op2.dtype], [])
dtype = _np.result_type(op1.dtype, op2.dtype)

super().__init__(dtype, op1.shape)

Expand Down Expand Up @@ -135,7 +135,7 @@ def __init__(self, op1, op2):
self._op1 = op1
self._op2 = op2

dtype = _np.result_type([op1.dtype, op2.dtype], [])
dtype = _np.result_type(op1.dtype, op2.dtype)

super().__init__(dtype, (op1.shape[0], op2.shape[1]))

Expand Down
6 changes: 3 additions & 3 deletions bempp/api/linalg/iterative_solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def cg(
bempp.api.log("Starting CG iteration")
start_time = time.time()
x, info = scipy.sparse.linalg.cg(
A_op, b_vec, tol=tol, maxiter=maxiter, callback=callback
A_op, b_vec, rtol=tol, maxiter=maxiter, callback=callback
)
end_time = time.time()
bempp.api.log(
Expand Down Expand Up @@ -202,7 +202,7 @@ def _gmres_single_op_imp(
bempp.api.log("Starting GMRES iteration")
start_time = time.time()
x, info = scipy.sparse.linalg.gmres(
A_op, b_vec, tol=tol, restart=restart, maxiter=maxiter, callback=callback
A_op, b_vec, rtol=tol, restart=restart, maxiter=maxiter, callback=callback
)
end_time = time.time()
bempp.api.log(
Expand Down Expand Up @@ -259,7 +259,7 @@ def _gmres_block_op_imp(
bempp.api.log("Starting GMRES iteration")
start_time = time.time()
x, info = scipy.sparse.linalg.gmres(
A_op, b_vec, tol=tol, restart=restart, maxiter=maxiter, callback=callback
A_op, b_vec, rtol=tol, restart=restart, maxiter=maxiter, callback=callback
)
end_time = time.time()
bempp.api.log(
Expand Down

0 comments on commit 8c57ca0

Please sign in to comment.