1 |
|
/* |
2 |
< |
File autogenerated by gengetopt version 2.19.1 |
2 |
> |
File autogenerated by gengetopt version 2.22.4 |
3 |
|
generated with the following command: |
4 |
< |
gengetopt --file-name=StaticPropsCmd -u |
4 |
> |
gengetopt --file-name=StaticPropsCmd --unamed-opts |
5 |
|
|
6 |
|
The developers of gengetopt consider the fixed text that goes in all |
7 |
|
gengetopt output files to be in the public domain: |
17 |
|
#include <stdlib.h> |
18 |
|
#include <string.h> |
19 |
|
|
20 |
< |
#include "getopt.h" |
20 |
> |
#ifndef FIX_UNUSED |
21 |
> |
#define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */ |
22 |
> |
#endif |
23 |
|
|
24 |
+ |
#ifdef WIN32 |
25 |
+ |
#include "utils/wingetopt.h" |
26 |
+ |
#else |
27 |
+ |
#include <getopt.h> |
28 |
+ |
#endif |
29 |
+ |
|
30 |
|
#include "StaticPropsCmd.h" |
31 |
|
|
32 |
|
const char *gengetopt_args_info_purpose = ""; |
44 |
|
" -b, --nbins=INT number of bins (general purpose) \n (default=`100')", |
45 |
|
" -x, --nbins_x=INT number of bins in x axis (default=`100')", |
46 |
|
" -y, --nbins_y=INT number of bins in y axis (default=`100')", |
47 |
+ |
" --nbins_z=INT number of bins in z axis (default=`100')", |
48 |
|
" -a, --nanglebins=INT number of bins for cos(angle) (default=`50')", |
40 |
– |
" --length=DOUBLE maximum length (Defaults to 1/2 smallest length \n of first frame)", |
49 |
|
" -c, --rcut=DOUBLE cutoff radius (rcut)", |
50 |
+ |
" --dz=DOUBLE slab width (dz)", |
51 |
+ |
" --length=DOUBLE maximum length (Defaults to 1/2 smallest length \n of first frame)", |
52 |
+ |
" --zlength=DOUBLE maximum length (Defaults to 1/2 smallest length \n of first frame)", |
53 |
|
" -z, --zoffset=DOUBLE Where to set the zero for the slab_density \n calculation (default=`0')", |
54 |
|
" --sele1=selection script select the first stuntdouble set", |
55 |
|
" --sele2=selection script select the second stuntdouble set", |
56 |
|
" --sele3=selection script select the third stuntdouble set", |
57 |
|
" --refsele=selection script\n select reference (use and only use with --gxyz)", |
58 |
+ |
" --comsele=selection script\n select stunt doubles for center-of-mass \n reference point", |
59 |
+ |
" --seleoffset=INT global index offset for a second object (used \n to define a vector between sites in molecule)", |
60 |
+ |
" --seleoffset2=INT global index offset for a third object (used to \n define a vector between sites in molecule)", |
61 |
|
" --molname=STRING molecule name", |
62 |
|
" --begin=INT begin internal index", |
63 |
|
" --end=INT end internal index", |
64 |
|
" --radius=DOUBLE nanoparticle radius", |
65 |
+ |
" -v, --voxelSize=DOUBLE voxel size (angstroms)", |
66 |
+ |
" --gaussWidth=DOUBLE Gaussian width (angstroms)", |
67 |
|
"\n Group: staticProps\n an option of this group is required", |
68 |
|
" --bo bond order parameter (--rcut must be specified)", |
69 |
< |
" --bor bond order parameter as a function of radius \n (--rcut must be specified)", |
69 |
> |
" --ior icosahedral bond order parameter as a function \n of radius (--rcut must be specified)", |
70 |
> |
" --for FCC bond order parameter as a function of \n radius (--rcut must be specified)", |
71 |
|
" --bad N(theta) bond angle density within (--rcut must \n be specified)", |
72 |
+ |
" --count count of molecules matching selection criteria \n (and associated statistics)", |
73 |
|
" -g, --gofr g(r)", |
74 |
|
" --gofz g(z)", |
75 |
|
" --r_theta g(r, cos(theta))", |
76 |
|
" --r_omega g(r, cos(omega))", |
77 |
+ |
" --r_z g(r, z)", |
78 |
|
" --theta_omega g(cos(theta), cos(omega))", |
79 |
|
" --gxyz g(x, y, z)", |
80 |
< |
" -p, --p2 p2 order parameter (--sele1 and --sele2 must be \n specified)", |
80 |
> |
" --twodgofr 2D g(r) (Slab width --dz must be specified)", |
81 |
> |
" -p, --p2 p2 order parameter (--sele1 must be specified, \n --sele2 is optional)", |
82 |
|
" --rp2 rp2 order parameter (--sele1 and --sele2 must \n be specified)", |
83 |
|
" -s, --scd scd order parameter (either --sele1, --sele2, \n --sele3 are specified or --molname, --begin, \n --end are specified)", |
84 |
|
" -d, --density density plot", |
85 |
|
" --slab_density slab density", |
86 |
+ |
" --p_angle p(cos(theta)) (--sele1 must be specified, \n --sele2 is optional)", |
87 |
|
" --hxy hxy", |
88 |
|
" --rho_r rho of R", |
89 |
+ |
" --angle_r angle of R", |
90 |
|
" --hullvol hull volume of nanoparticle", |
91 |
+ |
" --rodlength length of nanorod", |
92 |
+ |
" -Q, --tet_param tetrahedrality order parameter (Qk)", |
93 |
+ |
" --tet_param_z spatially-resolved tetrahedrality order \n parameter Qk(z)", |
94 |
+ |
" --tet_param_xyz volume-resolved tetrahedrality order parameter \n Qk(x,y,z). (voxelSize, rcut, and gaussWidth \n must be specified)", |
95 |
+ |
" --rnemdz slab-resolved RNEMD statistics (temperature, \n density, velocity)", |
96 |
+ |
" --rnemdr shell-resolved RNEMD statistics (temperature, \n density, angular velocity)", |
97 |
+ |
" --rnemdrt shell and angle-resolved RNEMD statistics \n (temperature, density, angular velocity)", |
98 |
+ |
" --nitrile electrostatic potential to frequency map based \n on the Cho nitrile fits", |
99 |
+ |
" -m, --multipole average multipole moments contained within \n cutoff spheres as a function of radius", |
100 |
|
0 |
101 |
|
}; |
102 |
|
|
103 |
+ |
typedef enum {ARG_NO |
104 |
+ |
, ARG_STRING |
105 |
+ |
, ARG_INT |
106 |
+ |
, ARG_DOUBLE |
107 |
+ |
} cmdline_parser_arg_type; |
108 |
+ |
|
109 |
|
static |
110 |
|
void clear_given (struct gengetopt_args_info *args_info); |
111 |
|
static |
112 |
|
void clear_args (struct gengetopt_args_info *args_info); |
113 |
|
|
114 |
|
static int |
115 |
< |
cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required, const char *additional_error); |
115 |
> |
cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info, |
116 |
> |
struct cmdline_parser_params *params, const char *additional_error); |
117 |
|
|
118 |
|
static int |
119 |
|
cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error); |
132 |
|
args_info->nbins_given = 0 ; |
133 |
|
args_info->nbins_x_given = 0 ; |
134 |
|
args_info->nbins_y_given = 0 ; |
135 |
+ |
args_info->nbins_z_given = 0 ; |
136 |
|
args_info->nanglebins_given = 0 ; |
98 |
– |
args_info->length_given = 0 ; |
137 |
|
args_info->rcut_given = 0 ; |
138 |
+ |
args_info->dz_given = 0 ; |
139 |
+ |
args_info->length_given = 0 ; |
140 |
+ |
args_info->zlength_given = 0 ; |
141 |
|
args_info->zoffset_given = 0 ; |
142 |
|
args_info->sele1_given = 0 ; |
143 |
|
args_info->sele2_given = 0 ; |
144 |
|
args_info->sele3_given = 0 ; |
145 |
|
args_info->refsele_given = 0 ; |
146 |
+ |
args_info->comsele_given = 0 ; |
147 |
+ |
args_info->seleoffset_given = 0 ; |
148 |
+ |
args_info->seleoffset2_given = 0 ; |
149 |
|
args_info->molname_given = 0 ; |
150 |
|
args_info->begin_given = 0 ; |
151 |
|
args_info->end_given = 0 ; |
152 |
|
args_info->radius_given = 0 ; |
153 |
+ |
args_info->voxelSize_given = 0 ; |
154 |
+ |
args_info->gaussWidth_given = 0 ; |
155 |
|
args_info->bo_given = 0 ; |
156 |
< |
args_info->bor_given = 0 ; |
156 |
> |
args_info->ior_given = 0 ; |
157 |
> |
args_info->for_given = 0 ; |
158 |
|
args_info->bad_given = 0 ; |
159 |
+ |
args_info->count_given = 0 ; |
160 |
|
args_info->gofr_given = 0 ; |
161 |
|
args_info->gofz_given = 0 ; |
162 |
|
args_info->r_theta_given = 0 ; |
163 |
|
args_info->r_omega_given = 0 ; |
164 |
+ |
args_info->r_z_given = 0 ; |
165 |
|
args_info->theta_omega_given = 0 ; |
166 |
|
args_info->gxyz_given = 0 ; |
167 |
+ |
args_info->twodgofr_given = 0 ; |
168 |
|
args_info->p2_given = 0 ; |
169 |
|
args_info->rp2_given = 0 ; |
170 |
|
args_info->scd_given = 0 ; |
171 |
|
args_info->density_given = 0 ; |
172 |
|
args_info->slab_density_given = 0 ; |
173 |
+ |
args_info->p_angle_given = 0 ; |
174 |
|
args_info->hxy_given = 0 ; |
175 |
|
args_info->rho_r_given = 0 ; |
176 |
+ |
args_info->angle_r_given = 0 ; |
177 |
|
args_info->hullvol_given = 0 ; |
178 |
+ |
args_info->rodlength_given = 0 ; |
179 |
+ |
args_info->tet_param_given = 0 ; |
180 |
+ |
args_info->tet_param_z_given = 0 ; |
181 |
+ |
args_info->tet_param_xyz_given = 0 ; |
182 |
+ |
args_info->rnemdz_given = 0 ; |
183 |
+ |
args_info->rnemdr_given = 0 ; |
184 |
+ |
args_info->rnemdrt_given = 0 ; |
185 |
+ |
args_info->nitrile_given = 0 ; |
186 |
+ |
args_info->multipole_given = 0 ; |
187 |
|
args_info->staticProps_group_counter = 0 ; |
188 |
|
} |
189 |
|
|
190 |
|
static |
191 |
|
void clear_args (struct gengetopt_args_info *args_info) |
192 |
|
{ |
193 |
+ |
FIX_UNUSED (args_info); |
194 |
|
args_info->input_arg = NULL; |
195 |
|
args_info->input_orig = NULL; |
196 |
|
args_info->output_arg = NULL; |
203 |
|
args_info->nbins_x_orig = NULL; |
204 |
|
args_info->nbins_y_arg = 100; |
205 |
|
args_info->nbins_y_orig = NULL; |
206 |
+ |
args_info->nbins_z_arg = 100; |
207 |
+ |
args_info->nbins_z_orig = NULL; |
208 |
|
args_info->nanglebins_arg = 50; |
209 |
|
args_info->nanglebins_orig = NULL; |
146 |
– |
args_info->length_orig = NULL; |
210 |
|
args_info->rcut_orig = NULL; |
211 |
+ |
args_info->dz_orig = NULL; |
212 |
+ |
args_info->length_orig = NULL; |
213 |
+ |
args_info->zlength_orig = NULL; |
214 |
|
args_info->zoffset_arg = 0; |
215 |
|
args_info->zoffset_orig = NULL; |
216 |
|
args_info->sele1_arg = NULL; |
221 |
|
args_info->sele3_orig = NULL; |
222 |
|
args_info->refsele_arg = NULL; |
223 |
|
args_info->refsele_orig = NULL; |
224 |
+ |
args_info->comsele_arg = NULL; |
225 |
+ |
args_info->comsele_orig = NULL; |
226 |
+ |
args_info->seleoffset_orig = NULL; |
227 |
+ |
args_info->seleoffset2_orig = NULL; |
228 |
|
args_info->molname_arg = NULL; |
229 |
|
args_info->molname_orig = NULL; |
230 |
|
args_info->begin_orig = NULL; |
231 |
|
args_info->end_orig = NULL; |
232 |
|
args_info->radius_orig = NULL; |
233 |
+ |
args_info->voxelSize_orig = NULL; |
234 |
+ |
args_info->gaussWidth_orig = NULL; |
235 |
|
|
236 |
|
} |
237 |
|
|
238 |
|
static |
239 |
|
void init_args_info(struct gengetopt_args_info *args_info) |
240 |
|
{ |
241 |
+ |
|
242 |
+ |
|
243 |
|
args_info->help_help = gengetopt_args_info_help[0] ; |
244 |
|
args_info->version_help = gengetopt_args_info_help[1] ; |
245 |
|
args_info->input_help = gengetopt_args_info_help[2] ; |
248 |
|
args_info->nbins_help = gengetopt_args_info_help[5] ; |
249 |
|
args_info->nbins_x_help = gengetopt_args_info_help[6] ; |
250 |
|
args_info->nbins_y_help = gengetopt_args_info_help[7] ; |
251 |
< |
args_info->nanglebins_help = gengetopt_args_info_help[8] ; |
252 |
< |
args_info->length_help = gengetopt_args_info_help[9] ; |
251 |
> |
args_info->nbins_z_help = gengetopt_args_info_help[8] ; |
252 |
> |
args_info->nanglebins_help = gengetopt_args_info_help[9] ; |
253 |
|
args_info->rcut_help = gengetopt_args_info_help[10] ; |
254 |
< |
args_info->zoffset_help = gengetopt_args_info_help[11] ; |
255 |
< |
args_info->sele1_help = gengetopt_args_info_help[12] ; |
256 |
< |
args_info->sele2_help = gengetopt_args_info_help[13] ; |
257 |
< |
args_info->sele3_help = gengetopt_args_info_help[14] ; |
258 |
< |
args_info->refsele_help = gengetopt_args_info_help[15] ; |
259 |
< |
args_info->molname_help = gengetopt_args_info_help[16] ; |
260 |
< |
args_info->begin_help = gengetopt_args_info_help[17] ; |
261 |
< |
args_info->end_help = gengetopt_args_info_help[18] ; |
262 |
< |
args_info->radius_help = gengetopt_args_info_help[19] ; |
263 |
< |
args_info->bo_help = gengetopt_args_info_help[20] ; |
264 |
< |
args_info->bor_help = gengetopt_args_info_help[21] ; |
265 |
< |
args_info->bad_help = gengetopt_args_info_help[22] ; |
266 |
< |
args_info->gofr_help = gengetopt_args_info_help[23] ; |
267 |
< |
args_info->gofz_help = gengetopt_args_info_help[24] ; |
268 |
< |
args_info->r_theta_help = gengetopt_args_info_help[25] ; |
269 |
< |
args_info->r_omega_help = gengetopt_args_info_help[26] ; |
270 |
< |
args_info->theta_omega_help = gengetopt_args_info_help[27] ; |
271 |
< |
args_info->gxyz_help = gengetopt_args_info_help[28] ; |
272 |
< |
args_info->p2_help = gengetopt_args_info_help[29] ; |
273 |
< |
args_info->rp2_help = gengetopt_args_info_help[30] ; |
274 |
< |
args_info->scd_help = gengetopt_args_info_help[31] ; |
275 |
< |
args_info->density_help = gengetopt_args_info_help[32] ; |
276 |
< |
args_info->slab_density_help = gengetopt_args_info_help[33] ; |
277 |
< |
args_info->hxy_help = gengetopt_args_info_help[34] ; |
278 |
< |
args_info->rho_r_help = gengetopt_args_info_help[35] ; |
279 |
< |
args_info->hullvol_help = gengetopt_args_info_help[36] ; |
254 |
> |
args_info->dz_help = gengetopt_args_info_help[11] ; |
255 |
> |
args_info->length_help = gengetopt_args_info_help[12] ; |
256 |
> |
args_info->zlength_help = gengetopt_args_info_help[13] ; |
257 |
> |
args_info->zoffset_help = gengetopt_args_info_help[14] ; |
258 |
> |
args_info->sele1_help = gengetopt_args_info_help[15] ; |
259 |
> |
args_info->sele2_help = gengetopt_args_info_help[16] ; |
260 |
> |
args_info->sele3_help = gengetopt_args_info_help[17] ; |
261 |
> |
args_info->refsele_help = gengetopt_args_info_help[18] ; |
262 |
> |
args_info->comsele_help = gengetopt_args_info_help[19] ; |
263 |
> |
args_info->seleoffset_help = gengetopt_args_info_help[20] ; |
264 |
> |
args_info->seleoffset2_help = gengetopt_args_info_help[21] ; |
265 |
> |
args_info->molname_help = gengetopt_args_info_help[22] ; |
266 |
> |
args_info->begin_help = gengetopt_args_info_help[23] ; |
267 |
> |
args_info->end_help = gengetopt_args_info_help[24] ; |
268 |
> |
args_info->radius_help = gengetopt_args_info_help[25] ; |
269 |
> |
args_info->voxelSize_help = gengetopt_args_info_help[26] ; |
270 |
> |
args_info->gaussWidth_help = gengetopt_args_info_help[27] ; |
271 |
> |
args_info->bo_help = gengetopt_args_info_help[29] ; |
272 |
> |
args_info->ior_help = gengetopt_args_info_help[30] ; |
273 |
> |
args_info->for_help = gengetopt_args_info_help[31] ; |
274 |
> |
args_info->bad_help = gengetopt_args_info_help[32] ; |
275 |
> |
args_info->count_help = gengetopt_args_info_help[33] ; |
276 |
> |
args_info->gofr_help = gengetopt_args_info_help[34] ; |
277 |
> |
args_info->gofz_help = gengetopt_args_info_help[35] ; |
278 |
> |
args_info->r_theta_help = gengetopt_args_info_help[36] ; |
279 |
> |
args_info->r_omega_help = gengetopt_args_info_help[37] ; |
280 |
> |
args_info->r_z_help = gengetopt_args_info_help[38] ; |
281 |
> |
args_info->theta_omega_help = gengetopt_args_info_help[39] ; |
282 |
> |
args_info->gxyz_help = gengetopt_args_info_help[40] ; |
283 |
> |
args_info->twodgofr_help = gengetopt_args_info_help[41] ; |
284 |
> |
args_info->p2_help = gengetopt_args_info_help[42] ; |
285 |
> |
args_info->rp2_help = gengetopt_args_info_help[43] ; |
286 |
> |
args_info->scd_help = gengetopt_args_info_help[44] ; |
287 |
> |
args_info->density_help = gengetopt_args_info_help[45] ; |
288 |
> |
args_info->slab_density_help = gengetopt_args_info_help[46] ; |
289 |
> |
args_info->p_angle_help = gengetopt_args_info_help[47] ; |
290 |
> |
args_info->hxy_help = gengetopt_args_info_help[48] ; |
291 |
> |
args_info->rho_r_help = gengetopt_args_info_help[49] ; |
292 |
> |
args_info->angle_r_help = gengetopt_args_info_help[50] ; |
293 |
> |
args_info->hullvol_help = gengetopt_args_info_help[51] ; |
294 |
> |
args_info->rodlength_help = gengetopt_args_info_help[52] ; |
295 |
> |
args_info->tet_param_help = gengetopt_args_info_help[53] ; |
296 |
> |
args_info->tet_param_z_help = gengetopt_args_info_help[54] ; |
297 |
> |
args_info->tet_param_xyz_help = gengetopt_args_info_help[55] ; |
298 |
> |
args_info->rnemdz_help = gengetopt_args_info_help[56] ; |
299 |
> |
args_info->rnemdr_help = gengetopt_args_info_help[57] ; |
300 |
> |
args_info->rnemdrt_help = gengetopt_args_info_help[58] ; |
301 |
> |
args_info->nitrile_help = gengetopt_args_info_help[59] ; |
302 |
> |
args_info->multipole_help = gengetopt_args_info_help[60] ; |
303 |
|
|
304 |
|
} |
305 |
|
|
306 |
|
void |
307 |
|
cmdline_parser_print_version (void) |
308 |
|
{ |
309 |
< |
printf ("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION); |
309 |
> |
printf ("%s %s\n", |
310 |
> |
(strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE), |
311 |
> |
CMDLINE_PARSER_VERSION); |
312 |
|
} |
313 |
|
|
314 |
< |
void |
216 |
< |
cmdline_parser_print_help (void) |
217 |
< |
{ |
218 |
< |
int i = 0; |
314 |
> |
static void print_help_common(void) { |
315 |
|
cmdline_parser_print_version (); |
316 |
|
|
317 |
|
if (strlen(gengetopt_args_info_purpose) > 0) |
318 |
|
printf("\n%s\n", gengetopt_args_info_purpose); |
319 |
|
|
320 |
< |
printf("\n%s\n\n", gengetopt_args_info_usage); |
320 |
> |
if (strlen(gengetopt_args_info_usage) > 0) |
321 |
> |
printf("\n%s\n", gengetopt_args_info_usage); |
322 |
|
|
323 |
+ |
printf("\n"); |
324 |
+ |
|
325 |
|
if (strlen(gengetopt_args_info_description) > 0) |
326 |
< |
printf("%s\n", gengetopt_args_info_description); |
326 |
> |
printf("%s\n\n", gengetopt_args_info_description); |
327 |
> |
} |
328 |
|
|
329 |
+ |
void |
330 |
+ |
cmdline_parser_print_help (void) |
331 |
+ |
{ |
332 |
+ |
int i = 0; |
333 |
+ |
print_help_common(); |
334 |
|
while (gengetopt_args_info_help[i]) |
335 |
|
printf("%s\n", gengetopt_args_info_help[i++]); |
336 |
|
} |
342 |
|
clear_args (args_info); |
343 |
|
init_args_info (args_info); |
344 |
|
|
345 |
< |
args_info->inputs = NULL; |
345 |
> |
args_info->inputs = 0; |
346 |
|
args_info->inputs_num = 0; |
347 |
|
} |
348 |
|
|
349 |
+ |
void |
350 |
+ |
cmdline_parser_params_init(struct cmdline_parser_params *params) |
351 |
+ |
{ |
352 |
+ |
if (params) |
353 |
+ |
{ |
354 |
+ |
params->override = 0; |
355 |
+ |
params->initialize = 1; |
356 |
+ |
params->check_required = 1; |
357 |
+ |
params->check_ambiguity = 0; |
358 |
+ |
params->print_errors = 1; |
359 |
+ |
} |
360 |
+ |
} |
361 |
+ |
|
362 |
+ |
struct cmdline_parser_params * |
363 |
+ |
cmdline_parser_params_create(void) |
364 |
+ |
{ |
365 |
+ |
struct cmdline_parser_params *params = |
366 |
+ |
(struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params)); |
367 |
+ |
cmdline_parser_params_init(params); |
368 |
+ |
return params; |
369 |
+ |
} |
370 |
+ |
|
371 |
|
static void |
372 |
< |
cmdline_parser_release (struct gengetopt_args_info *args_info) |
372 |
> |
free_string_field (char **s) |
373 |
|
{ |
374 |
< |
|
248 |
< |
unsigned int i; |
249 |
< |
if (args_info->input_arg) |
374 |
> |
if (*s) |
375 |
|
{ |
376 |
< |
free (args_info->input_arg); /* free previous argument */ |
377 |
< |
args_info->input_arg = 0; |
376 |
> |
free (*s); |
377 |
> |
*s = 0; |
378 |
|
} |
379 |
< |
if (args_info->input_orig) |
380 |
< |
{ |
381 |
< |
free (args_info->input_orig); /* free previous argument */ |
382 |
< |
args_info->input_orig = 0; |
383 |
< |
} |
384 |
< |
if (args_info->output_arg) |
385 |
< |
{ |
386 |
< |
free (args_info->output_arg); /* free previous argument */ |
387 |
< |
args_info->output_arg = 0; |
388 |
< |
} |
389 |
< |
if (args_info->output_orig) |
390 |
< |
{ |
391 |
< |
free (args_info->output_orig); /* free previous argument */ |
392 |
< |
args_info->output_orig = 0; |
393 |
< |
} |
394 |
< |
if (args_info->step_orig) |
395 |
< |
{ |
396 |
< |
free (args_info->step_orig); /* free previous argument */ |
397 |
< |
args_info->step_orig = 0; |
398 |
< |
} |
399 |
< |
if (args_info->nbins_orig) |
400 |
< |
{ |
401 |
< |
free (args_info->nbins_orig); /* free previous argument */ |
402 |
< |
args_info->nbins_orig = 0; |
403 |
< |
} |
404 |
< |
if (args_info->nbins_x_orig) |
405 |
< |
{ |
406 |
< |
free (args_info->nbins_x_orig); /* free previous argument */ |
407 |
< |
args_info->nbins_x_orig = 0; |
408 |
< |
} |
409 |
< |
if (args_info->nbins_y_orig) |
410 |
< |
{ |
411 |
< |
free (args_info->nbins_y_orig); /* free previous argument */ |
412 |
< |
args_info->nbins_y_orig = 0; |
413 |
< |
} |
414 |
< |
if (args_info->nanglebins_orig) |
415 |
< |
{ |
416 |
< |
free (args_info->nanglebins_orig); /* free previous argument */ |
417 |
< |
args_info->nanglebins_orig = 0; |
418 |
< |
} |
419 |
< |
if (args_info->length_orig) |
295 |
< |
{ |
296 |
< |
free (args_info->length_orig); /* free previous argument */ |
297 |
< |
args_info->length_orig = 0; |
298 |
< |
} |
299 |
< |
if (args_info->rcut_orig) |
300 |
< |
{ |
301 |
< |
free (args_info->rcut_orig); /* free previous argument */ |
302 |
< |
args_info->rcut_orig = 0; |
303 |
< |
} |
304 |
< |
if (args_info->zoffset_orig) |
305 |
< |
{ |
306 |
< |
free (args_info->zoffset_orig); /* free previous argument */ |
307 |
< |
args_info->zoffset_orig = 0; |
308 |
< |
} |
309 |
< |
if (args_info->sele1_arg) |
310 |
< |
{ |
311 |
< |
free (args_info->sele1_arg); /* free previous argument */ |
312 |
< |
args_info->sele1_arg = 0; |
313 |
< |
} |
314 |
< |
if (args_info->sele1_orig) |
315 |
< |
{ |
316 |
< |
free (args_info->sele1_orig); /* free previous argument */ |
317 |
< |
args_info->sele1_orig = 0; |
318 |
< |
} |
319 |
< |
if (args_info->sele2_arg) |
320 |
< |
{ |
321 |
< |
free (args_info->sele2_arg); /* free previous argument */ |
322 |
< |
args_info->sele2_arg = 0; |
323 |
< |
} |
324 |
< |
if (args_info->sele2_orig) |
325 |
< |
{ |
326 |
< |
free (args_info->sele2_orig); /* free previous argument */ |
327 |
< |
args_info->sele2_orig = 0; |
328 |
< |
} |
329 |
< |
if (args_info->sele3_arg) |
330 |
< |
{ |
331 |
< |
free (args_info->sele3_arg); /* free previous argument */ |
332 |
< |
args_info->sele3_arg = 0; |
333 |
< |
} |
334 |
< |
if (args_info->sele3_orig) |
335 |
< |
{ |
336 |
< |
free (args_info->sele3_orig); /* free previous argument */ |
337 |
< |
args_info->sele3_orig = 0; |
338 |
< |
} |
339 |
< |
if (args_info->refsele_arg) |
340 |
< |
{ |
341 |
< |
free (args_info->refsele_arg); /* free previous argument */ |
342 |
< |
args_info->refsele_arg = 0; |
343 |
< |
} |
344 |
< |
if (args_info->refsele_orig) |
345 |
< |
{ |
346 |
< |
free (args_info->refsele_orig); /* free previous argument */ |
347 |
< |
args_info->refsele_orig = 0; |
348 |
< |
} |
349 |
< |
if (args_info->molname_arg) |
350 |
< |
{ |
351 |
< |
free (args_info->molname_arg); /* free previous argument */ |
352 |
< |
args_info->molname_arg = 0; |
353 |
< |
} |
354 |
< |
if (args_info->molname_orig) |
355 |
< |
{ |
356 |
< |
free (args_info->molname_orig); /* free previous argument */ |
357 |
< |
args_info->molname_orig = 0; |
358 |
< |
} |
359 |
< |
if (args_info->begin_orig) |
360 |
< |
{ |
361 |
< |
free (args_info->begin_orig); /* free previous argument */ |
362 |
< |
args_info->begin_orig = 0; |
363 |
< |
} |
364 |
< |
if (args_info->end_orig) |
365 |
< |
{ |
366 |
< |
free (args_info->end_orig); /* free previous argument */ |
367 |
< |
args_info->end_orig = 0; |
368 |
< |
} |
369 |
< |
if (args_info->radius_orig) |
370 |
< |
{ |
371 |
< |
free (args_info->radius_orig); /* free previous argument */ |
372 |
< |
args_info->radius_orig = 0; |
373 |
< |
} |
379 |
> |
} |
380 |
> |
|
381 |
> |
|
382 |
> |
static void |
383 |
> |
cmdline_parser_release (struct gengetopt_args_info *args_info) |
384 |
> |
{ |
385 |
> |
unsigned int i; |
386 |
> |
free_string_field (&(args_info->input_arg)); |
387 |
> |
free_string_field (&(args_info->input_orig)); |
388 |
> |
free_string_field (&(args_info->output_arg)); |
389 |
> |
free_string_field (&(args_info->output_orig)); |
390 |
> |
free_string_field (&(args_info->step_orig)); |
391 |
> |
free_string_field (&(args_info->nbins_orig)); |
392 |
> |
free_string_field (&(args_info->nbins_x_orig)); |
393 |
> |
free_string_field (&(args_info->nbins_y_orig)); |
394 |
> |
free_string_field (&(args_info->nbins_z_orig)); |
395 |
> |
free_string_field (&(args_info->nanglebins_orig)); |
396 |
> |
free_string_field (&(args_info->rcut_orig)); |
397 |
> |
free_string_field (&(args_info->dz_orig)); |
398 |
> |
free_string_field (&(args_info->length_orig)); |
399 |
> |
free_string_field (&(args_info->zlength_orig)); |
400 |
> |
free_string_field (&(args_info->zoffset_orig)); |
401 |
> |
free_string_field (&(args_info->sele1_arg)); |
402 |
> |
free_string_field (&(args_info->sele1_orig)); |
403 |
> |
free_string_field (&(args_info->sele2_arg)); |
404 |
> |
free_string_field (&(args_info->sele2_orig)); |
405 |
> |
free_string_field (&(args_info->sele3_arg)); |
406 |
> |
free_string_field (&(args_info->sele3_orig)); |
407 |
> |
free_string_field (&(args_info->refsele_arg)); |
408 |
> |
free_string_field (&(args_info->refsele_orig)); |
409 |
> |
free_string_field (&(args_info->comsele_arg)); |
410 |
> |
free_string_field (&(args_info->comsele_orig)); |
411 |
> |
free_string_field (&(args_info->seleoffset_orig)); |
412 |
> |
free_string_field (&(args_info->seleoffset2_orig)); |
413 |
> |
free_string_field (&(args_info->molname_arg)); |
414 |
> |
free_string_field (&(args_info->molname_orig)); |
415 |
> |
free_string_field (&(args_info->begin_orig)); |
416 |
> |
free_string_field (&(args_info->end_orig)); |
417 |
> |
free_string_field (&(args_info->radius_orig)); |
418 |
> |
free_string_field (&(args_info->voxelSize_orig)); |
419 |
> |
free_string_field (&(args_info->gaussWidth_orig)); |
420 |
|
|
421 |
+ |
|
422 |
|
for (i = 0; i < args_info->inputs_num; ++i) |
423 |
|
free (args_info->inputs [i]); |
424 |
< |
|
424 |
> |
|
425 |
|
if (args_info->inputs_num) |
426 |
|
free (args_info->inputs); |
427 |
< |
|
427 |
> |
|
428 |
|
clear_given (args_info); |
429 |
|
} |
430 |
|
|
431 |
+ |
|
432 |
+ |
static void |
433 |
+ |
write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[]) |
434 |
+ |
{ |
435 |
+ |
FIX_UNUSED (values); |
436 |
+ |
if (arg) { |
437 |
+ |
fprintf(outfile, "%s=\"%s\"\n", opt, arg); |
438 |
+ |
} else { |
439 |
+ |
fprintf(outfile, "%s\n", opt); |
440 |
+ |
} |
441 |
+ |
} |
442 |
+ |
|
443 |
+ |
|
444 |
|
int |
445 |
+ |
cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info) |
446 |
+ |
{ |
447 |
+ |
int i = 0; |
448 |
+ |
|
449 |
+ |
if (!outfile) |
450 |
+ |
{ |
451 |
+ |
fprintf (stderr, "%s: cannot dump options to stream\n", CMDLINE_PARSER_PACKAGE); |
452 |
+ |
return EXIT_FAILURE; |
453 |
+ |
} |
454 |
+ |
|
455 |
+ |
if (args_info->help_given) |
456 |
+ |
write_into_file(outfile, "help", 0, 0 ); |
457 |
+ |
if (args_info->version_given) |
458 |
+ |
write_into_file(outfile, "version", 0, 0 ); |
459 |
+ |
if (args_info->input_given) |
460 |
+ |
write_into_file(outfile, "input", args_info->input_orig, 0); |
461 |
+ |
if (args_info->output_given) |
462 |
+ |
write_into_file(outfile, "output", args_info->output_orig, 0); |
463 |
+ |
if (args_info->step_given) |
464 |
+ |
write_into_file(outfile, "step", args_info->step_orig, 0); |
465 |
+ |
if (args_info->nbins_given) |
466 |
+ |
write_into_file(outfile, "nbins", args_info->nbins_orig, 0); |
467 |
+ |
if (args_info->nbins_x_given) |
468 |
+ |
write_into_file(outfile, "nbins_x", args_info->nbins_x_orig, 0); |
469 |
+ |
if (args_info->nbins_y_given) |
470 |
+ |
write_into_file(outfile, "nbins_y", args_info->nbins_y_orig, 0); |
471 |
+ |
if (args_info->nbins_z_given) |
472 |
+ |
write_into_file(outfile, "nbins_z", args_info->nbins_z_orig, 0); |
473 |
+ |
if (args_info->nanglebins_given) |
474 |
+ |
write_into_file(outfile, "nanglebins", args_info->nanglebins_orig, 0); |
475 |
+ |
if (args_info->rcut_given) |
476 |
+ |
write_into_file(outfile, "rcut", args_info->rcut_orig, 0); |
477 |
+ |
if (args_info->dz_given) |
478 |
+ |
write_into_file(outfile, "dz", args_info->dz_orig, 0); |
479 |
+ |
if (args_info->length_given) |
480 |
+ |
write_into_file(outfile, "length", args_info->length_orig, 0); |
481 |
+ |
if (args_info->zlength_given) |
482 |
+ |
write_into_file(outfile, "zlength", args_info->zlength_orig, 0); |
483 |
+ |
if (args_info->zoffset_given) |
484 |
+ |
write_into_file(outfile, "zoffset", args_info->zoffset_orig, 0); |
485 |
+ |
if (args_info->sele1_given) |
486 |
+ |
write_into_file(outfile, "sele1", args_info->sele1_orig, 0); |
487 |
+ |
if (args_info->sele2_given) |
488 |
+ |
write_into_file(outfile, "sele2", args_info->sele2_orig, 0); |
489 |
+ |
if (args_info->sele3_given) |
490 |
+ |
write_into_file(outfile, "sele3", args_info->sele3_orig, 0); |
491 |
+ |
if (args_info->refsele_given) |
492 |
+ |
write_into_file(outfile, "refsele", args_info->refsele_orig, 0); |
493 |
+ |
if (args_info->comsele_given) |
494 |
+ |
write_into_file(outfile, "comsele", args_info->comsele_orig, 0); |
495 |
+ |
if (args_info->seleoffset_given) |
496 |
+ |
write_into_file(outfile, "seleoffset", args_info->seleoffset_orig, 0); |
497 |
+ |
if (args_info->seleoffset2_given) |
498 |
+ |
write_into_file(outfile, "seleoffset2", args_info->seleoffset2_orig, 0); |
499 |
+ |
if (args_info->molname_given) |
500 |
+ |
write_into_file(outfile, "molname", args_info->molname_orig, 0); |
501 |
+ |
if (args_info->begin_given) |
502 |
+ |
write_into_file(outfile, "begin", args_info->begin_orig, 0); |
503 |
+ |
if (args_info->end_given) |
504 |
+ |
write_into_file(outfile, "end", args_info->end_orig, 0); |
505 |
+ |
if (args_info->radius_given) |
506 |
+ |
write_into_file(outfile, "radius", args_info->radius_orig, 0); |
507 |
+ |
if (args_info->voxelSize_given) |
508 |
+ |
write_into_file(outfile, "voxelSize", args_info->voxelSize_orig, 0); |
509 |
+ |
if (args_info->gaussWidth_given) |
510 |
+ |
write_into_file(outfile, "gaussWidth", args_info->gaussWidth_orig, 0); |
511 |
+ |
if (args_info->bo_given) |
512 |
+ |
write_into_file(outfile, "bo", 0, 0 ); |
513 |
+ |
if (args_info->ior_given) |
514 |
+ |
write_into_file(outfile, "ior", 0, 0 ); |
515 |
+ |
if (args_info->for_given) |
516 |
+ |
write_into_file(outfile, "for", 0, 0 ); |
517 |
+ |
if (args_info->bad_given) |
518 |
+ |
write_into_file(outfile, "bad", 0, 0 ); |
519 |
+ |
if (args_info->count_given) |
520 |
+ |
write_into_file(outfile, "count", 0, 0 ); |
521 |
+ |
if (args_info->gofr_given) |
522 |
+ |
write_into_file(outfile, "gofr", 0, 0 ); |
523 |
+ |
if (args_info->gofz_given) |
524 |
+ |
write_into_file(outfile, "gofz", 0, 0 ); |
525 |
+ |
if (args_info->r_theta_given) |
526 |
+ |
write_into_file(outfile, "r_theta", 0, 0 ); |
527 |
+ |
if (args_info->r_omega_given) |
528 |
+ |
write_into_file(outfile, "r_omega", 0, 0 ); |
529 |
+ |
if (args_info->r_z_given) |
530 |
+ |
write_into_file(outfile, "r_z", 0, 0 ); |
531 |
+ |
if (args_info->theta_omega_given) |
532 |
+ |
write_into_file(outfile, "theta_omega", 0, 0 ); |
533 |
+ |
if (args_info->gxyz_given) |
534 |
+ |
write_into_file(outfile, "gxyz", 0, 0 ); |
535 |
+ |
if (args_info->twodgofr_given) |
536 |
+ |
write_into_file(outfile, "twodgofr", 0, 0 ); |
537 |
+ |
if (args_info->p2_given) |
538 |
+ |
write_into_file(outfile, "p2", 0, 0 ); |
539 |
+ |
if (args_info->rp2_given) |
540 |
+ |
write_into_file(outfile, "rp2", 0, 0 ); |
541 |
+ |
if (args_info->scd_given) |
542 |
+ |
write_into_file(outfile, "scd", 0, 0 ); |
543 |
+ |
if (args_info->density_given) |
544 |
+ |
write_into_file(outfile, "density", 0, 0 ); |
545 |
+ |
if (args_info->slab_density_given) |
546 |
+ |
write_into_file(outfile, "slab_density", 0, 0 ); |
547 |
+ |
if (args_info->p_angle_given) |
548 |
+ |
write_into_file(outfile, "p_angle", 0, 0 ); |
549 |
+ |
if (args_info->hxy_given) |
550 |
+ |
write_into_file(outfile, "hxy", 0, 0 ); |
551 |
+ |
if (args_info->rho_r_given) |
552 |
+ |
write_into_file(outfile, "rho_r", 0, 0 ); |
553 |
+ |
if (args_info->angle_r_given) |
554 |
+ |
write_into_file(outfile, "angle_r", 0, 0 ); |
555 |
+ |
if (args_info->hullvol_given) |
556 |
+ |
write_into_file(outfile, "hullvol", 0, 0 ); |
557 |
+ |
if (args_info->rodlength_given) |
558 |
+ |
write_into_file(outfile, "rodlength", 0, 0 ); |
559 |
+ |
if (args_info->tet_param_given) |
560 |
+ |
write_into_file(outfile, "tet_param", 0, 0 ); |
561 |
+ |
if (args_info->tet_param_z_given) |
562 |
+ |
write_into_file(outfile, "tet_param_z", 0, 0 ); |
563 |
+ |
if (args_info->tet_param_xyz_given) |
564 |
+ |
write_into_file(outfile, "tet_param_xyz", 0, 0 ); |
565 |
+ |
if (args_info->rnemdz_given) |
566 |
+ |
write_into_file(outfile, "rnemdz", 0, 0 ); |
567 |
+ |
if (args_info->rnemdr_given) |
568 |
+ |
write_into_file(outfile, "rnemdr", 0, 0 ); |
569 |
+ |
if (args_info->rnemdrt_given) |
570 |
+ |
write_into_file(outfile, "rnemdrt", 0, 0 ); |
571 |
+ |
if (args_info->nitrile_given) |
572 |
+ |
write_into_file(outfile, "nitrile", 0, 0 ); |
573 |
+ |
if (args_info->multipole_given) |
574 |
+ |
write_into_file(outfile, "multipole", 0, 0 ); |
575 |
+ |
|
576 |
+ |
|
577 |
+ |
i = EXIT_SUCCESS; |
578 |
+ |
return i; |
579 |
+ |
} |
580 |
+ |
|
581 |
+ |
int |
582 |
|
cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info) |
583 |
|
{ |
584 |
|
FILE *outfile; |
592 |
|
return EXIT_FAILURE; |
593 |
|
} |
594 |
|
|
595 |
< |
if (args_info->help_given) { |
399 |
< |
fprintf(outfile, "%s\n", "help"); |
400 |
< |
} |
401 |
< |
if (args_info->version_given) { |
402 |
< |
fprintf(outfile, "%s\n", "version"); |
403 |
< |
} |
404 |
< |
if (args_info->input_given) { |
405 |
< |
if (args_info->input_orig) { |
406 |
< |
fprintf(outfile, "%s=\"%s\"\n", "input", args_info->input_orig); |
407 |
< |
} else { |
408 |
< |
fprintf(outfile, "%s\n", "input"); |
409 |
< |
} |
410 |
< |
} |
411 |
< |
if (args_info->output_given) { |
412 |
< |
if (args_info->output_orig) { |
413 |
< |
fprintf(outfile, "%s=\"%s\"\n", "output", args_info->output_orig); |
414 |
< |
} else { |
415 |
< |
fprintf(outfile, "%s\n", "output"); |
416 |
< |
} |
417 |
< |
} |
418 |
< |
if (args_info->step_given) { |
419 |
< |
if (args_info->step_orig) { |
420 |
< |
fprintf(outfile, "%s=\"%s\"\n", "step", args_info->step_orig); |
421 |
< |
} else { |
422 |
< |
fprintf(outfile, "%s\n", "step"); |
423 |
< |
} |
424 |
< |
} |
425 |
< |
if (args_info->nbins_given) { |
426 |
< |
if (args_info->nbins_orig) { |
427 |
< |
fprintf(outfile, "%s=\"%s\"\n", "nbins", args_info->nbins_orig); |
428 |
< |
} else { |
429 |
< |
fprintf(outfile, "%s\n", "nbins"); |
430 |
< |
} |
431 |
< |
} |
432 |
< |
if (args_info->nbins_x_given) { |
433 |
< |
if (args_info->nbins_x_orig) { |
434 |
< |
fprintf(outfile, "%s=\"%s\"\n", "nbins_x", args_info->nbins_x_orig); |
435 |
< |
} else { |
436 |
< |
fprintf(outfile, "%s\n", "nbins_x"); |
437 |
< |
} |
438 |
< |
} |
439 |
< |
if (args_info->nbins_y_given) { |
440 |
< |
if (args_info->nbins_y_orig) { |
441 |
< |
fprintf(outfile, "%s=\"%s\"\n", "nbins_y", args_info->nbins_y_orig); |
442 |
< |
} else { |
443 |
< |
fprintf(outfile, "%s\n", "nbins_y"); |
444 |
< |
} |
445 |
< |
} |
446 |
< |
if (args_info->nanglebins_given) { |
447 |
< |
if (args_info->nanglebins_orig) { |
448 |
< |
fprintf(outfile, "%s=\"%s\"\n", "nanglebins", args_info->nanglebins_orig); |
449 |
< |
} else { |
450 |
< |
fprintf(outfile, "%s\n", "nanglebins"); |
451 |
< |
} |
452 |
< |
} |
453 |
< |
if (args_info->length_given) { |
454 |
< |
if (args_info->length_orig) { |
455 |
< |
fprintf(outfile, "%s=\"%s\"\n", "length", args_info->length_orig); |
456 |
< |
} else { |
457 |
< |
fprintf(outfile, "%s\n", "length"); |
458 |
< |
} |
459 |
< |
} |
460 |
< |
if (args_info->rcut_given) { |
461 |
< |
if (args_info->rcut_orig) { |
462 |
< |
fprintf(outfile, "%s=\"%s\"\n", "rcut", args_info->rcut_orig); |
463 |
< |
} else { |
464 |
< |
fprintf(outfile, "%s\n", "rcut"); |
465 |
< |
} |
466 |
< |
} |
467 |
< |
if (args_info->zoffset_given) { |
468 |
< |
if (args_info->zoffset_orig) { |
469 |
< |
fprintf(outfile, "%s=\"%s\"\n", "zoffset", args_info->zoffset_orig); |
470 |
< |
} else { |
471 |
< |
fprintf(outfile, "%s\n", "zoffset"); |
472 |
< |
} |
473 |
< |
} |
474 |
< |
if (args_info->sele1_given) { |
475 |
< |
if (args_info->sele1_orig) { |
476 |
< |
fprintf(outfile, "%s=\"%s\"\n", "sele1", args_info->sele1_orig); |
477 |
< |
} else { |
478 |
< |
fprintf(outfile, "%s\n", "sele1"); |
479 |
< |
} |
480 |
< |
} |
481 |
< |
if (args_info->sele2_given) { |
482 |
< |
if (args_info->sele2_orig) { |
483 |
< |
fprintf(outfile, "%s=\"%s\"\n", "sele2", args_info->sele2_orig); |
484 |
< |
} else { |
485 |
< |
fprintf(outfile, "%s\n", "sele2"); |
486 |
< |
} |
487 |
< |
} |
488 |
< |
if (args_info->sele3_given) { |
489 |
< |
if (args_info->sele3_orig) { |
490 |
< |
fprintf(outfile, "%s=\"%s\"\n", "sele3", args_info->sele3_orig); |
491 |
< |
} else { |
492 |
< |
fprintf(outfile, "%s\n", "sele3"); |
493 |
< |
} |
494 |
< |
} |
495 |
< |
if (args_info->refsele_given) { |
496 |
< |
if (args_info->refsele_orig) { |
497 |
< |
fprintf(outfile, "%s=\"%s\"\n", "refsele", args_info->refsele_orig); |
498 |
< |
} else { |
499 |
< |
fprintf(outfile, "%s\n", "refsele"); |
500 |
< |
} |
501 |
< |
} |
502 |
< |
if (args_info->molname_given) { |
503 |
< |
if (args_info->molname_orig) { |
504 |
< |
fprintf(outfile, "%s=\"%s\"\n", "molname", args_info->molname_orig); |
505 |
< |
} else { |
506 |
< |
fprintf(outfile, "%s\n", "molname"); |
507 |
< |
} |
508 |
< |
} |
509 |
< |
if (args_info->begin_given) { |
510 |
< |
if (args_info->begin_orig) { |
511 |
< |
fprintf(outfile, "%s=\"%s\"\n", "begin", args_info->begin_orig); |
512 |
< |
} else { |
513 |
< |
fprintf(outfile, "%s\n", "begin"); |
514 |
< |
} |
515 |
< |
} |
516 |
< |
if (args_info->end_given) { |
517 |
< |
if (args_info->end_orig) { |
518 |
< |
fprintf(outfile, "%s=\"%s\"\n", "end", args_info->end_orig); |
519 |
< |
} else { |
520 |
< |
fprintf(outfile, "%s\n", "end"); |
521 |
< |
} |
522 |
< |
} |
523 |
< |
if (args_info->radius_given) { |
524 |
< |
if (args_info->radius_orig) { |
525 |
< |
fprintf(outfile, "%s=\"%s\"\n", "radius", args_info->radius_orig); |
526 |
< |
} else { |
527 |
< |
fprintf(outfile, "%s\n", "radius"); |
528 |
< |
} |
529 |
< |
} |
530 |
< |
if (args_info->bo_given) { |
531 |
< |
fprintf(outfile, "%s\n", "bo"); |
532 |
< |
} |
533 |
< |
if (args_info->bor_given) { |
534 |
< |
fprintf(outfile, "%s\n", "bor"); |
535 |
< |
} |
536 |
< |
if (args_info->bad_given) { |
537 |
< |
fprintf(outfile, "%s\n", "bad"); |
538 |
< |
} |
539 |
< |
if (args_info->gofr_given) { |
540 |
< |
fprintf(outfile, "%s\n", "gofr"); |
541 |
< |
} |
542 |
< |
if (args_info->gofz_given) { |
543 |
< |
fprintf(outfile, "%s\n", "gofz"); |
544 |
< |
} |
545 |
< |
if (args_info->r_theta_given) { |
546 |
< |
fprintf(outfile, "%s\n", "r_theta"); |
547 |
< |
} |
548 |
< |
if (args_info->r_omega_given) { |
549 |
< |
fprintf(outfile, "%s\n", "r_omega"); |
550 |
< |
} |
551 |
< |
if (args_info->theta_omega_given) { |
552 |
< |
fprintf(outfile, "%s\n", "theta_omega"); |
553 |
< |
} |
554 |
< |
if (args_info->gxyz_given) { |
555 |
< |
fprintf(outfile, "%s\n", "gxyz"); |
556 |
< |
} |
557 |
< |
if (args_info->p2_given) { |
558 |
< |
fprintf(outfile, "%s\n", "p2"); |
559 |
< |
} |
560 |
< |
if (args_info->rp2_given) { |
561 |
< |
fprintf(outfile, "%s\n", "rp2"); |
562 |
< |
} |
563 |
< |
if (args_info->scd_given) { |
564 |
< |
fprintf(outfile, "%s\n", "scd"); |
565 |
< |
} |
566 |
< |
if (args_info->density_given) { |
567 |
< |
fprintf(outfile, "%s\n", "density"); |
568 |
< |
} |
569 |
< |
if (args_info->slab_density_given) { |
570 |
< |
fprintf(outfile, "%s\n", "slab_density"); |
571 |
< |
} |
572 |
< |
if (args_info->hxy_given) { |
573 |
< |
fprintf(outfile, "%s\n", "hxy"); |
574 |
< |
} |
575 |
< |
if (args_info->rho_r_given) { |
576 |
< |
fprintf(outfile, "%s\n", "rho_r"); |
577 |
< |
} |
578 |
< |
if (args_info->hullvol_given) { |
579 |
< |
fprintf(outfile, "%s\n", "hullvol"); |
580 |
< |
} |
581 |
< |
|
595 |
> |
i = cmdline_parser_dump(outfile, args_info); |
596 |
|
fclose (outfile); |
597 |
|
|
584 |
– |
i = EXIT_SUCCESS; |
598 |
|
return i; |
599 |
|
} |
600 |
|
|
604 |
|
cmdline_parser_release (args_info); |
605 |
|
} |
606 |
|
|
607 |
< |
|
595 |
< |
/* gengetopt_strdup() */ |
596 |
< |
/* strdup.c replacement of strdup, which is not standard */ |
607 |
> |
/** @brief replacement of strdup, which is not standard */ |
608 |
|
char * |
609 |
|
gengetopt_strdup (const char *s) |
610 |
|
{ |
611 |
< |
char *result = NULL; |
611 |
> |
char *result = 0; |
612 |
|
if (!s) |
613 |
|
return result; |
614 |
|
|
620 |
|
} |
621 |
|
|
622 |
|
static void |
612 |
– |
reset_group_staticProps(struct gengetopt_args_info *args_info); |
613 |
– |
|
614 |
– |
static void |
623 |
|
reset_group_staticProps(struct gengetopt_args_info *args_info) |
624 |
|
{ |
625 |
|
if (! args_info->staticProps_group_counter) |
626 |
|
return; |
627 |
|
|
628 |
|
args_info->bo_given = 0 ; |
629 |
< |
args_info->bor_given = 0 ; |
629 |
> |
args_info->ior_given = 0 ; |
630 |
> |
args_info->for_given = 0 ; |
631 |
|
args_info->bad_given = 0 ; |
632 |
+ |
args_info->count_given = 0 ; |
633 |
|
args_info->gofr_given = 0 ; |
634 |
|
args_info->gofz_given = 0 ; |
635 |
|
args_info->r_theta_given = 0 ; |
636 |
|
args_info->r_omega_given = 0 ; |
637 |
+ |
args_info->r_z_given = 0 ; |
638 |
|
args_info->theta_omega_given = 0 ; |
639 |
|
args_info->gxyz_given = 0 ; |
640 |
+ |
args_info->twodgofr_given = 0 ; |
641 |
|
args_info->p2_given = 0 ; |
642 |
|
args_info->rp2_given = 0 ; |
643 |
|
args_info->scd_given = 0 ; |
644 |
|
args_info->density_given = 0 ; |
645 |
|
args_info->slab_density_given = 0 ; |
646 |
+ |
args_info->p_angle_given = 0 ; |
647 |
|
args_info->hxy_given = 0 ; |
648 |
|
args_info->rho_r_given = 0 ; |
649 |
+ |
args_info->angle_r_given = 0 ; |
650 |
|
args_info->hullvol_given = 0 ; |
651 |
+ |
args_info->rodlength_given = 0 ; |
652 |
+ |
args_info->tet_param_given = 0 ; |
653 |
+ |
args_info->tet_param_z_given = 0 ; |
654 |
+ |
args_info->tet_param_xyz_given = 0 ; |
655 |
+ |
args_info->rnemdz_given = 0 ; |
656 |
+ |
args_info->rnemdr_given = 0 ; |
657 |
+ |
args_info->rnemdrt_given = 0 ; |
658 |
+ |
args_info->nitrile_given = 0 ; |
659 |
+ |
args_info->multipole_given = 0 ; |
660 |
|
|
661 |
|
args_info->staticProps_group_counter = 0; |
662 |
|
} |
663 |
|
|
664 |
|
int |
665 |
< |
cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_info) |
665 |
> |
cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info) |
666 |
|
{ |
667 |
|
return cmdline_parser2 (argc, argv, args_info, 0, 1, 1); |
668 |
|
} |
669 |
|
|
670 |
|
int |
671 |
< |
cmdline_parser2 (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) |
671 |
> |
cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, |
672 |
> |
struct cmdline_parser_params *params) |
673 |
|
{ |
674 |
|
int result; |
675 |
+ |
result = cmdline_parser_internal (argc, argv, args_info, params, 0); |
676 |
|
|
677 |
< |
result = cmdline_parser_internal (argc, argv, args_info, override, initialize, check_required, NULL); |
677 |
> |
if (result == EXIT_FAILURE) |
678 |
> |
{ |
679 |
> |
cmdline_parser_free (args_info); |
680 |
> |
exit (EXIT_FAILURE); |
681 |
> |
} |
682 |
> |
|
683 |
> |
return result; |
684 |
> |
} |
685 |
> |
|
686 |
> |
int |
687 |
> |
cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) |
688 |
> |
{ |
689 |
> |
int result; |
690 |
> |
struct cmdline_parser_params params; |
691 |
> |
|
692 |
> |
params.override = override; |
693 |
> |
params.initialize = initialize; |
694 |
> |
params.check_required = check_required; |
695 |
> |
params.check_ambiguity = 0; |
696 |
> |
params.print_errors = 1; |
697 |
|
|
698 |
+ |
result = cmdline_parser_internal (argc, argv, args_info, ¶ms, 0); |
699 |
+ |
|
700 |
|
if (result == EXIT_FAILURE) |
701 |
|
{ |
702 |
|
cmdline_parser_free (args_info); |
711 |
|
{ |
712 |
|
int result = EXIT_SUCCESS; |
713 |
|
|
714 |
< |
if (cmdline_parser_required2(args_info, prog_name, NULL) > 0) |
714 |
> |
if (cmdline_parser_required2(args_info, prog_name, 0) > 0) |
715 |
|
result = EXIT_FAILURE; |
716 |
|
|
717 |
|
if (result == EXIT_FAILURE) |
727 |
|
cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error) |
728 |
|
{ |
729 |
|
int error = 0; |
730 |
+ |
FIX_UNUSED (additional_error); |
731 |
|
|
732 |
|
/* checks for required options */ |
733 |
|
if (! args_info->input_given) |
738 |
|
|
739 |
|
if (args_info->staticProps_group_counter == 0) |
740 |
|
{ |
741 |
< |
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 : "")); |
741 |
> |
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 : "")); |
742 |
|
error = 1; |
743 |
|
} |
744 |
|
|
748 |
|
return error; |
749 |
|
} |
750 |
|
|
751 |
+ |
|
752 |
+ |
static char *package_name = 0; |
753 |
+ |
|
754 |
+ |
/** |
755 |
+ |
* @brief updates an option |
756 |
+ |
* @param field the generic pointer to the field to update |
757 |
+ |
* @param orig_field the pointer to the orig field |
758 |
+ |
* @param field_given the pointer to the number of occurrence of this option |
759 |
+ |
* @param prev_given the pointer to the number of occurrence already seen |
760 |
+ |
* @param value the argument for this option (if null no arg was specified) |
761 |
+ |
* @param possible_values the possible values for this option (if specified) |
762 |
+ |
* @param default_value the default value (in case the option only accepts fixed values) |
763 |
+ |
* @param arg_type the type of this option |
764 |
+ |
* @param check_ambiguity @see cmdline_parser_params.check_ambiguity |
765 |
+ |
* @param override @see cmdline_parser_params.override |
766 |
+ |
* @param no_free whether to free a possible previous value |
767 |
+ |
* @param multiple_option whether this is a multiple option |
768 |
+ |
* @param long_opt the corresponding long option |
769 |
+ |
* @param short_opt the corresponding short option (or '-' if none) |
770 |
+ |
* @param additional_error possible further error specification |
771 |
+ |
*/ |
772 |
+ |
static |
773 |
+ |
int update_arg(void *field, char **orig_field, |
774 |
+ |
unsigned int *field_given, unsigned int *prev_given, |
775 |
+ |
char *value, const char *possible_values[], |
776 |
+ |
const char *default_value, |
777 |
+ |
cmdline_parser_arg_type arg_type, |
778 |
+ |
int check_ambiguity, int override, |
779 |
+ |
int no_free, int multiple_option, |
780 |
+ |
const char *long_opt, char short_opt, |
781 |
+ |
const char *additional_error) |
782 |
+ |
{ |
783 |
+ |
char *stop_char = 0; |
784 |
+ |
const char *val = value; |
785 |
+ |
int found; |
786 |
+ |
char **string_field; |
787 |
+ |
FIX_UNUSED (field); |
788 |
+ |
|
789 |
+ |
stop_char = 0; |
790 |
+ |
found = 0; |
791 |
+ |
|
792 |
+ |
if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given))) |
793 |
+ |
{ |
794 |
+ |
if (short_opt != '-') |
795 |
+ |
fprintf (stderr, "%s: `--%s' (`-%c') option given more than once%s\n", |
796 |
+ |
package_name, long_opt, short_opt, |
797 |
+ |
(additional_error ? additional_error : "")); |
798 |
+ |
else |
799 |
+ |
fprintf (stderr, "%s: `--%s' option given more than once%s\n", |
800 |
+ |
package_name, long_opt, |
801 |
+ |
(additional_error ? additional_error : "")); |
802 |
+ |
return 1; /* failure */ |
803 |
+ |
} |
804 |
+ |
|
805 |
+ |
FIX_UNUSED (default_value); |
806 |
+ |
|
807 |
+ |
if (field_given && *field_given && ! override) |
808 |
+ |
return 0; |
809 |
+ |
if (prev_given) |
810 |
+ |
(*prev_given)++; |
811 |
+ |
if (field_given) |
812 |
+ |
(*field_given)++; |
813 |
+ |
if (possible_values) |
814 |
+ |
val = possible_values[found]; |
815 |
+ |
|
816 |
+ |
switch(arg_type) { |
817 |
+ |
case ARG_INT: |
818 |
+ |
if (val) *((int *)field) = strtol (val, &stop_char, 0); |
819 |
+ |
break; |
820 |
+ |
case ARG_DOUBLE: |
821 |
+ |
if (val) *((double *)field) = strtod (val, &stop_char); |
822 |
+ |
break; |
823 |
+ |
case ARG_STRING: |
824 |
+ |
if (val) { |
825 |
+ |
string_field = (char **)field; |
826 |
+ |
if (!no_free && *string_field) |
827 |
+ |
free (*string_field); /* free previous string */ |
828 |
+ |
*string_field = gengetopt_strdup (val); |
829 |
+ |
} |
830 |
+ |
break; |
831 |
+ |
default: |
832 |
+ |
break; |
833 |
+ |
}; |
834 |
+ |
|
835 |
+ |
/* check numeric conversion */ |
836 |
+ |
switch(arg_type) { |
837 |
+ |
case ARG_INT: |
838 |
+ |
case ARG_DOUBLE: |
839 |
+ |
if (val && !(stop_char && *stop_char == '\0')) { |
840 |
+ |
fprintf(stderr, "%s: invalid numeric value: %s\n", package_name, val); |
841 |
+ |
return 1; /* failure */ |
842 |
+ |
} |
843 |
+ |
break; |
844 |
+ |
default: |
845 |
+ |
; |
846 |
+ |
}; |
847 |
+ |
|
848 |
+ |
/* store the original value */ |
849 |
+ |
switch(arg_type) { |
850 |
+ |
case ARG_NO: |
851 |
+ |
break; |
852 |
+ |
default: |
853 |
+ |
if (value && orig_field) { |
854 |
+ |
if (no_free) { |
855 |
+ |
*orig_field = value; |
856 |
+ |
} else { |
857 |
+ |
if (*orig_field) |
858 |
+ |
free (*orig_field); /* free previous string */ |
859 |
+ |
*orig_field = gengetopt_strdup (value); |
860 |
+ |
} |
861 |
+ |
} |
862 |
+ |
}; |
863 |
+ |
|
864 |
+ |
return 0; /* OK */ |
865 |
+ |
} |
866 |
+ |
|
867 |
+ |
|
868 |
|
int |
869 |
< |
cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required, const char *additional_error) |
869 |
> |
cmdline_parser_internal ( |
870 |
> |
int argc, char **argv, struct gengetopt_args_info *args_info, |
871 |
> |
struct cmdline_parser_params *params, const char *additional_error) |
872 |
|
{ |
873 |
|
int c; /* Character of the parsed option. */ |
874 |
|
|
875 |
|
int error = 0; |
876 |
|
struct gengetopt_args_info local_args_info; |
877 |
+ |
|
878 |
+ |
int override; |
879 |
+ |
int initialize; |
880 |
+ |
int check_required; |
881 |
+ |
int check_ambiguity; |
882 |
+ |
|
883 |
+ |
package_name = argv[0]; |
884 |
+ |
|
885 |
+ |
override = params->override; |
886 |
+ |
initialize = params->initialize; |
887 |
+ |
check_required = params->check_required; |
888 |
+ |
check_ambiguity = params->check_ambiguity; |
889 |
|
|
890 |
|
if (initialize) |
891 |
|
cmdline_parser_init (args_info); |
894 |
|
|
895 |
|
optarg = 0; |
896 |
|
optind = 0; |
897 |
< |
opterr = 1; |
897 |
> |
opterr = params->print_errors; |
898 |
|
optopt = '?'; |
899 |
|
|
900 |
|
while (1) |
901 |
|
{ |
902 |
|
int option_index = 0; |
725 |
– |
char *stop_char; |
903 |
|
|
904 |
|
static struct option long_options[] = { |
905 |
|
{ "help", 0, NULL, 'h' }, |
910 |
|
{ "nbins", 1, NULL, 'b' }, |
911 |
|
{ "nbins_x", 1, NULL, 'x' }, |
912 |
|
{ "nbins_y", 1, NULL, 'y' }, |
913 |
+ |
{ "nbins_z", 1, NULL, 0 }, |
914 |
|
{ "nanglebins", 1, NULL, 'a' }, |
737 |
– |
{ "length", 1, NULL, 0 }, |
915 |
|
{ "rcut", 1, NULL, 'c' }, |
916 |
+ |
{ "dz", 1, NULL, 0 }, |
917 |
+ |
{ "length", 1, NULL, 0 }, |
918 |
+ |
{ "zlength", 1, NULL, 0 }, |
919 |
|
{ "zoffset", 1, NULL, 'z' }, |
920 |
|
{ "sele1", 1, NULL, 0 }, |
921 |
|
{ "sele2", 1, NULL, 0 }, |
922 |
|
{ "sele3", 1, NULL, 0 }, |
923 |
|
{ "refsele", 1, NULL, 0 }, |
924 |
+ |
{ "comsele", 1, NULL, 0 }, |
925 |
+ |
{ "seleoffset", 1, NULL, 0 }, |
926 |
+ |
{ "seleoffset2", 1, NULL, 0 }, |
927 |
|
{ "molname", 1, NULL, 0 }, |
928 |
|
{ "begin", 1, NULL, 0 }, |
929 |
|
{ "end", 1, NULL, 0 }, |
930 |
|
{ "radius", 1, NULL, 0 }, |
931 |
+ |
{ "voxelSize", 1, NULL, 'v' }, |
932 |
+ |
{ "gaussWidth", 1, NULL, 0 }, |
933 |
|
{ "bo", 0, NULL, 0 }, |
934 |
< |
{ "bor", 0, NULL, 0 }, |
934 |
> |
{ "ior", 0, NULL, 0 }, |
935 |
> |
{ "for", 0, NULL, 0 }, |
936 |
|
{ "bad", 0, NULL, 0 }, |
937 |
+ |
{ "count", 0, NULL, 0 }, |
938 |
|
{ "gofr", 0, NULL, 'g' }, |
939 |
|
{ "gofz", 0, NULL, 0 }, |
940 |
|
{ "r_theta", 0, NULL, 0 }, |
941 |
|
{ "r_omega", 0, NULL, 0 }, |
942 |
+ |
{ "r_z", 0, NULL, 0 }, |
943 |
|
{ "theta_omega", 0, NULL, 0 }, |
944 |
|
{ "gxyz", 0, NULL, 0 }, |
945 |
+ |
{ "twodgofr", 0, NULL, 0 }, |
946 |
|
{ "p2", 0, NULL, 'p' }, |
947 |
|
{ "rp2", 0, NULL, 0 }, |
948 |
|
{ "scd", 0, NULL, 's' }, |
949 |
|
{ "density", 0, NULL, 'd' }, |
950 |
|
{ "slab_density", 0, NULL, 0 }, |
951 |
+ |
{ "p_angle", 0, NULL, 0 }, |
952 |
|
{ "hxy", 0, NULL, 0 }, |
953 |
|
{ "rho_r", 0, NULL, 0 }, |
954 |
+ |
{ "angle_r", 0, NULL, 0 }, |
955 |
|
{ "hullvol", 0, NULL, 0 }, |
956 |
< |
{ NULL, 0, NULL, 0 } |
956 |
> |
{ "rodlength", 0, NULL, 0 }, |
957 |
> |
{ "tet_param", 0, NULL, 'Q' }, |
958 |
> |
{ "tet_param_z", 0, NULL, 0 }, |
959 |
> |
{ "tet_param_xyz", 0, NULL, 0 }, |
960 |
> |
{ "rnemdz", 0, NULL, 0 }, |
961 |
> |
{ "rnemdr", 0, NULL, 0 }, |
962 |
> |
{ "rnemdrt", 0, NULL, 0 }, |
963 |
> |
{ "nitrile", 0, NULL, 0 }, |
964 |
> |
{ "multipole", 0, NULL, 'm' }, |
965 |
> |
{ 0, 0, 0, 0 } |
966 |
|
}; |
967 |
|
|
968 |
< |
stop_char = 0; |
769 |
< |
c = getopt_long (argc, argv, "hVi:o:n:b:x:y:a:c:z:gpsd", long_options, &option_index); |
968 |
> |
c = getopt_long (argc, argv, "hVi:o:n:b:x:y:a:c:z:v:gpsdQm", long_options, &option_index); |
969 |
|
|
970 |
|
if (c == -1) break; /* Exit from `while (1)' loop. */ |
971 |
|
|
982 |
|
exit (EXIT_SUCCESS); |
983 |
|
|
984 |
|
case 'i': /* input dump file. */ |
985 |
< |
if (local_args_info.input_given) |
986 |
< |
{ |
987 |
< |
fprintf (stderr, "%s: `--input' (`-i') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
988 |
< |
goto failure; |
989 |
< |
} |
990 |
< |
if (args_info->input_given && ! override) |
991 |
< |
continue; |
992 |
< |
local_args_info.input_given = 1; |
993 |
< |
args_info->input_given = 1; |
994 |
< |
if (args_info->input_arg) |
796 |
< |
free (args_info->input_arg); /* free previous string */ |
797 |
< |
args_info->input_arg = gengetopt_strdup (optarg); |
798 |
< |
if (args_info->input_orig) |
799 |
< |
free (args_info->input_orig); /* free previous string */ |
800 |
< |
args_info->input_orig = gengetopt_strdup (optarg); |
985 |
> |
|
986 |
> |
|
987 |
> |
if (update_arg( (void *)&(args_info->input_arg), |
988 |
> |
&(args_info->input_orig), &(args_info->input_given), |
989 |
> |
&(local_args_info.input_given), optarg, 0, 0, ARG_STRING, |
990 |
> |
check_ambiguity, override, 0, 0, |
991 |
> |
"input", 'i', |
992 |
> |
additional_error)) |
993 |
> |
goto failure; |
994 |
> |
|
995 |
|
break; |
802 |
– |
|
996 |
|
case 'o': /* output file name. */ |
997 |
< |
if (local_args_info.output_given) |
998 |
< |
{ |
999 |
< |
fprintf (stderr, "%s: `--output' (`-o') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1000 |
< |
goto failure; |
1001 |
< |
} |
1002 |
< |
if (args_info->output_given && ! override) |
1003 |
< |
continue; |
1004 |
< |
local_args_info.output_given = 1; |
1005 |
< |
args_info->output_given = 1; |
1006 |
< |
if (args_info->output_arg) |
814 |
< |
free (args_info->output_arg); /* free previous string */ |
815 |
< |
args_info->output_arg = gengetopt_strdup (optarg); |
816 |
< |
if (args_info->output_orig) |
817 |
< |
free (args_info->output_orig); /* free previous string */ |
818 |
< |
args_info->output_orig = gengetopt_strdup (optarg); |
997 |
> |
|
998 |
> |
|
999 |
> |
if (update_arg( (void *)&(args_info->output_arg), |
1000 |
> |
&(args_info->output_orig), &(args_info->output_given), |
1001 |
> |
&(local_args_info.output_given), optarg, 0, 0, ARG_STRING, |
1002 |
> |
check_ambiguity, override, 0, 0, |
1003 |
> |
"output", 'o', |
1004 |
> |
additional_error)) |
1005 |
> |
goto failure; |
1006 |
> |
|
1007 |
|
break; |
820 |
– |
|
1008 |
|
case 'n': /* process every n frame. */ |
1009 |
< |
if (local_args_info.step_given) |
1010 |
< |
{ |
1011 |
< |
fprintf (stderr, "%s: `--step' (`-n') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1012 |
< |
goto failure; |
1013 |
< |
} |
1014 |
< |
if (args_info->step_given && ! override) |
1015 |
< |
continue; |
1016 |
< |
local_args_info.step_given = 1; |
1017 |
< |
args_info->step_given = 1; |
1018 |
< |
args_info->step_arg = strtol (optarg, &stop_char, 0); |
832 |
< |
if (!(stop_char && *stop_char == '\0')) { |
833 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
834 |
< |
goto failure; |
835 |
< |
} |
836 |
< |
if (args_info->step_orig) |
837 |
< |
free (args_info->step_orig); /* free previous string */ |
838 |
< |
args_info->step_orig = gengetopt_strdup (optarg); |
1009 |
> |
|
1010 |
> |
|
1011 |
> |
if (update_arg( (void *)&(args_info->step_arg), |
1012 |
> |
&(args_info->step_orig), &(args_info->step_given), |
1013 |
> |
&(local_args_info.step_given), optarg, 0, "1", ARG_INT, |
1014 |
> |
check_ambiguity, override, 0, 0, |
1015 |
> |
"step", 'n', |
1016 |
> |
additional_error)) |
1017 |
> |
goto failure; |
1018 |
> |
|
1019 |
|
break; |
840 |
– |
|
1020 |
|
case 'b': /* number of bins (general purpose). */ |
1021 |
< |
if (local_args_info.nbins_given) |
1022 |
< |
{ |
1023 |
< |
fprintf (stderr, "%s: `--nbins' (`-b') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1024 |
< |
goto failure; |
1025 |
< |
} |
1026 |
< |
if (args_info->nbins_given && ! override) |
1027 |
< |
continue; |
1028 |
< |
local_args_info.nbins_given = 1; |
850 |
< |
args_info->nbins_given = 1; |
851 |
< |
args_info->nbins_arg = strtol (optarg, &stop_char, 0); |
852 |
< |
if (!(stop_char && *stop_char == '\0')) { |
853 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
1021 |
> |
|
1022 |
> |
|
1023 |
> |
if (update_arg( (void *)&(args_info->nbins_arg), |
1024 |
> |
&(args_info->nbins_orig), &(args_info->nbins_given), |
1025 |
> |
&(local_args_info.nbins_given), optarg, 0, "100", ARG_INT, |
1026 |
> |
check_ambiguity, override, 0, 0, |
1027 |
> |
"nbins", 'b', |
1028 |
> |
additional_error)) |
1029 |
|
goto failure; |
1030 |
< |
} |
856 |
< |
if (args_info->nbins_orig) |
857 |
< |
free (args_info->nbins_orig); /* free previous string */ |
858 |
< |
args_info->nbins_orig = gengetopt_strdup (optarg); |
1030 |
> |
|
1031 |
|
break; |
860 |
– |
|
1032 |
|
case 'x': /* number of bins in x axis. */ |
1033 |
< |
if (local_args_info.nbins_x_given) |
1034 |
< |
{ |
1035 |
< |
fprintf (stderr, "%s: `--nbins_x' (`-x') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1036 |
< |
goto failure; |
1037 |
< |
} |
1038 |
< |
if (args_info->nbins_x_given && ! override) |
1039 |
< |
continue; |
1040 |
< |
local_args_info.nbins_x_given = 1; |
870 |
< |
args_info->nbins_x_given = 1; |
871 |
< |
args_info->nbins_x_arg = strtol (optarg, &stop_char, 0); |
872 |
< |
if (!(stop_char && *stop_char == '\0')) { |
873 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
1033 |
> |
|
1034 |
> |
|
1035 |
> |
if (update_arg( (void *)&(args_info->nbins_x_arg), |
1036 |
> |
&(args_info->nbins_x_orig), &(args_info->nbins_x_given), |
1037 |
> |
&(local_args_info.nbins_x_given), optarg, 0, "100", ARG_INT, |
1038 |
> |
check_ambiguity, override, 0, 0, |
1039 |
> |
"nbins_x", 'x', |
1040 |
> |
additional_error)) |
1041 |
|
goto failure; |
1042 |
< |
} |
876 |
< |
if (args_info->nbins_x_orig) |
877 |
< |
free (args_info->nbins_x_orig); /* free previous string */ |
878 |
< |
args_info->nbins_x_orig = gengetopt_strdup (optarg); |
1042 |
> |
|
1043 |
|
break; |
880 |
– |
|
1044 |
|
case 'y': /* number of bins in y axis. */ |
1045 |
< |
if (local_args_info.nbins_y_given) |
1046 |
< |
{ |
1047 |
< |
fprintf (stderr, "%s: `--nbins_y' (`-y') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1048 |
< |
goto failure; |
1049 |
< |
} |
1050 |
< |
if (args_info->nbins_y_given && ! override) |
1051 |
< |
continue; |
1052 |
< |
local_args_info.nbins_y_given = 1; |
890 |
< |
args_info->nbins_y_given = 1; |
891 |
< |
args_info->nbins_y_arg = strtol (optarg, &stop_char, 0); |
892 |
< |
if (!(stop_char && *stop_char == '\0')) { |
893 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
1045 |
> |
|
1046 |
> |
|
1047 |
> |
if (update_arg( (void *)&(args_info->nbins_y_arg), |
1048 |
> |
&(args_info->nbins_y_orig), &(args_info->nbins_y_given), |
1049 |
> |
&(local_args_info.nbins_y_given), optarg, 0, "100", ARG_INT, |
1050 |
> |
check_ambiguity, override, 0, 0, |
1051 |
> |
"nbins_y", 'y', |
1052 |
> |
additional_error)) |
1053 |
|
goto failure; |
1054 |
< |
} |
896 |
< |
if (args_info->nbins_y_orig) |
897 |
< |
free (args_info->nbins_y_orig); /* free previous string */ |
898 |
< |
args_info->nbins_y_orig = gengetopt_strdup (optarg); |
1054 |
> |
|
1055 |
|
break; |
900 |
– |
|
1056 |
|
case 'a': /* number of bins for cos(angle). */ |
1057 |
< |
if (local_args_info.nanglebins_given) |
1058 |
< |
{ |
1059 |
< |
fprintf (stderr, "%s: `--nanglebins' (`-a') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1060 |
< |
goto failure; |
1061 |
< |
} |
1062 |
< |
if (args_info->nanglebins_given && ! override) |
1063 |
< |
continue; |
1064 |
< |
local_args_info.nanglebins_given = 1; |
910 |
< |
args_info->nanglebins_given = 1; |
911 |
< |
args_info->nanglebins_arg = strtol (optarg, &stop_char, 0); |
912 |
< |
if (!(stop_char && *stop_char == '\0')) { |
913 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
1057 |
> |
|
1058 |
> |
|
1059 |
> |
if (update_arg( (void *)&(args_info->nanglebins_arg), |
1060 |
> |
&(args_info->nanglebins_orig), &(args_info->nanglebins_given), |
1061 |
> |
&(local_args_info.nanglebins_given), optarg, 0, "50", ARG_INT, |
1062 |
> |
check_ambiguity, override, 0, 0, |
1063 |
> |
"nanglebins", 'a', |
1064 |
> |
additional_error)) |
1065 |
|
goto failure; |
1066 |
< |
} |
916 |
< |
if (args_info->nanglebins_orig) |
917 |
< |
free (args_info->nanglebins_orig); /* free previous string */ |
918 |
< |
args_info->nanglebins_orig = gengetopt_strdup (optarg); |
1066 |
> |
|
1067 |
|
break; |
920 |
– |
|
1068 |
|
case 'c': /* cutoff radius (rcut). */ |
1069 |
< |
if (local_args_info.rcut_given) |
1070 |
< |
{ |
1071 |
< |
fprintf (stderr, "%s: `--rcut' (`-c') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1072 |
< |
goto failure; |
1073 |
< |
} |
1074 |
< |
if (args_info->rcut_given && ! override) |
1075 |
< |
continue; |
1076 |
< |
local_args_info.rcut_given = 1; |
930 |
< |
args_info->rcut_given = 1; |
931 |
< |
args_info->rcut_arg = strtod (optarg, &stop_char); |
932 |
< |
if (!(stop_char && *stop_char == '\0')) { |
933 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
1069 |
> |
|
1070 |
> |
|
1071 |
> |
if (update_arg( (void *)&(args_info->rcut_arg), |
1072 |
> |
&(args_info->rcut_orig), &(args_info->rcut_given), |
1073 |
> |
&(local_args_info.rcut_given), optarg, 0, 0, ARG_DOUBLE, |
1074 |
> |
check_ambiguity, override, 0, 0, |
1075 |
> |
"rcut", 'c', |
1076 |
> |
additional_error)) |
1077 |
|
goto failure; |
1078 |
< |
} |
936 |
< |
if (args_info->rcut_orig) |
937 |
< |
free (args_info->rcut_orig); /* free previous string */ |
938 |
< |
args_info->rcut_orig = gengetopt_strdup (optarg); |
1078 |
> |
|
1079 |
|
break; |
940 |
– |
|
1080 |
|
case 'z': /* Where to set the zero for the slab_density calculation. */ |
1081 |
< |
if (local_args_info.zoffset_given) |
1082 |
< |
{ |
1083 |
< |
fprintf (stderr, "%s: `--zoffset' (`-z') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1084 |
< |
goto failure; |
1085 |
< |
} |
1086 |
< |
if (args_info->zoffset_given && ! override) |
1087 |
< |
continue; |
1088 |
< |
local_args_info.zoffset_given = 1; |
950 |
< |
args_info->zoffset_given = 1; |
951 |
< |
args_info->zoffset_arg = strtod (optarg, &stop_char); |
952 |
< |
if (!(stop_char && *stop_char == '\0')) { |
953 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
1081 |
> |
|
1082 |
> |
|
1083 |
> |
if (update_arg( (void *)&(args_info->zoffset_arg), |
1084 |
> |
&(args_info->zoffset_orig), &(args_info->zoffset_given), |
1085 |
> |
&(local_args_info.zoffset_given), optarg, 0, "0", ARG_DOUBLE, |
1086 |
> |
check_ambiguity, override, 0, 0, |
1087 |
> |
"zoffset", 'z', |
1088 |
> |
additional_error)) |
1089 |
|
goto failure; |
1090 |
< |
} |
956 |
< |
if (args_info->zoffset_orig) |
957 |
< |
free (args_info->zoffset_orig); /* free previous string */ |
958 |
< |
args_info->zoffset_orig = gengetopt_strdup (optarg); |
1090 |
> |
|
1091 |
|
break; |
1092 |
< |
|
1092 |
> |
case 'v': /* voxel size (angstroms). */ |
1093 |
> |
|
1094 |
> |
|
1095 |
> |
if (update_arg( (void *)&(args_info->voxelSize_arg), |
1096 |
> |
&(args_info->voxelSize_orig), &(args_info->voxelSize_given), |
1097 |
> |
&(local_args_info.voxelSize_given), optarg, 0, 0, ARG_DOUBLE, |
1098 |
> |
check_ambiguity, override, 0, 0, |
1099 |
> |
"voxelSize", 'v', |
1100 |
> |
additional_error)) |
1101 |
> |
goto failure; |
1102 |
> |
|
1103 |
> |
break; |
1104 |
|
case 'g': /* g(r). */ |
1105 |
< |
if (local_args_info.gofr_given) |
963 |
< |
{ |
964 |
< |
fprintf (stderr, "%s: `--gofr' (`-g') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
965 |
< |
goto failure; |
966 |
< |
} |
967 |
< |
if (args_info->gofr_given && ! override) |
968 |
< |
continue; |
969 |
< |
local_args_info.gofr_given = 1; |
970 |
< |
args_info->gofr_given = 1; |
1105 |
> |
|
1106 |
|
if (args_info->staticProps_group_counter && override) |
1107 |
|
reset_group_staticProps (args_info); |
1108 |
|
args_info->staticProps_group_counter += 1; |
1109 |
+ |
|
1110 |
+ |
if (update_arg( 0 , |
1111 |
+ |
0 , &(args_info->gofr_given), |
1112 |
+ |
&(local_args_info.gofr_given), optarg, 0, 0, ARG_NO, |
1113 |
+ |
check_ambiguity, override, 0, 0, |
1114 |
+ |
"gofr", 'g', |
1115 |
+ |
additional_error)) |
1116 |
+ |
goto failure; |
1117 |
+ |
|
1118 |
|
break; |
1119 |
< |
|
1120 |
< |
case 'p': /* p2 order parameter (--sele1 and --sele2 must be specified). */ |
977 |
< |
if (local_args_info.p2_given) |
978 |
< |
{ |
979 |
< |
fprintf (stderr, "%s: `--p2' (`-p') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
980 |
< |
goto failure; |
981 |
< |
} |
982 |
< |
if (args_info->p2_given && ! override) |
983 |
< |
continue; |
984 |
< |
local_args_info.p2_given = 1; |
985 |
< |
args_info->p2_given = 1; |
1119 |
> |
case 'p': /* p2 order parameter (--sele1 must be specified, --sele2 is optional). */ |
1120 |
> |
|
1121 |
|
if (args_info->staticProps_group_counter && override) |
1122 |
|
reset_group_staticProps (args_info); |
1123 |
|
args_info->staticProps_group_counter += 1; |
1124 |
+ |
|
1125 |
+ |
if (update_arg( 0 , |
1126 |
+ |
0 , &(args_info->p2_given), |
1127 |
+ |
&(local_args_info.p2_given), optarg, 0, 0, ARG_NO, |
1128 |
+ |
check_ambiguity, override, 0, 0, |
1129 |
+ |
"p2", 'p', |
1130 |
+ |
additional_error)) |
1131 |
+ |
goto failure; |
1132 |
+ |
|
1133 |
|
break; |
990 |
– |
|
1134 |
|
case 's': /* scd order parameter (either --sele1, --sele2, --sele3 are specified or --molname, --begin, --end are specified). */ |
1135 |
< |
if (local_args_info.scd_given) |
993 |
< |
{ |
994 |
< |
fprintf (stderr, "%s: `--scd' (`-s') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
995 |
< |
goto failure; |
996 |
< |
} |
997 |
< |
if (args_info->scd_given && ! override) |
998 |
< |
continue; |
999 |
< |
local_args_info.scd_given = 1; |
1000 |
< |
args_info->scd_given = 1; |
1135 |
> |
|
1136 |
|
if (args_info->staticProps_group_counter && override) |
1137 |
|
reset_group_staticProps (args_info); |
1138 |
|
args_info->staticProps_group_counter += 1; |
1139 |
+ |
|
1140 |
+ |
if (update_arg( 0 , |
1141 |
+ |
0 , &(args_info->scd_given), |
1142 |
+ |
&(local_args_info.scd_given), optarg, 0, 0, ARG_NO, |
1143 |
+ |
check_ambiguity, override, 0, 0, |
1144 |
+ |
"scd", 's', |
1145 |
+ |
additional_error)) |
1146 |
+ |
goto failure; |
1147 |
+ |
|
1148 |
|
break; |
1005 |
– |
|
1149 |
|
case 'd': /* density plot. */ |
1150 |
< |
if (local_args_info.density_given) |
1008 |
< |
{ |
1009 |
< |
fprintf (stderr, "%s: `--density' (`-d') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1010 |
< |
goto failure; |
1011 |
< |
} |
1012 |
< |
if (args_info->density_given && ! override) |
1013 |
< |
continue; |
1014 |
< |
local_args_info.density_given = 1; |
1015 |
< |
args_info->density_given = 1; |
1150 |
> |
|
1151 |
|
if (args_info->staticProps_group_counter && override) |
1152 |
|
reset_group_staticProps (args_info); |
1153 |
|
args_info->staticProps_group_counter += 1; |
1154 |
+ |
|
1155 |
+ |
if (update_arg( 0 , |
1156 |
+ |
0 , &(args_info->density_given), |
1157 |
+ |
&(local_args_info.density_given), optarg, 0, 0, ARG_NO, |
1158 |
+ |
check_ambiguity, override, 0, 0, |
1159 |
+ |
"density", 'd', |
1160 |
+ |
additional_error)) |
1161 |
+ |
goto failure; |
1162 |
+ |
|
1163 |
|
break; |
1164 |
< |
|
1164 |
> |
case 'Q': /* tetrahedrality order parameter (Qk). */ |
1165 |
> |
|
1166 |
> |
if (args_info->staticProps_group_counter && override) |
1167 |
> |
reset_group_staticProps (args_info); |
1168 |
> |
args_info->staticProps_group_counter += 1; |
1169 |
> |
|
1170 |
> |
if (update_arg( 0 , |
1171 |
> |
0 , &(args_info->tet_param_given), |
1172 |
> |
&(local_args_info.tet_param_given), optarg, 0, 0, ARG_NO, |
1173 |
> |
check_ambiguity, override, 0, 0, |
1174 |
> |
"tet_param", 'Q', |
1175 |
> |
additional_error)) |
1176 |
> |
goto failure; |
1177 |
> |
|
1178 |
> |
break; |
1179 |
> |
case 'm': /* average multipole moments contained within cutoff spheres as a function of radius. */ |
1180 |
> |
|
1181 |
> |
if (args_info->staticProps_group_counter && override) |
1182 |
> |
reset_group_staticProps (args_info); |
1183 |
> |
args_info->staticProps_group_counter += 1; |
1184 |
> |
|
1185 |
> |
if (update_arg( 0 , |
1186 |
> |
0 , &(args_info->multipole_given), |
1187 |
> |
&(local_args_info.multipole_given), optarg, 0, 0, ARG_NO, |
1188 |
> |
check_ambiguity, override, 0, 0, |
1189 |
> |
"multipole", 'm', |
1190 |
> |
additional_error)) |
1191 |
> |
goto failure; |
1192 |
> |
|
1193 |
> |
break; |
1194 |
|
|
1195 |
|
case 0: /* Long option with no short option */ |
1196 |
+ |
/* number of bins in z axis. */ |
1197 |
+ |
if (strcmp (long_options[option_index].name, "nbins_z") == 0) |
1198 |
+ |
{ |
1199 |
+ |
|
1200 |
+ |
|
1201 |
+ |
if (update_arg( (void *)&(args_info->nbins_z_arg), |
1202 |
+ |
&(args_info->nbins_z_orig), &(args_info->nbins_z_given), |
1203 |
+ |
&(local_args_info.nbins_z_given), optarg, 0, "100", ARG_INT, |
1204 |
+ |
check_ambiguity, override, 0, 0, |
1205 |
+ |
"nbins_z", '-', |
1206 |
+ |
additional_error)) |
1207 |
+ |
goto failure; |
1208 |
+ |
|
1209 |
+ |
} |
1210 |
+ |
/* slab width (dz). */ |
1211 |
+ |
else if (strcmp (long_options[option_index].name, "dz") == 0) |
1212 |
+ |
{ |
1213 |
+ |
|
1214 |
+ |
|
1215 |
+ |
if (update_arg( (void *)&(args_info->dz_arg), |
1216 |
+ |
&(args_info->dz_orig), &(args_info->dz_given), |
1217 |
+ |
&(local_args_info.dz_given), optarg, 0, 0, ARG_DOUBLE, |
1218 |
+ |
check_ambiguity, override, 0, 0, |
1219 |
+ |
"dz", '-', |
1220 |
+ |
additional_error)) |
1221 |
+ |
goto failure; |
1222 |
+ |
|
1223 |
+ |
} |
1224 |
|
/* maximum length (Defaults to 1/2 smallest length of first frame). */ |
1225 |
< |
if (strcmp (long_options[option_index].name, "length") == 0) |
1225 |
> |
else if (strcmp (long_options[option_index].name, "length") == 0) |
1226 |
|
{ |
1227 |
< |
if (local_args_info.length_given) |
1228 |
< |
{ |
1229 |
< |
fprintf (stderr, "%s: `--length' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1230 |
< |
goto failure; |
1231 |
< |
} |
1232 |
< |
if (args_info->length_given && ! override) |
1233 |
< |
continue; |
1234 |
< |
local_args_info.length_given = 1; |
1034 |
< |
args_info->length_given = 1; |
1035 |
< |
args_info->length_arg = strtod (optarg, &stop_char); |
1036 |
< |
if (!(stop_char && *stop_char == '\0')) { |
1037 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
1227 |
> |
|
1228 |
> |
|
1229 |
> |
if (update_arg( (void *)&(args_info->length_arg), |
1230 |
> |
&(args_info->length_orig), &(args_info->length_given), |
1231 |
> |
&(local_args_info.length_given), optarg, 0, 0, ARG_DOUBLE, |
1232 |
> |
check_ambiguity, override, 0, 0, |
1233 |
> |
"length", '-', |
1234 |
> |
additional_error)) |
1235 |
|
goto failure; |
1236 |
< |
} |
1040 |
< |
if (args_info->length_orig) |
1041 |
< |
free (args_info->length_orig); /* free previous string */ |
1042 |
< |
args_info->length_orig = gengetopt_strdup (optarg); |
1236 |
> |
|
1237 |
|
} |
1238 |
+ |
/* maximum length (Defaults to 1/2 smallest length of first frame). */ |
1239 |
+ |
else if (strcmp (long_options[option_index].name, "zlength") == 0) |
1240 |
+ |
{ |
1241 |
+ |
|
1242 |
+ |
|
1243 |
+ |
if (update_arg( (void *)&(args_info->zlength_arg), |
1244 |
+ |
&(args_info->zlength_orig), &(args_info->zlength_given), |
1245 |
+ |
&(local_args_info.zlength_given), optarg, 0, 0, ARG_DOUBLE, |
1246 |
+ |
check_ambiguity, override, 0, 0, |
1247 |
+ |
"zlength", '-', |
1248 |
+ |
additional_error)) |
1249 |
+ |
goto failure; |
1250 |
+ |
|
1251 |
+ |
} |
1252 |
|
/* select the first stuntdouble set. */ |
1253 |
|
else if (strcmp (long_options[option_index].name, "sele1") == 0) |
1254 |
|
{ |
1255 |
< |
if (local_args_info.sele1_given) |
1256 |
< |
{ |
1257 |
< |
fprintf (stderr, "%s: `--sele1' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1258 |
< |
goto failure; |
1259 |
< |
} |
1260 |
< |
if (args_info->sele1_given && ! override) |
1261 |
< |
continue; |
1262 |
< |
local_args_info.sele1_given = 1; |
1263 |
< |
args_info->sele1_given = 1; |
1264 |
< |
if (args_info->sele1_arg) |
1057 |
< |
free (args_info->sele1_arg); /* free previous string */ |
1058 |
< |
args_info->sele1_arg = gengetopt_strdup (optarg); |
1059 |
< |
if (args_info->sele1_orig) |
1060 |
< |
free (args_info->sele1_orig); /* free previous string */ |
1061 |
< |
args_info->sele1_orig = gengetopt_strdup (optarg); |
1255 |
> |
|
1256 |
> |
|
1257 |
> |
if (update_arg( (void *)&(args_info->sele1_arg), |
1258 |
> |
&(args_info->sele1_orig), &(args_info->sele1_given), |
1259 |
> |
&(local_args_info.sele1_given), optarg, 0, 0, ARG_STRING, |
1260 |
> |
check_ambiguity, override, 0, 0, |
1261 |
> |
"sele1", '-', |
1262 |
> |
additional_error)) |
1263 |
> |
goto failure; |
1264 |
> |
|
1265 |
|
} |
1266 |
|
/* select the second stuntdouble set. */ |
1267 |
|
else if (strcmp (long_options[option_index].name, "sele2") == 0) |
1268 |
|
{ |
1269 |
< |
if (local_args_info.sele2_given) |
1270 |
< |
{ |
1271 |
< |
fprintf (stderr, "%s: `--sele2' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1272 |
< |
goto failure; |
1273 |
< |
} |
1274 |
< |
if (args_info->sele2_given && ! override) |
1275 |
< |
continue; |
1276 |
< |
local_args_info.sele2_given = 1; |
1277 |
< |
args_info->sele2_given = 1; |
1278 |
< |
if (args_info->sele2_arg) |
1076 |
< |
free (args_info->sele2_arg); /* free previous string */ |
1077 |
< |
args_info->sele2_arg = gengetopt_strdup (optarg); |
1078 |
< |
if (args_info->sele2_orig) |
1079 |
< |
free (args_info->sele2_orig); /* free previous string */ |
1080 |
< |
args_info->sele2_orig = gengetopt_strdup (optarg); |
1269 |
> |
|
1270 |
> |
|
1271 |
> |
if (update_arg( (void *)&(args_info->sele2_arg), |
1272 |
> |
&(args_info->sele2_orig), &(args_info->sele2_given), |
1273 |
> |
&(local_args_info.sele2_given), optarg, 0, 0, ARG_STRING, |
1274 |
> |
check_ambiguity, override, 0, 0, |
1275 |
> |
"sele2", '-', |
1276 |
> |
additional_error)) |
1277 |
> |
goto failure; |
1278 |
> |
|
1279 |
|
} |
1280 |
|
/* select the third stuntdouble set. */ |
1281 |
|
else if (strcmp (long_options[option_index].name, "sele3") == 0) |
1282 |
|
{ |
1283 |
< |
if (local_args_info.sele3_given) |
1284 |
< |
{ |
1285 |
< |
fprintf (stderr, "%s: `--sele3' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1286 |
< |
goto failure; |
1287 |
< |
} |
1288 |
< |
if (args_info->sele3_given && ! override) |
1289 |
< |
continue; |
1290 |
< |
local_args_info.sele3_given = 1; |
1291 |
< |
args_info->sele3_given = 1; |
1292 |
< |
if (args_info->sele3_arg) |
1095 |
< |
free (args_info->sele3_arg); /* free previous string */ |
1096 |
< |
args_info->sele3_arg = gengetopt_strdup (optarg); |
1097 |
< |
if (args_info->sele3_orig) |
1098 |
< |
free (args_info->sele3_orig); /* free previous string */ |
1099 |
< |
args_info->sele3_orig = gengetopt_strdup (optarg); |
1283 |
> |
|
1284 |
> |
|
1285 |
> |
if (update_arg( (void *)&(args_info->sele3_arg), |
1286 |
> |
&(args_info->sele3_orig), &(args_info->sele3_given), |
1287 |
> |
&(local_args_info.sele3_given), optarg, 0, 0, ARG_STRING, |
1288 |
> |
check_ambiguity, override, 0, 0, |
1289 |
> |
"sele3", '-', |
1290 |
> |
additional_error)) |
1291 |
> |
goto failure; |
1292 |
> |
|
1293 |
|
} |
1294 |
|
/* select reference (use and only use with --gxyz). */ |
1295 |
|
else if (strcmp (long_options[option_index].name, "refsele") == 0) |
1296 |
|
{ |
1297 |
< |
if (local_args_info.refsele_given) |
1298 |
< |
{ |
1299 |
< |
fprintf (stderr, "%s: `--refsele' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1300 |
< |
goto failure; |
1301 |
< |
} |
1302 |
< |
if (args_info->refsele_given && ! override) |
1303 |
< |
continue; |
1304 |
< |
local_args_info.refsele_given = 1; |
1305 |
< |
args_info->refsele_given = 1; |
1306 |
< |
if (args_info->refsele_arg) |
1114 |
< |
free (args_info->refsele_arg); /* free previous string */ |
1115 |
< |
args_info->refsele_arg = gengetopt_strdup (optarg); |
1116 |
< |
if (args_info->refsele_orig) |
1117 |
< |
free (args_info->refsele_orig); /* free previous string */ |
1118 |
< |
args_info->refsele_orig = gengetopt_strdup (optarg); |
1297 |
> |
|
1298 |
> |
|
1299 |
> |
if (update_arg( (void *)&(args_info->refsele_arg), |
1300 |
> |
&(args_info->refsele_orig), &(args_info->refsele_given), |
1301 |
> |
&(local_args_info.refsele_given), optarg, 0, 0, ARG_STRING, |
1302 |
> |
check_ambiguity, override, 0, 0, |
1303 |
> |
"refsele", '-', |
1304 |
> |
additional_error)) |
1305 |
> |
goto failure; |
1306 |
> |
|
1307 |
|
} |
1308 |
+ |
/* select stunt doubles for center-of-mass reference point. */ |
1309 |
+ |
else if (strcmp (long_options[option_index].name, "comsele") == 0) |
1310 |
+ |
{ |
1311 |
+ |
|
1312 |
+ |
|
1313 |
+ |
if (update_arg( (void *)&(args_info->comsele_arg), |
1314 |
+ |
&(args_info->comsele_orig), &(args_info->comsele_given), |
1315 |
+ |
&(local_args_info.comsele_given), optarg, 0, 0, ARG_STRING, |
1316 |
+ |
check_ambiguity, override, 0, 0, |
1317 |
+ |
"comsele", '-', |
1318 |
+ |
additional_error)) |
1319 |
+ |
goto failure; |
1320 |
+ |
|
1321 |
+ |
} |
1322 |
+ |
/* global index offset for a second object (used to define a vector between sites in molecule). */ |
1323 |
+ |
else if (strcmp (long_options[option_index].name, "seleoffset") == 0) |
1324 |
+ |
{ |
1325 |
+ |
|
1326 |
+ |
|
1327 |
+ |
if (update_arg( (void *)&(args_info->seleoffset_arg), |
1328 |
+ |
&(args_info->seleoffset_orig), &(args_info->seleoffset_given), |
1329 |
+ |
&(local_args_info.seleoffset_given), optarg, 0, 0, ARG_INT, |
1330 |
+ |
check_ambiguity, override, 0, 0, |
1331 |
+ |
"seleoffset", '-', |
1332 |
+ |
additional_error)) |
1333 |
+ |
goto failure; |
1334 |
+ |
|
1335 |
+ |
} |
1336 |
+ |
/* global index offset for a third object (used to define a vector between sites in molecule). */ |
1337 |
+ |
else if (strcmp (long_options[option_index].name, "seleoffset2") == 0) |
1338 |
+ |
{ |
1339 |
+ |
|
1340 |
+ |
|
1341 |
+ |
if (update_arg( (void *)&(args_info->seleoffset2_arg), |
1342 |
+ |
&(args_info->seleoffset2_orig), &(args_info->seleoffset2_given), |
1343 |
+ |
&(local_args_info.seleoffset2_given), optarg, 0, 0, ARG_INT, |
1344 |
+ |
check_ambiguity, override, 0, 0, |
1345 |
+ |
"seleoffset2", '-', |
1346 |
+ |
additional_error)) |
1347 |
+ |
goto failure; |
1348 |
+ |
|
1349 |
+ |
} |
1350 |
|
/* molecule name. */ |
1351 |
|
else if (strcmp (long_options[option_index].name, "molname") == 0) |
1352 |
|
{ |
1353 |
< |
if (local_args_info.molname_given) |
1354 |
< |
{ |
1355 |
< |
fprintf (stderr, "%s: `--molname' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1356 |
< |
goto failure; |
1357 |
< |
} |
1358 |
< |
if (args_info->molname_given && ! override) |
1359 |
< |
continue; |
1360 |
< |
local_args_info.molname_given = 1; |
1361 |
< |
args_info->molname_given = 1; |
1362 |
< |
if (args_info->molname_arg) |
1133 |
< |
free (args_info->molname_arg); /* free previous string */ |
1134 |
< |
args_info->molname_arg = gengetopt_strdup (optarg); |
1135 |
< |
if (args_info->molname_orig) |
1136 |
< |
free (args_info->molname_orig); /* free previous string */ |
1137 |
< |
args_info->molname_orig = gengetopt_strdup (optarg); |
1353 |
> |
|
1354 |
> |
|
1355 |
> |
if (update_arg( (void *)&(args_info->molname_arg), |
1356 |
> |
&(args_info->molname_orig), &(args_info->molname_given), |
1357 |
> |
&(local_args_info.molname_given), optarg, 0, 0, ARG_STRING, |
1358 |
> |
check_ambiguity, override, 0, 0, |
1359 |
> |
"molname", '-', |
1360 |
> |
additional_error)) |
1361 |
> |
goto failure; |
1362 |
> |
|
1363 |
|
} |
1364 |
|
/* begin internal index. */ |
1365 |
|
else if (strcmp (long_options[option_index].name, "begin") == 0) |
1366 |
|
{ |
1367 |
< |
if (local_args_info.begin_given) |
1368 |
< |
{ |
1369 |
< |
fprintf (stderr, "%s: `--begin' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1370 |
< |
goto failure; |
1371 |
< |
} |
1372 |
< |
if (args_info->begin_given && ! override) |
1373 |
< |
continue; |
1374 |
< |
local_args_info.begin_given = 1; |
1150 |
< |
args_info->begin_given = 1; |
1151 |
< |
args_info->begin_arg = strtol (optarg, &stop_char, 0); |
1152 |
< |
if (!(stop_char && *stop_char == '\0')) { |
1153 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
1367 |
> |
|
1368 |
> |
|
1369 |
> |
if (update_arg( (void *)&(args_info->begin_arg), |
1370 |
> |
&(args_info->begin_orig), &(args_info->begin_given), |
1371 |
> |
&(local_args_info.begin_given), optarg, 0, 0, ARG_INT, |
1372 |
> |
check_ambiguity, override, 0, 0, |
1373 |
> |
"begin", '-', |
1374 |
> |
additional_error)) |
1375 |
|
goto failure; |
1376 |
< |
} |
1156 |
< |
if (args_info->begin_orig) |
1157 |
< |
free (args_info->begin_orig); /* free previous string */ |
1158 |
< |
args_info->begin_orig = gengetopt_strdup (optarg); |
1376 |
> |
|
1377 |
|
} |
1378 |
|
/* end internal index. */ |
1379 |
|
else if (strcmp (long_options[option_index].name, "end") == 0) |
1380 |
|
{ |
1381 |
< |
if (local_args_info.end_given) |
1382 |
< |
{ |
1383 |
< |
fprintf (stderr, "%s: `--end' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1384 |
< |
goto failure; |
1385 |
< |
} |
1386 |
< |
if (args_info->end_given && ! override) |
1387 |
< |
continue; |
1388 |
< |
local_args_info.end_given = 1; |
1171 |
< |
args_info->end_given = 1; |
1172 |
< |
args_info->end_arg = strtol (optarg, &stop_char, 0); |
1173 |
< |
if (!(stop_char && *stop_char == '\0')) { |
1174 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
1381 |
> |
|
1382 |
> |
|
1383 |
> |
if (update_arg( (void *)&(args_info->end_arg), |
1384 |
> |
&(args_info->end_orig), &(args_info->end_given), |
1385 |
> |
&(local_args_info.end_given), optarg, 0, 0, ARG_INT, |
1386 |
> |
check_ambiguity, override, 0, 0, |
1387 |
> |
"end", '-', |
1388 |
> |
additional_error)) |
1389 |
|
goto failure; |
1390 |
< |
} |
1177 |
< |
if (args_info->end_orig) |
1178 |
< |
free (args_info->end_orig); /* free previous string */ |
1179 |
< |
args_info->end_orig = gengetopt_strdup (optarg); |
1390 |
> |
|
1391 |
|
} |
1392 |
|
/* nanoparticle radius. */ |
1393 |
|
else if (strcmp (long_options[option_index].name, "radius") == 0) |
1394 |
|
{ |
1395 |
< |
if (local_args_info.radius_given) |
1396 |
< |
{ |
1397 |
< |
fprintf (stderr, "%s: `--radius' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1398 |
< |
goto failure; |
1399 |
< |
} |
1400 |
< |
if (args_info->radius_given && ! override) |
1401 |
< |
continue; |
1402 |
< |
local_args_info.radius_given = 1; |
1192 |
< |
args_info->radius_given = 1; |
1193 |
< |
args_info->radius_arg = strtod (optarg, &stop_char); |
1194 |
< |
if (!(stop_char && *stop_char == '\0')) { |
1195 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
1395 |
> |
|
1396 |
> |
|
1397 |
> |
if (update_arg( (void *)&(args_info->radius_arg), |
1398 |
> |
&(args_info->radius_orig), &(args_info->radius_given), |
1399 |
> |
&(local_args_info.radius_given), optarg, 0, 0, ARG_DOUBLE, |
1400 |
> |
check_ambiguity, override, 0, 0, |
1401 |
> |
"radius", '-', |
1402 |
> |
additional_error)) |
1403 |
|
goto failure; |
1404 |
< |
} |
1198 |
< |
if (args_info->radius_orig) |
1199 |
< |
free (args_info->radius_orig); /* free previous string */ |
1200 |
< |
args_info->radius_orig = gengetopt_strdup (optarg); |
1404 |
> |
|
1405 |
|
} |
1406 |
+ |
/* Gaussian width (angstroms). */ |
1407 |
+ |
else if (strcmp (long_options[option_index].name, "gaussWidth") == 0) |
1408 |
+ |
{ |
1409 |
+ |
|
1410 |
+ |
|
1411 |
+ |
if (update_arg( (void *)&(args_info->gaussWidth_arg), |
1412 |
+ |
&(args_info->gaussWidth_orig), &(args_info->gaussWidth_given), |
1413 |
+ |
&(local_args_info.gaussWidth_given), optarg, 0, 0, ARG_DOUBLE, |
1414 |
+ |
check_ambiguity, override, 0, 0, |
1415 |
+ |
"gaussWidth", '-', |
1416 |
+ |
additional_error)) |
1417 |
+ |
goto failure; |
1418 |
+ |
|
1419 |
+ |
} |
1420 |
|
/* bond order parameter (--rcut must be specified). */ |
1421 |
|
else if (strcmp (long_options[option_index].name, "bo") == 0) |
1422 |
|
{ |
1423 |
< |
if (local_args_info.bo_given) |
1206 |
< |
{ |
1207 |
< |
fprintf (stderr, "%s: `--bo' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1208 |
< |
goto failure; |
1209 |
< |
} |
1210 |
< |
if (args_info->bo_given && ! override) |
1211 |
< |
continue; |
1212 |
< |
local_args_info.bo_given = 1; |
1213 |
< |
args_info->bo_given = 1; |
1423 |
> |
|
1424 |
|
if (args_info->staticProps_group_counter && override) |
1425 |
|
reset_group_staticProps (args_info); |
1426 |
|
args_info->staticProps_group_counter += 1; |
1427 |
< |
break; |
1427 |
> |
|
1428 |
> |
if (update_arg( 0 , |
1429 |
> |
0 , &(args_info->bo_given), |
1430 |
> |
&(local_args_info.bo_given), optarg, 0, 0, ARG_NO, |
1431 |
> |
check_ambiguity, override, 0, 0, |
1432 |
> |
"bo", '-', |
1433 |
> |
additional_error)) |
1434 |
> |
goto failure; |
1435 |
> |
|
1436 |
|
} |
1437 |
< |
/* bond order parameter as a function of radius (--rcut must be specified). */ |
1438 |
< |
else if (strcmp (long_options[option_index].name, "bor") == 0) |
1437 |
> |
/* icosahedral bond order parameter as a function of radius (--rcut must be specified). */ |
1438 |
> |
else if (strcmp (long_options[option_index].name, "ior") == 0) |
1439 |
|
{ |
1440 |
< |
if (local_args_info.bor_given) |
1223 |
< |
{ |
1224 |
< |
fprintf (stderr, "%s: `--bor' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1225 |
< |
goto failure; |
1226 |
< |
} |
1227 |
< |
if (args_info->bor_given && ! override) |
1228 |
< |
continue; |
1229 |
< |
local_args_info.bor_given = 1; |
1230 |
< |
args_info->bor_given = 1; |
1440 |
> |
|
1441 |
|
if (args_info->staticProps_group_counter && override) |
1442 |
|
reset_group_staticProps (args_info); |
1443 |
|
args_info->staticProps_group_counter += 1; |
1444 |
< |
break; |
1444 |
> |
|
1445 |
> |
if (update_arg( 0 , |
1446 |
> |
0 , &(args_info->ior_given), |
1447 |
> |
&(local_args_info.ior_given), optarg, 0, 0, ARG_NO, |
1448 |
> |
check_ambiguity, override, 0, 0, |
1449 |
> |
"ior", '-', |
1450 |
> |
additional_error)) |
1451 |
> |
goto failure; |
1452 |
> |
|
1453 |
|
} |
1454 |
+ |
/* FCC bond order parameter as a function of radius (--rcut must be specified). */ |
1455 |
+ |
else if (strcmp (long_options[option_index].name, "for") == 0) |
1456 |
+ |
{ |
1457 |
+ |
|
1458 |
+ |
if (args_info->staticProps_group_counter && override) |
1459 |
+ |
reset_group_staticProps (args_info); |
1460 |
+ |
args_info->staticProps_group_counter += 1; |
1461 |
+ |
|
1462 |
+ |
if (update_arg( 0 , |
1463 |
+ |
0 , &(args_info->for_given), |
1464 |
+ |
&(local_args_info.for_given), optarg, 0, 0, ARG_NO, |
1465 |
+ |
check_ambiguity, override, 0, 0, |
1466 |
+ |
"for", '-', |
1467 |
+ |
additional_error)) |
1468 |
+ |
goto failure; |
1469 |
+ |
|
1470 |
+ |
} |
1471 |
|
/* N(theta) bond angle density within (--rcut must be specified). */ |
1472 |
|
else if (strcmp (long_options[option_index].name, "bad") == 0) |
1473 |
|
{ |
1474 |
< |
if (local_args_info.bad_given) |
1240 |
< |
{ |
1241 |
< |
fprintf (stderr, "%s: `--bad' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1242 |
< |
goto failure; |
1243 |
< |
} |
1244 |
< |
if (args_info->bad_given && ! override) |
1245 |
< |
continue; |
1246 |
< |
local_args_info.bad_given = 1; |
1247 |
< |
args_info->bad_given = 1; |
1474 |
> |
|
1475 |
|
if (args_info->staticProps_group_counter && override) |
1476 |
|
reset_group_staticProps (args_info); |
1477 |
|
args_info->staticProps_group_counter += 1; |
1478 |
< |
break; |
1478 |
> |
|
1479 |
> |
if (update_arg( 0 , |
1480 |
> |
0 , &(args_info->bad_given), |
1481 |
> |
&(local_args_info.bad_given), optarg, 0, 0, ARG_NO, |
1482 |
> |
check_ambiguity, override, 0, 0, |
1483 |
> |
"bad", '-', |
1484 |
> |
additional_error)) |
1485 |
> |
goto failure; |
1486 |
> |
|
1487 |
|
} |
1488 |
+ |
/* count of molecules matching selection criteria (and associated statistics). */ |
1489 |
+ |
else if (strcmp (long_options[option_index].name, "count") == 0) |
1490 |
+ |
{ |
1491 |
+ |
|
1492 |
+ |
if (args_info->staticProps_group_counter && override) |
1493 |
+ |
reset_group_staticProps (args_info); |
1494 |
+ |
args_info->staticProps_group_counter += 1; |
1495 |
+ |
|
1496 |
+ |
if (update_arg( 0 , |
1497 |
+ |
0 , &(args_info->count_given), |
1498 |
+ |
&(local_args_info.count_given), optarg, 0, 0, ARG_NO, |
1499 |
+ |
check_ambiguity, override, 0, 0, |
1500 |
+ |
"count", '-', |
1501 |
+ |
additional_error)) |
1502 |
+ |
goto failure; |
1503 |
+ |
|
1504 |
+ |
} |
1505 |
|
/* g(z). */ |
1506 |
|
else if (strcmp (long_options[option_index].name, "gofz") == 0) |
1507 |
|
{ |
1508 |
< |
if (local_args_info.gofz_given) |
1257 |
< |
{ |
1258 |
< |
fprintf (stderr, "%s: `--gofz' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1259 |
< |
goto failure; |
1260 |
< |
} |
1261 |
< |
if (args_info->gofz_given && ! override) |
1262 |
< |
continue; |
1263 |
< |
local_args_info.gofz_given = 1; |
1264 |
< |
args_info->gofz_given = 1; |
1508 |
> |
|
1509 |
|
if (args_info->staticProps_group_counter && override) |
1510 |
|
reset_group_staticProps (args_info); |
1511 |
|
args_info->staticProps_group_counter += 1; |
1512 |
< |
break; |
1512 |
> |
|
1513 |
> |
if (update_arg( 0 , |
1514 |
> |
0 , &(args_info->gofz_given), |
1515 |
> |
&(local_args_info.gofz_given), optarg, 0, 0, ARG_NO, |
1516 |
> |
check_ambiguity, override, 0, 0, |
1517 |
> |
"gofz", '-', |
1518 |
> |
additional_error)) |
1519 |
> |
goto failure; |
1520 |
> |
|
1521 |
|
} |
1522 |
|
/* g(r, cos(theta)). */ |
1523 |
|
else if (strcmp (long_options[option_index].name, "r_theta") == 0) |
1524 |
|
{ |
1525 |
< |
if (local_args_info.r_theta_given) |
1274 |
< |
{ |
1275 |
< |
fprintf (stderr, "%s: `--r_theta' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1276 |
< |
goto failure; |
1277 |
< |
} |
1278 |
< |
if (args_info->r_theta_given && ! override) |
1279 |
< |
continue; |
1280 |
< |
local_args_info.r_theta_given = 1; |
1281 |
< |
args_info->r_theta_given = 1; |
1525 |
> |
|
1526 |
|
if (args_info->staticProps_group_counter && override) |
1527 |
|
reset_group_staticProps (args_info); |
1528 |
|
args_info->staticProps_group_counter += 1; |
1529 |
< |
break; |
1529 |
> |
|
1530 |
> |
if (update_arg( 0 , |
1531 |
> |
0 , &(args_info->r_theta_given), |
1532 |
> |
&(local_args_info.r_theta_given), optarg, 0, 0, ARG_NO, |
1533 |
> |
check_ambiguity, override, 0, 0, |
1534 |
> |
"r_theta", '-', |
1535 |
> |
additional_error)) |
1536 |
> |
goto failure; |
1537 |
> |
|
1538 |
|
} |
1539 |
|
/* g(r, cos(omega)). */ |
1540 |
|
else if (strcmp (long_options[option_index].name, "r_omega") == 0) |
1541 |
|
{ |
1542 |
< |
if (local_args_info.r_omega_given) |
1291 |
< |
{ |
1292 |
< |
fprintf (stderr, "%s: `--r_omega' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1293 |
< |
goto failure; |
1294 |
< |
} |
1295 |
< |
if (args_info->r_omega_given && ! override) |
1296 |
< |
continue; |
1297 |
< |
local_args_info.r_omega_given = 1; |
1298 |
< |
args_info->r_omega_given = 1; |
1542 |
> |
|
1543 |
|
if (args_info->staticProps_group_counter && override) |
1544 |
|
reset_group_staticProps (args_info); |
1545 |
|
args_info->staticProps_group_counter += 1; |
1546 |
< |
break; |
1546 |
> |
|
1547 |
> |
if (update_arg( 0 , |
1548 |
> |
0 , &(args_info->r_omega_given), |
1549 |
> |
&(local_args_info.r_omega_given), optarg, 0, 0, ARG_NO, |
1550 |
> |
check_ambiguity, override, 0, 0, |
1551 |
> |
"r_omega", '-', |
1552 |
> |
additional_error)) |
1553 |
> |
goto failure; |
1554 |
> |
|
1555 |
|
} |
1556 |
+ |
/* g(r, z). */ |
1557 |
+ |
else if (strcmp (long_options[option_index].name, "r_z") == 0) |
1558 |
+ |
{ |
1559 |
+ |
|
1560 |
+ |
if (args_info->staticProps_group_counter && override) |
1561 |
+ |
reset_group_staticProps (args_info); |
1562 |
+ |
args_info->staticProps_group_counter += 1; |
1563 |
+ |
|
1564 |
+ |
if (update_arg( 0 , |
1565 |
+ |
0 , &(args_info->r_z_given), |
1566 |
+ |
&(local_args_info.r_z_given), optarg, 0, 0, ARG_NO, |
1567 |
+ |
check_ambiguity, override, 0, 0, |
1568 |
+ |
"r_z", '-', |
1569 |
+ |
additional_error)) |
1570 |
+ |
goto failure; |
1571 |
+ |
|
1572 |
+ |
} |
1573 |
|
/* g(cos(theta), cos(omega)). */ |
1574 |
|
else if (strcmp (long_options[option_index].name, "theta_omega") == 0) |
1575 |
|
{ |
1576 |
< |
if (local_args_info.theta_omega_given) |
1308 |
< |
{ |
1309 |
< |
fprintf (stderr, "%s: `--theta_omega' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1310 |
< |
goto failure; |
1311 |
< |
} |
1312 |
< |
if (args_info->theta_omega_given && ! override) |
1313 |
< |
continue; |
1314 |
< |
local_args_info.theta_omega_given = 1; |
1315 |
< |
args_info->theta_omega_given = 1; |
1576 |
> |
|
1577 |
|
if (args_info->staticProps_group_counter && override) |
1578 |
|
reset_group_staticProps (args_info); |
1579 |
|
args_info->staticProps_group_counter += 1; |
1580 |
< |
break; |
1580 |
> |
|
1581 |
> |
if (update_arg( 0 , |
1582 |
> |
0 , &(args_info->theta_omega_given), |
1583 |
> |
&(local_args_info.theta_omega_given), optarg, 0, 0, ARG_NO, |
1584 |
> |
check_ambiguity, override, 0, 0, |
1585 |
> |
"theta_omega", '-', |
1586 |
> |
additional_error)) |
1587 |
> |
goto failure; |
1588 |
> |
|
1589 |
|
} |
1590 |
|
/* g(x, y, z). */ |
1591 |
|
else if (strcmp (long_options[option_index].name, "gxyz") == 0) |
1592 |
|
{ |
1593 |
< |
if (local_args_info.gxyz_given) |
1325 |
< |
{ |
1326 |
< |
fprintf (stderr, "%s: `--gxyz' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1327 |
< |
goto failure; |
1328 |
< |
} |
1329 |
< |
if (args_info->gxyz_given && ! override) |
1330 |
< |
continue; |
1331 |
< |
local_args_info.gxyz_given = 1; |
1332 |
< |
args_info->gxyz_given = 1; |
1593 |
> |
|
1594 |
|
if (args_info->staticProps_group_counter && override) |
1595 |
|
reset_group_staticProps (args_info); |
1596 |
|
args_info->staticProps_group_counter += 1; |
1597 |
< |
break; |
1597 |
> |
|
1598 |
> |
if (update_arg( 0 , |
1599 |
> |
0 , &(args_info->gxyz_given), |
1600 |
> |
&(local_args_info.gxyz_given), optarg, 0, 0, ARG_NO, |
1601 |
> |
check_ambiguity, override, 0, 0, |
1602 |
> |
"gxyz", '-', |
1603 |
> |
additional_error)) |
1604 |
> |
goto failure; |
1605 |
> |
|
1606 |
|
} |
1607 |
+ |
/* 2D g(r) (Slab width --dz must be specified). */ |
1608 |
+ |
else if (strcmp (long_options[option_index].name, "twodgofr") == 0) |
1609 |
+ |
{ |
1610 |
+ |
|
1611 |
+ |
if (args_info->staticProps_group_counter && override) |
1612 |
+ |
reset_group_staticProps (args_info); |
1613 |
+ |
args_info->staticProps_group_counter += 1; |
1614 |
+ |
|
1615 |
+ |
if (update_arg( 0 , |
1616 |
+ |
0 , &(args_info->twodgofr_given), |
1617 |
+ |
&(local_args_info.twodgofr_given), optarg, 0, 0, ARG_NO, |
1618 |
+ |
check_ambiguity, override, 0, 0, |
1619 |
+ |
"twodgofr", '-', |
1620 |
+ |
additional_error)) |
1621 |
+ |
goto failure; |
1622 |
+ |
|
1623 |
+ |
} |
1624 |
|
/* rp2 order parameter (--sele1 and --sele2 must be specified). */ |
1625 |
|
else if (strcmp (long_options[option_index].name, "rp2") == 0) |
1626 |
|
{ |
1627 |
< |
if (local_args_info.rp2_given) |
1342 |
< |
{ |
1343 |
< |
fprintf (stderr, "%s: `--rp2' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1344 |
< |
goto failure; |
1345 |
< |
} |
1346 |
< |
if (args_info->rp2_given && ! override) |
1347 |
< |
continue; |
1348 |
< |
local_args_info.rp2_given = 1; |
1349 |
< |
args_info->rp2_given = 1; |
1627 |
> |
|
1628 |
|
if (args_info->staticProps_group_counter && override) |
1629 |
|
reset_group_staticProps (args_info); |
1630 |
|
args_info->staticProps_group_counter += 1; |
1631 |
< |
break; |
1631 |
> |
|
1632 |
> |
if (update_arg( 0 , |
1633 |
> |
0 , &(args_info->rp2_given), |
1634 |
> |
&(local_args_info.rp2_given), optarg, 0, 0, ARG_NO, |
1635 |
> |
check_ambiguity, override, 0, 0, |
1636 |
> |
"rp2", '-', |
1637 |
> |
additional_error)) |
1638 |
> |
goto failure; |
1639 |
> |
|
1640 |
|
} |
1641 |
|
/* slab density. */ |
1642 |
|
else if (strcmp (long_options[option_index].name, "slab_density") == 0) |
1643 |
|
{ |
1644 |
< |
if (local_args_info.slab_density_given) |
1359 |
< |
{ |
1360 |
< |
fprintf (stderr, "%s: `--slab_density' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1361 |
< |
goto failure; |
1362 |
< |
} |
1363 |
< |
if (args_info->slab_density_given && ! override) |
1364 |
< |
continue; |
1365 |
< |
local_args_info.slab_density_given = 1; |
1366 |
< |
args_info->slab_density_given = 1; |
1644 |
> |
|
1645 |
|
if (args_info->staticProps_group_counter && override) |
1646 |
|
reset_group_staticProps (args_info); |
1647 |
|
args_info->staticProps_group_counter += 1; |
1648 |
< |
break; |
1648 |
> |
|
1649 |
> |
if (update_arg( 0 , |
1650 |
> |
0 , &(args_info->slab_density_given), |
1651 |
> |
&(local_args_info.slab_density_given), optarg, 0, 0, ARG_NO, |
1652 |
> |
check_ambiguity, override, 0, 0, |
1653 |
> |
"slab_density", '-', |
1654 |
> |
additional_error)) |
1655 |
> |
goto failure; |
1656 |
> |
|
1657 |
|
} |
1658 |
+ |
/* p(cos(theta)) (--sele1 must be specified, --sele2 is optional). */ |
1659 |
+ |
else if (strcmp (long_options[option_index].name, "p_angle") == 0) |
1660 |
+ |
{ |
1661 |
+ |
|
1662 |
+ |
if (args_info->staticProps_group_counter && override) |
1663 |
+ |
reset_group_staticProps (args_info); |
1664 |
+ |
args_info->staticProps_group_counter += 1; |
1665 |
+ |
|
1666 |
+ |
if (update_arg( 0 , |
1667 |
+ |
0 , &(args_info->p_angle_given), |
1668 |
+ |
&(local_args_info.p_angle_given), optarg, 0, 0, ARG_NO, |
1669 |
+ |
check_ambiguity, override, 0, 0, |
1670 |
+ |
"p_angle", '-', |
1671 |
+ |
additional_error)) |
1672 |
+ |
goto failure; |
1673 |
+ |
|
1674 |
+ |
} |
1675 |
|
/* hxy. */ |
1676 |
|
else if (strcmp (long_options[option_index].name, "hxy") == 0) |
1677 |
|
{ |
1678 |
< |
if (local_args_info.hxy_given) |
1376 |
< |
{ |
1377 |
< |
fprintf (stderr, "%s: `--hxy' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1378 |
< |
goto failure; |
1379 |
< |
} |
1380 |
< |
if (args_info->hxy_given && ! override) |
1381 |
< |
continue; |
1382 |
< |
local_args_info.hxy_given = 1; |
1383 |
< |
args_info->hxy_given = 1; |
1678 |
> |
|
1679 |
|
if (args_info->staticProps_group_counter && override) |
1680 |
|
reset_group_staticProps (args_info); |
1681 |
|
args_info->staticProps_group_counter += 1; |
1682 |
< |
break; |
1682 |
> |
|
1683 |
> |
if (update_arg( 0 , |
1684 |
> |
0 , &(args_info->hxy_given), |
1685 |
> |
&(local_args_info.hxy_given), optarg, 0, 0, ARG_NO, |
1686 |
> |
check_ambiguity, override, 0, 0, |
1687 |
> |
"hxy", '-', |
1688 |
> |
additional_error)) |
1689 |
> |
goto failure; |
1690 |
> |
|
1691 |
|
} |
1692 |
|
/* rho of R. */ |
1693 |
|
else if (strcmp (long_options[option_index].name, "rho_r") == 0) |
1694 |
|
{ |
1695 |
< |
if (local_args_info.rho_r_given) |
1393 |
< |
{ |
1394 |
< |
fprintf (stderr, "%s: `--rho_r' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1395 |
< |
goto failure; |
1396 |
< |
} |
1397 |
< |
if (args_info->rho_r_given && ! override) |
1398 |
< |
continue; |
1399 |
< |
local_args_info.rho_r_given = 1; |
1400 |
< |
args_info->rho_r_given = 1; |
1695 |
> |
|
1696 |
|
if (args_info->staticProps_group_counter && override) |
1697 |
|
reset_group_staticProps (args_info); |
1698 |
|
args_info->staticProps_group_counter += 1; |
1699 |
< |
break; |
1699 |
> |
|
1700 |
> |
if (update_arg( 0 , |
1701 |
> |
0 , &(args_info->rho_r_given), |
1702 |
> |
&(local_args_info.rho_r_given), optarg, 0, 0, ARG_NO, |
1703 |
> |
check_ambiguity, override, 0, 0, |
1704 |
> |
"rho_r", '-', |
1705 |
> |
additional_error)) |
1706 |
> |
goto failure; |
1707 |
> |
|
1708 |
|
} |
1709 |
+ |
/* angle of R. */ |
1710 |
+ |
else if (strcmp (long_options[option_index].name, "angle_r") == 0) |
1711 |
+ |
{ |
1712 |
+ |
|
1713 |
+ |
if (args_info->staticProps_group_counter && override) |
1714 |
+ |
reset_group_staticProps (args_info); |
1715 |
+ |
args_info->staticProps_group_counter += 1; |
1716 |
+ |
|
1717 |
+ |
if (update_arg( 0 , |
1718 |
+ |
0 , &(args_info->angle_r_given), |
1719 |
+ |
&(local_args_info.angle_r_given), optarg, 0, 0, ARG_NO, |
1720 |
+ |
check_ambiguity, override, 0, 0, |
1721 |
+ |
"angle_r", '-', |
1722 |
+ |
additional_error)) |
1723 |
+ |
goto failure; |
1724 |
+ |
|
1725 |
+ |
} |
1726 |
|
/* hull volume of nanoparticle. */ |
1727 |
|
else if (strcmp (long_options[option_index].name, "hullvol") == 0) |
1728 |
|
{ |
1729 |
< |
if (local_args_info.hullvol_given) |
1410 |
< |
{ |
1411 |
< |
fprintf (stderr, "%s: `--hullvol' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1412 |
< |
goto failure; |
1413 |
< |
} |
1414 |
< |
if (args_info->hullvol_given && ! override) |
1415 |
< |
continue; |
1416 |
< |
local_args_info.hullvol_given = 1; |
1417 |
< |
args_info->hullvol_given = 1; |
1729 |
> |
|
1730 |
|
if (args_info->staticProps_group_counter && override) |
1731 |
|
reset_group_staticProps (args_info); |
1732 |
|
args_info->staticProps_group_counter += 1; |
1733 |
< |
break; |
1733 |
> |
|
1734 |
> |
if (update_arg( 0 , |
1735 |
> |
0 , &(args_info->hullvol_given), |
1736 |
> |
&(local_args_info.hullvol_given), optarg, 0, 0, ARG_NO, |
1737 |
> |
check_ambiguity, override, 0, 0, |
1738 |
> |
"hullvol", '-', |
1739 |
> |
additional_error)) |
1740 |
> |
goto failure; |
1741 |
> |
|
1742 |
|
} |
1743 |
+ |
/* length of nanorod. */ |
1744 |
+ |
else if (strcmp (long_options[option_index].name, "rodlength") == 0) |
1745 |
+ |
{ |
1746 |
|
|
1747 |
+ |
if (args_info->staticProps_group_counter && override) |
1748 |
+ |
reset_group_staticProps (args_info); |
1749 |
+ |
args_info->staticProps_group_counter += 1; |
1750 |
+ |
|
1751 |
+ |
if (update_arg( 0 , |
1752 |
+ |
0 , &(args_info->rodlength_given), |
1753 |
+ |
&(local_args_info.rodlength_given), optarg, 0, 0, ARG_NO, |
1754 |
+ |
check_ambiguity, override, 0, 0, |
1755 |
+ |
"rodlength", '-', |
1756 |
+ |
additional_error)) |
1757 |
+ |
goto failure; |
1758 |
+ |
|
1759 |
+ |
} |
1760 |
+ |
/* spatially-resolved tetrahedrality order parameter Qk(z). */ |
1761 |
+ |
else if (strcmp (long_options[option_index].name, "tet_param_z") == 0) |
1762 |
+ |
{ |
1763 |
+ |
|
1764 |
+ |
if (args_info->staticProps_group_counter && override) |
1765 |
+ |
reset_group_staticProps (args_info); |
1766 |
+ |
args_info->staticProps_group_counter += 1; |
1767 |
+ |
|
1768 |
+ |
if (update_arg( 0 , |
1769 |
+ |
0 , &(args_info->tet_param_z_given), |
1770 |
+ |
&(local_args_info.tet_param_z_given), optarg, 0, 0, ARG_NO, |
1771 |
+ |
check_ambiguity, override, 0, 0, |
1772 |
+ |
"tet_param_z", '-', |
1773 |
+ |
additional_error)) |
1774 |
+ |
goto failure; |
1775 |
+ |
|
1776 |
+ |
} |
1777 |
+ |
/* volume-resolved tetrahedrality order parameter Qk(x,y,z). (voxelSize, rcut, and gaussWidth must be specified). */ |
1778 |
+ |
else if (strcmp (long_options[option_index].name, "tet_param_xyz") == 0) |
1779 |
+ |
{ |
1780 |
+ |
|
1781 |
+ |
if (args_info->staticProps_group_counter && override) |
1782 |
+ |
reset_group_staticProps (args_info); |
1783 |
+ |
args_info->staticProps_group_counter += 1; |
1784 |
+ |
|
1785 |
+ |
if (update_arg( 0 , |
1786 |
+ |
0 , &(args_info->tet_param_xyz_given), |
1787 |
+ |
&(local_args_info.tet_param_xyz_given), optarg, 0, 0, ARG_NO, |
1788 |
+ |
check_ambiguity, override, 0, 0, |
1789 |
+ |
"tet_param_xyz", '-', |
1790 |
+ |
additional_error)) |
1791 |
+ |
goto failure; |
1792 |
+ |
|
1793 |
+ |
} |
1794 |
+ |
/* slab-resolved RNEMD statistics (temperature, density, velocity). */ |
1795 |
+ |
else if (strcmp (long_options[option_index].name, "rnemdz") == 0) |
1796 |
+ |
{ |
1797 |
+ |
|
1798 |
+ |
if (args_info->staticProps_group_counter && override) |
1799 |
+ |
reset_group_staticProps (args_info); |
1800 |
+ |
args_info->staticProps_group_counter += 1; |
1801 |
+ |
|
1802 |
+ |
if (update_arg( 0 , |
1803 |
+ |
0 , &(args_info->rnemdz_given), |
1804 |
+ |
&(local_args_info.rnemdz_given), optarg, 0, 0, ARG_NO, |
1805 |
+ |
check_ambiguity, override, 0, 0, |
1806 |
+ |
"rnemdz", '-', |
1807 |
+ |
additional_error)) |
1808 |
+ |
goto failure; |
1809 |
+ |
|
1810 |
+ |
} |
1811 |
+ |
/* shell-resolved RNEMD statistics (temperature, density, angular velocity). */ |
1812 |
+ |
else if (strcmp (long_options[option_index].name, "rnemdr") == 0) |
1813 |
+ |
{ |
1814 |
+ |
|
1815 |
+ |
if (args_info->staticProps_group_counter && override) |
1816 |
+ |
reset_group_staticProps (args_info); |
1817 |
+ |
args_info->staticProps_group_counter += 1; |
1818 |
+ |
|
1819 |
+ |
if (update_arg( 0 , |
1820 |
+ |
0 , &(args_info->rnemdr_given), |
1821 |
+ |
&(local_args_info.rnemdr_given), optarg, 0, 0, ARG_NO, |
1822 |
+ |
check_ambiguity, override, 0, 0, |
1823 |
+ |
"rnemdr", '-', |
1824 |
+ |
additional_error)) |
1825 |
+ |
goto failure; |
1826 |
+ |
|
1827 |
+ |
} |
1828 |
+ |
/* shell and angle-resolved RNEMD statistics (temperature, density, angular velocity). */ |
1829 |
+ |
else if (strcmp (long_options[option_index].name, "rnemdrt") == 0) |
1830 |
+ |
{ |
1831 |
+ |
|
1832 |
+ |
if (args_info->staticProps_group_counter && override) |
1833 |
+ |
reset_group_staticProps (args_info); |
1834 |
+ |
args_info->staticProps_group_counter += 1; |
1835 |
+ |
|
1836 |
+ |
if (update_arg( 0 , |
1837 |
+ |
0 , &(args_info->rnemdrt_given), |
1838 |
+ |
&(local_args_info.rnemdrt_given), optarg, 0, 0, ARG_NO, |
1839 |
+ |
check_ambiguity, override, 0, 0, |
1840 |
+ |
"rnemdrt", '-', |
1841 |
+ |
additional_error)) |
1842 |
+ |
goto failure; |
1843 |
+ |
|
1844 |
+ |
} |
1845 |
+ |
/* electrostatic potential to frequency map based on the Cho nitrile fits. */ |
1846 |
+ |
else if (strcmp (long_options[option_index].name, "nitrile") == 0) |
1847 |
+ |
{ |
1848 |
+ |
|
1849 |
+ |
if (args_info->staticProps_group_counter && override) |
1850 |
+ |
reset_group_staticProps (args_info); |
1851 |
+ |
args_info->staticProps_group_counter += 1; |
1852 |
+ |
|
1853 |
+ |
if (update_arg( 0 , |
1854 |
+ |
0 , &(args_info->nitrile_given), |
1855 |
+ |
&(local_args_info.nitrile_given), optarg, 0, 0, ARG_NO, |
1856 |
+ |
check_ambiguity, override, 0, 0, |
1857 |
+ |
"nitrile", '-', |
1858 |
+ |
additional_error)) |
1859 |
+ |
goto failure; |
1860 |
+ |
|
1861 |
+ |
} |
1862 |
+ |
|
1863 |
|
break; |
1864 |
|
case '?': /* Invalid option. */ |
1865 |
|
/* `getopt_long' already printed an error message. */ |
1873 |
|
|
1874 |
|
if (args_info->staticProps_group_counter > 1) |
1875 |
|
{ |
1876 |
< |
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 : "")); |
1876 |
> |
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 : "")); |
1877 |
|
error = 1; |
1878 |
|
} |
1879 |
|
|