step11, a FENICS code which uses the Discontinuous Petrov Galerkin (DPG) method to solve a Poisson problem, and repeatedly refines the mesh, guided by DPG error indicators. Two methods of adaptive refinement are compared, one of which refines cells which represent a fixed percentage of the error (case 0), and one of which refines a fixed percentage of the cells (case1). The problem uses a discontinuous diffusivity function kappa(x,y).
Note that I have installed FENICS using Docker, and so to run this script I issue the commands:
The error decay plots:
The mesh plots for case 0:
The mesh plots for case 1: