Assemble under dolfin adjoint

Hello everybody,

i have the following problem.

Without using dolfin_adjoint i can compute the area of a boundary successfully with

area_gamma1 = assemble(1*ds(4))

But since i imported the dolfin_adjoint package i get the following error

    area_gamma1 = assemble(1*ds(4))
  File "/home/fenics/.local/lib/python3.6/site-packages/fenics_adjoint/", line 24, in assemble
    block = AssembleBlock(form)
  File "/home/fenics/.local/lib/python3.6/site-packages/fenics_adjoint/", line 72, in __init__
  File "/home/fenics/.local/lib/python3.6/site-packages/pyadjoint/", line 51, in add_dependency
AttributeError: 'dolfin.cpp.mesh.Mesh' object has no attribute '_ad_will_add_as_dependency'

Does anybody have an idea please?


Ok. Sorry. I got it.

One have to use dolfin.assemble because of the overload function.

Greetings and have a nice day.