Cannot create a Function with firedrake-adjoint when using a MixedFunctionSpace

Bug #1277090 reported by Christian Jacobs
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Committed
Simon Funke

Bug Description

I'm trying to use firedrake-adjoint with my shallow water model. However, I receive the following error message when trying to instantiate a Function object using a MixedFunctionSpace:

"christian@elevate ~ $ python
Info : Increasing process stack size (8192 kB < 16 MB)
Traceback (most recent call last):
  File "", line 9, in <module>
    mixed_function = Function(W)
  File "/data/dolfin-adjoint-dolfin-adjoint-7a6628f15dbc/dolfin_adjoint/", line 134, in __init__
    assign.register_assign(self, args[0])
  File "/data/dolfin-adjoint-dolfin-adjoint-7a6628f15dbc/dolfin_adjoint/", line 11, in register_assign
    assert op is not None

The following code reproduces the error:

"from firedrake import *
from firedrake_adjoint import *

mesh = UnitSquareMesh(10, 10)
fs_1 = FunctionSpace(mesh, "CG", 2)
fs_2 = FunctionSpace(mesh, "CG", 1)
W = MixedFunctionSpace([fs_1, fs_2])

mixed_function = Function(W)"

Firedrake version: 0.9.0
DOLFIN version: 1.0.0
DOLFIN-adjoint version: 0.6
libadjoint version: 0.9.3

Revision history for this message
Simon Funke (simon-funke) wrote :

MixedFunctionSpaces have not been implemented in firedrake-adjoint yet.

I will have a look at it once I have a working firedrake installation again.

Changed in dolfin-adjoint:
assignee: nobody → Simon Funke (simon-funke)
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Christian Jacobs (ctjacobs) wrote :

I'm still getting this error with dolfin-adjoint 1.4. Has any progress been made in a development branch?

Revision history for this message
Patrick Farrell (pefarrell) wrote :

Hi Christian,

Sorry, I didn't see this because we've moved the issue tracker to bitbucket.

Should be fixed in d-a default (on bitbucket) now. The problem was that in dolfin, MixedFunctionSpace is a subclass of FunctionSpace, whereas in firedrake it isn't. So our isinstance(something, FunctionSpace) failed and it went down the wrong branch.


Changed in dolfin-adjoint:
status: Confirmed → Won't Fix
status: Won't Fix → Fix Committed
Revision history for this message
Christian Jacobs (ctjacobs) wrote :

Many thanks for fixing this, Patrick.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.