Hello everyone,
How can I set command-line options for Petsc with Fenics (python-version)
I tried parameters.parse()
at the start of my program and doing e.g. python bb.py --petsc.ksp_monitor <some_more_arguments_for_my_program>
. But I see no output on the screen. Instead, my input-file (which is one of the other arguments) gets overwritten and has some ksp-residuals in it (so at least something seems to work, but it's not exactly the behaviour i'd expect). Btw, I am using argparse
to handle my other arguments.
--petsc.ksp_type gmres
simply has no effect at all
Ultimately, I want to monitor the condition numbers of my linear systems by --petsc.ksp_monitor_singular_value
. So if there is any other way to do that in fenics, I'd be fine with it. (I know I can just use the array()
method, but handling nonsparse arrays in python takes hours for the systems that I am solving.
EDIT: I just found the PETScOptions.set()
method. However, this also does not work properly. My code has a time-loop, so many Sytems are solved inside that loop and then some more before the time-loop. The PetscOptions are only applied to the solves at the start of the code, but not to the ones inside the time-loop.....
regards