# | 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->rcut_given = 0 ; |
52 | args_info->zoffset_given = 0 ; | |
53 | args_info->sele1_given = 0 ; | |
54 | args_info->sele2_given = 0 ; | |
# | Line 56 | 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 ; | |
64 | args_info->r_omega_given = 0 ; | |
65 | args_info->theta_omega_given = 0 ; | |
66 | args_info->gxyz_given = 0 ; | |
67 | args_info->p2_given = 0 ; | |
68 | + | args_info->rp2_given = 0 ; |
69 | args_info->scd_given = 0 ; | |
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 78 | 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 87 | 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; | |
95 | + | args_info->rcut_orig = NULL; |
96 | args_info->zoffset_arg = 0; | |
97 | args_info->zoffset_orig = NULL; | |
98 | args_info->sele1_arg = NULL; | |
# | Line 101 | 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 120 | 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"," -x, --nbins_x=INT number of bins in x axis (default=`100')"); |
131 | < | printf("%s\n"," -y , --nbins_y=INT number of bins in y axis (default=`100')"); |
132 | < | 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"," -l, --length=DOUBLE maximum length (Defaults to 1/2 smallest length \n of first frame)"); |
134 | > | printf("%s\n"," --length=DOUBLE maximum length (Defaults to 1/2 smallest length \n of first frame)"); |
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"); | |
138 | printf("%s\n"," --sele2=selection script select the second stuntdouble set"); | |
139 | printf("%s\n"," --sele3=selection script select the third stuntdouble set"); | |
140 | printf("%s\n"," --refsele=selection script\n select reference (use and only use with --gxyz)"); | |
141 | printf("%s\n"," --molname=STRING molecule name"); | |
142 | < | printf("%s\n"," --begin=INT begin interanl index"); |
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"," --gofr g(r)"); |
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))"); | |
150 | printf("%s\n"," --theta_omega g(cos(theta), cos(omega))"); | |
151 | printf("%s\n"," --gxyz g(x, y, z)"); | |
152 | < | printf("%s\n"," --p2 p2 order parameter (--sele1 and --sele2 must be \n specified)"); |
153 | < | printf("%s\n"," --scd scd order parameter(either --sele1, --sele2, \n --sele3 are specified or --molname, --begin, \n --end are specified)"); |
154 | < | printf("%s\n"," --density density plot (--sele1 must be specified)"); |
155 | < | printf("%s\n"," --slab_density slab density (--sele1 must be specified)"); |
156 | < | printf("%s\n"," --hxy hxy (--sele1 must be specified)"); |
152 | > | printf("%s\n"," -p, --p2 p2 order parameter (--sele1 and --sele2 must be \n specified)"); |
153 | > | printf("%s\n"," --rp2 rp2 order parameter (--sele1 and --sele2 must \n be specified)"); |
154 | > | printf("%s\n"," -s, --scd scd order parameter (either --sele1, --sele2, \n --sele3 are specified or --molname, --begin, \n --end are specified)"); |
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 183 | 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) |
203 | > | if (args_info->nbins_x_orig) |
204 | { | |
205 | free (args_info->nbins_x_orig); /* free previous argument */ | |
206 | args_info->nbins_x_orig = 0; | |
# | Line 198 | Line 210 | cmdline_parser_release (struct gengetopt_args_info *ar | |
210 | free (args_info->nbins_y_orig); /* free previous argument */ | |
211 | args_info->nbins_y_orig = 0; | |
212 | } | |
201 | – | |
213 | if (args_info->nanglebins_orig) | |
214 | { | |
215 | free (args_info->nanglebins_orig); /* free previous argument */ | |
# | Line 209 | 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 | } | |
223 | + | if (args_info->rcut_orig) |
224 | + | { |
225 | + | free (args_info->rcut_orig); /* free previous argument */ |
226 | + | args_info->rcut_orig = 0; |
227 | + | } |
228 | if (args_info->zoffset_orig) | |
229 | { | |
230 | free (args_info->zoffset_orig); /* free previous argument */ | |
# | Line 274 | 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 319 | 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 354 | Line 375 | cmdline_parser_file_save(const char *filename, struct | |
375 | fprintf(outfile, "%s\n", "length"); | |
376 | } | |
377 | } | |
378 | + | if (args_info->rcut_given) { |
379 | + | if (args_info->rcut_orig) { |
380 | + | fprintf(outfile, "%s=\"%s\"\n", "rcut", args_info->rcut_orig); |
381 | + | } else { |
382 | + | fprintf(outfile, "%s\n", "rcut"); |
383 | + | } |
384 | + | } |
385 | if (args_info->zoffset_given) { | |
386 | if (args_info->zoffset_orig) { | |
387 | fprintf(outfile, "%s=\"%s\"\n", "zoffset", args_info->zoffset_orig); | |
# | Line 410 | 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 | + | } |
451 | if (args_info->gofr_given) { | |
452 | fprintf(outfile, "%s\n", "gofr"); | |
453 | } | |
# | Line 428 | Line 466 | cmdline_parser_file_save(const char *filename, struct | |
466 | if (args_info->p2_given) { | |
467 | fprintf(outfile, "%s\n", "p2"); | |
468 | } | |
469 | + | if (args_info->rp2_given) { |
470 | + | fprintf(outfile, "%s\n", "rp2"); |
471 | + | } |
472 | if (args_info->scd_given) { | |
473 | fprintf(outfile, "%s\n", "scd"); | |
474 | } | |
# | Line 440 | Line 481 | cmdline_parser_file_save(const char *filename, struct | |
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); | |
489 | ||
490 | i = EXIT_SUCCESS; | |
# | Line 478 | Line 523 | reset_group_staticProps(struct gengetopt_args_info *ar | |
523 | if (! args_info->staticProps_group_counter) | |
524 | return; | |
525 | ||
526 | + | args_info->bo_given = 0 ; |
527 | args_info->gofr_given = 0 ; | |
528 | args_info->r_theta_given = 0 ; | |
529 | args_info->r_omega_given = 0 ; | |
530 | args_info->theta_omega_given = 0 ; | |
531 | args_info->gxyz_given = 0 ; | |
532 | args_info->p2_given = 0 ; | |
533 | + | args_info->rp2_given = 0 ; |
534 | args_info->scd_given = 0 ; | |
535 | args_info->density_given = 0 ; | |
536 | args_info->slab_density_given = 0 ; | |
537 | < | args_info->hxy_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 565 | 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 580 | 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, 'l' }, |
635 | > | { "length", 1, NULL, 0 }, |
636 | > | { "rcut", 1, NULL, 'c' }, |
637 | { "zoffset", 1, NULL, 'z' }, | |
638 | { "sele1", 1, NULL, 0 }, | |
639 | { "sele2", 1, NULL, 0 }, | |
# | Line 591 | 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 | < | { "gofr", 0, NULL, 0 }, |
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 }, | |
650 | { "theta_omega", 0, NULL, 0 }, | |
651 | { "gxyz", 0, NULL, 0 }, | |
652 | < | { "p2", 0, NULL, 0 }, |
653 | < | { "scd", 0, NULL, 0 }, |
654 | < | { "density", 0, NULL, 0 }, |
652 | > | { "p2", 0, NULL, 'p' }, |
653 | > | { "rp2", 0, NULL, 0 }, |
654 | > | { "scd", 0, NULL, 's' }, |
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:a:l:z:", 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 677 | 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. */ | |
756 | if (local_args_info.nbins_x_given) | |
757 | { | |
758 | < | fprintf (stderr, "%s: `--nbins_x' (`-r') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
758 | > | fprintf (stderr, "%s: `--nbins_x' (`-x') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
759 | goto failure; | |
760 | } | |
761 | if (args_info->nbins_x_given && ! override) | |
# | Line 720 | Line 775 | cmdline_parser_internal (int argc, char * const *argv, | |
775 | case 'y': /* number of bins in y axis. */ | |
776 | if (local_args_info.nbins_y_given) | |
777 | { | |
778 | < | fprintf (stderr, "%s: `--nbins_y' (`-r') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
778 | > | fprintf (stderr, "%s: `--nbins_y' (`-y') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
779 | goto failure; | |
780 | } | |
781 | if (args_info->nbins_y_given && ! override) | |
# | Line 757 | Line 812 | cmdline_parser_internal (int argc, char * const *argv, | |
812 | args_info->nanglebins_orig = gengetopt_strdup (optarg); | |
813 | break; | |
814 | ||
815 | < | case 'l': /* maximum length (Defaults to 1/2 smallest length of first frame). */ |
816 | < | if (local_args_info.length_given) |
815 | > | case 'c': /* cutoff radius (rcut). */ |
816 | > | if (local_args_info.rcut_given) |
817 | { | |
818 | < | fprintf (stderr, "%s: `--length' (`-l') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
818 | > | fprintf (stderr, "%s: `--rcut' (`-c') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
819 | goto failure; | |
820 | } | |
821 | < | if (args_info->length_given && ! override) |
821 | > | if (args_info->rcut_given && ! override) |
822 | continue; | |
823 | < | local_args_info.length_given = 1; |
824 | < | args_info->length_given = 1; |
825 | < | args_info->length_arg = strtod (optarg, &stop_char); |
823 | > | local_args_info.rcut_given = 1; |
824 | > | args_info->rcut_given = 1; |
825 | > | args_info->rcut_arg = strtod (optarg, &stop_char); |
826 | if (!(stop_char && *stop_char == '\0')) { | |
827 | fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); | |
828 | goto failure; | |
829 | } | |
830 | < | if (args_info->length_orig) |
831 | < | free (args_info->length_orig); /* free previous string */ |
832 | < | args_info->length_orig = gengetopt_strdup (optarg); |
830 | > | if (args_info->rcut_orig) |
831 | > | free (args_info->rcut_orig); /* free previous string */ |
832 | > | args_info->rcut_orig = gengetopt_strdup (optarg); |
833 | break; | |
834 | ||
835 | case 'z': /* Where to set the zero for the slab_density calculation. */ | |
# | Line 795 | 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); | |
853 | + | break; |
854 | + | |
855 | + | case 'g': /* g(r). */ |
856 | + | if (local_args_info.gofr_given) |
857 | + | { |
858 | + | fprintf (stderr, "%s: `--gofr' (`-g') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
859 | + | goto failure; |
860 | + | } |
861 | + | if (args_info->gofr_given && ! override) |
862 | + | continue; |
863 | + | local_args_info.gofr_given = 1; |
864 | + | args_info->gofr_given = 1; |
865 | + | if (args_info->staticProps_group_counter && override) |
866 | + | reset_group_staticProps (args_info); |
867 | + | args_info->staticProps_group_counter += 1; |
868 | + | break; |
869 | + | |
870 | + | case 'p': /* p2 order parameter (--sele1 and --sele2 must be specified). */ |
871 | + | if (local_args_info.p2_given) |
872 | + | { |
873 | + | fprintf (stderr, "%s: `--p2' (`-p') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
874 | + | goto failure; |
875 | + | } |
876 | + | if (args_info->p2_given && ! override) |
877 | + | continue; |
878 | + | local_args_info.p2_given = 1; |
879 | + | args_info->p2_given = 1; |
880 | + | if (args_info->staticProps_group_counter && override) |
881 | + | reset_group_staticProps (args_info); |
882 | + | args_info->staticProps_group_counter += 1; |
883 | break; | |
884 | ||
885 | + | case 's': /* scd order parameter (either --sele1, --sele2, --sele3 are specified or --molname, --begin, --end are specified). */ |
886 | + | if (local_args_info.scd_given) |
887 | + | { |
888 | + | fprintf (stderr, "%s: `--scd' (`-s') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
889 | + | goto failure; |
890 | + | } |
891 | + | if (args_info->scd_given && ! override) |
892 | + | continue; |
893 | + | local_args_info.scd_given = 1; |
894 | + | args_info->scd_given = 1; |
895 | + | if (args_info->staticProps_group_counter && override) |
896 | + | reset_group_staticProps (args_info); |
897 | + | args_info->staticProps_group_counter += 1; |
898 | + | break; |
899 | ||
900 | + | case 'd': /* density plot. */ |
901 | + | if (local_args_info.density_given) |
902 | + | { |
903 | + | fprintf (stderr, "%s: `--density' (`-d') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
904 | + | goto failure; |
905 | + | } |
906 | + | if (args_info->density_given && ! override) |
907 | + | continue; |
908 | + | local_args_info.density_given = 1; |
909 | + | args_info->density_given = 1; |
910 | + | if (args_info->staticProps_group_counter && override) |
911 | + | reset_group_staticProps (args_info); |
912 | + | args_info->staticProps_group_counter += 1; |
913 | + | break; |
914 | + | |
915 | + | |
916 | case 0: /* Long option with no short option */ | |
917 | + | /* maximum length (Defaults to 1/2 smallest length of first frame). */ |
918 | + | if (strcmp (long_options[option_index].name, "length") == 0) |
919 | + | { |
920 | + | if (local_args_info.length_given) |
921 | + | { |
922 | + | fprintf (stderr, "%s: `--length' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
923 | + | goto failure; |
924 | + | } |
925 | + | if (args_info->length_given && ! override) |
926 | + | continue; |
927 | + | local_args_info.length_given = 1; |
928 | + | args_info->length_given = 1; |
929 | + | args_info->length_arg = strtod (optarg, &stop_char); |
930 | + | if (!(stop_char && *stop_char == '\0')) { |
931 | + | fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
932 | + | goto failure; |
933 | + | } |
934 | + | if (args_info->length_orig) |
935 | + | free (args_info->length_orig); /* free previous string */ |
936 | + | args_info->length_orig = gengetopt_strdup (optarg); |
937 | + | } |
938 | /* select the first stuntdouble set. */ | |
939 | < | if (strcmp (long_options[option_index].name, "sele1") == 0) |
939 | > | else if (strcmp (long_options[option_index].name, "sele1") == 0) |
940 | { | |
941 | if (local_args_info.sele1_given) | |
942 | { | |
# | Line 894 | Line 1030 | cmdline_parser_internal (int argc, char * const *argv, | |
1030 | free (args_info->molname_orig); /* free previous string */ | |
1031 | args_info->molname_orig = gengetopt_strdup (optarg); | |
1032 | } | |
1033 | < | /* begin interanl index. */ |
1033 | > | /* begin internal index. */ |
1034 | else if (strcmp (long_options[option_index].name, "begin") == 0) | |
1035 | { | |
1036 | if (local_args_info.begin_given) | |
# | Line 936 | Line 1072 | cmdline_parser_internal (int argc, char * const *argv, | |
1072 | free (args_info->end_orig); /* free previous string */ | |
1073 | args_info->end_orig = gengetopt_strdup (optarg); | |
1074 | } | |
1075 | < | /* g(r). */ |
1076 | < | else if (strcmp (long_options[option_index].name, "gofr") == 0) |
1075 | > | /* nanoparticle radius. */ |
1076 | > | else if (strcmp (long_options[option_index].name, "radius") == 0) |
1077 | { | |
1078 | < | if (local_args_info.gofr_given) |
1078 | > | if (local_args_info.radius_given) |
1079 | { | |
1080 | < | fprintf (stderr, "%s: `--gofr' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
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->gofr_given && ! override) |
1083 | > | if (args_info->radius_given && ! override) |
1084 | continue; | |
1085 | < | local_args_info.gofr_given = 1; |
1086 | < | args_info->gofr_given = 1; |
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; | |
# | Line 1021 | Line 1178 | cmdline_parser_internal (int argc, char * const *argv, | |
1178 | args_info->staticProps_group_counter += 1; | |
1179 | break; | |
1180 | } | |
1181 | < | /* p2 order parameter (--sele1 and --sele2 must be specified). */ |
1182 | < | else if (strcmp (long_options[option_index].name, "p2") == 0) |
1181 | > | /* rp2 order parameter (--sele1 and --sele2 must be specified). */ |
1182 | > | else if (strcmp (long_options[option_index].name, "rp2") == 0) |
1183 | { | |
1184 | < | if (local_args_info.p2_given) |
1184 | > | if (local_args_info.rp2_given) |
1185 | { | |
1186 | < | fprintf (stderr, "%s: `--p2' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1186 | > | fprintf (stderr, "%s: `--rp2' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1187 | goto failure; | |
1188 | } | |
1189 | < | if (args_info->p2_given && ! override) |
1189 | > | if (args_info->rp2_given && ! override) |
1190 | continue; | |
1191 | < | local_args_info.p2_given = 1; |
1192 | < | args_info->p2_given = 1; |
1191 | > | local_args_info.rp2_given = 1; |
1192 | > | args_info->rp2_given = 1; |
1193 | if (args_info->staticProps_group_counter && override) | |
1194 | reset_group_staticProps (args_info); | |
1195 | args_info->staticProps_group_counter += 1; | |
1196 | break; | |
1197 | } | |
1198 | < | /* scd order parameter(either --sele1, --sele2, --sele3 are specified or --molname, --begin, --end are specified). */ |
1042 | < | else if (strcmp (long_options[option_index].name, "scd") == 0) |
1043 | < | { |
1044 | < | if (local_args_info.scd_given) |
1045 | < | { |
1046 | < | fprintf (stderr, "%s: `--scd' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1047 | < | goto failure; |
1048 | < | } |
1049 | < | if (args_info->scd_given && ! override) |
1050 | < | continue; |
1051 | < | local_args_info.scd_given = 1; |
1052 | < | args_info->scd_given = 1; |
1053 | < | if (args_info->staticProps_group_counter && override) |
1054 | < | reset_group_staticProps (args_info); |
1055 | < | args_info->staticProps_group_counter += 1; |
1056 | < | break; |
1057 | < | } |
1058 | < | /* density plot (--sele1 must be specified). */ |
1059 | < | else if (strcmp (long_options[option_index].name, "density") == 0) |
1060 | < | { |
1061 | < | if (local_args_info.density_given) |
1062 | < | { |
1063 | < | fprintf (stderr, "%s: `--density' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1064 | < | goto failure; |
1065 | < | } |
1066 | < | if (args_info->density_given && ! override) |
1067 | < | continue; |
1068 | < | local_args_info.density_given = 1; |
1069 | < | args_info->density_given = 1; |
1070 | < | if (args_info->staticProps_group_counter && override) |
1071 | < | reset_group_staticProps (args_info); |
1072 | < | args_info->staticProps_group_counter += 1; |
1073 | < | break; |
1074 | < | } |
1075 | < | /* slab density (--sele1 must be specified). */ |
1198 | > | /* slab density. */ |
1199 | else if (strcmp (long_options[option_index].name, "slab_density") == 0) | |
1200 | { | |
1201 | if (local_args_info.slab_density_given) | |
# | Line 1089 | Line 1212 | cmdline_parser_internal (int argc, char * const *argv, | |
1212 | args_info->staticProps_group_counter += 1; | |
1213 | break; | |
1214 | } | |
1215 | < | /* hxy (--sele1 must be specified). */ |
1215 | > | /* hxy. */ |
1216 | else if (strcmp (long_options[option_index].name, "hxy") == 0) | |
1217 | { | |
1218 | if (local_args_info.hxy_given) | |
# | Line 1106 | 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 |