Refactor of autodiff for MultiField #1070
Draft
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.
The current implementation of autodiff for MultiField spaces is a mess... It relies on a lot of specific code, and has severe performance issues. I believe that with some though we could use the same code as for SingleField.
This is motivated by the fact that I do not want to replicate the current implementation for GridapDistributed. I believe it will also solve many issues we currently have for autodiff+multifield.
To-Dos
To-Think
Skeletons are wrong when the number of dofs is different in the left and right cells. The issue is that we are dualizing both left and right cells at once, but witout knowing which cells those are (we just assume they are the same). I think I'll have to go back to what Kishore was doing, i.e doing left then right. Hopefully without any densifying maps.
The other solution would be to directly port the cell values to the destination triangulation, and evaluate the bilinear forms with cellfields that are already there. The issue is that this will likely break the change_domain apis in an unpredictable way.