Hi Michael,
Thank you for your response and the changes that you made in the code. you are right, the exact solution produce a singularity at (0,0,0) with the term (x**2+y**2+z**2)**0.6. So, I expected a finer refinement around (0,0,0), but the refinement went in strange way. I added a grid function "e" to store the local exact error (which is the estimate used to mark the elements) for each element; but by drawing "e" we can see that some elements with big errors were not refined whereas other were refined with small error values.
My question again, does the attribute "SetRefinementFlag" work with 3D meshes?. Because I couldn't find any other adaptive refinement example that work for 3D problems.
Note: I can't used the Diff method of NGSolve, it gives me this error
File "<string>", line 26, in <module>
AttributeError: 'ngsolve.fem.CoefficientFunction' object has no attribute 'Diff'.
I am grateful for any explanation
Here are my python script after adding the grid function "e".