Hello, while fiddling with something loosely related, I noticed the following strange behaviour.
Consider the equation
where f and the Dirichlet boundary conditions are chosen so that the solution is, say, u_{ex} = \sin(12x) \cdot e^{-y^2} + \ln(1+z) [there is nothing special about this function].
If dolfin-x, I assemble the scalar residual = (div(grad(u)) + 1 - u**2 + f)**2*dx
which is the equation’s strong residual in L2 norm.
Naively, I expect this quantity to be very small, but it turns out that it’s quite “big”: to give some sample output, on a unit cube with n
subdivisions in each dimension, [after taking the square root]
n = 10; h = 0.173205; ||L u_ex - f(u_ex)|| = 26.2191
n = 20; h = 0.0866025; ||L u_ex - f(u_ex)|| = 13.3575
n = 40; h = 0.0433013; ||L u_ex - f(u_ex)|| = 6.70934
Now, the first thing I notice is that the residual decreases linearly with h, but my question is on how to interpret that number: is 13 a lot? Is it small? Should I normalise it with something?
Changing the interpolation spaces (P2, P3, …) makes the residual smaller, but still not the “10^-many” I was expecting.
Changing the quadrature degree in UFL doesn’t seem to affect the computed residual at all.
Some context: I want to solve some nonlinear equations [like the one above] with a fixed-point method, using the equation’s strong residual as a stopping criterion.
In practice I see that, despite converging to the correct solution, the residual plateaus around the quantity computed with the exact solution [of course it does!], but then I am unable to set a meaningful tolerance for my stopping criterion.
To clarify the last paragraph: what I mean is that if I run the fixed-point procedure on the equation above with n = 10
, the residuals I get for the various u_1, u_2, …, u_k make a sequence that converges to around 26. If I pick n = 20
, I get another sequence that converges to around 13, and so on.
My underlying issue is that I want that residual to be very small, and I don’t understand why it isn’t
Thanks for any help!