Skip to content

adapt_grid() fails for FEM orders >= 2 if coarsening is applied

I'm using adaptive grid refinement on the UG grid manager with different types of Finite Element Maps, depending on the grid geometry type.

For a grid of simplices, I use Dune::PDELab::PkLocalFiniteElementMap<GV,DF,RF,order>for the Problem GFS and Dune::PDELab::P0LocalFiniteElementMap<DF,RF,dim> for the Adaptivity GFS. For rectangles, Dune::PDELab::QkDGLocalFiniteElementMap<DF,RF,order,dim> and Dune::PDELab::QkDGLocalFiniteElementMap<DF,RF,0,dim> are used, respectively. Everything works fine for order < 2.

For order = 2, the function call Dune::PDELab::adapt_grid(grid, gfs, u, 2) fails as soon as any cell is marked for coarsening with the error

Dune reported error: FMatrixError [luDecomposition:/opt/dune/dune-common/dune/common/densematrix.hh:839]: matrix is singular

It works fine if cells are only marked for refinement, or if no cell was marked at all.