Remove checked on the first gmres iteration (issue #365)#405
Merged
ktbolt merged 1 commit intoSimVascular:mainfrom Jun 11, 2025
Merged
Remove checked on the first gmres iteration (issue #365)#405ktbolt merged 1 commit intoSimVascular:mainfrom
ktbolt merged 1 commit intoSimVascular:mainfrom
Conversation
check on the absolute tolerance for the first gmres iteration is removed. At least one linear iteration is allowed to be completed.
ktbolt
approved these changes
Jun 11, 2025
divyaadil23
pushed a commit
to divyaadil23/svFSIplus
that referenced
this pull request
Jun 11, 2025
check on the absolute tolerance for the first gmres iteration is removed. At least one linear iteration is allowed to be completed.
ktbolt
added a commit
that referenced
this pull request
Jun 13, 2025
* Moving changes from my CANN branch to this updated branch with eigen etc - modified a few files * Fix bug with coupled BCs in FSI simulation (#333) * add fsi/pipe_RCR_3d. With multiprocs, fails at end of timestep 13 with [set_bc_cpl] Follow pressure load ... error * In set_bc_cpl, use eq.phys instead of eq.dmn[cDmn].phys. For FSI sims, eq.phys = phys_FSI, while eq.dmn[:].phys = [phys_fluid, phys_struct]. Using eq.dmn[:].phys causes issues when cDmn suddenly changes due to likely undefined behavior related to MPI. * Add pipe_RCR_3d test to pytest suite, update test parameters and solution * v3 -> v4 (#335) * v3 -> v4 * actions/upload-artifact v4 -> v3, codecov/codecov-action v4 -> v5 * run coverage only on ubuntu22 * Added a check on the flux profile type name. If a match is not found, a runtime error is given. (#325) Co-authored-by: Dave Parker <dvdpax@gmail.com> Co-authored-by: Martin R. Pfaller <martin.pfaller@yale.edu> * Update precomputed dye ad readme (#331) * Update test LV Guccione active (#337) Reduce momentum and continuity stabilization coefficients, update reference solution, and add README.md and animations. * Check spatial dimension (#339) * Change file name. * Add setting the mesh element type from vtk cell type and a check for spatial dimension consistent with mesh element type. * Change to check using element dimension. * Add check for fiber mesh. * Add setting mesh element type for vtp files, reorganize checks. * Only test ubuntu-latest (#344) * only test ubuntu-latest * run ubuntu-latest on ubuntu-22.04 container * fix container name * Fixed spatial dimension bug in bw_fluid_3d and index error in set_bc_dir_wl (#342) Co-authored-by: Martin Pfaller <martin.pfaller@yale.edu> * Some more changes * still working on converting CANN func in mat_models to eigen * Copied everything except integrated tests from old branch to here. Still need to resolve some compilation errors * changes migrated from old branch and build is successful * Unit tests for S pass, but CC fail * All unit tests pass * v3 -> v4 (#335) * v3 -> v4 * actions/upload-artifact v4 -> v3, codecov/codecov-action v4 -> v5 * run coverage only on ubuntu22 * Only test ubuntu-latest (#344) * only test ubuntu-latest * run ubuntu-latest on ubuntu-22.04 container * fix container name * Cleaning up the code * Changing how the xml elements are structured for CANN. Made changes to parameters cpp and h - still need to update set_values function for CANNParameters. Need to modify set_material_props and ComMod. * v3 -> v4 (#335) * v3 -> v4 * actions/upload-artifact v4 -> v3, codecov/codecov-action v4 -> v5 * run coverage only on ubuntu22 * Only test ubuntu-latest (#344) * only test ubuntu-latest * run ubuntu-latest on ubuntu-22.04 container * fix container name * Fixed set_values. Modified set_material_props and ComMod, but now CANNTable uses CANNRow, so need to change uaniso_hyper functions to accomodate it * Made changes to uaniso_hyper function to accomodate CANNRow type. Need to make similar changes to test.h and cpp * Made changes to test.h and cpp. Code builds but unit tests fail. * Unit tests now pass. Need to remove all the debugging comments * The integrated tests are running but the xml file values are being appended to the 1 row CANN table. Not sure if it happens in set_material_props or ComMod. The value of psi is also wrong - goes to nan and other garbage values * The problem is in set_values in Parameters.cpp. It appends to the vectors instead of rewriting them. particularly, set_parameter_value function - write a new one for CANN perhaps in Parameters.h * changed the reference config for 2 invariants, was wrong before * Integrated test passes for CANN NH now * Cleaned up extra comments * Added unit tests for CANN HO. Fixed an issue with printing activation functions. * fiber directions are read correctly now but the S and CC values are still wrong * The only reason some unit tests are failing is that S_ref = sym(S). Figure out why this is * CC values are wrong, All S and convergence unit tests pass * All unit tests pass now! * Integration LV test cases added for HO with k=0. All tests pass. * Added licence lines to new code files * Fixed parameter value in block compression CANN test * Corrected parameters in struct LV HO test case * Cleaning up the code * Cleaning up the code * ran multiplle proc tests * Replaced the result file that tests check against to be the same as the result from 1 proc test for CANN integrated struct tests * Changed CANNTable to new class in ComMod and tests. Distributed new class among procs. Unit tests pass. Integrated tests with multiple procs fail because no output produced (check mpi on local machine) * Integration tests pass! Just need to clena up the code now * Cleaned up code. Still need to change names of UAnisoHyper just to be consistent with what this model is called * Added citation * Made changes suggested by Dave to ComMod.h and cpp (and the downstream files) * Made changes suggested to UAnisoHyper and consts - renamed all AnisoHyper for consistency * Made code more readable in mat_models.cpp * set_material_props - added for loop * Moved class definition from ComMod and put all external functions in class. Still need to move calc from compute_pk2cc to class for CANN * Moved the calculation to the class. It compiles but the anisotropic unit tests don't pass. * Fixed bug. All tests pass. Just need to clean up code * Cleaned up code * Move svzerodinterface file into solver xml (#396) * Change file name. * Add the svZeroDSolver_interface XML element to set the information used to interface to the svZeroDSolver. * Add checking for new and old formats. * Remove processing svZeroD_interface.dat file. * Change giving an integer surface ID in the Block_to_surface_map to a surface name. * Add the svZeroDSolver_block parameter under Add_BC. * Convert missed tests using svZeroDSolver. * Change parameter name to conform. * Stability convergence issue restarting simulation (#398) * Change file name. * Remove reading Dn array twice. * Fix yaml ignore md (#400) * Change file name. * Update test_macos.yml * Update test_ubuntu.yml * Updating yml files to run test actions only when files in Code and tests are modified. (#394) Co-authored-by: Aaron Brown <71424733+aabrown100-git@users.noreply.github.com> Co-authored-by: Dave Parker <dvdpax@gmail.com> * Remove checked on the first gmres iteration (#405) check on the absolute tolerance for the first gmres iteration is removed. At least one linear iteration is allowed to be completed. * Changed some names * Add check to make sure paramTable is initialized before distributing * If CANN is not used (paramTable is empty) don't broadcast it * Put it inside the if condition instead of having a return * added if statement for material model becasue nrows is also not defined for other materials --------- Co-authored-by: Aaron Brown <71424733+aabrown100-git@users.noreply.github.com> Co-authored-by: Martin R. Pfaller <martin.pfaller@yale.edu> Co-authored-by: dcodoni <160075903+dcodoni@users.noreply.github.com> Co-authored-by: Dave Parker <dvdpax@gmail.com> Co-authored-by: Han Zhao <60522366+hanzhao2020@users.noreply.github.com>
1 task
divyaadil23
added a commit
to divyaadil23/svFSIplus
that referenced
this pull request
Jun 24, 2025
* Moving changes from my CANN branch to this updated branch with eigen etc - modified a few files * Fix bug with coupled BCs in FSI simulation (SimVascular#333) * add fsi/pipe_RCR_3d. With multiprocs, fails at end of timestep 13 with [set_bc_cpl] Follow pressure load ... error * In set_bc_cpl, use eq.phys instead of eq.dmn[cDmn].phys. For FSI sims, eq.phys = phys_FSI, while eq.dmn[:].phys = [phys_fluid, phys_struct]. Using eq.dmn[:].phys causes issues when cDmn suddenly changes due to likely undefined behavior related to MPI. * Add pipe_RCR_3d test to pytest suite, update test parameters and solution * v3 -> v4 (SimVascular#335) * v3 -> v4 * actions/upload-artifact v4 -> v3, codecov/codecov-action v4 -> v5 * run coverage only on ubuntu22 * Added a check on the flux profile type name. If a match is not found, a runtime error is given. (SimVascular#325) Co-authored-by: Dave Parker <dvdpax@gmail.com> Co-authored-by: Martin R. Pfaller <martin.pfaller@yale.edu> * Update precomputed dye ad readme (SimVascular#331) * Update test LV Guccione active (SimVascular#337) Reduce momentum and continuity stabilization coefficients, update reference solution, and add README.md and animations. * Check spatial dimension (SimVascular#339) * Change file name. * Add setting the mesh element type from vtk cell type and a check for spatial dimension consistent with mesh element type. * Change to check using element dimension. * Add check for fiber mesh. * Add setting mesh element type for vtp files, reorganize checks. * Only test ubuntu-latest (SimVascular#344) * only test ubuntu-latest * run ubuntu-latest on ubuntu-22.04 container * fix container name * Fixed spatial dimension bug in bw_fluid_3d and index error in set_bc_dir_wl (SimVascular#342) Co-authored-by: Martin Pfaller <martin.pfaller@yale.edu> * Some more changes * still working on converting CANN func in mat_models to eigen * Copied everything except integrated tests from old branch to here. Still need to resolve some compilation errors * changes migrated from old branch and build is successful * Unit tests for S pass, but CC fail * All unit tests pass * v3 -> v4 (SimVascular#335) * v3 -> v4 * actions/upload-artifact v4 -> v3, codecov/codecov-action v4 -> v5 * run coverage only on ubuntu22 * Only test ubuntu-latest (SimVascular#344) * only test ubuntu-latest * run ubuntu-latest on ubuntu-22.04 container * fix container name * Cleaning up the code * Changing how the xml elements are structured for CANN. Made changes to parameters cpp and h - still need to update set_values function for CANNParameters. Need to modify set_material_props and ComMod. * v3 -> v4 (SimVascular#335) * v3 -> v4 * actions/upload-artifact v4 -> v3, codecov/codecov-action v4 -> v5 * run coverage only on ubuntu22 * Only test ubuntu-latest (SimVascular#344) * only test ubuntu-latest * run ubuntu-latest on ubuntu-22.04 container * fix container name * Fixed set_values. Modified set_material_props and ComMod, but now CANNTable uses CANNRow, so need to change uaniso_hyper functions to accomodate it * Made changes to uaniso_hyper function to accomodate CANNRow type. Need to make similar changes to test.h and cpp * Made changes to test.h and cpp. Code builds but unit tests fail. * Unit tests now pass. Need to remove all the debugging comments * The integrated tests are running but the xml file values are being appended to the 1 row CANN table. Not sure if it happens in set_material_props or ComMod. The value of psi is also wrong - goes to nan and other garbage values * The problem is in set_values in Parameters.cpp. It appends to the vectors instead of rewriting them. particularly, set_parameter_value function - write a new one for CANN perhaps in Parameters.h * changed the reference config for 2 invariants, was wrong before * Integrated test passes for CANN NH now * Cleaned up extra comments * Added unit tests for CANN HO. Fixed an issue with printing activation functions. * fiber directions are read correctly now but the S and CC values are still wrong * The only reason some unit tests are failing is that S_ref = sym(S). Figure out why this is * CC values are wrong, All S and convergence unit tests pass * All unit tests pass now! * Integration LV test cases added for HO with k=0. All tests pass. * Added licence lines to new code files * Fixed parameter value in block compression CANN test * Corrected parameters in struct LV HO test case * Cleaning up the code * Cleaning up the code * ran multiplle proc tests * Replaced the result file that tests check against to be the same as the result from 1 proc test for CANN integrated struct tests * Changed CANNTable to new class in ComMod and tests. Distributed new class among procs. Unit tests pass. Integrated tests with multiple procs fail because no output produced (check mpi on local machine) * Integration tests pass! Just need to clena up the code now * Cleaned up code. Still need to change names of UAnisoHyper just to be consistent with what this model is called * Added citation * Made changes suggested by Dave to ComMod.h and cpp (and the downstream files) * Made changes suggested to UAnisoHyper and consts - renamed all AnisoHyper for consistency * Made code more readable in mat_models.cpp * set_material_props - added for loop * Moved class definition from ComMod and put all external functions in class. Still need to move calc from compute_pk2cc to class for CANN * Moved the calculation to the class. It compiles but the anisotropic unit tests don't pass. * Fixed bug. All tests pass. Just need to clean up code * Cleaned up code * Move svzerodinterface file into solver xml (SimVascular#396) * Change file name. * Add the svZeroDSolver_interface XML element to set the information used to interface to the svZeroDSolver. * Add checking for new and old formats. * Remove processing svZeroD_interface.dat file. * Change giving an integer surface ID in the Block_to_surface_map to a surface name. * Add the svZeroDSolver_block parameter under Add_BC. * Convert missed tests using svZeroDSolver. * Change parameter name to conform. * Stability convergence issue restarting simulation (SimVascular#398) * Change file name. * Remove reading Dn array twice. * Fix yaml ignore md (SimVascular#400) * Change file name. * Update test_macos.yml * Update test_ubuntu.yml * Updating yml files to run test actions only when files in Code and tests are modified. (SimVascular#394) Co-authored-by: Aaron Brown <71424733+aabrown100-git@users.noreply.github.com> Co-authored-by: Dave Parker <dvdpax@gmail.com> * Remove checked on the first gmres iteration (SimVascular#405) check on the absolute tolerance for the first gmres iteration is removed. At least one linear iteration is allowed to be completed. * Changed some names * Add check to make sure paramTable is initialized before distributing * If CANN is not used (paramTable is empty) don't broadcast it * Put it inside the if condition instead of having a return * added if statement for material model becasue nrows is also not defined for other materials --------- Co-authored-by: Aaron Brown <71424733+aabrown100-git@users.noreply.github.com> Co-authored-by: Martin R. Pfaller <martin.pfaller@yale.edu> Co-authored-by: dcodoni <160075903+dcodoni@users.noreply.github.com> Co-authored-by: Dave Parker <dvdpax@gmail.com> Co-authored-by: Han Zhao <60522366+hanzhao2020@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #365
The check on the absolute tolerance for the first gmres iteration is removed. At least one linear iteration is allowed to be completed.
Current situation
When the non-linear residual meet the absolute tolerance criteria of the linear solver, the fsils implementation of the gmres, returns without completing the first linear iteration. This causes a zero-solution which in the BIPN method, triggers a singular matrix error.
Release Notes
The check on the first iteration of the gmres is removed and one linear iteration is always allowed, avoiding a zero-solution.
Code of Conduct & Contributing Guidelines