--- trunk/src/applications/staticProps/StaticPropsCmd.c 2006/09/19 21:14:11 1039 +++ trunk/src/applications/staticProps/StaticPropsCmd.c 2006/11/10 18:45:29 1091 @@ -1,7 +1,7 @@ /* - File autogenerated by gengetopt version 2.16 + File autogenerated by gengetopt version 2.15 generated with the following command: - gengetopt -F StaticPropsCmd + gengetopt -i StaticProps.ggo -F StaticPropsCmd The developers of gengetopt consider the fixed text that goes in all gengetopt output files to be in the public domain: @@ -43,12 +43,11 @@ void clear_given (struct gengetopt_args_info *args_inf args_info->input_given = 0 ; args_info->output_given = 0 ; args_info->step_given = 0 ; - args_info->nrbins_given = 0 ; + args_info->nbins_given = 0 ; args_info->nbins_x_given = 0 ; args_info->nbins_y_given = 0 ; args_info->nanglebins_given = 0 ; args_info->length_given = 0 ; - args_info->LegendreL_given = 0 ; args_info->rcut_given = 0 ; args_info->zoffset_given = 0 ; args_info->sele1_given = 0 ; @@ -58,6 +57,7 @@ void clear_given (struct gengetopt_args_info *args_inf args_info->molname_given = 0 ; args_info->begin_given = 0 ; args_info->end_given = 0 ; + args_info->radius_given = 0 ; args_info->bo_given = 0 ; args_info->gofr_given = 0 ; args_info->r_theta_given = 0 ; @@ -70,6 +70,7 @@ void clear_given (struct gengetopt_args_info *args_inf args_info->density_given = 0 ; args_info->slab_density_given = 0 ; args_info->hxy_given = 0 ; + args_info->rho_r_given = 0 ; args_info->staticProps_group_counter = 0 ; } @@ -82,8 +83,8 @@ void clear_args (struct gengetopt_args_info *args_info args_info->output_orig = NULL; args_info->step_arg = 1; args_info->step_orig = NULL; - args_info->nrbins_arg = 100; - args_info->nrbins_orig = NULL; + args_info->nbins_arg = 100; + args_info->nbins_orig = NULL; args_info->nbins_x_arg = 100; args_info->nbins_x_orig = NULL; args_info->nbins_y_arg = 100; @@ -91,7 +92,6 @@ void clear_args (struct gengetopt_args_info *args_info args_info->nanglebins_arg = 50; args_info->nanglebins_orig = NULL; args_info->length_orig = NULL; - args_info->LegendreL_orig = NULL; args_info->rcut_orig = NULL; args_info->zoffset_arg = 0; args_info->zoffset_orig = NULL; @@ -107,6 +107,7 @@ void clear_args (struct gengetopt_args_info *args_info args_info->molname_orig = NULL; args_info->begin_orig = NULL; args_info->end_orig = NULL; + args_info->radius_orig = NULL; } @@ -126,12 +127,11 @@ cmdline_parser_print_help (void) printf("%s\n"," -i, --input=filename input dump file"); printf("%s\n"," -o, --output=filename output file name"); printf("%s\n"," -n, --step=INT process every n frame (default=`1')"); - printf("%s\n"," -r, --nrbins=INT number of bins for distance (default=`100')"); + printf("%s\n"," -b, --nbins=INT number of bins (general purpose) \n (default=`100')"); printf("%s\n"," -x, --nbins_x=INT number of bins in x axis (default=`100')"); printf("%s\n"," -y, --nbins_y=INT number of bins in y axis (default=`100')"); printf("%s\n"," -a, --nanglebins=INT number of bins for cos(angle) (default=`50')"); printf("%s\n"," --length=DOUBLE maximum length (Defaults to 1/2 smallest length \n of first frame)"); - printf("%s\n"," -l, --LegendreL=INT Order of Legendre Polynomial (used for Bond \n Order calculations)"); printf("%s\n"," -c, --rcut=DOUBLE cutoff radius (rcut)"); printf("%s\n"," -z, --zoffset=DOUBLE Where to set the zero for the slab_density \n calculation (default=`0')"); printf("%s\n"," --sele1=selection script select the first stuntdouble set"); @@ -141,8 +141,9 @@ cmdline_parser_print_help (void) printf("%s\n"," --molname=STRING molecule name"); printf("%s\n"," --begin=INT begin internal index"); printf("%s\n"," --end=INT end internal index"); + printf("%s\n"," --radius=DOUBLE nanoparticle radius"); printf("%s\n","\n Group: staticProps\n an option of this group is required"); - printf("%s\n"," -b, --bo bond order parameter (--rcut and --LegendreL \n must be specified"); + printf("%s\n"," --bo bond order parameter (--rcut must be specified"); printf("%s\n"," -g, --gofr g(r)"); printf("%s\n"," --r_theta g(r, cos(theta))"); printf("%s\n"," --r_omega g(r, cos(omega))"); @@ -154,6 +155,7 @@ cmdline_parser_print_help (void) printf("%s\n"," -d, --density density plot"); printf("%s\n"," --slab_density slab density"); printf("%s\n"," --hxy hxy"); + printf("%s\n"," --rho_r rho of R"); } @@ -193,10 +195,10 @@ cmdline_parser_release (struct gengetopt_args_info *ar free (args_info->step_orig); /* free previous argument */ args_info->step_orig = 0; } - if (args_info->nrbins_orig) + if (args_info->nbins_orig) { - free (args_info->nrbins_orig); /* free previous argument */ - args_info->nrbins_orig = 0; + free (args_info->nbins_orig); /* free previous argument */ + args_info->nbins_orig = 0; } if (args_info->nbins_x_orig) { @@ -218,11 +220,6 @@ cmdline_parser_release (struct gengetopt_args_info *ar free (args_info->length_orig); /* free previous argument */ args_info->length_orig = 0; } - if (args_info->LegendreL_orig) - { - free (args_info->LegendreL_orig); /* free previous argument */ - args_info->LegendreL_orig = 0; - } if (args_info->rcut_orig) { free (args_info->rcut_orig); /* free previous argument */ @@ -293,6 +290,11 @@ cmdline_parser_release (struct gengetopt_args_info *ar free (args_info->end_orig); /* free previous argument */ args_info->end_orig = 0; } + if (args_info->radius_orig) + { + free (args_info->radius_orig); /* free previous argument */ + args_info->radius_orig = 0; + } clear_given (args_info); } @@ -338,11 +340,11 @@ cmdline_parser_file_save(const char *filename, struct fprintf(outfile, "%s\n", "step"); } } - if (args_info->nrbins_given) { - if (args_info->nrbins_orig) { - fprintf(outfile, "%s=\"%s\"\n", "nrbins", args_info->nrbins_orig); + if (args_info->nbins_given) { + if (args_info->nbins_orig) { + fprintf(outfile, "%s=\"%s\"\n", "nbins", args_info->nbins_orig); } else { - fprintf(outfile, "%s\n", "nrbins"); + fprintf(outfile, "%s\n", "nbins"); } } if (args_info->nbins_x_given) { @@ -371,13 +373,6 @@ cmdline_parser_file_save(const char *filename, struct fprintf(outfile, "%s=\"%s\"\n", "length", args_info->length_orig); } else { fprintf(outfile, "%s\n", "length"); - } - } - if (args_info->LegendreL_given) { - if (args_info->LegendreL_orig) { - fprintf(outfile, "%s=\"%s\"\n", "LegendreL", args_info->LegendreL_orig); - } else { - fprintf(outfile, "%s\n", "LegendreL"); } } if (args_info->rcut_given) { @@ -443,6 +438,13 @@ cmdline_parser_file_save(const char *filename, struct fprintf(outfile, "%s\n", "end"); } } + if (args_info->radius_given) { + if (args_info->radius_orig) { + fprintf(outfile, "%s=\"%s\"\n", "radius", args_info->radius_orig); + } else { + fprintf(outfile, "%s\n", "radius"); + } + } if (args_info->bo_given) { fprintf(outfile, "%s\n", "bo"); } @@ -478,6 +480,9 @@ cmdline_parser_file_save(const char *filename, struct } if (args_info->hxy_given) { fprintf(outfile, "%s\n", "hxy"); + } + if (args_info->rho_r_given) { + fprintf(outfile, "%s\n", "rho_r"); } fclose (outfile); @@ -530,6 +535,7 @@ reset_group_staticProps(struct gengetopt_args_info *ar args_info->density_given = 0 ; args_info->slab_density_given = 0 ; args_info->hxy_given = 0 ; + args_info->rho_r_given = 0 ; args_info->staticProps_group_counter = 0; } @@ -607,7 +613,7 @@ cmdline_parser_internal (int argc, char * const *argv, cmdline_parser_init (&local_args_info); optarg = 0; - optind = 0; + optind = 1; opterr = 1; optopt = '?'; @@ -622,12 +628,11 @@ cmdline_parser_internal (int argc, char * const *argv, { "input", 1, NULL, 'i' }, { "output", 1, NULL, 'o' }, { "step", 1, NULL, 'n' }, - { "nrbins", 1, NULL, 'r' }, + { "nbins", 1, NULL, 'b' }, { "nbins_x", 1, NULL, 'x' }, { "nbins_y", 1, NULL, 'y' }, { "nanglebins", 1, NULL, 'a' }, { "length", 1, NULL, 0 }, - { "LegendreL", 1, NULL, 'l' }, { "rcut", 1, NULL, 'c' }, { "zoffset", 1, NULL, 'z' }, { "sele1", 1, NULL, 0 }, @@ -637,7 +642,8 @@ cmdline_parser_internal (int argc, char * const *argv, { "molname", 1, NULL, 0 }, { "begin", 1, NULL, 0 }, { "end", 1, NULL, 0 }, - { "bo", 0, NULL, 'b' }, + { "radius", 1, NULL, 0 }, + { "bo", 0, NULL, 0 }, { "gofr", 0, NULL, 'g' }, { "r_theta", 0, NULL, 0 }, { "r_omega", 0, NULL, 0 }, @@ -649,11 +655,12 @@ cmdline_parser_internal (int argc, char * const *argv, { "density", 0, NULL, 'd' }, { "slab_density", 0, NULL, 0 }, { "hxy", 0, NULL, 0 }, + { "rho_r", 0, NULL, 0 }, { NULL, 0, NULL, 0 } }; stop_char = 0; - c = getopt_long (argc, argv, "hVi:o:n:r:x:y:a:l:c:z:bgpsd", long_options, &option_index); + c = getopt_long (argc, argv, "hVi:o:n:b:x:y:a:c:z:gpsd", long_options, &option_index); if (c == -1) break; /* Exit from `while (1)' loop. */ @@ -725,24 +732,24 @@ cmdline_parser_internal (int argc, char * const *argv, args_info->step_orig = gengetopt_strdup (optarg); break; - case 'r': /* number of bins for distance. */ - if (local_args_info.nrbins_given) + case 'b': /* number of bins (general purpose). */ + if (local_args_info.nbins_given) { - fprintf (stderr, "%s: `--nrbins' (`-r') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); + fprintf (stderr, "%s: `--nbins' (`-b') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); goto failure; } - if (args_info->nrbins_given && ! override) + if (args_info->nbins_given && ! override) continue; - local_args_info.nrbins_given = 1; - args_info->nrbins_given = 1; - args_info->nrbins_arg = strtol (optarg, &stop_char, 0); + local_args_info.nbins_given = 1; + args_info->nbins_given = 1; + args_info->nbins_arg = strtol (optarg, &stop_char, 0); if (!(stop_char && *stop_char == '\0')) { fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); goto failure; } - if (args_info->nrbins_orig) - free (args_info->nrbins_orig); /* free previous string */ - args_info->nrbins_orig = gengetopt_strdup (optarg); + if (args_info->nbins_orig) + free (args_info->nbins_orig); /* free previous string */ + args_info->nbins_orig = gengetopt_strdup (optarg); break; case 'x': /* number of bins in x axis. */ @@ -805,26 +812,6 @@ cmdline_parser_internal (int argc, char * const *argv, args_info->nanglebins_orig = gengetopt_strdup (optarg); break; - case 'l': /* Order of Legendre Polynomial (used for Bond Order calculations). */ - if (local_args_info.LegendreL_given) - { - fprintf (stderr, "%s: `--LegendreL' (`-l') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); - goto failure; - } - if (args_info->LegendreL_given && ! override) - continue; - local_args_info.LegendreL_given = 1; - args_info->LegendreL_given = 1; - args_info->LegendreL_arg = strtol (optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); - goto failure; - } - if (args_info->LegendreL_orig) - free (args_info->LegendreL_orig); /* free previous string */ - args_info->LegendreL_orig = gengetopt_strdup (optarg); - break; - case 'c': /* cutoff radius (rcut). */ if (local_args_info.rcut_given) { @@ -863,21 +850,6 @@ cmdline_parser_internal (int argc, char * const *argv, if (args_info->zoffset_orig) free (args_info->zoffset_orig); /* free previous string */ args_info->zoffset_orig = gengetopt_strdup (optarg); - break; - - case 'b': /* bond order parameter (--rcut and --LegendreL must be specified. */ - if (local_args_info.bo_given) - { - fprintf (stderr, "%s: `--bo' (`-b') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); - goto failure; - } - if (args_info->bo_given && ! override) - continue; - local_args_info.bo_given = 1; - args_info->bo_given = 1; - if (args_info->staticProps_group_counter && override) - reset_group_staticProps (args_info); - args_info->staticProps_group_counter += 1; break; case 'g': /* g(r). */ @@ -1099,7 +1071,45 @@ cmdline_parser_internal (int argc, char * const *argv, if (args_info->end_orig) free (args_info->end_orig); /* free previous string */ args_info->end_orig = gengetopt_strdup (optarg); + } + /* nanoparticle radius. */ + else if (strcmp (long_options[option_index].name, "radius") == 0) + { + if (local_args_info.radius_given) + { + fprintf (stderr, "%s: `--radius' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); + goto failure; + } + if (args_info->radius_given && ! override) + continue; + local_args_info.radius_given = 1; + args_info->radius_given = 1; + args_info->radius_arg = strtod (optarg, &stop_char); + if (!(stop_char && *stop_char == '\0')) { + fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); + goto failure; + } + if (args_info->radius_orig) + free (args_info->radius_orig); /* free previous string */ + args_info->radius_orig = gengetopt_strdup (optarg); } + /* bond order parameter (--rcut must be specified. */ + else if (strcmp (long_options[option_index].name, "bo") == 0) + { + if (local_args_info.bo_given) + { + fprintf (stderr, "%s: `--bo' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); + goto failure; + } + if (args_info->bo_given && ! override) + continue; + local_args_info.bo_given = 1; + args_info->bo_given = 1; + if (args_info->staticProps_group_counter && override) + reset_group_staticProps (args_info); + args_info->staticProps_group_counter += 1; + break; + } /* g(r, cos(theta)). */ else if (strcmp (long_options[option_index].name, "r_theta") == 0) { @@ -1219,6 +1229,23 @@ cmdline_parser_internal (int argc, char * const *argv, args_info->staticProps_group_counter += 1; break; } + /* rho of R. */ + else if (strcmp (long_options[option_index].name, "rho_r") == 0) + { + if (local_args_info.rho_r_given) + { + fprintf (stderr, "%s: `--rho_r' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); + goto failure; + } + if (args_info->rho_r_given && ! override) + continue; + local_args_info.rho_r_given = 1; + args_info->rho_r_given = 1; + if (args_info->staticProps_group_counter && override) + reset_group_staticProps (args_info); + args_info->staticProps_group_counter += 1; + break; + } break; case '?': /* Invalid option. */