Some PETSc parameters parsed from command line changes after plotting
Issue #512
invalid
Tolerances for PETSc solvers parsed from command line are set to 1 after plotting. This issue also affects other double-valued parameters.
The following example reproduces the issue.
import sys
from dolfin import *
args = """
--petsc.ksp_type cg
--petsc.pc_type hypre
--petsc.ksp_max_it 30
--petsc.ksp_rtol 1.0e-8
--petsc.ksp_atol 1.0e-10
"""
parameters.parse(argv = sys.argv[0:1] + args.split())
mesh = UnitSquareMesh(8,8)
V = FunctionSpace(mesh, 'CG', 1)
u, v = TrialFunction(V), TestFunction(V)
uh = Function(V); x = uh.vector()
a = inner(grad(u),grad(v))*dx + u*v * dx
L = v * dx
A, b = assemble_system(a, L)
solver = PETScKrylovSolver()
solver.solve(A, x, b)
solver.ksp().view()
plot(mesh)
solver.solve(A, x, b)
solver.ksp().view()
Prior to plotting, the tolerances are set correctly:
#!
tolerances: relative=1e-08, absolute=1e-10, divergence=10000
After plotting, the tolerances are set to 1.
#!
tolerances: relative=1, absolute=1, divergence=10000
Comments (4)
-
-
I can reproduce it with PETSc 3.5.3 and DOLFIN master.
simon@doodson /dataint/simon/src/fenics_master/dolfin git:master$ python bug.py | grep tolerances tolerances: relative=1e-08, absolute=1e-10, divergence=10000 tolerances: relative=1, absolute=1, divergence=10000
-
I can't reproduce with PETSc/master and DOLFIN/master.
-
- changed status to invalid
No further news on this, so closing. Re-open if it is still an issue.
- Log in to comment
Can't reproduce with PETSc 3.5.2 and DOLFIN master.