Cannot take dictionary of parameters of PETScKrylovSolver

Issue #583 closed
Patrick Farrell created an issue

The following code

from dolfin import *

solver = PETScKrylovSolver()
solver.parameters.to_dict()

fails with

Traceback (most recent call last):
  File "demo.py", line 4, in <module>
    solver.parameters.to_dict()
  File "/home/pfarrell/local/dolfin/fenics-dev-20150916/src/dolfin/local/lib/python2.7/site-packages/dolfin/cpp/common.py", line 2503, in to_dict
    for key, value in self.items():
  File "/home/pfarrell/local/dolfin/fenics-dev-20150916/src/dolfin/local/lib/python2.7/site-packages/dolfin/cpp/common.py", line 2446, in items
    return zip(self.keys(),self.values())
  File "/home/pfarrell/local/dolfin/fenics-dev-20150916/src/dolfin/local/lib/python2.7/site-packages/dolfin/cpp/common.py", line 2439, in values
    return [self[key] for key in self.keys()]
  File "/home/pfarrell/local/dolfin/fenics-dev-20150916/src/dolfin/local/lib/python2.7/site-packages/dolfin/cpp/common.py", line 2467, in __getitem__
    return self._get_parameter(key).value()
  File "/home/pfarrell/local/dolfin/fenics-dev-20150916/src/dolfin/local/lib/python2.7/site-packages/dolfin/cpp/common.py", line 1866, in value
    return str(self)
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
***
***     fenics@fenicsproject.org
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------------------------------------------------------------------------
*** Error:   Unable to convert parameter to string .
*** Reason:  Parameter has not been set.
*** Where:   This error was encountered inside Parameter.cpp.
*** Process: 0
*** 
*** DOLFIN version: 1.7.0dev
*** Git changeset:  4b7cb23187d1f12f7108474875253da287222898
*** -------------------------------------------------------------------------

The analogous code with KrylovSolver works OK.

Comments (5)

  1. Log in to comment