I implemented a virtualised (i.e. type erased) version of the DUNE grid interface.
It just takes dimension and world dimension as template parameters, and then can be constructed by passing another grid to the constructor. For instance:
Dune::VirtualizedGrid<2,2> ( yaspGrid );
I‘m looking forward to use this for the python bindings to improve compilation speed of JIT modules significantly.
It is currently tested with YaspGrid<1/2/3>. Other grid types have to be tested as implementations differ here and there, and performance might be improved. My gridcheck currently shows at least factor 2 in runtime compared to the non-virtualised grid.