tAdd time parameters to cmd line opts and fix help text - cngf-pf - continuum m… | |
git clone git://src.adamsgaard.dk/cngf-pf | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 949508fb9e7495371105b2b53629722c92d508f4 | |
parent ebe53df39f23493052516d89a237feb50c065f0b | |
Author: Anders Damsgaard <[email protected]> | |
Date: Mon, 15 Apr 2019 16:25:13 +0200 | |
Add time parameters to cmd line opts and fix help text | |
Diffstat: | |
M main.c | 29 ++++++++++++++++++++++++----- | |
1 file changed, 24 insertions(+), 5 deletions(-) | |
--- | |
diff --git a/main.c b/main.c | |
t@@ -29,9 +29,13 @@ static void usage(void) | |
" -o, --origo VAL coordinate system origo [m]\n" | |
" -L, --length VAL domain length [m]\n" | |
" -F, --fluid enable pore fluid computations\n" | |
- " -c, --fluid-compressibility VAL enable pore fluid computations\n" | |
- " -i, --fluid-viscosity VAL enable pore fluid computations\n" | |
- " -R, --fluid-density VAL enable pore fluid computations\n" | |
+ " -c, --fluid-compressibility VAL fluid compressibility [Pa^-1]\n" | |
+ " -i, --fluid-viscosity VAL fluid viscosity [Pa*s]\n" | |
+ " -R, --fluid-density VAL fluid density [kg/m^3]\n" | |
+ " -t, --time VAL simulation start time [s]\n" | |
+ " -T, --time-end VAL simulation end time [s]\n" | |
+ " -D, --time-step VAL computational time step length [… | |
+ " -I, --file-time VAL interval between output files [s… | |
" -v, --version show version information\n" | |
" -h, --help show this message\n" | |
, __func__, PROGNAME); | |
t@@ -55,7 +59,7 @@ int main(int argc, char* argv[]) | |
int normalize = 0; | |
int opt; | |
- const char* optstring = "hvNn:G:P:m:V:A:b:f:Fp:d:r:o:L:c:i:R:k:"; | |
+ const char* optstring = "hvNn:G:P:m:V:A:b:f:Fp:d:r:o:L:c:i:R:k:t:T:D:I:"; | |
const struct option longopts[] = { | |
{"help", no_argument, NULL, 'h'}, | |
{"version", no_argument, NULL, 'v'}, | |
t@@ -77,6 +81,10 @@ int main(int argc, char* argv[]) | |
{"fluid-viscosity", required_argument, NULL, 'i'}, | |
{"fluid-density", required_argument, NULL, 'R'}, | |
{"fluid-permeability", required_argument, NULL, 'R'}, | |
+ {"time", required_argument, NULL, 't'}, | |
+ {"time-end", required_argument, NULL, 'T'}, | |
+ {"time-step", required_argument, NULL, 'D'}, | |
+ {"file-time", required_argument, NULL, 'I'}, | |
{NULL, 0, NULL, 0} | |
}; | |
t@@ -151,6 +159,18 @@ int main(int argc, char* argv[]) | |
case 'k': | |
new_k = atof(optarg); | |
break; | |
+ case 't': | |
+ sim.t = atof(optarg); | |
+ break; | |
+ case 'T': | |
+ sim.t_end = atof(optarg); | |
+ break; | |
+ case 'D': | |
+ sim.t_end = atof(optarg); | |
+ break; | |
+ case 'I': | |
+ sim.file_dt = atof(optarg); | |
+ break; | |
default: | |
fprintf(stderr, "%s: invalid option -- %c\n", argv[0], opt); | |
t@@ -213,7 +233,6 @@ int main(int argc, char* argv[]) | |
write_output_file(&sim); | |
filetimeclock = 0.0; | |
} | |
- | |
} | |
free_arrays(&sim); |