1 |
|
/* |
2 |
< |
File autogenerated by gengetopt version 2.16 |
2 |
> |
File autogenerated by gengetopt version 2.19.1 |
3 |
|
generated with the following command: |
4 |
< |
gengetopt -F StaticPropsCmd |
4 |
> |
gengetopt --file-name=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: |
21 |
|
|
22 |
|
#include "StaticPropsCmd.h" |
23 |
|
|
24 |
+ |
const char *gengetopt_args_info_purpose = ""; |
25 |
+ |
|
26 |
+ |
const char *gengetopt_args_info_usage = "Usage: StaticProps [OPTIONS]... [FILES]..."; |
27 |
+ |
|
28 |
+ |
const char *gengetopt_args_info_description = ""; |
29 |
+ |
|
30 |
+ |
const char *gengetopt_args_info_help[] = { |
31 |
+ |
" -h, --help Print help and exit", |
32 |
+ |
" -V, --version Print version and exit", |
33 |
+ |
" -i, --input=filename input dump file", |
34 |
+ |
" -o, --output=filename output file name", |
35 |
+ |
" -n, --step=INT process every n frame (default=`1')", |
36 |
+ |
" -b, --nbins=INT number of bins (general purpose) \n (default=`100')", |
37 |
+ |
" -x, --nbins_x=INT number of bins in x axis (default=`100')", |
38 |
+ |
" -y, --nbins_y=INT number of bins in y axis (default=`100')", |
39 |
+ |
" -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)", |
41 |
+ |
" -c, --rcut=DOUBLE cutoff radius (rcut)", |
42 |
+ |
" -z, --zoffset=DOUBLE Where to set the zero for the slab_density \n calculation (default=`0')", |
43 |
+ |
" --sele1=selection script select the first stuntdouble set", |
44 |
+ |
" --sele2=selection script select the second stuntdouble set", |
45 |
+ |
" --sele3=selection script select the third stuntdouble set", |
46 |
+ |
" --refsele=selection script\n select reference (use and only use with --gxyz)", |
47 |
+ |
" --molname=STRING molecule name", |
48 |
+ |
" --begin=INT begin internal index", |
49 |
+ |
" --end=INT end internal index", |
50 |
+ |
" --radius=DOUBLE nanoparticle radius", |
51 |
+ |
"\n Group: staticProps\n an option of this group is required", |
52 |
+ |
" --bo bond order parameter (--rcut must be specified)", |
53 |
+ |
" --bor bond order parameter as a function of radius \n (--rcut must be specified)", |
54 |
+ |
" --bad N(theta) bond angle density within (--rcut must \n be specified)", |
55 |
+ |
" -g, --gofr g(r)", |
56 |
+ |
" --r_theta g(r, cos(theta))", |
57 |
+ |
" --r_omega g(r, cos(omega))", |
58 |
+ |
" --theta_omega g(cos(theta), cos(omega))", |
59 |
+ |
" --gxyz g(x, y, z)", |
60 |
+ |
" -p, --p2 p2 order parameter (--sele1 and --sele2 must be \n specified)", |
61 |
+ |
" --rp2 rp2 order parameter (--sele1 and --sele2 must \n be specified)", |
62 |
+ |
" -s, --scd scd order parameter (either --sele1, --sele2, \n --sele3 are specified or --molname, --begin, \n --end are specified)", |
63 |
+ |
" -d, --density density plot", |
64 |
+ |
" --slab_density slab density", |
65 |
+ |
" --hxy hxy", |
66 |
+ |
" --rho_r rho of R", |
67 |
+ |
" --hullvol hull volume of nanoparticle", |
68 |
+ |
0 |
69 |
+ |
}; |
70 |
+ |
|
71 |
|
static |
72 |
|
void clear_given (struct gengetopt_args_info *args_info); |
73 |
|
static |
90 |
|
args_info->input_given = 0 ; |
91 |
|
args_info->output_given = 0 ; |
92 |
|
args_info->step_given = 0 ; |
93 |
< |
args_info->nrbins_given = 0 ; |
93 |
> |
args_info->nbins_given = 0 ; |
94 |
> |
args_info->nbins_x_given = 0 ; |
95 |
> |
args_info->nbins_y_given = 0 ; |
96 |
|
args_info->nanglebins_given = 0 ; |
97 |
|
args_info->length_given = 0 ; |
98 |
+ |
args_info->rcut_given = 0 ; |
99 |
|
args_info->zoffset_given = 0 ; |
100 |
|
args_info->sele1_given = 0 ; |
101 |
|
args_info->sele2_given = 0 ; |
104 |
|
args_info->molname_given = 0 ; |
105 |
|
args_info->begin_given = 0 ; |
106 |
|
args_info->end_given = 0 ; |
107 |
+ |
args_info->radius_given = 0 ; |
108 |
+ |
args_info->bo_given = 0 ; |
109 |
+ |
args_info->bor_given = 0 ; |
110 |
+ |
args_info->bad_given = 0 ; |
111 |
|
args_info->gofr_given = 0 ; |
112 |
|
args_info->r_theta_given = 0 ; |
113 |
|
args_info->r_omega_given = 0 ; |
114 |
|
args_info->theta_omega_given = 0 ; |
115 |
|
args_info->gxyz_given = 0 ; |
116 |
|
args_info->p2_given = 0 ; |
117 |
+ |
args_info->rp2_given = 0 ; |
118 |
|
args_info->scd_given = 0 ; |
119 |
|
args_info->density_given = 0 ; |
120 |
|
args_info->slab_density_given = 0 ; |
121 |
+ |
args_info->hxy_given = 0 ; |
122 |
+ |
args_info->rho_r_given = 0 ; |
123 |
+ |
args_info->hullvol_given = 0 ; |
124 |
|
args_info->staticProps_group_counter = 0 ; |
125 |
|
} |
126 |
|
|
133 |
|
args_info->output_orig = NULL; |
134 |
|
args_info->step_arg = 1; |
135 |
|
args_info->step_orig = NULL; |
136 |
< |
args_info->nrbins_arg = 100; |
137 |
< |
args_info->nrbins_orig = NULL; |
136 |
> |
args_info->nbins_arg = 100; |
137 |
> |
args_info->nbins_orig = NULL; |
138 |
> |
args_info->nbins_x_arg = 100; |
139 |
> |
args_info->nbins_x_orig = NULL; |
140 |
> |
args_info->nbins_y_arg = 100; |
141 |
> |
args_info->nbins_y_orig = NULL; |
142 |
|
args_info->nanglebins_arg = 50; |
143 |
|
args_info->nanglebins_orig = NULL; |
144 |
|
args_info->length_orig = NULL; |
145 |
+ |
args_info->rcut_orig = NULL; |
146 |
|
args_info->zoffset_arg = 0; |
147 |
|
args_info->zoffset_orig = NULL; |
148 |
|
args_info->sele1_arg = NULL; |
157 |
|
args_info->molname_orig = NULL; |
158 |
|
args_info->begin_orig = NULL; |
159 |
|
args_info->end_orig = NULL; |
160 |
+ |
args_info->radius_orig = NULL; |
161 |
|
|
162 |
|
} |
163 |
|
|
164 |
+ |
static |
165 |
+ |
void init_args_info(struct gengetopt_args_info *args_info) |
166 |
+ |
{ |
167 |
+ |
args_info->help_help = gengetopt_args_info_help[0] ; |
168 |
+ |
args_info->version_help = gengetopt_args_info_help[1] ; |
169 |
+ |
args_info->input_help = gengetopt_args_info_help[2] ; |
170 |
+ |
args_info->output_help = gengetopt_args_info_help[3] ; |
171 |
+ |
args_info->step_help = gengetopt_args_info_help[4] ; |
172 |
+ |
args_info->nbins_help = gengetopt_args_info_help[5] ; |
173 |
+ |
args_info->nbins_x_help = gengetopt_args_info_help[6] ; |
174 |
+ |
args_info->nbins_y_help = gengetopt_args_info_help[7] ; |
175 |
+ |
args_info->nanglebins_help = gengetopt_args_info_help[8] ; |
176 |
+ |
args_info->length_help = gengetopt_args_info_help[9] ; |
177 |
+ |
args_info->rcut_help = gengetopt_args_info_help[10] ; |
178 |
+ |
args_info->zoffset_help = gengetopt_args_info_help[11] ; |
179 |
+ |
args_info->sele1_help = gengetopt_args_info_help[12] ; |
180 |
+ |
args_info->sele2_help = gengetopt_args_info_help[13] ; |
181 |
+ |
args_info->sele3_help = gengetopt_args_info_help[14] ; |
182 |
+ |
args_info->refsele_help = gengetopt_args_info_help[15] ; |
183 |
+ |
args_info->molname_help = gengetopt_args_info_help[16] ; |
184 |
+ |
args_info->begin_help = gengetopt_args_info_help[17] ; |
185 |
+ |
args_info->end_help = gengetopt_args_info_help[18] ; |
186 |
+ |
args_info->radius_help = gengetopt_args_info_help[19] ; |
187 |
+ |
args_info->bo_help = gengetopt_args_info_help[20] ; |
188 |
+ |
args_info->bor_help = gengetopt_args_info_help[21] ; |
189 |
+ |
args_info->bad_help = gengetopt_args_info_help[22] ; |
190 |
+ |
args_info->gofr_help = gengetopt_args_info_help[23] ; |
191 |
+ |
args_info->r_theta_help = gengetopt_args_info_help[24] ; |
192 |
+ |
args_info->r_omega_help = gengetopt_args_info_help[25] ; |
193 |
+ |
args_info->theta_omega_help = gengetopt_args_info_help[26] ; |
194 |
+ |
args_info->gxyz_help = gengetopt_args_info_help[27] ; |
195 |
+ |
args_info->p2_help = gengetopt_args_info_help[28] ; |
196 |
+ |
args_info->rp2_help = gengetopt_args_info_help[29] ; |
197 |
+ |
args_info->scd_help = gengetopt_args_info_help[30] ; |
198 |
+ |
args_info->density_help = gengetopt_args_info_help[31] ; |
199 |
+ |
args_info->slab_density_help = gengetopt_args_info_help[32] ; |
200 |
+ |
args_info->hxy_help = gengetopt_args_info_help[33] ; |
201 |
+ |
args_info->rho_r_help = gengetopt_args_info_help[34] ; |
202 |
+ |
args_info->hullvol_help = gengetopt_args_info_help[35] ; |
203 |
+ |
|
204 |
+ |
} |
205 |
+ |
|
206 |
|
void |
207 |
|
cmdline_parser_print_version (void) |
208 |
|
{ |
212 |
|
void |
213 |
|
cmdline_parser_print_help (void) |
214 |
|
{ |
215 |
+ |
int i = 0; |
216 |
|
cmdline_parser_print_version (); |
217 |
< |
printf("\nUsage: StaticProps [OPTIONS]...\n\n"); |
218 |
< |
printf("%s\n"," -h, --help Print help and exit"); |
219 |
< |
printf("%s\n"," -V, --version Print version and exit"); |
220 |
< |
printf("%s\n"," -i, --input=filename input dump file"); |
221 |
< |
printf("%s\n"," -o, --output=filename output file name"); |
222 |
< |
printf("%s\n"," -n, --step=INT process every n frame (default=`1')"); |
223 |
< |
printf("%s\n"," -r, --nrbins=INT number of bins for distance (default=`100')"); |
224 |
< |
printf("%s\n"," -a, --nanglebins=INT number of bins for cos(angle) (default=`50')"); |
225 |
< |
printf("%s\n"," -l, --length=DOUBLE maximum length (Defaults to 1/2 smallest length \n of first frame)"); |
226 |
< |
printf("%s\n"," -z, --zoffset=DOUBLE Where to set the zero for the slab_density \n calculation (default=`0')"); |
227 |
< |
printf("%s\n"," --sele1=selection script select the first stuntdouble set"); |
121 |
< |
printf("%s\n"," --sele2=selection script select the second stuntdouble set"); |
122 |
< |
printf("%s\n"," --sele3=selection script select the third stuntdouble set"); |
123 |
< |
printf("%s\n"," --refsele=selection script\n select reference (use and only use with --gxyz)"); |
124 |
< |
printf("%s\n"," --molname=STRING molecule name"); |
125 |
< |
printf("%s\n"," --begin=INT begin interanl index"); |
126 |
< |
printf("%s\n"," --end=INT end internal index"); |
127 |
< |
printf("%s\n","\n Group: staticProps\n an option of this group is required"); |
128 |
< |
printf("%s\n"," --gofr g(r)"); |
129 |
< |
printf("%s\n"," --r_theta g(r, cos(theta))"); |
130 |
< |
printf("%s\n"," --r_omega g(r, cos(omega))"); |
131 |
< |
printf("%s\n"," --theta_omega g(cos(theta), cos(omega))"); |
132 |
< |
printf("%s\n"," --gxyz g(x, y, z)"); |
133 |
< |
printf("%s\n"," --p2 p2 order parameter (--sele1 and --sele2 must be \n specified)"); |
134 |
< |
printf("%s\n"," --scd scd order parameter(either --sele1, --sele2, \n --sele3 are specified or --molname, --begin, \n --end are specified)"); |
135 |
< |
printf("%s\n"," --density density plot (--sele1 must be specified)"); |
136 |
< |
printf("%s\n"," --slab_density slab density (--sele1 must be specified)"); |
137 |
< |
|
217 |
> |
|
218 |
> |
if (strlen(gengetopt_args_info_purpose) > 0) |
219 |
> |
printf("\n%s\n", gengetopt_args_info_purpose); |
220 |
> |
|
221 |
> |
printf("\n%s\n\n", gengetopt_args_info_usage); |
222 |
> |
|
223 |
> |
if (strlen(gengetopt_args_info_description) > 0) |
224 |
> |
printf("%s\n", gengetopt_args_info_description); |
225 |
> |
|
226 |
> |
while (gengetopt_args_info_help[i]) |
227 |
> |
printf("%s\n", gengetopt_args_info_help[i++]); |
228 |
|
} |
229 |
|
|
230 |
|
void |
232 |
|
{ |
233 |
|
clear_given (args_info); |
234 |
|
clear_args (args_info); |
235 |
+ |
init_args_info (args_info); |
236 |
+ |
|
237 |
+ |
args_info->inputs = NULL; |
238 |
+ |
args_info->inputs_num = 0; |
239 |
|
} |
240 |
|
|
241 |
|
static void |
242 |
|
cmdline_parser_release (struct gengetopt_args_info *args_info) |
243 |
|
{ |
244 |
|
|
245 |
+ |
unsigned int i; |
246 |
|
if (args_info->input_arg) |
247 |
|
{ |
248 |
|
free (args_info->input_arg); /* free previous argument */ |
268 |
|
free (args_info->step_orig); /* free previous argument */ |
269 |
|
args_info->step_orig = 0; |
270 |
|
} |
271 |
< |
if (args_info->nrbins_orig) |
271 |
> |
if (args_info->nbins_orig) |
272 |
|
{ |
273 |
< |
free (args_info->nrbins_orig); /* free previous argument */ |
274 |
< |
args_info->nrbins_orig = 0; |
273 |
> |
free (args_info->nbins_orig); /* free previous argument */ |
274 |
> |
args_info->nbins_orig = 0; |
275 |
|
} |
276 |
+ |
if (args_info->nbins_x_orig) |
277 |
+ |
{ |
278 |
+ |
free (args_info->nbins_x_orig); /* free previous argument */ |
279 |
+ |
args_info->nbins_x_orig = 0; |
280 |
+ |
} |
281 |
+ |
if (args_info->nbins_y_orig) |
282 |
+ |
{ |
283 |
+ |
free (args_info->nbins_y_orig); /* free previous argument */ |
284 |
+ |
args_info->nbins_y_orig = 0; |
285 |
+ |
} |
286 |
|
if (args_info->nanglebins_orig) |
287 |
|
{ |
288 |
|
free (args_info->nanglebins_orig); /* free previous argument */ |
293 |
|
free (args_info->length_orig); /* free previous argument */ |
294 |
|
args_info->length_orig = 0; |
295 |
|
} |
296 |
+ |
if (args_info->rcut_orig) |
297 |
+ |
{ |
298 |
+ |
free (args_info->rcut_orig); /* free previous argument */ |
299 |
+ |
args_info->rcut_orig = 0; |
300 |
+ |
} |
301 |
|
if (args_info->zoffset_orig) |
302 |
|
{ |
303 |
|
free (args_info->zoffset_orig); /* free previous argument */ |
363 |
|
free (args_info->end_orig); /* free previous argument */ |
364 |
|
args_info->end_orig = 0; |
365 |
|
} |
366 |
+ |
if (args_info->radius_orig) |
367 |
+ |
{ |
368 |
+ |
free (args_info->radius_orig); /* free previous argument */ |
369 |
+ |
args_info->radius_orig = 0; |
370 |
+ |
} |
371 |
|
|
372 |
+ |
for (i = 0; i < args_info->inputs_num; ++i) |
373 |
+ |
free (args_info->inputs [i]); |
374 |
+ |
|
375 |
+ |
if (args_info->inputs_num) |
376 |
+ |
free (args_info->inputs); |
377 |
+ |
|
378 |
|
clear_given (args_info); |
379 |
|
} |
380 |
|
|
419 |
|
fprintf(outfile, "%s\n", "step"); |
420 |
|
} |
421 |
|
} |
422 |
< |
if (args_info->nrbins_given) { |
423 |
< |
if (args_info->nrbins_orig) { |
424 |
< |
fprintf(outfile, "%s=\"%s\"\n", "nrbins", args_info->nrbins_orig); |
422 |
> |
if (args_info->nbins_given) { |
423 |
> |
if (args_info->nbins_orig) { |
424 |
> |
fprintf(outfile, "%s=\"%s\"\n", "nbins", args_info->nbins_orig); |
425 |
|
} else { |
426 |
< |
fprintf(outfile, "%s\n", "nrbins"); |
426 |
> |
fprintf(outfile, "%s\n", "nbins"); |
427 |
|
} |
428 |
|
} |
429 |
+ |
if (args_info->nbins_x_given) { |
430 |
+ |
if (args_info->nbins_x_orig) { |
431 |
+ |
fprintf(outfile, "%s=\"%s\"\n", "nbins_x", args_info->nbins_x_orig); |
432 |
+ |
} else { |
433 |
+ |
fprintf(outfile, "%s\n", "nbins_x"); |
434 |
+ |
} |
435 |
+ |
} |
436 |
+ |
if (args_info->nbins_y_given) { |
437 |
+ |
if (args_info->nbins_y_orig) { |
438 |
+ |
fprintf(outfile, "%s=\"%s\"\n", "nbins_y", args_info->nbins_y_orig); |
439 |
+ |
} else { |
440 |
+ |
fprintf(outfile, "%s\n", "nbins_y"); |
441 |
+ |
} |
442 |
+ |
} |
443 |
|
if (args_info->nanglebins_given) { |
444 |
|
if (args_info->nanglebins_orig) { |
445 |
|
fprintf(outfile, "%s=\"%s\"\n", "nanglebins", args_info->nanglebins_orig); |
454 |
|
fprintf(outfile, "%s\n", "length"); |
455 |
|
} |
456 |
|
} |
457 |
+ |
if (args_info->rcut_given) { |
458 |
+ |
if (args_info->rcut_orig) { |
459 |
+ |
fprintf(outfile, "%s=\"%s\"\n", "rcut", args_info->rcut_orig); |
460 |
+ |
} else { |
461 |
+ |
fprintf(outfile, "%s\n", "rcut"); |
462 |
+ |
} |
463 |
+ |
} |
464 |
|
if (args_info->zoffset_given) { |
465 |
|
if (args_info->zoffset_orig) { |
466 |
|
fprintf(outfile, "%s=\"%s\"\n", "zoffset", args_info->zoffset_orig); |
517 |
|
fprintf(outfile, "%s\n", "end"); |
518 |
|
} |
519 |
|
} |
520 |
+ |
if (args_info->radius_given) { |
521 |
+ |
if (args_info->radius_orig) { |
522 |
+ |
fprintf(outfile, "%s=\"%s\"\n", "radius", args_info->radius_orig); |
523 |
+ |
} else { |
524 |
+ |
fprintf(outfile, "%s\n", "radius"); |
525 |
+ |
} |
526 |
+ |
} |
527 |
+ |
if (args_info->bo_given) { |
528 |
+ |
fprintf(outfile, "%s\n", "bo"); |
529 |
+ |
} |
530 |
+ |
if (args_info->bor_given) { |
531 |
+ |
fprintf(outfile, "%s\n", "bor"); |
532 |
+ |
} |
533 |
+ |
if (args_info->bad_given) { |
534 |
+ |
fprintf(outfile, "%s\n", "bad"); |
535 |
+ |
} |
536 |
|
if (args_info->gofr_given) { |
537 |
|
fprintf(outfile, "%s\n", "gofr"); |
538 |
|
} |
551 |
|
if (args_info->p2_given) { |
552 |
|
fprintf(outfile, "%s\n", "p2"); |
553 |
|
} |
554 |
+ |
if (args_info->rp2_given) { |
555 |
+ |
fprintf(outfile, "%s\n", "rp2"); |
556 |
+ |
} |
557 |
|
if (args_info->scd_given) { |
558 |
|
fprintf(outfile, "%s\n", "scd"); |
559 |
|
} |
563 |
|
if (args_info->slab_density_given) { |
564 |
|
fprintf(outfile, "%s\n", "slab_density"); |
565 |
|
} |
566 |
+ |
if (args_info->hxy_given) { |
567 |
+ |
fprintf(outfile, "%s\n", "hxy"); |
568 |
+ |
} |
569 |
+ |
if (args_info->rho_r_given) { |
570 |
+ |
fprintf(outfile, "%s\n", "rho_r"); |
571 |
+ |
} |
572 |
+ |
if (args_info->hullvol_given) { |
573 |
+ |
fprintf(outfile, "%s\n", "hullvol"); |
574 |
+ |
} |
575 |
|
|
576 |
|
fclose (outfile); |
577 |
|
|
611 |
|
if (! args_info->staticProps_group_counter) |
612 |
|
return; |
613 |
|
|
614 |
+ |
args_info->bo_given = 0 ; |
615 |
+ |
args_info->bor_given = 0 ; |
616 |
+ |
args_info->bad_given = 0 ; |
617 |
|
args_info->gofr_given = 0 ; |
618 |
|
args_info->r_theta_given = 0 ; |
619 |
|
args_info->r_omega_given = 0 ; |
620 |
|
args_info->theta_omega_given = 0 ; |
621 |
|
args_info->gxyz_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->hxy_given = 0 ; |
628 |
+ |
args_info->rho_r_given = 0 ; |
629 |
+ |
args_info->hullvol_given = 0 ; |
630 |
|
|
631 |
|
args_info->staticProps_group_counter = 0; |
632 |
|
} |
675 |
|
{ |
676 |
|
int error = 0; |
677 |
|
|
678 |
+ |
/* checks for required options */ |
679 |
|
if (! args_info->input_given) |
680 |
|
{ |
681 |
|
fprintf (stderr, "%s: '--input' ('-i') option required%s\n", prog_name, (additional_error ? additional_error : "")); |
682 |
|
error = 1; |
683 |
|
} |
684 |
+ |
|
685 |
|
if (args_info->staticProps_group_counter == 0) |
686 |
|
{ |
687 |
|
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 : "")); |
689 |
|
} |
690 |
|
|
691 |
|
|
692 |
+ |
/* checks for dependences among options */ |
693 |
+ |
|
694 |
|
return error; |
695 |
|
} |
696 |
|
|
723 |
|
{ "input", 1, NULL, 'i' }, |
724 |
|
{ "output", 1, NULL, 'o' }, |
725 |
|
{ "step", 1, NULL, 'n' }, |
726 |
< |
{ "nrbins", 1, NULL, 'r' }, |
726 |
> |
{ "nbins", 1, NULL, 'b' }, |
727 |
> |
{ "nbins_x", 1, NULL, 'x' }, |
728 |
> |
{ "nbins_y", 1, NULL, 'y' }, |
729 |
|
{ "nanglebins", 1, NULL, 'a' }, |
730 |
< |
{ "length", 1, NULL, 'l' }, |
730 |
> |
{ "length", 1, NULL, 0 }, |
731 |
> |
{ "rcut", 1, NULL, 'c' }, |
732 |
|
{ "zoffset", 1, NULL, 'z' }, |
733 |
|
{ "sele1", 1, NULL, 0 }, |
734 |
|
{ "sele2", 1, NULL, 0 }, |
737 |
|
{ "molname", 1, NULL, 0 }, |
738 |
|
{ "begin", 1, NULL, 0 }, |
739 |
|
{ "end", 1, NULL, 0 }, |
740 |
< |
{ "gofr", 0, NULL, 0 }, |
740 |
> |
{ "radius", 1, NULL, 0 }, |
741 |
> |
{ "bo", 0, NULL, 0 }, |
742 |
> |
{ "bor", 0, NULL, 0 }, |
743 |
> |
{ "bad", 0, NULL, 0 }, |
744 |
> |
{ "gofr", 0, NULL, 'g' }, |
745 |
|
{ "r_theta", 0, NULL, 0 }, |
746 |
|
{ "r_omega", 0, NULL, 0 }, |
747 |
|
{ "theta_omega", 0, NULL, 0 }, |
748 |
|
{ "gxyz", 0, NULL, 0 }, |
749 |
< |
{ "p2", 0, NULL, 0 }, |
750 |
< |
{ "scd", 0, NULL, 0 }, |
751 |
< |
{ "density", 0, NULL, 0 }, |
749 |
> |
{ "p2", 0, NULL, 'p' }, |
750 |
> |
{ "rp2", 0, NULL, 0 }, |
751 |
> |
{ "scd", 0, NULL, 's' }, |
752 |
> |
{ "density", 0, NULL, 'd' }, |
753 |
|
{ "slab_density", 0, NULL, 0 }, |
754 |
+ |
{ "hxy", 0, NULL, 0 }, |
755 |
+ |
{ "rho_r", 0, NULL, 0 }, |
756 |
+ |
{ "hullvol", 0, NULL, 0 }, |
757 |
|
{ NULL, 0, NULL, 0 } |
758 |
|
}; |
759 |
|
|
760 |
|
stop_char = 0; |
761 |
< |
c = getopt_long (argc, argv, "hVi:o:n:r:a:l:z:", long_options, &option_index); |
761 |
> |
c = getopt_long (argc, argv, "hVi:o:n:b:x:y:a:c:z:gpsd", long_options, &option_index); |
762 |
|
|
763 |
|
if (c == -1) break; /* Exit from `while (1)' loop. */ |
764 |
|
|
830 |
|
args_info->step_orig = gengetopt_strdup (optarg); |
831 |
|
break; |
832 |
|
|
833 |
< |
case 'r': /* number of bins for distance. */ |
834 |
< |
if (local_args_info.nrbins_given) |
833 |
> |
case 'b': /* number of bins (general purpose). */ |
834 |
> |
if (local_args_info.nbins_given) |
835 |
|
{ |
836 |
< |
fprintf (stderr, "%s: `--nrbins' (`-r') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
836 |
> |
fprintf (stderr, "%s: `--nbins' (`-b') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
837 |
|
goto failure; |
838 |
|
} |
839 |
< |
if (args_info->nrbins_given && ! override) |
839 |
> |
if (args_info->nbins_given && ! override) |
840 |
|
continue; |
841 |
< |
local_args_info.nrbins_given = 1; |
842 |
< |
args_info->nrbins_given = 1; |
843 |
< |
args_info->nrbins_arg = strtol (optarg, &stop_char, 0); |
841 |
> |
local_args_info.nbins_given = 1; |
842 |
> |
args_info->nbins_given = 1; |
843 |
> |
args_info->nbins_arg = strtol (optarg, &stop_char, 0); |
844 |
|
if (!(stop_char && *stop_char == '\0')) { |
845 |
|
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
846 |
|
goto failure; |
847 |
|
} |
848 |
< |
if (args_info->nrbins_orig) |
849 |
< |
free (args_info->nrbins_orig); /* free previous string */ |
850 |
< |
args_info->nrbins_orig = gengetopt_strdup (optarg); |
848 |
> |
if (args_info->nbins_orig) |
849 |
> |
free (args_info->nbins_orig); /* free previous string */ |
850 |
> |
args_info->nbins_orig = gengetopt_strdup (optarg); |
851 |
|
break; |
852 |
|
|
853 |
+ |
case 'x': /* number of bins in x axis. */ |
854 |
+ |
if (local_args_info.nbins_x_given) |
855 |
+ |
{ |
856 |
+ |
fprintf (stderr, "%s: `--nbins_x' (`-x') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
857 |
+ |
goto failure; |
858 |
+ |
} |
859 |
+ |
if (args_info->nbins_x_given && ! override) |
860 |
+ |
continue; |
861 |
+ |
local_args_info.nbins_x_given = 1; |
862 |
+ |
args_info->nbins_x_given = 1; |
863 |
+ |
args_info->nbins_x_arg = strtol (optarg, &stop_char, 0); |
864 |
+ |
if (!(stop_char && *stop_char == '\0')) { |
865 |
+ |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
866 |
+ |
goto failure; |
867 |
+ |
} |
868 |
+ |
if (args_info->nbins_x_orig) |
869 |
+ |
free (args_info->nbins_x_orig); /* free previous string */ |
870 |
+ |
args_info->nbins_x_orig = gengetopt_strdup (optarg); |
871 |
+ |
break; |
872 |
+ |
|
873 |
+ |
case 'y': /* number of bins in y axis. */ |
874 |
+ |
if (local_args_info.nbins_y_given) |
875 |
+ |
{ |
876 |
+ |
fprintf (stderr, "%s: `--nbins_y' (`-y') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
877 |
+ |
goto failure; |
878 |
+ |
} |
879 |
+ |
if (args_info->nbins_y_given && ! override) |
880 |
+ |
continue; |
881 |
+ |
local_args_info.nbins_y_given = 1; |
882 |
+ |
args_info->nbins_y_given = 1; |
883 |
+ |
args_info->nbins_y_arg = strtol (optarg, &stop_char, 0); |
884 |
+ |
if (!(stop_char && *stop_char == '\0')) { |
885 |
+ |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
886 |
+ |
goto failure; |
887 |
+ |
} |
888 |
+ |
if (args_info->nbins_y_orig) |
889 |
+ |
free (args_info->nbins_y_orig); /* free previous string */ |
890 |
+ |
args_info->nbins_y_orig = gengetopt_strdup (optarg); |
891 |
+ |
break; |
892 |
+ |
|
893 |
|
case 'a': /* number of bins for cos(angle). */ |
894 |
|
if (local_args_info.nanglebins_given) |
895 |
|
{ |
910 |
|
args_info->nanglebins_orig = gengetopt_strdup (optarg); |
911 |
|
break; |
912 |
|
|
913 |
< |
case 'l': /* maximum length (Defaults to 1/2 smallest length of first frame). */ |
914 |
< |
if (local_args_info.length_given) |
913 |
> |
case 'c': /* cutoff radius (rcut). */ |
914 |
> |
if (local_args_info.rcut_given) |
915 |
|
{ |
916 |
< |
fprintf (stderr, "%s: `--length' (`-l') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
916 |
> |
fprintf (stderr, "%s: `--rcut' (`-c') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
917 |
|
goto failure; |
918 |
|
} |
919 |
< |
if (args_info->length_given && ! override) |
919 |
> |
if (args_info->rcut_given && ! override) |
920 |
|
continue; |
921 |
< |
local_args_info.length_given = 1; |
922 |
< |
args_info->length_given = 1; |
923 |
< |
args_info->length_arg = strtod (optarg, &stop_char); |
921 |
> |
local_args_info.rcut_given = 1; |
922 |
> |
args_info->rcut_given = 1; |
923 |
> |
args_info->rcut_arg = strtod (optarg, &stop_char); |
924 |
|
if (!(stop_char && *stop_char == '\0')) { |
925 |
|
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
926 |
|
goto failure; |
927 |
|
} |
928 |
< |
if (args_info->length_orig) |
929 |
< |
free (args_info->length_orig); /* free previous string */ |
930 |
< |
args_info->length_orig = gengetopt_strdup (optarg); |
928 |
> |
if (args_info->rcut_orig) |
929 |
> |
free (args_info->rcut_orig); /* free previous string */ |
930 |
> |
args_info->rcut_orig = gengetopt_strdup (optarg); |
931 |
|
break; |
932 |
|
|
933 |
|
case 'z': /* Where to set the zero for the slab_density calculation. */ |
950 |
|
args_info->zoffset_orig = gengetopt_strdup (optarg); |
951 |
|
break; |
952 |
|
|
953 |
+ |
case 'g': /* g(r). */ |
954 |
+ |
if (local_args_info.gofr_given) |
955 |
+ |
{ |
956 |
+ |
fprintf (stderr, "%s: `--gofr' (`-g') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
957 |
+ |
goto failure; |
958 |
+ |
} |
959 |
+ |
if (args_info->gofr_given && ! override) |
960 |
+ |
continue; |
961 |
+ |
local_args_info.gofr_given = 1; |
962 |
+ |
args_info->gofr_given = 1; |
963 |
+ |
if (args_info->staticProps_group_counter && override) |
964 |
+ |
reset_group_staticProps (args_info); |
965 |
+ |
args_info->staticProps_group_counter += 1; |
966 |
+ |
break; |
967 |
|
|
968 |
+ |
case 'p': /* p2 order parameter (--sele1 and --sele2 must be specified). */ |
969 |
+ |
if (local_args_info.p2_given) |
970 |
+ |
{ |
971 |
+ |
fprintf (stderr, "%s: `--p2' (`-p') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
972 |
+ |
goto failure; |
973 |
+ |
} |
974 |
+ |
if (args_info->p2_given && ! override) |
975 |
+ |
continue; |
976 |
+ |
local_args_info.p2_given = 1; |
977 |
+ |
args_info->p2_given = 1; |
978 |
+ |
if (args_info->staticProps_group_counter && override) |
979 |
+ |
reset_group_staticProps (args_info); |
980 |
+ |
args_info->staticProps_group_counter += 1; |
981 |
+ |
break; |
982 |
+ |
|
983 |
+ |
case 's': /* scd order parameter (either --sele1, --sele2, --sele3 are specified or --molname, --begin, --end are specified). */ |
984 |
+ |
if (local_args_info.scd_given) |
985 |
+ |
{ |
986 |
+ |
fprintf (stderr, "%s: `--scd' (`-s') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
987 |
+ |
goto failure; |
988 |
+ |
} |
989 |
+ |
if (args_info->scd_given && ! override) |
990 |
+ |
continue; |
991 |
+ |
local_args_info.scd_given = 1; |
992 |
+ |
args_info->scd_given = 1; |
993 |
+ |
if (args_info->staticProps_group_counter && override) |
994 |
+ |
reset_group_staticProps (args_info); |
995 |
+ |
args_info->staticProps_group_counter += 1; |
996 |
+ |
break; |
997 |
+ |
|
998 |
+ |
case 'd': /* density plot. */ |
999 |
+ |
if (local_args_info.density_given) |
1000 |
+ |
{ |
1001 |
+ |
fprintf (stderr, "%s: `--density' (`-d') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1002 |
+ |
goto failure; |
1003 |
+ |
} |
1004 |
+ |
if (args_info->density_given && ! override) |
1005 |
+ |
continue; |
1006 |
+ |
local_args_info.density_given = 1; |
1007 |
+ |
args_info->density_given = 1; |
1008 |
+ |
if (args_info->staticProps_group_counter && override) |
1009 |
+ |
reset_group_staticProps (args_info); |
1010 |
+ |
args_info->staticProps_group_counter += 1; |
1011 |
+ |
break; |
1012 |
+ |
|
1013 |
+ |
|
1014 |
|
case 0: /* Long option with no short option */ |
1015 |
+ |
/* maximum length (Defaults to 1/2 smallest length of first frame). */ |
1016 |
+ |
if (strcmp (long_options[option_index].name, "length") == 0) |
1017 |
+ |
{ |
1018 |
+ |
if (local_args_info.length_given) |
1019 |
+ |
{ |
1020 |
+ |
fprintf (stderr, "%s: `--length' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1021 |
+ |
goto failure; |
1022 |
+ |
} |
1023 |
+ |
if (args_info->length_given && ! override) |
1024 |
+ |
continue; |
1025 |
+ |
local_args_info.length_given = 1; |
1026 |
+ |
args_info->length_given = 1; |
1027 |
+ |
args_info->length_arg = strtod (optarg, &stop_char); |
1028 |
+ |
if (!(stop_char && *stop_char == '\0')) { |
1029 |
+ |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
1030 |
+ |
goto failure; |
1031 |
+ |
} |
1032 |
+ |
if (args_info->length_orig) |
1033 |
+ |
free (args_info->length_orig); /* free previous string */ |
1034 |
+ |
args_info->length_orig = gengetopt_strdup (optarg); |
1035 |
+ |
} |
1036 |
|
/* select the first stuntdouble set. */ |
1037 |
< |
if (strcmp (long_options[option_index].name, "sele1") == 0) |
1037 |
> |
else if (strcmp (long_options[option_index].name, "sele1") == 0) |
1038 |
|
{ |
1039 |
|
if (local_args_info.sele1_given) |
1040 |
|
{ |
1128 |
|
free (args_info->molname_orig); /* free previous string */ |
1129 |
|
args_info->molname_orig = gengetopt_strdup (optarg); |
1130 |
|
} |
1131 |
< |
/* begin interanl index. */ |
1131 |
> |
/* begin internal index. */ |
1132 |
|
else if (strcmp (long_options[option_index].name, "begin") == 0) |
1133 |
|
{ |
1134 |
|
if (local_args_info.begin_given) |
1170 |
|
free (args_info->end_orig); /* free previous string */ |
1171 |
|
args_info->end_orig = gengetopt_strdup (optarg); |
1172 |
|
} |
1173 |
< |
/* g(r). */ |
1174 |
< |
else if (strcmp (long_options[option_index].name, "gofr") == 0) |
1173 |
> |
/* nanoparticle radius. */ |
1174 |
> |
else if (strcmp (long_options[option_index].name, "radius") == 0) |
1175 |
|
{ |
1176 |
< |
if (local_args_info.gofr_given) |
1176 |
> |
if (local_args_info.radius_given) |
1177 |
|
{ |
1178 |
< |
fprintf (stderr, "%s: `--gofr' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1178 |
> |
fprintf (stderr, "%s: `--radius' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1179 |
|
goto failure; |
1180 |
|
} |
1181 |
< |
if (args_info->gofr_given && ! override) |
1181 |
> |
if (args_info->radius_given && ! override) |
1182 |
|
continue; |
1183 |
< |
local_args_info.gofr_given = 1; |
1184 |
< |
args_info->gofr_given = 1; |
1183 |
> |
local_args_info.radius_given = 1; |
1184 |
> |
args_info->radius_given = 1; |
1185 |
> |
args_info->radius_arg = strtod (optarg, &stop_char); |
1186 |
> |
if (!(stop_char && *stop_char == '\0')) { |
1187 |
> |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
1188 |
> |
goto failure; |
1189 |
> |
} |
1190 |
> |
if (args_info->radius_orig) |
1191 |
> |
free (args_info->radius_orig); /* free previous string */ |
1192 |
> |
args_info->radius_orig = gengetopt_strdup (optarg); |
1193 |
> |
} |
1194 |
> |
/* bond order parameter (--rcut must be specified). */ |
1195 |
> |
else if (strcmp (long_options[option_index].name, "bo") == 0) |
1196 |
> |
{ |
1197 |
> |
if (local_args_info.bo_given) |
1198 |
> |
{ |
1199 |
> |
fprintf (stderr, "%s: `--bo' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1200 |
> |
goto failure; |
1201 |
> |
} |
1202 |
> |
if (args_info->bo_given && ! override) |
1203 |
> |
continue; |
1204 |
> |
local_args_info.bo_given = 1; |
1205 |
> |
args_info->bo_given = 1; |
1206 |
|
if (args_info->staticProps_group_counter && override) |
1207 |
|
reset_group_staticProps (args_info); |
1208 |
|
args_info->staticProps_group_counter += 1; |
1209 |
|
break; |
1210 |
|
} |
1211 |
+ |
/* bond order parameter as a function of radius (--rcut must be specified). */ |
1212 |
+ |
else if (strcmp (long_options[option_index].name, "bor") == 0) |
1213 |
+ |
{ |
1214 |
+ |
if (local_args_info.bor_given) |
1215 |
+ |
{ |
1216 |
+ |
fprintf (stderr, "%s: `--bor' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1217 |
+ |
goto failure; |
1218 |
+ |
} |
1219 |
+ |
if (args_info->bor_given && ! override) |
1220 |
+ |
continue; |
1221 |
+ |
local_args_info.bor_given = 1; |
1222 |
+ |
args_info->bor_given = 1; |
1223 |
+ |
if (args_info->staticProps_group_counter && override) |
1224 |
+ |
reset_group_staticProps (args_info); |
1225 |
+ |
args_info->staticProps_group_counter += 1; |
1226 |
+ |
break; |
1227 |
+ |
} |
1228 |
+ |
/* N(theta) bond angle density within (--rcut must be specified). */ |
1229 |
+ |
else if (strcmp (long_options[option_index].name, "bad") == 0) |
1230 |
+ |
{ |
1231 |
+ |
if (local_args_info.bad_given) |
1232 |
+ |
{ |
1233 |
+ |
fprintf (stderr, "%s: `--bad' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1234 |
+ |
goto failure; |
1235 |
+ |
} |
1236 |
+ |
if (args_info->bad_given && ! override) |
1237 |
+ |
continue; |
1238 |
+ |
local_args_info.bad_given = 1; |
1239 |
+ |
args_info->bad_given = 1; |
1240 |
+ |
if (args_info->staticProps_group_counter && override) |
1241 |
+ |
reset_group_staticProps (args_info); |
1242 |
+ |
args_info->staticProps_group_counter += 1; |
1243 |
+ |
break; |
1244 |
+ |
} |
1245 |
|
/* g(r, cos(theta)). */ |
1246 |
|
else if (strcmp (long_options[option_index].name, "r_theta") == 0) |
1247 |
|
{ |
1310 |
|
args_info->staticProps_group_counter += 1; |
1311 |
|
break; |
1312 |
|
} |
1313 |
< |
/* p2 order parameter (--sele1 and --sele2 must be specified). */ |
1314 |
< |
else if (strcmp (long_options[option_index].name, "p2") == 0) |
1313 |
> |
/* rp2 order parameter (--sele1 and --sele2 must be specified). */ |
1314 |
> |
else if (strcmp (long_options[option_index].name, "rp2") == 0) |
1315 |
|
{ |
1316 |
< |
if (local_args_info.p2_given) |
1316 |
> |
if (local_args_info.rp2_given) |
1317 |
|
{ |
1318 |
< |
fprintf (stderr, "%s: `--p2' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1318 |
> |
fprintf (stderr, "%s: `--rp2' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1319 |
|
goto failure; |
1320 |
|
} |
1321 |
< |
if (args_info->p2_given && ! override) |
1321 |
> |
if (args_info->rp2_given && ! override) |
1322 |
|
continue; |
1323 |
< |
local_args_info.p2_given = 1; |
1324 |
< |
args_info->p2_given = 1; |
1323 |
> |
local_args_info.rp2_given = 1; |
1324 |
> |
args_info->rp2_given = 1; |
1325 |
|
if (args_info->staticProps_group_counter && override) |
1326 |
|
reset_group_staticProps (args_info); |
1327 |
|
args_info->staticProps_group_counter += 1; |
1328 |
|
break; |
1329 |
|
} |
1330 |
< |
/* scd order parameter(either --sele1, --sele2, --sele3 are specified or --molname, --begin, --end are specified). */ |
1331 |
< |
else if (strcmp (long_options[option_index].name, "scd") == 0) |
1330 |
> |
/* slab density. */ |
1331 |
> |
else if (strcmp (long_options[option_index].name, "slab_density") == 0) |
1332 |
|
{ |
1333 |
< |
if (local_args_info.scd_given) |
1333 |
> |
if (local_args_info.slab_density_given) |
1334 |
|
{ |
1335 |
< |
fprintf (stderr, "%s: `--scd' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1335 |
> |
fprintf (stderr, "%s: `--slab_density' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1336 |
|
goto failure; |
1337 |
|
} |
1338 |
< |
if (args_info->scd_given && ! override) |
1338 |
> |
if (args_info->slab_density_given && ! override) |
1339 |
|
continue; |
1340 |
< |
local_args_info.scd_given = 1; |
1341 |
< |
args_info->scd_given = 1; |
1340 |
> |
local_args_info.slab_density_given = 1; |
1341 |
> |
args_info->slab_density_given = 1; |
1342 |
|
if (args_info->staticProps_group_counter && override) |
1343 |
|
reset_group_staticProps (args_info); |
1344 |
|
args_info->staticProps_group_counter += 1; |
1345 |
|
break; |
1346 |
|
} |
1347 |
< |
/* density plot (--sele1 must be specified). */ |
1348 |
< |
else if (strcmp (long_options[option_index].name, "density") == 0) |
1347 |
> |
/* hxy. */ |
1348 |
> |
else if (strcmp (long_options[option_index].name, "hxy") == 0) |
1349 |
|
{ |
1350 |
< |
if (local_args_info.density_given) |
1350 |
> |
if (local_args_info.hxy_given) |
1351 |
|
{ |
1352 |
< |
fprintf (stderr, "%s: `--density' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1352 |
> |
fprintf (stderr, "%s: `--hxy' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1353 |
|
goto failure; |
1354 |
|
} |
1355 |
< |
if (args_info->density_given && ! override) |
1355 |
> |
if (args_info->hxy_given && ! override) |
1356 |
|
continue; |
1357 |
< |
local_args_info.density_given = 1; |
1358 |
< |
args_info->density_given = 1; |
1357 |
> |
local_args_info.hxy_given = 1; |
1358 |
> |
args_info->hxy_given = 1; |
1359 |
|
if (args_info->staticProps_group_counter && override) |
1360 |
|
reset_group_staticProps (args_info); |
1361 |
|
args_info->staticProps_group_counter += 1; |
1362 |
|
break; |
1363 |
|
} |
1364 |
< |
/* slab density (--sele1 must be specified). */ |
1365 |
< |
else if (strcmp (long_options[option_index].name, "slab_density") == 0) |
1364 |
> |
/* rho of R. */ |
1365 |
> |
else if (strcmp (long_options[option_index].name, "rho_r") == 0) |
1366 |
|
{ |
1367 |
< |
if (local_args_info.slab_density_given) |
1367 |
> |
if (local_args_info.rho_r_given) |
1368 |
|
{ |
1369 |
< |
fprintf (stderr, "%s: `--slab_density' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1369 |
> |
fprintf (stderr, "%s: `--rho_r' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1370 |
|
goto failure; |
1371 |
|
} |
1372 |
< |
if (args_info->slab_density_given && ! override) |
1372 |
> |
if (args_info->rho_r_given && ! override) |
1373 |
|
continue; |
1374 |
< |
local_args_info.slab_density_given = 1; |
1375 |
< |
args_info->slab_density_given = 1; |
1374 |
> |
local_args_info.rho_r_given = 1; |
1375 |
> |
args_info->rho_r_given = 1; |
1376 |
|
if (args_info->staticProps_group_counter && override) |
1377 |
|
reset_group_staticProps (args_info); |
1378 |
|
args_info->staticProps_group_counter += 1; |
1379 |
|
break; |
1380 |
|
} |
1381 |
+ |
/* hull volume of nanoparticle. */ |
1382 |
+ |
else if (strcmp (long_options[option_index].name, "hullvol") == 0) |
1383 |
+ |
{ |
1384 |
+ |
if (local_args_info.hullvol_given) |
1385 |
+ |
{ |
1386 |
+ |
fprintf (stderr, "%s: `--hullvol' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1387 |
+ |
goto failure; |
1388 |
+ |
} |
1389 |
+ |
if (args_info->hullvol_given && ! override) |
1390 |
+ |
continue; |
1391 |
+ |
local_args_info.hullvol_given = 1; |
1392 |
+ |
args_info->hullvol_given = 1; |
1393 |
+ |
if (args_info->staticProps_group_counter && override) |
1394 |
+ |
reset_group_staticProps (args_info); |
1395 |
+ |
args_info->staticProps_group_counter += 1; |
1396 |
+ |
break; |
1397 |
+ |
} |
1398 |
|
|
1399 |
|
break; |
1400 |
|
case '?': /* Invalid option. */ |
1425 |
|
if ( error ) |
1426 |
|
return (EXIT_FAILURE); |
1427 |
|
|
1428 |
+ |
if (optind < argc) |
1429 |
+ |
{ |
1430 |
+ |
int i = 0 ; |
1431 |
+ |
int found_prog_name = 0; |
1432 |
+ |
/* whether program name, i.e., argv[0], is in the remaining args |
1433 |
+ |
(this may happen with some implementations of getopt, |
1434 |
+ |
but surely not with the one included by gengetopt) */ |
1435 |
+ |
|
1436 |
+ |
i = optind; |
1437 |
+ |
while (i < argc) |
1438 |
+ |
if (argv[i++] == argv[0]) { |
1439 |
+ |
found_prog_name = 1; |
1440 |
+ |
break; |
1441 |
+ |
} |
1442 |
+ |
i = 0; |
1443 |
+ |
|
1444 |
+ |
args_info->inputs_num = argc - optind - found_prog_name; |
1445 |
+ |
args_info->inputs = |
1446 |
+ |
(char **)(malloc ((args_info->inputs_num)*sizeof(char *))) ; |
1447 |
+ |
while (optind < argc) |
1448 |
+ |
if (argv[optind++] != argv[0]) |
1449 |
+ |
args_info->inputs[ i++ ] = gengetopt_strdup (argv[optind-1]) ; |
1450 |
+ |
} |
1451 |
+ |
|
1452 |
|
return 0; |
1453 |
|
|
1454 |
|
failure: |