Interpolation into MultiMeshFunctionSpace not implemented

Issue #675 resolved
Anders Logg (Chalmers) created an issue

Support interpolation of Expression into MultiMeshFunctionSpace.

Comments (7)

  1. Jørgen Dokken

    I tried to fix this by trying to interpolate the expression onto each Function in the MultiMeshFunction.

    from dolfin import *
    mesh_0 = RectangleMesh(Point(0, 0), Point(1, 1), 16, 16)
    mesh_1 = RectangleMesh(Point(0.2, 0.1), Point(0.3, 0.5), 20, 20)
    multimesh = MultiMesh()
    multimesh.add(mesh_0)
    multimesh.add(mesh_1)
    multimesh.build()
    V = MultiMeshFunctionSpace(multimesh, "Lagrange", 1)
    v = MultiMeshFunction(V)
    f = Expression("2")
    v0 = v.part(0)
    v0.interpolate(f)
    

    This produces the following error:

    ------------------------------------------------------------------------- Error: Unable to interpolate function into function space. Reason: Wrong size of vector. Where: This error was encountered inside FunctionSpace.cpp. *** Process: 0


    DOLFIN version: 2016.2.0.dev0 Git changeset: 8ea1b4e1a38f15458276d95fe8d751b36c3269b6 *** -------------------------------------------------------------------------

    It seems like there is some error in the initialization of _vector for each function and I'm not sure how to fix it.

  2. Jan Blechta

    I've already encountered non-matching multimesh vector dimension here. It seems that this is a design by purpose, not a bug.

  3. Jørgen Dokken

    Ok, I'm not going to try to fix this issue at the moment, looking forward to having someone fix this issue

  4. Log in to comment