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