Hello,
I was trying to do something very similar here. I would like to solve an electrostatic problem in 3D and use the adaptive refinement method to improve the result accuracy.
In practice I want to do the following.
I build a 3D geometry composed of a prism which contains come charge density surrounded by a "vacuum" domain enclosed in a far external surface (a sphere).
I than try to solve the BVP of the related Poisson problem with the adaptive refinement algorithm as in the example in section 1.6 (Error estimation & adaptive refinement).
I also added the lines of code suggested by Christopher to remove the refinement flags for surface elements.
As a result, i find a strange behavior of the error estimator. Indeed, with increasing mesh density the
error estimate tends to zero, but not with a monotonic manner (as in the tutorial example).
I have the feeling there is something wrong going on, but I can't say if it's a problem of my code or something related to the 3D refinement as faced by Ahmed.
I'm attaching the code.
Thanks in advance for the help.
Tommaso