dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #15369
[Bug 423154] Re: Interpolating between different meshes fails
This is problem exists in the c++ version as well.
It's actually critical for some codes I'm writing where I need to interpolate to a submesh.
Everything worked up to revision 6870, and I suspect it's related to putting ufc_cell into data (as is suggested by the workaround in the original bug report).
--
Interpolating between different meshes fails
https://bugs.launchpad.net/bugs/423154
You received this bug notification because you are subscribed to DOLFIN.
Status in DOLFIN: Confirmed
Bug description:
When I attempt to interpolate between different meshes, I get completely erroneous results. The following example demonstrates this:
from dolfin import *
mesh1 = UnitSquare(8, 8)
mesh2 = UnitSquare(16, 16)
V1 = FunctionSpace(mesh1, "CG", 1)
V2 = FunctionSpace(mesh2, "CG", 1)
f1 = Function(V1, "500.0 * exp(-(pow(x[0] - 0.5, 2) + pow(x[1] - 0.5, 2)) / 0.02)")
f1.interpolate()
f2 = interpolate(f1, V2)
plot(f1, title="Original function")
plot(f2, title="Interpolated function")
interactive()
Furthermore, when I comment out f1.interpolate(), i.e. keep it defined as an expression, I do not run into this problem. A workaround (as suggested by Anders) for this seems to be to comment out data._ufc_cell = &cell; from dolfin/function/UFCFunction.cpp.