Skip to content

Conversation

@ktbolt
Copy link
Collaborator

@ktbolt ktbolt commented Oct 15, 2025

Ill-posed boundary conditions can cause a divide by zero fault #423.

I've added a check for this that throws an exception if a zero norm is computed.

@ktbolt ktbolt requested a review from dcodoni October 15, 2025 18:14
Copy link
Contributor

@dcodoni dcodoni left a comment

Choose a reason for hiding this comment

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

@ktbolt I have some doubts about this problem.

I am skeptical about the fact that changing boundary conditions we get exactly zero as a result from some function in gmres. It makes me think that some variables enter the function zero-initialized. Also in the commit bf76a32, I commented a portion that would have prevented this problem.

Did you try to set the same incorrect BCs to any other case in fluid dynamics and replicate this problem? Also does this problem relates to gmres or bipn?

@codecov
Copy link

codecov bot commented Oct 15, 2025

Codecov Report

❌ Patch coverage is 50.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.44%. Comparing base (00f8a41) to head (d45e83a).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
Code/Source/liner_solver/gmres.cpp 50.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #453      +/-   ##
==========================================
- Coverage   67.45%   67.44%   -0.01%     
==========================================
  Files         170      170              
  Lines       34173    34179       +6     
  Branches     5736     5739       +3     
==========================================
+ Hits        23050    23053       +3     
- Misses      10985    10988       +3     
  Partials      138      138              

☔ 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.

@ktbolt
Copy link
Collaborator Author

ktbolt commented Oct 15, 2025

@dcodoni I am not as familiar as you are with what is going on in gmres.

But as stated in the Issue setting an inlet boundary condition for svMultiPhysics/tests/cases/fluid/pipe_RCR_3d like so

<Type>Neumann</Type>
<Time_dependence>Resistance</Time_dependence>
<Value>0</Value>

causes the R array passed to gmres to be all zeros which causes a divide by zero in the first iteration.

@ktbolt ktbolt merged commit 75edf0a into SimVascular:main Oct 23, 2025
8 checks passed
kko27 pushed a commit to kko27/svMultiPhysics that referenced this pull request Dec 17, 2025
* Change file name.

* Add check for gmres zero norm.
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.

2 participants