--- trunk/src/applications/hydrodynamics/HydroCmd.c 2006/02/22 20:35:16 891 +++ trunk/src/applications/hydrodynamics/HydroCmd.c 2006/02/23 23:16:43 892 @@ -35,13 +35,14 @@ cmdline_parser_print_help (void) printf("\n" "Usage: %s [OPTIONS]...\n", CMDLINE_PARSER_PACKAGE); printf("\n"); - printf(" -h, --help Print help and exit\n"); - printf(" -V, --version Print version and exit\n"); - printf(" -i, --input=filename input dump file\n"); - printf(" -o, --output=STRING output file prefix (default=`hydro')\n"); - printf(" --viscosity=DOUBLE viscosity of solvent\n"); - printf(" --sigma=DOUBLE diameter of beads(use with rough shell model)\n"); - printf(" --model=STRING hydrodynamics model (support RoughShell and \n BeadModel)\n"); + printf(" -h, --help Print help and exit\n"); + printf(" -V, --version Print version and exit\n"); + printf(" -i, --input=filename input dump file\n"); + printf(" -o, --output=STRING output file prefix (default=`hydro')\n"); + printf(" --viscosity=DOUBLE viscosity of solvent\n"); + printf(" --temperature=DOUBLE temperature of the system\n"); + printf(" --sigma=DOUBLE diameter of beads(use with rough shell model)\n"); + printf(" --model=STRING hydrodynamics model (support RoughShell and \n BeadModel)\n"); } @@ -70,6 +71,7 @@ cmdline_parser (int argc, char * const *argv, struct g args_info->input_given = 0 ; args_info->output_given = 0 ; args_info->viscosity_given = 0 ; + args_info->temperature_given = 0 ; args_info->sigma_given = 0 ; args_info->model_given = 0 ; #define clear_args() { \ @@ -96,6 +98,7 @@ cmdline_parser (int argc, char * const *argv, struct g { "input", 1, NULL, 'i' }, { "output", 1, NULL, 'o' }, { "viscosity", 1, NULL, 0 }, + { "temperature", 1, NULL, 0 }, { "sigma", 1, NULL, 0 }, { "model", 1, NULL, 0 }, { NULL, 0, NULL, 0 } @@ -158,6 +161,20 @@ cmdline_parser (int argc, char * const *argv, struct g break; } + /* temperature of the system. */ + else if (strcmp (long_options[option_index].name, "temperature") == 0) + { + if (args_info->temperature_given) + { + fprintf (stderr, "%s: `--temperature' option given more than once\n", CMDLINE_PARSER_PACKAGE); + clear_args (); + exit (EXIT_FAILURE); + } + args_info->temperature_given = 1; + args_info->temperature_arg = strtod (optarg, NULL); + break; + } + /* diameter of beads(use with rough shell model). */ else if (strcmp (long_options[option_index].name, "sigma") == 0) { @@ -208,6 +225,11 @@ cmdline_parser (int argc, char * const *argv, struct g fprintf (stderr, "%s: '--viscosity' option required\n", CMDLINE_PARSER_PACKAGE); missing_required_options = 1; } + if (! args_info->temperature_given) + { + fprintf (stderr, "%s: '--temperature' option required\n", CMDLINE_PARSER_PACKAGE); + missing_required_options = 1; + } if (! args_info->model_given) { fprintf (stderr, "%s: '--model' option required\n", CMDLINE_PARSER_PACKAGE);