cngf-pf

continuum model for granular flows with pore-pressure dynamics (renamed from 1d_fd_simple_shear)
git clone git://src.adamsgaard.dk/cngf-pf # fast
git clone https://src.adamsgaard.dk/cngf-pf.git # slow
Log | Files | Refs | README | LICENSE Back to index

commit 4d6712d0347bf1a4f6566dce2f0d58f854852ab8
parent 491b69c62c0aa413975e5bd57df9289054d80d62
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Sat,  7 Feb 2026 07:48:58 +0100

fix(cli): parse -X tolerance as positive float

Diffstat:
Mcngf-pf.c | 8+++++++-
Mtest/Makefile | 25++++++++++++-------------
2 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/cngf-pf.c b/cngf-pf.c @@ -222,7 +222,13 @@ main(int argc, char *argv[]) sim.phi_min = atof(EARGF(usage())); break; case 'X': - rtol = atoi(EARGF(usage())); + rtol = atof(EARGF(usage())); + if (rtol <= 0.0) { + fprintf(stderr, + "error: invalid -X relative tolerance '%g' (must be > 0)\n", + rtol); + return 1; + } break; case 'x': max_iter = atoi(EARGF(usage())); diff --git a/test/Makefile b/test/Makefile @@ -3,18 +3,18 @@ BIN2 = ../max_depth_simple_shear BIN3 = ../shear_flux TESTS = cngf_pf_dry \ - cngf_pf_dry_norm \ - cngf_pf_dry_cohesive \ - cngf_pf_dry_vconst \ - cngf_pf_wet \ - cngf_pf_wet_norm \ - cngf_pf_wet_vari \ - cngf_pf_wet_vari_diff \ - cngf_pf_wet_vari_pulse \ - cngf_pf_wet_vari_pulse_vlim \ - cngf_pf_dry_transient \ - shear_flux_dry \ - shear_flux_wet + cngf_pf_dry_norm \ + cngf_pf_dry_cohesive \ + cngf_pf_dry_vconst \ + cngf_pf_wet \ + cngf_pf_wet_norm \ + cngf_pf_wet_vari \ + cngf_pf_wet_vari_diff \ + cngf_pf_wet_vari_pulse \ + cngf_pf_wet_vari_pulse_vlim \ + cngf_pf_dry_transient \ + shear_flux_dry \ + shear_flux_wet # Skipped tests: # - cngf_pf_dry_trans_undercons, cngf_pf_dry_trans_overcons: @@ -114,7 +114,6 @@ shear_flux_dry: $(BIN) $(BIN3) shear_flux_wet: $(BIN) ./$(BIN) $(CNGF_PF_WET_OPTS) | ./$(BIN3) | diff $@.std - - cngf_pf_dry.std: $(BIN) ./$(BIN) $(CNGF_PF_DRY_OPTS) > $@