OpenMD 3.2
Molecular Dynamics in the Open
Loading...
Searching...
No Matches
DynamicPropsCmd.cpp
1/*
2 File autogenerated by gengetopt version 2.23
3 generated with the following command:
4 gengetopt --no-handle-error --include-getopt --show-required --unamed-opts --file-name=DynamicPropsCmd --c-extension=cpp --header-extension=hpp
5
6 The developers of gengetopt consider the fixed text that goes in all
7 gengetopt output files to be in the public domain:
8 we make no copyright claims on it.
9*/
10
11/* If we use autoconf. */
12#ifdef HAVE_CONFIG_H
13#include "config.h"
14#endif
15
16#include <stdio.h>
17#include <stdlib.h>
18#include <string.h>
19
20#ifndef FIX_UNUSED
21#define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */
22#endif
23
24
25#include "DynamicPropsCmd.hpp"
26
27const char *gengetopt_args_info_purpose = "Computes a variety of time correlation functions from the\nconfigurations stored in a dump file. Typical examples of time\ncorrelation functions are the mean square displacement and the\nvelocity autocorrelation functions. The selection syntax can be used\nto specify the StuntDoubles that will be used for the calculation. A\ngeneral time correlation function can be thought of as:\n\n C(t) = < A(0) * B(t) >\n\nwhere A(t) and B(t) are time-dependent properties, and the < >\nindicates an average over the initial time and atoms (if A and B are\nproperties of atoms).\n\nExample:\n DynamicProps -i longRun.dump --rcorr --sele1=\"select SPCE_RB_0\"";
28
29const char *gengetopt_args_info_usage = "Usage: DynamicProps [OPTION]... [FILE]...";
30
31const char *gengetopt_args_info_versiontext = "";
32
33const char *gengetopt_args_info_description = "";
34
35const char *gengetopt_args_info_help[] = {
36 " -h, --help Print help and exit",
37 " -V, --version Print version and exit",
38 " -i, --input=filename input dump file (mandatory)",
39 " -o, --output=filename output file name",
40 " --sele1=selection script select first stuntdouble set",
41 " --sele2=selection script select second stuntdouble set (if sele2 is not\n set, use script from sele1)",
42 " --sele3=selection script select third stuntdouble set",
43 " --seleoffset=INT global index offset for a second object (used\n to define a vector between sites in molecule)",
44 " --order=INT Lengendre Polynomial Order",
45 " -n, --nbins=INT Number of bins (default=`100')",
46 " -z, --nzbins=INT Number of Z bins (default=`100')",
47 " --tcorr=DOUBLE Correlation time (length of each window) in fs\n (default=`100000.0')",
48 " --nstart=INT Number of frames to skip at start of trajectory\n (default=`0')",
49 " --tsep=DOUBLE Separation time between correlation windows (0\n = no gap) (default=`0.0')",
50 " --t_apod=DOUBLE Apodization time (fs) [filters tcorr with\n exp(-t/t_apod) in Fourier-transformed\n spectroscopic functions] (default=`0.0')",
51 " --t_zerofill=DOUBLE Zero-fill time (fs) [Pads time correlation\n functions with zeros from tcorr -> t_zerofill\n in Fourier-transformed spectroscopic\n functions] (default=`0.0')",
52 " -c, --rcut=DOUBLE cutoff radius (angstroms)",
53 " --OOcut=DOUBLE Oxygen-Oxygen cutoff radius (angstroms)\n (default=`3.5')",
54 " --thetacut=DOUBLE HOO cutoff angle (degrees) (default=`30')",
55 " --OHcut=DOUBLE Oxygen-Hydrogen cutoff radius (angstroms)\n (default=`2.45')",
56 " --privilegedAxis=ENUM which axis is special for spatial analysis\n (default = z axis) (possible values=\"x\",\n \"y\", \"z\" default=`z')",
57 " --length=DOUBLE maximum length (default=`100')",
58 " --dipoleX=DOUBLE X-component of the dipole with respect to body\n frame (default=`0.0')",
59 " --dipoleY=DOUBLE Y-component of the dipole with respect to body\n frame (default=`0.0')",
60 " --dipoleZ=DOUBLE Z-component of the dipole with respect to body\n frame (default=`-1.0')",
61 " --selectionMode=ENUM How to treat objects which leave a dynamic\n selection and then return later (default =\n survival) (possible values=\"survival\",\n \"restart\" default=`survival')",
62 " --sfgPolarization=STRING SFG polarization combination: ssp, ppp, sps\n (default=`ssp')",
63 " --fermiCoupling=DOUBLE Fermi coupling [cm-1] for stretch-bend coupling\n in SFG spectra (default=`25')",
64 "\n Group: correlation function\n an option of this group is required",
65 " -s, --selecorr selection correlation function",
66 " -r, --rcorr mean squared displacement",
67 " --rcorrZ mean squared displacement binned by Z",
68 " -v, --vcorr velocity correlation function",
69 " --vcorrZ velocity correlation function along z-axis",
70 " --vcorrR velocity correlation function projected\n radially",
71 " --vaOutProdcorr Velocity - Velocity auto outer product\n correlation function",
72 " --waOutProdcorr Angular Velocity - Angular Velocity auto outer\n product correlation function",
73 " --vwOutProdcorr Velocity - Angular Velocity outer product\n correlation function",
74 " --wvOutProdcorr Angular Velocity - Velocity outer product\n correlation function",
75 " -w, --wcorr charge velocity correlation function",
76 " -d, --dcorr dipole correlation function",
77 " -l, --lcorr Lengendre correlation function",
78 " --lcorrZ Lengendre correlation function binned by Z",
79 " --cohZ Lengendre correlation function for OH bond\n vectors binned by Z",
80 " -M, --sdcorr System dipole correlation function",
81 " --r_rcorr Radial msd",
82 " --thetacorr Angular msd",
83 " --drcorr Directional msd for particles with unit vectors",
84 " --stresscorr Stress tensor correlation function",
85 " -b, --bondcorr Bond extension correlation function",
86 " -f, --freqfluccorr Frequency Fluctuation correlation function",
87 " -j, --jumptime Hydrogen bond jump time correlation function",
88 " --jumptimeZ Hydrogen bond jump time correlation function\n binned by Z",
89 " --jumptimeR Hydrogen bond jump time correlation function\n binned by R around a third selection",
90 " --persistence Hydrogen bond persistence correlation function",
91 " --pjcorr Momentum - Angular Momentum cross correlation\n function",
92 " --ftcorr Force - Torque cross correlation function",
93 " --ckcorr Charge - Kinetic energy cross correlation\n function",
94 " --cscorr Charge - Orientation order parameter\n (Cos\theta) cross correlation function",
95 " --facorr Force - Force auto correlation function",
96 " --tfcorr Torque - Force Cross correlation function",
97 " --tacorr Torque auto correlation function",
98 " --disp Displacement correlation function",
99 " --dispZ Displacement correlation function binned by Z",
100 " --current Current density auto correlation function",
101 " --onsager Onsager coefficient correlation functions",
102 " --ddisp Collective Dipole displacement function\n (Helfand moment of Current Density)",
103 " --rotAngleDisp Displacement correlation function for rotation\n angles",
104 " --meandisp mean displacement",
105 " --sfg SFG susceptibility spectrum (exciton model) -\n use molecular selections",
106 0
107};
108
109typedef enum {ARG_NO
110 , ARG_STRING
111 , ARG_INT
112 , ARG_DOUBLE
113 , ARG_ENUM
114} cmdline_parser_arg_type;
115
116static
117void clear_given (struct gengetopt_args_info *args_info);
118static
119void clear_args (struct gengetopt_args_info *args_info);
120
121static int
122cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info,
123 struct cmdline_parser_params *params, const char *additional_error);
124
125static int
126cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error);
127
128const char *cmdline_parser_privilegedAxis_values[] = {"x", "y", "z", 0}; /*< Possible values for privilegedAxis. */
129const char *cmdline_parser_selectionMode_values[] = {"survival", "restart", 0}; /*< Possible values for selectionMode. */
130
131static char *
132gengetopt_strdup (const char *s);
133
134static
135void clear_given (struct gengetopt_args_info *args_info)
136{
137 args_info->help_given = 0 ;
138 args_info->version_given = 0 ;
139 args_info->input_given = 0 ;
140 args_info->output_given = 0 ;
141 args_info->sele1_given = 0 ;
142 args_info->sele2_given = 0 ;
143 args_info->sele3_given = 0 ;
144 args_info->seleoffset_given = 0 ;
145 args_info->order_given = 0 ;
146 args_info->nbins_given = 0 ;
147 args_info->nzbins_given = 0 ;
148 args_info->tcorr_given = 0 ;
149 args_info->nstart_given = 0 ;
150 args_info->tsep_given = 0 ;
151 args_info->t_apod_given = 0 ;
152 args_info->t_zerofill_given = 0 ;
153 args_info->rcut_given = 0 ;
154 args_info->OOcut_given = 0 ;
155 args_info->thetacut_given = 0 ;
156 args_info->OHcut_given = 0 ;
157 args_info->privilegedAxis_given = 0 ;
158 args_info->length_given = 0 ;
159 args_info->dipoleX_given = 0 ;
160 args_info->dipoleY_given = 0 ;
161 args_info->dipoleZ_given = 0 ;
162 args_info->selectionMode_given = 0 ;
163 args_info->sfgPolarization_given = 0 ;
164 args_info->fermiCoupling_given = 0 ;
165 args_info->selecorr_given = 0 ;
166 args_info->rcorr_given = 0 ;
167 args_info->rcorrZ_given = 0 ;
168 args_info->vcorr_given = 0 ;
169 args_info->vcorrZ_given = 0 ;
170 args_info->vcorrR_given = 0 ;
171 args_info->vaOutProdcorr_given = 0 ;
172 args_info->waOutProdcorr_given = 0 ;
173 args_info->vwOutProdcorr_given = 0 ;
174 args_info->wvOutProdcorr_given = 0 ;
175 args_info->wcorr_given = 0 ;
176 args_info->dcorr_given = 0 ;
177 args_info->lcorr_given = 0 ;
178 args_info->lcorrZ_given = 0 ;
179 args_info->cohZ_given = 0 ;
180 args_info->sdcorr_given = 0 ;
181 args_info->r_rcorr_given = 0 ;
182 args_info->thetacorr_given = 0 ;
183 args_info->drcorr_given = 0 ;
184 args_info->stresscorr_given = 0 ;
185 args_info->bondcorr_given = 0 ;
186 args_info->freqfluccorr_given = 0 ;
187 args_info->jumptime_given = 0 ;
188 args_info->jumptimeZ_given = 0 ;
189 args_info->jumptimeR_given = 0 ;
190 args_info->persistence_given = 0 ;
191 args_info->pjcorr_given = 0 ;
192 args_info->ftcorr_given = 0 ;
193 args_info->ckcorr_given = 0 ;
194 args_info->cscorr_given = 0 ;
195 args_info->facorr_given = 0 ;
196 args_info->tfcorr_given = 0 ;
197 args_info->tacorr_given = 0 ;
198 args_info->disp_given = 0 ;
199 args_info->dispZ_given = 0 ;
200 args_info->current_given = 0 ;
201 args_info->onsager_given = 0 ;
202 args_info->ddisp_given = 0 ;
203 args_info->rotAngleDisp_given = 0 ;
204 args_info->meandisp_given = 0 ;
205 args_info->sfg_given = 0 ;
207}
208
209static
210void clear_args (struct gengetopt_args_info *args_info)
211{
212 FIX_UNUSED (args_info);
213 args_info->input_arg = NULL;
214 args_info->input_orig = NULL;
215 args_info->output_arg = NULL;
216 args_info->output_orig = NULL;
217 args_info->sele1_arg = NULL;
218 args_info->sele1_orig = NULL;
219 args_info->sele2_arg = NULL;
220 args_info->sele2_orig = NULL;
221 args_info->sele3_arg = NULL;
222 args_info->sele3_orig = NULL;
223 args_info->seleoffset_orig = NULL;
224 args_info->order_orig = NULL;
225 args_info->nbins_arg = 100;
226 args_info->nbins_orig = NULL;
227 args_info->nzbins_arg = 100;
228 args_info->nzbins_orig = NULL;
229 args_info->tcorr_arg = 100000.0;
230 args_info->tcorr_orig = NULL;
231 args_info->nstart_arg = 0;
232 args_info->nstart_orig = NULL;
233 args_info->tsep_arg = 0.0;
234 args_info->tsep_orig = NULL;
235 args_info->t_apod_arg = 0.0;
236 args_info->t_apod_orig = NULL;
237 args_info->t_zerofill_arg = 0.0;
238 args_info->t_zerofill_orig = NULL;
239 args_info->rcut_orig = NULL;
240 args_info->OOcut_arg = 3.5;
241 args_info->OOcut_orig = NULL;
242 args_info->thetacut_arg = 30;
243 args_info->thetacut_orig = NULL;
244 args_info->OHcut_arg = 2.45;
245 args_info->OHcut_orig = NULL;
246 args_info->privilegedAxis_arg = privilegedAxis_arg_z;
247 args_info->privilegedAxis_orig = NULL;
248 args_info->length_arg = 100;
249 args_info->length_orig = NULL;
250 args_info->dipoleX_arg = 0.0;
251 args_info->dipoleX_orig = NULL;
252 args_info->dipoleY_arg = 0.0;
253 args_info->dipoleY_orig = NULL;
254 args_info->dipoleZ_arg = -1.0;
255 args_info->dipoleZ_orig = NULL;
256 args_info->selectionMode_arg = selectionMode_arg_survival;
257 args_info->selectionMode_orig = NULL;
258 args_info->sfgPolarization_arg = gengetopt_strdup ("ssp");
259 args_info->sfgPolarization_orig = NULL;
260 args_info->fermiCoupling_arg = 25;
261 args_info->fermiCoupling_orig = NULL;
262
263}
264
265static
266void init_args_info(struct gengetopt_args_info *args_info)
267{
268
269
270 args_info->help_help = gengetopt_args_info_help[0] ;
271 args_info->version_help = gengetopt_args_info_help[1] ;
272 args_info->input_help = gengetopt_args_info_help[2] ;
273 args_info->output_help = gengetopt_args_info_help[3] ;
274 args_info->sele1_help = gengetopt_args_info_help[4] ;
275 args_info->sele2_help = gengetopt_args_info_help[5] ;
276 args_info->sele3_help = gengetopt_args_info_help[6] ;
277 args_info->seleoffset_help = gengetopt_args_info_help[7] ;
278 args_info->order_help = gengetopt_args_info_help[8] ;
279 args_info->nbins_help = gengetopt_args_info_help[9] ;
280 args_info->nzbins_help = gengetopt_args_info_help[10] ;
281 args_info->tcorr_help = gengetopt_args_info_help[11] ;
282 args_info->nstart_help = gengetopt_args_info_help[12] ;
283 args_info->tsep_help = gengetopt_args_info_help[13] ;
284 args_info->t_apod_help = gengetopt_args_info_help[14] ;
285 args_info->t_zerofill_help = gengetopt_args_info_help[15] ;
286 args_info->rcut_help = gengetopt_args_info_help[16] ;
287 args_info->OOcut_help = gengetopt_args_info_help[17] ;
288 args_info->thetacut_help = gengetopt_args_info_help[18] ;
289 args_info->OHcut_help = gengetopt_args_info_help[19] ;
290 args_info->privilegedAxis_help = gengetopt_args_info_help[20] ;
291 args_info->length_help = gengetopt_args_info_help[21] ;
292 args_info->dipoleX_help = gengetopt_args_info_help[22] ;
293 args_info->dipoleY_help = gengetopt_args_info_help[23] ;
294 args_info->dipoleZ_help = gengetopt_args_info_help[24] ;
295 args_info->selectionMode_help = gengetopt_args_info_help[25] ;
296 args_info->sfgPolarization_help = gengetopt_args_info_help[26] ;
297 args_info->fermiCoupling_help = gengetopt_args_info_help[27] ;
298 args_info->selecorr_help = gengetopt_args_info_help[29] ;
299 args_info->rcorr_help = gengetopt_args_info_help[30] ;
300 args_info->rcorrZ_help = gengetopt_args_info_help[31] ;
301 args_info->vcorr_help = gengetopt_args_info_help[32] ;
302 args_info->vcorrZ_help = gengetopt_args_info_help[33] ;
303 args_info->vcorrR_help = gengetopt_args_info_help[34] ;
304 args_info->vaOutProdcorr_help = gengetopt_args_info_help[35] ;
305 args_info->waOutProdcorr_help = gengetopt_args_info_help[36] ;
306 args_info->vwOutProdcorr_help = gengetopt_args_info_help[37] ;
307 args_info->wvOutProdcorr_help = gengetopt_args_info_help[38] ;
308 args_info->wcorr_help = gengetopt_args_info_help[39] ;
309 args_info->dcorr_help = gengetopt_args_info_help[40] ;
310 args_info->lcorr_help = gengetopt_args_info_help[41] ;
311 args_info->lcorrZ_help = gengetopt_args_info_help[42] ;
312 args_info->cohZ_help = gengetopt_args_info_help[43] ;
313 args_info->sdcorr_help = gengetopt_args_info_help[44] ;
314 args_info->r_rcorr_help = gengetopt_args_info_help[45] ;
315 args_info->thetacorr_help = gengetopt_args_info_help[46] ;
316 args_info->drcorr_help = gengetopt_args_info_help[47] ;
317 args_info->stresscorr_help = gengetopt_args_info_help[48] ;
318 args_info->bondcorr_help = gengetopt_args_info_help[49] ;
319 args_info->freqfluccorr_help = gengetopt_args_info_help[50] ;
320 args_info->jumptime_help = gengetopt_args_info_help[51] ;
321 args_info->jumptimeZ_help = gengetopt_args_info_help[52] ;
322 args_info->jumptimeR_help = gengetopt_args_info_help[53] ;
323 args_info->persistence_help = gengetopt_args_info_help[54] ;
324 args_info->pjcorr_help = gengetopt_args_info_help[55] ;
325 args_info->ftcorr_help = gengetopt_args_info_help[56] ;
326 args_info->ckcorr_help = gengetopt_args_info_help[57] ;
327 args_info->cscorr_help = gengetopt_args_info_help[58] ;
328 args_info->facorr_help = gengetopt_args_info_help[59] ;
329 args_info->tfcorr_help = gengetopt_args_info_help[60] ;
330 args_info->tacorr_help = gengetopt_args_info_help[61] ;
331 args_info->disp_help = gengetopt_args_info_help[62] ;
332 args_info->dispZ_help = gengetopt_args_info_help[63] ;
333 args_info->current_help = gengetopt_args_info_help[64] ;
334 args_info->onsager_help = gengetopt_args_info_help[65] ;
335 args_info->ddisp_help = gengetopt_args_info_help[66] ;
336 args_info->rotAngleDisp_help = gengetopt_args_info_help[67] ;
337 args_info->meandisp_help = gengetopt_args_info_help[68] ;
338 args_info->sfg_help = gengetopt_args_info_help[69] ;
339
340}
341
342void
344{
345 printf ("%s %s\n",
348
349 if (strlen(gengetopt_args_info_versiontext) > 0)
350 printf("\n%s\n", gengetopt_args_info_versiontext);
351}
352
353static void print_help_common(void)
354{
355 size_t len_purpose = strlen(gengetopt_args_info_purpose);
356 size_t len_usage = strlen(gengetopt_args_info_usage);
357
358 if (len_usage > 0) {
359 printf("%s\n", gengetopt_args_info_usage);
360 }
361 if (len_purpose > 0) {
362 printf("%s\n", gengetopt_args_info_purpose);
363 }
364
365 if (len_usage || len_purpose) {
366 printf("\n");
367 }
368
369 if (strlen(gengetopt_args_info_description) > 0) {
370 printf("%s\n\n", gengetopt_args_info_description);
371 }
372}
373
374void
376{
377 int i = 0;
378 print_help_common();
379 while (gengetopt_args_info_help[i])
380 printf("%s\n", gengetopt_args_info_help[i++]);
381}
382
383void
384cmdline_parser_init (struct gengetopt_args_info *args_info)
385{
386 clear_given (args_info);
387 clear_args (args_info);
388 init_args_info (args_info);
389
390 args_info->inputs = 0;
391 args_info->inputs_num = 0;
392}
393
394void
395cmdline_parser_params_init(struct cmdline_parser_params *params)
396{
397 if (params)
398 {
399 params->override = 0;
400 params->initialize = 1;
401 params->check_required = 1;
402 params->check_ambiguity = 0;
403 params->print_errors = 1;
404 }
405}
406
409{
410 struct cmdline_parser_params *params =
411 (struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params));
413 return params;
414}
415
416static void
417free_string_field (char **s)
418{
419 if (*s)
420 {
421 free (*s);
422 *s = 0;
423 }
424}
425
426
427static void
428cmdline_parser_release (struct gengetopt_args_info *args_info)
429{
430 unsigned int i;
431 free_string_field (&(args_info->input_arg));
432 free_string_field (&(args_info->input_orig));
433 free_string_field (&(args_info->output_arg));
434 free_string_field (&(args_info->output_orig));
435 free_string_field (&(args_info->sele1_arg));
436 free_string_field (&(args_info->sele1_orig));
437 free_string_field (&(args_info->sele2_arg));
438 free_string_field (&(args_info->sele2_orig));
439 free_string_field (&(args_info->sele3_arg));
440 free_string_field (&(args_info->sele3_orig));
441 free_string_field (&(args_info->seleoffset_orig));
442 free_string_field (&(args_info->order_orig));
443 free_string_field (&(args_info->nbins_orig));
444 free_string_field (&(args_info->nzbins_orig));
445 free_string_field (&(args_info->tcorr_orig));
446 free_string_field (&(args_info->nstart_orig));
447 free_string_field (&(args_info->tsep_orig));
448 free_string_field (&(args_info->t_apod_orig));
449 free_string_field (&(args_info->t_zerofill_orig));
450 free_string_field (&(args_info->rcut_orig));
451 free_string_field (&(args_info->OOcut_orig));
452 free_string_field (&(args_info->thetacut_orig));
453 free_string_field (&(args_info->OHcut_orig));
454 free_string_field (&(args_info->privilegedAxis_orig));
455 free_string_field (&(args_info->length_orig));
456 free_string_field (&(args_info->dipoleX_orig));
457 free_string_field (&(args_info->dipoleY_orig));
458 free_string_field (&(args_info->dipoleZ_orig));
459 free_string_field (&(args_info->selectionMode_orig));
460 free_string_field (&(args_info->sfgPolarization_arg));
461 free_string_field (&(args_info->sfgPolarization_orig));
462 free_string_field (&(args_info->fermiCoupling_orig));
463
464
465 for (i = 0; i < args_info->inputs_num; ++i)
466 free (args_info->inputs [i]);
467
468 if (args_info->inputs_num)
469 free (args_info->inputs);
470
471 clear_given (args_info);
472}
473
474/**
475 * @param val the value to check
476 * @param values the possible values
477 * @return the index of the matched value:
478 * -1 if no value matched,
479 * -2 if more than one value has matched
480 */
481static int
482check_possible_values(const char *val, const char *values[])
483{
484 int i, found, last;
485 size_t len;
486
487 if (!val) /* otherwise strlen() crashes below */
488 return -1; /* -1 means no argument for the option */
489
490 found = last = 0;
491
492 for (i = 0, len = strlen(val); values[i]; ++i)
493 {
494 if (strncmp(val, values[i], len) == 0)
495 {
496 ++found;
497 last = i;
498 if (strlen(values[i]) == len)
499 return i; /* exact macth no need to check more */
500 }
501 }
502
503 if (found == 1) /* one match: OK */
504 return last;
505
506 return (found ? -2 : -1); /* return many values or none matched */
507}
508
509
510static void
511write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[])
512{
513 int found = -1;
514 if (arg) {
515 if (values) {
516 found = check_possible_values(arg, values);
517 }
518 if (found >= 0)
519 fprintf(outfile, "%s=\"%s\" # %s\n", opt, arg, values[found]);
520 else
521 fprintf(outfile, "%s=\"%s\"\n", opt, arg);
522 } else {
523 fprintf(outfile, "%s\n", opt);
524 }
525}
526
527
528int
529cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info)
530{
531 int i = 0;
532
533 if (!outfile)
534 {
535 fprintf (stderr, "%s: cannot dump options to stream\n", CMDLINE_PARSER_PACKAGE);
536 return EXIT_FAILURE;
537 }
538
539 if (args_info->help_given)
540 write_into_file(outfile, "help", 0, 0 );
541 if (args_info->version_given)
542 write_into_file(outfile, "version", 0, 0 );
543 if (args_info->input_given)
544 write_into_file(outfile, "input", args_info->input_orig, 0);
545 if (args_info->output_given)
546 write_into_file(outfile, "output", args_info->output_orig, 0);
547 if (args_info->sele1_given)
548 write_into_file(outfile, "sele1", args_info->sele1_orig, 0);
549 if (args_info->sele2_given)
550 write_into_file(outfile, "sele2", args_info->sele2_orig, 0);
551 if (args_info->sele3_given)
552 write_into_file(outfile, "sele3", args_info->sele3_orig, 0);
553 if (args_info->seleoffset_given)
554 write_into_file(outfile, "seleoffset", args_info->seleoffset_orig, 0);
555 if (args_info->order_given)
556 write_into_file(outfile, "order", args_info->order_orig, 0);
557 if (args_info->nbins_given)
558 write_into_file(outfile, "nbins", args_info->nbins_orig, 0);
559 if (args_info->nzbins_given)
560 write_into_file(outfile, "nzbins", args_info->nzbins_orig, 0);
561 if (args_info->tcorr_given)
562 write_into_file(outfile, "tcorr", args_info->tcorr_orig, 0);
563 if (args_info->nstart_given)
564 write_into_file(outfile, "nstart", args_info->nstart_orig, 0);
565 if (args_info->tsep_given)
566 write_into_file(outfile, "tsep", args_info->tsep_orig, 0);
567 if (args_info->t_apod_given)
568 write_into_file(outfile, "t_apod", args_info->t_apod_orig, 0);
569 if (args_info->t_zerofill_given)
570 write_into_file(outfile, "t_zerofill", args_info->t_zerofill_orig, 0);
571 if (args_info->rcut_given)
572 write_into_file(outfile, "rcut", args_info->rcut_orig, 0);
573 if (args_info->OOcut_given)
574 write_into_file(outfile, "OOcut", args_info->OOcut_orig, 0);
575 if (args_info->thetacut_given)
576 write_into_file(outfile, "thetacut", args_info->thetacut_orig, 0);
577 if (args_info->OHcut_given)
578 write_into_file(outfile, "OHcut", args_info->OHcut_orig, 0);
579 if (args_info->privilegedAxis_given)
580 write_into_file(outfile, "privilegedAxis", args_info->privilegedAxis_orig, cmdline_parser_privilegedAxis_values);
581 if (args_info->length_given)
582 write_into_file(outfile, "length", args_info->length_orig, 0);
583 if (args_info->dipoleX_given)
584 write_into_file(outfile, "dipoleX", args_info->dipoleX_orig, 0);
585 if (args_info->dipoleY_given)
586 write_into_file(outfile, "dipoleY", args_info->dipoleY_orig, 0);
587 if (args_info->dipoleZ_given)
588 write_into_file(outfile, "dipoleZ", args_info->dipoleZ_orig, 0);
589 if (args_info->selectionMode_given)
590 write_into_file(outfile, "selectionMode", args_info->selectionMode_orig, cmdline_parser_selectionMode_values);
591 if (args_info->sfgPolarization_given)
592 write_into_file(outfile, "sfgPolarization", args_info->sfgPolarization_orig, 0);
593 if (args_info->fermiCoupling_given)
594 write_into_file(outfile, "fermiCoupling", args_info->fermiCoupling_orig, 0);
595 if (args_info->selecorr_given)
596 write_into_file(outfile, "selecorr", 0, 0 );
597 if (args_info->rcorr_given)
598 write_into_file(outfile, "rcorr", 0, 0 );
599 if (args_info->rcorrZ_given)
600 write_into_file(outfile, "rcorrZ", 0, 0 );
601 if (args_info->vcorr_given)
602 write_into_file(outfile, "vcorr", 0, 0 );
603 if (args_info->vcorrZ_given)
604 write_into_file(outfile, "vcorrZ", 0, 0 );
605 if (args_info->vcorrR_given)
606 write_into_file(outfile, "vcorrR", 0, 0 );
607 if (args_info->vaOutProdcorr_given)
608 write_into_file(outfile, "vaOutProdcorr", 0, 0 );
609 if (args_info->waOutProdcorr_given)
610 write_into_file(outfile, "waOutProdcorr", 0, 0 );
611 if (args_info->vwOutProdcorr_given)
612 write_into_file(outfile, "vwOutProdcorr", 0, 0 );
613 if (args_info->wvOutProdcorr_given)
614 write_into_file(outfile, "wvOutProdcorr", 0, 0 );
615 if (args_info->wcorr_given)
616 write_into_file(outfile, "wcorr", 0, 0 );
617 if (args_info->dcorr_given)
618 write_into_file(outfile, "dcorr", 0, 0 );
619 if (args_info->lcorr_given)
620 write_into_file(outfile, "lcorr", 0, 0 );
621 if (args_info->lcorrZ_given)
622 write_into_file(outfile, "lcorrZ", 0, 0 );
623 if (args_info->cohZ_given)
624 write_into_file(outfile, "cohZ", 0, 0 );
625 if (args_info->sdcorr_given)
626 write_into_file(outfile, "sdcorr", 0, 0 );
627 if (args_info->r_rcorr_given)
628 write_into_file(outfile, "r_rcorr", 0, 0 );
629 if (args_info->thetacorr_given)
630 write_into_file(outfile, "thetacorr", 0, 0 );
631 if (args_info->drcorr_given)
632 write_into_file(outfile, "drcorr", 0, 0 );
633 if (args_info->stresscorr_given)
634 write_into_file(outfile, "stresscorr", 0, 0 );
635 if (args_info->bondcorr_given)
636 write_into_file(outfile, "bondcorr", 0, 0 );
637 if (args_info->freqfluccorr_given)
638 write_into_file(outfile, "freqfluccorr", 0, 0 );
639 if (args_info->jumptime_given)
640 write_into_file(outfile, "jumptime", 0, 0 );
641 if (args_info->jumptimeZ_given)
642 write_into_file(outfile, "jumptimeZ", 0, 0 );
643 if (args_info->jumptimeR_given)
644 write_into_file(outfile, "jumptimeR", 0, 0 );
645 if (args_info->persistence_given)
646 write_into_file(outfile, "persistence", 0, 0 );
647 if (args_info->pjcorr_given)
648 write_into_file(outfile, "pjcorr", 0, 0 );
649 if (args_info->ftcorr_given)
650 write_into_file(outfile, "ftcorr", 0, 0 );
651 if (args_info->ckcorr_given)
652 write_into_file(outfile, "ckcorr", 0, 0 );
653 if (args_info->cscorr_given)
654 write_into_file(outfile, "cscorr", 0, 0 );
655 if (args_info->facorr_given)
656 write_into_file(outfile, "facorr", 0, 0 );
657 if (args_info->tfcorr_given)
658 write_into_file(outfile, "tfcorr", 0, 0 );
659 if (args_info->tacorr_given)
660 write_into_file(outfile, "tacorr", 0, 0 );
661 if (args_info->disp_given)
662 write_into_file(outfile, "disp", 0, 0 );
663 if (args_info->dispZ_given)
664 write_into_file(outfile, "dispZ", 0, 0 );
665 if (args_info->current_given)
666 write_into_file(outfile, "current", 0, 0 );
667 if (args_info->onsager_given)
668 write_into_file(outfile, "onsager", 0, 0 );
669 if (args_info->ddisp_given)
670 write_into_file(outfile, "ddisp", 0, 0 );
671 if (args_info->rotAngleDisp_given)
672 write_into_file(outfile, "rotAngleDisp", 0, 0 );
673 if (args_info->meandisp_given)
674 write_into_file(outfile, "meandisp", 0, 0 );
675 if (args_info->sfg_given)
676 write_into_file(outfile, "sfg", 0, 0 );
677
678
679 i = EXIT_SUCCESS;
680 return i;
681}
682
683int
684cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info)
685{
686 FILE *outfile;
687 int i = 0;
688
689 outfile = fopen(filename, "w");
690
691 if (!outfile)
692 {
693 fprintf (stderr, "%s: cannot open file for writing: %s\n", CMDLINE_PARSER_PACKAGE, filename);
694 return EXIT_FAILURE;
695 }
696
697 i = cmdline_parser_dump(outfile, args_info);
698 fclose (outfile);
699
700 return i;
701}
702
703void
705{
706 cmdline_parser_release (args_info);
707}
708
709/** @brief replacement of strdup, which is not standard */
710char *
711gengetopt_strdup (const char *s)
712{
713 char *result = 0;
714 if (!s)
715 return result;
716
717 result = (char*)malloc(strlen(s) + 1);
718 if (result == (char*)0)
719 return (char*)0;
720 strcpy(result, s);
721 return result;
722}
723
724static void
725reset_group_correlation_function(struct gengetopt_args_info *args_info)
726{
727 if (! args_info->correlation_function_group_counter)
728 return;
729
730 args_info->selecorr_given = 0 ;
731 args_info->rcorr_given = 0 ;
732 args_info->rcorrZ_given = 0 ;
733 args_info->vcorr_given = 0 ;
734 args_info->vcorrZ_given = 0 ;
735 args_info->vcorrR_given = 0 ;
736 args_info->vaOutProdcorr_given = 0 ;
737 args_info->waOutProdcorr_given = 0 ;
738 args_info->vwOutProdcorr_given = 0 ;
739 args_info->wvOutProdcorr_given = 0 ;
740 args_info->wcorr_given = 0 ;
741 args_info->dcorr_given = 0 ;
742 args_info->lcorr_given = 0 ;
743 args_info->lcorrZ_given = 0 ;
744 args_info->cohZ_given = 0 ;
745 args_info->sdcorr_given = 0 ;
746 args_info->r_rcorr_given = 0 ;
747 args_info->thetacorr_given = 0 ;
748 args_info->drcorr_given = 0 ;
749 args_info->stresscorr_given = 0 ;
750 args_info->bondcorr_given = 0 ;
751 args_info->freqfluccorr_given = 0 ;
752 args_info->jumptime_given = 0 ;
753 args_info->jumptimeZ_given = 0 ;
754 args_info->jumptimeR_given = 0 ;
755 args_info->persistence_given = 0 ;
756 args_info->pjcorr_given = 0 ;
757 args_info->ftcorr_given = 0 ;
758 args_info->ckcorr_given = 0 ;
759 args_info->cscorr_given = 0 ;
760 args_info->facorr_given = 0 ;
761 args_info->tfcorr_given = 0 ;
762 args_info->tacorr_given = 0 ;
763 args_info->disp_given = 0 ;
764 args_info->dispZ_given = 0 ;
765 args_info->current_given = 0 ;
766 args_info->onsager_given = 0 ;
767 args_info->ddisp_given = 0 ;
768 args_info->rotAngleDisp_given = 0 ;
769 args_info->meandisp_given = 0 ;
770 args_info->sfg_given = 0 ;
771
773}
774
775int
776cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info)
777{
778 return cmdline_parser2 (argc, argv, args_info, 0, 1, 1);
779}
780
781int
782cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info,
783 struct cmdline_parser_params *params)
784{
785 int result;
786 result = cmdline_parser_internal (argc, argv, args_info, params, 0);
787
788 return result;
789}
790
791int
792cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
793{
794 int result;
795 struct cmdline_parser_params params;
796
797 params.override = override;
798 params.initialize = initialize;
800 params.check_ambiguity = 0;
801 params.print_errors = 1;
802
803 result = cmdline_parser_internal (argc, argv, args_info, &params, 0);
804
805 return result;
806}
807
808int
809cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name)
810{
811 int result = EXIT_SUCCESS;
812
813 if (cmdline_parser_required2(args_info, prog_name, 0) > 0)
814 result = EXIT_FAILURE;
815
816 return result;
817}
818
819int
820cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error)
821{
822 int error_occurred = 0;
823 FIX_UNUSED (additional_error);
824
825 /* checks for required options */
826 if (! args_info->input_given)
827 {
828 fprintf (stderr, "%s: '--input' ('-i') option required%s\n", prog_name, (additional_error ? additional_error : ""));
829 error_occurred = 1;
830 }
831
832 if (args_info->correlation_function_group_counter == 0)
833 {
834 fprintf (stderr, "%s: %d options of group correlation function were given. One is required%s.\n", prog_name, args_info->correlation_function_group_counter, (additional_error ? additional_error : ""));
835 error_occurred = 1;
836 }
837
838
839 /* checks for dependences among options */
840
841 return error_occurred;
842}
843
844/*
845 * Extracted from the glibc source tree, version 2.3.6
846 *
847 * Licensed under the GPL as per the whole glibc source tree.
848 *
849 * This file was modified so that getopt_long can be called
850 * many times without risking previous memory to be spoiled.
851 *
852 * Modified by Andre Noll and Lorenzo Bettini for use in
853 * GNU gengetopt generated files.
854 *
855 */
856
857/*
858 * we must include anything we need since this file is not thought to be
859 * inserted in a file already using getopt.h
860 *
861 * Lorenzo
862 */
863
864struct option
865{
866 const char *name;
867 /* has_arg can't be an enum because some compilers complain about
868 type mismatches in all the code that assumes it is an int. */
869 int has_arg;
870 int *flag;
871 int val;
872};
873
874/* This version of `getopt' appears to the caller like standard Unix `getopt'
875 but it behaves differently for the user, since it allows the user
876 to intersperse the options with the other arguments.
877
878 As `getopt' works, it permutes the elements of ARGV so that,
879 when it is done, all the options precede everything else. Thus
880 all application programs are extended to handle flexible argument order.
881*/
882/*
883 If the field `flag' is not NULL, it points to a variable that is set
884 to the value given in the field `val' when the option is found, but
885 left unchanged if the option is not found.
886
887 To have a long-named option do something other than set an `int' to
888 a compiled-in constant, such as set a value from `custom_optarg', set the
889 option's `flag' field to zero and its `val' field to a nonzero
890 value (the equivalent single-letter option character, if there is
891 one). For long options that have a zero `flag' field, `getopt'
892 returns the contents of the `val' field. */
893
894/* Names for the values of the `has_arg' field of `struct option'. */
895#ifndef no_argument
896#define no_argument 0
897#endif
898
899#ifndef required_argument
900#define required_argument 1
901#endif
902
903#ifndef optional_argument
904#define optional_argument 2
905#endif
906
907struct custom_getopt_data {
908 /*
909 * These have exactly the same meaning as the corresponding global variables,
910 * except that they are used for the reentrant versions of getopt.
911 */
912 int custom_optind;
913 int custom_opterr;
914 int custom_optopt;
915 char *custom_optarg;
916
917 /* True if the internal members have been initialized. */
918 int initialized;
919
920 /*
921 * The next char to be scanned in the option-element in which the last option
922 * character we returned was found. This allows us to pick up the scan where
923 * we left off. If this is zero, or a null string, it means resume the scan by
924 * advancing to the next ARGV-element.
925 */
926 char *nextchar;
927
928 /*
929 * Describe the part of ARGV that contains non-options that have been skipped.
930 * `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is
931 * the index after the last of them.
932 */
933 int first_nonopt;
934 int last_nonopt;
935};
936
937/*
938 * the variables optarg, optind, opterr and optopt are renamed with
939 * the custom_ prefix so that they don't interfere with getopt ones.
940 *
941 * Moreover they're static so they are visible only from within the
942 * file where this very file will be included.
943 */
944
945/*
946 * For communication from `custom_getopt' to the caller. When `custom_getopt' finds an
947 * option that takes an argument, the argument value is returned here.
948 */
949static char *custom_optarg;
950
951/*
952 * Index in ARGV of the next element to be scanned. This is used for
953 * communication to and from the caller and for communication between
954 * successive calls to `custom_getopt'.
955 *
956 * On entry to `custom_getopt', 1 means this is the first call; initialize.
957 *
958 * When `custom_getopt' returns -1, this is the index of the first of the non-option
959 * elements that the caller should itself scan.
960 *
961 * Otherwise, `custom_optind' communicates from one call to the next how much of ARGV
962 * has been scanned so far.
963 *
964 * 1003.2 says this must be 1 before any call.
965 */
966static int custom_optind = 1;
967
968/*
969 * Callers store zero here to inhibit the error message for unrecognized
970 * options.
971 */
972static int custom_opterr = 1;
973
974/*
975 * Set to an option character which was unrecognized. This must be initialized
976 * on some systems to avoid linking in the system's own getopt implementation.
977 */
978static int custom_optopt = '?';
979
980/*
981 * Exchange two adjacent subsequences of ARGV. One subsequence is elements
982 * [first_nonopt,last_nonopt) which contains all the non-options that have been
983 * skipped so far. The other is elements [last_nonopt,custom_optind), which contains
984 * all the options processed since those non-options were skipped.
985 * `first_nonopt' and `last_nonopt' are relocated so that they describe the new
986 * indices of the non-options in ARGV after they are moved.
987 */
988static void exchange(char **argv, struct custom_getopt_data *d)
989{
990 int bottom = d->first_nonopt;
991 int middle = d->last_nonopt;
992 int top = d->custom_optind;
993 char *tem;
994
995 /*
996 * Exchange the shorter segment with the far end of the longer segment.
997 * That puts the shorter segment into the right place. It leaves the
998 * longer segment in the right place overall, but it consists of two
999 * parts that need to be swapped next.
1000 */
1001 while (top > middle && middle > bottom) {
1002 if (top - middle > middle - bottom) {
1003 /* Bottom segment is the short one. */
1004 int len = middle - bottom;
1005 int i;
1006
1007 /* Swap it with the top part of the top segment. */
1008 for (i = 0; i < len; i++) {
1009 tem = argv[bottom + i];
1010 argv[bottom + i] =
1011 argv[top - (middle - bottom) + i];
1012 argv[top - (middle - bottom) + i] = tem;
1013 }
1014 /* Exclude the moved bottom segment from further swapping. */
1015 top -= len;
1016 } else {
1017 /* Top segment is the short one. */
1018 int len = top - middle;
1019 int i;
1020
1021 /* Swap it with the bottom part of the bottom segment. */
1022 for (i = 0; i < len; i++) {
1023 tem = argv[bottom + i];
1024 argv[bottom + i] = argv[middle + i];
1025 argv[middle + i] = tem;
1026 }
1027 /* Exclude the moved top segment from further swapping. */
1028 bottom += len;
1029 }
1030 }
1031 /* Update records for the slots the non-options now occupy. */
1032 d->first_nonopt += (d->custom_optind - d->last_nonopt);
1033 d->last_nonopt = d->custom_optind;
1034}
1035
1036/* Initialize the internal data when the first call is made. */
1037static void custom_getopt_initialize(struct custom_getopt_data *d)
1038{
1039 /*
1040 * Start processing options with ARGV-element 1 (since ARGV-element 0
1041 * is the program name); the sequence of previously skipped non-option
1042 * ARGV-elements is empty.
1043 */
1044 d->first_nonopt = d->last_nonopt = d->custom_optind;
1045 d->nextchar = NULL;
1046 d->initialized = 1;
1047}
1048
1049#define NONOPTION_P (argv[d->custom_optind][0] != '-' || argv[d->custom_optind][1] == '\0')
1050
1051/* return: zero: continue, nonzero: return given value to user */
1052static int shuffle_argv(int argc, char *const *argv,const struct option *longopts,
1053 struct custom_getopt_data *d)
1054{
1055 /*
1056 * Give FIRST_NONOPT & LAST_NONOPT rational values if CUSTOM_OPTIND has been
1057 * moved back by the user (who may also have changed the arguments).
1058 */
1059 if (d->last_nonopt > d->custom_optind)
1060 d->last_nonopt = d->custom_optind;
1061 if (d->first_nonopt > d->custom_optind)
1062 d->first_nonopt = d->custom_optind;
1063 /*
1064 * If we have just processed some options following some
1065 * non-options, exchange them so that the options come first.
1066 */
1067 if (d->first_nonopt != d->last_nonopt &&
1068 d->last_nonopt != d->custom_optind)
1069 exchange((char **) argv, d);
1070 else if (d->last_nonopt != d->custom_optind)
1071 d->first_nonopt = d->custom_optind;
1072 /*
1073 * Skip any additional non-options and extend the range of
1074 * non-options previously skipped.
1075 */
1076 while (d->custom_optind < argc && NONOPTION_P)
1077 d->custom_optind++;
1078 d->last_nonopt = d->custom_optind;
1079 /*
1080 * The special ARGV-element `--' means premature end of options. Skip
1081 * it like a null option, then exchange with previous non-options as if
1082 * it were an option, then skip everything else like a non-option.
1083 */
1084 if (d->custom_optind != argc && !strcmp(argv[d->custom_optind], "--")) {
1085 d->custom_optind++;
1086 if (d->first_nonopt != d->last_nonopt
1087 && d->last_nonopt != d->custom_optind)
1088 exchange((char **) argv, d);
1089 else if (d->first_nonopt == d->last_nonopt)
1090 d->first_nonopt = d->custom_optind;
1091 d->last_nonopt = argc;
1092 d->custom_optind = argc;
1093 }
1094 /*
1095 * If we have done all the ARGV-elements, stop the scan and back over
1096 * any non-options that we skipped and permuted.
1097 */
1098 if (d->custom_optind == argc) {
1099 /*
1100 * Set the next-arg-index to point at the non-options that we
1101 * previously skipped, so the caller will digest them.
1102 */
1103 if (d->first_nonopt != d->last_nonopt)
1104 d->custom_optind = d->first_nonopt;
1105 return -1;
1106 }
1107 /*
1108 * If we have come to a non-option and did not permute it, either stop
1109 * the scan or describe it to the caller and pass it by.
1110 */
1111 if (NONOPTION_P) {
1112 d->custom_optarg = argv[d->custom_optind++];
1113 return 1;
1114 }
1115 /*
1116 * We have found another option-ARGV-element. Skip the initial
1117 * punctuation.
1118 */
1119 d->nextchar = (argv[d->custom_optind] + 1 + (longopts != NULL && argv[d->custom_optind][1] == '-'));
1120 return 0;
1121}
1122
1123/*
1124 * Check whether the ARGV-element is a long option.
1125 *
1126 * If there's a long option "fubar" and the ARGV-element is "-fu", consider
1127 * that an abbreviation of the long option, just like "--fu", and not "-f" with
1128 * arg "u".
1129 *
1130 * This distinction seems to be the most useful approach.
1131 *
1132 */
1133static int check_long_opt(int argc, char *const *argv, const char *optstring,
1134 const struct option *longopts, int *longind,
1135 int print_errors, struct custom_getopt_data *d)
1136{
1137 char *nameend;
1138 const struct option *p;
1139 const struct option *pfound = NULL;
1140 int exact = 0;
1141 int ambig = 0;
1142 int indfound = -1;
1143 int option_index;
1144
1145 for (nameend = d->nextchar; *nameend && *nameend != '='; nameend++)
1146 /* Do nothing. */ ;
1147
1148 /* Test all long options for either exact match or abbreviated matches */
1149 for (p = longopts, option_index = 0; p->name; p++, option_index++)
1150 if (!strncmp(p->name, d->nextchar, nameend - d->nextchar)) {
1151 if ((unsigned int) (nameend - d->nextchar)
1152 == (unsigned int) strlen(p->name)) {
1153 /* Exact match found. */
1154 pfound = p;
1155 indfound = option_index;
1156 exact = 1;
1157 break;
1158 } else if (pfound == NULL) {
1159 /* First nonexact match found. */
1160 pfound = p;
1161 indfound = option_index;
1162 } else if (pfound->has_arg != p->has_arg
1163 || pfound->flag != p->flag
1164 || pfound->val != p->val)
1165 /* Second or later nonexact match found. */
1166 ambig = 1;
1167 }
1168 if (ambig && !exact) {
1169 if (print_errors) {
1170 fprintf(stderr,
1171 "%s: option `%s' is ambiguous\n",
1172 argv[0], argv[d->custom_optind]);
1173 }
1174 d->nextchar += strlen(d->nextchar);
1175 d->custom_optind++;
1176 d->custom_optopt = 0;
1177 return '?';
1178 }
1179 if (pfound) {
1180 option_index = indfound;
1181 d->custom_optind++;
1182 if (*nameend) {
1183 if (pfound->has_arg != no_argument)
1184 d->custom_optarg = nameend + 1;
1185 else {
1186 if (print_errors) {
1187 if (argv[d->custom_optind - 1][1] == '-') {
1188 /* --option */
1189 fprintf(stderr, "%s: option `--%s' doesn't allow an argument\n",
1190 argv[0], pfound->name);
1191 } else {
1192 /* +option or -option */
1193 fprintf(stderr, "%s: option `%c%s' doesn't allow an argument\n",
1194 argv[0], argv[d->custom_optind - 1][0], pfound->name);
1195 }
1196
1197 }
1198 d->nextchar += strlen(d->nextchar);
1199 d->custom_optopt = pfound->val;
1200 return '?';
1201 }
1202 } else if (pfound->has_arg == required_argument) {
1203 if (d->custom_optind < argc)
1204 d->custom_optarg = argv[d->custom_optind++];
1205 else {
1206 if (print_errors) {
1207 fprintf(stderr,
1208 "%s: option `%s' requires an argument\n",
1209 argv[0],
1210 argv[d->custom_optind - 1]);
1211 }
1212 d->nextchar += strlen(d->nextchar);
1213 d->custom_optopt = pfound->val;
1214 return optstring[0] == ':' ? ':' : '?';
1215 }
1216 }
1217 d->nextchar += strlen(d->nextchar);
1218 if (longind != NULL)
1219 *longind = option_index;
1220 if (pfound->flag) {
1221 *(pfound->flag) = pfound->val;
1222 return 0;
1223 }
1224 return pfound->val;
1225 }
1226 /*
1227 * Can't find it as a long option. If this is not getopt_long_only, or
1228 * the option starts with '--' or is not a valid short option, then
1229 * it's an error. Otherwise interpret it as a short option.
1230 */
1231 if (print_errors) {
1232 if (argv[d->custom_optind][1] == '-') {
1233 /* --option */
1234 fprintf(stderr,
1235 "%s: unrecognized option `--%s'\n",
1236 argv[0], d->nextchar);
1237 } else {
1238 /* +option or -option */
1239 fprintf(stderr,
1240 "%s: unrecognized option `%c%s'\n",
1241 argv[0], argv[d->custom_optind][0],
1242 d->nextchar);
1243 }
1244 }
1245 d->nextchar = (char *) "";
1246 d->custom_optind++;
1247 d->custom_optopt = 0;
1248 return '?';
1249}
1250
1251static int check_short_opt(int argc, char *const *argv, const char *optstring,
1252 int print_errors, struct custom_getopt_data *d)
1253{
1254 char c = *d->nextchar++;
1255 const char *temp = strchr(optstring, c);
1256
1257 /* Increment `custom_optind' when we start to process its last character. */
1258 if (*d->nextchar == '\0')
1259 ++d->custom_optind;
1260 if (!temp || c == ':') {
1261 if (print_errors)
1262 fprintf(stderr, "%s: invalid option -- %c\n", argv[0], c);
1263
1264 d->custom_optopt = c;
1265 return '?';
1266 }
1267 if (temp[1] == ':') {
1268 if (temp[2] == ':') {
1269 /* This is an option that accepts an argument optionally. */
1270 if (*d->nextchar != '\0') {
1271 d->custom_optarg = d->nextchar;
1272 d->custom_optind++;
1273 } else
1274 d->custom_optarg = NULL;
1275 d->nextchar = NULL;
1276 } else {
1277 /* This is an option that requires an argument. */
1278 if (*d->nextchar != '\0') {
1279 d->custom_optarg = d->nextchar;
1280 /*
1281 * If we end this ARGV-element by taking the
1282 * rest as an arg, we must advance to the next
1283 * element now.
1284 */
1285 d->custom_optind++;
1286 } else if (d->custom_optind == argc) {
1287 if (print_errors) {
1288 fprintf(stderr,
1289 "%s: option requires an argument -- %c\n",
1290 argv[0], c);
1291 }
1292 d->custom_optopt = c;
1293 if (optstring[0] == ':')
1294 c = ':';
1295 else
1296 c = '?';
1297 } else
1298 /*
1299 * We already incremented `custom_optind' once;
1300 * increment it again when taking next ARGV-elt
1301 * as argument.
1302 */
1303 d->custom_optarg = argv[d->custom_optind++];
1304 d->nextchar = NULL;
1305 }
1306 }
1307 return c;
1308}
1309
1310/*
1311 * Scan elements of ARGV for option characters given in OPTSTRING.
1312 *
1313 * If an element of ARGV starts with '-', and is not exactly "-" or "--",
1314 * then it is an option element. The characters of this element
1315 * (aside from the initial '-') are option characters. If `getopt'
1316 * is called repeatedly, it returns successively each of the option characters
1317 * from each of the option elements.
1318 *
1319 * If `getopt' finds another option character, it returns that character,
1320 * updating `custom_optind' and `nextchar' so that the next call to `getopt' can
1321 * resume the scan with the following option character or ARGV-element.
1322 *
1323 * If there are no more option characters, `getopt' returns -1.
1324 * Then `custom_optind' is the index in ARGV of the first ARGV-element
1325 * that is not an option. (The ARGV-elements have been permuted
1326 * so that those that are not options now come last.)
1327 *
1328 * OPTSTRING is a string containing the legitimate option characters.
1329 * If an option character is seen that is not listed in OPTSTRING,
1330 * return '?' after printing an error message. If you set `custom_opterr' to
1331 * zero, the error message is suppressed but we still return '?'.
1332 *
1333 * If a char in OPTSTRING is followed by a colon, that means it wants an arg,
1334 * so the following text in the same ARGV-element, or the text of the following
1335 * ARGV-element, is returned in `custom_optarg'. Two colons mean an option that
1336 * wants an optional arg; if there is text in the current ARGV-element,
1337 * it is returned in `custom_optarg', otherwise `custom_optarg' is set to zero.
1338 *
1339 * If OPTSTRING starts with `-' or `+', it requests different methods of
1340 * handling the non-option ARGV-elements.
1341 * See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
1342 *
1343 * Long-named options begin with `--' instead of `-'.
1344 * Their names may be abbreviated as long as the abbreviation is unique
1345 * or is an exact match for some defined option. If they have an
1346 * argument, it follows the option name in the same ARGV-element, separated
1347 * from the option name by a `=', or else the in next ARGV-element.
1348 * When `getopt' finds a long-named option, it returns 0 if that option's
1349 * `flag' field is nonzero, the value of the option's `val' field
1350 * if the `flag' field is zero.
1351 *
1352 * The elements of ARGV aren't really const, because we permute them.
1353 * But we pretend they're const in the prototype to be compatible
1354 * with other systems.
1355 *
1356 * LONGOPTS is a vector of `struct option' terminated by an
1357 * element containing a name which is zero.
1358 *
1359 * LONGIND returns the index in LONGOPT of the long-named option found.
1360 * It is only valid when a long-named option has been found by the most
1361 * recent call.
1362 *
1363 * Return the option character from OPTS just read. Return -1 when there are
1364 * no more options. For unrecognized options, or options missing arguments,
1365 * `custom_optopt' is set to the option letter, and '?' is returned.
1366 *
1367 * The OPTS string is a list of characters which are recognized option letters,
1368 * optionally followed by colons, specifying that that letter takes an
1369 * argument, to be placed in `custom_optarg'.
1370 *
1371 * If a letter in OPTS is followed by two colons, its argument is optional.
1372 * This behavior is specific to the GNU `getopt'.
1373 *
1374 * The argument `--' causes premature termination of argument scanning,
1375 * explicitly telling `getopt' that there are no more options. If OPTS begins
1376 * with `--', then non-option arguments are treated as arguments to the option
1377 * '\0'. This behavior is specific to the GNU `getopt'.
1378 */
1379
1380static int getopt_internal_r(int argc, char *const *argv, const char *optstring,
1381 const struct option *longopts, int *longind,
1382 struct custom_getopt_data *d)
1383{
1384 int ret, print_errors = d->custom_opterr;
1385
1386 if (optstring[0] == ':')
1387 print_errors = 0;
1388 if (argc < 1)
1389 return -1;
1390 d->custom_optarg = NULL;
1391
1392 /*
1393 * This is a big difference with GNU getopt, since optind == 0
1394 * means initialization while here 1 means first call.
1395 */
1396 if (d->custom_optind == 0 || !d->initialized) {
1397 if (d->custom_optind == 0)
1398 d->custom_optind = 1; /* Don't scan ARGV[0], the program name. */
1399 custom_getopt_initialize(d);
1400 }
1401 if (d->nextchar == NULL || *d->nextchar == '\0') {
1402 ret = shuffle_argv(argc, argv, longopts, d);
1403 if (ret)
1404 return ret;
1405 }
1406 if (longopts && (argv[d->custom_optind][1] == '-' ))
1407 return check_long_opt(argc, argv, optstring, longopts,
1408 longind, print_errors, d);
1409 return check_short_opt(argc, argv, optstring, print_errors, d);
1410}
1411
1412static int custom_getopt_internal(int argc, char *const *argv, const char *optstring,
1413 const struct option *longopts, int *longind)
1414{
1415 int result;
1416 /* Keep a global copy of all internal members of d */
1417 static struct custom_getopt_data d;
1418
1419 d.custom_optind = custom_optind;
1420 d.custom_opterr = custom_opterr;
1421 result = getopt_internal_r(argc, argv, optstring, longopts,
1422 longind, &d);
1423 custom_optind = d.custom_optind;
1424 custom_optarg = d.custom_optarg;
1425 custom_optopt = d.custom_optopt;
1426 return result;
1427}
1428
1429static int custom_getopt_long (int argc, char *const *argv, const char *options,
1430 const struct option *long_options, int *opt_index)
1431{
1432 return custom_getopt_internal(argc, argv, options, long_options,
1433 opt_index);
1434}
1435
1436
1437static char *package_name = 0;
1438
1439/**
1440 * @brief updates an option
1441 * @param field the generic pointer to the field to update
1442 * @param orig_field the pointer to the orig field
1443 * @param field_given the pointer to the number of occurrence of this option
1444 * @param prev_given the pointer to the number of occurrence already seen
1445 * @param value the argument for this option (if null no arg was specified)
1446 * @param possible_values the possible values for this option (if specified)
1447 * @param default_value the default value (in case the option only accepts fixed values)
1448 * @param arg_type the type of this option
1449 * @param check_ambiguity @see cmdline_parser_params.check_ambiguity
1450 * @param override @see cmdline_parser_params.override
1451 * @param no_free whether to free a possible previous value
1452 * @param multiple_option whether this is a multiple option
1453 * @param long_opt the corresponding long option
1454 * @param short_opt the corresponding short option (or '-' if none)
1455 * @param additional_error possible further error specification
1456 */
1457static
1458int update_arg(void *field, char **orig_field,
1459 unsigned int *field_given, unsigned int *prev_given,
1460 char *value, const char *possible_values[],
1461 const char *default_value,
1462 cmdline_parser_arg_type arg_type,
1463 int check_ambiguity, int override,
1464 int no_free, int multiple_option,
1465 const char *long_opt, char short_opt,
1466 const char *additional_error)
1467{
1468 char *stop_char = 0;
1469 const char *val = value;
1470 int found;
1471 char **string_field;
1472 FIX_UNUSED (field);
1473
1474 stop_char = 0;
1475 found = 0;
1476
1477 if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given)))
1478 {
1479 if (short_opt != '-')
1480 fprintf (stderr, "%s: `--%s' (`-%c') option given more than once%s\n",
1481 package_name, long_opt, short_opt,
1482 (additional_error ? additional_error : ""));
1483 else
1484 fprintf (stderr, "%s: `--%s' option given more than once%s\n",
1485 package_name, long_opt,
1486 (additional_error ? additional_error : ""));
1487 return 1; /* failure */
1488 }
1489
1490 if (possible_values && (found = check_possible_values((value ? value : default_value), possible_values)) < 0)
1491 {
1492 if (short_opt != '-')
1493 fprintf (stderr, "%s: %s argument, \"%s\", for option `--%s' (`-%c')%s\n",
1494 package_name, (found == -2) ? "ambiguous" : "invalid", value, long_opt, short_opt,
1495 (additional_error ? additional_error : ""));
1496 else
1497 fprintf (stderr, "%s: %s argument, \"%s\", for option `--%s'%s\n",
1498 package_name, (found == -2) ? "ambiguous" : "invalid", value, long_opt,
1499 (additional_error ? additional_error : ""));
1500 return 1; /* failure */
1501 }
1502
1503 if (field_given && *field_given && ! override)
1504 return 0;
1505 if (prev_given)
1506 (*prev_given)++;
1507 if (field_given)
1508 (*field_given)++;
1509 if (possible_values)
1510 val = possible_values[found];
1511
1512 switch(arg_type) {
1513 case ARG_INT:
1514 if (val) *((int *)field) = strtol (val, &stop_char, 0);
1515 break;
1516 case ARG_DOUBLE:
1517 if (val) *((double *)field) = strtod (val, &stop_char);
1518 break;
1519 case ARG_ENUM:
1520 if (val) *((int *)field) = found;
1521 break;
1522 case ARG_STRING:
1523 if (val) {
1524 string_field = (char **)field;
1525 if (!no_free && *string_field)
1526 free (*string_field); /* free previous string */
1527 *string_field = gengetopt_strdup (val);
1528 }
1529 break;
1530 default:
1531 break;
1532 };
1533
1534 /* check numeric conversion */
1535 switch(arg_type) {
1536 case ARG_INT:
1537 case ARG_DOUBLE:
1538 if (val && !(stop_char && *stop_char == '\0')) {
1539 fprintf(stderr, "%s: invalid numeric value: %s\n", package_name, val);
1540 return 1; /* failure */
1541 }
1542 break;
1543 default:
1544 ;
1545 };
1546
1547 /* store the original value */
1548 switch(arg_type) {
1549 case ARG_NO:
1550 break;
1551 default:
1552 if (value && orig_field) {
1553 if (no_free) {
1554 *orig_field = value;
1555 } else {
1556 if (*orig_field)
1557 free (*orig_field); /* free previous string */
1558 *orig_field = gengetopt_strdup (value);
1559 }
1560 }
1561 };
1562
1563 return 0; /* OK */
1564}
1565
1566
1567int
1568cmdline_parser_internal (
1569 int argc, char **argv, struct gengetopt_args_info *args_info,
1570 struct cmdline_parser_params *params, const char *additional_error)
1571{
1572 int c; /* Character of the parsed option. */
1573
1574 int error_occurred = 0;
1575 struct gengetopt_args_info local_args_info;
1576
1577 int override;
1578 int initialize;
1579 int check_required;
1580 int check_ambiguity;
1581
1582 char *optarg;
1583 int optind;
1584 int opterr;
1585 int optopt;
1586
1587 package_name = argv[0];
1588
1589 /* TODO: Why is this here? It is not used anywhere. */
1590 override = params->override;
1591 FIX_UNUSED(override);
1592
1593 initialize = params->initialize;
1594 check_required = params->check_required;
1595
1596 /* TODO: Why is this here? It is not used anywhere. */
1597 check_ambiguity = params->check_ambiguity;
1598 FIX_UNUSED(check_ambiguity);
1599
1600 if (initialize)
1601 cmdline_parser_init (args_info);
1602
1603 cmdline_parser_init (&local_args_info);
1604
1605 optarg = 0;
1606 optind = 0;
1607 opterr = params->print_errors;
1608 optopt = '?';
1609
1610 while (1)
1611 {
1612 int option_index = 0;
1613
1614 static struct option long_options[] = {
1615 { "help", 0, NULL, 'h' },
1616 { "version", 0, NULL, 'V' },
1617 { "input", 1, NULL, 'i' },
1618 { "output", 1, NULL, 'o' },
1619 { "sele1", 1, NULL, 0 },
1620 { "sele2", 1, NULL, 0 },
1621 { "sele3", 1, NULL, 0 },
1622 { "seleoffset", 1, NULL, 0 },
1623 { "order", 1, NULL, 0 },
1624 { "nbins", 1, NULL, 'n' },
1625 { "nzbins", 1, NULL, 'z' },
1626 { "tcorr", 1, NULL, 0 },
1627 { "nstart", 1, NULL, 0 },
1628 { "tsep", 1, NULL, 0 },
1629 { "t_apod", 1, NULL, 0 },
1630 { "t_zerofill", 1, NULL, 0 },
1631 { "rcut", 1, NULL, 'c' },
1632 { "OOcut", 1, NULL, 0 },
1633 { "thetacut", 1, NULL, 0 },
1634 { "OHcut", 1, NULL, 0 },
1635 { "privilegedAxis", 1, NULL, 0 },
1636 { "length", 1, NULL, 0 },
1637 { "dipoleX", 1, NULL, 0 },
1638 { "dipoleY", 1, NULL, 0 },
1639 { "dipoleZ", 1, NULL, 0 },
1640 { "selectionMode", 1, NULL, 0 },
1641 { "sfgPolarization", 1, NULL, 0 },
1642 { "fermiCoupling", 1, NULL, 0 },
1643 { "selecorr", 0, NULL, 's' },
1644 { "rcorr", 0, NULL, 'r' },
1645 { "rcorrZ", 0, NULL, 0 },
1646 { "vcorr", 0, NULL, 'v' },
1647 { "vcorrZ", 0, NULL, 0 },
1648 { "vcorrR", 0, NULL, 0 },
1649 { "vaOutProdcorr", 0, NULL, 0 },
1650 { "waOutProdcorr", 0, NULL, 0 },
1651 { "vwOutProdcorr", 0, NULL, 0 },
1652 { "wvOutProdcorr", 0, NULL, 0 },
1653 { "wcorr", 0, NULL, 'w' },
1654 { "dcorr", 0, NULL, 'd' },
1655 { "lcorr", 0, NULL, 'l' },
1656 { "lcorrZ", 0, NULL, 0 },
1657 { "cohZ", 0, NULL, 0 },
1658 { "sdcorr", 0, NULL, 'M' },
1659 { "r_rcorr", 0, NULL, 0 },
1660 { "thetacorr", 0, NULL, 0 },
1661 { "drcorr", 0, NULL, 0 },
1662 { "stresscorr", 0, NULL, 0 },
1663 { "bondcorr", 0, NULL, 'b' },
1664 { "freqfluccorr", 0, NULL, 'f' },
1665 { "jumptime", 0, NULL, 'j' },
1666 { "jumptimeZ", 0, NULL, 0 },
1667 { "jumptimeR", 0, NULL, 0 },
1668 { "persistence", 0, NULL, 0 },
1669 { "pjcorr", 0, NULL, 0 },
1670 { "ftcorr", 0, NULL, 0 },
1671 { "ckcorr", 0, NULL, 0 },
1672 { "cscorr", 0, NULL, 0 },
1673 { "facorr", 0, NULL, 0 },
1674 { "tfcorr", 0, NULL, 0 },
1675 { "tacorr", 0, NULL, 0 },
1676 { "disp", 0, NULL, 0 },
1677 { "dispZ", 0, NULL, 0 },
1678 { "current", 0, NULL, 0 },
1679 { "onsager", 0, NULL, 0 },
1680 { "ddisp", 0, NULL, 0 },
1681 { "rotAngleDisp", 0, NULL, 0 },
1682 { "meandisp", 0, NULL, 0 },
1683 { "sfg", 0, NULL, 0 },
1684 { 0, 0, 0, 0 }
1685 };
1686
1687 custom_optarg = optarg;
1688 custom_optind = optind;
1689 custom_opterr = opterr;
1690 custom_optopt = optopt;
1691
1692 c = custom_getopt_long (argc, argv, "hVi:o:n:z:c:srvwdlMbfj", long_options, &option_index);
1693
1694 optarg = custom_optarg;
1695 optind = custom_optind;
1696 opterr = custom_opterr;
1697 optopt = custom_optopt;
1698
1699 if (c == -1) break; /* Exit from `while (1)' loop. */
1700
1701 switch (c)
1702 {
1703 case 'h': /* Print help and exit. */
1705 cmdline_parser_free (&local_args_info);
1706 exit (EXIT_SUCCESS);
1707
1708 case 'V': /* Print version and exit. */
1710 cmdline_parser_free (&local_args_info);
1711 exit (EXIT_SUCCESS);
1712
1713 case 'i': /* input dump file. */
1714
1715
1716 if (update_arg( (void *)&(args_info->input_arg),
1717 &(args_info->input_orig), &(args_info->input_given),
1718 &(local_args_info.input_given), optarg, 0, 0, ARG_STRING,
1719 check_ambiguity, override, 0, 0,
1720 "input", 'i',
1721 additional_error))
1722 goto failure;
1723
1724 break;
1725 case 'o': /* output file name. */
1726
1727
1728 if (update_arg( (void *)&(args_info->output_arg),
1729 &(args_info->output_orig), &(args_info->output_given),
1730 &(local_args_info.output_given), optarg, 0, 0, ARG_STRING,
1731 check_ambiguity, override, 0, 0,
1732 "output", 'o',
1733 additional_error))
1734 goto failure;
1735
1736 break;
1737 case 'n': /* Number of bins. */
1738
1739
1740 if (update_arg( (void *)&(args_info->nbins_arg),
1741 &(args_info->nbins_orig), &(args_info->nbins_given),
1742 &(local_args_info.nbins_given), optarg, 0, "100", ARG_INT,
1743 check_ambiguity, override, 0, 0,
1744 "nbins", 'n',
1745 additional_error))
1746 goto failure;
1747
1748 break;
1749 case 'z': /* Number of Z bins. */
1750
1751
1752 if (update_arg( (void *)&(args_info->nzbins_arg),
1753 &(args_info->nzbins_orig), &(args_info->nzbins_given),
1754 &(local_args_info.nzbins_given), optarg, 0, "100", ARG_INT,
1755 check_ambiguity, override, 0, 0,
1756 "nzbins", 'z',
1757 additional_error))
1758 goto failure;
1759
1760 break;
1761 case 'c': /* cutoff radius (angstroms). */
1762
1763
1764 if (update_arg( (void *)&(args_info->rcut_arg),
1765 &(args_info->rcut_orig), &(args_info->rcut_given),
1766 &(local_args_info.rcut_given), optarg, 0, 0, ARG_DOUBLE,
1767 check_ambiguity, override, 0, 0,
1768 "rcut", 'c',
1769 additional_error))
1770 goto failure;
1771
1772 break;
1773 case 's': /* selection correlation function. */
1774
1775 if (args_info->correlation_function_group_counter && override)
1776 reset_group_correlation_function (args_info);
1777 args_info->correlation_function_group_counter += 1;
1778
1779 if (update_arg( 0 ,
1780 0 , &(args_info->selecorr_given),
1781 &(local_args_info.selecorr_given), optarg, 0, 0, ARG_NO,
1782 check_ambiguity, override, 0, 0,
1783 "selecorr", 's',
1784 additional_error))
1785 goto failure;
1786
1787 break;
1788 case 'r': /* mean squared displacement. */
1789
1790 if (args_info->correlation_function_group_counter && override)
1791 reset_group_correlation_function (args_info);
1792 args_info->correlation_function_group_counter += 1;
1793
1794 if (update_arg( 0 ,
1795 0 , &(args_info->rcorr_given),
1796 &(local_args_info.rcorr_given), optarg, 0, 0, ARG_NO,
1797 check_ambiguity, override, 0, 0,
1798 "rcorr", 'r',
1799 additional_error))
1800 goto failure;
1801
1802 break;
1803 case 'v': /* velocity correlation function. */
1804
1805 if (args_info->correlation_function_group_counter && override)
1806 reset_group_correlation_function (args_info);
1807 args_info->correlation_function_group_counter += 1;
1808
1809 if (update_arg( 0 ,
1810 0 , &(args_info->vcorr_given),
1811 &(local_args_info.vcorr_given), optarg, 0, 0, ARG_NO,
1812 check_ambiguity, override, 0, 0,
1813 "vcorr", 'v',
1814 additional_error))
1815 goto failure;
1816
1817 break;
1818 case 'w': /* charge velocity correlation function. */
1819
1820 if (args_info->correlation_function_group_counter && override)
1821 reset_group_correlation_function (args_info);
1822 args_info->correlation_function_group_counter += 1;
1823
1824 if (update_arg( 0 ,
1825 0 , &(args_info->wcorr_given),
1826 &(local_args_info.wcorr_given), optarg, 0, 0, ARG_NO,
1827 check_ambiguity, override, 0, 0,
1828 "wcorr", 'w',
1829 additional_error))
1830 goto failure;
1831
1832 break;
1833 case 'd': /* dipole correlation function. */
1834
1835 if (args_info->correlation_function_group_counter && override)
1836 reset_group_correlation_function (args_info);
1837 args_info->correlation_function_group_counter += 1;
1838
1839 if (update_arg( 0 ,
1840 0 , &(args_info->dcorr_given),
1841 &(local_args_info.dcorr_given), optarg, 0, 0, ARG_NO,
1842 check_ambiguity, override, 0, 0,
1843 "dcorr", 'd',
1844 additional_error))
1845 goto failure;
1846
1847 break;
1848 case 'l': /* Lengendre correlation function. */
1849
1850 if (args_info->correlation_function_group_counter && override)
1851 reset_group_correlation_function (args_info);
1852 args_info->correlation_function_group_counter += 1;
1853
1854 if (update_arg( 0 ,
1855 0 , &(args_info->lcorr_given),
1856 &(local_args_info.lcorr_given), optarg, 0, 0, ARG_NO,
1857 check_ambiguity, override, 0, 0,
1858 "lcorr", 'l',
1859 additional_error))
1860 goto failure;
1861
1862 break;
1863 case 'M': /* System dipole correlation function. */
1864
1865 if (args_info->correlation_function_group_counter && override)
1866 reset_group_correlation_function (args_info);
1867 args_info->correlation_function_group_counter += 1;
1868
1869 if (update_arg( 0 ,
1870 0 , &(args_info->sdcorr_given),
1871 &(local_args_info.sdcorr_given), optarg, 0, 0, ARG_NO,
1872 check_ambiguity, override, 0, 0,
1873 "sdcorr", 'M',
1874 additional_error))
1875 goto failure;
1876
1877 break;
1878 case 'b': /* Bond extension correlation function. */
1879
1880 if (args_info->correlation_function_group_counter && override)
1881 reset_group_correlation_function (args_info);
1882 args_info->correlation_function_group_counter += 1;
1883
1884 if (update_arg( 0 ,
1885 0 , &(args_info->bondcorr_given),
1886 &(local_args_info.bondcorr_given), optarg, 0, 0, ARG_NO,
1887 check_ambiguity, override, 0, 0,
1888 "bondcorr", 'b',
1889 additional_error))
1890 goto failure;
1891
1892 break;
1893 case 'f': /* Frequency Fluctuation correlation function. */
1894
1895 if (args_info->correlation_function_group_counter && override)
1896 reset_group_correlation_function (args_info);
1897 args_info->correlation_function_group_counter += 1;
1898
1899 if (update_arg( 0 ,
1900 0 , &(args_info->freqfluccorr_given),
1901 &(local_args_info.freqfluccorr_given), optarg, 0, 0, ARG_NO,
1902 check_ambiguity, override, 0, 0,
1903 "freqfluccorr", 'f',
1904 additional_error))
1905 goto failure;
1906
1907 break;
1908 case 'j': /* Hydrogen bond jump time correlation function. */
1909
1910 if (args_info->correlation_function_group_counter && override)
1911 reset_group_correlation_function (args_info);
1912 args_info->correlation_function_group_counter += 1;
1913
1914 if (update_arg( 0 ,
1915 0 , &(args_info->jumptime_given),
1916 &(local_args_info.jumptime_given), optarg, 0, 0, ARG_NO,
1917 check_ambiguity, override, 0, 0,
1918 "jumptime", 'j',
1919 additional_error))
1920 goto failure;
1921
1922 break;
1923
1924 case 0: /* Long option with no short option */
1925 /* select first stuntdouble set. */
1926 if (strcmp (long_options[option_index].name, "sele1") == 0)
1927 {
1928
1929
1930 if (update_arg( (void *)&(args_info->sele1_arg),
1931 &(args_info->sele1_orig), &(args_info->sele1_given),
1932 &(local_args_info.sele1_given), optarg, 0, 0, ARG_STRING,
1933 check_ambiguity, override, 0, 0,
1934 "sele1", '-',
1935 additional_error))
1936 goto failure;
1937
1938 }
1939 /* select second stuntdouble set (if sele2 is not set, use script from sele1). */
1940 else if (strcmp (long_options[option_index].name, "sele2") == 0)
1941 {
1942
1943
1944 if (update_arg( (void *)&(args_info->sele2_arg),
1945 &(args_info->sele2_orig), &(args_info->sele2_given),
1946 &(local_args_info.sele2_given), optarg, 0, 0, ARG_STRING,
1947 check_ambiguity, override, 0, 0,
1948 "sele2", '-',
1949 additional_error))
1950 goto failure;
1951
1952 }
1953 /* select third stuntdouble set. */
1954 else if (strcmp (long_options[option_index].name, "sele3") == 0)
1955 {
1956
1957
1958 if (update_arg( (void *)&(args_info->sele3_arg),
1959 &(args_info->sele3_orig), &(args_info->sele3_given),
1960 &(local_args_info.sele3_given), optarg, 0, 0, ARG_STRING,
1961 check_ambiguity, override, 0, 0,
1962 "sele3", '-',
1963 additional_error))
1964 goto failure;
1965
1966 }
1967 /* global index offset for a second object (used to define a vector between sites in molecule). */
1968 else if (strcmp (long_options[option_index].name, "seleoffset") == 0)
1969 {
1970
1971
1972 if (update_arg( (void *)&(args_info->seleoffset_arg),
1973 &(args_info->seleoffset_orig), &(args_info->seleoffset_given),
1974 &(local_args_info.seleoffset_given), optarg, 0, 0, ARG_INT,
1975 check_ambiguity, override, 0, 0,
1976 "seleoffset", '-',
1977 additional_error))
1978 goto failure;
1979
1980 }
1981 /* Lengendre Polynomial Order. */
1982 else if (strcmp (long_options[option_index].name, "order") == 0)
1983 {
1984
1985
1986 if (update_arg( (void *)&(args_info->order_arg),
1987 &(args_info->order_orig), &(args_info->order_given),
1988 &(local_args_info.order_given), optarg, 0, 0, ARG_INT,
1989 check_ambiguity, override, 0, 0,
1990 "order", '-',
1991 additional_error))
1992 goto failure;
1993
1994 }
1995 /* Correlation time (length of each window) in fs. */
1996 else if (strcmp (long_options[option_index].name, "tcorr") == 0)
1997 {
1998
1999
2000 if (update_arg( (void *)&(args_info->tcorr_arg),
2001 &(args_info->tcorr_orig), &(args_info->tcorr_given),
2002 &(local_args_info.tcorr_given), optarg, 0, "100000.0", ARG_DOUBLE,
2003 check_ambiguity, override, 0, 0,
2004 "tcorr", '-',
2005 additional_error))
2006 goto failure;
2007
2008 }
2009 /* Number of frames to skip at start of trajectory. */
2010 else if (strcmp (long_options[option_index].name, "nstart") == 0)
2011 {
2012
2013
2014 if (update_arg( (void *)&(args_info->nstart_arg),
2015 &(args_info->nstart_orig), &(args_info->nstart_given),
2016 &(local_args_info.nstart_given), optarg, 0, "0", ARG_INT,
2017 check_ambiguity, override, 0, 0,
2018 "nstart", '-',
2019 additional_error))
2020 goto failure;
2021
2022 }
2023 /* Separation time between correlation windows (0 = no gap). */
2024 else if (strcmp (long_options[option_index].name, "tsep") == 0)
2025 {
2026
2027
2028 if (update_arg( (void *)&(args_info->tsep_arg),
2029 &(args_info->tsep_orig), &(args_info->tsep_given),
2030 &(local_args_info.tsep_given), optarg, 0, "0.0", ARG_DOUBLE,
2031 check_ambiguity, override, 0, 0,
2032 "tsep", '-',
2033 additional_error))
2034 goto failure;
2035
2036 }
2037 /* Apodization time (fs) [filters tcorr with exp(-t/t_apod) in Fourier-transformed spectroscopic functions]. */
2038 else if (strcmp (long_options[option_index].name, "t_apod") == 0)
2039 {
2040
2041
2042 if (update_arg( (void *)&(args_info->t_apod_arg),
2043 &(args_info->t_apod_orig), &(args_info->t_apod_given),
2044 &(local_args_info.t_apod_given), optarg, 0, "0.0", ARG_DOUBLE,
2045 check_ambiguity, override, 0, 0,
2046 "t_apod", '-',
2047 additional_error))
2048 goto failure;
2049
2050 }
2051 /* Zero-fill time (fs) [Pads time correlation functions with zeros from tcorr -> t_zerofill in Fourier-transformed spectroscopic functions]. */
2052 else if (strcmp (long_options[option_index].name, "t_zerofill") == 0)
2053 {
2054
2055
2056 if (update_arg( (void *)&(args_info->t_zerofill_arg),
2057 &(args_info->t_zerofill_orig), &(args_info->t_zerofill_given),
2058 &(local_args_info.t_zerofill_given), optarg, 0, "0.0", ARG_DOUBLE,
2059 check_ambiguity, override, 0, 0,
2060 "t_zerofill", '-',
2061 additional_error))
2062 goto failure;
2063
2064 }
2065 /* Oxygen-Oxygen cutoff radius (angstroms). */
2066 else if (strcmp (long_options[option_index].name, "OOcut") == 0)
2067 {
2068
2069
2070 if (update_arg( (void *)&(args_info->OOcut_arg),
2071 &(args_info->OOcut_orig), &(args_info->OOcut_given),
2072 &(local_args_info.OOcut_given), optarg, 0, "3.5", ARG_DOUBLE,
2073 check_ambiguity, override, 0, 0,
2074 "OOcut", '-',
2075 additional_error))
2076 goto failure;
2077
2078 }
2079 /* HOO cutoff angle (degrees). */
2080 else if (strcmp (long_options[option_index].name, "thetacut") == 0)
2081 {
2082
2083
2084 if (update_arg( (void *)&(args_info->thetacut_arg),
2085 &(args_info->thetacut_orig), &(args_info->thetacut_given),
2086 &(local_args_info.thetacut_given), optarg, 0, "30", ARG_DOUBLE,
2087 check_ambiguity, override, 0, 0,
2088 "thetacut", '-',
2089 additional_error))
2090 goto failure;
2091
2092 }
2093 /* Oxygen-Hydrogen cutoff radius (angstroms). */
2094 else if (strcmp (long_options[option_index].name, "OHcut") == 0)
2095 {
2096
2097
2098 if (update_arg( (void *)&(args_info->OHcut_arg),
2099 &(args_info->OHcut_orig), &(args_info->OHcut_given),
2100 &(local_args_info.OHcut_given), optarg, 0, "2.45", ARG_DOUBLE,
2101 check_ambiguity, override, 0, 0,
2102 "OHcut", '-',
2103 additional_error))
2104 goto failure;
2105
2106 }
2107 /* which axis is special for spatial analysis (default = z axis). */
2108 else if (strcmp (long_options[option_index].name, "privilegedAxis") == 0)
2109 {
2110
2111
2112 if (update_arg( (void *)&(args_info->privilegedAxis_arg),
2113 &(args_info->privilegedAxis_orig), &(args_info->privilegedAxis_given),
2114 &(local_args_info.privilegedAxis_given), optarg, cmdline_parser_privilegedAxis_values, "z", ARG_ENUM,
2115 check_ambiguity, override, 0, 0,
2116 "privilegedAxis", '-',
2117 additional_error))
2118 goto failure;
2119
2120 }
2121 /* maximum length. */
2122 else if (strcmp (long_options[option_index].name, "length") == 0)
2123 {
2124
2125
2126 if (update_arg( (void *)&(args_info->length_arg),
2127 &(args_info->length_orig), &(args_info->length_given),
2128 &(local_args_info.length_given), optarg, 0, "100", ARG_DOUBLE,
2129 check_ambiguity, override, 0, 0,
2130 "length", '-',
2131 additional_error))
2132 goto failure;
2133
2134 }
2135 /* X-component of the dipole with respect to body frame. */
2136 else if (strcmp (long_options[option_index].name, "dipoleX") == 0)
2137 {
2138
2139
2140 if (update_arg( (void *)&(args_info->dipoleX_arg),
2141 &(args_info->dipoleX_orig), &(args_info->dipoleX_given),
2142 &(local_args_info.dipoleX_given), optarg, 0, "0.0", ARG_DOUBLE,
2143 check_ambiguity, override, 0, 0,
2144 "dipoleX", '-',
2145 additional_error))
2146 goto failure;
2147
2148 }
2149 /* Y-component of the dipole with respect to body frame. */
2150 else if (strcmp (long_options[option_index].name, "dipoleY") == 0)
2151 {
2152
2153
2154 if (update_arg( (void *)&(args_info->dipoleY_arg),
2155 &(args_info->dipoleY_orig), &(args_info->dipoleY_given),
2156 &(local_args_info.dipoleY_given), optarg, 0, "0.0", ARG_DOUBLE,
2157 check_ambiguity, override, 0, 0,
2158 "dipoleY", '-',
2159 additional_error))
2160 goto failure;
2161
2162 }
2163 /* Z-component of the dipole with respect to body frame. */
2164 else if (strcmp (long_options[option_index].name, "dipoleZ") == 0)
2165 {
2166
2167
2168 if (update_arg( (void *)&(args_info->dipoleZ_arg),
2169 &(args_info->dipoleZ_orig), &(args_info->dipoleZ_given),
2170 &(local_args_info.dipoleZ_given), optarg, 0, "-1.0", ARG_DOUBLE,
2171 check_ambiguity, override, 0, 0,
2172 "dipoleZ", '-',
2173 additional_error))
2174 goto failure;
2175
2176 }
2177 /* How to treat objects which leave a dynamic selection and then return later (default = survival). */
2178 else if (strcmp (long_options[option_index].name, "selectionMode") == 0)
2179 {
2180
2181
2182 if (update_arg( (void *)&(args_info->selectionMode_arg),
2183 &(args_info->selectionMode_orig), &(args_info->selectionMode_given),
2184 &(local_args_info.selectionMode_given), optarg, cmdline_parser_selectionMode_values, "survival", ARG_ENUM,
2185 check_ambiguity, override, 0, 0,
2186 "selectionMode", '-',
2187 additional_error))
2188 goto failure;
2189
2190 }
2191 /* SFG polarization combination: ssp, ppp, sps. */
2192 else if (strcmp (long_options[option_index].name, "sfgPolarization") == 0)
2193 {
2194
2195
2196 if (update_arg( (void *)&(args_info->sfgPolarization_arg),
2197 &(args_info->sfgPolarization_orig), &(args_info->sfgPolarization_given),
2198 &(local_args_info.sfgPolarization_given), optarg, 0, "ssp", ARG_STRING,
2199 check_ambiguity, override, 0, 0,
2200 "sfgPolarization", '-',
2201 additional_error))
2202 goto failure;
2203
2204 }
2205 /* Fermi coupling [cm-1] for stretch-bend coupling in SFG spectra. */
2206 else if (strcmp (long_options[option_index].name, "fermiCoupling") == 0)
2207 {
2208
2209
2210 if (update_arg( (void *)&(args_info->fermiCoupling_arg),
2211 &(args_info->fermiCoupling_orig), &(args_info->fermiCoupling_given),
2212 &(local_args_info.fermiCoupling_given), optarg, 0, "25", ARG_DOUBLE,
2213 check_ambiguity, override, 0, 0,
2214 "fermiCoupling", '-',
2215 additional_error))
2216 goto failure;
2217
2218 }
2219 /* mean squared displacement binned by Z. */
2220 else if (strcmp (long_options[option_index].name, "rcorrZ") == 0)
2221 {
2222
2223 if (args_info->correlation_function_group_counter && override)
2224 reset_group_correlation_function (args_info);
2225 args_info->correlation_function_group_counter += 1;
2226
2227 if (update_arg( 0 ,
2228 0 , &(args_info->rcorrZ_given),
2229 &(local_args_info.rcorrZ_given), optarg, 0, 0, ARG_NO,
2230 check_ambiguity, override, 0, 0,
2231 "rcorrZ", '-',
2232 additional_error))
2233 goto failure;
2234
2235 }
2236 /* velocity correlation function along z-axis. */
2237 else if (strcmp (long_options[option_index].name, "vcorrZ") == 0)
2238 {
2239
2240 if (args_info->correlation_function_group_counter && override)
2241 reset_group_correlation_function (args_info);
2242 args_info->correlation_function_group_counter += 1;
2243
2244 if (update_arg( 0 ,
2245 0 , &(args_info->vcorrZ_given),
2246 &(local_args_info.vcorrZ_given), optarg, 0, 0, ARG_NO,
2247 check_ambiguity, override, 0, 0,
2248 "vcorrZ", '-',
2249 additional_error))
2250 goto failure;
2251
2252 }
2253 /* velocity correlation function projected radially. */
2254 else if (strcmp (long_options[option_index].name, "vcorrR") == 0)
2255 {
2256
2257 if (args_info->correlation_function_group_counter && override)
2258 reset_group_correlation_function (args_info);
2259 args_info->correlation_function_group_counter += 1;
2260
2261 if (update_arg( 0 ,
2262 0 , &(args_info->vcorrR_given),
2263 &(local_args_info.vcorrR_given), optarg, 0, 0, ARG_NO,
2264 check_ambiguity, override, 0, 0,
2265 "vcorrR", '-',
2266 additional_error))
2267 goto failure;
2268
2269 }
2270 /* Velocity - Velocity auto outer product correlation function. */
2271 else if (strcmp (long_options[option_index].name, "vaOutProdcorr") == 0)
2272 {
2273
2274 if (args_info->correlation_function_group_counter && override)
2275 reset_group_correlation_function (args_info);
2276 args_info->correlation_function_group_counter += 1;
2277
2278 if (update_arg( 0 ,
2279 0 , &(args_info->vaOutProdcorr_given),
2280 &(local_args_info.vaOutProdcorr_given), optarg, 0, 0, ARG_NO,
2281 check_ambiguity, override, 0, 0,
2282 "vaOutProdcorr", '-',
2283 additional_error))
2284 goto failure;
2285
2286 }
2287 /* Angular Velocity - Angular Velocity auto outer product correlation function. */
2288 else if (strcmp (long_options[option_index].name, "waOutProdcorr") == 0)
2289 {
2290
2291 if (args_info->correlation_function_group_counter && override)
2292 reset_group_correlation_function (args_info);
2293 args_info->correlation_function_group_counter += 1;
2294
2295 if (update_arg( 0 ,
2296 0 , &(args_info->waOutProdcorr_given),
2297 &(local_args_info.waOutProdcorr_given), optarg, 0, 0, ARG_NO,
2298 check_ambiguity, override, 0, 0,
2299 "waOutProdcorr", '-',
2300 additional_error))
2301 goto failure;
2302
2303 }
2304 /* Velocity - Angular Velocity outer product correlation function. */
2305 else if (strcmp (long_options[option_index].name, "vwOutProdcorr") == 0)
2306 {
2307
2308 if (args_info->correlation_function_group_counter && override)
2309 reset_group_correlation_function (args_info);
2310 args_info->correlation_function_group_counter += 1;
2311
2312 if (update_arg( 0 ,
2313 0 , &(args_info->vwOutProdcorr_given),
2314 &(local_args_info.vwOutProdcorr_given), optarg, 0, 0, ARG_NO,
2315 check_ambiguity, override, 0, 0,
2316 "vwOutProdcorr", '-',
2317 additional_error))
2318 goto failure;
2319
2320 }
2321 /* Angular Velocity - Velocity outer product correlation function. */
2322 else if (strcmp (long_options[option_index].name, "wvOutProdcorr") == 0)
2323 {
2324
2325 if (args_info->correlation_function_group_counter && override)
2326 reset_group_correlation_function (args_info);
2327 args_info->correlation_function_group_counter += 1;
2328
2329 if (update_arg( 0 ,
2330 0 , &(args_info->wvOutProdcorr_given),
2331 &(local_args_info.wvOutProdcorr_given), optarg, 0, 0, ARG_NO,
2332 check_ambiguity, override, 0, 0,
2333 "wvOutProdcorr", '-',
2334 additional_error))
2335 goto failure;
2336
2337 }
2338 /* Lengendre correlation function binned by Z. */
2339 else if (strcmp (long_options[option_index].name, "lcorrZ") == 0)
2340 {
2341
2342 if (args_info->correlation_function_group_counter && override)
2343 reset_group_correlation_function (args_info);
2344 args_info->correlation_function_group_counter += 1;
2345
2346 if (update_arg( 0 ,
2347 0 , &(args_info->lcorrZ_given),
2348 &(local_args_info.lcorrZ_given), optarg, 0, 0, ARG_NO,
2349 check_ambiguity, override, 0, 0,
2350 "lcorrZ", '-',
2351 additional_error))
2352 goto failure;
2353
2354 }
2355 /* Lengendre correlation function for OH bond vectors binned by Z. */
2356 else if (strcmp (long_options[option_index].name, "cohZ") == 0)
2357 {
2358
2359 if (args_info->correlation_function_group_counter && override)
2360 reset_group_correlation_function (args_info);
2361 args_info->correlation_function_group_counter += 1;
2362
2363 if (update_arg( 0 ,
2364 0 , &(args_info->cohZ_given),
2365 &(local_args_info.cohZ_given), optarg, 0, 0, ARG_NO,
2366 check_ambiguity, override, 0, 0,
2367 "cohZ", '-',
2368 additional_error))
2369 goto failure;
2370
2371 }
2372 /* Radial msd. */
2373 else if (strcmp (long_options[option_index].name, "r_rcorr") == 0)
2374 {
2375
2376 if (args_info->correlation_function_group_counter && override)
2377 reset_group_correlation_function (args_info);
2378 args_info->correlation_function_group_counter += 1;
2379
2380 if (update_arg( 0 ,
2381 0 , &(args_info->r_rcorr_given),
2382 &(local_args_info.r_rcorr_given), optarg, 0, 0, ARG_NO,
2383 check_ambiguity, override, 0, 0,
2384 "r_rcorr", '-',
2385 additional_error))
2386 goto failure;
2387
2388 }
2389 /* Angular msd. */
2390 else if (strcmp (long_options[option_index].name, "thetacorr") == 0)
2391 {
2392
2393 if (args_info->correlation_function_group_counter && override)
2394 reset_group_correlation_function (args_info);
2395 args_info->correlation_function_group_counter += 1;
2396
2397 if (update_arg( 0 ,
2398 0 , &(args_info->thetacorr_given),
2399 &(local_args_info.thetacorr_given), optarg, 0, 0, ARG_NO,
2400 check_ambiguity, override, 0, 0,
2401 "thetacorr", '-',
2402 additional_error))
2403 goto failure;
2404
2405 }
2406 /* Directional msd for particles with unit vectors. */
2407 else if (strcmp (long_options[option_index].name, "drcorr") == 0)
2408 {
2409
2410 if (args_info->correlation_function_group_counter && override)
2411 reset_group_correlation_function (args_info);
2412 args_info->correlation_function_group_counter += 1;
2413
2414 if (update_arg( 0 ,
2415 0 , &(args_info->drcorr_given),
2416 &(local_args_info.drcorr_given), optarg, 0, 0, ARG_NO,
2417 check_ambiguity, override, 0, 0,
2418 "drcorr", '-',
2419 additional_error))
2420 goto failure;
2421
2422 }
2423 /* Stress tensor correlation function. */
2424 else if (strcmp (long_options[option_index].name, "stresscorr") == 0)
2425 {
2426
2427 if (args_info->correlation_function_group_counter && override)
2428 reset_group_correlation_function (args_info);
2429 args_info->correlation_function_group_counter += 1;
2430
2431 if (update_arg( 0 ,
2432 0 , &(args_info->stresscorr_given),
2433 &(local_args_info.stresscorr_given), optarg, 0, 0, ARG_NO,
2434 check_ambiguity, override, 0, 0,
2435 "stresscorr", '-',
2436 additional_error))
2437 goto failure;
2438
2439 }
2440 /* Hydrogen bond jump time correlation function binned by Z. */
2441 else if (strcmp (long_options[option_index].name, "jumptimeZ") == 0)
2442 {
2443
2444 if (args_info->correlation_function_group_counter && override)
2445 reset_group_correlation_function (args_info);
2446 args_info->correlation_function_group_counter += 1;
2447
2448 if (update_arg( 0 ,
2449 0 , &(args_info->jumptimeZ_given),
2450 &(local_args_info.jumptimeZ_given), optarg, 0, 0, ARG_NO,
2451 check_ambiguity, override, 0, 0,
2452 "jumptimeZ", '-',
2453 additional_error))
2454 goto failure;
2455
2456 }
2457 /* Hydrogen bond jump time correlation function binned by R around a third selection. */
2458 else if (strcmp (long_options[option_index].name, "jumptimeR") == 0)
2459 {
2460
2461 if (args_info->correlation_function_group_counter && override)
2462 reset_group_correlation_function (args_info);
2463 args_info->correlation_function_group_counter += 1;
2464
2465 if (update_arg( 0 ,
2466 0 , &(args_info->jumptimeR_given),
2467 &(local_args_info.jumptimeR_given), optarg, 0, 0, ARG_NO,
2468 check_ambiguity, override, 0, 0,
2469 "jumptimeR", '-',
2470 additional_error))
2471 goto failure;
2472
2473 }
2474 /* Hydrogen bond persistence correlation function. */
2475 else if (strcmp (long_options[option_index].name, "persistence") == 0)
2476 {
2477
2478 if (args_info->correlation_function_group_counter && override)
2479 reset_group_correlation_function (args_info);
2480 args_info->correlation_function_group_counter += 1;
2481
2482 if (update_arg( 0 ,
2483 0 , &(args_info->persistence_given),
2484 &(local_args_info.persistence_given), optarg, 0, 0, ARG_NO,
2485 check_ambiguity, override, 0, 0,
2486 "persistence", '-',
2487 additional_error))
2488 goto failure;
2489
2490 }
2491 /* Momentum - Angular Momentum cross correlation function. */
2492 else if (strcmp (long_options[option_index].name, "pjcorr") == 0)
2493 {
2494
2495 if (args_info->correlation_function_group_counter && override)
2496 reset_group_correlation_function (args_info);
2497 args_info->correlation_function_group_counter += 1;
2498
2499 if (update_arg( 0 ,
2500 0 , &(args_info->pjcorr_given),
2501 &(local_args_info.pjcorr_given), optarg, 0, 0, ARG_NO,
2502 check_ambiguity, override, 0, 0,
2503 "pjcorr", '-',
2504 additional_error))
2505 goto failure;
2506
2507 }
2508 /* Force - Torque cross correlation function. */
2509 else if (strcmp (long_options[option_index].name, "ftcorr") == 0)
2510 {
2511
2512 if (args_info->correlation_function_group_counter && override)
2513 reset_group_correlation_function (args_info);
2514 args_info->correlation_function_group_counter += 1;
2515
2516 if (update_arg( 0 ,
2517 0 , &(args_info->ftcorr_given),
2518 &(local_args_info.ftcorr_given), optarg, 0, 0, ARG_NO,
2519 check_ambiguity, override, 0, 0,
2520 "ftcorr", '-',
2521 additional_error))
2522 goto failure;
2523
2524 }
2525 /* Charge - Kinetic energy cross correlation function. */
2526 else if (strcmp (long_options[option_index].name, "ckcorr") == 0)
2527 {
2528
2529 if (args_info->correlation_function_group_counter && override)
2530 reset_group_correlation_function (args_info);
2531 args_info->correlation_function_group_counter += 1;
2532
2533 if (update_arg( 0 ,
2534 0 , &(args_info->ckcorr_given),
2535 &(local_args_info.ckcorr_given), optarg, 0, 0, ARG_NO,
2536 check_ambiguity, override, 0, 0,
2537 "ckcorr", '-',
2538 additional_error))
2539 goto failure;
2540
2541 }
2542 /* Charge - Orientation order parameter (Cos\theta) cross correlation function. */
2543 else if (strcmp (long_options[option_index].name, "cscorr") == 0)
2544 {
2545
2546 if (args_info->correlation_function_group_counter && override)
2547 reset_group_correlation_function (args_info);
2548 args_info->correlation_function_group_counter += 1;
2549
2550 if (update_arg( 0 ,
2551 0 , &(args_info->cscorr_given),
2552 &(local_args_info.cscorr_given), optarg, 0, 0, ARG_NO,
2553 check_ambiguity, override, 0, 0,
2554 "cscorr", '-',
2555 additional_error))
2556 goto failure;
2557
2558 }
2559 /* Force - Force auto correlation function. */
2560 else if (strcmp (long_options[option_index].name, "facorr") == 0)
2561 {
2562
2563 if (args_info->correlation_function_group_counter && override)
2564 reset_group_correlation_function (args_info);
2565 args_info->correlation_function_group_counter += 1;
2566
2567 if (update_arg( 0 ,
2568 0 , &(args_info->facorr_given),
2569 &(local_args_info.facorr_given), optarg, 0, 0, ARG_NO,
2570 check_ambiguity, override, 0, 0,
2571 "facorr", '-',
2572 additional_error))
2573 goto failure;
2574
2575 }
2576 /* Torque - Force Cross correlation function. */
2577 else if (strcmp (long_options[option_index].name, "tfcorr") == 0)
2578 {
2579
2580 if (args_info->correlation_function_group_counter && override)
2581 reset_group_correlation_function (args_info);
2582 args_info->correlation_function_group_counter += 1;
2583
2584 if (update_arg( 0 ,
2585 0 , &(args_info->tfcorr_given),
2586 &(local_args_info.tfcorr_given), optarg, 0, 0, ARG_NO,
2587 check_ambiguity, override, 0, 0,
2588 "tfcorr", '-',
2589 additional_error))
2590 goto failure;
2591
2592 }
2593 /* Torque auto correlation function. */
2594 else if (strcmp (long_options[option_index].name, "tacorr") == 0)
2595 {
2596
2597 if (args_info->correlation_function_group_counter && override)
2598 reset_group_correlation_function (args_info);
2599 args_info->correlation_function_group_counter += 1;
2600
2601 if (update_arg( 0 ,
2602 0 , &(args_info->tacorr_given),
2603 &(local_args_info.tacorr_given), optarg, 0, 0, ARG_NO,
2604 check_ambiguity, override, 0, 0,
2605 "tacorr", '-',
2606 additional_error))
2607 goto failure;
2608
2609 }
2610 /* Displacement correlation function. */
2611 else if (strcmp (long_options[option_index].name, "disp") == 0)
2612 {
2613
2614 if (args_info->correlation_function_group_counter && override)
2615 reset_group_correlation_function (args_info);
2616 args_info->correlation_function_group_counter += 1;
2617
2618 if (update_arg( 0 ,
2619 0 , &(args_info->disp_given),
2620 &(local_args_info.disp_given), optarg, 0, 0, ARG_NO,
2621 check_ambiguity, override, 0, 0,
2622 "disp", '-',
2623 additional_error))
2624 goto failure;
2625
2626 }
2627 /* Displacement correlation function binned by Z. */
2628 else if (strcmp (long_options[option_index].name, "dispZ") == 0)
2629 {
2630
2631 if (args_info->correlation_function_group_counter && override)
2632 reset_group_correlation_function (args_info);
2633 args_info->correlation_function_group_counter += 1;
2634
2635 if (update_arg( 0 ,
2636 0 , &(args_info->dispZ_given),
2637 &(local_args_info.dispZ_given), optarg, 0, 0, ARG_NO,
2638 check_ambiguity, override, 0, 0,
2639 "dispZ", '-',
2640 additional_error))
2641 goto failure;
2642
2643 }
2644 /* Current density auto correlation function. */
2645 else if (strcmp (long_options[option_index].name, "current") == 0)
2646 {
2647
2648 if (args_info->correlation_function_group_counter && override)
2649 reset_group_correlation_function (args_info);
2650 args_info->correlation_function_group_counter += 1;
2651
2652 if (update_arg( 0 ,
2653 0 , &(args_info->current_given),
2654 &(local_args_info.current_given), optarg, 0, 0, ARG_NO,
2655 check_ambiguity, override, 0, 0,
2656 "current", '-',
2657 additional_error))
2658 goto failure;
2659
2660 }
2661 /* Onsager coefficient correlation functions. */
2662 else if (strcmp (long_options[option_index].name, "onsager") == 0)
2663 {
2664
2665 if (args_info->correlation_function_group_counter && override)
2666 reset_group_correlation_function (args_info);
2667 args_info->correlation_function_group_counter += 1;
2668
2669 if (update_arg( 0 ,
2670 0 , &(args_info->onsager_given),
2671 &(local_args_info.onsager_given), optarg, 0, 0, ARG_NO,
2672 check_ambiguity, override, 0, 0,
2673 "onsager", '-',
2674 additional_error))
2675 goto failure;
2676
2677 }
2678 /* Collective Dipole displacement function (Helfand moment of Current Density). */
2679 else if (strcmp (long_options[option_index].name, "ddisp") == 0)
2680 {
2681
2682 if (args_info->correlation_function_group_counter && override)
2683 reset_group_correlation_function (args_info);
2684 args_info->correlation_function_group_counter += 1;
2685
2686 if (update_arg( 0 ,
2687 0 , &(args_info->ddisp_given),
2688 &(local_args_info.ddisp_given), optarg, 0, 0, ARG_NO,
2689 check_ambiguity, override, 0, 0,
2690 "ddisp", '-',
2691 additional_error))
2692 goto failure;
2693
2694 }
2695 /* Displacement correlation function for rotation angles. */
2696 else if (strcmp (long_options[option_index].name, "rotAngleDisp") == 0)
2697 {
2698
2699 if (args_info->correlation_function_group_counter && override)
2700 reset_group_correlation_function (args_info);
2701 args_info->correlation_function_group_counter += 1;
2702
2703 if (update_arg( 0 ,
2704 0 , &(args_info->rotAngleDisp_given),
2705 &(local_args_info.rotAngleDisp_given), optarg, 0, 0, ARG_NO,
2706 check_ambiguity, override, 0, 0,
2707 "rotAngleDisp", '-',
2708 additional_error))
2709 goto failure;
2710
2711 }
2712 /* mean displacement. */
2713 else if (strcmp (long_options[option_index].name, "meandisp") == 0)
2714 {
2715
2716 if (args_info->correlation_function_group_counter && override)
2717 reset_group_correlation_function (args_info);
2718 args_info->correlation_function_group_counter += 1;
2719
2720 if (update_arg( 0 ,
2721 0 , &(args_info->meandisp_given),
2722 &(local_args_info.meandisp_given), optarg, 0, 0, ARG_NO,
2723 check_ambiguity, override, 0, 0,
2724 "meandisp", '-',
2725 additional_error))
2726 goto failure;
2727
2728 }
2729 /* SFG susceptibility spectrum (exciton model) - use molecular selections. */
2730 else if (strcmp (long_options[option_index].name, "sfg") == 0)
2731 {
2732
2733 if (args_info->correlation_function_group_counter && override)
2734 reset_group_correlation_function (args_info);
2735 args_info->correlation_function_group_counter += 1;
2736
2737 if (update_arg( 0 ,
2738 0 , &(args_info->sfg_given),
2739 &(local_args_info.sfg_given), optarg, 0, 0, ARG_NO,
2740 check_ambiguity, override, 0, 0,
2741 "sfg", '-',
2742 additional_error))
2743 goto failure;
2744
2745 }
2746
2747 break;
2748 case '?': /* Invalid option. */
2749 /* `getopt_long' already printed an error message. */
2750 goto failure;
2751
2752 default: /* bug: option not considered. */
2753 fprintf (stderr, "%s: option unknown: %c%s\n", CMDLINE_PARSER_PACKAGE, c, (additional_error ? additional_error : ""));
2754 abort ();
2755 } /* switch */
2756 } /* while */
2757
2758 if (args_info->correlation_function_group_counter > 1)
2759 {
2760 fprintf (stderr, "%s: %d options of group correlation function were given. One is required%s.\n", argv[0], args_info->correlation_function_group_counter, (additional_error ? additional_error : ""));
2761 error_occurred = 1;
2762 }
2763
2764
2765
2766 if (check_required)
2767 {
2768 error_occurred += cmdline_parser_required2 (args_info, argv[0], additional_error);
2769 }
2770
2771 cmdline_parser_release (&local_args_info);
2772
2773 if ( error_occurred )
2774 return (EXIT_FAILURE);
2775
2776 if (optind < argc)
2777 {
2778 int i = 0 ;
2779 int found_prog_name = 0;
2780 /* whether program name, i.e., argv[0], is in the remaining args
2781 (this may happen with some implementations of getopt,
2782 but surely not with the one included by gengetopt) */
2783
2784
2785 args_info->inputs_num = argc - optind - found_prog_name;
2786 args_info->inputs =
2787 (char **)(malloc ((args_info->inputs_num)*sizeof(char *))) ;
2788 while (optind < argc)
2789 args_info->inputs[ i++ ] = gengetopt_strdup (argv[optind++]) ;
2790 }
2791
2792 return 0;
2793
2794failure:
2795
2796 cmdline_parser_release (&local_args_info);
2797 return (EXIT_FAILURE);
2798}
2799/* vim: set ft=c noet ts=8 sts=8 sw=8 tw=80 nojs spell : */
#define CMDLINE_PARSER_VERSION
the program version
void cmdline_parser_print_version(void)
Print the version.
struct cmdline_parser_params * cmdline_parser_params_create(void)
Allocates dynamically a cmdline_parser_params structure and initializes all its fields to their defau...
void cmdline_parser_print_help(void)
Print the help.
#define CMDLINE_PARSER_PACKAGE_NAME
the complete program name (used for help and version)
#define CMDLINE_PARSER_PACKAGE
the program name (used for printing errors)
The header file for the command line option parser generated by GNU Gengetopt version 2....
The additional parameters to pass to parser functions.
int print_errors
whether getopt_long should print an error message for a bad option (default 1)
int check_required
whether to check that all required options were provided (default 1)
int check_ambiguity
whether to check for options already specified in the option structure gengetopt_args_info (default 0...
int initialize
whether to initialize the option structure gengetopt_args_info (default 1)
int override
whether to override possibly already present options (default 0)
Where the command line options are stored.
unsigned int jumptimeZ_given
Whether jumptimeZ was given.
const char * jumptimeZ_help
Hydrogen bond jump time correlation function binned by Z help description.
char * sele2_arg
select second stuntdouble set (if sele2 is not set, use script from sele1).
const char * vwOutProdcorr_help
Velocity - Angular Velocity outer product correlation function help description.
unsigned int persistence_given
Whether persistence was given.
char * nbins_orig
Number of bins original value given at command line.
char * dipoleX_orig
X-component of the dipole with respect to body frame original value given at command line.
unsigned int freqfluccorr_given
Whether freqfluccorr was given.
unsigned int r_rcorr_given
Whether r_rcorr was given.
unsigned int output_given
Whether output was given.
const char * ckcorr_help
Charge - Kinetic energy cross correlation function help description.
unsigned int vcorrZ_given
Whether vcorrZ was given.
const char * ftcorr_help
Force - Torque cross correlation function help description.
unsigned int privilegedAxis_given
Whether privilegedAxis was given.
unsigned int drcorr_given
Whether drcorr was given.
unsigned int selecorr_given
Whether selecorr was given.
unsigned int OHcut_given
Whether OHcut was given.
const char * rcut_help
cutoff radius (angstroms) help description.
char * nstart_orig
Number of frames to skip at start of trajectory original value given at command line.
unsigned int selectionMode_given
Whether selectionMode was given.
unsigned int thetacut_given
Whether thetacut was given.
const char * lcorr_help
Lengendre correlation function help description.
const char * dcorr_help
dipole correlation function help description.
unsigned int dcorr_given
Whether dcorr was given.
char * output_orig
output file name original value given at command line.
const char * output_help
output file name help description.
const char * tsep_help
Separation time between correlation windows (0 = no gap) help description.
const char * nbins_help
Number of bins help description.
unsigned int tcorr_given
Whether tcorr was given.
const char * dipoleZ_help
Z-component of the dipole with respect to body frame help description.
unsigned int onsager_given
Whether onsager was given.
unsigned int current_given
Whether current was given.
char * sfgPolarization_arg
SFG polarization combination: ssp, ppp, sps (default='ssp').
unsigned int sele3_given
Whether sele3 was given.
double dipoleZ_arg
Z-component of the dipole with respect to body frame (default='-1.0').
unsigned int lcorrZ_given
Whether lcorrZ was given.
const char * sele1_help
select first stuntdouble set help description.
unsigned int disp_given
Whether disp was given.
const char * seleoffset_help
global index offset for a second object (used to define a vector between sites in molecule) help desc...
unsigned int order_given
Whether order was given.
const char * jumptime_help
Hydrogen bond jump time correlation function help description.
const char * waOutProdcorr_help
Angular Velocity - Angular Velocity auto outer product correlation function help description.
char * dipoleY_orig
Y-component of the dipole with respect to body frame original value given at command line.
const char * tfcorr_help
Torque - Force Cross correlation function help description.
const char * persistence_help
Hydrogen bond persistence correlation function help description.
char * sele3_orig
select third stuntdouble set original value given at command line.
unsigned int tacorr_given
Whether tacorr was given.
const char * OHcut_help
Oxygen-Hydrogen cutoff radius (angstroms) help description.
double t_apod_arg
Apodization time (fs) [filters tcorr with exp(-t/t_apod) in Fourier-transformed spectroscopic functio...
const char * sele2_help
select second stuntdouble set (if sele2 is not set, use script from sele1) help description.
unsigned inputs_num
unamed options number
const char * t_zerofill_help
Zero-fill time (fs) [Pads time correlation functions with zeros from tcorr -> t_zerofill in Fourier-t...
unsigned int tsep_given
Whether tsep was given.
char * privilegedAxis_orig
which axis is special for spatial analysis (default = z axis) original value given at command line.
unsigned int OOcut_given
Whether OOcut was given.
int order_arg
Lengendre Polynomial Order.
const char * selecorr_help
selection correlation function help description.
double dipoleY_arg
Y-component of the dipole with respect to body frame (default='0.0').
unsigned int vcorr_given
Whether vcorr was given.
unsigned int tfcorr_given
Whether tfcorr was given.
const char * rotAngleDisp_help
Displacement correlation function for rotation angles help description.
unsigned int wcorr_given
Whether wcorr was given.
unsigned int pjcorr_given
Whether pjcorr was given.
const char * thetacut_help
HOO cutoff angle (degrees) help description.
unsigned int fermiCoupling_given
Whether fermiCoupling was given.
char * order_orig
Lengendre Polynomial Order original value given at command line.
char * fermiCoupling_orig
Fermi coupling [cm-1] for stretch-bend coupling in SFG spectra original value given at command line.
const char * wcorr_help
charge velocity correlation function help description.
double fermiCoupling_arg
Fermi coupling [cm-1] for stretch-bend coupling in SFG spectra (default='25').
unsigned int lcorr_given
Whether lcorr was given.
char * sfgPolarization_orig
SFG polarization combination: ssp, ppp, sps original value given at command line.
char * OOcut_orig
Oxygen-Oxygen cutoff radius (angstroms) original value given at command line.
const char * stresscorr_help
Stress tensor correlation function help description.
unsigned int meandisp_given
Whether meandisp was given.
double length_arg
maximum length (default='100').
unsigned int facorr_given
Whether facorr was given.
unsigned int bondcorr_given
Whether bondcorr was given.
const char * help_help
Print help and exit help description.
char * sele3_arg
select third stuntdouble set.
const char * cscorr_help
Charge - Orientation order parameter (Cos\theta) cross correlation function help description.
char * seleoffset_orig
global index offset for a second object (used to define a vector between sites in molecule) original ...
const char * rcorrZ_help
mean squared displacement binned by Z help description.
unsigned int dipoleX_given
Whether dipoleX was given.
char * output_arg
output file name.
unsigned int t_apod_given
Whether t_apod was given.
char ** inputs
unamed options (options without names)
const char * thetacorr_help
Angular msd help description.
unsigned int cscorr_given
Whether cscorr was given.
unsigned int jumptimeR_given
Whether jumptimeR was given.
char * t_zerofill_orig
Zero-fill time (fs) [Pads time correlation functions with zeros from tcorr -> t_zerofill in Fourier-t...
unsigned int rcorr_given
Whether rcorr was given.
char * input_arg
input dump file.
double thetacut_arg
HOO cutoff angle (degrees) (default='30').
unsigned int dipoleZ_given
Whether dipoleZ was given.
char * t_apod_orig
Apodization time (fs) [filters tcorr with exp(-t/t_apod) in Fourier-transformed spectroscopic functio...
unsigned int vwOutProdcorr_given
Whether vwOutProdcorr was given.
char * thetacut_orig
HOO cutoff angle (degrees) original value given at command line.
unsigned int sele1_given
Whether sele1 was given.
unsigned int sfg_given
Whether sfg was given.
unsigned int length_given
Whether length was given.
int seleoffset_arg
global index offset for a second object (used to define a vector between sites in molecule).
const char * order_help
Lengendre Polynomial Order help description.
const char * wvOutProdcorr_help
Angular Velocity - Velocity outer product correlation function help description.
const char * vcorrR_help
velocity correlation function projected radially help description.
unsigned int ddisp_given
Whether ddisp was given.
unsigned int nstart_given
Whether nstart was given.
double rcut_arg
cutoff radius (angstroms).
double tsep_arg
Separation time between correlation windows (0 = no gap) (default='0.0').
unsigned int jumptime_given
Whether jumptime was given.
char * nzbins_orig
Number of Z bins original value given at command line.
unsigned int ftcorr_given
Whether ftcorr was given.
unsigned int wvOutProdcorr_given
Whether wvOutProdcorr was given.
const char * sfg_help
SFG susceptibility spectrum (exciton model) - use molecular selections help description.
unsigned int stresscorr_given
Whether stresscorr was given.
unsigned int vaOutProdcorr_given
Whether vaOutProdcorr was given.
const char * rcorr_help
mean squared displacement help description.
const char * privilegedAxis_help
which axis is special for spatial analysis (default = z axis) help description.
unsigned int t_zerofill_given
Whether t_zerofill was given.
char * sele2_orig
select second stuntdouble set (if sele2 is not set, use script from sele1) original value given at co...
const char * current_help
Current density auto correlation function help description.
const char * meandisp_help
mean displacement help description.
const char * vaOutProdcorr_help
Velocity - Velocity auto outer product correlation function help description.
const char * selectionMode_help
How to treat objects which leave a dynamic selection and then return later (default = survival) help ...
unsigned int dispZ_given
Whether dispZ was given.
const char * freqfluccorr_help
Frequency Fluctuation correlation function help description.
const char * t_apod_help
Apodization time (fs) [filters tcorr with exp(-t/t_apod) in Fourier-transformed spectroscopic functio...
const char * bondcorr_help
Bond extension correlation function help description.
const char * facorr_help
Force - Force auto correlation function help description.
const char * r_rcorr_help
Radial msd help description.
char * sele1_orig
select first stuntdouble set original value given at command line.
char * tcorr_orig
Correlation time (length of each window) in fs original value given at command line.
unsigned int rotAngleDisp_given
Whether rotAngleDisp was given.
unsigned int cohZ_given
Whether cohZ was given.
double OHcut_arg
Oxygen-Hydrogen cutoff radius (angstroms) (default='2.45').
char * length_orig
maximum length original value given at command line.
char * sele1_arg
select first stuntdouble set.
unsigned int ckcorr_given
Whether ckcorr was given.
int nstart_arg
Number of frames to skip at start of trajectory (default='0').
const char * pjcorr_help
Momentum - Angular Momentum cross correlation function help description.
const char * fermiCoupling_help
Fermi coupling [cm-1] for stretch-bend coupling in SFG spectra help description.
unsigned int dipoleY_given
Whether dipoleY was given.
const char * nzbins_help
Number of Z bins help description.
const char * drcorr_help
Directional msd for particles with unit vectors help description.
double dipoleX_arg
X-component of the dipole with respect to body frame (default='0.0').
unsigned int rcut_given
Whether rcut was given.
const char * ddisp_help
Collective Dipole displacement function (Helfand moment of Current Density) help description.
const char * tacorr_help
Torque auto correlation function help description.
int correlation_function_group_counter
Counter for group correlation_function.
char * OHcut_orig
Oxygen-Hydrogen cutoff radius (angstroms) original value given at command line.
unsigned int help_given
Whether help was given.
const char * sele3_help
select third stuntdouble set help description.
const char * vcorrZ_help
velocity correlation function along z-axis help description.
enum enum_selectionMode selectionMode_arg
How to treat objects which leave a dynamic selection and then return later (default = survival) (defa...
const char * vcorr_help
velocity correlation function help description.
char * tsep_orig
Separation time between correlation windows (0 = no gap) original value given at command line.
unsigned int input_given
Whether input was given.
unsigned int rcorrZ_given
Whether rcorrZ was given.
const char * tcorr_help
Correlation time (length of each window) in fs help description.
int nbins_arg
Number of bins (default='100').
const char * onsager_help
Onsager coefficient correlation functions help description.
unsigned int sdcorr_given
Whether sdcorr was given.
enum enum_privilegedAxis privilegedAxis_arg
which axis is special for spatial analysis (default = z axis) (default='z').
double t_zerofill_arg
Zero-fill time (fs) [Pads time correlation functions with zeros from tcorr -> t_zerofill in Fourier-t...
unsigned int version_given
Whether version was given.
char * dipoleZ_orig
Z-component of the dipole with respect to body frame original value given at command line.
unsigned int thetacorr_given
Whether thetacorr was given.
const char * jumptimeR_help
Hydrogen bond jump time correlation function binned by R around a third selection help description.
const char * sfgPolarization_help
SFG polarization combination: ssp, ppp, sps help description.
const char * length_help
maximum length help description.
const char * dispZ_help
Displacement correlation function binned by Z help description.
const char * dipoleX_help
X-component of the dipole with respect to body frame help description.
unsigned int sele2_given
Whether sele2 was given.
const char * sdcorr_help
System dipole correlation function help description.
const char * version_help
Print version and exit help description.
char * input_orig
input dump file original value given at command line.
const char * disp_help
Displacement correlation function help description.
unsigned int nbins_given
Whether nbins was given.
unsigned int vcorrR_given
Whether vcorrR was given.
const char * lcorrZ_help
Lengendre correlation function binned by Z help description.
const char * cohZ_help
Lengendre correlation function for OH bond vectors binned by Z help description.
unsigned int sfgPolarization_given
Whether sfgPolarization was given.
const char * OOcut_help
Oxygen-Oxygen cutoff radius (angstroms) help description.
unsigned int nzbins_given
Whether nzbins was given.
double OOcut_arg
Oxygen-Oxygen cutoff radius (angstroms) (default='3.5').
unsigned int waOutProdcorr_given
Whether waOutProdcorr was given.
char * rcut_orig
cutoff radius (angstroms) original value given at command line.
double tcorr_arg
Correlation time (length of each window) in fs (default='100000.0').
char * selectionMode_orig
How to treat objects which leave a dynamic selection and then return later (default = survival) origi...
unsigned int seleoffset_given
Whether seleoffset was given.
const char * input_help
input dump file help description.
int nzbins_arg
Number of Z bins (default='100').
const char * nstart_help
Number of frames to skip at start of trajectory help description.
const char * dipoleY_help
Y-component of the dipole with respect to body frame help description.
int cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info)
Save the contents of the option struct into an already open FILE stream.
int cmdline_parser(int argc, char **argv, struct gengetopt_args_info *args_info)
The command line parser.
int cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info)
Save the contents of the option struct into a (text) file.
int cmdline_parser2(int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
The command line parser (version with additional parameters - deprecated).
int cmdline_parser_required(struct gengetopt_args_info *args_info, const char *prog_name)
Checks that all the required options were specified.
int cmdline_parser_ext(int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params)
The command line parser (version with additional parameters).
void cmdline_parser_init(struct gengetopt_args_info *args_info)
Initializes the passed gengetopt_args_info structure's fields (also set default values for options th...
void cmdline_parser_free(struct gengetopt_args_info *args_info)
Deallocates the string fields of the gengetopt_args_info structure (but does not deallocate the struc...
void cmdline_parser_params_init(struct cmdline_parser_params *params)
Initializes all the fields a cmdline_parser_params structure to their default values.