1 |
|
/* |
2 |
|
File autogenerated by gengetopt version 2.22 |
3 |
|
generated with the following command: |
4 |
< |
gengetopt -F StaticPropsCmd |
4 |
> |
gengetopt -F StaticPropsCmd -u |
5 |
|
|
6 |
|
The developers of gengetopt consider the fixed text that goes in all |
7 |
|
gengetopt output files to be in the public domain: |
23 |
|
|
24 |
|
const char *gengetopt_args_info_purpose = ""; |
25 |
|
|
26 |
< |
const char *gengetopt_args_info_usage = "Usage: StaticProps [OPTIONS]..."; |
26 |
> |
const char *gengetopt_args_info_usage = "Usage: StaticProps [OPTIONS]... [FILES]..."; |
27 |
|
|
28 |
|
const char *gengetopt_args_info_description = ""; |
29 |
|
|
39 |
|
" --nbins_z=INT number of bins in z axis (default=`100')", |
40 |
|
" -a, --nanglebins=INT number of bins for cos(angle) (default=`50')", |
41 |
|
" -c, --rcut=DOUBLE cutoff radius (rcut)", |
42 |
+ |
" --dz=DOUBLE slab width (dz)", |
43 |
|
" --length=DOUBLE maximum length (Defaults to 1/2 smallest length \n of first frame)", |
44 |
|
" --zlength=DOUBLE maximum length (Defaults to 1/2 smallest length \n of first frame)", |
45 |
|
" -z, --zoffset=DOUBLE Where to set the zero for the slab_density \n calculation (default=`0')", |
56 |
|
" --bo bond order parameter (--rcut must be specified)", |
57 |
|
" --bor bond order parameter as a function of radius \n (--rcut must be specified)", |
58 |
|
" --bad N(theta) bond angle density within (--rcut must \n be specified)", |
59 |
+ |
" --count count of molecules matching selection criteria \n (and associated statistics)", |
60 |
|
" -g, --gofr g(r)", |
61 |
|
" --gofz g(z)", |
62 |
|
" --r_theta g(r, cos(theta))", |
64 |
|
" --r_z g(r, z)", |
65 |
|
" --theta_omega g(cos(theta), cos(omega))", |
66 |
|
" --gxyz g(x, y, z)", |
67 |
+ |
" --twodgofr 2D g(r) (Slab width --dz must be specified)", |
68 |
|
" -p, --p2 p2 order parameter (--sele1 and --sele2 must be \n specified)", |
69 |
|
" --rp2 rp2 order parameter (--sele1 and --sele2 must \n be specified)", |
70 |
|
" -s, --scd scd order parameter (either --sele1, --sele2, \n --sele3 are specified or --molname, --begin, \n --end are specified)", |
112 |
|
args_info->nbins_z_given = 0 ; |
113 |
|
args_info->nanglebins_given = 0 ; |
114 |
|
args_info->rcut_given = 0 ; |
115 |
+ |
args_info->dz_given = 0 ; |
116 |
|
args_info->length_given = 0 ; |
117 |
|
args_info->zlength_given = 0 ; |
118 |
|
args_info->zoffset_given = 0 ; |
128 |
|
args_info->bo_given = 0 ; |
129 |
|
args_info->bor_given = 0 ; |
130 |
|
args_info->bad_given = 0 ; |
131 |
+ |
args_info->count_given = 0 ; |
132 |
|
args_info->gofr_given = 0 ; |
133 |
|
args_info->gofz_given = 0 ; |
134 |
|
args_info->r_theta_given = 0 ; |
136 |
|
args_info->r_z_given = 0 ; |
137 |
|
args_info->theta_omega_given = 0 ; |
138 |
|
args_info->gxyz_given = 0 ; |
139 |
+ |
args_info->twodgofr_given = 0 ; |
140 |
|
args_info->p2_given = 0 ; |
141 |
|
args_info->rp2_given = 0 ; |
142 |
|
args_info->scd_given = 0 ; |
169 |
|
args_info->nanglebins_arg = 50; |
170 |
|
args_info->nanglebins_orig = NULL; |
171 |
|
args_info->rcut_orig = NULL; |
172 |
+ |
args_info->dz_orig = NULL; |
173 |
|
args_info->length_orig = NULL; |
174 |
|
args_info->zlength_orig = NULL; |
175 |
|
args_info->zoffset_arg = 0; |
208 |
|
args_info->nbins_z_help = gengetopt_args_info_help[8] ; |
209 |
|
args_info->nanglebins_help = gengetopt_args_info_help[9] ; |
210 |
|
args_info->rcut_help = gengetopt_args_info_help[10] ; |
211 |
< |
args_info->length_help = gengetopt_args_info_help[11] ; |
212 |
< |
args_info->zlength_help = gengetopt_args_info_help[12] ; |
213 |
< |
args_info->zoffset_help = gengetopt_args_info_help[13] ; |
214 |
< |
args_info->sele1_help = gengetopt_args_info_help[14] ; |
215 |
< |
args_info->sele2_help = gengetopt_args_info_help[15] ; |
216 |
< |
args_info->sele3_help = gengetopt_args_info_help[16] ; |
217 |
< |
args_info->refsele_help = gengetopt_args_info_help[17] ; |
218 |
< |
args_info->comsele_help = gengetopt_args_info_help[18] ; |
219 |
< |
args_info->molname_help = gengetopt_args_info_help[19] ; |
220 |
< |
args_info->begin_help = gengetopt_args_info_help[20] ; |
221 |
< |
args_info->end_help = gengetopt_args_info_help[21] ; |
222 |
< |
args_info->radius_help = gengetopt_args_info_help[22] ; |
223 |
< |
args_info->bo_help = gengetopt_args_info_help[24] ; |
224 |
< |
args_info->bor_help = gengetopt_args_info_help[25] ; |
225 |
< |
args_info->bad_help = gengetopt_args_info_help[26] ; |
226 |
< |
args_info->gofr_help = gengetopt_args_info_help[27] ; |
227 |
< |
args_info->gofz_help = gengetopt_args_info_help[28] ; |
228 |
< |
args_info->r_theta_help = gengetopt_args_info_help[29] ; |
229 |
< |
args_info->r_omega_help = gengetopt_args_info_help[30] ; |
230 |
< |
args_info->r_z_help = gengetopt_args_info_help[31] ; |
231 |
< |
args_info->theta_omega_help = gengetopt_args_info_help[32] ; |
232 |
< |
args_info->gxyz_help = gengetopt_args_info_help[33] ; |
233 |
< |
args_info->p2_help = gengetopt_args_info_help[34] ; |
234 |
< |
args_info->rp2_help = gengetopt_args_info_help[35] ; |
235 |
< |
args_info->scd_help = gengetopt_args_info_help[36] ; |
236 |
< |
args_info->density_help = gengetopt_args_info_help[37] ; |
237 |
< |
args_info->slab_density_help = gengetopt_args_info_help[38] ; |
238 |
< |
args_info->p_angle_help = gengetopt_args_info_help[39] ; |
239 |
< |
args_info->hxy_help = gengetopt_args_info_help[40] ; |
240 |
< |
args_info->rho_r_help = gengetopt_args_info_help[41] ; |
241 |
< |
args_info->hullvol_help = gengetopt_args_info_help[42] ; |
211 |
> |
args_info->dz_help = gengetopt_args_info_help[11] ; |
212 |
> |
args_info->length_help = gengetopt_args_info_help[12] ; |
213 |
> |
args_info->zlength_help = gengetopt_args_info_help[13] ; |
214 |
> |
args_info->zoffset_help = gengetopt_args_info_help[14] ; |
215 |
> |
args_info->sele1_help = gengetopt_args_info_help[15] ; |
216 |
> |
args_info->sele2_help = gengetopt_args_info_help[16] ; |
217 |
> |
args_info->sele3_help = gengetopt_args_info_help[17] ; |
218 |
> |
args_info->refsele_help = gengetopt_args_info_help[18] ; |
219 |
> |
args_info->comsele_help = gengetopt_args_info_help[19] ; |
220 |
> |
args_info->molname_help = gengetopt_args_info_help[20] ; |
221 |
> |
args_info->begin_help = gengetopt_args_info_help[21] ; |
222 |
> |
args_info->end_help = gengetopt_args_info_help[22] ; |
223 |
> |
args_info->radius_help = gengetopt_args_info_help[23] ; |
224 |
> |
args_info->bo_help = gengetopt_args_info_help[25] ; |
225 |
> |
args_info->bor_help = gengetopt_args_info_help[26] ; |
226 |
> |
args_info->bad_help = gengetopt_args_info_help[27] ; |
227 |
> |
args_info->count_help = gengetopt_args_info_help[28] ; |
228 |
> |
args_info->gofr_help = gengetopt_args_info_help[29] ; |
229 |
> |
args_info->gofz_help = gengetopt_args_info_help[30] ; |
230 |
> |
args_info->r_theta_help = gengetopt_args_info_help[31] ; |
231 |
> |
args_info->r_omega_help = gengetopt_args_info_help[32] ; |
232 |
> |
args_info->r_z_help = gengetopt_args_info_help[33] ; |
233 |
> |
args_info->theta_omega_help = gengetopt_args_info_help[34] ; |
234 |
> |
args_info->gxyz_help = gengetopt_args_info_help[35] ; |
235 |
> |
args_info->twodgofr_help = gengetopt_args_info_help[36] ; |
236 |
> |
args_info->p2_help = gengetopt_args_info_help[37] ; |
237 |
> |
args_info->rp2_help = gengetopt_args_info_help[38] ; |
238 |
> |
args_info->scd_help = gengetopt_args_info_help[39] ; |
239 |
> |
args_info->density_help = gengetopt_args_info_help[40] ; |
240 |
> |
args_info->slab_density_help = gengetopt_args_info_help[41] ; |
241 |
> |
args_info->p_angle_help = gengetopt_args_info_help[42] ; |
242 |
> |
args_info->hxy_help = gengetopt_args_info_help[43] ; |
243 |
> |
args_info->rho_r_help = gengetopt_args_info_help[44] ; |
244 |
> |
args_info->hullvol_help = gengetopt_args_info_help[45] ; |
245 |
|
|
246 |
|
} |
247 |
|
|
281 |
|
clear_given (args_info); |
282 |
|
clear_args (args_info); |
283 |
|
init_args_info (args_info); |
284 |
+ |
|
285 |
+ |
args_info->inputs = NULL; |
286 |
+ |
args_info->inputs_num = 0; |
287 |
|
} |
288 |
|
|
289 |
|
void |
322 |
|
static void |
323 |
|
cmdline_parser_release (struct gengetopt_args_info *args_info) |
324 |
|
{ |
325 |
< |
|
325 |
> |
unsigned int i; |
326 |
|
free_string_field (&(args_info->input_arg)); |
327 |
|
free_string_field (&(args_info->input_orig)); |
328 |
|
free_string_field (&(args_info->output_arg)); |
334 |
|
free_string_field (&(args_info->nbins_z_orig)); |
335 |
|
free_string_field (&(args_info->nanglebins_orig)); |
336 |
|
free_string_field (&(args_info->rcut_orig)); |
337 |
+ |
free_string_field (&(args_info->dz_orig)); |
338 |
|
free_string_field (&(args_info->length_orig)); |
339 |
|
free_string_field (&(args_info->zlength_orig)); |
340 |
|
free_string_field (&(args_info->zoffset_orig)); |
355 |
|
free_string_field (&(args_info->radius_orig)); |
356 |
|
|
357 |
|
|
358 |
+ |
for (i = 0; i < args_info->inputs_num; ++i) |
359 |
+ |
free (args_info->inputs [i]); |
360 |
+ |
|
361 |
+ |
if (args_info->inputs_num) |
362 |
+ |
free (args_info->inputs); |
363 |
|
|
364 |
|
clear_given (args_info); |
365 |
|
} |
409 |
|
write_into_file(outfile, "nanglebins", args_info->nanglebins_orig, 0); |
410 |
|
if (args_info->rcut_given) |
411 |
|
write_into_file(outfile, "rcut", args_info->rcut_orig, 0); |
412 |
+ |
if (args_info->dz_given) |
413 |
+ |
write_into_file(outfile, "dz", args_info->dz_orig, 0); |
414 |
|
if (args_info->length_given) |
415 |
|
write_into_file(outfile, "length", args_info->length_orig, 0); |
416 |
|
if (args_info->zlength_given) |
441 |
|
write_into_file(outfile, "bor", 0, 0 ); |
442 |
|
if (args_info->bad_given) |
443 |
|
write_into_file(outfile, "bad", 0, 0 ); |
444 |
+ |
if (args_info->count_given) |
445 |
+ |
write_into_file(outfile, "count", 0, 0 ); |
446 |
|
if (args_info->gofr_given) |
447 |
|
write_into_file(outfile, "gofr", 0, 0 ); |
448 |
|
if (args_info->gofz_given) |
457 |
|
write_into_file(outfile, "theta_omega", 0, 0 ); |
458 |
|
if (args_info->gxyz_given) |
459 |
|
write_into_file(outfile, "gxyz", 0, 0 ); |
460 |
+ |
if (args_info->twodgofr_given) |
461 |
+ |
write_into_file(outfile, "twodgofr", 0, 0 ); |
462 |
|
if (args_info->p2_given) |
463 |
|
write_into_file(outfile, "p2", 0, 0 ); |
464 |
|
if (args_info->rp2_given) |
533 |
|
args_info->bo_given = 0 ; |
534 |
|
args_info->bor_given = 0 ; |
535 |
|
args_info->bad_given = 0 ; |
536 |
+ |
args_info->count_given = 0 ; |
537 |
|
args_info->gofr_given = 0 ; |
538 |
|
args_info->gofz_given = 0 ; |
539 |
|
args_info->r_theta_given = 0 ; |
541 |
|
args_info->r_z_given = 0 ; |
542 |
|
args_info->theta_omega_given = 0 ; |
543 |
|
args_info->gxyz_given = 0 ; |
544 |
+ |
args_info->twodgofr_given = 0 ; |
545 |
|
args_info->p2_given = 0 ; |
546 |
|
args_info->rp2_given = 0 ; |
547 |
|
args_info->scd_given = 0 ; |
802 |
|
{ "nbins_z", 1, NULL, 0 }, |
803 |
|
{ "nanglebins", 1, NULL, 'a' }, |
804 |
|
{ "rcut", 1, NULL, 'c' }, |
805 |
+ |
{ "dz", 1, NULL, 0 }, |
806 |
|
{ "length", 1, NULL, 0 }, |
807 |
|
{ "zlength", 1, NULL, 0 }, |
808 |
|
{ "zoffset", 1, NULL, 'z' }, |
818 |
|
{ "bo", 0, NULL, 0 }, |
819 |
|
{ "bor", 0, NULL, 0 }, |
820 |
|
{ "bad", 0, NULL, 0 }, |
821 |
+ |
{ "count", 0, NULL, 0 }, |
822 |
|
{ "gofr", 0, NULL, 'g' }, |
823 |
|
{ "gofz", 0, NULL, 0 }, |
824 |
|
{ "r_theta", 0, NULL, 0 }, |
826 |
|
{ "r_z", 0, NULL, 0 }, |
827 |
|
{ "theta_omega", 0, NULL, 0 }, |
828 |
|
{ "gxyz", 0, NULL, 0 }, |
829 |
+ |
{ "twodgofr", 0, NULL, 0 }, |
830 |
|
{ "p2", 0, NULL, 'p' }, |
831 |
|
{ "rp2", 0, NULL, 0 }, |
832 |
|
{ "scd", 0, NULL, 's' }, |
1035 |
|
&(local_args_info.nbins_z_given), optarg, 0, "100", ARG_INT, |
1036 |
|
check_ambiguity, override, 0, 0, |
1037 |
|
"nbins_z", '-', |
1038 |
+ |
additional_error)) |
1039 |
+ |
goto failure; |
1040 |
+ |
|
1041 |
+ |
} |
1042 |
+ |
/* slab width (dz). */ |
1043 |
+ |
else if (strcmp (long_options[option_index].name, "dz") == 0) |
1044 |
+ |
{ |
1045 |
+ |
|
1046 |
+ |
|
1047 |
+ |
if (update_arg( (void *)&(args_info->dz_arg), |
1048 |
+ |
&(args_info->dz_orig), &(args_info->dz_given), |
1049 |
+ |
&(local_args_info.dz_given), optarg, 0, 0, ARG_DOUBLE, |
1050 |
+ |
check_ambiguity, override, 0, 0, |
1051 |
+ |
"dz", '-', |
1052 |
|
additional_error)) |
1053 |
|
goto failure; |
1054 |
|
|
1254 |
|
&(local_args_info.bad_given), optarg, 0, 0, ARG_NO, |
1255 |
|
check_ambiguity, override, 0, 0, |
1256 |
|
"bad", '-', |
1257 |
+ |
additional_error)) |
1258 |
+ |
goto failure; |
1259 |
+ |
|
1260 |
+ |
} |
1261 |
+ |
/* count of molecules matching selection criteria (and associated statistics). */ |
1262 |
+ |
else if (strcmp (long_options[option_index].name, "count") == 0) |
1263 |
+ |
{ |
1264 |
+ |
|
1265 |
+ |
if (args_info->staticProps_group_counter && override) |
1266 |
+ |
reset_group_staticProps (args_info); |
1267 |
+ |
args_info->staticProps_group_counter += 1; |
1268 |
+ |
|
1269 |
+ |
if (update_arg( 0 , |
1270 |
+ |
0 , &(args_info->count_given), |
1271 |
+ |
&(local_args_info.count_given), optarg, 0, 0, ARG_NO, |
1272 |
+ |
check_ambiguity, override, 0, 0, |
1273 |
+ |
"count", '-', |
1274 |
|
additional_error)) |
1275 |
|
goto failure; |
1276 |
|
|
1377 |
|
goto failure; |
1378 |
|
|
1379 |
|
} |
1380 |
+ |
/* 2D g(r) (Slab width --dz must be specified). */ |
1381 |
+ |
else if (strcmp (long_options[option_index].name, "twodgofr") == 0) |
1382 |
+ |
{ |
1383 |
+ |
|
1384 |
+ |
if (args_info->staticProps_group_counter && override) |
1385 |
+ |
reset_group_staticProps (args_info); |
1386 |
+ |
args_info->staticProps_group_counter += 1; |
1387 |
+ |
|
1388 |
+ |
if (update_arg( 0 , |
1389 |
+ |
0 , &(args_info->twodgofr_given), |
1390 |
+ |
&(local_args_info.twodgofr_given), optarg, 0, 0, ARG_NO, |
1391 |
+ |
check_ambiguity, override, 0, 0, |
1392 |
+ |
"twodgofr", '-', |
1393 |
+ |
additional_error)) |
1394 |
+ |
goto failure; |
1395 |
+ |
|
1396 |
+ |
} |
1397 |
|
/* rp2 order parameter (--sele1 and --sele2 must be specified). */ |
1398 |
|
else if (strcmp (long_options[option_index].name, "rp2") == 0) |
1399 |
|
{ |
1526 |
|
if ( error ) |
1527 |
|
return (EXIT_FAILURE); |
1528 |
|
|
1529 |
+ |
if (optind < argc) |
1530 |
+ |
{ |
1531 |
+ |
int i = 0 ; |
1532 |
+ |
int found_prog_name = 0; |
1533 |
+ |
/* whether program name, i.e., argv[0], is in the remaining args |
1534 |
+ |
(this may happen with some implementations of getopt, |
1535 |
+ |
but surely not with the one included by gengetopt) */ |
1536 |
+ |
|
1537 |
+ |
i = optind; |
1538 |
+ |
while (i < argc) |
1539 |
+ |
if (argv[i++] == argv[0]) { |
1540 |
+ |
found_prog_name = 1; |
1541 |
+ |
break; |
1542 |
+ |
} |
1543 |
+ |
i = 0; |
1544 |
+ |
|
1545 |
+ |
args_info->inputs_num = argc - optind - found_prog_name; |
1546 |
+ |
args_info->inputs = |
1547 |
+ |
(char **)(malloc ((args_info->inputs_num)*sizeof(char *))) ; |
1548 |
+ |
while (optind < argc) |
1549 |
+ |
if (argv[optind++] != argv[0]) |
1550 |
+ |
args_info->inputs[ i++ ] = gengetopt_strdup (argv[optind-1]) ; |
1551 |
+ |
} |
1552 |
+ |
|
1553 |
|
return 0; |
1554 |
|
|
1555 |
|
failure: |