Skip to content

Commit b97ac1e

Browse files
committed
_ad_init_object fix
1 parent 4d482b8 commit b97ac1e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

firedrake/adjoint_utils/function.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,10 @@ class CofunctionMixin(FunctionMixin):
342342
def _ad_dot(self, other):
343343
return firedrake.assemble(firedrake.action(self, other))
344344

345+
@classmethod
345346
def _ad_init_object(cls, obj):
346347
from firedrake import Cofunction
347-
return Cofunction(cls.function_space()).assign(obj)
348+
return Cofunction(obj.function_space()).assign(obj)
348349

349350
def _ad_init_zero(self, dual=False):
350351
from firedrake import Function, Cofunction

0 commit comments

Comments
 (0)