No option to pass the tensor when assembling a zero form #2938
Unanswered
miguelcoolchips
asked this question in
Firedrake support
Replies: 1 comment 19 replies
-
There's no strong reason not to allow the tensor to be passed to zero forms. I'm a bit mystified by this though, the variables in question should be cleaned up by Python once they go out of scope. |
Beta Was this translation helpful? Give feedback.
19 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What is the reason for not accepting the keyword
tensor
when assembling zero-arity forms? The following example (arguably a bit contrived) shows how the memory grows when we do not pass thetensor
keyword and how we can alleviate the issue by passing it.This code results in the following memory plots
The effect is not as noticeable as the problem size grows, but it is still there (of course, 100,000 iterations are a lot of iterations). I modified firedrake to let it accept tensor as keyword. In general, for reusing the assembly routine many times, is it better to build my own assembler (
ZeroFormAssembler
)? The thing is that firedrake-adjoint builds a new form for every evaluation of the tape. I would prefer not having to cache the form because I would have to update its coefficients whenever I run the tape.My firedrake-status is (a bit outdated, but I see there's still no support for tensor in zero-form assembly)
Beta Was this translation helpful? Give feedback.
All reactions