From d5154440f91bb779bcd104aee8fcb50511189614 Mon Sep 17 00:00:00 2001 From: Pablo Brubeck Date: Mon, 29 Jul 2024 16:44:04 +0100 Subject: [PATCH] WIP: fixes to assemble complicated BaseForms --- ufl/adjoint.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ufl/adjoint.py b/ufl/adjoint.py index 71ac3bd32..f4a7f4494 100644 --- a/ufl/adjoint.py +++ b/ufl/adjoint.py @@ -84,7 +84,11 @@ def form(self): def _analyze_form_arguments(self): """The arguments of adjoint are the reverse of the form arguments.""" - self._arguments = self._form.arguments()[::-1] + reversed_args = self._form.arguments()[::-1] + # Canonical numbering for arguments that is consistent with other BaseForm objects. + self._arguments = tuple( + type(arg)(arg.ufl_function_space(), number=i) for i, arg in enumerate(reversed_args) + ) self._coefficients = self._form.coefficients() def _analyze_domains(self):