Actions and adjoints.
- Dominant language
- Python
- Stars
- 150
- Forks
- 79
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 10
Description
I'm getting an error when I try to apply actions and adjoints. Could you please help me with this?
The followiing is a minimal example and the error.
```
from firedrake import *
from firedrake.__future__ import interpolate
mesh = UnitSquareMesh(1, 1)
V = FunctionSpace(mesh, "CG", 1)
K = interpolate(TestFunction(V), V)
w = Function(V)
derivative(action(adjoint(K), inner(TestFunction(V), w)*dx), w)
```
The error:
Traceback (most recent call last):
File "/opt/firedrake/firedrake/src/ufl/ufl/domain.py", line 189, in as_domain
return extract_unique_domain(domain)
File "/opt/firedrake/firedrake/src/ufl/ufl/domain.py", line 255, in extract_unique_domain
domains = extract_domains(expr)
File "/opt/firedrake/firedrake/src/ufl/ufl/domain.py", line 248, in extract_domains
for t in traverse_unique_terminals(expr):
File "/opt/firedrake/firedrake/src/ufl/ufl/corealg/traversal.py", line 137, in traverse_unique_terminals
if op._ufl_is_terminal_:
AttributeError: 'Action' object has no attribute '_ufl_is_terminal_'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/firedrake/codes/rfem.py", line 7, in
derivative(action(adjoint(K), inner(TestFunction(V), w)*dx), w)
File "petsc4py/PETSc/Log.pyx", line 188, in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
File "petsc4py/PETSc/Log.pyx", line 189, in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
File "/opt/firedrake/firedrake/src/firedrake/firedrake/ufl_expr.py", line 239, in derivative
mesh = as_domain(form)
File "/opt/firedrake/firedrake/src/ufl/ufl/domain.py", line 191, in as_domain
return domain.ufl_domain()
File "/opt/firedrake/firedrake/src/ufl/ufl/form.py", line 112, in ufl_domain
self._analyze_domains()
File "/opt/firedrake/firedrake/src/ufl/ufl/action.py", line 127, in _analyze_domains
self._domains = join_domains(chain.from_iterable(e.ufl_domain() for e in self.ufl_operands))
File "/opt/firedrake/firedrake/src/ufl/ufl/domain.py", line 205, in join_domains
domains = set(domains) - set((None,))
TypeError: 'MeshGeometry' object is not iterable
Thanks!
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.