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 |
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 = ""; |
33 |
|
|
34 |
< |
const char *gengetopt_args_info_usage = "Usage: StaticProps [OPTIONS]..."; |
34 |
> |
const char *gengetopt_args_info_usage = "Usage: StaticProps [OPTIONS]... [FILES]..."; |
35 |
|
|
36 |
|
const char *gengetopt_args_info_description = ""; |
37 |
|
|
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 |
+ |
" --seleoffset2=INT global index offset for a third object (used to \n define a vector between sites in molecule)", |
61 |
|
" --molname=STRING molecule name", |
62 |
|
" --begin=INT begin internal index", |
63 |
|
" --end=INT end internal index", |
64 |
|
" --radius=DOUBLE nanoparticle radius", |
65 |
|
"\n Group: staticProps\n an option of this group is required", |
66 |
|
" --bo bond order parameter (--rcut must be specified)", |
67 |
< |
" --bor bond order parameter as a function of radius \n (--rcut must be specified)", |
67 |
> |
" --ior icosahedral bond order parameter as a function \n of radius (--rcut must be specified)", |
68 |
> |
" --for FCC bond order parameter as a function of \n radius (--rcut must be specified)", |
69 |
|
" --bad N(theta) bond angle density within (--rcut must \n be specified)", |
70 |
+ |
" --count count of molecules matching selection criteria \n (and associated statistics)", |
71 |
|
" -g, --gofr g(r)", |
72 |
|
" --gofz g(z)", |
73 |
|
" --r_theta g(r, cos(theta))", |
74 |
|
" --r_omega g(r, cos(omega))", |
75 |
+ |
" --r_z g(r, z)", |
76 |
|
" --theta_omega g(cos(theta), cos(omega))", |
77 |
|
" --gxyz g(x, y, z)", |
78 |
< |
" -p, --p2 p2 order parameter (--sele1 and --sele2 must be \n specified)", |
78 |
> |
" --twodgofr 2D g(r) (Slab width --dz must be specified)", |
79 |
> |
" -p, --p2 p2 order parameter (--sele1 must be specified, \n --sele2 is optional)", |
80 |
|
" --rp2 rp2 order parameter (--sele1 and --sele2 must \n be specified)", |
81 |
|
" -s, --scd scd order parameter (either --sele1, --sele2, \n --sele3 are specified or --molname, --begin, \n --end are specified)", |
82 |
|
" -d, --density density plot", |
83 |
|
" --slab_density slab density", |
84 |
+ |
" --p_angle p(cos(theta)) (--sele1 must be specified, \n --sele2 is optional)", |
85 |
|
" --hxy hxy", |
86 |
|
" --rho_r rho of R", |
87 |
+ |
" --angle_r angle of R", |
88 |
|
" --hullvol hull volume of nanoparticle", |
89 |
+ |
" --rodlength length of nanorod", |
90 |
+ |
" -Q, --tet_param tetrahedrality order parameter (Qk)", |
91 |
+ |
" --tet_param_z spatially-resolved tetrahedrality order \n parameter Qk(z)", |
92 |
+ |
" --rnemdz slab-resolved RNEMD statistics (temperature, \n density, velocity)", |
93 |
+ |
" --rnemdr shell-resolved RNEMD statistics (temperature, \n density, angular velocity)", |
94 |
+ |
" --rnemdrt shell and angle-resolved RNEMD statistics \n (temperature, density, angular velocity)", |
95 |
+ |
" --nitrile electrostatic potential to frequency map based \n on the Cho nitrile fits", |
96 |
+ |
" -m, --multipole average multipole moments contained within \n cutoff spheres as a function of radius", |
97 |
|
0 |
98 |
|
}; |
99 |
|
|
109 |
|
void clear_args (struct gengetopt_args_info *args_info); |
110 |
|
|
111 |
|
static int |
112 |
< |
cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info, |
112 |
> |
cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info, |
113 |
|
struct cmdline_parser_params *params, const char *additional_error); |
114 |
|
|
115 |
|
static int |
129 |
|
args_info->nbins_given = 0 ; |
130 |
|
args_info->nbins_x_given = 0 ; |
131 |
|
args_info->nbins_y_given = 0 ; |
132 |
+ |
args_info->nbins_z_given = 0 ; |
133 |
|
args_info->nanglebins_given = 0 ; |
106 |
– |
args_info->length_given = 0 ; |
134 |
|
args_info->rcut_given = 0 ; |
135 |
+ |
args_info->dz_given = 0 ; |
136 |
+ |
args_info->length_given = 0 ; |
137 |
+ |
args_info->zlength_given = 0 ; |
138 |
|
args_info->zoffset_given = 0 ; |
139 |
|
args_info->sele1_given = 0 ; |
140 |
|
args_info->sele2_given = 0 ; |
141 |
|
args_info->sele3_given = 0 ; |
142 |
|
args_info->refsele_given = 0 ; |
143 |
|
args_info->comsele_given = 0 ; |
144 |
+ |
args_info->seleoffset_given = 0 ; |
145 |
+ |
args_info->seleoffset2_given = 0 ; |
146 |
|
args_info->molname_given = 0 ; |
147 |
|
args_info->begin_given = 0 ; |
148 |
|
args_info->end_given = 0 ; |
149 |
|
args_info->radius_given = 0 ; |
150 |
|
args_info->bo_given = 0 ; |
151 |
< |
args_info->bor_given = 0 ; |
151 |
> |
args_info->ior_given = 0 ; |
152 |
> |
args_info->for_given = 0 ; |
153 |
|
args_info->bad_given = 0 ; |
154 |
+ |
args_info->count_given = 0 ; |
155 |
|
args_info->gofr_given = 0 ; |
156 |
|
args_info->gofz_given = 0 ; |
157 |
|
args_info->r_theta_given = 0 ; |
158 |
|
args_info->r_omega_given = 0 ; |
159 |
+ |
args_info->r_z_given = 0 ; |
160 |
|
args_info->theta_omega_given = 0 ; |
161 |
|
args_info->gxyz_given = 0 ; |
162 |
+ |
args_info->twodgofr_given = 0 ; |
163 |
|
args_info->p2_given = 0 ; |
164 |
|
args_info->rp2_given = 0 ; |
165 |
|
args_info->scd_given = 0 ; |
166 |
|
args_info->density_given = 0 ; |
167 |
|
args_info->slab_density_given = 0 ; |
168 |
+ |
args_info->p_angle_given = 0 ; |
169 |
|
args_info->hxy_given = 0 ; |
170 |
|
args_info->rho_r_given = 0 ; |
171 |
+ |
args_info->angle_r_given = 0 ; |
172 |
|
args_info->hullvol_given = 0 ; |
173 |
+ |
args_info->rodlength_given = 0 ; |
174 |
+ |
args_info->tet_param_given = 0 ; |
175 |
+ |
args_info->tet_param_z_given = 0 ; |
176 |
+ |
args_info->rnemdz_given = 0 ; |
177 |
+ |
args_info->rnemdr_given = 0 ; |
178 |
+ |
args_info->rnemdrt_given = 0 ; |
179 |
+ |
args_info->nitrile_given = 0 ; |
180 |
+ |
args_info->multipole_given = 0 ; |
181 |
|
args_info->staticProps_group_counter = 0 ; |
182 |
|
} |
183 |
|
|
184 |
|
static |
185 |
|
void clear_args (struct gengetopt_args_info *args_info) |
186 |
|
{ |
187 |
+ |
FIX_UNUSED (args_info); |
188 |
|
args_info->input_arg = NULL; |
189 |
|
args_info->input_orig = NULL; |
190 |
|
args_info->output_arg = NULL; |
197 |
|
args_info->nbins_x_orig = NULL; |
198 |
|
args_info->nbins_y_arg = 100; |
199 |
|
args_info->nbins_y_orig = NULL; |
200 |
+ |
args_info->nbins_z_arg = 100; |
201 |
+ |
args_info->nbins_z_orig = NULL; |
202 |
|
args_info->nanglebins_arg = 50; |
203 |
|
args_info->nanglebins_orig = NULL; |
155 |
– |
args_info->length_orig = NULL; |
204 |
|
args_info->rcut_orig = NULL; |
205 |
+ |
args_info->dz_orig = NULL; |
206 |
+ |
args_info->length_orig = NULL; |
207 |
+ |
args_info->zlength_orig = NULL; |
208 |
|
args_info->zoffset_arg = 0; |
209 |
|
args_info->zoffset_orig = NULL; |
210 |
|
args_info->sele1_arg = NULL; |
217 |
|
args_info->refsele_orig = NULL; |
218 |
|
args_info->comsele_arg = NULL; |
219 |
|
args_info->comsele_orig = NULL; |
220 |
+ |
args_info->seleoffset_orig = NULL; |
221 |
+ |
args_info->seleoffset2_orig = NULL; |
222 |
|
args_info->molname_arg = NULL; |
223 |
|
args_info->molname_orig = NULL; |
224 |
|
args_info->begin_orig = NULL; |
240 |
|
args_info->nbins_help = gengetopt_args_info_help[5] ; |
241 |
|
args_info->nbins_x_help = gengetopt_args_info_help[6] ; |
242 |
|
args_info->nbins_y_help = gengetopt_args_info_help[7] ; |
243 |
< |
args_info->nanglebins_help = gengetopt_args_info_help[8] ; |
244 |
< |
args_info->length_help = gengetopt_args_info_help[9] ; |
243 |
> |
args_info->nbins_z_help = gengetopt_args_info_help[8] ; |
244 |
> |
args_info->nanglebins_help = gengetopt_args_info_help[9] ; |
245 |
|
args_info->rcut_help = gengetopt_args_info_help[10] ; |
246 |
< |
args_info->zoffset_help = gengetopt_args_info_help[11] ; |
247 |
< |
args_info->sele1_help = gengetopt_args_info_help[12] ; |
248 |
< |
args_info->sele2_help = gengetopt_args_info_help[13] ; |
249 |
< |
args_info->sele3_help = gengetopt_args_info_help[14] ; |
250 |
< |
args_info->refsele_help = gengetopt_args_info_help[15] ; |
251 |
< |
args_info->comsele_help = gengetopt_args_info_help[16] ; |
252 |
< |
args_info->molname_help = gengetopt_args_info_help[17] ; |
253 |
< |
args_info->begin_help = gengetopt_args_info_help[18] ; |
254 |
< |
args_info->end_help = gengetopt_args_info_help[19] ; |
255 |
< |
args_info->radius_help = gengetopt_args_info_help[20] ; |
256 |
< |
args_info->bo_help = gengetopt_args_info_help[22] ; |
257 |
< |
args_info->bor_help = gengetopt_args_info_help[23] ; |
258 |
< |
args_info->bad_help = gengetopt_args_info_help[24] ; |
259 |
< |
args_info->gofr_help = gengetopt_args_info_help[25] ; |
260 |
< |
args_info->gofz_help = gengetopt_args_info_help[26] ; |
261 |
< |
args_info->r_theta_help = gengetopt_args_info_help[27] ; |
262 |
< |
args_info->r_omega_help = gengetopt_args_info_help[28] ; |
263 |
< |
args_info->theta_omega_help = gengetopt_args_info_help[29] ; |
264 |
< |
args_info->gxyz_help = gengetopt_args_info_help[30] ; |
265 |
< |
args_info->p2_help = gengetopt_args_info_help[31] ; |
266 |
< |
args_info->rp2_help = gengetopt_args_info_help[32] ; |
267 |
< |
args_info->scd_help = gengetopt_args_info_help[33] ; |
268 |
< |
args_info->density_help = gengetopt_args_info_help[34] ; |
269 |
< |
args_info->slab_density_help = gengetopt_args_info_help[35] ; |
270 |
< |
args_info->hxy_help = gengetopt_args_info_help[36] ; |
271 |
< |
args_info->rho_r_help = gengetopt_args_info_help[37] ; |
272 |
< |
args_info->hullvol_help = gengetopt_args_info_help[38] ; |
246 |
> |
args_info->dz_help = gengetopt_args_info_help[11] ; |
247 |
> |
args_info->length_help = gengetopt_args_info_help[12] ; |
248 |
> |
args_info->zlength_help = gengetopt_args_info_help[13] ; |
249 |
> |
args_info->zoffset_help = gengetopt_args_info_help[14] ; |
250 |
> |
args_info->sele1_help = gengetopt_args_info_help[15] ; |
251 |
> |
args_info->sele2_help = gengetopt_args_info_help[16] ; |
252 |
> |
args_info->sele3_help = gengetopt_args_info_help[17] ; |
253 |
> |
args_info->refsele_help = gengetopt_args_info_help[18] ; |
254 |
> |
args_info->comsele_help = gengetopt_args_info_help[19] ; |
255 |
> |
args_info->seleoffset_help = gengetopt_args_info_help[20] ; |
256 |
> |
args_info->seleoffset2_help = gengetopt_args_info_help[21] ; |
257 |
> |
args_info->molname_help = gengetopt_args_info_help[22] ; |
258 |
> |
args_info->begin_help = gengetopt_args_info_help[23] ; |
259 |
> |
args_info->end_help = gengetopt_args_info_help[24] ; |
260 |
> |
args_info->radius_help = gengetopt_args_info_help[25] ; |
261 |
> |
args_info->bo_help = gengetopt_args_info_help[27] ; |
262 |
> |
args_info->ior_help = gengetopt_args_info_help[28] ; |
263 |
> |
args_info->for_help = gengetopt_args_info_help[29] ; |
264 |
> |
args_info->bad_help = gengetopt_args_info_help[30] ; |
265 |
> |
args_info->count_help = gengetopt_args_info_help[31] ; |
266 |
> |
args_info->gofr_help = gengetopt_args_info_help[32] ; |
267 |
> |
args_info->gofz_help = gengetopt_args_info_help[33] ; |
268 |
> |
args_info->r_theta_help = gengetopt_args_info_help[34] ; |
269 |
> |
args_info->r_omega_help = gengetopt_args_info_help[35] ; |
270 |
> |
args_info->r_z_help = gengetopt_args_info_help[36] ; |
271 |
> |
args_info->theta_omega_help = gengetopt_args_info_help[37] ; |
272 |
> |
args_info->gxyz_help = gengetopt_args_info_help[38] ; |
273 |
> |
args_info->twodgofr_help = gengetopt_args_info_help[39] ; |
274 |
> |
args_info->p2_help = gengetopt_args_info_help[40] ; |
275 |
> |
args_info->rp2_help = gengetopt_args_info_help[41] ; |
276 |
> |
args_info->scd_help = gengetopt_args_info_help[42] ; |
277 |
> |
args_info->density_help = gengetopt_args_info_help[43] ; |
278 |
> |
args_info->slab_density_help = gengetopt_args_info_help[44] ; |
279 |
> |
args_info->p_angle_help = gengetopt_args_info_help[45] ; |
280 |
> |
args_info->hxy_help = gengetopt_args_info_help[46] ; |
281 |
> |
args_info->rho_r_help = gengetopt_args_info_help[47] ; |
282 |
> |
args_info->angle_r_help = gengetopt_args_info_help[48] ; |
283 |
> |
args_info->hullvol_help = gengetopt_args_info_help[49] ; |
284 |
> |
args_info->rodlength_help = gengetopt_args_info_help[50] ; |
285 |
> |
args_info->tet_param_help = gengetopt_args_info_help[51] ; |
286 |
> |
args_info->tet_param_z_help = gengetopt_args_info_help[52] ; |
287 |
> |
args_info->rnemdz_help = gengetopt_args_info_help[53] ; |
288 |
> |
args_info->rnemdr_help = gengetopt_args_info_help[54] ; |
289 |
> |
args_info->rnemdrt_help = gengetopt_args_info_help[55] ; |
290 |
> |
args_info->nitrile_help = gengetopt_args_info_help[56] ; |
291 |
> |
args_info->multipole_help = gengetopt_args_info_help[57] ; |
292 |
|
|
293 |
|
} |
294 |
|
|
295 |
|
void |
296 |
|
cmdline_parser_print_version (void) |
297 |
|
{ |
298 |
< |
printf ("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION); |
298 |
> |
printf ("%s %s\n", |
299 |
> |
(strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE), |
300 |
> |
CMDLINE_PARSER_VERSION); |
301 |
|
} |
302 |
|
|
303 |
|
static void print_help_common(void) { |
312 |
|
printf("\n"); |
313 |
|
|
314 |
|
if (strlen(gengetopt_args_info_description) > 0) |
315 |
< |
printf("%s\n", gengetopt_args_info_description); |
315 |
> |
printf("%s\n\n", gengetopt_args_info_description); |
316 |
|
} |
317 |
|
|
318 |
|
void |
330 |
|
clear_given (args_info); |
331 |
|
clear_args (args_info); |
332 |
|
init_args_info (args_info); |
333 |
+ |
|
334 |
+ |
args_info->inputs = 0; |
335 |
+ |
args_info->inputs_num = 0; |
336 |
|
} |
337 |
|
|
338 |
|
void |
371 |
|
static void |
372 |
|
cmdline_parser_release (struct gengetopt_args_info *args_info) |
373 |
|
{ |
374 |
< |
|
374 |
> |
unsigned int i; |
375 |
|
free_string_field (&(args_info->input_arg)); |
376 |
|
free_string_field (&(args_info->input_orig)); |
377 |
|
free_string_field (&(args_info->output_arg)); |
380 |
|
free_string_field (&(args_info->nbins_orig)); |
381 |
|
free_string_field (&(args_info->nbins_x_orig)); |
382 |
|
free_string_field (&(args_info->nbins_y_orig)); |
383 |
+ |
free_string_field (&(args_info->nbins_z_orig)); |
384 |
|
free_string_field (&(args_info->nanglebins_orig)); |
307 |
– |
free_string_field (&(args_info->length_orig)); |
385 |
|
free_string_field (&(args_info->rcut_orig)); |
386 |
+ |
free_string_field (&(args_info->dz_orig)); |
387 |
+ |
free_string_field (&(args_info->length_orig)); |
388 |
+ |
free_string_field (&(args_info->zlength_orig)); |
389 |
|
free_string_field (&(args_info->zoffset_orig)); |
390 |
|
free_string_field (&(args_info->sele1_arg)); |
391 |
|
free_string_field (&(args_info->sele1_orig)); |
397 |
|
free_string_field (&(args_info->refsele_orig)); |
398 |
|
free_string_field (&(args_info->comsele_arg)); |
399 |
|
free_string_field (&(args_info->comsele_orig)); |
400 |
+ |
free_string_field (&(args_info->seleoffset_orig)); |
401 |
+ |
free_string_field (&(args_info->seleoffset2_orig)); |
402 |
|
free_string_field (&(args_info->molname_arg)); |
403 |
|
free_string_field (&(args_info->molname_orig)); |
404 |
|
free_string_field (&(args_info->begin_orig)); |
406 |
|
free_string_field (&(args_info->radius_orig)); |
407 |
|
|
408 |
|
|
409 |
+ |
for (i = 0; i < args_info->inputs_num; ++i) |
410 |
+ |
free (args_info->inputs [i]); |
411 |
|
|
412 |
+ |
if (args_info->inputs_num) |
413 |
+ |
free (args_info->inputs); |
414 |
+ |
|
415 |
|
clear_given (args_info); |
416 |
|
} |
417 |
|
|
418 |
|
|
419 |
|
static void |
420 |
< |
write_into_file(FILE *outfile, const char *opt, const char *arg, char *values[]) |
420 |
> |
write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[]) |
421 |
|
{ |
422 |
+ |
FIX_UNUSED (values); |
423 |
|
if (arg) { |
424 |
|
fprintf(outfile, "%s=\"%s\"\n", opt, arg); |
425 |
|
} else { |
455 |
|
write_into_file(outfile, "nbins_x", args_info->nbins_x_orig, 0); |
456 |
|
if (args_info->nbins_y_given) |
457 |
|
write_into_file(outfile, "nbins_y", args_info->nbins_y_orig, 0); |
458 |
+ |
if (args_info->nbins_z_given) |
459 |
+ |
write_into_file(outfile, "nbins_z", args_info->nbins_z_orig, 0); |
460 |
|
if (args_info->nanglebins_given) |
461 |
|
write_into_file(outfile, "nanglebins", args_info->nanglebins_orig, 0); |
372 |
– |
if (args_info->length_given) |
373 |
– |
write_into_file(outfile, "length", args_info->length_orig, 0); |
462 |
|
if (args_info->rcut_given) |
463 |
|
write_into_file(outfile, "rcut", args_info->rcut_orig, 0); |
464 |
+ |
if (args_info->dz_given) |
465 |
+ |
write_into_file(outfile, "dz", args_info->dz_orig, 0); |
466 |
+ |
if (args_info->length_given) |
467 |
+ |
write_into_file(outfile, "length", args_info->length_orig, 0); |
468 |
+ |
if (args_info->zlength_given) |
469 |
+ |
write_into_file(outfile, "zlength", args_info->zlength_orig, 0); |
470 |
|
if (args_info->zoffset_given) |
471 |
|
write_into_file(outfile, "zoffset", args_info->zoffset_orig, 0); |
472 |
|
if (args_info->sele1_given) |
479 |
|
write_into_file(outfile, "refsele", args_info->refsele_orig, 0); |
480 |
|
if (args_info->comsele_given) |
481 |
|
write_into_file(outfile, "comsele", args_info->comsele_orig, 0); |
482 |
+ |
if (args_info->seleoffset_given) |
483 |
+ |
write_into_file(outfile, "seleoffset", args_info->seleoffset_orig, 0); |
484 |
+ |
if (args_info->seleoffset2_given) |
485 |
+ |
write_into_file(outfile, "seleoffset2", args_info->seleoffset2_orig, 0); |
486 |
|
if (args_info->molname_given) |
487 |
|
write_into_file(outfile, "molname", args_info->molname_orig, 0); |
488 |
|
if (args_info->begin_given) |
493 |
|
write_into_file(outfile, "radius", args_info->radius_orig, 0); |
494 |
|
if (args_info->bo_given) |
495 |
|
write_into_file(outfile, "bo", 0, 0 ); |
496 |
< |
if (args_info->bor_given) |
497 |
< |
write_into_file(outfile, "bor", 0, 0 ); |
496 |
> |
if (args_info->ior_given) |
497 |
> |
write_into_file(outfile, "ior", 0, 0 ); |
498 |
> |
if (args_info->for_given) |
499 |
> |
write_into_file(outfile, "for", 0, 0 ); |
500 |
|
if (args_info->bad_given) |
501 |
|
write_into_file(outfile, "bad", 0, 0 ); |
502 |
+ |
if (args_info->count_given) |
503 |
+ |
write_into_file(outfile, "count", 0, 0 ); |
504 |
|
if (args_info->gofr_given) |
505 |
|
write_into_file(outfile, "gofr", 0, 0 ); |
506 |
|
if (args_info->gofz_given) |
509 |
|
write_into_file(outfile, "r_theta", 0, 0 ); |
510 |
|
if (args_info->r_omega_given) |
511 |
|
write_into_file(outfile, "r_omega", 0, 0 ); |
512 |
+ |
if (args_info->r_z_given) |
513 |
+ |
write_into_file(outfile, "r_z", 0, 0 ); |
514 |
|
if (args_info->theta_omega_given) |
515 |
|
write_into_file(outfile, "theta_omega", 0, 0 ); |
516 |
|
if (args_info->gxyz_given) |
517 |
|
write_into_file(outfile, "gxyz", 0, 0 ); |
518 |
+ |
if (args_info->twodgofr_given) |
519 |
+ |
write_into_file(outfile, "twodgofr", 0, 0 ); |
520 |
|
if (args_info->p2_given) |
521 |
|
write_into_file(outfile, "p2", 0, 0 ); |
522 |
|
if (args_info->rp2_given) |
527 |
|
write_into_file(outfile, "density", 0, 0 ); |
528 |
|
if (args_info->slab_density_given) |
529 |
|
write_into_file(outfile, "slab_density", 0, 0 ); |
530 |
+ |
if (args_info->p_angle_given) |
531 |
+ |
write_into_file(outfile, "p_angle", 0, 0 ); |
532 |
|
if (args_info->hxy_given) |
533 |
|
write_into_file(outfile, "hxy", 0, 0 ); |
534 |
|
if (args_info->rho_r_given) |
535 |
|
write_into_file(outfile, "rho_r", 0, 0 ); |
536 |
+ |
if (args_info->angle_r_given) |
537 |
+ |
write_into_file(outfile, "angle_r", 0, 0 ); |
538 |
|
if (args_info->hullvol_given) |
539 |
|
write_into_file(outfile, "hullvol", 0, 0 ); |
540 |
+ |
if (args_info->rodlength_given) |
541 |
+ |
write_into_file(outfile, "rodlength", 0, 0 ); |
542 |
+ |
if (args_info->tet_param_given) |
543 |
+ |
write_into_file(outfile, "tet_param", 0, 0 ); |
544 |
+ |
if (args_info->tet_param_z_given) |
545 |
+ |
write_into_file(outfile, "tet_param_z", 0, 0 ); |
546 |
+ |
if (args_info->rnemdz_given) |
547 |
+ |
write_into_file(outfile, "rnemdz", 0, 0 ); |
548 |
+ |
if (args_info->rnemdr_given) |
549 |
+ |
write_into_file(outfile, "rnemdr", 0, 0 ); |
550 |
+ |
if (args_info->rnemdrt_given) |
551 |
+ |
write_into_file(outfile, "rnemdrt", 0, 0 ); |
552 |
+ |
if (args_info->nitrile_given) |
553 |
+ |
write_into_file(outfile, "nitrile", 0, 0 ); |
554 |
+ |
if (args_info->multipole_given) |
555 |
+ |
write_into_file(outfile, "multipole", 0, 0 ); |
556 |
|
|
557 |
|
|
558 |
|
i = EXIT_SUCCESS; |
589 |
|
char * |
590 |
|
gengetopt_strdup (const char *s) |
591 |
|
{ |
592 |
< |
char *result = NULL; |
592 |
> |
char *result = 0; |
593 |
|
if (!s) |
594 |
|
return result; |
595 |
|
|
607 |
|
return; |
608 |
|
|
609 |
|
args_info->bo_given = 0 ; |
610 |
< |
args_info->bor_given = 0 ; |
610 |
> |
args_info->ior_given = 0 ; |
611 |
> |
args_info->for_given = 0 ; |
612 |
|
args_info->bad_given = 0 ; |
613 |
+ |
args_info->count_given = 0 ; |
614 |
|
args_info->gofr_given = 0 ; |
615 |
|
args_info->gofz_given = 0 ; |
616 |
|
args_info->r_theta_given = 0 ; |
617 |
|
args_info->r_omega_given = 0 ; |
618 |
+ |
args_info->r_z_given = 0 ; |
619 |
|
args_info->theta_omega_given = 0 ; |
620 |
|
args_info->gxyz_given = 0 ; |
621 |
+ |
args_info->twodgofr_given = 0 ; |
622 |
|
args_info->p2_given = 0 ; |
623 |
|
args_info->rp2_given = 0 ; |
624 |
|
args_info->scd_given = 0 ; |
625 |
|
args_info->density_given = 0 ; |
626 |
|
args_info->slab_density_given = 0 ; |
627 |
+ |
args_info->p_angle_given = 0 ; |
628 |
|
args_info->hxy_given = 0 ; |
629 |
|
args_info->rho_r_given = 0 ; |
630 |
+ |
args_info->angle_r_given = 0 ; |
631 |
|
args_info->hullvol_given = 0 ; |
632 |
+ |
args_info->rodlength_given = 0 ; |
633 |
+ |
args_info->tet_param_given = 0 ; |
634 |
+ |
args_info->tet_param_z_given = 0 ; |
635 |
+ |
args_info->rnemdz_given = 0 ; |
636 |
+ |
args_info->rnemdr_given = 0 ; |
637 |
+ |
args_info->rnemdrt_given = 0 ; |
638 |
+ |
args_info->nitrile_given = 0 ; |
639 |
+ |
args_info->multipole_given = 0 ; |
640 |
|
|
641 |
|
args_info->staticProps_group_counter = 0; |
642 |
|
} |
643 |
|
|
644 |
|
int |
645 |
< |
cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_info) |
645 |
> |
cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info) |
646 |
|
{ |
647 |
|
return cmdline_parser2 (argc, argv, args_info, 0, 1, 1); |
648 |
|
} |
649 |
|
|
650 |
|
int |
651 |
< |
cmdline_parser_ext (int argc, char * const *argv, struct gengetopt_args_info *args_info, |
651 |
> |
cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, |
652 |
|
struct cmdline_parser_params *params) |
653 |
|
{ |
654 |
|
int result; |
655 |
< |
result = cmdline_parser_internal (argc, argv, args_info, params, NULL); |
655 |
> |
result = cmdline_parser_internal (argc, argv, args_info, params, 0); |
656 |
|
|
657 |
|
if (result == EXIT_FAILURE) |
658 |
|
{ |
664 |
|
} |
665 |
|
|
666 |
|
int |
667 |
< |
cmdline_parser2 (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) |
667 |
> |
cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) |
668 |
|
{ |
669 |
|
int result; |
670 |
|
struct cmdline_parser_params params; |
675 |
|
params.check_ambiguity = 0; |
676 |
|
params.print_errors = 1; |
677 |
|
|
678 |
< |
result = cmdline_parser_internal (argc, argv, args_info, ¶ms, NULL); |
678 |
> |
result = cmdline_parser_internal (argc, argv, args_info, ¶ms, 0); |
679 |
|
|
680 |
|
if (result == EXIT_FAILURE) |
681 |
|
{ |
691 |
|
{ |
692 |
|
int result = EXIT_SUCCESS; |
693 |
|
|
694 |
< |
if (cmdline_parser_required2(args_info, prog_name, NULL) > 0) |
694 |
> |
if (cmdline_parser_required2(args_info, prog_name, 0) > 0) |
695 |
|
result = EXIT_FAILURE; |
696 |
|
|
697 |
|
if (result == EXIT_FAILURE) |
707 |
|
cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error) |
708 |
|
{ |
709 |
|
int error = 0; |
710 |
+ |
FIX_UNUSED (additional_error); |
711 |
|
|
712 |
|
/* checks for required options */ |
713 |
|
if (! args_info->input_given) |
718 |
|
|
719 |
|
if (args_info->staticProps_group_counter == 0) |
720 |
|
{ |
721 |
< |
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 : "")); |
721 |
> |
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 : "")); |
722 |
|
error = 1; |
723 |
|
} |
724 |
|
|
752 |
|
static |
753 |
|
int update_arg(void *field, char **orig_field, |
754 |
|
unsigned int *field_given, unsigned int *prev_given, |
755 |
< |
char *value, char *possible_values[], const char *default_value, |
755 |
> |
char *value, const char *possible_values[], |
756 |
> |
const char *default_value, |
757 |
|
cmdline_parser_arg_type arg_type, |
758 |
|
int check_ambiguity, int override, |
759 |
|
int no_free, int multiple_option, |
764 |
|
const char *val = value; |
765 |
|
int found; |
766 |
|
char **string_field; |
767 |
+ |
FIX_UNUSED (field); |
768 |
|
|
769 |
|
stop_char = 0; |
770 |
|
found = 0; |
782 |
|
return 1; /* failure */ |
783 |
|
} |
784 |
|
|
785 |
+ |
FIX_UNUSED (default_value); |
786 |
|
|
787 |
|
if (field_given && *field_given && ! override) |
788 |
|
return 0; |
846 |
|
|
847 |
|
|
848 |
|
int |
849 |
< |
cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info, |
849 |
> |
cmdline_parser_internal ( |
850 |
> |
int argc, char **argv, struct gengetopt_args_info *args_info, |
851 |
|
struct cmdline_parser_params *params, const char *additional_error) |
852 |
|
{ |
853 |
|
int c; /* Character of the parsed option. */ |
890 |
|
{ "nbins", 1, NULL, 'b' }, |
891 |
|
{ "nbins_x", 1, NULL, 'x' }, |
892 |
|
{ "nbins_y", 1, NULL, 'y' }, |
893 |
+ |
{ "nbins_z", 1, NULL, 0 }, |
894 |
|
{ "nanglebins", 1, NULL, 'a' }, |
749 |
– |
{ "length", 1, NULL, 0 }, |
895 |
|
{ "rcut", 1, NULL, 'c' }, |
896 |
+ |
{ "dz", 1, NULL, 0 }, |
897 |
+ |
{ "length", 1, NULL, 0 }, |
898 |
+ |
{ "zlength", 1, NULL, 0 }, |
899 |
|
{ "zoffset", 1, NULL, 'z' }, |
900 |
|
{ "sele1", 1, NULL, 0 }, |
901 |
|
{ "sele2", 1, NULL, 0 }, |
902 |
|
{ "sele3", 1, NULL, 0 }, |
903 |
|
{ "refsele", 1, NULL, 0 }, |
904 |
|
{ "comsele", 1, NULL, 0 }, |
905 |
+ |
{ "seleoffset", 1, NULL, 0 }, |
906 |
+ |
{ "seleoffset2", 1, NULL, 0 }, |
907 |
|
{ "molname", 1, NULL, 0 }, |
908 |
|
{ "begin", 1, NULL, 0 }, |
909 |
|
{ "end", 1, NULL, 0 }, |
910 |
|
{ "radius", 1, NULL, 0 }, |
911 |
|
{ "bo", 0, NULL, 0 }, |
912 |
< |
{ "bor", 0, NULL, 0 }, |
912 |
> |
{ "ior", 0, NULL, 0 }, |
913 |
> |
{ "for", 0, NULL, 0 }, |
914 |
|
{ "bad", 0, NULL, 0 }, |
915 |
+ |
{ "count", 0, NULL, 0 }, |
916 |
|
{ "gofr", 0, NULL, 'g' }, |
917 |
|
{ "gofz", 0, NULL, 0 }, |
918 |
|
{ "r_theta", 0, NULL, 0 }, |
919 |
|
{ "r_omega", 0, NULL, 0 }, |
920 |
+ |
{ "r_z", 0, NULL, 0 }, |
921 |
|
{ "theta_omega", 0, NULL, 0 }, |
922 |
|
{ "gxyz", 0, NULL, 0 }, |
923 |
+ |
{ "twodgofr", 0, NULL, 0 }, |
924 |
|
{ "p2", 0, NULL, 'p' }, |
925 |
|
{ "rp2", 0, NULL, 0 }, |
926 |
|
{ "scd", 0, NULL, 's' }, |
927 |
|
{ "density", 0, NULL, 'd' }, |
928 |
|
{ "slab_density", 0, NULL, 0 }, |
929 |
+ |
{ "p_angle", 0, NULL, 0 }, |
930 |
|
{ "hxy", 0, NULL, 0 }, |
931 |
|
{ "rho_r", 0, NULL, 0 }, |
932 |
+ |
{ "angle_r", 0, NULL, 0 }, |
933 |
|
{ "hullvol", 0, NULL, 0 }, |
934 |
< |
{ NULL, 0, NULL, 0 } |
934 |
> |
{ "rodlength", 0, NULL, 0 }, |
935 |
> |
{ "tet_param", 0, NULL, 'Q' }, |
936 |
> |
{ "tet_param_z", 0, NULL, 0 }, |
937 |
> |
{ "rnemdz", 0, NULL, 0 }, |
938 |
> |
{ "rnemdr", 0, NULL, 0 }, |
939 |
> |
{ "rnemdrt", 0, NULL, 0 }, |
940 |
> |
{ "nitrile", 0, NULL, 0 }, |
941 |
> |
{ "multipole", 0, NULL, 'm' }, |
942 |
> |
{ 0, 0, 0, 0 } |
943 |
|
}; |
944 |
|
|
945 |
< |
c = getopt_long (argc, argv, "hVi:o:n:b:x:y:a:c:z:gpsd", long_options, &option_index); |
945 |
> |
c = getopt_long (argc, argv, "hVi:o:n:b:x:y:a:c:z:gpsdQm", long_options, &option_index); |
946 |
|
|
947 |
|
if (c == -1) break; /* Exit from `while (1)' loop. */ |
948 |
|
|
1081 |
|
goto failure; |
1082 |
|
|
1083 |
|
break; |
1084 |
< |
case 'p': /* p2 order parameter (--sele1 and --sele2 must be specified). */ |
1084 |
> |
case 'p': /* p2 order parameter (--sele1 must be specified, --sele2 is optional). */ |
1085 |
|
|
1086 |
|
if (args_info->staticProps_group_counter && override) |
1087 |
|
reset_group_staticProps (args_info); |
1122 |
|
&(local_args_info.density_given), optarg, 0, 0, ARG_NO, |
1123 |
|
check_ambiguity, override, 0, 0, |
1124 |
|
"density", 'd', |
1125 |
+ |
additional_error)) |
1126 |
+ |
goto failure; |
1127 |
+ |
|
1128 |
+ |
break; |
1129 |
+ |
case 'Q': /* tetrahedrality order parameter (Qk). */ |
1130 |
+ |
|
1131 |
+ |
if (args_info->staticProps_group_counter && override) |
1132 |
+ |
reset_group_staticProps (args_info); |
1133 |
+ |
args_info->staticProps_group_counter += 1; |
1134 |
+ |
|
1135 |
+ |
if (update_arg( 0 , |
1136 |
+ |
0 , &(args_info->tet_param_given), |
1137 |
+ |
&(local_args_info.tet_param_given), optarg, 0, 0, ARG_NO, |
1138 |
+ |
check_ambiguity, override, 0, 0, |
1139 |
+ |
"tet_param", 'Q', |
1140 |
+ |
additional_error)) |
1141 |
+ |
goto failure; |
1142 |
+ |
|
1143 |
+ |
break; |
1144 |
+ |
case 'm': /* average multipole moments contained within cutoff spheres as a function of radius. */ |
1145 |
+ |
|
1146 |
+ |
if (args_info->staticProps_group_counter && override) |
1147 |
+ |
reset_group_staticProps (args_info); |
1148 |
+ |
args_info->staticProps_group_counter += 1; |
1149 |
+ |
|
1150 |
+ |
if (update_arg( 0 , |
1151 |
+ |
0 , &(args_info->multipole_given), |
1152 |
+ |
&(local_args_info.multipole_given), optarg, 0, 0, ARG_NO, |
1153 |
+ |
check_ambiguity, override, 0, 0, |
1154 |
+ |
"multipole", 'm', |
1155 |
|
additional_error)) |
1156 |
|
goto failure; |
1157 |
|
|
1158 |
|
break; |
1159 |
|
|
1160 |
|
case 0: /* Long option with no short option */ |
1161 |
+ |
/* number of bins in z axis. */ |
1162 |
+ |
if (strcmp (long_options[option_index].name, "nbins_z") == 0) |
1163 |
+ |
{ |
1164 |
+ |
|
1165 |
+ |
|
1166 |
+ |
if (update_arg( (void *)&(args_info->nbins_z_arg), |
1167 |
+ |
&(args_info->nbins_z_orig), &(args_info->nbins_z_given), |
1168 |
+ |
&(local_args_info.nbins_z_given), optarg, 0, "100", ARG_INT, |
1169 |
+ |
check_ambiguity, override, 0, 0, |
1170 |
+ |
"nbins_z", '-', |
1171 |
+ |
additional_error)) |
1172 |
+ |
goto failure; |
1173 |
+ |
|
1174 |
+ |
} |
1175 |
+ |
/* slab width (dz). */ |
1176 |
+ |
else if (strcmp (long_options[option_index].name, "dz") == 0) |
1177 |
+ |
{ |
1178 |
+ |
|
1179 |
+ |
|
1180 |
+ |
if (update_arg( (void *)&(args_info->dz_arg), |
1181 |
+ |
&(args_info->dz_orig), &(args_info->dz_given), |
1182 |
+ |
&(local_args_info.dz_given), optarg, 0, 0, ARG_DOUBLE, |
1183 |
+ |
check_ambiguity, override, 0, 0, |
1184 |
+ |
"dz", '-', |
1185 |
+ |
additional_error)) |
1186 |
+ |
goto failure; |
1187 |
+ |
|
1188 |
+ |
} |
1189 |
|
/* maximum length (Defaults to 1/2 smallest length of first frame). */ |
1190 |
< |
if (strcmp (long_options[option_index].name, "length") == 0) |
1190 |
> |
else if (strcmp (long_options[option_index].name, "length") == 0) |
1191 |
|
{ |
1192 |
|
|
1193 |
|
|
1200 |
|
goto failure; |
1201 |
|
|
1202 |
|
} |
1203 |
+ |
/* maximum length (Defaults to 1/2 smallest length of first frame). */ |
1204 |
+ |
else if (strcmp (long_options[option_index].name, "zlength") == 0) |
1205 |
+ |
{ |
1206 |
+ |
|
1207 |
+ |
|
1208 |
+ |
if (update_arg( (void *)&(args_info->zlength_arg), |
1209 |
+ |
&(args_info->zlength_orig), &(args_info->zlength_given), |
1210 |
+ |
&(local_args_info.zlength_given), optarg, 0, 0, ARG_DOUBLE, |
1211 |
+ |
check_ambiguity, override, 0, 0, |
1212 |
+ |
"zlength", '-', |
1213 |
+ |
additional_error)) |
1214 |
+ |
goto failure; |
1215 |
+ |
|
1216 |
+ |
} |
1217 |
|
/* select the first stuntdouble set. */ |
1218 |
|
else if (strcmp (long_options[option_index].name, "sele1") == 0) |
1219 |
|
{ |
1284 |
|
goto failure; |
1285 |
|
|
1286 |
|
} |
1287 |
+ |
/* global index offset for a second object (used to define a vector between sites in molecule). */ |
1288 |
+ |
else if (strcmp (long_options[option_index].name, "seleoffset") == 0) |
1289 |
+ |
{ |
1290 |
+ |
|
1291 |
+ |
|
1292 |
+ |
if (update_arg( (void *)&(args_info->seleoffset_arg), |
1293 |
+ |
&(args_info->seleoffset_orig), &(args_info->seleoffset_given), |
1294 |
+ |
&(local_args_info.seleoffset_given), optarg, 0, 0, ARG_INT, |
1295 |
+ |
check_ambiguity, override, 0, 0, |
1296 |
+ |
"seleoffset", '-', |
1297 |
+ |
additional_error)) |
1298 |
+ |
goto failure; |
1299 |
+ |
|
1300 |
+ |
} |
1301 |
+ |
/* global index offset for a third object (used to define a vector between sites in molecule). */ |
1302 |
+ |
else if (strcmp (long_options[option_index].name, "seleoffset2") == 0) |
1303 |
+ |
{ |
1304 |
+ |
|
1305 |
+ |
|
1306 |
+ |
if (update_arg( (void *)&(args_info->seleoffset2_arg), |
1307 |
+ |
&(args_info->seleoffset2_orig), &(args_info->seleoffset2_given), |
1308 |
+ |
&(local_args_info.seleoffset2_given), optarg, 0, 0, ARG_INT, |
1309 |
+ |
check_ambiguity, override, 0, 0, |
1310 |
+ |
"seleoffset2", '-', |
1311 |
+ |
additional_error)) |
1312 |
+ |
goto failure; |
1313 |
+ |
|
1314 |
+ |
} |
1315 |
|
/* molecule name. */ |
1316 |
|
else if (strcmp (long_options[option_index].name, "molname") == 0) |
1317 |
|
{ |
1385 |
|
goto failure; |
1386 |
|
|
1387 |
|
} |
1388 |
< |
/* bond order parameter as a function of radius (--rcut must be specified). */ |
1389 |
< |
else if (strcmp (long_options[option_index].name, "bor") == 0) |
1388 |
> |
/* icosahedral bond order parameter as a function of radius (--rcut must be specified). */ |
1389 |
> |
else if (strcmp (long_options[option_index].name, "ior") == 0) |
1390 |
> |
{ |
1391 |
> |
|
1392 |
> |
if (args_info->staticProps_group_counter && override) |
1393 |
> |
reset_group_staticProps (args_info); |
1394 |
> |
args_info->staticProps_group_counter += 1; |
1395 |
> |
|
1396 |
> |
if (update_arg( 0 , |
1397 |
> |
0 , &(args_info->ior_given), |
1398 |
> |
&(local_args_info.ior_given), optarg, 0, 0, ARG_NO, |
1399 |
> |
check_ambiguity, override, 0, 0, |
1400 |
> |
"ior", '-', |
1401 |
> |
additional_error)) |
1402 |
> |
goto failure; |
1403 |
> |
|
1404 |
> |
} |
1405 |
> |
/* FCC bond order parameter as a function of radius (--rcut must be specified). */ |
1406 |
> |
else if (strcmp (long_options[option_index].name, "for") == 0) |
1407 |
|
{ |
1408 |
|
|
1409 |
|
if (args_info->staticProps_group_counter && override) |
1411 |
|
args_info->staticProps_group_counter += 1; |
1412 |
|
|
1413 |
|
if (update_arg( 0 , |
1414 |
< |
0 , &(args_info->bor_given), |
1415 |
< |
&(local_args_info.bor_given), optarg, 0, 0, ARG_NO, |
1414 |
> |
0 , &(args_info->for_given), |
1415 |
> |
&(local_args_info.for_given), optarg, 0, 0, ARG_NO, |
1416 |
|
check_ambiguity, override, 0, 0, |
1417 |
< |
"bor", '-', |
1417 |
> |
"for", '-', |
1418 |
|
additional_error)) |
1419 |
|
goto failure; |
1420 |
|
|
1436 |
|
goto failure; |
1437 |
|
|
1438 |
|
} |
1439 |
+ |
/* count of molecules matching selection criteria (and associated statistics). */ |
1440 |
+ |
else if (strcmp (long_options[option_index].name, "count") == 0) |
1441 |
+ |
{ |
1442 |
+ |
|
1443 |
+ |
if (args_info->staticProps_group_counter && override) |
1444 |
+ |
reset_group_staticProps (args_info); |
1445 |
+ |
args_info->staticProps_group_counter += 1; |
1446 |
+ |
|
1447 |
+ |
if (update_arg( 0 , |
1448 |
+ |
0 , &(args_info->count_given), |
1449 |
+ |
&(local_args_info.count_given), optarg, 0, 0, ARG_NO, |
1450 |
+ |
check_ambiguity, override, 0, 0, |
1451 |
+ |
"count", '-', |
1452 |
+ |
additional_error)) |
1453 |
+ |
goto failure; |
1454 |
+ |
|
1455 |
+ |
} |
1456 |
|
/* g(z). */ |
1457 |
|
else if (strcmp (long_options[option_index].name, "gofz") == 0) |
1458 |
|
{ |
1504 |
|
goto failure; |
1505 |
|
|
1506 |
|
} |
1507 |
+ |
/* g(r, z). */ |
1508 |
+ |
else if (strcmp (long_options[option_index].name, "r_z") == 0) |
1509 |
+ |
{ |
1510 |
+ |
|
1511 |
+ |
if (args_info->staticProps_group_counter && override) |
1512 |
+ |
reset_group_staticProps (args_info); |
1513 |
+ |
args_info->staticProps_group_counter += 1; |
1514 |
+ |
|
1515 |
+ |
if (update_arg( 0 , |
1516 |
+ |
0 , &(args_info->r_z_given), |
1517 |
+ |
&(local_args_info.r_z_given), optarg, 0, 0, ARG_NO, |
1518 |
+ |
check_ambiguity, override, 0, 0, |
1519 |
+ |
"r_z", '-', |
1520 |
+ |
additional_error)) |
1521 |
+ |
goto failure; |
1522 |
+ |
|
1523 |
+ |
} |
1524 |
|
/* g(cos(theta), cos(omega)). */ |
1525 |
|
else if (strcmp (long_options[option_index].name, "theta_omega") == 0) |
1526 |
|
{ |
1555 |
|
goto failure; |
1556 |
|
|
1557 |
|
} |
1558 |
+ |
/* 2D g(r) (Slab width --dz must be specified). */ |
1559 |
+ |
else if (strcmp (long_options[option_index].name, "twodgofr") == 0) |
1560 |
+ |
{ |
1561 |
+ |
|
1562 |
+ |
if (args_info->staticProps_group_counter && override) |
1563 |
+ |
reset_group_staticProps (args_info); |
1564 |
+ |
args_info->staticProps_group_counter += 1; |
1565 |
+ |
|
1566 |
+ |
if (update_arg( 0 , |
1567 |
+ |
0 , &(args_info->twodgofr_given), |
1568 |
+ |
&(local_args_info.twodgofr_given), optarg, 0, 0, ARG_NO, |
1569 |
+ |
check_ambiguity, override, 0, 0, |
1570 |
+ |
"twodgofr", '-', |
1571 |
+ |
additional_error)) |
1572 |
+ |
goto failure; |
1573 |
+ |
|
1574 |
+ |
} |
1575 |
|
/* rp2 order parameter (--sele1 and --sele2 must be specified). */ |
1576 |
|
else if (strcmp (long_options[option_index].name, "rp2") == 0) |
1577 |
|
{ |
1602 |
|
&(local_args_info.slab_density_given), optarg, 0, 0, ARG_NO, |
1603 |
|
check_ambiguity, override, 0, 0, |
1604 |
|
"slab_density", '-', |
1605 |
+ |
additional_error)) |
1606 |
+ |
goto failure; |
1607 |
+ |
|
1608 |
+ |
} |
1609 |
+ |
/* p(cos(theta)) (--sele1 must be specified, --sele2 is optional). */ |
1610 |
+ |
else if (strcmp (long_options[option_index].name, "p_angle") == 0) |
1611 |
+ |
{ |
1612 |
+ |
|
1613 |
+ |
if (args_info->staticProps_group_counter && override) |
1614 |
+ |
reset_group_staticProps (args_info); |
1615 |
+ |
args_info->staticProps_group_counter += 1; |
1616 |
+ |
|
1617 |
+ |
if (update_arg( 0 , |
1618 |
+ |
0 , &(args_info->p_angle_given), |
1619 |
+ |
&(local_args_info.p_angle_given), optarg, 0, 0, ARG_NO, |
1620 |
+ |
check_ambiguity, override, 0, 0, |
1621 |
+ |
"p_angle", '-', |
1622 |
|
additional_error)) |
1623 |
|
goto failure; |
1624 |
|
|
1657 |
|
goto failure; |
1658 |
|
|
1659 |
|
} |
1660 |
+ |
/* angle of R. */ |
1661 |
+ |
else if (strcmp (long_options[option_index].name, "angle_r") == 0) |
1662 |
+ |
{ |
1663 |
+ |
|
1664 |
+ |
if (args_info->staticProps_group_counter && override) |
1665 |
+ |
reset_group_staticProps (args_info); |
1666 |
+ |
args_info->staticProps_group_counter += 1; |
1667 |
+ |
|
1668 |
+ |
if (update_arg( 0 , |
1669 |
+ |
0 , &(args_info->angle_r_given), |
1670 |
+ |
&(local_args_info.angle_r_given), optarg, 0, 0, ARG_NO, |
1671 |
+ |
check_ambiguity, override, 0, 0, |
1672 |
+ |
"angle_r", '-', |
1673 |
+ |
additional_error)) |
1674 |
+ |
goto failure; |
1675 |
+ |
|
1676 |
+ |
} |
1677 |
|
/* hull volume of nanoparticle. */ |
1678 |
|
else if (strcmp (long_options[option_index].name, "hullvol") == 0) |
1679 |
|
{ |
1691 |
|
goto failure; |
1692 |
|
|
1693 |
|
} |
1694 |
+ |
/* length of nanorod. */ |
1695 |
+ |
else if (strcmp (long_options[option_index].name, "rodlength") == 0) |
1696 |
+ |
{ |
1697 |
|
|
1698 |
+ |
if (args_info->staticProps_group_counter && override) |
1699 |
+ |
reset_group_staticProps (args_info); |
1700 |
+ |
args_info->staticProps_group_counter += 1; |
1701 |
+ |
|
1702 |
+ |
if (update_arg( 0 , |
1703 |
+ |
0 , &(args_info->rodlength_given), |
1704 |
+ |
&(local_args_info.rodlength_given), optarg, 0, 0, ARG_NO, |
1705 |
+ |
check_ambiguity, override, 0, 0, |
1706 |
+ |
"rodlength", '-', |
1707 |
+ |
additional_error)) |
1708 |
+ |
goto failure; |
1709 |
+ |
|
1710 |
+ |
} |
1711 |
+ |
/* spatially-resolved tetrahedrality order parameter Qk(z). */ |
1712 |
+ |
else if (strcmp (long_options[option_index].name, "tet_param_z") == 0) |
1713 |
+ |
{ |
1714 |
+ |
|
1715 |
+ |
if (args_info->staticProps_group_counter && override) |
1716 |
+ |
reset_group_staticProps (args_info); |
1717 |
+ |
args_info->staticProps_group_counter += 1; |
1718 |
+ |
|
1719 |
+ |
if (update_arg( 0 , |
1720 |
+ |
0 , &(args_info->tet_param_z_given), |
1721 |
+ |
&(local_args_info.tet_param_z_given), optarg, 0, 0, ARG_NO, |
1722 |
+ |
check_ambiguity, override, 0, 0, |
1723 |
+ |
"tet_param_z", '-', |
1724 |
+ |
additional_error)) |
1725 |
+ |
goto failure; |
1726 |
+ |
|
1727 |
+ |
} |
1728 |
+ |
/* slab-resolved RNEMD statistics (temperature, density, velocity). */ |
1729 |
+ |
else if (strcmp (long_options[option_index].name, "rnemdz") == 0) |
1730 |
+ |
{ |
1731 |
+ |
|
1732 |
+ |
if (args_info->staticProps_group_counter && override) |
1733 |
+ |
reset_group_staticProps (args_info); |
1734 |
+ |
args_info->staticProps_group_counter += 1; |
1735 |
+ |
|
1736 |
+ |
if (update_arg( 0 , |
1737 |
+ |
0 , &(args_info->rnemdz_given), |
1738 |
+ |
&(local_args_info.rnemdz_given), optarg, 0, 0, ARG_NO, |
1739 |
+ |
check_ambiguity, override, 0, 0, |
1740 |
+ |
"rnemdz", '-', |
1741 |
+ |
additional_error)) |
1742 |
+ |
goto failure; |
1743 |
+ |
|
1744 |
+ |
} |
1745 |
+ |
/* shell-resolved RNEMD statistics (temperature, density, angular velocity). */ |
1746 |
+ |
else if (strcmp (long_options[option_index].name, "rnemdr") == 0) |
1747 |
+ |
{ |
1748 |
+ |
|
1749 |
+ |
if (args_info->staticProps_group_counter && override) |
1750 |
+ |
reset_group_staticProps (args_info); |
1751 |
+ |
args_info->staticProps_group_counter += 1; |
1752 |
+ |
|
1753 |
+ |
if (update_arg( 0 , |
1754 |
+ |
0 , &(args_info->rnemdr_given), |
1755 |
+ |
&(local_args_info.rnemdr_given), optarg, 0, 0, ARG_NO, |
1756 |
+ |
check_ambiguity, override, 0, 0, |
1757 |
+ |
"rnemdr", '-', |
1758 |
+ |
additional_error)) |
1759 |
+ |
goto failure; |
1760 |
+ |
|
1761 |
+ |
} |
1762 |
+ |
/* shell and angle-resolved RNEMD statistics (temperature, density, angular velocity). */ |
1763 |
+ |
else if (strcmp (long_options[option_index].name, "rnemdrt") == 0) |
1764 |
+ |
{ |
1765 |
+ |
|
1766 |
+ |
if (args_info->staticProps_group_counter && override) |
1767 |
+ |
reset_group_staticProps (args_info); |
1768 |
+ |
args_info->staticProps_group_counter += 1; |
1769 |
+ |
|
1770 |
+ |
if (update_arg( 0 , |
1771 |
+ |
0 , &(args_info->rnemdrt_given), |
1772 |
+ |
&(local_args_info.rnemdrt_given), optarg, 0, 0, ARG_NO, |
1773 |
+ |
check_ambiguity, override, 0, 0, |
1774 |
+ |
"rnemdrt", '-', |
1775 |
+ |
additional_error)) |
1776 |
+ |
goto failure; |
1777 |
+ |
|
1778 |
+ |
} |
1779 |
+ |
/* electrostatic potential to frequency map based on the Cho nitrile fits. */ |
1780 |
+ |
else if (strcmp (long_options[option_index].name, "nitrile") == 0) |
1781 |
+ |
{ |
1782 |
+ |
|
1783 |
+ |
if (args_info->staticProps_group_counter && override) |
1784 |
+ |
reset_group_staticProps (args_info); |
1785 |
+ |
args_info->staticProps_group_counter += 1; |
1786 |
+ |
|
1787 |
+ |
if (update_arg( 0 , |
1788 |
+ |
0 , &(args_info->nitrile_given), |
1789 |
+ |
&(local_args_info.nitrile_given), optarg, 0, 0, ARG_NO, |
1790 |
+ |
check_ambiguity, override, 0, 0, |
1791 |
+ |
"nitrile", '-', |
1792 |
+ |
additional_error)) |
1793 |
+ |
goto failure; |
1794 |
+ |
|
1795 |
+ |
} |
1796 |
+ |
|
1797 |
|
break; |
1798 |
|
case '?': /* Invalid option. */ |
1799 |
|
/* `getopt_long' already printed an error message. */ |
1807 |
|
|
1808 |
|
if (args_info->staticProps_group_counter > 1) |
1809 |
|
{ |
1810 |
< |
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 : "")); |
1810 |
> |
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 : "")); |
1811 |
|
error = 1; |
1812 |
|
} |
1813 |
|
|
1823 |
|
if ( error ) |
1824 |
|
return (EXIT_FAILURE); |
1825 |
|
|
1826 |
+ |
if (optind < argc) |
1827 |
+ |
{ |
1828 |
+ |
int i = 0 ; |
1829 |
+ |
int found_prog_name = 0; |
1830 |
+ |
/* whether program name, i.e., argv[0], is in the remaining args |
1831 |
+ |
(this may happen with some implementations of getopt, |
1832 |
+ |
but surely not with the one included by gengetopt) */ |
1833 |
+ |
|
1834 |
+ |
i = optind; |
1835 |
+ |
while (i < argc) |
1836 |
+ |
if (argv[i++] == argv[0]) { |
1837 |
+ |
found_prog_name = 1; |
1838 |
+ |
break; |
1839 |
+ |
} |
1840 |
+ |
i = 0; |
1841 |
+ |
|
1842 |
+ |
args_info->inputs_num = argc - optind - found_prog_name; |
1843 |
+ |
args_info->inputs = |
1844 |
+ |
(char **)(malloc ((args_info->inputs_num)*sizeof(char *))) ; |
1845 |
+ |
while (optind < argc) |
1846 |
+ |
if (argv[optind++] != argv[0]) |
1847 |
+ |
args_info->inputs[ i++ ] = gengetopt_strdup (argv[optind-1]) ; |
1848 |
+ |
} |
1849 |
+ |
|
1850 |
|
return 0; |
1851 |
|
|
1852 |
|
failure: |