Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix velocity average solution transfer adapt grid #1436

Merged
merged 3 commits into from
Mar 3, 2025

Conversation

blaisb
Copy link
Contributor

@blaisb blaisb commented Feb 28, 2025

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:

  • All in-code documentation related to this PR is up to date (Doxygen format)
  • Copyright headers are present and up to date
  • Lethe documentation is up to date
  • Fix has unit test(s) (preferred) or application test(s), and restart files are in the generator folder
  • The branch is rebased onto master
  • Changelog (CHANGELOG.md) is up to date
  • Code is indented with indent-all and .prm files (examples and tests) with prm-indent

Pull request related list:

  • Labels are applied
  • There are at least 2 reviewers (or 1 if small feature) excluding the responsible for the merge
  • If this PR closes an issue or is related to a project, it is linked in the "Projects" or "Development" section
  • If the fix is temporary, an issue is opened
  • The PR description is cleaned and ready for merge

@blaisb blaisb requested a review from lpsaavedra February 28, 2025 13:40
@blaisb blaisb added the Bug Something isn't working label Feb 28, 2025
@blaisb blaisb force-pushed the velocity_average_vector_type-bug branch from 75345a5 to 6c5b6d5 Compare March 3, 2025 13:33
@blaisb blaisb merged commit c4844e3 into master Mar 3, 2025
11 checks passed
@blaisb blaisb deleted the velocity_average_vector_type-bug branch March 3, 2025 14:48
blaisb added a commit that referenced this pull request Mar 4, 2025
Description
PR #1436 fixed a bug related to the averaging velocity in the matrix-free solver. I had made a test for that but forgot to add it. This PR adds the missing test that was promised in that PR.
marineharel pushed a commit that referenced this pull request Mar 4, 2025
Description
PR #1436 fixed a bug related to the averaging velocity in the matrix-free solver. I had made a test for that but forgot to add it. This PR adds the missing test that was promised in that PR.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants