| 35 |
|
printf("\n" |
| 36 |
|
"Usage: %s [OPTIONS]...\n", CMDLINE_PARSER_PACKAGE); |
| 37 |
|
printf("\n"); |
| 38 |
< |
printf(" -h, --help Print help and exit\n"); |
| 39 |
< |
printf(" -V, --version Print version and exit\n"); |
| 40 |
< |
printf(" -i, --input=filename input dump file\n"); |
| 41 |
< |
printf(" -o, --output=STRING output file prefix (default=`hydro')\n"); |
| 42 |
< |
printf(" --viscosity=DOUBLE viscosity of solvent\n"); |
| 43 |
< |
printf(" --sigma=DOUBLE diameter of beads(use with rough shell model)\n"); |
| 44 |
< |
printf(" --model=STRING hydrodynamics model (support RoughShell and \n BeadModel)\n"); |
| 38 |
> |
printf(" -h, --help Print help and exit\n"); |
| 39 |
> |
printf(" -V, --version Print version and exit\n"); |
| 40 |
> |
printf(" -i, --input=filename input dump file\n"); |
| 41 |
> |
printf(" -o, --output=STRING output file prefix (default=`hydro')\n"); |
| 42 |
> |
printf(" --viscosity=DOUBLE viscosity of solvent\n"); |
| 43 |
> |
printf(" --temperature=DOUBLE temperature of the system\n"); |
| 44 |
> |
printf(" --sigma=DOUBLE diameter of beads(use with rough shell model)\n"); |
| 45 |
> |
printf(" --model=STRING hydrodynamics model (support RoughShell and \n BeadModel)\n"); |
| 46 |
|
} |
| 47 |
|
|
| 48 |
|
|
| 71 |
|
args_info->input_given = 0 ; |
| 72 |
|
args_info->output_given = 0 ; |
| 73 |
|
args_info->viscosity_given = 0 ; |
| 74 |
+ |
args_info->temperature_given = 0 ; |
| 75 |
|
args_info->sigma_given = 0 ; |
| 76 |
|
args_info->model_given = 0 ; |
| 77 |
|
#define clear_args() { \ |
| 98 |
|
{ "input", 1, NULL, 'i' }, |
| 99 |
|
{ "output", 1, NULL, 'o' }, |
| 100 |
|
{ "viscosity", 1, NULL, 0 }, |
| 101 |
+ |
{ "temperature", 1, NULL, 0 }, |
| 102 |
|
{ "sigma", 1, NULL, 0 }, |
| 103 |
|
{ "model", 1, NULL, 0 }, |
| 104 |
|
{ NULL, 0, NULL, 0 } |
| 161 |
|
break; |
| 162 |
|
} |
| 163 |
|
|
| 164 |
+ |
/* temperature of the system. */ |
| 165 |
+ |
else if (strcmp (long_options[option_index].name, "temperature") == 0) |
| 166 |
+ |
{ |
| 167 |
+ |
if (args_info->temperature_given) |
| 168 |
+ |
{ |
| 169 |
+ |
fprintf (stderr, "%s: `--temperature' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
| 170 |
+ |
clear_args (); |
| 171 |
+ |
exit (EXIT_FAILURE); |
| 172 |
+ |
} |
| 173 |
+ |
args_info->temperature_given = 1; |
| 174 |
+ |
args_info->temperature_arg = strtod (optarg, NULL); |
| 175 |
+ |
break; |
| 176 |
+ |
} |
| 177 |
+ |
|
| 178 |
|
/* diameter of beads(use with rough shell model). */ |
| 179 |
|
else if (strcmp (long_options[option_index].name, "sigma") == 0) |
| 180 |
|
{ |
| 225 |
|
fprintf (stderr, "%s: '--viscosity' option required\n", CMDLINE_PARSER_PACKAGE); |
| 226 |
|
missing_required_options = 1; |
| 227 |
|
} |
| 228 |
+ |
if (! args_info->temperature_given) |
| 229 |
+ |
{ |
| 230 |
+ |
fprintf (stderr, "%s: '--temperature' option required\n", CMDLINE_PARSER_PACKAGE); |
| 231 |
+ |
missing_required_options = 1; |
| 232 |
+ |
} |
| 233 |
|
if (! args_info->model_given) |
| 234 |
|
{ |
| 235 |
|
fprintf (stderr, "%s: '--model' option required\n", CMDLINE_PARSER_PACKAGE); |