-
Notifications
You must be signed in to change notification settings - Fork 36
Fix Solver Tests, addressing #156 #166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…h_reference function
…ove unused main execution block
…fference calculation
|
so if we update the test tolerance for flow results from 1e-8 to 1e-7, all tests pass. Currently the pressure tolerance is already set at 1e-7. Is this something we want to do @mrp089? you could check previous workflow runs to see that the flow result and reference are very close for closedLoopHeart_singleVessel.json, the only test that fails against a 1e-8 flow tolerance |
|
Can you tighten the solver tolerances? We're probably testing with the default value of |
…computation functionality
So I can't tighten the solver tolerance below 1e-9 without certain test cases hitting the maximum number of nonlinear iterations. When I use solver tolerance 1e-9, with test tolerance 1e-8, the tests still do not pass on ubuntu or macOS 13. see latest commit + workflow runs for details |
|
That's good to know, @ncdorn. That means we're testing as accurately as we can. @menon-karthik, do you have any idea why those tests are particularly trickier?
If this does not indicate some error, we'll loosen the tolerances. |
|
@menon-karthik just bumping this as it is currently a bottleneck to the other pull requests |
|
@ncdorn, can you also add a test readme, similar to https://github.com/SimVascular/svMultiPhysics/tree/main/tests |
…sting guide README
see latest commit! |
|
@menon-karthik, can you have a look at why those test cases are having problems on different machines:
|
|
@ncdorn, in the interest of getting this (and the other PRs) merged, can you go ahead and lower the tolerance to |
|
so the latest commit is passing on all operating systems except for windows. Looks like again, a very small difference between reference and computed solution for the closedLoopHeart_singleVessel.json case |
|
Thanks, @ncdorn! Looking at the results, it seems we would need to coarsen the test tolerance to I could crank up to To make our tests more robust, can you go through every test case and set This ensures that every result we test is computed as precisely as possible. It's a bit tedious, but this should save us from most future machine-dependent troubles (we also did that for |
|
unexpectedly, this leads to failure on the other operating systems. super confusing. Will keep looking into it. |
…edLoopHeartPulmonary parameters.
|
ok so what I've done is adjust the input time arrays in the external_solver_coupling_blocks such that there should be no interpolation needed, which could lead to discrepancies in operating systems. This got |
|
so I converted the input flow in the external solver coupling blocks to steady flow, and still the tests do not pass, implying that it is not an issue with the interpolation, but maybe somewhere in the numerics, or in the compilation of the 3d-0d interface. |
…olver into fix-solver-tests
|
Hi @ncdorn sorry I was AWOL on this! I just looked through and caught myself up with what's happening here. The closed loop block is numerically stiff because it has a lot of different components acting together. In particular, I think the valves make it sensitive (uninitialized variables can be slightly different on different operating systems). I believe the So if the code coverage is the same with and without the |
|
Alright so I had to reduce the test tolerance to 1e-1 only for |
|
@mrp089 what do you think of this? Any other changes we need to make? |
|
just bumping this in case anyone is able to take a look so we can merge this in soon and move on to the other issues @mrp089 @menon-karthik |
|
Sorry, @ncdorn. I thought I had submitted those comments |
|
no worries, thanks for checking! changes addressed. |
Current situation
Currently the tests for svZeroDSolver do not actually test the relative difference between the reference solution and the test result, as outlined in #156 . This was due to a syntax error, specifically improper use of np.all() in the solver tolerance check. This PR updates the testing protocol to ensure that every value of the reference solution is being compared to the test result, ensuring that the relative difference between the two values is below the desired tolerance
Release Notes
Documentation
no Documentation to add
Testing
Test tolerances were increased from 1e-8 to 1e-7. For
coupledBlock_closedLoopHeart_withCoronaries.jsonthe test tolerance was increased to 1e-1 due to increased numerical stiffness and differences in the result between operating systems. After these changes, all tests are passing.Code of Conduct & Contributing Guidelines