GridFunctionSpace not updated properly after grid coarsening
This may be related to #69 (closed). Using adapt_grid() with a P2-P1-CompositeGridFunctionSpace results in a wrong number of DoFs for the P1 subspace. I uploaded a zip file consisting of the master branch of dune-pdelab with an additional test and its dependencies here. Compile and execute with
./dune-common/bin/dunecontrol --opts=config-gcc-debug all
cd dune-pdelab/build-gcc-debug/dune/pdelab/test/
make adapt_grid_bug
./adapt_grid_bug
The test creates an ALUGrid<2,2,simplex,conforming> with 1 cell and does a global refine which yields 5 cells, 10 intersections and 6 vertices. All cells are marked for coarsening and then adapt_grid is called which results in a grid with 3 cells, 7 intersections and 5 vertices. The updated P2 gridfunctionspace has size() 12 (which is correct) but the P1 gridfunctionspace still has size() 6 (should be 5). The test also creates vtk files of the grid before and after coarsening. The issue is not restricted to ALUGrid but also occurs with an UG simplex grid.
Replacing the CompositeGridFunctionSpace with a simple P1 space results in the correct number of DoFs, as does a CompositeGridFunctionSpace with the P1 space as only child.
Setting fixedSize() to false for the PkLocalFiniteElementMap does not fix the issue.