Interpolation between non-Lagrange spaces on different meshes in parallel
As pointed out in this question, when working in parallel, one cannot take a function from a FunctionSpace on one mesh, and then interpolate it into a non-Lagrange function space on another mesh (e.g., interpolate an N1curl element on one mesh to an N1curl element on a refined mesh). If the interpolate function is used in parallel, the code crahses unless the "allow_extrapolation" parameter is set, but if it is set, the code returns the wrong answer. (For interpolating into a Lagrange function space, there is LagrangeInterpolator, which does work in parallel and so provides a solution. This was the solution provided for this issue when it was raised previously here.)
In summary, this issue has the following aspects:
-
When interpolate is used in parallel with two different meshes and without setting allow_extrapolation, the error message "Error: Unable to evaluate function at point. Reason: The point is not inside the domain. Consider setting 'allow_extrapolation' to allow extrapolation." is output. This is misleading and the advice bad.
-
When interpolate is used in parallel with two different meshes and with allow_extrapolation set, the wrong answer is returned and no error or warning is issued. This is dangerous. It would be better to issue an error message.
-
Most useful would be to provide a method that does work for interpolation between two different meshes if the target space is not Lagrange.
Comments (3)
-
-
- changed milestone to 1.7
An update is needed to
Function::eval()
to make this work properly. Some changes will be implemented along withMeshView
to allow more efficient interpolation between meshes which are related (either by refinement or view). -
- removed milestone
Removing milestone: 1.7 (automated comment)
- Log in to comment
I'd like to see a method to interpolate between related meshes, e.g.
and there could also probably be
F = interpolate_from_child(F2, Q)
. Both of these could just work cell-by-cell, so would be easy to implement in parallel.