OpenMD 3.2
Molecular Dynamics in the Open
Loading...
Searching...
No Matches
StaticPropsCmd.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=StaticPropsCmd --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 "StaticPropsCmd.hpp"
26
27const char *gengetopt_args_info_purpose = "Computes properties which are averaged over some or all of the\nconfigurations that are contained within a dump file. The most common\nexample of a static property that can be computed is the pair\ndistribution function between atoms of type A and other atoms of type\nB, gAB(r).\n\nExample:\n StaticProps -i tp4.dump --gofr --sele1=\"select O*\" --sele2=\"select O*\"\n\nThis command computes the oxygen-oxygen pair distribution function,\ngOO(r), from a file named tp4.dump";
28
29const char *gengetopt_args_info_usage = "Usage: StaticProps [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 " -n, --step=INT process every n frame (default=`1')",
41 " -b, --nbins=INT number of bins (general purpose)\n (default=`100')",
42 " -x, --nbins_x=INT number of bins in x axis (default=`100')",
43 " -y, --nbins_y=INT number of bins in y axis (default=`100')",
44 " --nbins_z=INT number of bins in z axis (default=`100')",
45 " -r, --nrbins=INT number of radial bins (usually duplicates\n functionality of nbins) (default=`100')",
46 " --binWidth=DOUBLE width of radial bins in angstroms\n (default=`1.0')",
47 " -a, --nanglebins=INT number of bins for cos(angle) (default=`50')",
48 " -c, --rcut=DOUBLE cutoff radius (rcut)",
49 " --OOcut=DOUBLE Oxygen-Oxygen cutoff radius (angstroms)\n (default=`3.5')",
50 " --thetacut=DOUBLE HOO cutoff angle (degrees) (default=`30')",
51 " --OHcut=DOUBLE Oxygen-Hydrogen cutoff radius (angstroms)\n (default=`2.45')",
52 " --dz=DOUBLE slab width (dz)",
53 " --length=DOUBLE maximum length (Defaults to 1/2 smallest length\n of first frame)",
54 " --zlength=DOUBLE maximum length (Defaults to 1/2 smallest length\n of first frame)",
55 " -z, --zoffset=DOUBLE Where to set the zero for the slab_density\n calculation (default=`0')",
56 " --sele1=selection script select the first stuntdouble set",
57 " --sele2=selection script select the second stuntdouble set",
58 " --sele3=selection script select the third stuntdouble set",
59 " --refsele=selection script\n select reference (use and only use with --gxyz)",
60 " --comsele=selection script\n select stunt doubles for center-of-mass\n reference point",
61 " --seleoffset=INT global index offset for a second object (used\n to define a vector between sites in molecule)",
62 " --seleoffset2=INT global index offset for a third object (used to\n define a vector between sites in molecule)",
63 " --seleoffset3=INT global index offset for a fourth object (used\n to define a vector between sites in molecule)",
64 " --molname=STRING molecule name",
65 " --begin=INT begin internal index",
66 " --end=INT end internal index",
67 " --radius=DOUBLE nanoparticle radius",
68 " -v, --voxelSize=DOUBLE voxel size (angstroms)",
69 " --gaussWidth=DOUBLE Gaussian width (angstroms)",
70 " --privilegedAxis=ENUM which axis is special for spatial analysis\n (default = z axis) (possible values=\"x\",\n \"y\", \"z\" default=`z')",
71 " --privilegedAxis2=ENUM which axis is special for spatial analysis\n (default = x axis) (possible values=\"x\",\n \"y\", \"z\" default=`x')",
72 " --momentum=ENUM Type of momentum whose distribtution is\n required (default = Liner Momentum)\n (possible values=\"P\", \"J\" default=`P')",
73 " --component=ENUM component of momentum for the momemtum\n distribution (default = z axis) (possible\n values=\"x\", \"y\", \"z\" default=`z')",
74 " --dipoleX=DOUBLE X-component of the dipole with respect to body\n frame",
75 " --dipoleY=DOUBLE Y-component of the dipole with respect to body\n frame",
76 " --dipoleZ=DOUBLE Z-component of the dipole with respect to body\n frame",
77 " --v_radius=DOUBLE VanderWaals radiius for fictious atoms used in\n model eg. M site in TIP4P-FQ water model",
78 " --gen_xyz generates xyz file (default=off)",
79 " --atom_name=selection script\n name of atom for with average charge to be\n generated",
80 " --sfgPolarization=STRING SFG polarization combination: ssp, ppp, sps\n (default=`ssp')",
81 " --lorentzianWidth=DOUBLE Lorentzian half-width [cm-1] applied to\n eigenstates in SFG spectra (default=`5')",
82 " --fermiCoupling=DOUBLE Fermi coupling [cm-1] for stretch-bend coupling\n in SFG spectra (default=`25')",
83 "\n Group: staticProps\n an option of this group is required",
84 " --bo bond order parameter (--rcut must be specified)",
85 " --ior icosahedral bond order parameter as a function\n of radius (--rcut must be specified)",
86 " --for FCC bond order parameter as a function of\n radius (--rcut must be specified)",
87 " --bad N(theta) bond angle density within (--rcut must\n be specified)",
88 " --count count of objects matching selection criteria\n (and associated statistics)",
89 " --mcount count of molecules matching selection criteria\n (and associated statistics)",
90 " -g, --gofr g(r)",
91 " --gofz g(z)",
92 " --r_theta g(r, cos(theta))",
93 " --r_omega g(r, cos(omega))",
94 " --r_z g(r, z)",
95 " --theta_omega g(cos(theta), cos(omega))",
96 " --r_theta_omega g(r, cos(theta), cos(omega))",
97 " --gxyz g(x, y, z)",
98 " --twodgofr 2D g(r) (Slab width --dz must be specified)",
99 " --kirkwood_buff Kirkwood-Buff integrals (--sele1 and --sele2\n must both be specified)",
100 " -p, --p2 p2 order parameter (--sele1 must be specified,\n --sele2 is optional)",
101 " --p2r p2 order parameter using r as director axis",
102 " --p2z p2 order parameter using z (or privilegedAxis)\n as director axis",
103 " --rp2 rp2 order parameter (--sele1 and --sele2 must\n be specified)",
104 " -s, --scd scd order parameter (either --sele1, --sele2,\n --sele3 are specified or --molname, --begin,\n --end are specified)",
105 " -d, --density density plot",
106 " --slab_density slab density, rho(z)",
107 " --pipe_density pipe density, rho(axis1, axis2)",
108 " --p_angle p(cos(theta)) (--sele1 must be specified,\n --sele2 is optional)",
109 " --hxy hxy",
110 " --rho_r rho(R)",
111 " --angle_r angle of R",
112 " --hullvol hull volume of nanoparticle",
113 " --rodlength length of nanorod",
114 " -Q, --tet_param tetrahedrality order parameter (Qk)",
115 " --tet_param_z spatially-resolved tetrahedrality order\n parameter Qk(z)",
116 " --tet_param_r spatially-resolved tetrahedrality order\n parameter Qk(r) around a third selection",
117 " --tet_param_rangle spatially-resolved tetrahedrality order\n parameter Qk(r,cos(theta)) around a third\n selection",
118 " --tet_param_dens computes density of the tetrahedrality order\n parameter Qk",
119 " --tet_param_xyz volume-resolved tetrahedrality order parameter\n Qk(x,y,z). (voxelSize, rcut, and gaussWidth\n must be specified)",
120 " --trans_param_z spatially-resolved translational order\n parameter t(z)",
121 " --rnemdz slab-resolved RNEMD statistics (temperature,\n density, velocity)",
122 " --rnemdr shell-resolved RNEMD statistics (temperature,\n density, angular velocity)",
123 " --rnemdrt shell and angle-resolved RNEMD statistics\n (temperature, density, angular velocity)",
124 " --nitrile electrostatic potential to frequency map based\n on the Cho nitrile fits",
125 " --OHfreqmap electrostatic field to OH frequency\n distribution based on the Corcelli frequency\n map",
126 " -m, --multipole average multipole moments contained within\n cutoff spheres as a function of radius",
127 " --surfDiffusion X, Y, and R (surface diffusion if Z exposed and\n bulk immobile) diffusion",
128 " --cn Coordination Number Distribution",
129 " --scn Secondary Coordination Number Distribution",
130 " --gcn Generalized Coordination Number Distribution",
131 " --hbond Hydrogen Bonding statistics using geometric\n criteria (rcut and thetacut must be\n specified)",
132 " --hbondz Hydrogen Bonding density binned by z (rcut and\n thetacut must be specified)",
133 " --hbondzvol Hydrogen Bonding density binned by z and\n normalized by bin volume (rcut and thetacut\n must be specified)",
134 " --hbondr Hydrogen Bonding density binned by r (rcut and\n thetacut must be specified)",
135 " --hbondrvol Hydrogen Bonding density binned by r and\n normalized by bin volume (rcut and thetacut\n must be specified)",
136 " --potDiff potential energy difference when charge on\n selection is set to zero",
137 " --tet_hb hydrogen bond statistics binned by\n tetrahedrality of donor and acceptor\n molecules",
138 " -k, --kirkwood distance-dependent Kirkwood factor",
139 " --kirkwoodQ distance-dependent Kirkwood factor for\n quadrupoles",
140 " --densityfield computes an average density field",
141 " --velocityfield computes an average velocity field",
142 " --velocityZ computes an average two-dimensional velocity\n map",
143 " -D, --eam_density computes an average eam density profile of the\n selected atom",
144 " -q, --net_charge computes an average charge profile of the\n selected atom",
145 " -J, --current_density computes the current density for the selected\n atom",
146 " --chargez computes the charge distribution along selected\n axis and selected atom",
147 " --charger computes the charge density as a function of\n the radius and selected atom",
148 " --massdensityz computes the mass density of the selection\n along selected axis",
149 " --massdensityr computes the mass density of the selection as a\n function of the radius from the center of\n mass",
150 " --numberz computes the number density along selected axis\n and selected molcule",
151 " --numberr computes the number density as a function of\n the radius and selected molecule",
152 " --charge_density_z computes the continuous charge distribution\n along selected axis and selected atom",
153 " --countz computes the number of selected atoms along\n selected axis",
154 " -M, --momentum_distribution computes the momentum distribution for the\n selected atom",
155 " -S, --dipole_orientation spatially-resolved dipole order parameter S(z),\n S = (3 Cos^2\\theta - 1)/2",
156 " --order_prob probability of order parameter for given\n selection",
157 " --sfg SFG susceptibility spectrum (time averaging\n approximation) - uses molecular selections",
158 0
159};
160
161typedef enum {ARG_NO
162 , ARG_FLAG
163 , ARG_STRING
164 , ARG_INT
165 , ARG_DOUBLE
166 , ARG_ENUM
167} cmdline_parser_arg_type;
168
169static
170void clear_given (struct gengetopt_args_info *args_info);
171static
172void clear_args (struct gengetopt_args_info *args_info);
173
174static int
175cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info,
176 struct cmdline_parser_params *params, const char *additional_error);
177
178static int
179cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error);
180
181const char *cmdline_parser_privilegedAxis_values[] = {"x", "y", "z", 0}; /*< Possible values for privilegedAxis. */
182const char *cmdline_parser_privilegedAxis2_values[] = {"x", "y", "z", 0}; /*< Possible values for privilegedAxis2. */
183const char *cmdline_parser_momentum_values[] = {"P", "J", 0}; /*< Possible values for momentum. */
184const char *cmdline_parser_component_values[] = {"x", "y", "z", 0}; /*< Possible values for component. */
185
186static char *
187gengetopt_strdup (const char *s);
188
189static
190void clear_given (struct gengetopt_args_info *args_info)
191{
192 args_info->help_given = 0 ;
193 args_info->version_given = 0 ;
194 args_info->input_given = 0 ;
195 args_info->output_given = 0 ;
196 args_info->step_given = 0 ;
197 args_info->nbins_given = 0 ;
198 args_info->nbins_x_given = 0 ;
199 args_info->nbins_y_given = 0 ;
200 args_info->nbins_z_given = 0 ;
201 args_info->nrbins_given = 0 ;
202 args_info->binWidth_given = 0 ;
203 args_info->nanglebins_given = 0 ;
204 args_info->rcut_given = 0 ;
205 args_info->OOcut_given = 0 ;
206 args_info->thetacut_given = 0 ;
207 args_info->OHcut_given = 0 ;
208 args_info->dz_given = 0 ;
209 args_info->length_given = 0 ;
210 args_info->zlength_given = 0 ;
211 args_info->zoffset_given = 0 ;
212 args_info->sele1_given = 0 ;
213 args_info->sele2_given = 0 ;
214 args_info->sele3_given = 0 ;
215 args_info->refsele_given = 0 ;
216 args_info->comsele_given = 0 ;
217 args_info->seleoffset_given = 0 ;
218 args_info->seleoffset2_given = 0 ;
219 args_info->seleoffset3_given = 0 ;
220 args_info->molname_given = 0 ;
221 args_info->begin_given = 0 ;
222 args_info->end_given = 0 ;
223 args_info->radius_given = 0 ;
224 args_info->voxelSize_given = 0 ;
225 args_info->gaussWidth_given = 0 ;
226 args_info->privilegedAxis_given = 0 ;
227 args_info->privilegedAxis2_given = 0 ;
228 args_info->momentum_given = 0 ;
229 args_info->component_given = 0 ;
230 args_info->dipoleX_given = 0 ;
231 args_info->dipoleY_given = 0 ;
232 args_info->dipoleZ_given = 0 ;
233 args_info->v_radius_given = 0 ;
234 args_info->gen_xyz_given = 0 ;
235 args_info->atom_name_given = 0 ;
236 args_info->sfgPolarization_given = 0 ;
237 args_info->lorentzianWidth_given = 0 ;
238 args_info->fermiCoupling_given = 0 ;
239 args_info->bo_given = 0 ;
240 args_info->ior_given = 0 ;
241 args_info->for_given = 0 ;
242 args_info->bad_given = 0 ;
243 args_info->count_given = 0 ;
244 args_info->mcount_given = 0 ;
245 args_info->gofr_given = 0 ;
246 args_info->gofz_given = 0 ;
247 args_info->r_theta_given = 0 ;
248 args_info->r_omega_given = 0 ;
249 args_info->r_z_given = 0 ;
250 args_info->theta_omega_given = 0 ;
251 args_info->r_theta_omega_given = 0 ;
252 args_info->gxyz_given = 0 ;
253 args_info->twodgofr_given = 0 ;
254 args_info->kirkwood_buff_given = 0 ;
255 args_info->p2_given = 0 ;
256 args_info->p2r_given = 0 ;
257 args_info->p2z_given = 0 ;
258 args_info->rp2_given = 0 ;
259 args_info->scd_given = 0 ;
260 args_info->density_given = 0 ;
261 args_info->slab_density_given = 0 ;
262 args_info->pipe_density_given = 0 ;
263 args_info->p_angle_given = 0 ;
264 args_info->hxy_given = 0 ;
265 args_info->rho_r_given = 0 ;
266 args_info->angle_r_given = 0 ;
267 args_info->hullvol_given = 0 ;
268 args_info->rodlength_given = 0 ;
269 args_info->tet_param_given = 0 ;
270 args_info->tet_param_z_given = 0 ;
271 args_info->tet_param_r_given = 0 ;
272 args_info->tet_param_rangle_given = 0 ;
273 args_info->tet_param_dens_given = 0 ;
274 args_info->tet_param_xyz_given = 0 ;
275 args_info->trans_param_z_given = 0 ;
276 args_info->rnemdz_given = 0 ;
277 args_info->rnemdr_given = 0 ;
278 args_info->rnemdrt_given = 0 ;
279 args_info->nitrile_given = 0 ;
280 args_info->OHfreqmap_given = 0 ;
281 args_info->multipole_given = 0 ;
282 args_info->surfDiffusion_given = 0 ;
283 args_info->cn_given = 0 ;
284 args_info->scn_given = 0 ;
285 args_info->gcn_given = 0 ;
286 args_info->hbond_given = 0 ;
287 args_info->hbondz_given = 0 ;
288 args_info->hbondzvol_given = 0 ;
289 args_info->hbondr_given = 0 ;
290 args_info->hbondrvol_given = 0 ;
291 args_info->potDiff_given = 0 ;
292 args_info->tet_hb_given = 0 ;
293 args_info->kirkwood_given = 0 ;
294 args_info->kirkwoodQ_given = 0 ;
295 args_info->densityfield_given = 0 ;
296 args_info->velocityfield_given = 0 ;
297 args_info->velocityZ_given = 0 ;
298 args_info->eam_density_given = 0 ;
299 args_info->net_charge_given = 0 ;
300 args_info->current_density_given = 0 ;
301 args_info->chargez_given = 0 ;
302 args_info->charger_given = 0 ;
303 args_info->massdensityz_given = 0 ;
304 args_info->massdensityr_given = 0 ;
305 args_info->numberz_given = 0 ;
306 args_info->numberr_given = 0 ;
307 args_info->charge_density_z_given = 0 ;
308 args_info->countz_given = 0 ;
309 args_info->momentum_distribution_given = 0 ;
310 args_info->dipole_orientation_given = 0 ;
311 args_info->order_prob_given = 0 ;
312 args_info->sfg_given = 0 ;
313 args_info->staticProps_group_counter = 0 ;
314}
315
316static
317void clear_args (struct gengetopt_args_info *args_info)
318{
319 FIX_UNUSED (args_info);
320 args_info->input_arg = NULL;
321 args_info->input_orig = NULL;
322 args_info->output_arg = NULL;
323 args_info->output_orig = NULL;
324 args_info->step_arg = 1;
325 args_info->step_orig = NULL;
326 args_info->nbins_arg = 100;
327 args_info->nbins_orig = NULL;
328 args_info->nbins_x_arg = 100;
329 args_info->nbins_x_orig = NULL;
330 args_info->nbins_y_arg = 100;
331 args_info->nbins_y_orig = NULL;
332 args_info->nbins_z_arg = 100;
333 args_info->nbins_z_orig = NULL;
334 args_info->nrbins_arg = 100;
335 args_info->nrbins_orig = NULL;
336 args_info->binWidth_arg = 1.0;
337 args_info->binWidth_orig = NULL;
338 args_info->nanglebins_arg = 50;
339 args_info->nanglebins_orig = NULL;
340 args_info->rcut_orig = NULL;
341 args_info->OOcut_arg = 3.5;
342 args_info->OOcut_orig = NULL;
343 args_info->thetacut_arg = 30;
344 args_info->thetacut_orig = NULL;
345 args_info->OHcut_arg = 2.45;
346 args_info->OHcut_orig = NULL;
347 args_info->dz_orig = NULL;
348 args_info->length_orig = NULL;
349 args_info->zlength_orig = NULL;
350 args_info->zoffset_arg = 0;
351 args_info->zoffset_orig = NULL;
352 args_info->sele1_arg = NULL;
353 args_info->sele1_orig = NULL;
354 args_info->sele2_arg = NULL;
355 args_info->sele2_orig = NULL;
356 args_info->sele3_arg = NULL;
357 args_info->sele3_orig = NULL;
358 args_info->refsele_arg = NULL;
359 args_info->refsele_orig = NULL;
360 args_info->comsele_arg = NULL;
361 args_info->comsele_orig = NULL;
362 args_info->seleoffset_orig = NULL;
363 args_info->seleoffset2_orig = NULL;
364 args_info->seleoffset3_orig = NULL;
365 args_info->molname_arg = NULL;
366 args_info->molname_orig = NULL;
367 args_info->begin_orig = NULL;
368 args_info->end_orig = NULL;
369 args_info->radius_orig = NULL;
370 args_info->voxelSize_orig = NULL;
371 args_info->gaussWidth_orig = NULL;
372 args_info->privilegedAxis_arg = privilegedAxis_arg_z;
373 args_info->privilegedAxis_orig = NULL;
374 args_info->privilegedAxis2_arg = privilegedAxis2_arg_x;
375 args_info->privilegedAxis2_orig = NULL;
376 args_info->momentum_arg = momentum_arg_P;
377 args_info->momentum_orig = NULL;
378 args_info->component_arg = component_arg_z;
379 args_info->component_orig = NULL;
380 args_info->dipoleX_orig = NULL;
381 args_info->dipoleY_orig = NULL;
382 args_info->dipoleZ_orig = NULL;
383 args_info->v_radius_orig = NULL;
384 args_info->gen_xyz_flag = 0;
385 args_info->atom_name_arg = NULL;
386 args_info->atom_name_orig = NULL;
387 args_info->sfgPolarization_arg = gengetopt_strdup ("ssp");
388 args_info->sfgPolarization_orig = NULL;
389 args_info->lorentzianWidth_arg = 5;
390 args_info->lorentzianWidth_orig = NULL;
391 args_info->fermiCoupling_arg = 25;
392 args_info->fermiCoupling_orig = NULL;
393
394}
395
396static
397void init_args_info(struct gengetopt_args_info *args_info)
398{
399
400
401 args_info->help_help = gengetopt_args_info_help[0] ;
402 args_info->version_help = gengetopt_args_info_help[1] ;
403 args_info->input_help = gengetopt_args_info_help[2] ;
404 args_info->output_help = gengetopt_args_info_help[3] ;
405 args_info->step_help = gengetopt_args_info_help[4] ;
406 args_info->nbins_help = gengetopt_args_info_help[5] ;
407 args_info->nbins_x_help = gengetopt_args_info_help[6] ;
408 args_info->nbins_y_help = gengetopt_args_info_help[7] ;
409 args_info->nbins_z_help = gengetopt_args_info_help[8] ;
410 args_info->nrbins_help = gengetopt_args_info_help[9] ;
411 args_info->binWidth_help = gengetopt_args_info_help[10] ;
412 args_info->nanglebins_help = gengetopt_args_info_help[11] ;
413 args_info->rcut_help = gengetopt_args_info_help[12] ;
414 args_info->OOcut_help = gengetopt_args_info_help[13] ;
415 args_info->thetacut_help = gengetopt_args_info_help[14] ;
416 args_info->OHcut_help = gengetopt_args_info_help[15] ;
417 args_info->dz_help = gengetopt_args_info_help[16] ;
418 args_info->length_help = gengetopt_args_info_help[17] ;
419 args_info->zlength_help = gengetopt_args_info_help[18] ;
420 args_info->zoffset_help = gengetopt_args_info_help[19] ;
421 args_info->sele1_help = gengetopt_args_info_help[20] ;
422 args_info->sele2_help = gengetopt_args_info_help[21] ;
423 args_info->sele3_help = gengetopt_args_info_help[22] ;
424 args_info->refsele_help = gengetopt_args_info_help[23] ;
425 args_info->comsele_help = gengetopt_args_info_help[24] ;
426 args_info->seleoffset_help = gengetopt_args_info_help[25] ;
427 args_info->seleoffset2_help = gengetopt_args_info_help[26] ;
428 args_info->seleoffset3_help = gengetopt_args_info_help[27] ;
429 args_info->molname_help = gengetopt_args_info_help[28] ;
430 args_info->begin_help = gengetopt_args_info_help[29] ;
431 args_info->end_help = gengetopt_args_info_help[30] ;
432 args_info->radius_help = gengetopt_args_info_help[31] ;
433 args_info->voxelSize_help = gengetopt_args_info_help[32] ;
434 args_info->gaussWidth_help = gengetopt_args_info_help[33] ;
435 args_info->privilegedAxis_help = gengetopt_args_info_help[34] ;
436 args_info->privilegedAxis2_help = gengetopt_args_info_help[35] ;
437 args_info->momentum_help = gengetopt_args_info_help[36] ;
438 args_info->component_help = gengetopt_args_info_help[37] ;
439 args_info->dipoleX_help = gengetopt_args_info_help[38] ;
440 args_info->dipoleY_help = gengetopt_args_info_help[39] ;
441 args_info->dipoleZ_help = gengetopt_args_info_help[40] ;
442 args_info->v_radius_help = gengetopt_args_info_help[41] ;
443 args_info->gen_xyz_help = gengetopt_args_info_help[42] ;
444 args_info->atom_name_help = gengetopt_args_info_help[43] ;
445 args_info->sfgPolarization_help = gengetopt_args_info_help[44] ;
446 args_info->lorentzianWidth_help = gengetopt_args_info_help[45] ;
447 args_info->fermiCoupling_help = gengetopt_args_info_help[46] ;
448 args_info->bo_help = gengetopt_args_info_help[48] ;
449 args_info->ior_help = gengetopt_args_info_help[49] ;
450 args_info->for_help = gengetopt_args_info_help[50] ;
451 args_info->bad_help = gengetopt_args_info_help[51] ;
452 args_info->count_help = gengetopt_args_info_help[52] ;
453 args_info->mcount_help = gengetopt_args_info_help[53] ;
454 args_info->gofr_help = gengetopt_args_info_help[54] ;
455 args_info->gofz_help = gengetopt_args_info_help[55] ;
456 args_info->r_theta_help = gengetopt_args_info_help[56] ;
457 args_info->r_omega_help = gengetopt_args_info_help[57] ;
458 args_info->r_z_help = gengetopt_args_info_help[58] ;
459 args_info->theta_omega_help = gengetopt_args_info_help[59] ;
460 args_info->r_theta_omega_help = gengetopt_args_info_help[60] ;
461 args_info->gxyz_help = gengetopt_args_info_help[61] ;
462 args_info->twodgofr_help = gengetopt_args_info_help[62] ;
463 args_info->kirkwood_buff_help = gengetopt_args_info_help[63] ;
464 args_info->p2_help = gengetopt_args_info_help[64] ;
465 args_info->p2r_help = gengetopt_args_info_help[65] ;
466 args_info->p2z_help = gengetopt_args_info_help[66] ;
467 args_info->rp2_help = gengetopt_args_info_help[67] ;
468 args_info->scd_help = gengetopt_args_info_help[68] ;
469 args_info->density_help = gengetopt_args_info_help[69] ;
470 args_info->slab_density_help = gengetopt_args_info_help[70] ;
471 args_info->pipe_density_help = gengetopt_args_info_help[71] ;
472 args_info->p_angle_help = gengetopt_args_info_help[72] ;
473 args_info->hxy_help = gengetopt_args_info_help[73] ;
474 args_info->rho_r_help = gengetopt_args_info_help[74] ;
475 args_info->angle_r_help = gengetopt_args_info_help[75] ;
476 args_info->hullvol_help = gengetopt_args_info_help[76] ;
477 args_info->rodlength_help = gengetopt_args_info_help[77] ;
478 args_info->tet_param_help = gengetopt_args_info_help[78] ;
479 args_info->tet_param_z_help = gengetopt_args_info_help[79] ;
480 args_info->tet_param_r_help = gengetopt_args_info_help[80] ;
481 args_info->tet_param_rangle_help = gengetopt_args_info_help[81] ;
482 args_info->tet_param_dens_help = gengetopt_args_info_help[82] ;
483 args_info->tet_param_xyz_help = gengetopt_args_info_help[83] ;
484 args_info->trans_param_z_help = gengetopt_args_info_help[84] ;
485 args_info->rnemdz_help = gengetopt_args_info_help[85] ;
486 args_info->rnemdr_help = gengetopt_args_info_help[86] ;
487 args_info->rnemdrt_help = gengetopt_args_info_help[87] ;
488 args_info->nitrile_help = gengetopt_args_info_help[88] ;
489 args_info->OHfreqmap_help = gengetopt_args_info_help[89] ;
490 args_info->multipole_help = gengetopt_args_info_help[90] ;
491 args_info->surfDiffusion_help = gengetopt_args_info_help[91] ;
492 args_info->cn_help = gengetopt_args_info_help[92] ;
493 args_info->scn_help = gengetopt_args_info_help[93] ;
494 args_info->gcn_help = gengetopt_args_info_help[94] ;
495 args_info->hbond_help = gengetopt_args_info_help[95] ;
496 args_info->hbondz_help = gengetopt_args_info_help[96] ;
497 args_info->hbondzvol_help = gengetopt_args_info_help[97] ;
498 args_info->hbondr_help = gengetopt_args_info_help[98] ;
499 args_info->hbondrvol_help = gengetopt_args_info_help[99] ;
500 args_info->potDiff_help = gengetopt_args_info_help[100] ;
501 args_info->tet_hb_help = gengetopt_args_info_help[101] ;
502 args_info->kirkwood_help = gengetopt_args_info_help[102] ;
503 args_info->kirkwoodQ_help = gengetopt_args_info_help[103] ;
504 args_info->densityfield_help = gengetopt_args_info_help[104] ;
505 args_info->velocityfield_help = gengetopt_args_info_help[105] ;
506 args_info->velocityZ_help = gengetopt_args_info_help[106] ;
507 args_info->eam_density_help = gengetopt_args_info_help[107] ;
508 args_info->net_charge_help = gengetopt_args_info_help[108] ;
509 args_info->current_density_help = gengetopt_args_info_help[109] ;
510 args_info->chargez_help = gengetopt_args_info_help[110] ;
511 args_info->charger_help = gengetopt_args_info_help[111] ;
512 args_info->massdensityz_help = gengetopt_args_info_help[112] ;
513 args_info->massdensityr_help = gengetopt_args_info_help[113] ;
514 args_info->numberz_help = gengetopt_args_info_help[114] ;
515 args_info->numberr_help = gengetopt_args_info_help[115] ;
516 args_info->charge_density_z_help = gengetopt_args_info_help[116] ;
517 args_info->countz_help = gengetopt_args_info_help[117] ;
518 args_info->momentum_distribution_help = gengetopt_args_info_help[118] ;
519 args_info->dipole_orientation_help = gengetopt_args_info_help[119] ;
520 args_info->order_prob_help = gengetopt_args_info_help[120] ;
521 args_info->sfg_help = gengetopt_args_info_help[121] ;
522
523}
524
525void
527{
528 printf ("%s %s\n",
531
532 if (strlen(gengetopt_args_info_versiontext) > 0)
533 printf("\n%s\n", gengetopt_args_info_versiontext);
534}
535
536static void print_help_common(void)
537{
538 size_t len_purpose = strlen(gengetopt_args_info_purpose);
539 size_t len_usage = strlen(gengetopt_args_info_usage);
540
541 if (len_usage > 0) {
542 printf("%s\n", gengetopt_args_info_usage);
543 }
544 if (len_purpose > 0) {
545 printf("%s\n", gengetopt_args_info_purpose);
546 }
547
548 if (len_usage || len_purpose) {
549 printf("\n");
550 }
551
552 if (strlen(gengetopt_args_info_description) > 0) {
553 printf("%s\n\n", gengetopt_args_info_description);
554 }
555}
556
557void
559{
560 int i = 0;
561 print_help_common();
562 while (gengetopt_args_info_help[i])
563 printf("%s\n", gengetopt_args_info_help[i++]);
564}
565
566void
567cmdline_parser_init (struct gengetopt_args_info *args_info)
568{
569 clear_given (args_info);
570 clear_args (args_info);
571 init_args_info (args_info);
572
573 args_info->inputs = 0;
574 args_info->inputs_num = 0;
575}
576
577void
578cmdline_parser_params_init(struct cmdline_parser_params *params)
579{
580 if (params)
581 {
582 params->override = 0;
583 params->initialize = 1;
584 params->check_required = 1;
585 params->check_ambiguity = 0;
586 params->print_errors = 1;
587 }
588}
589
592{
593 struct cmdline_parser_params *params =
594 (struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params));
596 return params;
597}
598
599static void
600free_string_field (char **s)
601{
602 if (*s)
603 {
604 free (*s);
605 *s = 0;
606 }
607}
608
609
610static void
611cmdline_parser_release (struct gengetopt_args_info *args_info)
612{
613 unsigned int i;
614 free_string_field (&(args_info->input_arg));
615 free_string_field (&(args_info->input_orig));
616 free_string_field (&(args_info->output_arg));
617 free_string_field (&(args_info->output_orig));
618 free_string_field (&(args_info->step_orig));
619 free_string_field (&(args_info->nbins_orig));
620 free_string_field (&(args_info->nbins_x_orig));
621 free_string_field (&(args_info->nbins_y_orig));
622 free_string_field (&(args_info->nbins_z_orig));
623 free_string_field (&(args_info->nrbins_orig));
624 free_string_field (&(args_info->binWidth_orig));
625 free_string_field (&(args_info->nanglebins_orig));
626 free_string_field (&(args_info->rcut_orig));
627 free_string_field (&(args_info->OOcut_orig));
628 free_string_field (&(args_info->thetacut_orig));
629 free_string_field (&(args_info->OHcut_orig));
630 free_string_field (&(args_info->dz_orig));
631 free_string_field (&(args_info->length_orig));
632 free_string_field (&(args_info->zlength_orig));
633 free_string_field (&(args_info->zoffset_orig));
634 free_string_field (&(args_info->sele1_arg));
635 free_string_field (&(args_info->sele1_orig));
636 free_string_field (&(args_info->sele2_arg));
637 free_string_field (&(args_info->sele2_orig));
638 free_string_field (&(args_info->sele3_arg));
639 free_string_field (&(args_info->sele3_orig));
640 free_string_field (&(args_info->refsele_arg));
641 free_string_field (&(args_info->refsele_orig));
642 free_string_field (&(args_info->comsele_arg));
643 free_string_field (&(args_info->comsele_orig));
644 free_string_field (&(args_info->seleoffset_orig));
645 free_string_field (&(args_info->seleoffset2_orig));
646 free_string_field (&(args_info->seleoffset3_orig));
647 free_string_field (&(args_info->molname_arg));
648 free_string_field (&(args_info->molname_orig));
649 free_string_field (&(args_info->begin_orig));
650 free_string_field (&(args_info->end_orig));
651 free_string_field (&(args_info->radius_orig));
652 free_string_field (&(args_info->voxelSize_orig));
653 free_string_field (&(args_info->gaussWidth_orig));
654 free_string_field (&(args_info->privilegedAxis_orig));
655 free_string_field (&(args_info->privilegedAxis2_orig));
656 free_string_field (&(args_info->momentum_orig));
657 free_string_field (&(args_info->component_orig));
658 free_string_field (&(args_info->dipoleX_orig));
659 free_string_field (&(args_info->dipoleY_orig));
660 free_string_field (&(args_info->dipoleZ_orig));
661 free_string_field (&(args_info->v_radius_orig));
662 free_string_field (&(args_info->atom_name_arg));
663 free_string_field (&(args_info->atom_name_orig));
664 free_string_field (&(args_info->sfgPolarization_arg));
665 free_string_field (&(args_info->sfgPolarization_orig));
666 free_string_field (&(args_info->lorentzianWidth_orig));
667 free_string_field (&(args_info->fermiCoupling_orig));
668
669
670 for (i = 0; i < args_info->inputs_num; ++i)
671 free (args_info->inputs [i]);
672
673 if (args_info->inputs_num)
674 free (args_info->inputs);
675
676 clear_given (args_info);
677}
678
679/**
680 * @param val the value to check
681 * @param values the possible values
682 * @return the index of the matched value:
683 * -1 if no value matched,
684 * -2 if more than one value has matched
685 */
686static int
687check_possible_values(const char *val, const char *values[])
688{
689 int i, found, last;
690 size_t len;
691
692 if (!val) /* otherwise strlen() crashes below */
693 return -1; /* -1 means no argument for the option */
694
695 found = last = 0;
696
697 for (i = 0, len = strlen(val); values[i]; ++i)
698 {
699 if (strncmp(val, values[i], len) == 0)
700 {
701 ++found;
702 last = i;
703 if (strlen(values[i]) == len)
704 return i; /* exact macth no need to check more */
705 }
706 }
707
708 if (found == 1) /* one match: OK */
709 return last;
710
711 return (found ? -2 : -1); /* return many values or none matched */
712}
713
714
715static void
716write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[])
717{
718 int found = -1;
719 if (arg) {
720 if (values) {
721 found = check_possible_values(arg, values);
722 }
723 if (found >= 0)
724 fprintf(outfile, "%s=\"%s\" # %s\n", opt, arg, values[found]);
725 else
726 fprintf(outfile, "%s=\"%s\"\n", opt, arg);
727 } else {
728 fprintf(outfile, "%s\n", opt);
729 }
730}
731
732
733int
734cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info)
735{
736 int i = 0;
737
738 if (!outfile)
739 {
740 fprintf (stderr, "%s: cannot dump options to stream\n", CMDLINE_PARSER_PACKAGE);
741 return EXIT_FAILURE;
742 }
743
744 if (args_info->help_given)
745 write_into_file(outfile, "help", 0, 0 );
746 if (args_info->version_given)
747 write_into_file(outfile, "version", 0, 0 );
748 if (args_info->input_given)
749 write_into_file(outfile, "input", args_info->input_orig, 0);
750 if (args_info->output_given)
751 write_into_file(outfile, "output", args_info->output_orig, 0);
752 if (args_info->step_given)
753 write_into_file(outfile, "step", args_info->step_orig, 0);
754 if (args_info->nbins_given)
755 write_into_file(outfile, "nbins", args_info->nbins_orig, 0);
756 if (args_info->nbins_x_given)
757 write_into_file(outfile, "nbins_x", args_info->nbins_x_orig, 0);
758 if (args_info->nbins_y_given)
759 write_into_file(outfile, "nbins_y", args_info->nbins_y_orig, 0);
760 if (args_info->nbins_z_given)
761 write_into_file(outfile, "nbins_z", args_info->nbins_z_orig, 0);
762 if (args_info->nrbins_given)
763 write_into_file(outfile, "nrbins", args_info->nrbins_orig, 0);
764 if (args_info->binWidth_given)
765 write_into_file(outfile, "binWidth", args_info->binWidth_orig, 0);
766 if (args_info->nanglebins_given)
767 write_into_file(outfile, "nanglebins", args_info->nanglebins_orig, 0);
768 if (args_info->rcut_given)
769 write_into_file(outfile, "rcut", args_info->rcut_orig, 0);
770 if (args_info->OOcut_given)
771 write_into_file(outfile, "OOcut", args_info->OOcut_orig, 0);
772 if (args_info->thetacut_given)
773 write_into_file(outfile, "thetacut", args_info->thetacut_orig, 0);
774 if (args_info->OHcut_given)
775 write_into_file(outfile, "OHcut", args_info->OHcut_orig, 0);
776 if (args_info->dz_given)
777 write_into_file(outfile, "dz", args_info->dz_orig, 0);
778 if (args_info->length_given)
779 write_into_file(outfile, "length", args_info->length_orig, 0);
780 if (args_info->zlength_given)
781 write_into_file(outfile, "zlength", args_info->zlength_orig, 0);
782 if (args_info->zoffset_given)
783 write_into_file(outfile, "zoffset", args_info->zoffset_orig, 0);
784 if (args_info->sele1_given)
785 write_into_file(outfile, "sele1", args_info->sele1_orig, 0);
786 if (args_info->sele2_given)
787 write_into_file(outfile, "sele2", args_info->sele2_orig, 0);
788 if (args_info->sele3_given)
789 write_into_file(outfile, "sele3", args_info->sele3_orig, 0);
790 if (args_info->refsele_given)
791 write_into_file(outfile, "refsele", args_info->refsele_orig, 0);
792 if (args_info->comsele_given)
793 write_into_file(outfile, "comsele", args_info->comsele_orig, 0);
794 if (args_info->seleoffset_given)
795 write_into_file(outfile, "seleoffset", args_info->seleoffset_orig, 0);
796 if (args_info->seleoffset2_given)
797 write_into_file(outfile, "seleoffset2", args_info->seleoffset2_orig, 0);
798 if (args_info->seleoffset3_given)
799 write_into_file(outfile, "seleoffset3", args_info->seleoffset3_orig, 0);
800 if (args_info->molname_given)
801 write_into_file(outfile, "molname", args_info->molname_orig, 0);
802 if (args_info->begin_given)
803 write_into_file(outfile, "begin", args_info->begin_orig, 0);
804 if (args_info->end_given)
805 write_into_file(outfile, "end", args_info->end_orig, 0);
806 if (args_info->radius_given)
807 write_into_file(outfile, "radius", args_info->radius_orig, 0);
808 if (args_info->voxelSize_given)
809 write_into_file(outfile, "voxelSize", args_info->voxelSize_orig, 0);
810 if (args_info->gaussWidth_given)
811 write_into_file(outfile, "gaussWidth", args_info->gaussWidth_orig, 0);
812 if (args_info->privilegedAxis_given)
813 write_into_file(outfile, "privilegedAxis", args_info->privilegedAxis_orig, cmdline_parser_privilegedAxis_values);
814 if (args_info->privilegedAxis2_given)
815 write_into_file(outfile, "privilegedAxis2", args_info->privilegedAxis2_orig, cmdline_parser_privilegedAxis2_values);
816 if (args_info->momentum_given)
817 write_into_file(outfile, "momentum", args_info->momentum_orig, cmdline_parser_momentum_values);
818 if (args_info->component_given)
819 write_into_file(outfile, "component", args_info->component_orig, cmdline_parser_component_values);
820 if (args_info->dipoleX_given)
821 write_into_file(outfile, "dipoleX", args_info->dipoleX_orig, 0);
822 if (args_info->dipoleY_given)
823 write_into_file(outfile, "dipoleY", args_info->dipoleY_orig, 0);
824 if (args_info->dipoleZ_given)
825 write_into_file(outfile, "dipoleZ", args_info->dipoleZ_orig, 0);
826 if (args_info->v_radius_given)
827 write_into_file(outfile, "v_radius", args_info->v_radius_orig, 0);
828 if (args_info->gen_xyz_given)
829 write_into_file(outfile, "gen_xyz", 0, 0 );
830 if (args_info->atom_name_given)
831 write_into_file(outfile, "atom_name", args_info->atom_name_orig, 0);
832 if (args_info->sfgPolarization_given)
833 write_into_file(outfile, "sfgPolarization", args_info->sfgPolarization_orig, 0);
834 if (args_info->lorentzianWidth_given)
835 write_into_file(outfile, "lorentzianWidth", args_info->lorentzianWidth_orig, 0);
836 if (args_info->fermiCoupling_given)
837 write_into_file(outfile, "fermiCoupling", args_info->fermiCoupling_orig, 0);
838 if (args_info->bo_given)
839 write_into_file(outfile, "bo", 0, 0 );
840 if (args_info->ior_given)
841 write_into_file(outfile, "ior", 0, 0 );
842 if (args_info->for_given)
843 write_into_file(outfile, "for", 0, 0 );
844 if (args_info->bad_given)
845 write_into_file(outfile, "bad", 0, 0 );
846 if (args_info->count_given)
847 write_into_file(outfile, "count", 0, 0 );
848 if (args_info->mcount_given)
849 write_into_file(outfile, "mcount", 0, 0 );
850 if (args_info->gofr_given)
851 write_into_file(outfile, "gofr", 0, 0 );
852 if (args_info->gofz_given)
853 write_into_file(outfile, "gofz", 0, 0 );
854 if (args_info->r_theta_given)
855 write_into_file(outfile, "r_theta", 0, 0 );
856 if (args_info->r_omega_given)
857 write_into_file(outfile, "r_omega", 0, 0 );
858 if (args_info->r_z_given)
859 write_into_file(outfile, "r_z", 0, 0 );
860 if (args_info->theta_omega_given)
861 write_into_file(outfile, "theta_omega", 0, 0 );
862 if (args_info->r_theta_omega_given)
863 write_into_file(outfile, "r_theta_omega", 0, 0 );
864 if (args_info->gxyz_given)
865 write_into_file(outfile, "gxyz", 0, 0 );
866 if (args_info->twodgofr_given)
867 write_into_file(outfile, "twodgofr", 0, 0 );
868 if (args_info->kirkwood_buff_given)
869 write_into_file(outfile, "kirkwood_buff", 0, 0 );
870 if (args_info->p2_given)
871 write_into_file(outfile, "p2", 0, 0 );
872 if (args_info->p2r_given)
873 write_into_file(outfile, "p2r", 0, 0 );
874 if (args_info->p2z_given)
875 write_into_file(outfile, "p2z", 0, 0 );
876 if (args_info->rp2_given)
877 write_into_file(outfile, "rp2", 0, 0 );
878 if (args_info->scd_given)
879 write_into_file(outfile, "scd", 0, 0 );
880 if (args_info->density_given)
881 write_into_file(outfile, "density", 0, 0 );
882 if (args_info->slab_density_given)
883 write_into_file(outfile, "slab_density", 0, 0 );
884 if (args_info->pipe_density_given)
885 write_into_file(outfile, "pipe_density", 0, 0 );
886 if (args_info->p_angle_given)
887 write_into_file(outfile, "p_angle", 0, 0 );
888 if (args_info->hxy_given)
889 write_into_file(outfile, "hxy", 0, 0 );
890 if (args_info->rho_r_given)
891 write_into_file(outfile, "rho_r", 0, 0 );
892 if (args_info->angle_r_given)
893 write_into_file(outfile, "angle_r", 0, 0 );
894 if (args_info->hullvol_given)
895 write_into_file(outfile, "hullvol", 0, 0 );
896 if (args_info->rodlength_given)
897 write_into_file(outfile, "rodlength", 0, 0 );
898 if (args_info->tet_param_given)
899 write_into_file(outfile, "tet_param", 0, 0 );
900 if (args_info->tet_param_z_given)
901 write_into_file(outfile, "tet_param_z", 0, 0 );
902 if (args_info->tet_param_r_given)
903 write_into_file(outfile, "tet_param_r", 0, 0 );
904 if (args_info->tet_param_rangle_given)
905 write_into_file(outfile, "tet_param_rangle", 0, 0 );
906 if (args_info->tet_param_dens_given)
907 write_into_file(outfile, "tet_param_dens", 0, 0 );
908 if (args_info->tet_param_xyz_given)
909 write_into_file(outfile, "tet_param_xyz", 0, 0 );
910 if (args_info->trans_param_z_given)
911 write_into_file(outfile, "trans_param_z", 0, 0 );
912 if (args_info->rnemdz_given)
913 write_into_file(outfile, "rnemdz", 0, 0 );
914 if (args_info->rnemdr_given)
915 write_into_file(outfile, "rnemdr", 0, 0 );
916 if (args_info->rnemdrt_given)
917 write_into_file(outfile, "rnemdrt", 0, 0 );
918 if (args_info->nitrile_given)
919 write_into_file(outfile, "nitrile", 0, 0 );
920 if (args_info->OHfreqmap_given)
921 write_into_file(outfile, "OHfreqmap", 0, 0 );
922 if (args_info->multipole_given)
923 write_into_file(outfile, "multipole", 0, 0 );
924 if (args_info->surfDiffusion_given)
925 write_into_file(outfile, "surfDiffusion", 0, 0 );
926 if (args_info->cn_given)
927 write_into_file(outfile, "cn", 0, 0 );
928 if (args_info->scn_given)
929 write_into_file(outfile, "scn", 0, 0 );
930 if (args_info->gcn_given)
931 write_into_file(outfile, "gcn", 0, 0 );
932 if (args_info->hbond_given)
933 write_into_file(outfile, "hbond", 0, 0 );
934 if (args_info->hbondz_given)
935 write_into_file(outfile, "hbondz", 0, 0 );
936 if (args_info->hbondzvol_given)
937 write_into_file(outfile, "hbondzvol", 0, 0 );
938 if (args_info->hbondr_given)
939 write_into_file(outfile, "hbondr", 0, 0 );
940 if (args_info->hbondrvol_given)
941 write_into_file(outfile, "hbondrvol", 0, 0 );
942 if (args_info->potDiff_given)
943 write_into_file(outfile, "potDiff", 0, 0 );
944 if (args_info->tet_hb_given)
945 write_into_file(outfile, "tet_hb", 0, 0 );
946 if (args_info->kirkwood_given)
947 write_into_file(outfile, "kirkwood", 0, 0 );
948 if (args_info->kirkwoodQ_given)
949 write_into_file(outfile, "kirkwoodQ", 0, 0 );
950 if (args_info->densityfield_given)
951 write_into_file(outfile, "densityfield", 0, 0 );
952 if (args_info->velocityfield_given)
953 write_into_file(outfile, "velocityfield", 0, 0 );
954 if (args_info->velocityZ_given)
955 write_into_file(outfile, "velocityZ", 0, 0 );
956 if (args_info->eam_density_given)
957 write_into_file(outfile, "eam_density", 0, 0 );
958 if (args_info->net_charge_given)
959 write_into_file(outfile, "net_charge", 0, 0 );
960 if (args_info->current_density_given)
961 write_into_file(outfile, "current_density", 0, 0 );
962 if (args_info->chargez_given)
963 write_into_file(outfile, "chargez", 0, 0 );
964 if (args_info->charger_given)
965 write_into_file(outfile, "charger", 0, 0 );
966 if (args_info->massdensityz_given)
967 write_into_file(outfile, "massdensityz", 0, 0 );
968 if (args_info->massdensityr_given)
969 write_into_file(outfile, "massdensityr", 0, 0 );
970 if (args_info->numberz_given)
971 write_into_file(outfile, "numberz", 0, 0 );
972 if (args_info->numberr_given)
973 write_into_file(outfile, "numberr", 0, 0 );
974 if (args_info->charge_density_z_given)
975 write_into_file(outfile, "charge_density_z", 0, 0 );
976 if (args_info->countz_given)
977 write_into_file(outfile, "countz", 0, 0 );
978 if (args_info->momentum_distribution_given)
979 write_into_file(outfile, "momentum_distribution", 0, 0 );
980 if (args_info->dipole_orientation_given)
981 write_into_file(outfile, "dipole_orientation", 0, 0 );
982 if (args_info->order_prob_given)
983 write_into_file(outfile, "order_prob", 0, 0 );
984 if (args_info->sfg_given)
985 write_into_file(outfile, "sfg", 0, 0 );
986
987
988 i = EXIT_SUCCESS;
989 return i;
990}
991
992int
993cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info)
994{
995 FILE *outfile;
996 int i = 0;
997
998 outfile = fopen(filename, "w");
999
1000 if (!outfile)
1001 {
1002 fprintf (stderr, "%s: cannot open file for writing: %s\n", CMDLINE_PARSER_PACKAGE, filename);
1003 return EXIT_FAILURE;
1004 }
1005
1006 i = cmdline_parser_dump(outfile, args_info);
1007 fclose (outfile);
1008
1009 return i;
1010}
1011
1012void
1013cmdline_parser_free (struct gengetopt_args_info *args_info)
1014{
1015 cmdline_parser_release (args_info);
1016}
1017
1018/** @brief replacement of strdup, which is not standard */
1019char *
1020gengetopt_strdup (const char *s)
1021{
1022 char *result = 0;
1023 if (!s)
1024 return result;
1025
1026 result = (char*)malloc(strlen(s) + 1);
1027 if (result == (char*)0)
1028 return (char*)0;
1029 strcpy(result, s);
1030 return result;
1031}
1032
1033static void
1034reset_group_staticProps(struct gengetopt_args_info *args_info)
1035{
1036 if (! args_info->staticProps_group_counter)
1037 return;
1038
1039 args_info->bo_given = 0 ;
1040 args_info->ior_given = 0 ;
1041 args_info->for_given = 0 ;
1042 args_info->bad_given = 0 ;
1043 args_info->count_given = 0 ;
1044 args_info->mcount_given = 0 ;
1045 args_info->gofr_given = 0 ;
1046 args_info->gofz_given = 0 ;
1047 args_info->r_theta_given = 0 ;
1048 args_info->r_omega_given = 0 ;
1049 args_info->r_z_given = 0 ;
1050 args_info->theta_omega_given = 0 ;
1051 args_info->r_theta_omega_given = 0 ;
1052 args_info->gxyz_given = 0 ;
1053 args_info->twodgofr_given = 0 ;
1054 args_info->kirkwood_buff_given = 0 ;
1055 args_info->p2_given = 0 ;
1056 args_info->p2r_given = 0 ;
1057 args_info->p2z_given = 0 ;
1058 args_info->rp2_given = 0 ;
1059 args_info->scd_given = 0 ;
1060 args_info->density_given = 0 ;
1061 args_info->slab_density_given = 0 ;
1062 args_info->pipe_density_given = 0 ;
1063 args_info->p_angle_given = 0 ;
1064 args_info->hxy_given = 0 ;
1065 args_info->rho_r_given = 0 ;
1066 args_info->angle_r_given = 0 ;
1067 args_info->hullvol_given = 0 ;
1068 args_info->rodlength_given = 0 ;
1069 args_info->tet_param_given = 0 ;
1070 args_info->tet_param_z_given = 0 ;
1071 args_info->tet_param_r_given = 0 ;
1072 args_info->tet_param_rangle_given = 0 ;
1073 args_info->tet_param_dens_given = 0 ;
1074 args_info->tet_param_xyz_given = 0 ;
1075 args_info->trans_param_z_given = 0 ;
1076 args_info->rnemdz_given = 0 ;
1077 args_info->rnemdr_given = 0 ;
1078 args_info->rnemdrt_given = 0 ;
1079 args_info->nitrile_given = 0 ;
1080 args_info->OHfreqmap_given = 0 ;
1081 args_info->multipole_given = 0 ;
1082 args_info->surfDiffusion_given = 0 ;
1083 args_info->cn_given = 0 ;
1084 args_info->scn_given = 0 ;
1085 args_info->gcn_given = 0 ;
1086 args_info->hbond_given = 0 ;
1087 args_info->hbondz_given = 0 ;
1088 args_info->hbondzvol_given = 0 ;
1089 args_info->hbondr_given = 0 ;
1090 args_info->hbondrvol_given = 0 ;
1091 args_info->potDiff_given = 0 ;
1092 args_info->tet_hb_given = 0 ;
1093 args_info->kirkwood_given = 0 ;
1094 args_info->kirkwoodQ_given = 0 ;
1095 args_info->densityfield_given = 0 ;
1096 args_info->velocityfield_given = 0 ;
1097 args_info->velocityZ_given = 0 ;
1098 args_info->eam_density_given = 0 ;
1099 args_info->net_charge_given = 0 ;
1100 args_info->current_density_given = 0 ;
1101 args_info->chargez_given = 0 ;
1102 args_info->charger_given = 0 ;
1103 args_info->massdensityz_given = 0 ;
1104 args_info->massdensityr_given = 0 ;
1105 args_info->numberz_given = 0 ;
1106 args_info->numberr_given = 0 ;
1107 args_info->charge_density_z_given = 0 ;
1108 args_info->countz_given = 0 ;
1109 args_info->momentum_distribution_given = 0 ;
1110 args_info->dipole_orientation_given = 0 ;
1111 args_info->order_prob_given = 0 ;
1112 args_info->sfg_given = 0 ;
1113
1114 args_info->staticProps_group_counter = 0;
1115}
1116
1117int
1118cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info)
1119{
1120 return cmdline_parser2 (argc, argv, args_info, 0, 1, 1);
1121}
1122
1123int
1124cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info,
1125 struct cmdline_parser_params *params)
1126{
1127 int result;
1128 result = cmdline_parser_internal (argc, argv, args_info, params, 0);
1129
1130 return result;
1131}
1132
1133int
1134cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
1135{
1136 int result;
1137 struct cmdline_parser_params params;
1138
1139 params.override = override;
1140 params.initialize = initialize;
1142 params.check_ambiguity = 0;
1143 params.print_errors = 1;
1144
1145 result = cmdline_parser_internal (argc, argv, args_info, &params, 0);
1146
1147 return result;
1148}
1149
1150int
1151cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name)
1152{
1153 int result = EXIT_SUCCESS;
1154
1155 if (cmdline_parser_required2(args_info, prog_name, 0) > 0)
1156 result = EXIT_FAILURE;
1157
1158 return result;
1159}
1160
1161int
1162cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error)
1163{
1164 int error_occurred = 0;
1165 FIX_UNUSED (additional_error);
1166
1167 /* checks for required options */
1168 if (! args_info->input_given)
1169 {
1170 fprintf (stderr, "%s: '--input' ('-i') option required%s\n", prog_name, (additional_error ? additional_error : ""));
1171 error_occurred = 1;
1172 }
1173
1174 if (args_info->staticProps_group_counter == 0)
1175 {
1176 fprintf (stderr, "%s: %d options of group staticProps were given. One is required%s.\n", prog_name, args_info->staticProps_group_counter, (additional_error ? additional_error : ""));
1177 error_occurred = 1;
1178 }
1179
1180
1181 /* checks for dependences among options */
1182
1183 return error_occurred;
1184}
1185
1186/*
1187 * Extracted from the glibc source tree, version 2.3.6
1188 *
1189 * Licensed under the GPL as per the whole glibc source tree.
1190 *
1191 * This file was modified so that getopt_long can be called
1192 * many times without risking previous memory to be spoiled.
1193 *
1194 * Modified by Andre Noll and Lorenzo Bettini for use in
1195 * GNU gengetopt generated files.
1196 *
1197 */
1198
1199/*
1200 * we must include anything we need since this file is not thought to be
1201 * inserted in a file already using getopt.h
1202 *
1203 * Lorenzo
1204 */
1205
1206struct option
1207{
1208 const char *name;
1209 /* has_arg can't be an enum because some compilers complain about
1210 type mismatches in all the code that assumes it is an int. */
1211 int has_arg;
1212 int *flag;
1213 int val;
1214};
1215
1216/* This version of `getopt' appears to the caller like standard Unix `getopt'
1217 but it behaves differently for the user, since it allows the user
1218 to intersperse the options with the other arguments.
1219
1220 As `getopt' works, it permutes the elements of ARGV so that,
1221 when it is done, all the options precede everything else. Thus
1222 all application programs are extended to handle flexible argument order.
1223*/
1224/*
1225 If the field `flag' is not NULL, it points to a variable that is set
1226 to the value given in the field `val' when the option is found, but
1227 left unchanged if the option is not found.
1228
1229 To have a long-named option do something other than set an `int' to
1230 a compiled-in constant, such as set a value from `custom_optarg', set the
1231 option's `flag' field to zero and its `val' field to a nonzero
1232 value (the equivalent single-letter option character, if there is
1233 one). For long options that have a zero `flag' field, `getopt'
1234 returns the contents of the `val' field. */
1235
1236/* Names for the values of the `has_arg' field of `struct option'. */
1237#ifndef no_argument
1238#define no_argument 0
1239#endif
1240
1241#ifndef required_argument
1242#define required_argument 1
1243#endif
1244
1245#ifndef optional_argument
1246#define optional_argument 2
1247#endif
1248
1249struct custom_getopt_data {
1250 /*
1251 * These have exactly the same meaning as the corresponding global variables,
1252 * except that they are used for the reentrant versions of getopt.
1253 */
1254 int custom_optind;
1255 int custom_opterr;
1256 int custom_optopt;
1257 char *custom_optarg;
1258
1259 /* True if the internal members have been initialized. */
1260 int initialized;
1261
1262 /*
1263 * The next char to be scanned in the option-element in which the last option
1264 * character we returned was found. This allows us to pick up the scan where
1265 * we left off. If this is zero, or a null string, it means resume the scan by
1266 * advancing to the next ARGV-element.
1267 */
1268 char *nextchar;
1269
1270 /*
1271 * Describe the part of ARGV that contains non-options that have been skipped.
1272 * `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is
1273 * the index after the last of them.
1274 */
1275 int first_nonopt;
1276 int last_nonopt;
1277};
1278
1279/*
1280 * the variables optarg, optind, opterr and optopt are renamed with
1281 * the custom_ prefix so that they don't interfere with getopt ones.
1282 *
1283 * Moreover they're static so they are visible only from within the
1284 * file where this very file will be included.
1285 */
1286
1287/*
1288 * For communication from `custom_getopt' to the caller. When `custom_getopt' finds an
1289 * option that takes an argument, the argument value is returned here.
1290 */
1291static char *custom_optarg;
1292
1293/*
1294 * Index in ARGV of the next element to be scanned. This is used for
1295 * communication to and from the caller and for communication between
1296 * successive calls to `custom_getopt'.
1297 *
1298 * On entry to `custom_getopt', 1 means this is the first call; initialize.
1299 *
1300 * When `custom_getopt' returns -1, this is the index of the first of the non-option
1301 * elements that the caller should itself scan.
1302 *
1303 * Otherwise, `custom_optind' communicates from one call to the next how much of ARGV
1304 * has been scanned so far.
1305 *
1306 * 1003.2 says this must be 1 before any call.
1307 */
1308static int custom_optind = 1;
1309
1310/*
1311 * Callers store zero here to inhibit the error message for unrecognized
1312 * options.
1313 */
1314static int custom_opterr = 1;
1315
1316/*
1317 * Set to an option character which was unrecognized. This must be initialized
1318 * on some systems to avoid linking in the system's own getopt implementation.
1319 */
1320static int custom_optopt = '?';
1321
1322/*
1323 * Exchange two adjacent subsequences of ARGV. One subsequence is elements
1324 * [first_nonopt,last_nonopt) which contains all the non-options that have been
1325 * skipped so far. The other is elements [last_nonopt,custom_optind), which contains
1326 * all the options processed since those non-options were skipped.
1327 * `first_nonopt' and `last_nonopt' are relocated so that they describe the new
1328 * indices of the non-options in ARGV after they are moved.
1329 */
1330static void exchange(char **argv, struct custom_getopt_data *d)
1331{
1332 int bottom = d->first_nonopt;
1333 int middle = d->last_nonopt;
1334 int top = d->custom_optind;
1335 char *tem;
1336
1337 /*
1338 * Exchange the shorter segment with the far end of the longer segment.
1339 * That puts the shorter segment into the right place. It leaves the
1340 * longer segment in the right place overall, but it consists of two
1341 * parts that need to be swapped next.
1342 */
1343 while (top > middle && middle > bottom) {
1344 if (top - middle > middle - bottom) {
1345 /* Bottom segment is the short one. */
1346 int len = middle - bottom;
1347 int i;
1348
1349 /* Swap it with the top part of the top segment. */
1350 for (i = 0; i < len; i++) {
1351 tem = argv[bottom + i];
1352 argv[bottom + i] =
1353 argv[top - (middle - bottom) + i];
1354 argv[top - (middle - bottom) + i] = tem;
1355 }
1356 /* Exclude the moved bottom segment from further swapping. */
1357 top -= len;
1358 } else {
1359 /* Top segment is the short one. */
1360 int len = top - middle;
1361 int i;
1362
1363 /* Swap it with the bottom part of the bottom segment. */
1364 for (i = 0; i < len; i++) {
1365 tem = argv[bottom + i];
1366 argv[bottom + i] = argv[middle + i];
1367 argv[middle + i] = tem;
1368 }
1369 /* Exclude the moved top segment from further swapping. */
1370 bottom += len;
1371 }
1372 }
1373 /* Update records for the slots the non-options now occupy. */
1374 d->first_nonopt += (d->custom_optind - d->last_nonopt);
1375 d->last_nonopt = d->custom_optind;
1376}
1377
1378/* Initialize the internal data when the first call is made. */
1379static void custom_getopt_initialize(struct custom_getopt_data *d)
1380{
1381 /*
1382 * Start processing options with ARGV-element 1 (since ARGV-element 0
1383 * is the program name); the sequence of previously skipped non-option
1384 * ARGV-elements is empty.
1385 */
1386 d->first_nonopt = d->last_nonopt = d->custom_optind;
1387 d->nextchar = NULL;
1388 d->initialized = 1;
1389}
1390
1391#define NONOPTION_P (argv[d->custom_optind][0] != '-' || argv[d->custom_optind][1] == '\0')
1392
1393/* return: zero: continue, nonzero: return given value to user */
1394static int shuffle_argv(int argc, char *const *argv,const struct option *longopts,
1395 struct custom_getopt_data *d)
1396{
1397 /*
1398 * Give FIRST_NONOPT & LAST_NONOPT rational values if CUSTOM_OPTIND has been
1399 * moved back by the user (who may also have changed the arguments).
1400 */
1401 if (d->last_nonopt > d->custom_optind)
1402 d->last_nonopt = d->custom_optind;
1403 if (d->first_nonopt > d->custom_optind)
1404 d->first_nonopt = d->custom_optind;
1405 /*
1406 * If we have just processed some options following some
1407 * non-options, exchange them so that the options come first.
1408 */
1409 if (d->first_nonopt != d->last_nonopt &&
1410 d->last_nonopt != d->custom_optind)
1411 exchange((char **) argv, d);
1412 else if (d->last_nonopt != d->custom_optind)
1413 d->first_nonopt = d->custom_optind;
1414 /*
1415 * Skip any additional non-options and extend the range of
1416 * non-options previously skipped.
1417 */
1418 while (d->custom_optind < argc && NONOPTION_P)
1419 d->custom_optind++;
1420 d->last_nonopt = d->custom_optind;
1421 /*
1422 * The special ARGV-element `--' means premature end of options. Skip
1423 * it like a null option, then exchange with previous non-options as if
1424 * it were an option, then skip everything else like a non-option.
1425 */
1426 if (d->custom_optind != argc && !strcmp(argv[d->custom_optind], "--")) {
1427 d->custom_optind++;
1428 if (d->first_nonopt != d->last_nonopt
1429 && d->last_nonopt != d->custom_optind)
1430 exchange((char **) argv, d);
1431 else if (d->first_nonopt == d->last_nonopt)
1432 d->first_nonopt = d->custom_optind;
1433 d->last_nonopt = argc;
1434 d->custom_optind = argc;
1435 }
1436 /*
1437 * If we have done all the ARGV-elements, stop the scan and back over
1438 * any non-options that we skipped and permuted.
1439 */
1440 if (d->custom_optind == argc) {
1441 /*
1442 * Set the next-arg-index to point at the non-options that we
1443 * previously skipped, so the caller will digest them.
1444 */
1445 if (d->first_nonopt != d->last_nonopt)
1446 d->custom_optind = d->first_nonopt;
1447 return -1;
1448 }
1449 /*
1450 * If we have come to a non-option and did not permute it, either stop
1451 * the scan or describe it to the caller and pass it by.
1452 */
1453 if (NONOPTION_P) {
1454 d->custom_optarg = argv[d->custom_optind++];
1455 return 1;
1456 }
1457 /*
1458 * We have found another option-ARGV-element. Skip the initial
1459 * punctuation.
1460 */
1461 d->nextchar = (argv[d->custom_optind] + 1 + (longopts != NULL && argv[d->custom_optind][1] == '-'));
1462 return 0;
1463}
1464
1465/*
1466 * Check whether the ARGV-element is a long option.
1467 *
1468 * If there's a long option "fubar" and the ARGV-element is "-fu", consider
1469 * that an abbreviation of the long option, just like "--fu", and not "-f" with
1470 * arg "u".
1471 *
1472 * This distinction seems to be the most useful approach.
1473 *
1474 */
1475static int check_long_opt(int argc, char *const *argv, const char *optstring,
1476 const struct option *longopts, int *longind,
1477 int print_errors, struct custom_getopt_data *d)
1478{
1479 char *nameend;
1480 const struct option *p;
1481 const struct option *pfound = NULL;
1482 int exact = 0;
1483 int ambig = 0;
1484 int indfound = -1;
1485 int option_index;
1486
1487 for (nameend = d->nextchar; *nameend && *nameend != '='; nameend++)
1488 /* Do nothing. */ ;
1489
1490 /* Test all long options for either exact match or abbreviated matches */
1491 for (p = longopts, option_index = 0; p->name; p++, option_index++)
1492 if (!strncmp(p->name, d->nextchar, nameend - d->nextchar)) {
1493 if ((unsigned int) (nameend - d->nextchar)
1494 == (unsigned int) strlen(p->name)) {
1495 /* Exact match found. */
1496 pfound = p;
1497 indfound = option_index;
1498 exact = 1;
1499 break;
1500 } else if (pfound == NULL) {
1501 /* First nonexact match found. */
1502 pfound = p;
1503 indfound = option_index;
1504 } else if (pfound->has_arg != p->has_arg
1505 || pfound->flag != p->flag
1506 || pfound->val != p->val)
1507 /* Second or later nonexact match found. */
1508 ambig = 1;
1509 }
1510 if (ambig && !exact) {
1511 if (print_errors) {
1512 fprintf(stderr,
1513 "%s: option `%s' is ambiguous\n",
1514 argv[0], argv[d->custom_optind]);
1515 }
1516 d->nextchar += strlen(d->nextchar);
1517 d->custom_optind++;
1518 d->custom_optopt = 0;
1519 return '?';
1520 }
1521 if (pfound) {
1522 option_index = indfound;
1523 d->custom_optind++;
1524 if (*nameend) {
1525 if (pfound->has_arg != no_argument)
1526 d->custom_optarg = nameend + 1;
1527 else {
1528 if (print_errors) {
1529 if (argv[d->custom_optind - 1][1] == '-') {
1530 /* --option */
1531 fprintf(stderr, "%s: option `--%s' doesn't allow an argument\n",
1532 argv[0], pfound->name);
1533 } else {
1534 /* +option or -option */
1535 fprintf(stderr, "%s: option `%c%s' doesn't allow an argument\n",
1536 argv[0], argv[d->custom_optind - 1][0], pfound->name);
1537 }
1538
1539 }
1540 d->nextchar += strlen(d->nextchar);
1541 d->custom_optopt = pfound->val;
1542 return '?';
1543 }
1544 } else if (pfound->has_arg == required_argument) {
1545 if (d->custom_optind < argc)
1546 d->custom_optarg = argv[d->custom_optind++];
1547 else {
1548 if (print_errors) {
1549 fprintf(stderr,
1550 "%s: option `%s' requires an argument\n",
1551 argv[0],
1552 argv[d->custom_optind - 1]);
1553 }
1554 d->nextchar += strlen(d->nextchar);
1555 d->custom_optopt = pfound->val;
1556 return optstring[0] == ':' ? ':' : '?';
1557 }
1558 }
1559 d->nextchar += strlen(d->nextchar);
1560 if (longind != NULL)
1561 *longind = option_index;
1562 if (pfound->flag) {
1563 *(pfound->flag) = pfound->val;
1564 return 0;
1565 }
1566 return pfound->val;
1567 }
1568 /*
1569 * Can't find it as a long option. If this is not getopt_long_only, or
1570 * the option starts with '--' or is not a valid short option, then
1571 * it's an error. Otherwise interpret it as a short option.
1572 */
1573 if (print_errors) {
1574 if (argv[d->custom_optind][1] == '-') {
1575 /* --option */
1576 fprintf(stderr,
1577 "%s: unrecognized option `--%s'\n",
1578 argv[0], d->nextchar);
1579 } else {
1580 /* +option or -option */
1581 fprintf(stderr,
1582 "%s: unrecognized option `%c%s'\n",
1583 argv[0], argv[d->custom_optind][0],
1584 d->nextchar);
1585 }
1586 }
1587 d->nextchar = (char *) "";
1588 d->custom_optind++;
1589 d->custom_optopt = 0;
1590 return '?';
1591}
1592
1593static int check_short_opt(int argc, char *const *argv, const char *optstring,
1594 int print_errors, struct custom_getopt_data *d)
1595{
1596 char c = *d->nextchar++;
1597 const char *temp = strchr(optstring, c);
1598
1599 /* Increment `custom_optind' when we start to process its last character. */
1600 if (*d->nextchar == '\0')
1601 ++d->custom_optind;
1602 if (!temp || c == ':') {
1603 if (print_errors)
1604 fprintf(stderr, "%s: invalid option -- %c\n", argv[0], c);
1605
1606 d->custom_optopt = c;
1607 return '?';
1608 }
1609 if (temp[1] == ':') {
1610 if (temp[2] == ':') {
1611 /* This is an option that accepts an argument optionally. */
1612 if (*d->nextchar != '\0') {
1613 d->custom_optarg = d->nextchar;
1614 d->custom_optind++;
1615 } else
1616 d->custom_optarg = NULL;
1617 d->nextchar = NULL;
1618 } else {
1619 /* This is an option that requires an argument. */
1620 if (*d->nextchar != '\0') {
1621 d->custom_optarg = d->nextchar;
1622 /*
1623 * If we end this ARGV-element by taking the
1624 * rest as an arg, we must advance to the next
1625 * element now.
1626 */
1627 d->custom_optind++;
1628 } else if (d->custom_optind == argc) {
1629 if (print_errors) {
1630 fprintf(stderr,
1631 "%s: option requires an argument -- %c\n",
1632 argv[0], c);
1633 }
1634 d->custom_optopt = c;
1635 if (optstring[0] == ':')
1636 c = ':';
1637 else
1638 c = '?';
1639 } else
1640 /*
1641 * We already incremented `custom_optind' once;
1642 * increment it again when taking next ARGV-elt
1643 * as argument.
1644 */
1645 d->custom_optarg = argv[d->custom_optind++];
1646 d->nextchar = NULL;
1647 }
1648 }
1649 return c;
1650}
1651
1652/*
1653 * Scan elements of ARGV for option characters given in OPTSTRING.
1654 *
1655 * If an element of ARGV starts with '-', and is not exactly "-" or "--",
1656 * then it is an option element. The characters of this element
1657 * (aside from the initial '-') are option characters. If `getopt'
1658 * is called repeatedly, it returns successively each of the option characters
1659 * from each of the option elements.
1660 *
1661 * If `getopt' finds another option character, it returns that character,
1662 * updating `custom_optind' and `nextchar' so that the next call to `getopt' can
1663 * resume the scan with the following option character or ARGV-element.
1664 *
1665 * If there are no more option characters, `getopt' returns -1.
1666 * Then `custom_optind' is the index in ARGV of the first ARGV-element
1667 * that is not an option. (The ARGV-elements have been permuted
1668 * so that those that are not options now come last.)
1669 *
1670 * OPTSTRING is a string containing the legitimate option characters.
1671 * If an option character is seen that is not listed in OPTSTRING,
1672 * return '?' after printing an error message. If you set `custom_opterr' to
1673 * zero, the error message is suppressed but we still return '?'.
1674 *
1675 * If a char in OPTSTRING is followed by a colon, that means it wants an arg,
1676 * so the following text in the same ARGV-element, or the text of the following
1677 * ARGV-element, is returned in `custom_optarg'. Two colons mean an option that
1678 * wants an optional arg; if there is text in the current ARGV-element,
1679 * it is returned in `custom_optarg', otherwise `custom_optarg' is set to zero.
1680 *
1681 * If OPTSTRING starts with `-' or `+', it requests different methods of
1682 * handling the non-option ARGV-elements.
1683 * See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
1684 *
1685 * Long-named options begin with `--' instead of `-'.
1686 * Their names may be abbreviated as long as the abbreviation is unique
1687 * or is an exact match for some defined option. If they have an
1688 * argument, it follows the option name in the same ARGV-element, separated
1689 * from the option name by a `=', or else the in next ARGV-element.
1690 * When `getopt' finds a long-named option, it returns 0 if that option's
1691 * `flag' field is nonzero, the value of the option's `val' field
1692 * if the `flag' field is zero.
1693 *
1694 * The elements of ARGV aren't really const, because we permute them.
1695 * But we pretend they're const in the prototype to be compatible
1696 * with other systems.
1697 *
1698 * LONGOPTS is a vector of `struct option' terminated by an
1699 * element containing a name which is zero.
1700 *
1701 * LONGIND returns the index in LONGOPT of the long-named option found.
1702 * It is only valid when a long-named option has been found by the most
1703 * recent call.
1704 *
1705 * Return the option character from OPTS just read. Return -1 when there are
1706 * no more options. For unrecognized options, or options missing arguments,
1707 * `custom_optopt' is set to the option letter, and '?' is returned.
1708 *
1709 * The OPTS string is a list of characters which are recognized option letters,
1710 * optionally followed by colons, specifying that that letter takes an
1711 * argument, to be placed in `custom_optarg'.
1712 *
1713 * If a letter in OPTS is followed by two colons, its argument is optional.
1714 * This behavior is specific to the GNU `getopt'.
1715 *
1716 * The argument `--' causes premature termination of argument scanning,
1717 * explicitly telling `getopt' that there are no more options. If OPTS begins
1718 * with `--', then non-option arguments are treated as arguments to the option
1719 * '\0'. This behavior is specific to the GNU `getopt'.
1720 */
1721
1722static int getopt_internal_r(int argc, char *const *argv, const char *optstring,
1723 const struct option *longopts, int *longind,
1724 struct custom_getopt_data *d)
1725{
1726 int ret, print_errors = d->custom_opterr;
1727
1728 if (optstring[0] == ':')
1729 print_errors = 0;
1730 if (argc < 1)
1731 return -1;
1732 d->custom_optarg = NULL;
1733
1734 /*
1735 * This is a big difference with GNU getopt, since optind == 0
1736 * means initialization while here 1 means first call.
1737 */
1738 if (d->custom_optind == 0 || !d->initialized) {
1739 if (d->custom_optind == 0)
1740 d->custom_optind = 1; /* Don't scan ARGV[0], the program name. */
1741 custom_getopt_initialize(d);
1742 }
1743 if (d->nextchar == NULL || *d->nextchar == '\0') {
1744 ret = shuffle_argv(argc, argv, longopts, d);
1745 if (ret)
1746 return ret;
1747 }
1748 if (longopts && (argv[d->custom_optind][1] == '-' ))
1749 return check_long_opt(argc, argv, optstring, longopts,
1750 longind, print_errors, d);
1751 return check_short_opt(argc, argv, optstring, print_errors, d);
1752}
1753
1754static int custom_getopt_internal(int argc, char *const *argv, const char *optstring,
1755 const struct option *longopts, int *longind)
1756{
1757 int result;
1758 /* Keep a global copy of all internal members of d */
1759 static struct custom_getopt_data d;
1760
1761 d.custom_optind = custom_optind;
1762 d.custom_opterr = custom_opterr;
1763 result = getopt_internal_r(argc, argv, optstring, longopts,
1764 longind, &d);
1765 custom_optind = d.custom_optind;
1766 custom_optarg = d.custom_optarg;
1767 custom_optopt = d.custom_optopt;
1768 return result;
1769}
1770
1771static int custom_getopt_long (int argc, char *const *argv, const char *options,
1772 const struct option *long_options, int *opt_index)
1773{
1774 return custom_getopt_internal(argc, argv, options, long_options,
1775 opt_index);
1776}
1777
1778
1779static char *package_name = 0;
1780
1781/**
1782 * @brief updates an option
1783 * @param field the generic pointer to the field to update
1784 * @param orig_field the pointer to the orig field
1785 * @param field_given the pointer to the number of occurrence of this option
1786 * @param prev_given the pointer to the number of occurrence already seen
1787 * @param value the argument for this option (if null no arg was specified)
1788 * @param possible_values the possible values for this option (if specified)
1789 * @param default_value the default value (in case the option only accepts fixed values)
1790 * @param arg_type the type of this option
1791 * @param check_ambiguity @see cmdline_parser_params.check_ambiguity
1792 * @param override @see cmdline_parser_params.override
1793 * @param no_free whether to free a possible previous value
1794 * @param multiple_option whether this is a multiple option
1795 * @param long_opt the corresponding long option
1796 * @param short_opt the corresponding short option (or '-' if none)
1797 * @param additional_error possible further error specification
1798 */
1799static
1800int update_arg(void *field, char **orig_field,
1801 unsigned int *field_given, unsigned int *prev_given,
1802 char *value, const char *possible_values[],
1803 const char *default_value,
1804 cmdline_parser_arg_type arg_type,
1805 int check_ambiguity, int override,
1806 int no_free, int multiple_option,
1807 const char *long_opt, char short_opt,
1808 const char *additional_error)
1809{
1810 char *stop_char = 0;
1811 const char *val = value;
1812 int found;
1813 char **string_field;
1814 FIX_UNUSED (field);
1815
1816 stop_char = 0;
1817 found = 0;
1818
1819 if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given)))
1820 {
1821 if (short_opt != '-')
1822 fprintf (stderr, "%s: `--%s' (`-%c') option given more than once%s\n",
1823 package_name, long_opt, short_opt,
1824 (additional_error ? additional_error : ""));
1825 else
1826 fprintf (stderr, "%s: `--%s' option given more than once%s\n",
1827 package_name, long_opt,
1828 (additional_error ? additional_error : ""));
1829 return 1; /* failure */
1830 }
1831
1832 if (possible_values && (found = check_possible_values((value ? value : default_value), possible_values)) < 0)
1833 {
1834 if (short_opt != '-')
1835 fprintf (stderr, "%s: %s argument, \"%s\", for option `--%s' (`-%c')%s\n",
1836 package_name, (found == -2) ? "ambiguous" : "invalid", value, long_opt, short_opt,
1837 (additional_error ? additional_error : ""));
1838 else
1839 fprintf (stderr, "%s: %s argument, \"%s\", for option `--%s'%s\n",
1840 package_name, (found == -2) ? "ambiguous" : "invalid", value, long_opt,
1841 (additional_error ? additional_error : ""));
1842 return 1; /* failure */
1843 }
1844
1845 if (field_given && *field_given && ! override)
1846 return 0;
1847 if (prev_given)
1848 (*prev_given)++;
1849 if (field_given)
1850 (*field_given)++;
1851 if (possible_values)
1852 val = possible_values[found];
1853
1854 switch(arg_type) {
1855 case ARG_FLAG:
1856 *((int *)field) = !*((int *)field);
1857 break;
1858 case ARG_INT:
1859 if (val) *((int *)field) = strtol (val, &stop_char, 0);
1860 break;
1861 case ARG_DOUBLE:
1862 if (val) *((double *)field) = strtod (val, &stop_char);
1863 break;
1864 case ARG_ENUM:
1865 if (val) *((int *)field) = found;
1866 break;
1867 case ARG_STRING:
1868 if (val) {
1869 string_field = (char **)field;
1870 if (!no_free && *string_field)
1871 free (*string_field); /* free previous string */
1872 *string_field = gengetopt_strdup (val);
1873 }
1874 break;
1875 default:
1876 break;
1877 };
1878
1879 /* check numeric conversion */
1880 switch(arg_type) {
1881 case ARG_INT:
1882 case ARG_DOUBLE:
1883 if (val && !(stop_char && *stop_char == '\0')) {
1884 fprintf(stderr, "%s: invalid numeric value: %s\n", package_name, val);
1885 return 1; /* failure */
1886 }
1887 break;
1888 default:
1889 ;
1890 };
1891
1892 /* store the original value */
1893 switch(arg_type) {
1894 case ARG_NO:
1895 case ARG_FLAG:
1896 break;
1897 default:
1898 if (value && orig_field) {
1899 if (no_free) {
1900 *orig_field = value;
1901 } else {
1902 if (*orig_field)
1903 free (*orig_field); /* free previous string */
1904 *orig_field = gengetopt_strdup (value);
1905 }
1906 }
1907 };
1908
1909 return 0; /* OK */
1910}
1911
1912
1913int
1914cmdline_parser_internal (
1915 int argc, char **argv, struct gengetopt_args_info *args_info,
1916 struct cmdline_parser_params *params, const char *additional_error)
1917{
1918 int c; /* Character of the parsed option. */
1919
1920 int error_occurred = 0;
1921 struct gengetopt_args_info local_args_info;
1922
1923 int override;
1924 int initialize;
1925 int check_required;
1926 int check_ambiguity;
1927
1928 char *optarg;
1929 int optind;
1930 int opterr;
1931 int optopt;
1932
1933 package_name = argv[0];
1934
1935 /* TODO: Why is this here? It is not used anywhere. */
1936 override = params->override;
1937 FIX_UNUSED(override);
1938
1939 initialize = params->initialize;
1940 check_required = params->check_required;
1941
1942 /* TODO: Why is this here? It is not used anywhere. */
1943 check_ambiguity = params->check_ambiguity;
1944 FIX_UNUSED(check_ambiguity);
1945
1946 if (initialize)
1947 cmdline_parser_init (args_info);
1948
1949 cmdline_parser_init (&local_args_info);
1950
1951 optarg = 0;
1952 optind = 0;
1953 opterr = params->print_errors;
1954 optopt = '?';
1955
1956 while (1)
1957 {
1958 int option_index = 0;
1959
1960 static struct option long_options[] = {
1961 { "help", 0, NULL, 'h' },
1962 { "version", 0, NULL, 'V' },
1963 { "input", 1, NULL, 'i' },
1964 { "output", 1, NULL, 'o' },
1965 { "step", 1, NULL, 'n' },
1966 { "nbins", 1, NULL, 'b' },
1967 { "nbins_x", 1, NULL, 'x' },
1968 { "nbins_y", 1, NULL, 'y' },
1969 { "nbins_z", 1, NULL, 0 },
1970 { "nrbins", 1, NULL, 'r' },
1971 { "binWidth", 1, NULL, 0 },
1972 { "nanglebins", 1, NULL, 'a' },
1973 { "rcut", 1, NULL, 'c' },
1974 { "OOcut", 1, NULL, 0 },
1975 { "thetacut", 1, NULL, 0 },
1976 { "OHcut", 1, NULL, 0 },
1977 { "dz", 1, NULL, 0 },
1978 { "length", 1, NULL, 0 },
1979 { "zlength", 1, NULL, 0 },
1980 { "zoffset", 1, NULL, 'z' },
1981 { "sele1", 1, NULL, 0 },
1982 { "sele2", 1, NULL, 0 },
1983 { "sele3", 1, NULL, 0 },
1984 { "refsele", 1, NULL, 0 },
1985 { "comsele", 1, NULL, 0 },
1986 { "seleoffset", 1, NULL, 0 },
1987 { "seleoffset2", 1, NULL, 0 },
1988 { "seleoffset3", 1, NULL, 0 },
1989 { "molname", 1, NULL, 0 },
1990 { "begin", 1, NULL, 0 },
1991 { "end", 1, NULL, 0 },
1992 { "radius", 1, NULL, 0 },
1993 { "voxelSize", 1, NULL, 'v' },
1994 { "gaussWidth", 1, NULL, 0 },
1995 { "privilegedAxis", 1, NULL, 0 },
1996 { "privilegedAxis2", 1, NULL, 0 },
1997 { "momentum", 1, NULL, 0 },
1998 { "component", 1, NULL, 0 },
1999 { "dipoleX", 1, NULL, 0 },
2000 { "dipoleY", 1, NULL, 0 },
2001 { "dipoleZ", 1, NULL, 0 },
2002 { "v_radius", 1, NULL, 0 },
2003 { "gen_xyz", 0, NULL, 0 },
2004 { "atom_name", 1, NULL, 0 },
2005 { "sfgPolarization", 1, NULL, 0 },
2006 { "lorentzianWidth", 1, NULL, 0 },
2007 { "fermiCoupling", 1, NULL, 0 },
2008 { "bo", 0, NULL, 0 },
2009 { "ior", 0, NULL, 0 },
2010 { "for", 0, NULL, 0 },
2011 { "bad", 0, NULL, 0 },
2012 { "count", 0, NULL, 0 },
2013 { "mcount", 0, NULL, 0 },
2014 { "gofr", 0, NULL, 'g' },
2015 { "gofz", 0, NULL, 0 },
2016 { "r_theta", 0, NULL, 0 },
2017 { "r_omega", 0, NULL, 0 },
2018 { "r_z", 0, NULL, 0 },
2019 { "theta_omega", 0, NULL, 0 },
2020 { "r_theta_omega", 0, NULL, 0 },
2021 { "gxyz", 0, NULL, 0 },
2022 { "twodgofr", 0, NULL, 0 },
2023 { "kirkwood_buff", 0, NULL, 0 },
2024 { "p2", 0, NULL, 'p' },
2025 { "p2r", 0, NULL, 0 },
2026 { "p2z", 0, NULL, 0 },
2027 { "rp2", 0, NULL, 0 },
2028 { "scd", 0, NULL, 's' },
2029 { "density", 0, NULL, 'd' },
2030 { "slab_density", 0, NULL, 0 },
2031 { "pipe_density", 0, NULL, 0 },
2032 { "p_angle", 0, NULL, 0 },
2033 { "hxy", 0, NULL, 0 },
2034 { "rho_r", 0, NULL, 0 },
2035 { "angle_r", 0, NULL, 0 },
2036 { "hullvol", 0, NULL, 0 },
2037 { "rodlength", 0, NULL, 0 },
2038 { "tet_param", 0, NULL, 'Q' },
2039 { "tet_param_z", 0, NULL, 0 },
2040 { "tet_param_r", 0, NULL, 0 },
2041 { "tet_param_rangle", 0, NULL, 0 },
2042 { "tet_param_dens", 0, NULL, 0 },
2043 { "tet_param_xyz", 0, NULL, 0 },
2044 { "trans_param_z", 0, NULL, 0 },
2045 { "rnemdz", 0, NULL, 0 },
2046 { "rnemdr", 0, NULL, 0 },
2047 { "rnemdrt", 0, NULL, 0 },
2048 { "nitrile", 0, NULL, 0 },
2049 { "OHfreqmap", 0, NULL, 0 },
2050 { "multipole", 0, NULL, 'm' },
2051 { "surfDiffusion", 0, NULL, 0 },
2052 { "cn", 0, NULL, 0 },
2053 { "scn", 0, NULL, 0 },
2054 { "gcn", 0, NULL, 0 },
2055 { "hbond", 0, NULL, 0 },
2056 { "hbondz", 0, NULL, 0 },
2057 { "hbondzvol", 0, NULL, 0 },
2058 { "hbondr", 0, NULL, 0 },
2059 { "hbondrvol", 0, NULL, 0 },
2060 { "potDiff", 0, NULL, 0 },
2061 { "tet_hb", 0, NULL, 0 },
2062 { "kirkwood", 0, NULL, 'k' },
2063 { "kirkwoodQ", 0, NULL, 0 },
2064 { "densityfield", 0, NULL, 0 },
2065 { "velocityfield", 0, NULL, 0 },
2066 { "velocityZ", 0, NULL, 0 },
2067 { "eam_density", 0, NULL, 'D' },
2068 { "net_charge", 0, NULL, 'q' },
2069 { "current_density", 0, NULL, 'J' },
2070 { "chargez", 0, NULL, 0 },
2071 { "charger", 0, NULL, 0 },
2072 { "massdensityz", 0, NULL, 0 },
2073 { "massdensityr", 0, NULL, 0 },
2074 { "numberz", 0, NULL, 0 },
2075 { "numberr", 0, NULL, 0 },
2076 { "charge_density_z", 0, NULL, 0 },
2077 { "countz", 0, NULL, 0 },
2078 { "momentum_distribution", 0, NULL, 'M' },
2079 { "dipole_orientation", 0, NULL, 'S' },
2080 { "order_prob", 0, NULL, 0 },
2081 { "sfg", 0, NULL, 0 },
2082 { 0, 0, 0, 0 }
2083 };
2084
2085 custom_optarg = optarg;
2086 custom_optind = optind;
2087 custom_opterr = opterr;
2088 custom_optopt = optopt;
2089
2090 c = custom_getopt_long (argc, argv, "hVi:o:n:b:x:y:r:a:c:z:v:gpsdQmkDqJMS", long_options, &option_index);
2091
2092 optarg = custom_optarg;
2093 optind = custom_optind;
2094 opterr = custom_opterr;
2095 optopt = custom_optopt;
2096
2097 if (c == -1) break; /* Exit from `while (1)' loop. */
2098
2099 switch (c)
2100 {
2101 case 'h': /* Print help and exit. */
2103 cmdline_parser_free (&local_args_info);
2104 exit (EXIT_SUCCESS);
2105
2106 case 'V': /* Print version and exit. */
2108 cmdline_parser_free (&local_args_info);
2109 exit (EXIT_SUCCESS);
2110
2111 case 'i': /* input dump file. */
2112
2113
2114 if (update_arg( (void *)&(args_info->input_arg),
2115 &(args_info->input_orig), &(args_info->input_given),
2116 &(local_args_info.input_given), optarg, 0, 0, ARG_STRING,
2117 check_ambiguity, override, 0, 0,
2118 "input", 'i',
2119 additional_error))
2120 goto failure;
2121
2122 break;
2123 case 'o': /* output file name. */
2124
2125
2126 if (update_arg( (void *)&(args_info->output_arg),
2127 &(args_info->output_orig), &(args_info->output_given),
2128 &(local_args_info.output_given), optarg, 0, 0, ARG_STRING,
2129 check_ambiguity, override, 0, 0,
2130 "output", 'o',
2131 additional_error))
2132 goto failure;
2133
2134 break;
2135 case 'n': /* process every n frame. */
2136
2137
2138 if (update_arg( (void *)&(args_info->step_arg),
2139 &(args_info->step_orig), &(args_info->step_given),
2140 &(local_args_info.step_given), optarg, 0, "1", ARG_INT,
2141 check_ambiguity, override, 0, 0,
2142 "step", 'n',
2143 additional_error))
2144 goto failure;
2145
2146 break;
2147 case 'b': /* number of bins (general purpose). */
2148
2149
2150 if (update_arg( (void *)&(args_info->nbins_arg),
2151 &(args_info->nbins_orig), &(args_info->nbins_given),
2152 &(local_args_info.nbins_given), optarg, 0, "100", ARG_INT,
2153 check_ambiguity, override, 0, 0,
2154 "nbins", 'b',
2155 additional_error))
2156 goto failure;
2157
2158 break;
2159 case 'x': /* number of bins in x axis. */
2160
2161
2162 if (update_arg( (void *)&(args_info->nbins_x_arg),
2163 &(args_info->nbins_x_orig), &(args_info->nbins_x_given),
2164 &(local_args_info.nbins_x_given), optarg, 0, "100", ARG_INT,
2165 check_ambiguity, override, 0, 0,
2166 "nbins_x", 'x',
2167 additional_error))
2168 goto failure;
2169
2170 break;
2171 case 'y': /* number of bins in y axis. */
2172
2173
2174 if (update_arg( (void *)&(args_info->nbins_y_arg),
2175 &(args_info->nbins_y_orig), &(args_info->nbins_y_given),
2176 &(local_args_info.nbins_y_given), optarg, 0, "100", ARG_INT,
2177 check_ambiguity, override, 0, 0,
2178 "nbins_y", 'y',
2179 additional_error))
2180 goto failure;
2181
2182 break;
2183 case 'r': /* number of radial bins (usually duplicates functionality of nbins). */
2184
2185
2186 if (update_arg( (void *)&(args_info->nrbins_arg),
2187 &(args_info->nrbins_orig), &(args_info->nrbins_given),
2188 &(local_args_info.nrbins_given), optarg, 0, "100", ARG_INT,
2189 check_ambiguity, override, 0, 0,
2190 "nrbins", 'r',
2191 additional_error))
2192 goto failure;
2193
2194 break;
2195 case 'a': /* number of bins for cos(angle). */
2196
2197
2198 if (update_arg( (void *)&(args_info->nanglebins_arg),
2199 &(args_info->nanglebins_orig), &(args_info->nanglebins_given),
2200 &(local_args_info.nanglebins_given), optarg, 0, "50", ARG_INT,
2201 check_ambiguity, override, 0, 0,
2202 "nanglebins", 'a',
2203 additional_error))
2204 goto failure;
2205
2206 break;
2207 case 'c': /* cutoff radius (rcut). */
2208
2209
2210 if (update_arg( (void *)&(args_info->rcut_arg),
2211 &(args_info->rcut_orig), &(args_info->rcut_given),
2212 &(local_args_info.rcut_given), optarg, 0, 0, ARG_DOUBLE,
2213 check_ambiguity, override, 0, 0,
2214 "rcut", 'c',
2215 additional_error))
2216 goto failure;
2217
2218 break;
2219 case 'z': /* Where to set the zero for the slab_density calculation. */
2220
2221
2222 if (update_arg( (void *)&(args_info->zoffset_arg),
2223 &(args_info->zoffset_orig), &(args_info->zoffset_given),
2224 &(local_args_info.zoffset_given), optarg, 0, "0", ARG_DOUBLE,
2225 check_ambiguity, override, 0, 0,
2226 "zoffset", 'z',
2227 additional_error))
2228 goto failure;
2229
2230 break;
2231 case 'v': /* voxel size (angstroms). */
2232
2233
2234 if (update_arg( (void *)&(args_info->voxelSize_arg),
2235 &(args_info->voxelSize_orig), &(args_info->voxelSize_given),
2236 &(local_args_info.voxelSize_given), optarg, 0, 0, ARG_DOUBLE,
2237 check_ambiguity, override, 0, 0,
2238 "voxelSize", 'v',
2239 additional_error))
2240 goto failure;
2241
2242 break;
2243 case 'g': /* g(r). */
2244
2245 if (args_info->staticProps_group_counter && override)
2246 reset_group_staticProps (args_info);
2247 args_info->staticProps_group_counter += 1;
2248
2249 if (update_arg( 0 ,
2250 0 , &(args_info->gofr_given),
2251 &(local_args_info.gofr_given), optarg, 0, 0, ARG_NO,
2252 check_ambiguity, override, 0, 0,
2253 "gofr", 'g',
2254 additional_error))
2255 goto failure;
2256
2257 break;
2258 case 'p': /* p2 order parameter (--sele1 must be specified, --sele2 is optional). */
2259
2260 if (args_info->staticProps_group_counter && override)
2261 reset_group_staticProps (args_info);
2262 args_info->staticProps_group_counter += 1;
2263
2264 if (update_arg( 0 ,
2265 0 , &(args_info->p2_given),
2266 &(local_args_info.p2_given), optarg, 0, 0, ARG_NO,
2267 check_ambiguity, override, 0, 0,
2268 "p2", 'p',
2269 additional_error))
2270 goto failure;
2271
2272 break;
2273 case 's': /* scd order parameter (either --sele1, --sele2, --sele3 are specified or --molname, --begin, --end are specified). */
2274
2275 if (args_info->staticProps_group_counter && override)
2276 reset_group_staticProps (args_info);
2277 args_info->staticProps_group_counter += 1;
2278
2279 if (update_arg( 0 ,
2280 0 , &(args_info->scd_given),
2281 &(local_args_info.scd_given), optarg, 0, 0, ARG_NO,
2282 check_ambiguity, override, 0, 0,
2283 "scd", 's',
2284 additional_error))
2285 goto failure;
2286
2287 break;
2288 case 'd': /* density plot. */
2289
2290 if (args_info->staticProps_group_counter && override)
2291 reset_group_staticProps (args_info);
2292 args_info->staticProps_group_counter += 1;
2293
2294 if (update_arg( 0 ,
2295 0 , &(args_info->density_given),
2296 &(local_args_info.density_given), optarg, 0, 0, ARG_NO,
2297 check_ambiguity, override, 0, 0,
2298 "density", 'd',
2299 additional_error))
2300 goto failure;
2301
2302 break;
2303 case 'Q': /* tetrahedrality order parameter (Qk). */
2304
2305 if (args_info->staticProps_group_counter && override)
2306 reset_group_staticProps (args_info);
2307 args_info->staticProps_group_counter += 1;
2308
2309 if (update_arg( 0 ,
2310 0 , &(args_info->tet_param_given),
2311 &(local_args_info.tet_param_given), optarg, 0, 0, ARG_NO,
2312 check_ambiguity, override, 0, 0,
2313 "tet_param", 'Q',
2314 additional_error))
2315 goto failure;
2316
2317 break;
2318 case 'm': /* average multipole moments contained within cutoff spheres as a function of radius. */
2319
2320 if (args_info->staticProps_group_counter && override)
2321 reset_group_staticProps (args_info);
2322 args_info->staticProps_group_counter += 1;
2323
2324 if (update_arg( 0 ,
2325 0 , &(args_info->multipole_given),
2326 &(local_args_info.multipole_given), optarg, 0, 0, ARG_NO,
2327 check_ambiguity, override, 0, 0,
2328 "multipole", 'm',
2329 additional_error))
2330 goto failure;
2331
2332 break;
2333 case 'k': /* distance-dependent Kirkwood factor. */
2334
2335 if (args_info->staticProps_group_counter && override)
2336 reset_group_staticProps (args_info);
2337 args_info->staticProps_group_counter += 1;
2338
2339 if (update_arg( 0 ,
2340 0 , &(args_info->kirkwood_given),
2341 &(local_args_info.kirkwood_given), optarg, 0, 0, ARG_NO,
2342 check_ambiguity, override, 0, 0,
2343 "kirkwood", 'k',
2344 additional_error))
2345 goto failure;
2346
2347 break;
2348 case 'D': /* computes an average eam density profile of the selected atom. */
2349
2350 if (args_info->staticProps_group_counter && override)
2351 reset_group_staticProps (args_info);
2352 args_info->staticProps_group_counter += 1;
2353
2354 if (update_arg( 0 ,
2355 0 , &(args_info->eam_density_given),
2356 &(local_args_info.eam_density_given), optarg, 0, 0, ARG_NO,
2357 check_ambiguity, override, 0, 0,
2358 "eam_density", 'D',
2359 additional_error))
2360 goto failure;
2361
2362 break;
2363 case 'q': /* computes an average charge profile of the selected atom. */
2364
2365 if (args_info->staticProps_group_counter && override)
2366 reset_group_staticProps (args_info);
2367 args_info->staticProps_group_counter += 1;
2368
2369 if (update_arg( 0 ,
2370 0 , &(args_info->net_charge_given),
2371 &(local_args_info.net_charge_given), optarg, 0, 0, ARG_NO,
2372 check_ambiguity, override, 0, 0,
2373 "net_charge", 'q',
2374 additional_error))
2375 goto failure;
2376
2377 break;
2378 case 'J': /* computes the current density for the selected atom. */
2379
2380 if (args_info->staticProps_group_counter && override)
2381 reset_group_staticProps (args_info);
2382 args_info->staticProps_group_counter += 1;
2383
2384 if (update_arg( 0 ,
2385 0 , &(args_info->current_density_given),
2386 &(local_args_info.current_density_given), optarg, 0, 0, ARG_NO,
2387 check_ambiguity, override, 0, 0,
2388 "current_density", 'J',
2389 additional_error))
2390 goto failure;
2391
2392 break;
2393 case 'M': /* computes the momentum distribution for the selected atom. */
2394
2395 if (args_info->staticProps_group_counter && override)
2396 reset_group_staticProps (args_info);
2397 args_info->staticProps_group_counter += 1;
2398
2399 if (update_arg( 0 ,
2400 0 , &(args_info->momentum_distribution_given),
2401 &(local_args_info.momentum_distribution_given), optarg, 0, 0, ARG_NO,
2402 check_ambiguity, override, 0, 0,
2403 "momentum_distribution", 'M',
2404 additional_error))
2405 goto failure;
2406
2407 break;
2408 case 'S': /* spatially-resolved dipole order parameter S(z), S = (3 Cos^2\\theta - 1)/2. */
2409
2410 if (args_info->staticProps_group_counter && override)
2411 reset_group_staticProps (args_info);
2412 args_info->staticProps_group_counter += 1;
2413
2414 if (update_arg( 0 ,
2415 0 , &(args_info->dipole_orientation_given),
2416 &(local_args_info.dipole_orientation_given), optarg, 0, 0, ARG_NO,
2417 check_ambiguity, override, 0, 0,
2418 "dipole_orientation", 'S',
2419 additional_error))
2420 goto failure;
2421
2422 break;
2423
2424 case 0: /* Long option with no short option */
2425 /* number of bins in z axis. */
2426 if (strcmp (long_options[option_index].name, "nbins_z") == 0)
2427 {
2428
2429
2430 if (update_arg( (void *)&(args_info->nbins_z_arg),
2431 &(args_info->nbins_z_orig), &(args_info->nbins_z_given),
2432 &(local_args_info.nbins_z_given), optarg, 0, "100", ARG_INT,
2433 check_ambiguity, override, 0, 0,
2434 "nbins_z", '-',
2435 additional_error))
2436 goto failure;
2437
2438 }
2439 /* width of radial bins in angstroms. */
2440 else if (strcmp (long_options[option_index].name, "binWidth") == 0)
2441 {
2442
2443
2444 if (update_arg( (void *)&(args_info->binWidth_arg),
2445 &(args_info->binWidth_orig), &(args_info->binWidth_given),
2446 &(local_args_info.binWidth_given), optarg, 0, "1.0", ARG_DOUBLE,
2447 check_ambiguity, override, 0, 0,
2448 "binWidth", '-',
2449 additional_error))
2450 goto failure;
2451
2452 }
2453 /* Oxygen-Oxygen cutoff radius (angstroms). */
2454 else if (strcmp (long_options[option_index].name, "OOcut") == 0)
2455 {
2456
2457
2458 if (update_arg( (void *)&(args_info->OOcut_arg),
2459 &(args_info->OOcut_orig), &(args_info->OOcut_given),
2460 &(local_args_info.OOcut_given), optarg, 0, "3.5", ARG_DOUBLE,
2461 check_ambiguity, override, 0, 0,
2462 "OOcut", '-',
2463 additional_error))
2464 goto failure;
2465
2466 }
2467 /* HOO cutoff angle (degrees). */
2468 else if (strcmp (long_options[option_index].name, "thetacut") == 0)
2469 {
2470
2471
2472 if (update_arg( (void *)&(args_info->thetacut_arg),
2473 &(args_info->thetacut_orig), &(args_info->thetacut_given),
2474 &(local_args_info.thetacut_given), optarg, 0, "30", ARG_DOUBLE,
2475 check_ambiguity, override, 0, 0,
2476 "thetacut", '-',
2477 additional_error))
2478 goto failure;
2479
2480 }
2481 /* Oxygen-Hydrogen cutoff radius (angstroms). */
2482 else if (strcmp (long_options[option_index].name, "OHcut") == 0)
2483 {
2484
2485
2486 if (update_arg( (void *)&(args_info->OHcut_arg),
2487 &(args_info->OHcut_orig), &(args_info->OHcut_given),
2488 &(local_args_info.OHcut_given), optarg, 0, "2.45", ARG_DOUBLE,
2489 check_ambiguity, override, 0, 0,
2490 "OHcut", '-',
2491 additional_error))
2492 goto failure;
2493
2494 }
2495 /* slab width (dz). */
2496 else if (strcmp (long_options[option_index].name, "dz") == 0)
2497 {
2498
2499
2500 if (update_arg( (void *)&(args_info->dz_arg),
2501 &(args_info->dz_orig), &(args_info->dz_given),
2502 &(local_args_info.dz_given), optarg, 0, 0, ARG_DOUBLE,
2503 check_ambiguity, override, 0, 0,
2504 "dz", '-',
2505 additional_error))
2506 goto failure;
2507
2508 }
2509 /* maximum length (Defaults to 1/2 smallest length of first frame). */
2510 else if (strcmp (long_options[option_index].name, "length") == 0)
2511 {
2512
2513
2514 if (update_arg( (void *)&(args_info->length_arg),
2515 &(args_info->length_orig), &(args_info->length_given),
2516 &(local_args_info.length_given), optarg, 0, 0, ARG_DOUBLE,
2517 check_ambiguity, override, 0, 0,
2518 "length", '-',
2519 additional_error))
2520 goto failure;
2521
2522 }
2523 /* maximum length (Defaults to 1/2 smallest length of first frame). */
2524 else if (strcmp (long_options[option_index].name, "zlength") == 0)
2525 {
2526
2527
2528 if (update_arg( (void *)&(args_info->zlength_arg),
2529 &(args_info->zlength_orig), &(args_info->zlength_given),
2530 &(local_args_info.zlength_given), optarg, 0, 0, ARG_DOUBLE,
2531 check_ambiguity, override, 0, 0,
2532 "zlength", '-',
2533 additional_error))
2534 goto failure;
2535
2536 }
2537 /* select the first stuntdouble set. */
2538 else if (strcmp (long_options[option_index].name, "sele1") == 0)
2539 {
2540
2541
2542 if (update_arg( (void *)&(args_info->sele1_arg),
2543 &(args_info->sele1_orig), &(args_info->sele1_given),
2544 &(local_args_info.sele1_given), optarg, 0, 0, ARG_STRING,
2545 check_ambiguity, override, 0, 0,
2546 "sele1", '-',
2547 additional_error))
2548 goto failure;
2549
2550 }
2551 /* select the second stuntdouble set. */
2552 else if (strcmp (long_options[option_index].name, "sele2") == 0)
2553 {
2554
2555
2556 if (update_arg( (void *)&(args_info->sele2_arg),
2557 &(args_info->sele2_orig), &(args_info->sele2_given),
2558 &(local_args_info.sele2_given), optarg, 0, 0, ARG_STRING,
2559 check_ambiguity, override, 0, 0,
2560 "sele2", '-',
2561 additional_error))
2562 goto failure;
2563
2564 }
2565 /* select the third stuntdouble set. */
2566 else if (strcmp (long_options[option_index].name, "sele3") == 0)
2567 {
2568
2569
2570 if (update_arg( (void *)&(args_info->sele3_arg),
2571 &(args_info->sele3_orig), &(args_info->sele3_given),
2572 &(local_args_info.sele3_given), optarg, 0, 0, ARG_STRING,
2573 check_ambiguity, override, 0, 0,
2574 "sele3", '-',
2575 additional_error))
2576 goto failure;
2577
2578 }
2579 /* select reference (use and only use with --gxyz). */
2580 else if (strcmp (long_options[option_index].name, "refsele") == 0)
2581 {
2582
2583
2584 if (update_arg( (void *)&(args_info->refsele_arg),
2585 &(args_info->refsele_orig), &(args_info->refsele_given),
2586 &(local_args_info.refsele_given), optarg, 0, 0, ARG_STRING,
2587 check_ambiguity, override, 0, 0,
2588 "refsele", '-',
2589 additional_error))
2590 goto failure;
2591
2592 }
2593 /* select stunt doubles for center-of-mass reference point. */
2594 else if (strcmp (long_options[option_index].name, "comsele") == 0)
2595 {
2596
2597
2598 if (update_arg( (void *)&(args_info->comsele_arg),
2599 &(args_info->comsele_orig), &(args_info->comsele_given),
2600 &(local_args_info.comsele_given), optarg, 0, 0, ARG_STRING,
2601 check_ambiguity, override, 0, 0,
2602 "comsele", '-',
2603 additional_error))
2604 goto failure;
2605
2606 }
2607 /* global index offset for a second object (used to define a vector between sites in molecule). */
2608 else if (strcmp (long_options[option_index].name, "seleoffset") == 0)
2609 {
2610
2611
2612 if (update_arg( (void *)&(args_info->seleoffset_arg),
2613 &(args_info->seleoffset_orig), &(args_info->seleoffset_given),
2614 &(local_args_info.seleoffset_given), optarg, 0, 0, ARG_INT,
2615 check_ambiguity, override, 0, 0,
2616 "seleoffset", '-',
2617 additional_error))
2618 goto failure;
2619
2620 }
2621 /* global index offset for a third object (used to define a vector between sites in molecule). */
2622 else if (strcmp (long_options[option_index].name, "seleoffset2") == 0)
2623 {
2624
2625
2626 if (update_arg( (void *)&(args_info->seleoffset2_arg),
2627 &(args_info->seleoffset2_orig), &(args_info->seleoffset2_given),
2628 &(local_args_info.seleoffset2_given), optarg, 0, 0, ARG_INT,
2629 check_ambiguity, override, 0, 0,
2630 "seleoffset2", '-',
2631 additional_error))
2632 goto failure;
2633
2634 }
2635 /* global index offset for a fourth object (used to define a vector between sites in molecule). */
2636 else if (strcmp (long_options[option_index].name, "seleoffset3") == 0)
2637 {
2638
2639
2640 if (update_arg( (void *)&(args_info->seleoffset3_arg),
2641 &(args_info->seleoffset3_orig), &(args_info->seleoffset3_given),
2642 &(local_args_info.seleoffset3_given), optarg, 0, 0, ARG_INT,
2643 check_ambiguity, override, 0, 0,
2644 "seleoffset3", '-',
2645 additional_error))
2646 goto failure;
2647
2648 }
2649 /* molecule name. */
2650 else if (strcmp (long_options[option_index].name, "molname") == 0)
2651 {
2652
2653
2654 if (update_arg( (void *)&(args_info->molname_arg),
2655 &(args_info->molname_orig), &(args_info->molname_given),
2656 &(local_args_info.molname_given), optarg, 0, 0, ARG_STRING,
2657 check_ambiguity, override, 0, 0,
2658 "molname", '-',
2659 additional_error))
2660 goto failure;
2661
2662 }
2663 /* begin internal index. */
2664 else if (strcmp (long_options[option_index].name, "begin") == 0)
2665 {
2666
2667
2668 if (update_arg( (void *)&(args_info->begin_arg),
2669 &(args_info->begin_orig), &(args_info->begin_given),
2670 &(local_args_info.begin_given), optarg, 0, 0, ARG_INT,
2671 check_ambiguity, override, 0, 0,
2672 "begin", '-',
2673 additional_error))
2674 goto failure;
2675
2676 }
2677 /* end internal index. */
2678 else if (strcmp (long_options[option_index].name, "end") == 0)
2679 {
2680
2681
2682 if (update_arg( (void *)&(args_info->end_arg),
2683 &(args_info->end_orig), &(args_info->end_given),
2684 &(local_args_info.end_given), optarg, 0, 0, ARG_INT,
2685 check_ambiguity, override, 0, 0,
2686 "end", '-',
2687 additional_error))
2688 goto failure;
2689
2690 }
2691 /* nanoparticle radius. */
2692 else if (strcmp (long_options[option_index].name, "radius") == 0)
2693 {
2694
2695
2696 if (update_arg( (void *)&(args_info->radius_arg),
2697 &(args_info->radius_orig), &(args_info->radius_given),
2698 &(local_args_info.radius_given), optarg, 0, 0, ARG_DOUBLE,
2699 check_ambiguity, override, 0, 0,
2700 "radius", '-',
2701 additional_error))
2702 goto failure;
2703
2704 }
2705 /* Gaussian width (angstroms). */
2706 else if (strcmp (long_options[option_index].name, "gaussWidth") == 0)
2707 {
2708
2709
2710 if (update_arg( (void *)&(args_info->gaussWidth_arg),
2711 &(args_info->gaussWidth_orig), &(args_info->gaussWidth_given),
2712 &(local_args_info.gaussWidth_given), optarg, 0, 0, ARG_DOUBLE,
2713 check_ambiguity, override, 0, 0,
2714 "gaussWidth", '-',
2715 additional_error))
2716 goto failure;
2717
2718 }
2719 /* which axis is special for spatial analysis (default = z axis). */
2720 else if (strcmp (long_options[option_index].name, "privilegedAxis") == 0)
2721 {
2722
2723
2724 if (update_arg( (void *)&(args_info->privilegedAxis_arg),
2725 &(args_info->privilegedAxis_orig), &(args_info->privilegedAxis_given),
2726 &(local_args_info.privilegedAxis_given), optarg, cmdline_parser_privilegedAxis_values, "z", ARG_ENUM,
2727 check_ambiguity, override, 0, 0,
2728 "privilegedAxis", '-',
2729 additional_error))
2730 goto failure;
2731
2732 }
2733 /* which axis is special for spatial analysis (default = x axis). */
2734 else if (strcmp (long_options[option_index].name, "privilegedAxis2") == 0)
2735 {
2736
2737
2738 if (update_arg( (void *)&(args_info->privilegedAxis2_arg),
2739 &(args_info->privilegedAxis2_orig), &(args_info->privilegedAxis2_given),
2740 &(local_args_info.privilegedAxis2_given), optarg, cmdline_parser_privilegedAxis2_values, "x", ARG_ENUM,
2741 check_ambiguity, override, 0, 0,
2742 "privilegedAxis2", '-',
2743 additional_error))
2744 goto failure;
2745
2746 }
2747 /* Type of momentum whose distribtution is required (default = Liner Momentum). */
2748 else if (strcmp (long_options[option_index].name, "momentum") == 0)
2749 {
2750
2751
2752 if (update_arg( (void *)&(args_info->momentum_arg),
2753 &(args_info->momentum_orig), &(args_info->momentum_given),
2754 &(local_args_info.momentum_given), optarg, cmdline_parser_momentum_values, "P", ARG_ENUM,
2755 check_ambiguity, override, 0, 0,
2756 "momentum", '-',
2757 additional_error))
2758 goto failure;
2759
2760 }
2761 /* component of momentum for the momemtum distribution (default = z axis). */
2762 else if (strcmp (long_options[option_index].name, "component") == 0)
2763 {
2764
2765
2766 if (update_arg( (void *)&(args_info->component_arg),
2767 &(args_info->component_orig), &(args_info->component_given),
2768 &(local_args_info.component_given), optarg, cmdline_parser_component_values, "z", ARG_ENUM,
2769 check_ambiguity, override, 0, 0,
2770 "component", '-',
2771 additional_error))
2772 goto failure;
2773
2774 }
2775 /* X-component of the dipole with respect to body frame. */
2776 else if (strcmp (long_options[option_index].name, "dipoleX") == 0)
2777 {
2778
2779
2780 if (update_arg( (void *)&(args_info->dipoleX_arg),
2781 &(args_info->dipoleX_orig), &(args_info->dipoleX_given),
2782 &(local_args_info.dipoleX_given), optarg, 0, 0, ARG_DOUBLE,
2783 check_ambiguity, override, 0, 0,
2784 "dipoleX", '-',
2785 additional_error))
2786 goto failure;
2787
2788 }
2789 /* Y-component of the dipole with respect to body frame. */
2790 else if (strcmp (long_options[option_index].name, "dipoleY") == 0)
2791 {
2792
2793
2794 if (update_arg( (void *)&(args_info->dipoleY_arg),
2795 &(args_info->dipoleY_orig), &(args_info->dipoleY_given),
2796 &(local_args_info.dipoleY_given), optarg, 0, 0, ARG_DOUBLE,
2797 check_ambiguity, override, 0, 0,
2798 "dipoleY", '-',
2799 additional_error))
2800 goto failure;
2801
2802 }
2803 /* Z-component of the dipole with respect to body frame. */
2804 else if (strcmp (long_options[option_index].name, "dipoleZ") == 0)
2805 {
2806
2807
2808 if (update_arg( (void *)&(args_info->dipoleZ_arg),
2809 &(args_info->dipoleZ_orig), &(args_info->dipoleZ_given),
2810 &(local_args_info.dipoleZ_given), optarg, 0, 0, ARG_DOUBLE,
2811 check_ambiguity, override, 0, 0,
2812 "dipoleZ", '-',
2813 additional_error))
2814 goto failure;
2815
2816 }
2817 /* VanderWaals radiius for fictious atoms used in model eg. M site in TIP4P-FQ water model. */
2818 else if (strcmp (long_options[option_index].name, "v_radius") == 0)
2819 {
2820
2821
2822 if (update_arg( (void *)&(args_info->v_radius_arg),
2823 &(args_info->v_radius_orig), &(args_info->v_radius_given),
2824 &(local_args_info.v_radius_given), optarg, 0, 0, ARG_DOUBLE,
2825 check_ambiguity, override, 0, 0,
2826 "v_radius", '-',
2827 additional_error))
2828 goto failure;
2829
2830 }
2831 /* generates xyz file. */
2832 else if (strcmp (long_options[option_index].name, "gen_xyz") == 0)
2833 {
2834
2835
2836 if (update_arg((void *)&(args_info->gen_xyz_flag), 0, &(args_info->gen_xyz_given),
2837 &(local_args_info.gen_xyz_given), optarg, 0, 0, ARG_FLAG,
2838 check_ambiguity, override, 1, 0, "gen_xyz", '-',
2839 additional_error))
2840 goto failure;
2841
2842 }
2843 /* name of atom for with average charge to be generated. */
2844 else if (strcmp (long_options[option_index].name, "atom_name") == 0)
2845 {
2846
2847
2848 if (update_arg( (void *)&(args_info->atom_name_arg),
2849 &(args_info->atom_name_orig), &(args_info->atom_name_given),
2850 &(local_args_info.atom_name_given), optarg, 0, 0, ARG_STRING,
2851 check_ambiguity, override, 0, 0,
2852 "atom_name", '-',
2853 additional_error))
2854 goto failure;
2855
2856 }
2857 /* SFG polarization combination: ssp, ppp, sps. */
2858 else if (strcmp (long_options[option_index].name, "sfgPolarization") == 0)
2859 {
2860
2861
2862 if (update_arg( (void *)&(args_info->sfgPolarization_arg),
2863 &(args_info->sfgPolarization_orig), &(args_info->sfgPolarization_given),
2864 &(local_args_info.sfgPolarization_given), optarg, 0, "ssp", ARG_STRING,
2865 check_ambiguity, override, 0, 0,
2866 "sfgPolarization", '-',
2867 additional_error))
2868 goto failure;
2869
2870 }
2871 /* Lorentzian half-width [cm-1] applied to eigenstates in SFG spectra. */
2872 else if (strcmp (long_options[option_index].name, "lorentzianWidth") == 0)
2873 {
2874
2875
2876 if (update_arg( (void *)&(args_info->lorentzianWidth_arg),
2877 &(args_info->lorentzianWidth_orig), &(args_info->lorentzianWidth_given),
2878 &(local_args_info.lorentzianWidth_given), optarg, 0, "5", ARG_DOUBLE,
2879 check_ambiguity, override, 0, 0,
2880 "lorentzianWidth", '-',
2881 additional_error))
2882 goto failure;
2883
2884 }
2885 /* Fermi coupling [cm-1] for stretch-bend coupling in SFG spectra. */
2886 else if (strcmp (long_options[option_index].name, "fermiCoupling") == 0)
2887 {
2888
2889
2890 if (update_arg( (void *)&(args_info->fermiCoupling_arg),
2891 &(args_info->fermiCoupling_orig), &(args_info->fermiCoupling_given),
2892 &(local_args_info.fermiCoupling_given), optarg, 0, "25", ARG_DOUBLE,
2893 check_ambiguity, override, 0, 0,
2894 "fermiCoupling", '-',
2895 additional_error))
2896 goto failure;
2897
2898 }
2899 /* bond order parameter (--rcut must be specified). */
2900 else if (strcmp (long_options[option_index].name, "bo") == 0)
2901 {
2902
2903 if (args_info->staticProps_group_counter && override)
2904 reset_group_staticProps (args_info);
2905 args_info->staticProps_group_counter += 1;
2906
2907 if (update_arg( 0 ,
2908 0 , &(args_info->bo_given),
2909 &(local_args_info.bo_given), optarg, 0, 0, ARG_NO,
2910 check_ambiguity, override, 0, 0,
2911 "bo", '-',
2912 additional_error))
2913 goto failure;
2914
2915 }
2916 /* icosahedral bond order parameter as a function of radius (--rcut must be specified). */
2917 else if (strcmp (long_options[option_index].name, "ior") == 0)
2918 {
2919
2920 if (args_info->staticProps_group_counter && override)
2921 reset_group_staticProps (args_info);
2922 args_info->staticProps_group_counter += 1;
2923
2924 if (update_arg( 0 ,
2925 0 , &(args_info->ior_given),
2926 &(local_args_info.ior_given), optarg, 0, 0, ARG_NO,
2927 check_ambiguity, override, 0, 0,
2928 "ior", '-',
2929 additional_error))
2930 goto failure;
2931
2932 }
2933 /* FCC bond order parameter as a function of radius (--rcut must be specified). */
2934 else if (strcmp (long_options[option_index].name, "for") == 0)
2935 {
2936
2937 if (args_info->staticProps_group_counter && override)
2938 reset_group_staticProps (args_info);
2939 args_info->staticProps_group_counter += 1;
2940
2941 if (update_arg( 0 ,
2942 0 , &(args_info->for_given),
2943 &(local_args_info.for_given), optarg, 0, 0, ARG_NO,
2944 check_ambiguity, override, 0, 0,
2945 "for", '-',
2946 additional_error))
2947 goto failure;
2948
2949 }
2950 /* N(theta) bond angle density within (--rcut must be specified). */
2951 else if (strcmp (long_options[option_index].name, "bad") == 0)
2952 {
2953
2954 if (args_info->staticProps_group_counter && override)
2955 reset_group_staticProps (args_info);
2956 args_info->staticProps_group_counter += 1;
2957
2958 if (update_arg( 0 ,
2959 0 , &(args_info->bad_given),
2960 &(local_args_info.bad_given), optarg, 0, 0, ARG_NO,
2961 check_ambiguity, override, 0, 0,
2962 "bad", '-',
2963 additional_error))
2964 goto failure;
2965
2966 }
2967 /* count of objects matching selection criteria (and associated statistics). */
2968 else if (strcmp (long_options[option_index].name, "count") == 0)
2969 {
2970
2971 if (args_info->staticProps_group_counter && override)
2972 reset_group_staticProps (args_info);
2973 args_info->staticProps_group_counter += 1;
2974
2975 if (update_arg( 0 ,
2976 0 , &(args_info->count_given),
2977 &(local_args_info.count_given), optarg, 0, 0, ARG_NO,
2978 check_ambiguity, override, 0, 0,
2979 "count", '-',
2980 additional_error))
2981 goto failure;
2982
2983 }
2984 /* count of molecules matching selection criteria (and associated statistics). */
2985 else if (strcmp (long_options[option_index].name, "mcount") == 0)
2986 {
2987
2988 if (args_info->staticProps_group_counter && override)
2989 reset_group_staticProps (args_info);
2990 args_info->staticProps_group_counter += 1;
2991
2992 if (update_arg( 0 ,
2993 0 , &(args_info->mcount_given),
2994 &(local_args_info.mcount_given), optarg, 0, 0, ARG_NO,
2995 check_ambiguity, override, 0, 0,
2996 "mcount", '-',
2997 additional_error))
2998 goto failure;
2999
3000 }
3001 /* g(z). */
3002 else if (strcmp (long_options[option_index].name, "gofz") == 0)
3003 {
3004
3005 if (args_info->staticProps_group_counter && override)
3006 reset_group_staticProps (args_info);
3007 args_info->staticProps_group_counter += 1;
3008
3009 if (update_arg( 0 ,
3010 0 , &(args_info->gofz_given),
3011 &(local_args_info.gofz_given), optarg, 0, 0, ARG_NO,
3012 check_ambiguity, override, 0, 0,
3013 "gofz", '-',
3014 additional_error))
3015 goto failure;
3016
3017 }
3018 /* g(r, cos(theta)). */
3019 else if (strcmp (long_options[option_index].name, "r_theta") == 0)
3020 {
3021
3022 if (args_info->staticProps_group_counter && override)
3023 reset_group_staticProps (args_info);
3024 args_info->staticProps_group_counter += 1;
3025
3026 if (update_arg( 0 ,
3027 0 , &(args_info->r_theta_given),
3028 &(local_args_info.r_theta_given), optarg, 0, 0, ARG_NO,
3029 check_ambiguity, override, 0, 0,
3030 "r_theta", '-',
3031 additional_error))
3032 goto failure;
3033
3034 }
3035 /* g(r, cos(omega)). */
3036 else if (strcmp (long_options[option_index].name, "r_omega") == 0)
3037 {
3038
3039 if (args_info->staticProps_group_counter && override)
3040 reset_group_staticProps (args_info);
3041 args_info->staticProps_group_counter += 1;
3042
3043 if (update_arg( 0 ,
3044 0 , &(args_info->r_omega_given),
3045 &(local_args_info.r_omega_given), optarg, 0, 0, ARG_NO,
3046 check_ambiguity, override, 0, 0,
3047 "r_omega", '-',
3048 additional_error))
3049 goto failure;
3050
3051 }
3052 /* g(r, z). */
3053 else if (strcmp (long_options[option_index].name, "r_z") == 0)
3054 {
3055
3056 if (args_info->staticProps_group_counter && override)
3057 reset_group_staticProps (args_info);
3058 args_info->staticProps_group_counter += 1;
3059
3060 if (update_arg( 0 ,
3061 0 , &(args_info->r_z_given),
3062 &(local_args_info.r_z_given), optarg, 0, 0, ARG_NO,
3063 check_ambiguity, override, 0, 0,
3064 "r_z", '-',
3065 additional_error))
3066 goto failure;
3067
3068 }
3069 /* g(cos(theta), cos(omega)). */
3070 else if (strcmp (long_options[option_index].name, "theta_omega") == 0)
3071 {
3072
3073 if (args_info->staticProps_group_counter && override)
3074 reset_group_staticProps (args_info);
3075 args_info->staticProps_group_counter += 1;
3076
3077 if (update_arg( 0 ,
3078 0 , &(args_info->theta_omega_given),
3079 &(local_args_info.theta_omega_given), optarg, 0, 0, ARG_NO,
3080 check_ambiguity, override, 0, 0,
3081 "theta_omega", '-',
3082 additional_error))
3083 goto failure;
3084
3085 }
3086 /* g(r, cos(theta), cos(omega)). */
3087 else if (strcmp (long_options[option_index].name, "r_theta_omega") == 0)
3088 {
3089
3090 if (args_info->staticProps_group_counter && override)
3091 reset_group_staticProps (args_info);
3092 args_info->staticProps_group_counter += 1;
3093
3094 if (update_arg( 0 ,
3095 0 , &(args_info->r_theta_omega_given),
3096 &(local_args_info.r_theta_omega_given), optarg, 0, 0, ARG_NO,
3097 check_ambiguity, override, 0, 0,
3098 "r_theta_omega", '-',
3099 additional_error))
3100 goto failure;
3101
3102 }
3103 /* g(x, y, z). */
3104 else if (strcmp (long_options[option_index].name, "gxyz") == 0)
3105 {
3106
3107 if (args_info->staticProps_group_counter && override)
3108 reset_group_staticProps (args_info);
3109 args_info->staticProps_group_counter += 1;
3110
3111 if (update_arg( 0 ,
3112 0 , &(args_info->gxyz_given),
3113 &(local_args_info.gxyz_given), optarg, 0, 0, ARG_NO,
3114 check_ambiguity, override, 0, 0,
3115 "gxyz", '-',
3116 additional_error))
3117 goto failure;
3118
3119 }
3120 /* 2D g(r) (Slab width --dz must be specified). */
3121 else if (strcmp (long_options[option_index].name, "twodgofr") == 0)
3122 {
3123
3124 if (args_info->staticProps_group_counter && override)
3125 reset_group_staticProps (args_info);
3126 args_info->staticProps_group_counter += 1;
3127
3128 if (update_arg( 0 ,
3129 0 , &(args_info->twodgofr_given),
3130 &(local_args_info.twodgofr_given), optarg, 0, 0, ARG_NO,
3131 check_ambiguity, override, 0, 0,
3132 "twodgofr", '-',
3133 additional_error))
3134 goto failure;
3135
3136 }
3137 /* Kirkwood-Buff integrals (--sele1 and --sele2 must both be specified). */
3138 else if (strcmp (long_options[option_index].name, "kirkwood_buff") == 0)
3139 {
3140
3141 if (args_info->staticProps_group_counter && override)
3142 reset_group_staticProps (args_info);
3143 args_info->staticProps_group_counter += 1;
3144
3145 if (update_arg( 0 ,
3146 0 , &(args_info->kirkwood_buff_given),
3147 &(local_args_info.kirkwood_buff_given), optarg, 0, 0, ARG_NO,
3148 check_ambiguity, override, 0, 0,
3149 "kirkwood_buff", '-',
3150 additional_error))
3151 goto failure;
3152
3153 }
3154 /* p2 order parameter using r as director axis. */
3155 else if (strcmp (long_options[option_index].name, "p2r") == 0)
3156 {
3157
3158 if (args_info->staticProps_group_counter && override)
3159 reset_group_staticProps (args_info);
3160 args_info->staticProps_group_counter += 1;
3161
3162 if (update_arg( 0 ,
3163 0 , &(args_info->p2r_given),
3164 &(local_args_info.p2r_given), optarg, 0, 0, ARG_NO,
3165 check_ambiguity, override, 0, 0,
3166 "p2r", '-',
3167 additional_error))
3168 goto failure;
3169
3170 }
3171 /* p2 order parameter using z (or privilegedAxis) as director axis. */
3172 else if (strcmp (long_options[option_index].name, "p2z") == 0)
3173 {
3174
3175 if (args_info->staticProps_group_counter && override)
3176 reset_group_staticProps (args_info);
3177 args_info->staticProps_group_counter += 1;
3178
3179 if (update_arg( 0 ,
3180 0 , &(args_info->p2z_given),
3181 &(local_args_info.p2z_given), optarg, 0, 0, ARG_NO,
3182 check_ambiguity, override, 0, 0,
3183 "p2z", '-',
3184 additional_error))
3185 goto failure;
3186
3187 }
3188 /* rp2 order parameter (--sele1 and --sele2 must be specified). */
3189 else if (strcmp (long_options[option_index].name, "rp2") == 0)
3190 {
3191
3192 if (args_info->staticProps_group_counter && override)
3193 reset_group_staticProps (args_info);
3194 args_info->staticProps_group_counter += 1;
3195
3196 if (update_arg( 0 ,
3197 0 , &(args_info->rp2_given),
3198 &(local_args_info.rp2_given), optarg, 0, 0, ARG_NO,
3199 check_ambiguity, override, 0, 0,
3200 "rp2", '-',
3201 additional_error))
3202 goto failure;
3203
3204 }
3205 /* slab density, rho(z). */
3206 else if (strcmp (long_options[option_index].name, "slab_density") == 0)
3207 {
3208
3209 if (args_info->staticProps_group_counter && override)
3210 reset_group_staticProps (args_info);
3211 args_info->staticProps_group_counter += 1;
3212
3213 if (update_arg( 0 ,
3214 0 , &(args_info->slab_density_given),
3215 &(local_args_info.slab_density_given), optarg, 0, 0, ARG_NO,
3216 check_ambiguity, override, 0, 0,
3217 "slab_density", '-',
3218 additional_error))
3219 goto failure;
3220
3221 }
3222 /* pipe density, rho(axis1, axis2). */
3223 else if (strcmp (long_options[option_index].name, "pipe_density") == 0)
3224 {
3225
3226 if (args_info->staticProps_group_counter && override)
3227 reset_group_staticProps (args_info);
3228 args_info->staticProps_group_counter += 1;
3229
3230 if (update_arg( 0 ,
3231 0 , &(args_info->pipe_density_given),
3232 &(local_args_info.pipe_density_given), optarg, 0, 0, ARG_NO,
3233 check_ambiguity, override, 0, 0,
3234 "pipe_density", '-',
3235 additional_error))
3236 goto failure;
3237
3238 }
3239 /* p(cos(theta)) (--sele1 must be specified, --sele2 is optional). */
3240 else if (strcmp (long_options[option_index].name, "p_angle") == 0)
3241 {
3242
3243 if (args_info->staticProps_group_counter && override)
3244 reset_group_staticProps (args_info);
3245 args_info->staticProps_group_counter += 1;
3246
3247 if (update_arg( 0 ,
3248 0 , &(args_info->p_angle_given),
3249 &(local_args_info.p_angle_given), optarg, 0, 0, ARG_NO,
3250 check_ambiguity, override, 0, 0,
3251 "p_angle", '-',
3252 additional_error))
3253 goto failure;
3254
3255 }
3256 /* hxy. */
3257 else if (strcmp (long_options[option_index].name, "hxy") == 0)
3258 {
3259
3260 if (args_info->staticProps_group_counter && override)
3261 reset_group_staticProps (args_info);
3262 args_info->staticProps_group_counter += 1;
3263
3264 if (update_arg( 0 ,
3265 0 , &(args_info->hxy_given),
3266 &(local_args_info.hxy_given), optarg, 0, 0, ARG_NO,
3267 check_ambiguity, override, 0, 0,
3268 "hxy", '-',
3269 additional_error))
3270 goto failure;
3271
3272 }
3273 /* rho(R). */
3274 else if (strcmp (long_options[option_index].name, "rho_r") == 0)
3275 {
3276
3277 if (args_info->staticProps_group_counter && override)
3278 reset_group_staticProps (args_info);
3279 args_info->staticProps_group_counter += 1;
3280
3281 if (update_arg( 0 ,
3282 0 , &(args_info->rho_r_given),
3283 &(local_args_info.rho_r_given), optarg, 0, 0, ARG_NO,
3284 check_ambiguity, override, 0, 0,
3285 "rho_r", '-',
3286 additional_error))
3287 goto failure;
3288
3289 }
3290 /* angle of R. */
3291 else if (strcmp (long_options[option_index].name, "angle_r") == 0)
3292 {
3293
3294 if (args_info->staticProps_group_counter && override)
3295 reset_group_staticProps (args_info);
3296 args_info->staticProps_group_counter += 1;
3297
3298 if (update_arg( 0 ,
3299 0 , &(args_info->angle_r_given),
3300 &(local_args_info.angle_r_given), optarg, 0, 0, ARG_NO,
3301 check_ambiguity, override, 0, 0,
3302 "angle_r", '-',
3303 additional_error))
3304 goto failure;
3305
3306 }
3307 /* hull volume of nanoparticle. */
3308 else if (strcmp (long_options[option_index].name, "hullvol") == 0)
3309 {
3310
3311 if (args_info->staticProps_group_counter && override)
3312 reset_group_staticProps (args_info);
3313 args_info->staticProps_group_counter += 1;
3314
3315 if (update_arg( 0 ,
3316 0 , &(args_info->hullvol_given),
3317 &(local_args_info.hullvol_given), optarg, 0, 0, ARG_NO,
3318 check_ambiguity, override, 0, 0,
3319 "hullvol", '-',
3320 additional_error))
3321 goto failure;
3322
3323 }
3324 /* length of nanorod. */
3325 else if (strcmp (long_options[option_index].name, "rodlength") == 0)
3326 {
3327
3328 if (args_info->staticProps_group_counter && override)
3329 reset_group_staticProps (args_info);
3330 args_info->staticProps_group_counter += 1;
3331
3332 if (update_arg( 0 ,
3333 0 , &(args_info->rodlength_given),
3334 &(local_args_info.rodlength_given), optarg, 0, 0, ARG_NO,
3335 check_ambiguity, override, 0, 0,
3336 "rodlength", '-',
3337 additional_error))
3338 goto failure;
3339
3340 }
3341 /* spatially-resolved tetrahedrality order parameter Qk(z). */
3342 else if (strcmp (long_options[option_index].name, "tet_param_z") == 0)
3343 {
3344
3345 if (args_info->staticProps_group_counter && override)
3346 reset_group_staticProps (args_info);
3347 args_info->staticProps_group_counter += 1;
3348
3349 if (update_arg( 0 ,
3350 0 , &(args_info->tet_param_z_given),
3351 &(local_args_info.tet_param_z_given), optarg, 0, 0, ARG_NO,
3352 check_ambiguity, override, 0, 0,
3353 "tet_param_z", '-',
3354 additional_error))
3355 goto failure;
3356
3357 }
3358 /* spatially-resolved tetrahedrality order parameter Qk(r) around a third selection. */
3359 else if (strcmp (long_options[option_index].name, "tet_param_r") == 0)
3360 {
3361
3362 if (args_info->staticProps_group_counter && override)
3363 reset_group_staticProps (args_info);
3364 args_info->staticProps_group_counter += 1;
3365
3366 if (update_arg( 0 ,
3367 0 , &(args_info->tet_param_r_given),
3368 &(local_args_info.tet_param_r_given), optarg, 0, 0, ARG_NO,
3369 check_ambiguity, override, 0, 0,
3370 "tet_param_r", '-',
3371 additional_error))
3372 goto failure;
3373
3374 }
3375 /* spatially-resolved tetrahedrality order parameter Qk(r,cos(theta)) around a third selection. */
3376 else if (strcmp (long_options[option_index].name, "tet_param_rangle") == 0)
3377 {
3378
3379 if (args_info->staticProps_group_counter && override)
3380 reset_group_staticProps (args_info);
3381 args_info->staticProps_group_counter += 1;
3382
3383 if (update_arg( 0 ,
3384 0 , &(args_info->tet_param_rangle_given),
3385 &(local_args_info.tet_param_rangle_given), optarg, 0, 0, ARG_NO,
3386 check_ambiguity, override, 0, 0,
3387 "tet_param_rangle", '-',
3388 additional_error))
3389 goto failure;
3390
3391 }
3392 /* computes density of the tetrahedrality order parameter Qk. */
3393 else if (strcmp (long_options[option_index].name, "tet_param_dens") == 0)
3394 {
3395
3396 if (args_info->staticProps_group_counter && override)
3397 reset_group_staticProps (args_info);
3398 args_info->staticProps_group_counter += 1;
3399
3400 if (update_arg( 0 ,
3401 0 , &(args_info->tet_param_dens_given),
3402 &(local_args_info.tet_param_dens_given), optarg, 0, 0, ARG_NO,
3403 check_ambiguity, override, 0, 0,
3404 "tet_param_dens", '-',
3405 additional_error))
3406 goto failure;
3407
3408 }
3409 /* volume-resolved tetrahedrality order parameter Qk(x,y,z). (voxelSize, rcut, and gaussWidth must be specified). */
3410 else if (strcmp (long_options[option_index].name, "tet_param_xyz") == 0)
3411 {
3412
3413 if (args_info->staticProps_group_counter && override)
3414 reset_group_staticProps (args_info);
3415 args_info->staticProps_group_counter += 1;
3416
3417 if (update_arg( 0 ,
3418 0 , &(args_info->tet_param_xyz_given),
3419 &(local_args_info.tet_param_xyz_given), optarg, 0, 0, ARG_NO,
3420 check_ambiguity, override, 0, 0,
3421 "tet_param_xyz", '-',
3422 additional_error))
3423 goto failure;
3424
3425 }
3426 /* spatially-resolved translational order parameter t(z). */
3427 else if (strcmp (long_options[option_index].name, "trans_param_z") == 0)
3428 {
3429
3430 if (args_info->staticProps_group_counter && override)
3431 reset_group_staticProps (args_info);
3432 args_info->staticProps_group_counter += 1;
3433
3434 if (update_arg( 0 ,
3435 0 , &(args_info->trans_param_z_given),
3436 &(local_args_info.trans_param_z_given), optarg, 0, 0, ARG_NO,
3437 check_ambiguity, override, 0, 0,
3438 "trans_param_z", '-',
3439 additional_error))
3440 goto failure;
3441
3442 }
3443 /* slab-resolved RNEMD statistics (temperature, density, velocity). */
3444 else if (strcmp (long_options[option_index].name, "rnemdz") == 0)
3445 {
3446
3447 if (args_info->staticProps_group_counter && override)
3448 reset_group_staticProps (args_info);
3449 args_info->staticProps_group_counter += 1;
3450
3451 if (update_arg( 0 ,
3452 0 , &(args_info->rnemdz_given),
3453 &(local_args_info.rnemdz_given), optarg, 0, 0, ARG_NO,
3454 check_ambiguity, override, 0, 0,
3455 "rnemdz", '-',
3456 additional_error))
3457 goto failure;
3458
3459 }
3460 /* shell-resolved RNEMD statistics (temperature, density, angular velocity). */
3461 else if (strcmp (long_options[option_index].name, "rnemdr") == 0)
3462 {
3463
3464 if (args_info->staticProps_group_counter && override)
3465 reset_group_staticProps (args_info);
3466 args_info->staticProps_group_counter += 1;
3467
3468 if (update_arg( 0 ,
3469 0 , &(args_info->rnemdr_given),
3470 &(local_args_info.rnemdr_given), optarg, 0, 0, ARG_NO,
3471 check_ambiguity, override, 0, 0,
3472 "rnemdr", '-',
3473 additional_error))
3474 goto failure;
3475
3476 }
3477 /* shell and angle-resolved RNEMD statistics (temperature, density, angular velocity). */
3478 else if (strcmp (long_options[option_index].name, "rnemdrt") == 0)
3479 {
3480
3481 if (args_info->staticProps_group_counter && override)
3482 reset_group_staticProps (args_info);
3483 args_info->staticProps_group_counter += 1;
3484
3485 if (update_arg( 0 ,
3486 0 , &(args_info->rnemdrt_given),
3487 &(local_args_info.rnemdrt_given), optarg, 0, 0, ARG_NO,
3488 check_ambiguity, override, 0, 0,
3489 "rnemdrt", '-',
3490 additional_error))
3491 goto failure;
3492
3493 }
3494 /* electrostatic potential to frequency map based on the Cho nitrile fits. */
3495 else if (strcmp (long_options[option_index].name, "nitrile") == 0)
3496 {
3497
3498 if (args_info->staticProps_group_counter && override)
3499 reset_group_staticProps (args_info);
3500 args_info->staticProps_group_counter += 1;
3501
3502 if (update_arg( 0 ,
3503 0 , &(args_info->nitrile_given),
3504 &(local_args_info.nitrile_given), optarg, 0, 0, ARG_NO,
3505 check_ambiguity, override, 0, 0,
3506 "nitrile", '-',
3507 additional_error))
3508 goto failure;
3509
3510 }
3511 /* electrostatic field to OH frequency distribution based on the Corcelli frequency map. */
3512 else if (strcmp (long_options[option_index].name, "OHfreqmap") == 0)
3513 {
3514
3515 if (args_info->staticProps_group_counter && override)
3516 reset_group_staticProps (args_info);
3517 args_info->staticProps_group_counter += 1;
3518
3519 if (update_arg( 0 ,
3520 0 , &(args_info->OHfreqmap_given),
3521 &(local_args_info.OHfreqmap_given), optarg, 0, 0, ARG_NO,
3522 check_ambiguity, override, 0, 0,
3523 "OHfreqmap", '-',
3524 additional_error))
3525 goto failure;
3526
3527 }
3528 /* X, Y, and R (surface diffusion if Z exposed and bulk immobile) diffusion. */
3529 else if (strcmp (long_options[option_index].name, "surfDiffusion") == 0)
3530 {
3531
3532 if (args_info->staticProps_group_counter && override)
3533 reset_group_staticProps (args_info);
3534 args_info->staticProps_group_counter += 1;
3535
3536 if (update_arg( 0 ,
3537 0 , &(args_info->surfDiffusion_given),
3538 &(local_args_info.surfDiffusion_given), optarg, 0, 0, ARG_NO,
3539 check_ambiguity, override, 0, 0,
3540 "surfDiffusion", '-',
3541 additional_error))
3542 goto failure;
3543
3544 }
3545 /* Coordination Number Distribution. */
3546 else if (strcmp (long_options[option_index].name, "cn") == 0)
3547 {
3548
3549 if (args_info->staticProps_group_counter && override)
3550 reset_group_staticProps (args_info);
3551 args_info->staticProps_group_counter += 1;
3552
3553 if (update_arg( 0 ,
3554 0 , &(args_info->cn_given),
3555 &(local_args_info.cn_given), optarg, 0, 0, ARG_NO,
3556 check_ambiguity, override, 0, 0,
3557 "cn", '-',
3558 additional_error))
3559 goto failure;
3560
3561 }
3562 /* Secondary Coordination Number Distribution. */
3563 else if (strcmp (long_options[option_index].name, "scn") == 0)
3564 {
3565
3566 if (args_info->staticProps_group_counter && override)
3567 reset_group_staticProps (args_info);
3568 args_info->staticProps_group_counter += 1;
3569
3570 if (update_arg( 0 ,
3571 0 , &(args_info->scn_given),
3572 &(local_args_info.scn_given), optarg, 0, 0, ARG_NO,
3573 check_ambiguity, override, 0, 0,
3574 "scn", '-',
3575 additional_error))
3576 goto failure;
3577
3578 }
3579 /* Generalized Coordination Number Distribution. */
3580 else if (strcmp (long_options[option_index].name, "gcn") == 0)
3581 {
3582
3583 if (args_info->staticProps_group_counter && override)
3584 reset_group_staticProps (args_info);
3585 args_info->staticProps_group_counter += 1;
3586
3587 if (update_arg( 0 ,
3588 0 , &(args_info->gcn_given),
3589 &(local_args_info.gcn_given), optarg, 0, 0, ARG_NO,
3590 check_ambiguity, override, 0, 0,
3591 "gcn", '-',
3592 additional_error))
3593 goto failure;
3594
3595 }
3596 /* Hydrogen Bonding statistics using geometric criteria (rcut and thetacut must be specified). */
3597 else if (strcmp (long_options[option_index].name, "hbond") == 0)
3598 {
3599
3600 if (args_info->staticProps_group_counter && override)
3601 reset_group_staticProps (args_info);
3602 args_info->staticProps_group_counter += 1;
3603
3604 if (update_arg( 0 ,
3605 0 , &(args_info->hbond_given),
3606 &(local_args_info.hbond_given), optarg, 0, 0, ARG_NO,
3607 check_ambiguity, override, 0, 0,
3608 "hbond", '-',
3609 additional_error))
3610 goto failure;
3611
3612 }
3613 /* Hydrogen Bonding density binned by z (rcut and thetacut must be specified). */
3614 else if (strcmp (long_options[option_index].name, "hbondz") == 0)
3615 {
3616
3617 if (args_info->staticProps_group_counter && override)
3618 reset_group_staticProps (args_info);
3619 args_info->staticProps_group_counter += 1;
3620
3621 if (update_arg( 0 ,
3622 0 , &(args_info->hbondz_given),
3623 &(local_args_info.hbondz_given), optarg, 0, 0, ARG_NO,
3624 check_ambiguity, override, 0, 0,
3625 "hbondz", '-',
3626 additional_error))
3627 goto failure;
3628
3629 }
3630 /* Hydrogen Bonding density binned by z and normalized by bin volume (rcut and thetacut must be specified). */
3631 else if (strcmp (long_options[option_index].name, "hbondzvol") == 0)
3632 {
3633
3634 if (args_info->staticProps_group_counter && override)
3635 reset_group_staticProps (args_info);
3636 args_info->staticProps_group_counter += 1;
3637
3638 if (update_arg( 0 ,
3639 0 , &(args_info->hbondzvol_given),
3640 &(local_args_info.hbondzvol_given), optarg, 0, 0, ARG_NO,
3641 check_ambiguity, override, 0, 0,
3642 "hbondzvol", '-',
3643 additional_error))
3644 goto failure;
3645
3646 }
3647 /* Hydrogen Bonding density binned by r (rcut and thetacut must be specified). */
3648 else if (strcmp (long_options[option_index].name, "hbondr") == 0)
3649 {
3650
3651 if (args_info->staticProps_group_counter && override)
3652 reset_group_staticProps (args_info);
3653 args_info->staticProps_group_counter += 1;
3654
3655 if (update_arg( 0 ,
3656 0 , &(args_info->hbondr_given),
3657 &(local_args_info.hbondr_given), optarg, 0, 0, ARG_NO,
3658 check_ambiguity, override, 0, 0,
3659 "hbondr", '-',
3660 additional_error))
3661 goto failure;
3662
3663 }
3664 /* Hydrogen Bonding density binned by r and normalized by bin volume (rcut and thetacut must be specified). */
3665 else if (strcmp (long_options[option_index].name, "hbondrvol") == 0)
3666 {
3667
3668 if (args_info->staticProps_group_counter && override)
3669 reset_group_staticProps (args_info);
3670 args_info->staticProps_group_counter += 1;
3671
3672 if (update_arg( 0 ,
3673 0 , &(args_info->hbondrvol_given),
3674 &(local_args_info.hbondrvol_given), optarg, 0, 0, ARG_NO,
3675 check_ambiguity, override, 0, 0,
3676 "hbondrvol", '-',
3677 additional_error))
3678 goto failure;
3679
3680 }
3681 /* potential energy difference when charge on selection is set to zero. */
3682 else if (strcmp (long_options[option_index].name, "potDiff") == 0)
3683 {
3684
3685 if (args_info->staticProps_group_counter && override)
3686 reset_group_staticProps (args_info);
3687 args_info->staticProps_group_counter += 1;
3688
3689 if (update_arg( 0 ,
3690 0 , &(args_info->potDiff_given),
3691 &(local_args_info.potDiff_given), optarg, 0, 0, ARG_NO,
3692 check_ambiguity, override, 0, 0,
3693 "potDiff", '-',
3694 additional_error))
3695 goto failure;
3696
3697 }
3698 /* hydrogen bond statistics binned by tetrahedrality of donor and acceptor molecules. */
3699 else if (strcmp (long_options[option_index].name, "tet_hb") == 0)
3700 {
3701
3702 if (args_info->staticProps_group_counter && override)
3703 reset_group_staticProps (args_info);
3704 args_info->staticProps_group_counter += 1;
3705
3706 if (update_arg( 0 ,
3707 0 , &(args_info->tet_hb_given),
3708 &(local_args_info.tet_hb_given), optarg, 0, 0, ARG_NO,
3709 check_ambiguity, override, 0, 0,
3710 "tet_hb", '-',
3711 additional_error))
3712 goto failure;
3713
3714 }
3715 /* distance-dependent Kirkwood factor for quadrupoles. */
3716 else if (strcmp (long_options[option_index].name, "kirkwoodQ") == 0)
3717 {
3718
3719 if (args_info->staticProps_group_counter && override)
3720 reset_group_staticProps (args_info);
3721 args_info->staticProps_group_counter += 1;
3722
3723 if (update_arg( 0 ,
3724 0 , &(args_info->kirkwoodQ_given),
3725 &(local_args_info.kirkwoodQ_given), optarg, 0, 0, ARG_NO,
3726 check_ambiguity, override, 0, 0,
3727 "kirkwoodQ", '-',
3728 additional_error))
3729 goto failure;
3730
3731 }
3732 /* computes an average density field. */
3733 else if (strcmp (long_options[option_index].name, "densityfield") == 0)
3734 {
3735
3736 if (args_info->staticProps_group_counter && override)
3737 reset_group_staticProps (args_info);
3738 args_info->staticProps_group_counter += 1;
3739
3740 if (update_arg( 0 ,
3741 0 , &(args_info->densityfield_given),
3742 &(local_args_info.densityfield_given), optarg, 0, 0, ARG_NO,
3743 check_ambiguity, override, 0, 0,
3744 "densityfield", '-',
3745 additional_error))
3746 goto failure;
3747
3748 }
3749 /* computes an average velocity field. */
3750 else if (strcmp (long_options[option_index].name, "velocityfield") == 0)
3751 {
3752
3753 if (args_info->staticProps_group_counter && override)
3754 reset_group_staticProps (args_info);
3755 args_info->staticProps_group_counter += 1;
3756
3757 if (update_arg( 0 ,
3758 0 , &(args_info->velocityfield_given),
3759 &(local_args_info.velocityfield_given), optarg, 0, 0, ARG_NO,
3760 check_ambiguity, override, 0, 0,
3761 "velocityfield", '-',
3762 additional_error))
3763 goto failure;
3764
3765 }
3766 /* computes an average two-dimensional velocity map. */
3767 else if (strcmp (long_options[option_index].name, "velocityZ") == 0)
3768 {
3769
3770 if (args_info->staticProps_group_counter && override)
3771 reset_group_staticProps (args_info);
3772 args_info->staticProps_group_counter += 1;
3773
3774 if (update_arg( 0 ,
3775 0 , &(args_info->velocityZ_given),
3776 &(local_args_info.velocityZ_given), optarg, 0, 0, ARG_NO,
3777 check_ambiguity, override, 0, 0,
3778 "velocityZ", '-',
3779 additional_error))
3780 goto failure;
3781
3782 }
3783 /* computes the charge distribution along selected axis and selected atom. */
3784 else if (strcmp (long_options[option_index].name, "chargez") == 0)
3785 {
3786
3787 if (args_info->staticProps_group_counter && override)
3788 reset_group_staticProps (args_info);
3789 args_info->staticProps_group_counter += 1;
3790
3791 if (update_arg( 0 ,
3792 0 , &(args_info->chargez_given),
3793 &(local_args_info.chargez_given), optarg, 0, 0, ARG_NO,
3794 check_ambiguity, override, 0, 0,
3795 "chargez", '-',
3796 additional_error))
3797 goto failure;
3798
3799 }
3800 /* computes the charge density as a function of the radius and selected atom. */
3801 else if (strcmp (long_options[option_index].name, "charger") == 0)
3802 {
3803
3804 if (args_info->staticProps_group_counter && override)
3805 reset_group_staticProps (args_info);
3806 args_info->staticProps_group_counter += 1;
3807
3808 if (update_arg( 0 ,
3809 0 , &(args_info->charger_given),
3810 &(local_args_info.charger_given), optarg, 0, 0, ARG_NO,
3811 check_ambiguity, override, 0, 0,
3812 "charger", '-',
3813 additional_error))
3814 goto failure;
3815
3816 }
3817 /* computes the mass density of the selection along selected axis. */
3818 else if (strcmp (long_options[option_index].name, "massdensityz") == 0)
3819 {
3820
3821 if (args_info->staticProps_group_counter && override)
3822 reset_group_staticProps (args_info);
3823 args_info->staticProps_group_counter += 1;
3824
3825 if (update_arg( 0 ,
3826 0 , &(args_info->massdensityz_given),
3827 &(local_args_info.massdensityz_given), optarg, 0, 0, ARG_NO,
3828 check_ambiguity, override, 0, 0,
3829 "massdensityz", '-',
3830 additional_error))
3831 goto failure;
3832
3833 }
3834 /* computes the mass density of the selection as a function of the radius from the center of mass. */
3835 else if (strcmp (long_options[option_index].name, "massdensityr") == 0)
3836 {
3837
3838 if (args_info->staticProps_group_counter && override)
3839 reset_group_staticProps (args_info);
3840 args_info->staticProps_group_counter += 1;
3841
3842 if (update_arg( 0 ,
3843 0 , &(args_info->massdensityr_given),
3844 &(local_args_info.massdensityr_given), optarg, 0, 0, ARG_NO,
3845 check_ambiguity, override, 0, 0,
3846 "massdensityr", '-',
3847 additional_error))
3848 goto failure;
3849
3850 }
3851 /* computes the number density along selected axis and selected molcule. */
3852 else if (strcmp (long_options[option_index].name, "numberz") == 0)
3853 {
3854
3855 if (args_info->staticProps_group_counter && override)
3856 reset_group_staticProps (args_info);
3857 args_info->staticProps_group_counter += 1;
3858
3859 if (update_arg( 0 ,
3860 0 , &(args_info->numberz_given),
3861 &(local_args_info.numberz_given), optarg, 0, 0, ARG_NO,
3862 check_ambiguity, override, 0, 0,
3863 "numberz", '-',
3864 additional_error))
3865 goto failure;
3866
3867 }
3868 /* computes the number density as a function of the radius and selected molecule. */
3869 else if (strcmp (long_options[option_index].name, "numberr") == 0)
3870 {
3871
3872 if (args_info->staticProps_group_counter && override)
3873 reset_group_staticProps (args_info);
3874 args_info->staticProps_group_counter += 1;
3875
3876 if (update_arg( 0 ,
3877 0 , &(args_info->numberr_given),
3878 &(local_args_info.numberr_given), optarg, 0, 0, ARG_NO,
3879 check_ambiguity, override, 0, 0,
3880 "numberr", '-',
3881 additional_error))
3882 goto failure;
3883
3884 }
3885 /* computes the continuous charge distribution along selected axis and selected atom. */
3886 else if (strcmp (long_options[option_index].name, "charge_density_z") == 0)
3887 {
3888
3889 if (args_info->staticProps_group_counter && override)
3890 reset_group_staticProps (args_info);
3891 args_info->staticProps_group_counter += 1;
3892
3893 if (update_arg( 0 ,
3894 0 , &(args_info->charge_density_z_given),
3895 &(local_args_info.charge_density_z_given), optarg, 0, 0, ARG_NO,
3896 check_ambiguity, override, 0, 0,
3897 "charge_density_z", '-',
3898 additional_error))
3899 goto failure;
3900
3901 }
3902 /* computes the number of selected atoms along selected axis. */
3903 else if (strcmp (long_options[option_index].name, "countz") == 0)
3904 {
3905
3906 if (args_info->staticProps_group_counter && override)
3907 reset_group_staticProps (args_info);
3908 args_info->staticProps_group_counter += 1;
3909
3910 if (update_arg( 0 ,
3911 0 , &(args_info->countz_given),
3912 &(local_args_info.countz_given), optarg, 0, 0, ARG_NO,
3913 check_ambiguity, override, 0, 0,
3914 "countz", '-',
3915 additional_error))
3916 goto failure;
3917
3918 }
3919 /* probability of order parameter for given selection. */
3920 else if (strcmp (long_options[option_index].name, "order_prob") == 0)
3921 {
3922
3923 if (args_info->staticProps_group_counter && override)
3924 reset_group_staticProps (args_info);
3925 args_info->staticProps_group_counter += 1;
3926
3927 if (update_arg( 0 ,
3928 0 , &(args_info->order_prob_given),
3929 &(local_args_info.order_prob_given), optarg, 0, 0, ARG_NO,
3930 check_ambiguity, override, 0, 0,
3931 "order_prob", '-',
3932 additional_error))
3933 goto failure;
3934
3935 }
3936 /* SFG susceptibility spectrum (time averaging approximation) - uses molecular selections. */
3937 else if (strcmp (long_options[option_index].name, "sfg") == 0)
3938 {
3939
3940 if (args_info->staticProps_group_counter && override)
3941 reset_group_staticProps (args_info);
3942 args_info->staticProps_group_counter += 1;
3943
3944 if (update_arg( 0 ,
3945 0 , &(args_info->sfg_given),
3946 &(local_args_info.sfg_given), optarg, 0, 0, ARG_NO,
3947 check_ambiguity, override, 0, 0,
3948 "sfg", '-',
3949 additional_error))
3950 goto failure;
3951
3952 }
3953
3954 break;
3955 case '?': /* Invalid option. */
3956 /* `getopt_long' already printed an error message. */
3957 goto failure;
3958
3959 default: /* bug: option not considered. */
3960 fprintf (stderr, "%s: option unknown: %c%s\n", CMDLINE_PARSER_PACKAGE, c, (additional_error ? additional_error : ""));
3961 abort ();
3962 } /* switch */
3963 } /* while */
3964
3965 if (args_info->staticProps_group_counter > 1)
3966 {
3967 fprintf (stderr, "%s: %d options of group staticProps were given. One is required%s.\n", argv[0], args_info->staticProps_group_counter, (additional_error ? additional_error : ""));
3968 error_occurred = 1;
3969 }
3970
3971
3972
3973 if (check_required)
3974 {
3975 error_occurred += cmdline_parser_required2 (args_info, argv[0], additional_error);
3976 }
3977
3978 cmdline_parser_release (&local_args_info);
3979
3980 if ( error_occurred )
3981 return (EXIT_FAILURE);
3982
3983 if (optind < argc)
3984 {
3985 int i = 0 ;
3986 int found_prog_name = 0;
3987 /* whether program name, i.e., argv[0], is in the remaining args
3988 (this may happen with some implementations of getopt,
3989 but surely not with the one included by gengetopt) */
3990
3991
3992 args_info->inputs_num = argc - optind - found_prog_name;
3993 args_info->inputs =
3994 (char **)(malloc ((args_info->inputs_num)*sizeof(char *))) ;
3995 while (optind < argc)
3996 args_info->inputs[ i++ ] = gengetopt_strdup (argv[optind++]) ;
3997 }
3998
3999 return 0;
4000
4001failure:
4002
4003 cmdline_parser_release (&local_args_info);
4004 return (EXIT_FAILURE);
4005}
4006/* 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 zoffset_given
Whether zoffset was given.
unsigned int nanglebins_given
Whether nanglebins was given.
unsigned int momentum_given
Whether momentum was given.
const char * tet_param_z_help
spatially-resolved tetrahedrality order parameter Qk(z) help description.
unsigned int seleoffset2_given
Whether seleoffset2 was given.
char * sele2_arg
select second stuntdouble set (if sele2 is not set, use script from sele1).
const char * r_omega_help
g(r, cos(omega)) help description.
char * nbins_orig
Number of bins original value given at command line.
unsigned int pipe_density_given
Whether pipe_density was given.
const char * p2z_help
p2 order parameter using z (or privilegedAxis) as director axis help description.
unsigned int surfDiffusion_given
Whether surfDiffusion was given.
const char * gxyz_help
g(x, y, z) help description.
const char * nbins_x_help
number of bins in x axis help description.
unsigned int tet_param_r_given
Whether tet_param_r was given.
char * dipoleX_orig
X-component of the dipole with respect to body frame original value given at command line.
unsigned int output_given
Whether output was given.
const char * OHfreqmap_help
electrostatic field to OH frequency distribution based on the Corcelli frequency map help description...
double gaussWidth_arg
Gaussian width for coarse graining (Angstroms) (default='3.0').
unsigned int multipole_given
Whether multipole was given.
int nanglebins_arg
number of bins for cos(angle) (default='50').
const char * tet_param_dens_help
computes density of the tetrahedrality order parameter Qk help description.
const char * scd_help
scd order parameter (either –sele1, –sele2, –sele3 are specified or –molname, –begin,...
unsigned int privilegedAxis_given
Whether privilegedAxis was given.
unsigned int OHcut_given
Whether OHcut was given.
char * molname_orig
molecule name original value given at command line.
unsigned int density_given
Whether density was given.
const char * velocityZ_help
computes an average two-dimensional velocity map help description.
const char * theta_omega_help
g(cos(theta), cos(omega)) help description.
const char * rcut_help
cutoff radius (angstroms) help description.
unsigned int comsele_given
Whether comsele was given.
unsigned int for_given
Whether for was given.
unsigned int thetacut_given
Whether thetacut was given.
const char * radius_help
Nanoparticle radius in Angstroms help description.
const char * hullvol_help
hull volume of nanoparticle help description.
const char * rnemdr_help
shell-resolved RNEMD statistics (temperature, density, angular velocity) help description.
char * atom_name_arg
name of atom for with average charge to be generated.
unsigned int scd_given
Whether scd was given.
char * output_orig
output file name original value given at command line.
const char * p2r_help
p2 order parameter using r as director axis help description.
const char * output_help
output file name help description.
const char * nbins_help
Number of bins help description.
const char * massdensityz_help
computes the mass density of the selection along selected axis help description.
unsigned int step_given
Whether step was given.
unsigned int rho_r_given
Whether rho_r was given.
unsigned int hullvol_given
Whether hullvol was given.
unsigned int net_charge_given
Whether net_charge was given.
const char * slab_density_help
slab density, rho(z) help description.
const char * dipoleZ_help
Z-component of the dipole with respect to body frame help description.
const char * numberr_help
computes the number density as a function of the radius and selected molecule help description.
const char * twodgofr_help
2D g(r) (Slab width –dz must be specified) help description.
unsigned int end_given
Whether end was given.
char * binWidth_orig
width of radial bins in angstroms original value given at command line.
unsigned int ior_given
Whether ior 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').
const char * p_angle_help
p(cos(theta)) (–sele1 must be specified, –sele2 is optional) help description.
double binWidth_arg
width of radial bins in angstroms (default='1.0').
unsigned int tet_hb_given
Whether tet_hb was given.
unsigned int chargez_given
Whether chargez was given.
const char * kirkwood_buff_help
Kirkwood-Buff integrals (–sele1 and –sele2 must both be specified) help description.
unsigned int velocityZ_given
Whether velocityZ was given.
const char * sele1_help
select first stuntdouble set help description.
char * molname_arg
molecule name.
char * comsele_arg
select stunt doubles for center-of-mass reference point.
unsigned int voxelSize_given
Whether voxelSize was given.
unsigned int kirkwood_given
Whether kirkwood was given.
unsigned int gofr_given
Whether gofr was given.
unsigned int r_theta_omega_given
Whether r_theta_omega was given.
unsigned int potDiff_given
Whether potDiff was given.
const char * rho_r_help
rho(R) help description.
const char * charger_help
computes the charge density as a function of the radius and selected atom help description.
const char * seleoffset_help
global index offset for a second object (used to define a vector between sites in molecule) help desc...
const char * seleoffset3_help
global index offset for a fourth object (used to define a vector between sites in molecule) help desc...
unsigned int massdensityz_given
Whether massdensityz was given.
unsigned int binWidth_given
Whether binWidth was given.
unsigned int molname_given
Whether molname was given.
int nbins_x_arg
number of bins in x axis (default='100').
char * dipoleY_orig
Y-component of the dipole with respect to body frame original value given at command line.
char * sele3_orig
select third stuntdouble set original value given at command line.
const char * OHcut_help
Oxygen-Hydrogen cutoff radius (angstroms) help description.
const char * sele2_help
select second stuntdouble set (if sele2 is not set, use script from sele1) help description.
unsigned int tet_param_z_given
Whether tet_param_z was given.
const char * current_density_help
computes the current density for the selected atom help description.
char * zlength_orig
maximum length (Defaults to 1/2 smallest length of first frame) original value given at command line.
unsigned int gxyz_given
Whether gxyz was given.
unsigned inputs_num
unamed options number
unsigned int bo_given
Whether bo was given.
unsigned int kirkwoodQ_given
Whether kirkwoodQ was given.
unsigned int begin_given
Whether begin was given.
const char * bo_help
bond order parameter (–rcut must be specified) help description.
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.
unsigned int p2z_given
Whether p2z was given.
const char * gcn_help
Generalized Coordinate Number help description.
unsigned int gen_xyz_given
Whether gen_xyz was given.
unsigned int nbins_y_given
Whether nbins_y was given.
double dipoleY_arg
Y-component of the dipole with respect to body frame (default='0.0').
const char * rp2_help
rp2 order parameter (–sele1 and –sele2 must be specified) help description.
const char * mcount_help
count of molecules matching selection criteria (and associated statistics) help description.
const char * comsele_help
select stunt doubles for center-of-mass reference point help description.
int begin_arg
begin internal index.
unsigned int charge_density_z_given
Whether charge_density_z was given.
unsigned int cn_given
Whether cn was given.
const char * zoffset_help
Where to set the zero for the slab_density calculation help description.
unsigned int tet_param_rangle_given
Whether tet_param_rangle was given.
unsigned int tet_param_given
Whether tet_param was given.
unsigned int component_given
Whether component was given.
const char * hbondz_help
Hydrogen Bonding density binned by z (rcut and thetacut must be specified) help description.
const char * ior_help
icosahedral bond order parameter as a function of radius (–rcut must be specified) help description.
unsigned int dipole_orientation_given
Whether dipole_orientation was given.
unsigned int hbond_given
Whether hbond was given.
const char * rnemdz_help
slab-resolved RNEMD statistics (temperature, density, velocity) help description.
const char * privilegedAxis2_help
which axis is special for spatial analysis (default = x axis) help description.
int nbins_y_arg
number of bins in y axis (default='100').
const char * gofz_help
g(z) help description.
unsigned int hbondr_given
Whether hbondr was given.
const char * thetacut_help
HOO cutoff angle (degrees) help description.
unsigned int refsele_given
Whether refsele was given.
unsigned int fermiCoupling_given
Whether fermiCoupling was given.
char * fermiCoupling_orig
Fermi coupling [cm-1] for stretch-bend coupling in SFG spectra original value given at command line.
const char * seleoffset2_help
global index offset for a third object (used to define a vector between sites in molecule) help descr...
unsigned int bad_given
Whether bad was given.
const char * hbondr_help
Hydrogen Bonding density binned by r (rcut and thetacut must be specified) help description.
double fermiCoupling_arg
Fermi coupling [cm-1] for stretch-bend coupling in SFG spectra (default='25').
unsigned int hbondrvol_given
Whether hbondrvol was given.
char * sfgPolarization_orig
SFG polarization combination: ssp, ppp, sps original value given at command line.
unsigned int charger_given
Whether charger was given.
unsigned int p2_given
Whether p2 was given.
char * OOcut_orig
Oxygen-Oxygen cutoff radius (angstroms) original value given at command line.
unsigned int gaussWidth_given
Whether gaussWidth was given.
double length_arg
maximum length (default='100').
const char * begin_help
begin internal index help description.
const char * help_help
Print help and exit help description.
unsigned int rnemdr_given
Whether rnemdr was given.
char * sele3_arg
select third stuntdouble set.
char * seleoffset_orig
global index offset for a second object (used to define a vector between sites in molecule) original ...
const char * rnemdrt_help
shell and angle-resolved RNEMD statistics (temperature, density, angular velocity) help description.
unsigned int dipoleX_given
Whether dipoleX was given.
char * output_arg
output file name.
unsigned int eam_density_given
Whether eam_density was given.
unsigned int velocityfield_given
Whether velocityfield was given.
double zoffset_arg
Where to set the zero for the slab_density calculation (default='0').
unsigned int tet_param_dens_given
Whether tet_param_dens was given.
char ** inputs
unamed options (options without names)
double lorentzianWidth_arg
Lorentzian half-width [cm-1] applied to eigenstates in SFG spectra (default='5').
const char * v_radius_help
VanderWaals radiius for fictious atoms used in model eg.
unsigned int seleoffset3_given
Whether seleoffset3 was given.
int staticProps_group_counter
Counter for group staticProps.
const char * atom_name_help
name of atom for with average charge to be generated help description.
unsigned int r_z_given
Whether r_z was given.
unsigned int v_radius_given
Whether v_radius was given.
char * nanglebins_orig
number of bins for cos(angle) original value given at command line.
const char * trans_param_z_help
spatially-resolved translational order parameter t(z) help description.
char * input_arg
input dump file.
char * nbins_z_orig
number of bins in z axis original value given at command line.
unsigned int hbondz_given
Whether hbondz was given.
int nbins_z_arg
number of bins in z axis (default='100').
int seleoffset3_arg
global index offset for a fourth object (used to define a vector between sites in molecule).
char * nbins_x_orig
number of bins in x axis original value given at command line.
double thetacut_arg
HOO cutoff angle (degrees) (default='30').
unsigned int dipoleZ_given
Whether dipoleZ was given.
char * thetacut_orig
HOO cutoff angle (degrees) original value given at command line.
const char * dipole_orientation_help
spatially-resolved dipole order parameter S(z), S = (3 Cos^2\theta - 1)/2 help description.
const char * for_help
FCC bond order parameter as a function of radius (–rcut must be specified) help description.
const char * nanglebins_help
number of bins for cos(angle) help description.
unsigned int sele1_given
Whether sele1 was given.
unsigned int sfg_given
Whether sfg was given.
const char * chargez_help
computes the charge distribution along selected axis and selected atom help description.
unsigned int gcn_given
Whether gcn was given.
unsigned int lorentzianWidth_given
Whether lorentzianWidth was given.
unsigned int length_given
Whether length was given.
const char * momentum_help
Type of momentum whose distribtution is required (default = Liner Momentum) help description.
int seleoffset_arg
global index offset for a second object (used to define a vector between sites in molecule).
const char * hbondzvol_help
Hydrogen Bonding density binned by z and normalized by bin volume (rcut and thetacut must be specifie...
unsigned int countz_given
Whether countz was given.
unsigned int rnemdrt_given
Whether rnemdrt was given.
char * momentum_orig
Type of momentum whose distribtution is required (default = Liner Momentum) original value given at c...
unsigned int current_density_given
Whether current_density was given.
double rcut_arg
cutoff radius (angstroms).
const char * voxelSize_help
voxel size for coarse graining (Angstroms) help description.
unsigned int slab_density_given
Whether slab_density was given.
const char * densityfield_help
computes an average density field help description.
const char * sfg_help
SFG susceptibility spectrum (exciton model) - use molecular selections help description.
int gen_xyz_flag
generates xyz file (default=off).
unsigned int kirkwood_buff_given
Whether kirkwood_buff was given.
unsigned int p_angle_given
Whether p_angle was given.
unsigned int trans_param_z_given
Whether trans_param_z was given.
unsigned int densityfield_given
Whether densityfield was given.
const char * privilegedAxis_help
which axis is special for spatial analysis (default = z axis) help description.
char * sele2_orig
select second stuntdouble set (if sele2 is not set, use script from sele1) original value given at co...
const char * scn_help
Secondary Coordination Number Distribution help description.
const char * tet_hb_help
hydrogen bond statistics binned by tetrahedrality of donor and acceptor molecules help description.
enum enum_momentum momentum_arg
Type of momentum whose distribtution is required (default = Liner Momentum) (default='P').
const char * momentum_distribution_help
computes the momentum distribution for the selected atom help description.
const char * dz_help
slab width (dz) help description.
char * refsele_arg
select reference.
const char * count_help
count of objects matching selection criteria (and associated statistics) help description.
const char * nrbins_help
number of radial bins (usually duplicates functionality of nbins) help description.
const char * bad_help
N(theta) bond angle density within (–rcut must be specified) help description.
const char * net_charge_help
computes an average charge profile of the selected atom help description.
char * sele1_orig
select first stuntdouble set original value given at command line.
double dz_arg
slab width (dz).
unsigned int twodgofr_given
Whether twodgofr was given.
enum enum_component component_arg
component of momentum for the momemtum distribution (default = z axis) (default='z').
char * step_orig
process every n frame original value given at command line.
double OHcut_arg
Oxygen-Hydrogen cutoff radius (angstroms) (default='2.45').
char * begin_orig
begin internal index original value given at command line.
const char * end_help
ending affine scale help description.
double voxelSize_arg
voxel size for coarse graining (Angstroms) (default='2.0').
const char * angle_r_help
angle of R help description.
unsigned int OHfreqmap_given
Whether OHfreqmap was given.
const char * lorentzianWidth_help
Lorentzian half-width [cm-1] applied to eigenstates in SFG spectra help description.
char * length_orig
maximum length original value given at command line.
const char * countz_help
computes the number of selected atoms along selected axis help description.
const char * hxy_help
hxy help description.
const char * hbond_help
Hydrogen Bonding statistics using geometric criteria (rcut and thetacut must be specified) help descr...
const char * charge_density_z_help
computes the continuous charge distribution along selected axis and selected atom help description.
char * end_orig
ending affine scale original value given at command line.
char * sele1_arg
select first stuntdouble set.
const char * cn_help
Coordination Number Distribution help description.
double radius_arg
Nanoparticle radius in Angstroms.
const char * nitrile_help
electrostatic potential to frequency map based on the Cho nitrile fits help description.
const char * tet_param_r_help
spatially-resolved tetrahedrality order parameter Qk(r) around a third selection 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 * r_theta_help
g(r, cos(theta)) help description.
const char * rodlength_help
length of nanorod help description.
unsigned int order_prob_given
Whether order_prob was given.
const char * eam_density_help
computes an average eam density profile of the selected atom help description.
char * atom_name_orig
name of atom for with average charge to be generated original value given at command line.
char * refsele_orig
select reference original value given at command line.
double dipoleX_arg
X-component of the dipole with respect to body frame (default='0.0').
unsigned int rcut_given
Whether rcut was given.
char * nbins_y_orig
number of bins in y axis original value given at command line.
const char * kirkwood_help
distance-dependent Kirkwood factor help description.
char * OHcut_orig
Oxygen-Hydrogen cutoff radius (angstroms) original value given at command line.
unsigned int r_theta_given
Whether r_theta was given.
unsigned int help_given
Whether help was given.
const char * gofr_help
g(r) help description.
const char * zlength_help
maximum length (Defaults to 1/2 smallest length of first frame) help description.
const char * sele3_help
select third stuntdouble set help description.
const char * surfDiffusion_help
X, Y, and R (surface diffusion if Z exposed and bulk immobile) diffusion help description.
const char * component_help
component of momentum for the momemtum distribution (default = z axis) help description.
unsigned int nitrile_given
Whether nitrile was given.
const char * hbondrvol_help
Hydrogen Bonding density binned by r and normalized by bin volume (rcut and thetacut must be specifie...
unsigned int gofz_given
Whether gofz was given.
char * v_radius_orig
VanderWaals radiius for fictious atoms used in model eg.
const char * refsele_help
select reference help description.
unsigned int input_given
Whether input was given.
const char * tet_param_rangle_help
spatially-resolved tetrahedrality order parameter Qk(r,cos(theta)) around a third selection help desc...
unsigned int rodlength_given
Whether rodlength was given.
char * nrbins_orig
number of radial bins (usually duplicates functionality of nbins) original value given at command lin...
char * comsele_orig
select stunt doubles for center-of-mass reference point original value given at command line.
char * voxelSize_orig
voxel size for coarse graining (Angstroms) original value given at command line.
unsigned int numberz_given
Whether numberz was given.
unsigned int radius_given
Whether radius was given.
const char * step_help
process every n frame help description.
unsigned int scn_given
Whether scn was given.
int nbins_arg
Number of bins (default='100').
unsigned int rp2_given
Whether rp2 was given.
char * radius_orig
Nanoparticle radius in Angstroms original value given at command line.
unsigned int nrbins_given
Whether nrbins was given.
const char * p2_help
p2 order parameter (–sele1 must be specified, –sele2 is optional) help description.
const char * multipole_help
average multipole moments contained within cutoff spheres as a function of radius help description.
unsigned int p2r_given
Whether p2r was given.
const char * tet_param_xyz_help
volume-resolved tetrahedrality order parameter Qk(x,y,z).
enum enum_privilegedAxis privilegedAxis_arg
which axis is special for spatial analysis (default = z axis) (default='z').
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 numberr_given
Whether numberr was given.
const char * sfgPolarization_help
SFG polarization combination: ssp, ppp, sps help description.
const char * length_help
maximum length help description.
unsigned int hbondzvol_given
Whether hbondzvol was given.
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 * pipe_density_help
pipe density, rho(axis1, axis2) help description.
double end_arg
ending affine scale (default='1.2').
char * dz_orig
slab width (dz) original value given at command line.
char * seleoffset2_orig
global index offset for a third object (used to define a vector between sites in molecule) original v...
char * seleoffset3_orig
global index offset for a fourth object (used to define a vector between sites in molecule) original ...
unsigned int hxy_given
Whether hxy was given.
const char * tet_param_help
tetrahedrality order parameter (Qk) help description.
const char * version_help
Print version and exit help description.
const char * nbins_y_help
number of bins in y axis help description.
const char * binWidth_help
width of radial bins in angstroms help description.
const char * velocityfield_help
computes an average velocity field help description.
enum enum_privilegedAxis2 privilegedAxis2_arg
which axis is special for spatial analysis (default = x axis) (default='x').
char * input_orig
input dump file original value given at command line.
const char * potDiff_help
potential energy difference when charge on selection is set to zero help description.
const char * r_theta_omega_help
g(r, cos(theta), cos(omega)) help description.
unsigned int privilegedAxis2_given
Whether privilegedAxis2 was given.
unsigned int nbins_given
Whether nbins was given.
unsigned int nbins_x_given
Whether nbins_x was given.
unsigned int atom_name_given
Whether atom_name was given.
const char * nbins_z_help
number of bins in z axis help description.
unsigned int zlength_given
Whether zlength was given.
int seleoffset2_arg
global index offset for a third object (used to define a vector between sites in molecule).
const char * massdensityr_help
computes the mass density of the selection as a function of the radius from the center of mass help d...
double zlength_arg
maximum length (Defaults to 1/2 smallest length of first frame).
unsigned int r_omega_given
Whether r_omega was given.
unsigned int count_given
Whether count was given.
unsigned int momentum_distribution_given
Whether momentum_distribution was given.
unsigned int sfgPolarization_given
Whether sfgPolarization was given.
const char * gaussWidth_help
Gaussian width for coarse graining (Angstroms) help description.
const char * r_z_help
g(r, z) help description.
const char * OOcut_help
Oxygen-Oxygen cutoff radius (angstroms) help description.
unsigned int angle_r_given
Whether angle_r was given.
const char * density_help
density (g/cm^3) help description.
const char * gen_xyz_help
generates xyz file help description.
const char * order_prob_help
probability of order parameter for given selection help description.
unsigned int tet_param_xyz_given
Whether tet_param_xyz was given.
double OOcut_arg
Oxygen-Oxygen cutoff radius (angstroms) (default='3.5').
int nrbins_arg
number of radial bins (usually duplicates functionality of nbins) (default='100').
const char * molname_help
molecule name help description.
unsigned int nbins_z_given
Whether nbins_z was given.
char * rcut_orig
cutoff radius (angstroms) original value given at command line.
unsigned int theta_omega_given
Whether theta_omega was given.
char * component_orig
component of momentum for the momemtum distribution (default = z axis) original value given at comman...
unsigned int seleoffset_given
Whether seleoffset was given.
const char * input_help
input dump file help description.
unsigned int rnemdz_given
Whether rnemdz was given.
const char * kirkwoodQ_help
distance-dependent Kirkwood factor for quadrupoles help description.
unsigned int massdensityr_given
Whether massdensityr was given.
char * lorentzianWidth_orig
Lorentzian half-width [cm-1] applied to eigenstates in SFG spectra original value given at command li...
double v_radius_arg
VanderWaals radiius for fictious atoms used in model eg.
unsigned int dz_given
Whether dz was given.
char * gaussWidth_orig
Gaussian width for coarse graining (Angstroms) original value given at command line.
char * zoffset_orig
Where to set the zero for the slab_density calculation original value given at command line.
char * privilegedAxis2_orig
which axis is special for spatial analysis (default = x axis) original value given at command line.
const char * dipoleY_help
Y-component of the dipole with respect to body frame help description.
unsigned int mcount_given
Whether mcount was given.
const char * numberz_help
computes the number density along selected axis and selected molcule help description.
int step_arg
process every n frame (default='1').
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.