opm-models icon indicating copy to clipboard operation
opm-models copied to clipboard

Separate parameters from properties

Open berndflemisch opened this issue 5 years ago • 2 comments

Currently, a parameter gets a default value from a corresponding property with the same name. It is inconvenient to require that a parameter has a property default and also unnecessarily mixes the two concepts. Moreover, the hierarchical structure of parameters is not reflected adequately by the property system.

  • [ ] Replace the parameter system by the one from Dumux.
  • [ ] Redefine the parameter macros in terms of the new system and mark them as deprecated.
  • [ ] Replace the macro calls.

berndflemisch avatar Oct 12 '20 09:10 berndflemisch

Sounds interesting. Briefly, what are the properties of the Dumux system? For the current system, one big advantage is the automatic generation of the --help message listing all parameters, a drawback is that the existence of any specific parameter and its default value must be set at compile-time. How does the Dumux system compare on those two features?

atgeirr avatar Oct 12 '20 09:10 atgeirr

A bit in the opposite way. You can pass a default value to every call to getParam . To avoid possible inconsistencies, we set default values for specific parameters in a central file by means of a global default list. These parameters and their values could also be printed with --help, along with the ones passed on the command line and in the parameter file. Actually used parameters and the ones that have been specified on the command line or in the parameter file but are not used can be printed at the end of simulation.

Parameters do not need to get a default value. If a parameter value is requested by getParam without passing a default value, an exception is thrown if the value is not set on the command line, in the parameter file or in the global default list.

berndflemisch avatar Oct 12 '20 10:10 berndflemisch