--- trunk/SHAPES/shaperCmd.c 2004/06/25 22:16:39 1311 +++ trunk/SHAPES/shaperCmd.c 2004/06/26 15:32:12 1312 @@ -39,6 +39,7 @@ void clear_given (struct gengetopt_args_info *args_inf args_info->version_given = 0 ; args_info->input_given = 0 ; args_info->bandwidth_given = 0 ; + args_info->tolerance_given = 0 ; args_info->charmm_given = 0 ; args_info->amber_given = 0 ; args_info->lj_given = 0 ; @@ -52,6 +53,7 @@ void clear_args (struct gengetopt_args_info *args_info { args_info->input_arg = NULL; args_info->bandwidth_arg = 8 ; + args_info->tolerance_arg = 0.01 ; } void @@ -67,17 +69,18 @@ cmdline_parser_print_help (void) printf("\n" "Usage: %s [OPTIONS]...\n", CMDLINE_PARSER_PACKAGE); printf("\n"); - printf("%s\n"," -h, --help Print help and exit"); - printf("%s\n"," -V, --version Print version and exit"); - printf("%s\n"," -i, --input=filename input file name"); - printf("%s\n"," -b, --bandwidth=INT The step detail for the potential grids - typically a \n power of 2 (default=`8')"); + printf("%s\n"," -h, --help Print help and exit"); + printf("%s\n"," -V, --version Print version and exit"); + printf("%s\n"," -i, --input=filename input file name"); + printf("%s\n"," -b, --bandwidth=INT The step detail for the potential grids - typically \n a power of 2 (default=`8')"); + printf("%s\n"," -t, --tolerance=DOUBLE The tolerance for recognition of spherical harmonic \n terms (default=`0.01')"); printf("\n"); printf(" Group: ForceField A Force Field must be specified\n"); - printf("%s\n"," -c, --charmm Use CHARMM 27 parameters"); - printf("%s\n"," -a, --amber Use Amber99 parameters"); - printf("%s\n"," -l, --lj Use Lennard-Jones parameters"); - printf("%s\n"," -g, --gaff Use GAFF parameters"); - printf("%s\n"," -o, --opls Use OPLS/AA parameters"); + printf("%s\n"," -c, --charmm Use CHARMM 27 parameters"); + printf("%s\n"," -a, --amber Use Amber99 parameters"); + printf("%s\n"," -l, --lj Use Lennard-Jones parameters"); + printf("%s\n"," -g, --gaff Use GAFF parameters"); + printf("%s\n"," -o, --opls Use OPLS/AA parameters"); } void @@ -184,6 +187,7 @@ cmdline_parser_internal (int argc, char * const *argv, { "version", 0, NULL, 'V' }, { "input", 1, NULL, 'i' }, { "bandwidth", 1, NULL, 'b' }, + { "tolerance", 1, NULL, 't' }, { "charmm", 0, NULL, 'c' }, { "amber", 0, NULL, 'a' }, { "lj", 0, NULL, 'l' }, @@ -193,7 +197,7 @@ cmdline_parser_internal (int argc, char * const *argv, }; stop_char = 0; - c = getopt_long (argc, argv, "hVi:b:calgo", long_options, &option_index); + c = getopt_long (argc, argv, "hVi:b:t:calgo", long_options, &option_index); if (c == -1) break; /* Exit from `while (1)' loop. */ @@ -233,6 +237,19 @@ cmdline_parser_internal (int argc, char * const *argv, local_args_info.bandwidth_given = 1; args_info->bandwidth_given = 1; args_info->bandwidth_arg = strtol (optarg,&stop_char,0); + break; + + case 't': /* The tolerance for recognition of spherical harmonic terms. */ + if (local_args_info.tolerance_given) + { + fprintf (stderr, "%s: `--tolerance' (`-t') option given more than once%s\n", CMDLINE_PARSER_PACKAGE, (additional_error ? additional_error : "")); + goto failure; + } + if (args_info->tolerance_given && ! override) + continue; + local_args_info.tolerance_given = 1; + args_info->tolerance_given = 1; + args_info->tolerance_arg = strtod (optarg, NULL); break; case 'c': /* Use CHARMM 27 parameters. */