Makes totally sense!
The function I interpolate using an FE_Q<1> element is
f(x,y) = 0.12x + 0.002x^4 + sqrt(y), 3.0<{x,y}<4.0
Lets call the FE function f^h(x,y) which lives in the space H^1,
hence it lives in a different space than f(x,y).
Clearly, df^h(x,y) / dx and
df^h(x,y) / dy are discontinuous and
I project them using global smoothing as implemented in VectorTools::project.
, hence
df^h(x,y) / dx and
df^h(x,y) / dy live again in H^1 and I can
differentiate them again to calculate the "second derivatives" of f^h(x,y).
The mixed second partial derivatives of f(x,y) are zero per design,
which is perfectly captured by f^h(x,y)
in
the unrotated grid with
only 9 degrees of freedom (refining once globally a GridGenerator::general_cell).
After rotating the grid as shown in my question, the mixed second partial derivatives
of
f^h(x,y) are no longer zero,
although f^h(x,y) and the smoothed first derivatives show good agreement with the analytical counterparts.
I think this is because the (lines of the) cells are not aligned with the global coordinate system and
things get mixed up due to the interpolation.
If the cells are aligned with the global coordinate system,
the decoupling of x and y can be captured on a coarse grid
Does this argumentation make sense?
I would have to refine the rotated grid roughly seven times to approximate this decoupling accurately.
Unfortunately, I can refine the grid globally at most twice.
Do you have an idea how to capture the above decoupling also at the rotated grid better --
maybe by generating the grid differently?
The input to my grid are four points which represent the minimal bounding box of a set of points in 2d
and the grid should roughly represent this box.
Thank you very much for your input,
Math