Solver diagnostics with options database

Issue #1057 new
Jed Brown created an issue

In trying to help a student with Python demos, I found it rather cumbersome to get diagnostics about solvers. (My preferred method is PETSc options, but it seems hard to get any diagnostics.) I got it working with code like

solver.set_options_prefix('mydemo_')
solver.set_from_options()
solver.solve(u.vector(), b)

but the examples typically are not written with an explicit solver object so this transformation is awkward. Also, if the user has called assemble() to get matrices, then a different code path (dolfin.la.solver.solve -> cpp.la.solve) is taken that does not have a Python-visible object on which to set a prefix or options.

Would it be reasonable to add a solve() keyword argument prefix= that sets the prefix and calls set_from_options on any internal solver object that may be created?

Comments (0)

  1. Log in to comment