tPass pulse shape value as string - cngf-pf - continuum model for granular flow… | |
git clone git://src.adamsgaard.dk/cngf-pf | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 934c2a555efeceff702659449db4c68ed2bf9b23 | |
parent f2663e1123ac994ca9f60a747addf5559786f887 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Wed, 18 Sep 2019 16:54:01 +0200 | |
Pass pulse shape value as string | |
Diffstat: | |
M main.c | 13 +++++++++++-- | |
1 file changed, 11 insertions(+), 2 deletions(-) | |
--- | |
diff --git a/main.c b/main.c | |
t@@ -69,7 +69,7 @@ usage(void) | |
" -u, --fluid-pressure-pulse-time VAL fluid pressure pulse pea… | |
" (default %g)\n" | |
" -S, --fluid-pressure-pulse-shape VAL\n" | |
- " 0: triangular (default), 1: … | |
+ " where VAL is triangular (def… | |
" -t, --time VAL simulation start time [s] (d… | |
" -T, --time-end VAL simulation end time [s] (def… | |
" -I, --file-interval VAL interval between output file… | |
t@@ -283,7 +283,16 @@ main(int argc, char* argv[]) | |
sim.p_f_mod_pulse_time = atof(optarg); | |
break; | |
case 'S': | |
- sim.p_f_mod_pulse_shape = atoi(optarg); | |
+ if (strcmp(optarg, "triangle") == 0) | |
+ sim.p_f_mod_pulse_shape = 0; | |
+ else if (strcmp(optarg, "square") == 0) | |
+ sim.p_f_mod_pulse_shape = 1; | |
+ else { | |
+ fprintf(stderr, "error: invalid pulse … | |
+ optarg); | |
+ return 1; | |
+ } | |
+ printf("pulse shape: %d\n", sim.p_f_mod_pulse_… | |
break; | |
case 't': | |
sim.t = atof(optarg); |