-
-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Actions and adjoints. #301
Comments
Something is not quite right in the logic of extracting domains when applied to nested BaseForms. @nbouziani ? |
I think the logic should be that we collect all the domains we find as we traverse the DAG, and then check that we only get one domain at the end of the traversal, which is what we currently do. What I don’t understand though is why @ah3557 note that the differentiation of |
I'm trying to solve a linear system of the form where S is a stiffness matrix, K is an interpolation matrix and w is a function. I thought I can solve the system without assembling A. |
I think I don't understand where the solve comes into this (or the derivative, for that matter). Can you show us mathematically what you are trying to do? |
You could avoid this issue by simply providing a dummy Jacobian, so |
Well if you build a LVP or call solve on a linear system you also don't get a derivative, but I don't actually see where the system is here. |
Apart from that, |
@dham: I'm trying to apply recovered finite element methods. Attached is the weak form I'm solving. the operator, epsilon, maps DG elements to Nedelec ones. |
OK, I think if you set up a |
There's also another bug in how we extract arguments of a complicated linear form
|
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.
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!
The text was updated successfully, but these errors were encountered: