Epetra solver with ilu preconditioner fails for repeated solves
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
DOLFIN |
New
|
Undecided
|
Unassigned |
Bug Description
The ilu preconditioner of Epetra works just fine if the solver is used just once, but fails for repeated solves, like in a timeloop.
Reconstruction:
from dolfin import *
parameters[
mesh = UnitSquare(16, 16)
V = FunctionSpace(mesh, 'CG', 1)
u = TrialFunction(V)
v = TestFunction(V)
A = assemble(
bc = DirichletBC(V, Constant(0), DomainBoundary())
source = interpolate(
b = assemble(
bc.apply(A, b)
solver = KrylovSolver(
solver.
solver.
u = Function(V)
for i in range(2):
solver.solve(A, u.vector(), b)
The first solve is just fine, but the second fails. It does not matter whether the preconditioner is reused or not. The output using dolfin-dev on bigblue is:
*****
***** Problem: Epetra::CrsMatrix
***** Preconditioned GMRES solution
***** Ifpack_
***** `IFPACK ILU (fill=0, relax=0.000000, athr=0.000000, rthr=1.000000)'
***** rcm reord, Condition number estimate = 1.70703
***** No scaling
*****
Solution time: 0.081843 (sec.)
total iterations: 13
Epetra (AztecOO) Krylov solver (gmres, ILU) converged in 13 iterations.
*****
***** Problem: Epetra::CrsMatrix
***** Preconditioned GMRES solution
*****
***** No scaling
*****
AZ_check_options: ERROR: options[AZ_precond] has improper value = 31626240
Solution time: 0.000012 (sec.)
total iterations: 0
Traceback (most recent call last):
File "simple_test.py", line 17, in <module>
solver.solve(A, u.vector(), b)
RuntimeError:
*** -------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
***
*** https:/
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------
*** Error: Unable to solve linear system using Epetra Krylov solver.
*** Reason: Solution failed to converge (error code 1).
*** Where: This error was encountered inside EpetraKrylovSol
*** -------