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