← Back to team overview

dolfin team mailing list archive

Parameters

 

Hello

Is there a reason the function default_parameters() doesn't return a reference or pointer to a singleton object? Returning a singleton object would allow parameters to be changed class wide before objects are created. As of now it makes no sense to use the parameter system in constructors.

Or have I missed some smart trick?

To be specific I would like to have a parameter in the ODESolution class, but I would like to avoid accessing the parameter system within ODESolution::eval(). With a singleton the solution would be (from a user perspective)

// Set parameter class wide
ODESolution::default_parameters().set("exact_interpolation") = false;

// The parameter will be parsed in the constructor
ODESolution solution();

// Doesn't access the parameter system
solution.eval(...)



Benjamin