Open JHopeCollins opened 10 months ago
@nbouziani @pbrubeck any idea why this is breaking?
The backtrace makes it look like the issue is with ufl.split
. Perhaps a more minimal example could be constructed?
It also looks like _ufl_class_
is only used in undefined
. So this issue is really two issues:
split
doesn't know what to do with Cofunction
Cofunction
doesn't define _ufl_class_
so the error results in a less-than-informative error message.The split
call is the method of firedrake.ExtractSubBlock
, rather than ufl.split
, which splits a form rather than a Function
.
ufl.split(Cofunction)
also doesn't work (TypeError: 'Cofunction' object is not subscriptable
) but I don't think that's the error here.
Seems the error is coming from somewhere in the ufl.map_expr_dags
code but I'm having trouble untangling what is actually getting called there.
I don't understand what is happening inside split
in solving_utils.py
so I'm not sure how to proceed.
The _ufl_class_
error can be avoided by adding the line
class ExtractSubBlock(MultiFunction):
...
cofunction = expr # == MultiFunction.reuse_if_untouched
but this just leads to a shape error further on so it might be wrong.
This bug is affecting the recently merged PR #3723 (Variational adjoint solver) for problems involving a mixed function space.
I was looking at this again the other day, I'll have a shot at trying to fix it probably next week.
Describe the bug
Using a fieldsplit preconditioner with a
Cofunction
as the right hand side of aLinearVariationalProblem
crashes becauseCofunction
doesn't have a_ufl_class_
attribute.Steps to Reproduce
Expected behavior I would expect that this would solve the problem without error in one iteration.
Error message
Environment:
firedrake-status
: