This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Function interpolation in parallel?

+1 vote

Hi Everyone, I'm trying to do adaptive refinement for an elliptic equation where the coefficients are Functions rather than Expressions. This works fine in serial but in parallel I get the error below.

Is this something that can be put on a list of features to implement?

Thanks,
Dave

RuntimeError:

*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at


*** fenics@fenicsproject.org


*** Remember to include the error message listed below and, if possible,
*** include a minimal running example to reproduce the error.


*** -------------------------------------------------------------------------
*** Error: Unable to perform operation in parallel.
*** Reason: Extrapolation of functions is not yet working in parallel.
*** Consider filing a bug report at https://bitbucket.org/fenics-project/dolfin/issues.
*** Where: This error was encountered inside log.cpp.
*** Process: 1


*** DOLFIN version: 1.6.0dev
*** Git changeset: 823502fdf5bf550d5515e595a661a241596fff1e
*** ------------------------------

asked Aug 4, 2015 by david.bernstein FEniCS User (2,000 points)

1 Answer

+1 vote

For Lagrange Functions on adaptively refined meshes you can use the LagrangeInterpolator class to interpolate from one mesh to another in parallel. For non-Lagrange elements there is currently no such functionality, but there are at least two issues already here and here . Naturally, for adaptive meshes with no repartitioning of mesh there could be more efficient routines. I think this has been addressed recently also here

answered Aug 11, 2015 by mikael-mortensen FEniCS Expert (29,340 points)

Hi Mikael, Thanks for your response. The coefficient function in my case is Lagrange and I'm using LinearAdaptiveSolver so the interpolation of the coefficient happens behind the scenes.

I would be happy if this could work in parallel without repartitioning the mesh.

Hello guys. Any update in interpolating a function in parallel?

Thanks and best regards,
Omkar.

You can use interpolate_nonmatching_mesh_any for non-Lagrange spaces and interpolate_nonmatching_mesh for Lagrange spaces. The first functionality is only in fenicstools, the second is more or less the same as LagrangeInterpolator.

...