SimVascular / SimVascular/svZeroDSolver
Catch solver exceptions
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 22
- Forks
- 44
- PR merge metrics
- No merged PRs in 30d
Description
Problem
Providing an input file that results in a singular system matrix (e.g., through missing connections) will throw an error like
Assertion failed: (m_factorizationIsOk && "The matrix should be factorized first"), function _solve_impl, file SparseLU.h, line 340.
This is thrown in this line:
https://github.com/SimVascular/svZeroDSolver/blob/32b46d7ba376c8384842902aadc45aeb6d875bbd/src/algebra/SparseSystem.cpp#L104
This is a very generic error by Eigen/SuperLU and doesn't help the user find what is wrong with the input file.
Solution
Throw a helpful error message and tell the user what is wrong with the input file.
Additional context
We've had this problem before, e.g., #94
Code of Conduct
- I agree to follow this project's Code of Conduct and Contributing Guidelines
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at src/algebra/SparseSystem.cpp line 104 and review the solver path that triggers Eigen/SuperLU's singular-matrix assertion. Reproduce the failure with an input containing missing connections, and consult issue #94 for related context. Done means the solver reports a helpful error that identifies the input problem instead of exposing the generic assertion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100