#699 Wishlist: a general dynamic parameter interface for grids
Metadata
Property | Value |
---|---|
Reported by | Oliver Sander (oliver.sander@tu-dresden.de) |
Reported at | Dec 29, 2009 11:23 |
Type | Feature Request |
Version | 1.2 |
Operating System | Unspecified / All |
Last edited by | Christian Engwer (christi@conan.iwr.uni-heidelberg.de) |
Last edited at | Apr 22, 2012 18:51 |
Description
I would like to propose the following addition to the grid interface. It is not urgent, but I think it would clean out various rough edges we have currently.
There should be a generic way to dynamically set parameters of grids. Examples of such parameters are, e.g., different refinement strategies in AlbertaGrid, UGGrid, OnedGrid. Currently, these parameters are set using special-purpose methods (e.g. UGGrid::setRefinementType()
) which are not part of the interface and are different for each grid. As one negative consequence, the dgf parser has to have dedicated code for each grid implementation in order to handle these parameters.
I propose to introduce a generic interface for these parameters. In the simplest form, the parameters would be a list of name-value pairs, stored as strings. There would then be new methods like
void setParameter(string name, string value);
string getParameter(string name);
or similar. More fancy versions (if we decide that is necessary) could offer more than just string types for the values, or some sort of parameter hierarchy.
With such an interface it is much easier to load parameters in files into the grid types that expect them. This concerns the dgfparser, but also other file formats that allow arbitrary parameters (e.g. AmiraMesh). It may also help to unify the cases where the grid constructors need some grid specific parameters (memory size for UGGrid).
A second possible use may be that it allows grids to provide additional information about themself (similar to capabilities, but dynamically). For example, we may decide that the recently deprecated name()
method could reappear as a parameter set by the grid itself. Or possibly a grid may be able to give its memory consumption, or ...
I'd be interested to hear your opinions on this.