Hi, I want to test an estimator. Therefore I have my own norm which is supposed to integrate over each cell and assigning this cell the integral value. $$ \int_T(\textrm{ grad}\phi_h-\varepsilon^{-1}\sigma_h)^2 $$ My final goal is to have a function (piecewise constants) for each mesh cell containing the error present in this cell and plot it so it can be seen where the biggest error is in the domain (so I can know where to make the mesh finer) I cannot find out how this is done
You can use DG0 Function:
DG = FunctionSpace(mesh, "DG", 0) v = TestFunction(DG) f = 1./CellVolume(mesh)*inner(grad(phi)-1./eps*sigma, v)*dx() err = Function(DG) assemble(f, tensor=err.vector())
Thanks, It has to be this to work: 1./CellVolume(mesh)*inner(dot(grad(phi)-1./eps*sigma,grad(phi)-1./eps*sigma), v)*dx
1./CellVolume(mesh)*inner(dot(grad(phi)-1./eps*sigma,grad(phi)-1./eps*sigma), v)*dx