Skip to content

Commit

Permalink
[python3] implements workaround for #171
Browse files Browse the repository at this point in the history
  • Loading branch information
renefritze authored and sdrave committed May 4, 2016
1 parent b529e08 commit ac45c16
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/pymor/operators/numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -814,8 +814,14 @@ def _apply_inverse(matrix, V, options=None):
raise InversionError('bicgstab failed with error code {} (illegal input or breakdown)'.
format(info))
elif options['type'] == 'bicgstab_spilu':
ilu = spilu(matrix, drop_tol=options['spilu_drop_tol'], fill_factor=options['spilu_fill_factor'],
drop_rule=options['spilu_drop_rule'], permc_spec=options['spilu_permc_spec'])
# workaround for https://github.com/pymor/pymor/issues/171
try:
ilu = spilu(matrix, drop_tol=options['spilu_drop_tol'], fill_factor=options['spilu_fill_factor'],
drop_rule=options['spilu_drop_rule'], permc_spec=options['spilu_permc_spec'])
except TypeError as t:
logger = getLogger('pymor.operators.numpy._apply_inverse')
logger.error("ignoring drop_rule and permc_spec in ilu factorization")
ilu = spilu(matrix, drop_tol=options['spilu_drop_tol'], fill_factor=options['spilu_fill_factor'])
precond = LinearOperator(matrix.shape, ilu.solve)
for i, VV in enumerate(V):
R[i], info = bicgstab(matrix, VV, tol=options['tol'], maxiter=options['maxiter'], M=precond)
Expand Down

0 comments on commit ac45c16

Please sign in to comment.