Interpolation between non-Lagrange spaces on different meshes in parallel

Issue #507 new
Douglas Arnold created an issue

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:

  1. 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.

  2. 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.

  3. 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)

  1. Chris Richardson

    I'd like to see a method to interpolate between related meshes, e.g.

    Q = FunctionSpace(mesh, "CG", 3)
    F = Function(Q)
    
    mesh2 = refine(mesh)
    Q2 = FunctionSpace(mesh2, "CG", 3)
    
    F2 = interpolate_from_parent(F, Q2)
    

    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.

  2. Chris Richardson
    • changed milestone to 1.7

    An update is needed to Function::eval() to make this work properly. Some changes will be implemented along with MeshView to allow more efficient interpolation between meshes which are related (either by refinement or view).

  3. Log in to comment