cbcpost does not allow for storing of dolfin.Parameters

Issue #3 resolved
Marie Elisabeth Rognes created an issue

It would be very useful if cbcpost could store dolfin.Parameters as well as the custom ParamDict for instance via:

from dolfin import *
from cbcpost import *
pp = PostProcessor(dict(casedir="results", clean_casedir=True))
info(parameters)
pp.store_params(parameters)

Comments (3)

  1. Øyvind Evju

    The dolfin parameters are not pickleable, and therefore won't work for simple storing/loading. However, the following is supported:

    from dolfin import *
    from cbcpost import *
    pp = PostProcessor(dict(casedir="results", clean_casedir=True))
    info(parameters)
    pp.store_params(parameters.to_dict())
    

    For improved readability in the params.txt-file, I suggest converting the dict (recursively) to ParamDict, which is now supported:

    from dolfin import *
    from cbcpost import *
    pp = PostProcessor(dict(casedir="results", clean_casedir=True))
    info(parameters)
    pp.store_params(ParamDict(parameters.to_dict()))
    
  2. Log in to comment