# | Line 1 | Line 1 | |
---|---|---|
1 | /* | |
2 | < | File autogenerated by gengetopt version 2.16 |
2 | > | File autogenerated by gengetopt version 2.15 |
3 | generated with the following command: | |
4 | < | gengetopt -F StaticPropsCmd |
4 | > | gengetopt -i StaticProps.ggo -F StaticPropsCmd |
5 | ||
6 | The developers of gengetopt consider the fixed text that goes in all | |
7 | gengetopt output files to be in the public domain: | |
# | Line 43 | Line 43 | void clear_given (struct gengetopt_args_info *args_inf | |
43 | args_info->input_given = 0 ; | |
44 | args_info->output_given = 0 ; | |
45 | args_info->step_given = 0 ; | |
46 | < | args_info->nrbins_given = 0 ; |
46 | > | args_info->nbins_given = 0 ; |
47 | args_info->nbins_x_given = 0 ; | |
48 | args_info->nbins_y_given = 0 ; | |
49 | args_info->nanglebins_given = 0 ; | |
50 | args_info->length_given = 0 ; | |
51 | – | args_info->LegendreL_given = 0 ; |
51 | args_info->rcut_given = 0 ; | |
52 | args_info->zoffset_given = 0 ; | |
53 | args_info->sele1_given = 0 ; | |
# | Line 58 | Line 57 | void clear_given (struct gengetopt_args_info *args_inf | |
57 | args_info->molname_given = 0 ; | |
58 | args_info->begin_given = 0 ; | |
59 | args_info->end_given = 0 ; | |
60 | + | args_info->radius_given = 0 ; |
61 | args_info->bo_given = 0 ; | |
62 | args_info->gofr_given = 0 ; | |
63 | args_info->r_theta_given = 0 ; | |
# | Line 70 | Line 70 | void clear_given (struct gengetopt_args_info *args_inf | |
70 | args_info->density_given = 0 ; | |
71 | args_info->slab_density_given = 0 ; | |
72 | args_info->hxy_given = 0 ; | |
73 | + | args_info->rho_r_given = 0 ; |
74 | args_info->staticProps_group_counter = 0 ; | |
75 | } | |
76 | ||
# | Line 82 | Line 83 | void clear_args (struct gengetopt_args_info *args_info | |
83 | args_info->output_orig = NULL; | |
84 | args_info->step_arg = 1; | |
85 | args_info->step_orig = NULL; | |
86 | < | args_info->nrbins_arg = 100; |
87 | < | args_info->nrbins_orig = NULL; |
86 | > | args_info->nbins_arg = 100; |
87 | > | args_info->nbins_orig = NULL; |
88 | args_info->nbins_x_arg = 100; | |
89 | args_info->nbins_x_orig = NULL; | |
90 | args_info->nbins_y_arg = 100; | |
# | Line 91 | Line 92 | void clear_args (struct gengetopt_args_info *args_info | |
92 | args_info->nanglebins_arg = 50; | |
93 | args_info->nanglebins_orig = NULL; | |
94 | args_info->length_orig = NULL; | |
94 | – | args_info->LegendreL_orig = NULL; |
95 | args_info->rcut_orig = NULL; | |
96 | args_info->zoffset_arg = 0; | |
97 | args_info->zoffset_orig = NULL; | |
# | Line 107 | Line 107 | void clear_args (struct gengetopt_args_info *args_info | |
107 | args_info->molname_orig = NULL; | |
108 | args_info->begin_orig = NULL; | |
109 | args_info->end_orig = NULL; | |
110 | + | args_info->radius_orig = NULL; |
111 | ||
112 | } | |
113 | ||
# | Line 126 | Line 127 | cmdline_parser_print_help (void) | |
127 | printf("%s\n"," -i, --input=filename input dump file"); | |
128 | printf("%s\n"," -o, --output=filename output file name"); | |
129 | printf("%s\n"," -n, --step=INT process every n frame (default=`1')"); | |
130 | < | printf("%s\n"," -r, --nrbins=INT number of bins for distance (default=`100')"); |
130 | > | printf("%s\n"," -b, --nbins=INT number of bins (general purpose) \n (default=`100')"); |
131 | printf("%s\n"," -x, --nbins_x=INT number of bins in x axis (default=`100')"); | |
132 | printf("%s\n"," -y, --nbins_y=INT number of bins in y axis (default=`100')"); | |
133 | printf("%s\n"," -a, --nanglebins=INT number of bins for cos(angle) (default=`50')"); | |
134 | printf("%s\n"," --length=DOUBLE maximum length (Defaults to 1/2 smallest length \n of first frame)"); | |
134 | – | printf("%s\n"," -l, --LegendreL=INT Order of Legendre Polynomial (used for Bond \n Order calculations)"); |
135 | printf("%s\n"," -c, --rcut=DOUBLE cutoff radius (rcut)"); | |
136 | printf("%s\n"," -z, --zoffset=DOUBLE Where to set the zero for the slab_density \n calculation (default=`0')"); | |
137 | printf("%s\n"," --sele1=selection script select the first stuntdouble set"); | |
# | Line 141 | Line 141 | cmdline_parser_print_help (void) | |
141 | printf("%s\n"," --molname=STRING molecule name"); | |
142 | printf("%s\n"," --begin=INT begin internal index"); | |
143 | printf("%s\n"," --end=INT end internal index"); | |
144 | + | printf("%s\n"," --radius=DOUBLE nanoparticle radius"); |
145 | printf("%s\n","\n Group: staticProps\n an option of this group is required"); | |
146 | < | printf("%s\n"," -b, --bo bond order parameter (--rcut and --LegendreL \n must be specified"); |
146 | > | printf("%s\n"," --bo bond order parameter (--rcut must be specified"); |
147 | printf("%s\n"," -g, --gofr g(r)"); | |
148 | printf("%s\n"," --r_theta g(r, cos(theta))"); | |
149 | printf("%s\n"," --r_omega g(r, cos(omega))"); | |
# | Line 154 | Line 155 | cmdline_parser_print_help (void) | |
155 | printf("%s\n"," -d, --density density plot"); | |
156 | printf("%s\n"," --slab_density slab density"); | |
157 | printf("%s\n"," --hxy hxy"); | |
158 | + | printf("%s\n"," --rho_r rho of R"); |
159 | ||
160 | } | |
161 | ||
# | Line 193 | Line 195 | cmdline_parser_release (struct gengetopt_args_info *ar | |
195 | free (args_info->step_orig); /* free previous argument */ | |
196 | args_info->step_orig = 0; | |
197 | } | |
198 | < | if (args_info->nrbins_orig) |
198 | > | if (args_info->nbins_orig) |
199 | { | |
200 | < | free (args_info->nrbins_orig); /* free previous argument */ |
201 | < | args_info->nrbins_orig = 0; |
200 | > | free (args_info->nbins_orig); /* free previous argument */ |
201 | > | args_info->nbins_orig = 0; |
202 | } | |
203 | if (args_info->nbins_x_orig) | |
204 | { | |
# | Line 218 | Line 220 | cmdline_parser_release (struct gengetopt_args_info *ar | |
220 | free (args_info->length_orig); /* free previous argument */ | |
221 | args_info->length_orig = 0; | |
222 | } | |
221 | – | if (args_info->LegendreL_orig) |
222 | – | { |
223 | – | free (args_info->LegendreL_orig); /* free previous argument */ |
224 | – | args_info->LegendreL_orig = 0; |
225 | – | } |
223 | if (args_info->rcut_orig) | |
224 | { | |
225 | free (args_info->rcut_orig); /* free previous argument */ | |
# | Line 293 | Line 290 | cmdline_parser_release (struct gengetopt_args_info *ar | |
290 | free (args_info->end_orig); /* free previous argument */ | |
291 | args_info->end_orig = 0; | |
292 | } | |
293 | + | if (args_info->radius_orig) |
294 | + | { |
295 | + | free (args_info->radius_orig); /* free previous argument */ |
296 | + | args_info->radius_orig = 0; |
297 | + | } |
298 | ||
299 | clear_given (args_info); | |
300 | } | |
# | Line 338 | Line 340 | cmdline_parser_file_save(const char *filename, struct | |
340 | fprintf(outfile, "%s\n", "step"); | |
341 | } | |
342 | } | |
343 | < | if (args_info->nrbins_given) { |
344 | < | if (args_info->nrbins_orig) { |
345 | < | fprintf(outfile, "%s=\"%s\"\n", "nrbins", args_info->nrbins_orig); |
343 | > | if (args_info->nbins_given) { |
344 | > | if (args_info->nbins_orig) { |
345 | > | fprintf(outfile, "%s=\"%s\"\n", "nbins", args_info->nbins_orig); |
346 | } else { | |
347 | < | fprintf(outfile, "%s\n", "nrbins"); |
347 | > | fprintf(outfile, "%s\n", "nbins"); |
348 | } | |
349 | } | |
350 | if (args_info->nbins_x_given) { | |
# | Line 371 | Line 373 | cmdline_parser_file_save(const char *filename, struct | |
373 | fprintf(outfile, "%s=\"%s\"\n", "length", args_info->length_orig); | |
374 | } else { | |
375 | fprintf(outfile, "%s\n", "length"); | |
374 | – | } |
375 | – | } |
376 | – | if (args_info->LegendreL_given) { |
377 | – | if (args_info->LegendreL_orig) { |
378 | – | fprintf(outfile, "%s=\"%s\"\n", "LegendreL", args_info->LegendreL_orig); |
379 | – | } else { |
380 | – | fprintf(outfile, "%s\n", "LegendreL"); |
376 | } | |
377 | } | |
378 | if (args_info->rcut_given) { | |
# | Line 443 | Line 438 | cmdline_parser_file_save(const char *filename, struct | |
438 | fprintf(outfile, "%s\n", "end"); | |
439 | } | |
440 | } | |
441 | + | if (args_info->radius_given) { |
442 | + | if (args_info->radius_orig) { |
443 | + | fprintf(outfile, "%s=\"%s\"\n", "radius", args_info->radius_orig); |
444 | + | } else { |
445 | + | fprintf(outfile, "%s\n", "radius"); |
446 | + | } |
447 | + | } |
448 | if (args_info->bo_given) { | |
449 | fprintf(outfile, "%s\n", "bo"); | |
450 | } | |
# | Line 478 | Line 480 | cmdline_parser_file_save(const char *filename, struct | |
480 | } | |
481 | if (args_info->hxy_given) { | |
482 | fprintf(outfile, "%s\n", "hxy"); | |
483 | + | } |
484 | + | if (args_info->rho_r_given) { |
485 | + | fprintf(outfile, "%s\n", "rho_r"); |
486 | } | |
487 | ||
488 | fclose (outfile); | |
# | Line 530 | Line 535 | reset_group_staticProps(struct gengetopt_args_info *ar | |
535 | args_info->density_given = 0 ; | |
536 | args_info->slab_density_given = 0 ; | |
537 | args_info->hxy_given = 0 ; | |
538 | + | args_info->rho_r_given = 0 ; |
539 | ||
540 | args_info->staticProps_group_counter = 0; | |
541 | } | |
# | Line 607 | Line 613 | cmdline_parser_internal (int argc, char * const *argv, | |
613 | cmdline_parser_init (&local_args_info); | |
614 | ||
615 | optarg = 0; | |
616 | < | optind = 0; |
616 | > | optind = 1; |
617 | opterr = 1; | |
618 | optopt = '?'; | |
619 | ||
# | Line 622 | Line 628 | cmdline_parser_internal (int argc, char * const *argv, | |
628 | { "input", 1, NULL, 'i' }, | |
629 | { "output", 1, NULL, 'o' }, | |
630 | { "step", 1, NULL, 'n' }, | |
631 | < | { "nrbins", 1, NULL, 'r' }, |
631 | > | { "nbins", 1, NULL, 'b' }, |
632 | { "nbins_x", 1, NULL, 'x' }, | |
633 | { "nbins_y", 1, NULL, 'y' }, | |
634 | { "nanglebins", 1, NULL, 'a' }, | |
635 | { "length", 1, NULL, 0 }, | |
630 | – | { "LegendreL", 1, NULL, 'l' }, |
636 | { "rcut", 1, NULL, 'c' }, | |
637 | { "zoffset", 1, NULL, 'z' }, | |
638 | { "sele1", 1, NULL, 0 }, | |
# | Line 637 | Line 642 | cmdline_parser_internal (int argc, char * const *argv, | |
642 | { "molname", 1, NULL, 0 }, | |
643 | { "begin", 1, NULL, 0 }, | |
644 | { "end", 1, NULL, 0 }, | |
645 | < | { "bo", 0, NULL, 'b' }, |
645 | > | { "radius", 1, NULL, 0 }, |
646 | > | { "bo", 0, NULL, 0 }, |
647 | { "gofr", 0, NULL, 'g' }, | |
648 | { "r_theta", 0, NULL, 0 }, | |
649 | { "r_omega", 0, NULL, 0 }, | |
# | Line 649 | Line 655 | cmdline_parser_internal (int argc, char * const *argv, | |
655 | { "density", 0, NULL, 'd' }, | |
656 | { "slab_density", 0, NULL, 0 }, | |
657 | { "hxy", 0, NULL, 0 }, | |
658 | + | { "rho_r", 0, NULL, 0 }, |
659 | { NULL, 0, NULL, 0 } | |
660 | }; | |
661 | ||
662 | stop_char = 0; | |
663 | < | c = getopt_long (argc, argv, "hVi:o:n:r:x:y:a:l:c:z:bgpsd", long_options, &option_index); |
663 | > | c = getopt_long (argc, argv, "hVi:o:n:b:x:y:a:c:z:gpsd", long_options, &option_index); |
664 | ||
665 | if (c == -1) break; /* Exit from `while (1)' loop. */ | |
666 | ||
# | Line 725 | Line 732 | cmdline_parser_internal (int argc, char * const *argv, | |
732 | args_info->step_orig = gengetopt_strdup (optarg); | |
733 | break; | |
734 | ||
735 | < | case 'r': /* number of bins for distance. */ |
736 | < | if (local_args_info.nrbins_given) |
735 | > | case 'b': /* number of bins (general purpose). */ |
736 | > | if (local_args_info.nbins_given) |
737 | { | |
738 | < | fprintf (stderr, "%s: `--nrbins' (`-r') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
738 | > | fprintf (stderr, "%s: `--nbins' (`-b') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
739 | goto failure; | |
740 | } | |
741 | < | if (args_info->nrbins_given && ! override) |
741 | > | if (args_info->nbins_given && ! override) |
742 | continue; | |
743 | < | local_args_info.nrbins_given = 1; |
744 | < | args_info->nrbins_given = 1; |
745 | < | args_info->nrbins_arg = strtol (optarg, &stop_char, 0); |
743 | > | local_args_info.nbins_given = 1; |
744 | > | args_info->nbins_given = 1; |
745 | > | args_info->nbins_arg = strtol (optarg, &stop_char, 0); |
746 | if (!(stop_char && *stop_char == '\0')) { | |
747 | fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); | |
748 | goto failure; | |
749 | } | |
750 | < | if (args_info->nrbins_orig) |
751 | < | free (args_info->nrbins_orig); /* free previous string */ |
752 | < | args_info->nrbins_orig = gengetopt_strdup (optarg); |
750 | > | if (args_info->nbins_orig) |
751 | > | free (args_info->nbins_orig); /* free previous string */ |
752 | > | args_info->nbins_orig = gengetopt_strdup (optarg); |
753 | break; | |
754 | ||
755 | case 'x': /* number of bins in x axis. */ | |
# | Line 805 | Line 812 | cmdline_parser_internal (int argc, char * const *argv, | |
812 | args_info->nanglebins_orig = gengetopt_strdup (optarg); | |
813 | break; | |
814 | ||
808 | – | case 'l': /* Order of Legendre Polynomial (used for Bond Order calculations). */ |
809 | – | if (local_args_info.LegendreL_given) |
810 | – | { |
811 | – | fprintf (stderr, "%s: `--LegendreL' (`-l') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
812 | – | goto failure; |
813 | – | } |
814 | – | if (args_info->LegendreL_given && ! override) |
815 | – | continue; |
816 | – | local_args_info.LegendreL_given = 1; |
817 | – | args_info->LegendreL_given = 1; |
818 | – | args_info->LegendreL_arg = strtol (optarg, &stop_char, 0); |
819 | – | if (!(stop_char && *stop_char == '\0')) { |
820 | – | fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
821 | – | goto failure; |
822 | – | } |
823 | – | if (args_info->LegendreL_orig) |
824 | – | free (args_info->LegendreL_orig); /* free previous string */ |
825 | – | args_info->LegendreL_orig = gengetopt_strdup (optarg); |
826 | – | break; |
827 | – | |
815 | case 'c': /* cutoff radius (rcut). */ | |
816 | if (local_args_info.rcut_given) | |
817 | { | |
# | Line 863 | Line 850 | cmdline_parser_internal (int argc, char * const *argv, | |
850 | if (args_info->zoffset_orig) | |
851 | free (args_info->zoffset_orig); /* free previous string */ | |
852 | args_info->zoffset_orig = gengetopt_strdup (optarg); | |
866 | – | break; |
867 | – | |
868 | – | case 'b': /* bond order parameter (--rcut and --LegendreL must be specified. */ |
869 | – | if (local_args_info.bo_given) |
870 | – | { |
871 | – | fprintf (stderr, "%s: `--bo' (`-b') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
872 | – | goto failure; |
873 | – | } |
874 | – | if (args_info->bo_given && ! override) |
875 | – | continue; |
876 | – | local_args_info.bo_given = 1; |
877 | – | args_info->bo_given = 1; |
878 | – | if (args_info->staticProps_group_counter && override) |
879 | – | reset_group_staticProps (args_info); |
880 | – | args_info->staticProps_group_counter += 1; |
853 | break; | |
854 | ||
855 | case 'g': /* g(r). */ | |
# | Line 1099 | Line 1071 | cmdline_parser_internal (int argc, char * const *argv, | |
1071 | if (args_info->end_orig) | |
1072 | free (args_info->end_orig); /* free previous string */ | |
1073 | args_info->end_orig = gengetopt_strdup (optarg); | |
1074 | + | } |
1075 | + | /* nanoparticle radius. */ |
1076 | + | else if (strcmp (long_options[option_index].name, "radius") == 0) |
1077 | + | { |
1078 | + | if (local_args_info.radius_given) |
1079 | + | { |
1080 | + | fprintf (stderr, "%s: `--radius' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1081 | + | goto failure; |
1082 | + | } |
1083 | + | if (args_info->radius_given && ! override) |
1084 | + | continue; |
1085 | + | local_args_info.radius_given = 1; |
1086 | + | args_info->radius_given = 1; |
1087 | + | args_info->radius_arg = strtod (optarg, &stop_char); |
1088 | + | if (!(stop_char && *stop_char == '\0')) { |
1089 | + | fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
1090 | + | goto failure; |
1091 | + | } |
1092 | + | if (args_info->radius_orig) |
1093 | + | free (args_info->radius_orig); /* free previous string */ |
1094 | + | args_info->radius_orig = gengetopt_strdup (optarg); |
1095 | } | |
1096 | + | /* bond order parameter (--rcut must be specified. */ |
1097 | + | else if (strcmp (long_options[option_index].name, "bo") == 0) |
1098 | + | { |
1099 | + | if (local_args_info.bo_given) |
1100 | + | { |
1101 | + | fprintf (stderr, "%s: `--bo' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1102 | + | goto failure; |
1103 | + | } |
1104 | + | if (args_info->bo_given && ! override) |
1105 | + | continue; |
1106 | + | local_args_info.bo_given = 1; |
1107 | + | args_info->bo_given = 1; |
1108 | + | if (args_info->staticProps_group_counter && override) |
1109 | + | reset_group_staticProps (args_info); |
1110 | + | args_info->staticProps_group_counter += 1; |
1111 | + | break; |
1112 | + | } |
1113 | /* g(r, cos(theta)). */ | |
1114 | else if (strcmp (long_options[option_index].name, "r_theta") == 0) | |
1115 | { | |
# | Line 1219 | Line 1229 | cmdline_parser_internal (int argc, char * const *argv, | |
1229 | args_info->staticProps_group_counter += 1; | |
1230 | break; | |
1231 | } | |
1232 | + | /* rho of R. */ |
1233 | + | else if (strcmp (long_options[option_index].name, "rho_r") == 0) |
1234 | + | { |
1235 | + | if (local_args_info.rho_r_given) |
1236 | + | { |
1237 | + | fprintf (stderr, "%s: `--rho_r' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1238 | + | goto failure; |
1239 | + | } |
1240 | + | if (args_info->rho_r_given && ! override) |
1241 | + | continue; |
1242 | + | local_args_info.rho_r_given = 1; |
1243 | + | args_info->rho_r_given = 1; |
1244 | + | if (args_info->staticProps_group_counter && override) |
1245 | + | reset_group_staticProps (args_info); |
1246 | + | args_info->staticProps_group_counter += 1; |
1247 | + | break; |
1248 | + | } |
1249 | ||
1250 | break; | |
1251 | case '?': /* Invalid option. */ |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |