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 ; |
81 |
|
args_info->output_orig = NULL; |
82 |
|
args_info->step_arg = 1; |
83 |
|
args_info->step_orig = NULL; |
84 |
< |
args_info->nrbins_arg = 100; |
85 |
< |
args_info->nrbins_orig = NULL; |
84 |
> |
args_info->nbins_arg = 100; |
85 |
> |
args_info->nbins_orig = NULL; |
86 |
|
args_info->nbins_x_arg = 100; |
87 |
|
args_info->nbins_x_orig = NULL; |
88 |
|
args_info->nbins_y_arg = 100; |
90 |
|
args_info->nanglebins_arg = 50; |
91 |
|
args_info->nanglebins_orig = NULL; |
92 |
|
args_info->length_orig = NULL; |
94 |
– |
args_info->LegendreL_orig = NULL; |
93 |
|
args_info->rcut_orig = NULL; |
94 |
|
args_info->zoffset_arg = 0; |
95 |
|
args_info->zoffset_orig = NULL; |
124 |
|
printf("%s\n"," -i, --input=filename input dump file"); |
125 |
|
printf("%s\n"," -o, --output=filename output file name"); |
126 |
|
printf("%s\n"," -n, --step=INT process every n frame (default=`1')"); |
127 |
< |
printf("%s\n"," -r, --nrbins=INT number of bins for distance (default=`100')"); |
127 |
> |
printf("%s\n"," -b, --nbins=INT number of bins (general purpose) \n (default=`100')"); |
128 |
|
printf("%s\n"," -x, --nbins_x=INT number of bins in x axis (default=`100')"); |
129 |
|
printf("%s\n"," -y, --nbins_y=INT number of bins in y axis (default=`100')"); |
130 |
|
printf("%s\n"," -a, --nanglebins=INT number of bins for cos(angle) (default=`50')"); |
131 |
|
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)"); |
132 |
|
printf("%s\n"," -c, --rcut=DOUBLE cutoff radius (rcut)"); |
133 |
|
printf("%s\n"," -z, --zoffset=DOUBLE Where to set the zero for the slab_density \n calculation (default=`0')"); |
134 |
|
printf("%s\n"," --sele1=selection script select the first stuntdouble set"); |
139 |
|
printf("%s\n"," --begin=INT begin internal index"); |
140 |
|
printf("%s\n"," --end=INT end internal index"); |
141 |
|
printf("%s\n","\n Group: staticProps\n an option of this group is required"); |
142 |
< |
printf("%s\n"," -b, --bo bond order parameter (--rcut and --LegendreL \n must be specified"); |
142 |
> |
printf("%s\n"," --bo bond order parameter (--rcut must be specified"); |
143 |
|
printf("%s\n"," -g, --gofr g(r)"); |
144 |
|
printf("%s\n"," --r_theta g(r, cos(theta))"); |
145 |
|
printf("%s\n"," --r_omega g(r, cos(omega))"); |
190 |
|
free (args_info->step_orig); /* free previous argument */ |
191 |
|
args_info->step_orig = 0; |
192 |
|
} |
193 |
< |
if (args_info->nrbins_orig) |
193 |
> |
if (args_info->nbins_orig) |
194 |
|
{ |
195 |
< |
free (args_info->nrbins_orig); /* free previous argument */ |
196 |
< |
args_info->nrbins_orig = 0; |
195 |
> |
free (args_info->nbins_orig); /* free previous argument */ |
196 |
> |
args_info->nbins_orig = 0; |
197 |
|
} |
198 |
|
if (args_info->nbins_x_orig) |
199 |
|
{ |
215 |
|
free (args_info->length_orig); /* free previous argument */ |
216 |
|
args_info->length_orig = 0; |
217 |
|
} |
221 |
– |
if (args_info->LegendreL_orig) |
222 |
– |
{ |
223 |
– |
free (args_info->LegendreL_orig); /* free previous argument */ |
224 |
– |
args_info->LegendreL_orig = 0; |
225 |
– |
} |
218 |
|
if (args_info->rcut_orig) |
219 |
|
{ |
220 |
|
free (args_info->rcut_orig); /* free previous argument */ |
330 |
|
fprintf(outfile, "%s\n", "step"); |
331 |
|
} |
332 |
|
} |
333 |
< |
if (args_info->nrbins_given) { |
334 |
< |
if (args_info->nrbins_orig) { |
335 |
< |
fprintf(outfile, "%s=\"%s\"\n", "nrbins", args_info->nrbins_orig); |
333 |
> |
if (args_info->nbins_given) { |
334 |
> |
if (args_info->nbins_orig) { |
335 |
> |
fprintf(outfile, "%s=\"%s\"\n", "nbins", args_info->nbins_orig); |
336 |
|
} else { |
337 |
< |
fprintf(outfile, "%s\n", "nrbins"); |
337 |
> |
fprintf(outfile, "%s\n", "nbins"); |
338 |
|
} |
339 |
|
} |
340 |
|
if (args_info->nbins_x_given) { |
365 |
|
fprintf(outfile, "%s\n", "length"); |
366 |
|
} |
367 |
|
} |
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"); |
381 |
– |
} |
382 |
– |
} |
368 |
|
if (args_info->rcut_given) { |
369 |
|
if (args_info->rcut_orig) { |
370 |
|
fprintf(outfile, "%s=\"%s\"\n", "rcut", args_info->rcut_orig); |
607 |
|
{ "input", 1, NULL, 'i' }, |
608 |
|
{ "output", 1, NULL, 'o' }, |
609 |
|
{ "step", 1, NULL, 'n' }, |
610 |
< |
{ "nrbins", 1, NULL, 'r' }, |
610 |
> |
{ "nbins", 1, NULL, 'b' }, |
611 |
|
{ "nbins_x", 1, NULL, 'x' }, |
612 |
|
{ "nbins_y", 1, NULL, 'y' }, |
613 |
|
{ "nanglebins", 1, NULL, 'a' }, |
614 |
|
{ "length", 1, NULL, 0 }, |
630 |
– |
{ "LegendreL", 1, NULL, 'l' }, |
615 |
|
{ "rcut", 1, NULL, 'c' }, |
616 |
|
{ "zoffset", 1, NULL, 'z' }, |
617 |
|
{ "sele1", 1, NULL, 0 }, |
621 |
|
{ "molname", 1, NULL, 0 }, |
622 |
|
{ "begin", 1, NULL, 0 }, |
623 |
|
{ "end", 1, NULL, 0 }, |
624 |
< |
{ "bo", 0, NULL, 'b' }, |
624 |
> |
{ "bo", 0, NULL, 0 }, |
625 |
|
{ "gofr", 0, NULL, 'g' }, |
626 |
|
{ "r_theta", 0, NULL, 0 }, |
627 |
|
{ "r_omega", 0, NULL, 0 }, |
637 |
|
}; |
638 |
|
|
639 |
|
stop_char = 0; |
640 |
< |
c = getopt_long (argc, argv, "hVi:o:n:r:x:y:a:l:c:z:bgpsd", long_options, &option_index); |
640 |
> |
c = getopt_long (argc, argv, "hVi:o:n:b:x:y:a:c:z:gpsd", long_options, &option_index); |
641 |
|
|
642 |
|
if (c == -1) break; /* Exit from `while (1)' loop. */ |
643 |
|
|
709 |
|
args_info->step_orig = gengetopt_strdup (optarg); |
710 |
|
break; |
711 |
|
|
712 |
< |
case 'r': /* number of bins for distance. */ |
713 |
< |
if (local_args_info.nrbins_given) |
712 |
> |
case 'b': /* number of bins (general purpose). */ |
713 |
> |
if (local_args_info.nbins_given) |
714 |
|
{ |
715 |
< |
fprintf (stderr, "%s: `--nrbins' (`-r') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
715 |
> |
fprintf (stderr, "%s: `--nbins' (`-b') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
716 |
|
goto failure; |
717 |
|
} |
718 |
< |
if (args_info->nrbins_given && ! override) |
718 |
> |
if (args_info->nbins_given && ! override) |
719 |
|
continue; |
720 |
< |
local_args_info.nrbins_given = 1; |
721 |
< |
args_info->nrbins_given = 1; |
722 |
< |
args_info->nrbins_arg = strtol (optarg, &stop_char, 0); |
720 |
> |
local_args_info.nbins_given = 1; |
721 |
> |
args_info->nbins_given = 1; |
722 |
> |
args_info->nbins_arg = strtol (optarg, &stop_char, 0); |
723 |
|
if (!(stop_char && *stop_char == '\0')) { |
724 |
|
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
725 |
|
goto failure; |
726 |
|
} |
727 |
< |
if (args_info->nrbins_orig) |
728 |
< |
free (args_info->nrbins_orig); /* free previous string */ |
729 |
< |
args_info->nrbins_orig = gengetopt_strdup (optarg); |
727 |
> |
if (args_info->nbins_orig) |
728 |
> |
free (args_info->nbins_orig); /* free previous string */ |
729 |
> |
args_info->nbins_orig = gengetopt_strdup (optarg); |
730 |
|
break; |
731 |
|
|
732 |
|
case 'x': /* number of bins in x axis. */ |
789 |
|
args_info->nanglebins_orig = gengetopt_strdup (optarg); |
790 |
|
break; |
791 |
|
|
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 |
– |
|
792 |
|
case 'c': /* cutoff radius (rcut). */ |
793 |
|
if (local_args_info.rcut_given) |
794 |
|
{ |
827 |
|
if (args_info->zoffset_orig) |
828 |
|
free (args_info->zoffset_orig); /* free previous string */ |
829 |
|
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; |
830 |
|
break; |
831 |
|
|
832 |
|
case 'g': /* g(r). */ |
1048 |
|
if (args_info->end_orig) |
1049 |
|
free (args_info->end_orig); /* free previous string */ |
1050 |
|
args_info->end_orig = gengetopt_strdup (optarg); |
1051 |
+ |
} |
1052 |
+ |
/* bond order parameter (--rcut must be specified. */ |
1053 |
+ |
else if (strcmp (long_options[option_index].name, "bo") == 0) |
1054 |
+ |
{ |
1055 |
+ |
if (local_args_info.bo_given) |
1056 |
+ |
{ |
1057 |
+ |
fprintf (stderr, "%s: `--bo' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1058 |
+ |
goto failure; |
1059 |
+ |
} |
1060 |
+ |
if (args_info->bo_given && ! override) |
1061 |
+ |
continue; |
1062 |
+ |
local_args_info.bo_given = 1; |
1063 |
+ |
args_info->bo_given = 1; |
1064 |
+ |
if (args_info->staticProps_group_counter && override) |
1065 |
+ |
reset_group_staticProps (args_info); |
1066 |
+ |
args_info->staticProps_group_counter += 1; |
1067 |
+ |
break; |
1068 |
|
} |
1069 |
|
/* g(r, cos(theta)). */ |
1070 |
|
else if (strcmp (long_options[option_index].name, "r_theta") == 0) |