Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @jwallwork23, I have been trying again to get this to work for vector fields and I think I got it. I hope I won't sound rude when I ask this: could I please ask you if you could take a look into this, instead of prioritising mesh-adaptation/goalie#188 as you said you would? Lumping really did make a significant difference in my case, whereas the adjoint action issue is (I assume, but could very easily be wrong) not so significant. So I'd really like to get this sorted out :) and I hope this will be pretty straightforward.
I basically just put what you did here inside a
for
loop, but I had to createFunctionSpace
s for individual components in a messy way, since just doingsource.sub(i).function_space()
didn't work. Anyway, the ping pong demo results (i.e. scalar fields) are identical, and I tested it on a vector field and it looks good.I also tried it out on the
burgers.py
demo, by passingtransfer_kwargs={"bounded": True}
toMeshSeq
and then got this (tolerance of 1e-7). In doing that, I also had to dopyadjoint.pause_annotation()
insidesolve_forward
before transferring the checkpoint to the next subinterval (and then I continued annotating after the transfer). Otherwise theassign
insource_sub = ffunc.Function(Vs_sub).assign(source.sub(i))
raises an error.