Skip to content

[params] Make it possible to initialize parameters when not called from main

Timo Koch requested to merge feature/extend-parameter-init-interface into master

We cannot expect that we always have argv,argc to initialize the parameters. Also we might wanna run a simulation without input file. Unfortunately, the new interface makes it possible to easily overwrite parameters in every class / function. The name init still suggests that it should be only used to initialize parameters. Do we want such an option for the singleton? AFAIK Fenics also has a global parameter object that can be changed everywhere. This makes it possible to easily change parameters in the main file. However, the feature should never be used in any class as setting the parameter will have hidden side effects on the whole program. Maybe just having a function init instead of a function setParam documents our intent on how to use it well. By the way, overwriting the params in some class is also possible with the current init, it's just inefficient as you overwrite all parameters and have to read the input file again.

Merge request reports