dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #21244
Parameters
-
To:
DOLFIN Mailing List <dolfin@xxxxxxxxxxxxxxxxxxx>
-
From:
Benjamin Kehlet <benjamik@xxxxxxxxx>
-
Date:
Thu, 03 Feb 2011 21:35:22 +0100
-
User-agent:
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7
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