Fix velocity average solution transfer adapt grid #1436
Merged
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.
Description
Simulation with dynamic mesh adaptation and time-averaging of the velocity field carried out using the lethe-fluid-matrix-free solver would crash with a thrown error. This was caused by the fact that solution transfer with deal.II vector requires ghosted vectors whereas solution transfer with Trilinos vectors requires locally_owned vectors.
This PR aims at solving this which also pointed out in issue #1434 . It will close this issue.
Furthermore, simulation with dynamic mesh adaptation and the matrix-free solver could sometimes crash during the mesh adaptation stage due to the SolutionTransfer. This has been fixed by enabling averaging of the SolutionTransfer to reconcile incoherence between multiple cells by having the average flag set to true. For most simulation this does not have an impact, but for some it will (esp. when grid is distorted). Thanks to @peterrum for pointing this out ot me.
Solution
This has been fixed by adding a const expression to adapt the behaviour depending on the vector type
Testing
Test has been added.
It breaks on master and works on this branch.
Documentation
Nothing to document here.
Miscellaneous (will be removed when merged)
Checklist (will be removed when merged)
See this page for more information about the pull request process.
Code related list:
Pull request related list: