Skip to content

Fixed RIS valve displacement interpolation issue with different mesh scale factors#541

Merged
hanzhao2020 merged 5 commits into
SimVascular:mainfrom
hanzhao2020:fix/uris_disp_interp
May 13, 2026
Merged

Fixed RIS valve displacement interpolation issue with different mesh scale factors#541
hanzhao2020 merged 5 commits into
SimVascular:mainfrom
hanzhao2020:fix/uris_disp_interp

Conversation

@hanzhao2020
Copy link
Copy Markdown
Contributor

Resolves #461

Release Notes

  • Replaced hard-coded tolerances with scale-aware tolerances when locating fluid elements for valve surface nodes, so displacement interpolation is stable with different mesh scale factors in the uris_update_disp function.
  • Improved parallel implementation when interpolating displacements from fluid elements to valve surfaces. Each immersed surface node gets one owner rank (via MPI_MIN); only that rank contributes interpolated displacement.
  • Comments and declarations were cleaned up

Code of Conduct & Contributing Guidelines

@hanzhao2020 hanzhao2020 changed the title Fix/uris disp interp Fixed RIS valve displacement interpolation issue with different mesh scale factors May 7, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

❌ Patch coverage is 83.33333% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.15%. Comparing base (50a1a4a) to head (a6d3b99).

Files with missing lines Patch % Lines
Code/Source/solver/uris.cpp 83.33% 17 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #541   +/-   ##
=======================================
  Coverage   68.15%   68.15%           
=======================================
  Files         174      174           
  Lines       34160    34187   +27     
  Branches     5932     5935    +3     
=======================================
+ Hits        23281    23301   +20     
- Misses      10742    10749    +7     
  Partials      137      137           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses incorrect URIS_displacement output for URIS/RIS valves when simulations use different mesh scale factors and run in parallel, by improving how immersed surface nodes are localized into fluid elements and how displacement is interpolated and reduced across MPI ranks.

Changes:

  • Reworked uris_update_disp() to avoid multi-rank double-counting by electing a single owning rank per immersed node and only letting that rank contribute to the MPI reduction.
  • Made element-containment checks more scale-aware (bounding-box tolerance + boundary handling) to stabilize localization across mesh scales.
  • Cleaned up URIS helper APIs (return types/const-correctness) and related comments/struct members.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
Code/Source/solver/uris.h Updates URIS helper function signatures (bool returns, const refs) and removes stale inline notes.
Code/Source/solver/uris.cpp Implements owner-rank election for URIS displacement interpolation, adjusts localization tolerances, and updates geometry containment utilities.
Code/Source/solver/ComMod.h Updates urisType fields/comments to support the new ownership flag (localNode) and cleans up URIS documentation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Code/Source/solver/uris.cpp Outdated
Comment thread Code/Source/solver/uris.cpp
Comment thread Code/Source/solver/uris.cpp Outdated
Comment thread Code/Source/solver/ComMod.h Outdated
Comment thread Code/Source/solver/uris.cpp Outdated
Comment thread Code/Source/solver/uris.cpp Outdated
Comment thread Code/Source/solver/uris.cpp
Comment thread Code/Source/solver/uris.cpp
@hanzhao2020 hanzhao2020 force-pushed the fix/uris_disp_interp branch from 3aa5da9 to 6605c7e Compare May 7, 2026 20:57
@aabrown100-git
Copy link
Copy Markdown
Collaborator

@codex review for the owner-rank tie-breaker in uris_update_disp, especially the equal local_metric case from the Copilot thread.

Copy link
Copy Markdown
Collaborator

@aabrown100-git aabrown100-git left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now!

Copy link
Copy Markdown
Contributor

@zinanhu0810 zinanhu0810 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes look good to me.

@aabrown100-git
Copy link
Copy Markdown
Collaborator

Shall we merge?

@hanzhao2020
Copy link
Copy Markdown
Contributor Author

@aabrown100-git Yes, I think it's ready to merge. Thanks!

@hanzhao2020 hanzhao2020 merged commit 69086cb into SimVascular:main May 13, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

URIS_displacement appears incorrect

4 participants