1 |
|
/* |
2 |
< |
File autogenerated by gengetopt version 2.22 |
2 |
> |
File autogenerated by gengetopt version 2.22.4 |
3 |
|
generated with the following command: |
4 |
< |
gengetopt -F StaticPropsCmd -u |
4 |
> |
gengetopt --file-name=StaticPropsCmd --unamed-opts |
5 |
|
|
6 |
|
The developers of gengetopt consider the fixed text that goes in all |
7 |
|
gengetopt output files to be in the public domain: |
17 |
|
#include <stdlib.h> |
18 |
|
#include <string.h> |
19 |
|
|
20 |
< |
#include "getopt.h" |
20 |
> |
#ifndef FIX_UNUSED |
21 |
> |
#define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */ |
22 |
> |
#endif |
23 |
|
|
24 |
+ |
#ifdef WIN32 |
25 |
+ |
#include "utils/wingetopt.h" |
26 |
+ |
#else |
27 |
+ |
#include <getopt.h> |
28 |
+ |
#endif |
29 |
+ |
|
30 |
|
#include "StaticPropsCmd.h" |
31 |
|
|
32 |
|
const char *gengetopt_args_info_purpose = ""; |
44 |
|
" -b, --nbins=INT number of bins (general purpose) \n (default=`100')", |
45 |
|
" -x, --nbins_x=INT number of bins in x axis (default=`100')", |
46 |
|
" -y, --nbins_y=INT number of bins in y axis (default=`100')", |
47 |
+ |
" --nbins_z=INT number of bins in z axis (default=`100')", |
48 |
|
" -a, --nanglebins=INT number of bins for cos(angle) (default=`50')", |
40 |
– |
" --length=DOUBLE maximum length (Defaults to 1/2 smallest length \n of first frame)", |
49 |
|
" -c, --rcut=DOUBLE cutoff radius (rcut)", |
50 |
+ |
" --dz=DOUBLE slab width (dz)", |
51 |
+ |
" --length=DOUBLE maximum length (Defaults to 1/2 smallest length \n of first frame)", |
52 |
+ |
" --zlength=DOUBLE maximum length (Defaults to 1/2 smallest length \n of first frame)", |
53 |
|
" -z, --zoffset=DOUBLE Where to set the zero for the slab_density \n calculation (default=`0')", |
54 |
|
" --sele1=selection script select the first stuntdouble set", |
55 |
|
" --sele2=selection script select the second stuntdouble set", |
56 |
|
" --sele3=selection script select the third stuntdouble set", |
57 |
|
" --refsele=selection script\n select reference (use and only use with --gxyz)", |
58 |
|
" --comsele=selection script\n select stunt doubles for center-of-mass \n reference point", |
59 |
+ |
" --seleoffset=INT global index offset for a second object (used \n to define a vector between sites in molecule)", |
60 |
|
" --molname=STRING molecule name", |
61 |
|
" --begin=INT begin internal index", |
62 |
|
" --end=INT end internal index", |
65 |
|
" --bo bond order parameter (--rcut must be specified)", |
66 |
|
" --bor bond order parameter as a function of radius \n (--rcut must be specified)", |
67 |
|
" --bad N(theta) bond angle density within (--rcut must \n be specified)", |
68 |
+ |
" --count count of molecules matching selection criteria \n (and associated statistics)", |
69 |
|
" -g, --gofr g(r)", |
70 |
|
" --gofz g(z)", |
71 |
|
" --r_theta g(r, cos(theta))", |
72 |
|
" --r_omega g(r, cos(omega))", |
73 |
+ |
" --r_z g(r, z)", |
74 |
|
" --theta_omega g(cos(theta), cos(omega))", |
75 |
|
" --gxyz g(x, y, z)", |
76 |
< |
" -p, --p2 p2 order parameter (--sele1 and --sele2 must be \n specified)", |
76 |
> |
" --twodgofr 2D g(r) (Slab width --dz must be specified)", |
77 |
> |
" -p, --p2 p2 order parameter (--sele1 must be specified, \n --sele2 is optional)", |
78 |
|
" --rp2 rp2 order parameter (--sele1 and --sele2 must \n be specified)", |
79 |
|
" -s, --scd scd order parameter (either --sele1, --sele2, \n --sele3 are specified or --molname, --begin, \n --end are specified)", |
80 |
|
" -d, --density density plot", |
82 |
|
" --p_angle p(cos(theta))", |
83 |
|
" --hxy hxy", |
84 |
|
" --rho_r rho of R", |
85 |
+ |
" --angle_r angle of R", |
86 |
|
" --hullvol hull volume of nanoparticle", |
87 |
+ |
" --rodlength length of nanorod", |
88 |
+ |
" -Q, --tet_param tetrahedrality order parameter (Qk)", |
89 |
+ |
" --tet_param_z spatially-resolved tetrahedrality order \n parameter Qk(z)", |
90 |
+ |
" --rnemdz slab-resolved RNEMD statistics (temperature, \n density, velocity)", |
91 |
+ |
" --rnemdr shell-resolved RNEMD statistics (temperature, \n density, angular velocity)", |
92 |
|
0 |
93 |
|
}; |
94 |
|
|
104 |
|
void clear_args (struct gengetopt_args_info *args_info); |
105 |
|
|
106 |
|
static int |
107 |
< |
cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info, |
107 |
> |
cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info, |
108 |
|
struct cmdline_parser_params *params, const char *additional_error); |
109 |
|
|
110 |
|
static int |
124 |
|
args_info->nbins_given = 0 ; |
125 |
|
args_info->nbins_x_given = 0 ; |
126 |
|
args_info->nbins_y_given = 0 ; |
127 |
+ |
args_info->nbins_z_given = 0 ; |
128 |
|
args_info->nanglebins_given = 0 ; |
107 |
– |
args_info->length_given = 0 ; |
129 |
|
args_info->rcut_given = 0 ; |
130 |
+ |
args_info->dz_given = 0 ; |
131 |
+ |
args_info->length_given = 0 ; |
132 |
+ |
args_info->zlength_given = 0 ; |
133 |
|
args_info->zoffset_given = 0 ; |
134 |
|
args_info->sele1_given = 0 ; |
135 |
|
args_info->sele2_given = 0 ; |
136 |
|
args_info->sele3_given = 0 ; |
137 |
|
args_info->refsele_given = 0 ; |
138 |
|
args_info->comsele_given = 0 ; |
139 |
+ |
args_info->seleoffset_given = 0 ; |
140 |
|
args_info->molname_given = 0 ; |
141 |
|
args_info->begin_given = 0 ; |
142 |
|
args_info->end_given = 0 ; |
144 |
|
args_info->bo_given = 0 ; |
145 |
|
args_info->bor_given = 0 ; |
146 |
|
args_info->bad_given = 0 ; |
147 |
+ |
args_info->count_given = 0 ; |
148 |
|
args_info->gofr_given = 0 ; |
149 |
|
args_info->gofz_given = 0 ; |
150 |
|
args_info->r_theta_given = 0 ; |
151 |
|
args_info->r_omega_given = 0 ; |
152 |
+ |
args_info->r_z_given = 0 ; |
153 |
|
args_info->theta_omega_given = 0 ; |
154 |
|
args_info->gxyz_given = 0 ; |
155 |
+ |
args_info->twodgofr_given = 0 ; |
156 |
|
args_info->p2_given = 0 ; |
157 |
|
args_info->rp2_given = 0 ; |
158 |
|
args_info->scd_given = 0 ; |
161 |
|
args_info->p_angle_given = 0 ; |
162 |
|
args_info->hxy_given = 0 ; |
163 |
|
args_info->rho_r_given = 0 ; |
164 |
+ |
args_info->angle_r_given = 0 ; |
165 |
|
args_info->hullvol_given = 0 ; |
166 |
+ |
args_info->rodlength_given = 0 ; |
167 |
+ |
args_info->tet_param_given = 0 ; |
168 |
+ |
args_info->tet_param_z_given = 0 ; |
169 |
+ |
args_info->rnemdz_given = 0 ; |
170 |
+ |
args_info->rnemdr_given = 0 ; |
171 |
|
args_info->staticProps_group_counter = 0 ; |
172 |
|
} |
173 |
|
|
174 |
|
static |
175 |
|
void clear_args (struct gengetopt_args_info *args_info) |
176 |
|
{ |
177 |
+ |
FIX_UNUSED (args_info); |
178 |
|
args_info->input_arg = NULL; |
179 |
|
args_info->input_orig = NULL; |
180 |
|
args_info->output_arg = NULL; |
187 |
|
args_info->nbins_x_orig = NULL; |
188 |
|
args_info->nbins_y_arg = 100; |
189 |
|
args_info->nbins_y_orig = NULL; |
190 |
+ |
args_info->nbins_z_arg = 100; |
191 |
+ |
args_info->nbins_z_orig = NULL; |
192 |
|
args_info->nanglebins_arg = 50; |
193 |
|
args_info->nanglebins_orig = NULL; |
157 |
– |
args_info->length_orig = NULL; |
194 |
|
args_info->rcut_orig = NULL; |
195 |
+ |
args_info->dz_orig = NULL; |
196 |
+ |
args_info->length_orig = NULL; |
197 |
+ |
args_info->zlength_orig = NULL; |
198 |
|
args_info->zoffset_arg = 0; |
199 |
|
args_info->zoffset_orig = NULL; |
200 |
|
args_info->sele1_arg = NULL; |
207 |
|
args_info->refsele_orig = NULL; |
208 |
|
args_info->comsele_arg = NULL; |
209 |
|
args_info->comsele_orig = NULL; |
210 |
+ |
args_info->seleoffset_orig = NULL; |
211 |
|
args_info->molname_arg = NULL; |
212 |
|
args_info->molname_orig = NULL; |
213 |
|
args_info->begin_orig = NULL; |
229 |
|
args_info->nbins_help = gengetopt_args_info_help[5] ; |
230 |
|
args_info->nbins_x_help = gengetopt_args_info_help[6] ; |
231 |
|
args_info->nbins_y_help = gengetopt_args_info_help[7] ; |
232 |
< |
args_info->nanglebins_help = gengetopt_args_info_help[8] ; |
233 |
< |
args_info->length_help = gengetopt_args_info_help[9] ; |
232 |
> |
args_info->nbins_z_help = gengetopt_args_info_help[8] ; |
233 |
> |
args_info->nanglebins_help = gengetopt_args_info_help[9] ; |
234 |
|
args_info->rcut_help = gengetopt_args_info_help[10] ; |
235 |
< |
args_info->zoffset_help = gengetopt_args_info_help[11] ; |
236 |
< |
args_info->sele1_help = gengetopt_args_info_help[12] ; |
237 |
< |
args_info->sele2_help = gengetopt_args_info_help[13] ; |
238 |
< |
args_info->sele3_help = gengetopt_args_info_help[14] ; |
239 |
< |
args_info->refsele_help = gengetopt_args_info_help[15] ; |
240 |
< |
args_info->comsele_help = gengetopt_args_info_help[16] ; |
241 |
< |
args_info->molname_help = gengetopt_args_info_help[17] ; |
242 |
< |
args_info->begin_help = gengetopt_args_info_help[18] ; |
243 |
< |
args_info->end_help = gengetopt_args_info_help[19] ; |
244 |
< |
args_info->radius_help = gengetopt_args_info_help[20] ; |
245 |
< |
args_info->bo_help = gengetopt_args_info_help[22] ; |
246 |
< |
args_info->bor_help = gengetopt_args_info_help[23] ; |
247 |
< |
args_info->bad_help = gengetopt_args_info_help[24] ; |
248 |
< |
args_info->gofr_help = gengetopt_args_info_help[25] ; |
249 |
< |
args_info->gofz_help = gengetopt_args_info_help[26] ; |
250 |
< |
args_info->r_theta_help = gengetopt_args_info_help[27] ; |
251 |
< |
args_info->r_omega_help = gengetopt_args_info_help[28] ; |
252 |
< |
args_info->theta_omega_help = gengetopt_args_info_help[29] ; |
253 |
< |
args_info->gxyz_help = gengetopt_args_info_help[30] ; |
254 |
< |
args_info->p2_help = gengetopt_args_info_help[31] ; |
255 |
< |
args_info->rp2_help = gengetopt_args_info_help[32] ; |
256 |
< |
args_info->scd_help = gengetopt_args_info_help[33] ; |
257 |
< |
args_info->density_help = gengetopt_args_info_help[34] ; |
258 |
< |
args_info->slab_density_help = gengetopt_args_info_help[35] ; |
259 |
< |
args_info->p_angle_help = gengetopt_args_info_help[36] ; |
260 |
< |
args_info->hxy_help = gengetopt_args_info_help[37] ; |
261 |
< |
args_info->rho_r_help = gengetopt_args_info_help[38] ; |
262 |
< |
args_info->hullvol_help = gengetopt_args_info_help[39] ; |
235 |
> |
args_info->dz_help = gengetopt_args_info_help[11] ; |
236 |
> |
args_info->length_help = gengetopt_args_info_help[12] ; |
237 |
> |
args_info->zlength_help = gengetopt_args_info_help[13] ; |
238 |
> |
args_info->zoffset_help = gengetopt_args_info_help[14] ; |
239 |
> |
args_info->sele1_help = gengetopt_args_info_help[15] ; |
240 |
> |
args_info->sele2_help = gengetopt_args_info_help[16] ; |
241 |
> |
args_info->sele3_help = gengetopt_args_info_help[17] ; |
242 |
> |
args_info->refsele_help = gengetopt_args_info_help[18] ; |
243 |
> |
args_info->comsele_help = gengetopt_args_info_help[19] ; |
244 |
> |
args_info->seleoffset_help = gengetopt_args_info_help[20] ; |
245 |
> |
args_info->molname_help = gengetopt_args_info_help[21] ; |
246 |
> |
args_info->begin_help = gengetopt_args_info_help[22] ; |
247 |
> |
args_info->end_help = gengetopt_args_info_help[23] ; |
248 |
> |
args_info->radius_help = gengetopt_args_info_help[24] ; |
249 |
> |
args_info->bo_help = gengetopt_args_info_help[26] ; |
250 |
> |
args_info->bor_help = gengetopt_args_info_help[27] ; |
251 |
> |
args_info->bad_help = gengetopt_args_info_help[28] ; |
252 |
> |
args_info->count_help = gengetopt_args_info_help[29] ; |
253 |
> |
args_info->gofr_help = gengetopt_args_info_help[30] ; |
254 |
> |
args_info->gofz_help = gengetopt_args_info_help[31] ; |
255 |
> |
args_info->r_theta_help = gengetopt_args_info_help[32] ; |
256 |
> |
args_info->r_omega_help = gengetopt_args_info_help[33] ; |
257 |
> |
args_info->r_z_help = gengetopt_args_info_help[34] ; |
258 |
> |
args_info->theta_omega_help = gengetopt_args_info_help[35] ; |
259 |
> |
args_info->gxyz_help = gengetopt_args_info_help[36] ; |
260 |
> |
args_info->twodgofr_help = gengetopt_args_info_help[37] ; |
261 |
> |
args_info->p2_help = gengetopt_args_info_help[38] ; |
262 |
> |
args_info->rp2_help = gengetopt_args_info_help[39] ; |
263 |
> |
args_info->scd_help = gengetopt_args_info_help[40] ; |
264 |
> |
args_info->density_help = gengetopt_args_info_help[41] ; |
265 |
> |
args_info->slab_density_help = gengetopt_args_info_help[42] ; |
266 |
> |
args_info->p_angle_help = gengetopt_args_info_help[43] ; |
267 |
> |
args_info->hxy_help = gengetopt_args_info_help[44] ; |
268 |
> |
args_info->rho_r_help = gengetopt_args_info_help[45] ; |
269 |
> |
args_info->angle_r_help = gengetopt_args_info_help[46] ; |
270 |
> |
args_info->hullvol_help = gengetopt_args_info_help[47] ; |
271 |
> |
args_info->rodlength_help = gengetopt_args_info_help[48] ; |
272 |
> |
args_info->tet_param_help = gengetopt_args_info_help[49] ; |
273 |
> |
args_info->tet_param_z_help = gengetopt_args_info_help[50] ; |
274 |
> |
args_info->rnemdz_help = gengetopt_args_info_help[51] ; |
275 |
> |
args_info->rnemdr_help = gengetopt_args_info_help[52] ; |
276 |
|
|
277 |
|
} |
278 |
|
|
279 |
|
void |
280 |
|
cmdline_parser_print_version (void) |
281 |
|
{ |
282 |
< |
printf ("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION); |
282 |
> |
printf ("%s %s\n", |
283 |
> |
(strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE), |
284 |
> |
CMDLINE_PARSER_VERSION); |
285 |
|
} |
286 |
|
|
287 |
|
static void print_help_common(void) { |
296 |
|
printf("\n"); |
297 |
|
|
298 |
|
if (strlen(gengetopt_args_info_description) > 0) |
299 |
< |
printf("%s\n", gengetopt_args_info_description); |
299 |
> |
printf("%s\n\n", gengetopt_args_info_description); |
300 |
|
} |
301 |
|
|
302 |
|
void |
315 |
|
clear_args (args_info); |
316 |
|
init_args_info (args_info); |
317 |
|
|
318 |
< |
args_info->inputs = NULL; |
318 |
> |
args_info->inputs = 0; |
319 |
|
args_info->inputs_num = 0; |
320 |
|
} |
321 |
|
|
364 |
|
free_string_field (&(args_info->nbins_orig)); |
365 |
|
free_string_field (&(args_info->nbins_x_orig)); |
366 |
|
free_string_field (&(args_info->nbins_y_orig)); |
367 |
+ |
free_string_field (&(args_info->nbins_z_orig)); |
368 |
|
free_string_field (&(args_info->nanglebins_orig)); |
313 |
– |
free_string_field (&(args_info->length_orig)); |
369 |
|
free_string_field (&(args_info->rcut_orig)); |
370 |
+ |
free_string_field (&(args_info->dz_orig)); |
371 |
+ |
free_string_field (&(args_info->length_orig)); |
372 |
+ |
free_string_field (&(args_info->zlength_orig)); |
373 |
|
free_string_field (&(args_info->zoffset_orig)); |
374 |
|
free_string_field (&(args_info->sele1_arg)); |
375 |
|
free_string_field (&(args_info->sele1_orig)); |
381 |
|
free_string_field (&(args_info->refsele_orig)); |
382 |
|
free_string_field (&(args_info->comsele_arg)); |
383 |
|
free_string_field (&(args_info->comsele_orig)); |
384 |
+ |
free_string_field (&(args_info->seleoffset_orig)); |
385 |
|
free_string_field (&(args_info->molname_arg)); |
386 |
|
free_string_field (&(args_info->molname_orig)); |
387 |
|
free_string_field (&(args_info->begin_orig)); |
400 |
|
|
401 |
|
|
402 |
|
static void |
403 |
< |
write_into_file(FILE *outfile, const char *opt, const char *arg, char *values[]) |
403 |
> |
write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[]) |
404 |
|
{ |
405 |
+ |
FIX_UNUSED (values); |
406 |
|
if (arg) { |
407 |
|
fprintf(outfile, "%s=\"%s\"\n", opt, arg); |
408 |
|
} else { |
438 |
|
write_into_file(outfile, "nbins_x", args_info->nbins_x_orig, 0); |
439 |
|
if (args_info->nbins_y_given) |
440 |
|
write_into_file(outfile, "nbins_y", args_info->nbins_y_orig, 0); |
441 |
+ |
if (args_info->nbins_z_given) |
442 |
+ |
write_into_file(outfile, "nbins_z", args_info->nbins_z_orig, 0); |
443 |
|
if (args_info->nanglebins_given) |
444 |
|
write_into_file(outfile, "nanglebins", args_info->nanglebins_orig, 0); |
383 |
– |
if (args_info->length_given) |
384 |
– |
write_into_file(outfile, "length", args_info->length_orig, 0); |
445 |
|
if (args_info->rcut_given) |
446 |
|
write_into_file(outfile, "rcut", args_info->rcut_orig, 0); |
447 |
+ |
if (args_info->dz_given) |
448 |
+ |
write_into_file(outfile, "dz", args_info->dz_orig, 0); |
449 |
+ |
if (args_info->length_given) |
450 |
+ |
write_into_file(outfile, "length", args_info->length_orig, 0); |
451 |
+ |
if (args_info->zlength_given) |
452 |
+ |
write_into_file(outfile, "zlength", args_info->zlength_orig, 0); |
453 |
|
if (args_info->zoffset_given) |
454 |
|
write_into_file(outfile, "zoffset", args_info->zoffset_orig, 0); |
455 |
|
if (args_info->sele1_given) |
462 |
|
write_into_file(outfile, "refsele", args_info->refsele_orig, 0); |
463 |
|
if (args_info->comsele_given) |
464 |
|
write_into_file(outfile, "comsele", args_info->comsele_orig, 0); |
465 |
+ |
if (args_info->seleoffset_given) |
466 |
+ |
write_into_file(outfile, "seleoffset", args_info->seleoffset_orig, 0); |
467 |
|
if (args_info->molname_given) |
468 |
|
write_into_file(outfile, "molname", args_info->molname_orig, 0); |
469 |
|
if (args_info->begin_given) |
478 |
|
write_into_file(outfile, "bor", 0, 0 ); |
479 |
|
if (args_info->bad_given) |
480 |
|
write_into_file(outfile, "bad", 0, 0 ); |
481 |
+ |
if (args_info->count_given) |
482 |
+ |
write_into_file(outfile, "count", 0, 0 ); |
483 |
|
if (args_info->gofr_given) |
484 |
|
write_into_file(outfile, "gofr", 0, 0 ); |
485 |
|
if (args_info->gofz_given) |
488 |
|
write_into_file(outfile, "r_theta", 0, 0 ); |
489 |
|
if (args_info->r_omega_given) |
490 |
|
write_into_file(outfile, "r_omega", 0, 0 ); |
491 |
+ |
if (args_info->r_z_given) |
492 |
+ |
write_into_file(outfile, "r_z", 0, 0 ); |
493 |
|
if (args_info->theta_omega_given) |
494 |
|
write_into_file(outfile, "theta_omega", 0, 0 ); |
495 |
|
if (args_info->gxyz_given) |
496 |
|
write_into_file(outfile, "gxyz", 0, 0 ); |
497 |
+ |
if (args_info->twodgofr_given) |
498 |
+ |
write_into_file(outfile, "twodgofr", 0, 0 ); |
499 |
|
if (args_info->p2_given) |
500 |
|
write_into_file(outfile, "p2", 0, 0 ); |
501 |
|
if (args_info->rp2_given) |
512 |
|
write_into_file(outfile, "hxy", 0, 0 ); |
513 |
|
if (args_info->rho_r_given) |
514 |
|
write_into_file(outfile, "rho_r", 0, 0 ); |
515 |
+ |
if (args_info->angle_r_given) |
516 |
+ |
write_into_file(outfile, "angle_r", 0, 0 ); |
517 |
|
if (args_info->hullvol_given) |
518 |
|
write_into_file(outfile, "hullvol", 0, 0 ); |
519 |
+ |
if (args_info->rodlength_given) |
520 |
+ |
write_into_file(outfile, "rodlength", 0, 0 ); |
521 |
+ |
if (args_info->tet_param_given) |
522 |
+ |
write_into_file(outfile, "tet_param", 0, 0 ); |
523 |
+ |
if (args_info->tet_param_z_given) |
524 |
+ |
write_into_file(outfile, "tet_param_z", 0, 0 ); |
525 |
+ |
if (args_info->rnemdz_given) |
526 |
+ |
write_into_file(outfile, "rnemdz", 0, 0 ); |
527 |
+ |
if (args_info->rnemdr_given) |
528 |
+ |
write_into_file(outfile, "rnemdr", 0, 0 ); |
529 |
|
|
530 |
|
|
531 |
|
i = EXIT_SUCCESS; |
562 |
|
char * |
563 |
|
gengetopt_strdup (const char *s) |
564 |
|
{ |
565 |
< |
char *result = NULL; |
565 |
> |
char *result = 0; |
566 |
|
if (!s) |
567 |
|
return result; |
568 |
|
|
582 |
|
args_info->bo_given = 0 ; |
583 |
|
args_info->bor_given = 0 ; |
584 |
|
args_info->bad_given = 0 ; |
585 |
+ |
args_info->count_given = 0 ; |
586 |
|
args_info->gofr_given = 0 ; |
587 |
|
args_info->gofz_given = 0 ; |
588 |
|
args_info->r_theta_given = 0 ; |
589 |
|
args_info->r_omega_given = 0 ; |
590 |
+ |
args_info->r_z_given = 0 ; |
591 |
|
args_info->theta_omega_given = 0 ; |
592 |
|
args_info->gxyz_given = 0 ; |
593 |
+ |
args_info->twodgofr_given = 0 ; |
594 |
|
args_info->p2_given = 0 ; |
595 |
|
args_info->rp2_given = 0 ; |
596 |
|
args_info->scd_given = 0 ; |
599 |
|
args_info->p_angle_given = 0 ; |
600 |
|
args_info->hxy_given = 0 ; |
601 |
|
args_info->rho_r_given = 0 ; |
602 |
+ |
args_info->angle_r_given = 0 ; |
603 |
|
args_info->hullvol_given = 0 ; |
604 |
+ |
args_info->rodlength_given = 0 ; |
605 |
+ |
args_info->tet_param_given = 0 ; |
606 |
+ |
args_info->tet_param_z_given = 0 ; |
607 |
+ |
args_info->rnemdz_given = 0 ; |
608 |
+ |
args_info->rnemdr_given = 0 ; |
609 |
|
|
610 |
|
args_info->staticProps_group_counter = 0; |
611 |
|
} |
612 |
|
|
613 |
|
int |
614 |
< |
cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_info) |
614 |
> |
cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info) |
615 |
|
{ |
616 |
|
return cmdline_parser2 (argc, argv, args_info, 0, 1, 1); |
617 |
|
} |
618 |
|
|
619 |
|
int |
620 |
< |
cmdline_parser_ext (int argc, char * const *argv, struct gengetopt_args_info *args_info, |
620 |
> |
cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, |
621 |
|
struct cmdline_parser_params *params) |
622 |
|
{ |
623 |
|
int result; |
624 |
< |
result = cmdline_parser_internal (argc, argv, args_info, params, NULL); |
624 |
> |
result = cmdline_parser_internal (argc, argv, args_info, params, 0); |
625 |
|
|
626 |
|
if (result == EXIT_FAILURE) |
627 |
|
{ |
633 |
|
} |
634 |
|
|
635 |
|
int |
636 |
< |
cmdline_parser2 (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) |
636 |
> |
cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) |
637 |
|
{ |
638 |
|
int result; |
639 |
|
struct cmdline_parser_params params; |
644 |
|
params.check_ambiguity = 0; |
645 |
|
params.print_errors = 1; |
646 |
|
|
647 |
< |
result = cmdline_parser_internal (argc, argv, args_info, ¶ms, NULL); |
647 |
> |
result = cmdline_parser_internal (argc, argv, args_info, ¶ms, 0); |
648 |
|
|
649 |
|
if (result == EXIT_FAILURE) |
650 |
|
{ |
660 |
|
{ |
661 |
|
int result = EXIT_SUCCESS; |
662 |
|
|
663 |
< |
if (cmdline_parser_required2(args_info, prog_name, NULL) > 0) |
663 |
> |
if (cmdline_parser_required2(args_info, prog_name, 0) > 0) |
664 |
|
result = EXIT_FAILURE; |
665 |
|
|
666 |
|
if (result == EXIT_FAILURE) |
676 |
|
cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error) |
677 |
|
{ |
678 |
|
int error = 0; |
679 |
+ |
FIX_UNUSED (additional_error); |
680 |
|
|
681 |
|
/* checks for required options */ |
682 |
|
if (! args_info->input_given) |
687 |
|
|
688 |
|
if (args_info->staticProps_group_counter == 0) |
689 |
|
{ |
690 |
< |
fprintf (stderr, "%s: %d options of group staticProps were given. One is required.%s\n", prog_name, args_info->staticProps_group_counter, (additional_error ? additional_error : "")); |
690 |
> |
fprintf (stderr, "%s: %d options of group staticProps were given. One is required%s.\n", prog_name, args_info->staticProps_group_counter, (additional_error ? additional_error : "")); |
691 |
|
error = 1; |
692 |
|
} |
693 |
|
|
721 |
|
static |
722 |
|
int update_arg(void *field, char **orig_field, |
723 |
|
unsigned int *field_given, unsigned int *prev_given, |
724 |
< |
char *value, char *possible_values[], const char *default_value, |
724 |
> |
char *value, const char *possible_values[], |
725 |
> |
const char *default_value, |
726 |
|
cmdline_parser_arg_type arg_type, |
727 |
|
int check_ambiguity, int override, |
728 |
|
int no_free, int multiple_option, |
733 |
|
const char *val = value; |
734 |
|
int found; |
735 |
|
char **string_field; |
736 |
+ |
FIX_UNUSED (field); |
737 |
|
|
738 |
|
stop_char = 0; |
739 |
|
found = 0; |
751 |
|
return 1; /* failure */ |
752 |
|
} |
753 |
|
|
754 |
+ |
FIX_UNUSED (default_value); |
755 |
|
|
756 |
|
if (field_given && *field_given && ! override) |
757 |
|
return 0; |
815 |
|
|
816 |
|
|
817 |
|
int |
818 |
< |
cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info, |
818 |
> |
cmdline_parser_internal ( |
819 |
> |
int argc, char **argv, struct gengetopt_args_info *args_info, |
820 |
|
struct cmdline_parser_params *params, const char *additional_error) |
821 |
|
{ |
822 |
|
int c; /* Character of the parsed option. */ |
859 |
|
{ "nbins", 1, NULL, 'b' }, |
860 |
|
{ "nbins_x", 1, NULL, 'x' }, |
861 |
|
{ "nbins_y", 1, NULL, 'y' }, |
862 |
+ |
{ "nbins_z", 1, NULL, 0 }, |
863 |
|
{ "nanglebins", 1, NULL, 'a' }, |
763 |
– |
{ "length", 1, NULL, 0 }, |
864 |
|
{ "rcut", 1, NULL, 'c' }, |
865 |
+ |
{ "dz", 1, NULL, 0 }, |
866 |
+ |
{ "length", 1, NULL, 0 }, |
867 |
+ |
{ "zlength", 1, NULL, 0 }, |
868 |
|
{ "zoffset", 1, NULL, 'z' }, |
869 |
|
{ "sele1", 1, NULL, 0 }, |
870 |
|
{ "sele2", 1, NULL, 0 }, |
871 |
|
{ "sele3", 1, NULL, 0 }, |
872 |
|
{ "refsele", 1, NULL, 0 }, |
873 |
|
{ "comsele", 1, NULL, 0 }, |
874 |
+ |
{ "seleoffset", 1, NULL, 0 }, |
875 |
|
{ "molname", 1, NULL, 0 }, |
876 |
|
{ "begin", 1, NULL, 0 }, |
877 |
|
{ "end", 1, NULL, 0 }, |
879 |
|
{ "bo", 0, NULL, 0 }, |
880 |
|
{ "bor", 0, NULL, 0 }, |
881 |
|
{ "bad", 0, NULL, 0 }, |
882 |
+ |
{ "count", 0, NULL, 0 }, |
883 |
|
{ "gofr", 0, NULL, 'g' }, |
884 |
|
{ "gofz", 0, NULL, 0 }, |
885 |
|
{ "r_theta", 0, NULL, 0 }, |
886 |
|
{ "r_omega", 0, NULL, 0 }, |
887 |
+ |
{ "r_z", 0, NULL, 0 }, |
888 |
|
{ "theta_omega", 0, NULL, 0 }, |
889 |
|
{ "gxyz", 0, NULL, 0 }, |
890 |
+ |
{ "twodgofr", 0, NULL, 0 }, |
891 |
|
{ "p2", 0, NULL, 'p' }, |
892 |
|
{ "rp2", 0, NULL, 0 }, |
893 |
|
{ "scd", 0, NULL, 's' }, |
896 |
|
{ "p_angle", 0, NULL, 0 }, |
897 |
|
{ "hxy", 0, NULL, 0 }, |
898 |
|
{ "rho_r", 0, NULL, 0 }, |
899 |
+ |
{ "angle_r", 0, NULL, 0 }, |
900 |
|
{ "hullvol", 0, NULL, 0 }, |
901 |
< |
{ NULL, 0, NULL, 0 } |
901 |
> |
{ "rodlength", 0, NULL, 0 }, |
902 |
> |
{ "tet_param", 0, NULL, 'Q' }, |
903 |
> |
{ "tet_param_z", 0, NULL, 0 }, |
904 |
> |
{ "rnemdz", 0, NULL, 0 }, |
905 |
> |
{ "rnemdr", 0, NULL, 0 }, |
906 |
> |
{ 0, 0, 0, 0 } |
907 |
|
}; |
908 |
|
|
909 |
< |
c = getopt_long (argc, argv, "hVi:o:n:b:x:y:a:c:z:gpsd", long_options, &option_index); |
909 |
> |
c = getopt_long (argc, argv, "hVi:o:n:b:x:y:a:c:z:gpsdQ", long_options, &option_index); |
910 |
|
|
911 |
|
if (c == -1) break; /* Exit from `while (1)' loop. */ |
912 |
|
|
1045 |
|
goto failure; |
1046 |
|
|
1047 |
|
break; |
1048 |
< |
case 'p': /* p2 order parameter (--sele1 and --sele2 must be specified). */ |
1048 |
> |
case 'p': /* p2 order parameter (--sele1 must be specified, --sele2 is optional). */ |
1049 |
|
|
1050 |
|
if (args_info->staticProps_group_counter && override) |
1051 |
|
reset_group_staticProps (args_info); |
1090 |
|
goto failure; |
1091 |
|
|
1092 |
|
break; |
1093 |
+ |
case 'Q': /* tetrahedrality order parameter (Qk). */ |
1094 |
+ |
|
1095 |
+ |
if (args_info->staticProps_group_counter && override) |
1096 |
+ |
reset_group_staticProps (args_info); |
1097 |
+ |
args_info->staticProps_group_counter += 1; |
1098 |
+ |
|
1099 |
+ |
if (update_arg( 0 , |
1100 |
+ |
0 , &(args_info->tet_param_given), |
1101 |
+ |
&(local_args_info.tet_param_given), optarg, 0, 0, ARG_NO, |
1102 |
+ |
check_ambiguity, override, 0, 0, |
1103 |
+ |
"tet_param", 'Q', |
1104 |
+ |
additional_error)) |
1105 |
+ |
goto failure; |
1106 |
+ |
|
1107 |
+ |
break; |
1108 |
|
|
1109 |
|
case 0: /* Long option with no short option */ |
1110 |
+ |
/* number of bins in z axis. */ |
1111 |
+ |
if (strcmp (long_options[option_index].name, "nbins_z") == 0) |
1112 |
+ |
{ |
1113 |
+ |
|
1114 |
+ |
|
1115 |
+ |
if (update_arg( (void *)&(args_info->nbins_z_arg), |
1116 |
+ |
&(args_info->nbins_z_orig), &(args_info->nbins_z_given), |
1117 |
+ |
&(local_args_info.nbins_z_given), optarg, 0, "100", ARG_INT, |
1118 |
+ |
check_ambiguity, override, 0, 0, |
1119 |
+ |
"nbins_z", '-', |
1120 |
+ |
additional_error)) |
1121 |
+ |
goto failure; |
1122 |
+ |
|
1123 |
+ |
} |
1124 |
+ |
/* slab width (dz). */ |
1125 |
+ |
else if (strcmp (long_options[option_index].name, "dz") == 0) |
1126 |
+ |
{ |
1127 |
+ |
|
1128 |
+ |
|
1129 |
+ |
if (update_arg( (void *)&(args_info->dz_arg), |
1130 |
+ |
&(args_info->dz_orig), &(args_info->dz_given), |
1131 |
+ |
&(local_args_info.dz_given), optarg, 0, 0, ARG_DOUBLE, |
1132 |
+ |
check_ambiguity, override, 0, 0, |
1133 |
+ |
"dz", '-', |
1134 |
+ |
additional_error)) |
1135 |
+ |
goto failure; |
1136 |
+ |
|
1137 |
+ |
} |
1138 |
|
/* maximum length (Defaults to 1/2 smallest length of first frame). */ |
1139 |
< |
if (strcmp (long_options[option_index].name, "length") == 0) |
1139 |
> |
else if (strcmp (long_options[option_index].name, "length") == 0) |
1140 |
|
{ |
1141 |
|
|
1142 |
|
|
1145 |
|
&(local_args_info.length_given), optarg, 0, 0, ARG_DOUBLE, |
1146 |
|
check_ambiguity, override, 0, 0, |
1147 |
|
"length", '-', |
1148 |
+ |
additional_error)) |
1149 |
+ |
goto failure; |
1150 |
+ |
|
1151 |
+ |
} |
1152 |
+ |
/* maximum length (Defaults to 1/2 smallest length of first frame). */ |
1153 |
+ |
else if (strcmp (long_options[option_index].name, "zlength") == 0) |
1154 |
+ |
{ |
1155 |
+ |
|
1156 |
+ |
|
1157 |
+ |
if (update_arg( (void *)&(args_info->zlength_arg), |
1158 |
+ |
&(args_info->zlength_orig), &(args_info->zlength_given), |
1159 |
+ |
&(local_args_info.zlength_given), optarg, 0, 0, ARG_DOUBLE, |
1160 |
+ |
check_ambiguity, override, 0, 0, |
1161 |
+ |
"zlength", '-', |
1162 |
|
additional_error)) |
1163 |
|
goto failure; |
1164 |
|
|
1233 |
|
goto failure; |
1234 |
|
|
1235 |
|
} |
1236 |
+ |
/* global index offset for a second object (used to define a vector between sites in molecule). */ |
1237 |
+ |
else if (strcmp (long_options[option_index].name, "seleoffset") == 0) |
1238 |
+ |
{ |
1239 |
+ |
|
1240 |
+ |
|
1241 |
+ |
if (update_arg( (void *)&(args_info->seleoffset_arg), |
1242 |
+ |
&(args_info->seleoffset_orig), &(args_info->seleoffset_given), |
1243 |
+ |
&(local_args_info.seleoffset_given), optarg, 0, 0, ARG_INT, |
1244 |
+ |
check_ambiguity, override, 0, 0, |
1245 |
+ |
"seleoffset", '-', |
1246 |
+ |
additional_error)) |
1247 |
+ |
goto failure; |
1248 |
+ |
|
1249 |
+ |
} |
1250 |
|
/* molecule name. */ |
1251 |
|
else if (strcmp (long_options[option_index].name, "molname") == 0) |
1252 |
|
{ |
1354 |
|
goto failure; |
1355 |
|
|
1356 |
|
} |
1357 |
+ |
/* count of molecules matching selection criteria (and associated statistics). */ |
1358 |
+ |
else if (strcmp (long_options[option_index].name, "count") == 0) |
1359 |
+ |
{ |
1360 |
+ |
|
1361 |
+ |
if (args_info->staticProps_group_counter && override) |
1362 |
+ |
reset_group_staticProps (args_info); |
1363 |
+ |
args_info->staticProps_group_counter += 1; |
1364 |
+ |
|
1365 |
+ |
if (update_arg( 0 , |
1366 |
+ |
0 , &(args_info->count_given), |
1367 |
+ |
&(local_args_info.count_given), optarg, 0, 0, ARG_NO, |
1368 |
+ |
check_ambiguity, override, 0, 0, |
1369 |
+ |
"count", '-', |
1370 |
+ |
additional_error)) |
1371 |
+ |
goto failure; |
1372 |
+ |
|
1373 |
+ |
} |
1374 |
|
/* g(z). */ |
1375 |
|
else if (strcmp (long_options[option_index].name, "gofz") == 0) |
1376 |
|
{ |
1418 |
|
&(local_args_info.r_omega_given), optarg, 0, 0, ARG_NO, |
1419 |
|
check_ambiguity, override, 0, 0, |
1420 |
|
"r_omega", '-', |
1421 |
+ |
additional_error)) |
1422 |
+ |
goto failure; |
1423 |
+ |
|
1424 |
+ |
} |
1425 |
+ |
/* g(r, z). */ |
1426 |
+ |
else if (strcmp (long_options[option_index].name, "r_z") == 0) |
1427 |
+ |
{ |
1428 |
+ |
|
1429 |
+ |
if (args_info->staticProps_group_counter && override) |
1430 |
+ |
reset_group_staticProps (args_info); |
1431 |
+ |
args_info->staticProps_group_counter += 1; |
1432 |
+ |
|
1433 |
+ |
if (update_arg( 0 , |
1434 |
+ |
0 , &(args_info->r_z_given), |
1435 |
+ |
&(local_args_info.r_z_given), optarg, 0, 0, ARG_NO, |
1436 |
+ |
check_ambiguity, override, 0, 0, |
1437 |
+ |
"r_z", '-', |
1438 |
|
additional_error)) |
1439 |
|
goto failure; |
1440 |
|
|
1473 |
|
goto failure; |
1474 |
|
|
1475 |
|
} |
1476 |
+ |
/* 2D g(r) (Slab width --dz must be specified). */ |
1477 |
+ |
else if (strcmp (long_options[option_index].name, "twodgofr") == 0) |
1478 |
+ |
{ |
1479 |
+ |
|
1480 |
+ |
if (args_info->staticProps_group_counter && override) |
1481 |
+ |
reset_group_staticProps (args_info); |
1482 |
+ |
args_info->staticProps_group_counter += 1; |
1483 |
+ |
|
1484 |
+ |
if (update_arg( 0 , |
1485 |
+ |
0 , &(args_info->twodgofr_given), |
1486 |
+ |
&(local_args_info.twodgofr_given), optarg, 0, 0, ARG_NO, |
1487 |
+ |
check_ambiguity, override, 0, 0, |
1488 |
+ |
"twodgofr", '-', |
1489 |
+ |
additional_error)) |
1490 |
+ |
goto failure; |
1491 |
+ |
|
1492 |
+ |
} |
1493 |
|
/* rp2 order parameter (--sele1 and --sele2 must be specified). */ |
1494 |
|
else if (strcmp (long_options[option_index].name, "rp2") == 0) |
1495 |
|
{ |
1575 |
|
goto failure; |
1576 |
|
|
1577 |
|
} |
1578 |
+ |
/* angle of R. */ |
1579 |
+ |
else if (strcmp (long_options[option_index].name, "angle_r") == 0) |
1580 |
+ |
{ |
1581 |
+ |
|
1582 |
+ |
if (args_info->staticProps_group_counter && override) |
1583 |
+ |
reset_group_staticProps (args_info); |
1584 |
+ |
args_info->staticProps_group_counter += 1; |
1585 |
+ |
|
1586 |
+ |
if (update_arg( 0 , |
1587 |
+ |
0 , &(args_info->angle_r_given), |
1588 |
+ |
&(local_args_info.angle_r_given), optarg, 0, 0, ARG_NO, |
1589 |
+ |
check_ambiguity, override, 0, 0, |
1590 |
+ |
"angle_r", '-', |
1591 |
+ |
additional_error)) |
1592 |
+ |
goto failure; |
1593 |
+ |
|
1594 |
+ |
} |
1595 |
|
/* hull volume of nanoparticle. */ |
1596 |
|
else if (strcmp (long_options[option_index].name, "hullvol") == 0) |
1597 |
|
{ |
1609 |
|
goto failure; |
1610 |
|
|
1611 |
|
} |
1612 |
+ |
/* length of nanorod. */ |
1613 |
+ |
else if (strcmp (long_options[option_index].name, "rodlength") == 0) |
1614 |
+ |
{ |
1615 |
|
|
1616 |
+ |
if (args_info->staticProps_group_counter && override) |
1617 |
+ |
reset_group_staticProps (args_info); |
1618 |
+ |
args_info->staticProps_group_counter += 1; |
1619 |
+ |
|
1620 |
+ |
if (update_arg( 0 , |
1621 |
+ |
0 , &(args_info->rodlength_given), |
1622 |
+ |
&(local_args_info.rodlength_given), optarg, 0, 0, ARG_NO, |
1623 |
+ |
check_ambiguity, override, 0, 0, |
1624 |
+ |
"rodlength", '-', |
1625 |
+ |
additional_error)) |
1626 |
+ |
goto failure; |
1627 |
+ |
|
1628 |
+ |
} |
1629 |
+ |
/* spatially-resolved tetrahedrality order parameter Qk(z). */ |
1630 |
+ |
else if (strcmp (long_options[option_index].name, "tet_param_z") == 0) |
1631 |
+ |
{ |
1632 |
+ |
|
1633 |
+ |
if (args_info->staticProps_group_counter && override) |
1634 |
+ |
reset_group_staticProps (args_info); |
1635 |
+ |
args_info->staticProps_group_counter += 1; |
1636 |
+ |
|
1637 |
+ |
if (update_arg( 0 , |
1638 |
+ |
0 , &(args_info->tet_param_z_given), |
1639 |
+ |
&(local_args_info.tet_param_z_given), optarg, 0, 0, ARG_NO, |
1640 |
+ |
check_ambiguity, override, 0, 0, |
1641 |
+ |
"tet_param_z", '-', |
1642 |
+ |
additional_error)) |
1643 |
+ |
goto failure; |
1644 |
+ |
|
1645 |
+ |
} |
1646 |
+ |
/* slab-resolved RNEMD statistics (temperature, density, velocity). */ |
1647 |
+ |
else if (strcmp (long_options[option_index].name, "rnemdz") == 0) |
1648 |
+ |
{ |
1649 |
+ |
|
1650 |
+ |
if (args_info->staticProps_group_counter && override) |
1651 |
+ |
reset_group_staticProps (args_info); |
1652 |
+ |
args_info->staticProps_group_counter += 1; |
1653 |
+ |
|
1654 |
+ |
if (update_arg( 0 , |
1655 |
+ |
0 , &(args_info->rnemdz_given), |
1656 |
+ |
&(local_args_info.rnemdz_given), optarg, 0, 0, ARG_NO, |
1657 |
+ |
check_ambiguity, override, 0, 0, |
1658 |
+ |
"rnemdz", '-', |
1659 |
+ |
additional_error)) |
1660 |
+ |
goto failure; |
1661 |
+ |
|
1662 |
+ |
} |
1663 |
+ |
/* shell-resolved RNEMD statistics (temperature, density, angular velocity). */ |
1664 |
+ |
else if (strcmp (long_options[option_index].name, "rnemdr") == 0) |
1665 |
+ |
{ |
1666 |
+ |
|
1667 |
+ |
if (args_info->staticProps_group_counter && override) |
1668 |
+ |
reset_group_staticProps (args_info); |
1669 |
+ |
args_info->staticProps_group_counter += 1; |
1670 |
+ |
|
1671 |
+ |
if (update_arg( 0 , |
1672 |
+ |
0 , &(args_info->rnemdr_given), |
1673 |
+ |
&(local_args_info.rnemdr_given), optarg, 0, 0, ARG_NO, |
1674 |
+ |
check_ambiguity, override, 0, 0, |
1675 |
+ |
"rnemdr", '-', |
1676 |
+ |
additional_error)) |
1677 |
+ |
goto failure; |
1678 |
+ |
|
1679 |
+ |
} |
1680 |
+ |
|
1681 |
|
break; |
1682 |
|
case '?': /* Invalid option. */ |
1683 |
|
/* `getopt_long' already printed an error message. */ |
1691 |
|
|
1692 |
|
if (args_info->staticProps_group_counter > 1) |
1693 |
|
{ |
1694 |
< |
fprintf (stderr, "%s: %d options of group staticProps were given. One is required.%s\n", argv[0], args_info->staticProps_group_counter, (additional_error ? additional_error : "")); |
1694 |
> |
fprintf (stderr, "%s: %d options of group staticProps were given. One is required%s.\n", argv[0], args_info->staticProps_group_counter, (additional_error ? additional_error : "")); |
1695 |
|
error = 1; |
1696 |
|
} |
1697 |
|
|