IniGridFactory should work on a subtree of variable name
I was about to write a tutorial for PDELab on how to use our stuff and I realized that there is some flaw in how IniGridFactory works right now. It hardcodes the section name that configuration parameters are found in to e.g. yaspgrid
. That however, does not allow you to define multiple YapsGrids (preferably even of different dimensions or coordinate object type).
Instead, the factory should work exaclty like Linus work in core/dune-istl!5 (closed) does it: The factory gets the section name. Making this approach work with a static variation then requires the following:
dim = 2, 3 | expand grid
gridconfiguration = yasp2d, yasp3d | expand grid
[yasp2d]
... the section configuring a 2d grid
[yasp3d]
... the section configuring a 3d grid
[__static]
GRIDTYPE = Dune::YaspGrid<{dim}>
The C++ part then reads
Dune::IniGridFactory<GRIDTYPE> factory(initree, initree.get<std::string>("gridconfiguration"));
auto grid = factory.getGrid()
I do not see any chance to do something like this right now.
In order to implement this the factory should be constructed from initree and configuration section name.