ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/applications/staticProps/StaticPropsCmd.cpp
(Generate patch)

Comparing:
trunk/src/applications/staticProps/StaticPropsCmd.c (file contents), Revision 1454 by gezelter, Wed Jun 23 19:25:02 2010 UTC vs.
trunk/src/applications/staticProps/StaticPropsCmd.cpp (file contents), Revision 2031 by jmichalk, Fri Oct 31 18:40:40 2014 UTC

# Line 1 | Line 1
1   /*
2 <  File autogenerated by gengetopt version 2.22
2 >  File autogenerated by gengetopt version 2.22.4
3    generated with the following command:
4 <  gengetopt -F StaticPropsCmd -u
4 >  gengetopt -i StaticProps.ggo -F StaticPropsCmd -c cpp
5  
6    The developers of gengetopt consider the fixed text that goes in all
7    gengetopt output files to be in the public domain:
# Line 17 | Line 17
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 + #include <getopt.h>
25 +
26   #include "StaticPropsCmd.h"
27  
28   const char *gengetopt_args_info_purpose = "";
29  
30 < const char *gengetopt_args_info_usage = "Usage: StaticProps [OPTIONS]... [FILES]...";
30 > const char *gengetopt_args_info_usage = "Usage: StaticProps [OPTIONS]...";
31  
32   const char *gengetopt_args_info_description = "";
33  
# Line 48 | Line 52 | const char *gengetopt_args_info_help[] = {
52    "      --sele3=selection script  select the third stuntdouble set",
53    "      --refsele=selection script\n                                select reference (use and only use with --gxyz)",
54    "      --comsele=selection script\n                                select stunt doubles for center-of-mass \n                                  reference point",
55 +  "      --seleoffset=INT          global index offset for a second object (used \n                                  to define a vector between sites in molecule)",
56 +  "      --seleoffset2=INT         global index offset for a third object (used to \n                                  define a vector between sites in molecule)",
57    "      --molname=STRING          molecule name",
58    "      --begin=INT               begin internal index",
59    "      --end=INT                 end internal index",
60    "      --radius=DOUBLE           nanoparticle radius",
61 +  "  -v, --voxelSize=DOUBLE        voxel size (angstroms)",
62 +  "      --gaussWidth=DOUBLE       Gaussian width (angstroms)",
63    "\n Group: staticProps\n   an option of this group is required",
64    "      --bo                      bond order parameter (--rcut must be specified)",
65 <  "      --bor                     bond order parameter as a function of radius \n                                  (--rcut must be specified)",
65 >  "      --ior                     icosahedral bond order parameter as a function \n                                  of radius (--rcut must be specified)",
66 >  "      --for                     FCC bond order parameter as a function of \n                                  radius (--rcut must be specified)",
67    "      --bad                     N(theta) bond angle density within (--rcut must \n                                  be specified)",
68 +  "      --count                   count of molecules matching selection criteria \n                                  (and associated statistics)",
69    "  -g, --gofr                    g(r)",
70    "      --gofz                    g(z)",
71    "      --r_theta                 g(r, cos(theta))",
# Line 64 | Line 74 | const char *gengetopt_args_info_help[] = {
74    "      --theta_omega             g(cos(theta), cos(omega))",
75    "      --gxyz                    g(x, y, z)",
76    "      --twodgofr                2D g(r) (Slab width --dz must be specified)",
77 <  "  -p, --p2                      p2 order parameter (--sele1 and --sele2 must be \n                                  specified)",
77 >  "  -p, --p2                      p2 order parameter (--sele1 must be specified, \n                                  --sele2 is optional)",
78    "      --rp2                     rp2 order parameter (--sele1 and --sele2 must \n                                  be specified)",
79    "  -s, --scd                     scd order parameter (either --sele1, --sele2, \n                                  --sele3 are specified or --molname, --begin, \n                                  --end are specified)",
80    "  -d, --density                 density plot",
81    "      --slab_density            slab density",
82 <  "      --p_angle                 p(cos(theta))",
82 >  "      --p_angle                 p(cos(theta)) (--sele1 must be specified, \n                                  --sele2 is optional)",
83    "      --hxy                     hxy",
84    "      --rho_r                   rho of R",
85 +  "      --angle_r                 angle of R",
86    "      --hullvol                 hull volume of nanoparticle",
87 +  "      --rodlength               length of nanorod",
88 +  "  -Q, --tet_param               tetrahedrality order parameter (Qk)",
89 +  "      --tet_param_z             spatially-resolved tetrahedrality order \n                                  parameter Qk(z)",
90 +  "      --tet_param_xyz           volume-resolved tetrahedrality order parameter \n                                  Qk(x,y,z).  (voxelSize, rcut, and gaussWidth \n                                  must be specified)",
91 +  "      --rnemdz                  slab-resolved RNEMD statistics (temperature, \n                                  density, velocity)",
92 +  "      --rnemdr                  shell-resolved RNEMD statistics (temperature, \n                                  density, angular velocity)",
93 +  "      --rnemdrt                 shell and angle-resolved RNEMD statistics \n                                  (temperature, density, angular velocity)",
94 +  "      --nitrile                 electrostatic potential to frequency map based \n                                  on the Cho nitrile fits",
95 +  "  -m, --multipole               average multipole moments contained within \n                                  cutoff spheres as a function of radius",
96 +  "      --surfDiffusion           X, Y, and R (surface diffusion if Z exposed and \n                                  bulk immobile) diffusion",
97      0
98   };
99  
# Line 88 | Line 109 | static int
109   void clear_args (struct gengetopt_args_info *args_info);
110  
111   static int
112 < cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info,
112 > cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info,
113                          struct cmdline_parser_params *params, const char *additional_error);
114  
115   static int
# Line 120 | Line 141 | void clear_given (struct gengetopt_args_info *args_inf
141    args_info->sele3_given = 0 ;
142    args_info->refsele_given = 0 ;
143    args_info->comsele_given = 0 ;
144 +  args_info->seleoffset_given = 0 ;
145 +  args_info->seleoffset2_given = 0 ;
146    args_info->molname_given = 0 ;
147    args_info->begin_given = 0 ;
148    args_info->end_given = 0 ;
149    args_info->radius_given = 0 ;
150 +  args_info->voxelSize_given = 0 ;
151 +  args_info->gaussWidth_given = 0 ;
152    args_info->bo_given = 0 ;
153 <  args_info->bor_given = 0 ;
153 >  args_info->ior_given = 0 ;
154 >  args_info->for_given = 0 ;
155    args_info->bad_given = 0 ;
156 +  args_info->count_given = 0 ;
157    args_info->gofr_given = 0 ;
158    args_info->gofz_given = 0 ;
159    args_info->r_theta_given = 0 ;
# Line 143 | Line 170 | void clear_given (struct gengetopt_args_info *args_inf
170    args_info->p_angle_given = 0 ;
171    args_info->hxy_given = 0 ;
172    args_info->rho_r_given = 0 ;
173 +  args_info->angle_r_given = 0 ;
174    args_info->hullvol_given = 0 ;
175 +  args_info->rodlength_given = 0 ;
176 +  args_info->tet_param_given = 0 ;
177 +  args_info->tet_param_z_given = 0 ;
178 +  args_info->tet_param_xyz_given = 0 ;
179 +  args_info->rnemdz_given = 0 ;
180 +  args_info->rnemdr_given = 0 ;
181 +  args_info->rnemdrt_given = 0 ;
182 +  args_info->nitrile_given = 0 ;
183 +  args_info->multipole_given = 0 ;
184 +  args_info->surfDiffusion_given = 0 ;
185    args_info->staticProps_group_counter = 0 ;
186   }
187  
188   static
189   void clear_args (struct gengetopt_args_info *args_info)
190   {
191 +  FIX_UNUSED (args_info);
192    args_info->input_arg = NULL;
193    args_info->input_orig = NULL;
194    args_info->output_arg = NULL;
# Line 182 | Line 221 | void clear_args (struct gengetopt_args_info *args_info
221    args_info->refsele_orig = NULL;
222    args_info->comsele_arg = NULL;
223    args_info->comsele_orig = NULL;
224 +  args_info->seleoffset_orig = NULL;
225 +  args_info->seleoffset2_orig = NULL;
226    args_info->molname_arg = NULL;
227    args_info->molname_orig = NULL;
228    args_info->begin_orig = NULL;
229    args_info->end_orig = NULL;
230    args_info->radius_orig = NULL;
231 +  args_info->voxelSize_orig = NULL;
232 +  args_info->gaussWidth_orig = NULL;
233    
234   }
235  
# Line 215 | Line 258 | void init_args_info(struct gengetopt_args_info *args_i
258    args_info->sele3_help = gengetopt_args_info_help[17] ;
259    args_info->refsele_help = gengetopt_args_info_help[18] ;
260    args_info->comsele_help = gengetopt_args_info_help[19] ;
261 <  args_info->molname_help = gengetopt_args_info_help[20] ;
262 <  args_info->begin_help = gengetopt_args_info_help[21] ;
263 <  args_info->end_help = gengetopt_args_info_help[22] ;
264 <  args_info->radius_help = gengetopt_args_info_help[23] ;
265 <  args_info->bo_help = gengetopt_args_info_help[25] ;
266 <  args_info->bor_help = gengetopt_args_info_help[26] ;
267 <  args_info->bad_help = gengetopt_args_info_help[27] ;
268 <  args_info->gofr_help = gengetopt_args_info_help[28] ;
269 <  args_info->gofz_help = gengetopt_args_info_help[29] ;
270 <  args_info->r_theta_help = gengetopt_args_info_help[30] ;
271 <  args_info->r_omega_help = gengetopt_args_info_help[31] ;
272 <  args_info->r_z_help = gengetopt_args_info_help[32] ;
273 <  args_info->theta_omega_help = gengetopt_args_info_help[33] ;
274 <  args_info->gxyz_help = gengetopt_args_info_help[34] ;
275 <  args_info->twodgofr_help = gengetopt_args_info_help[35] ;
276 <  args_info->p2_help = gengetopt_args_info_help[36] ;
277 <  args_info->rp2_help = gengetopt_args_info_help[37] ;
278 <  args_info->scd_help = gengetopt_args_info_help[38] ;
279 <  args_info->density_help = gengetopt_args_info_help[39] ;
280 <  args_info->slab_density_help = gengetopt_args_info_help[40] ;
281 <  args_info->p_angle_help = gengetopt_args_info_help[41] ;
282 <  args_info->hxy_help = gengetopt_args_info_help[42] ;
283 <  args_info->rho_r_help = gengetopt_args_info_help[43] ;
284 <  args_info->hullvol_help = gengetopt_args_info_help[44] ;
261 >  args_info->seleoffset_help = gengetopt_args_info_help[20] ;
262 >  args_info->seleoffset2_help = gengetopt_args_info_help[21] ;
263 >  args_info->molname_help = gengetopt_args_info_help[22] ;
264 >  args_info->begin_help = gengetopt_args_info_help[23] ;
265 >  args_info->end_help = gengetopt_args_info_help[24] ;
266 >  args_info->radius_help = gengetopt_args_info_help[25] ;
267 >  args_info->voxelSize_help = gengetopt_args_info_help[26] ;
268 >  args_info->gaussWidth_help = gengetopt_args_info_help[27] ;
269 >  args_info->bo_help = gengetopt_args_info_help[29] ;
270 >  args_info->ior_help = gengetopt_args_info_help[30] ;
271 >  args_info->for_help = gengetopt_args_info_help[31] ;
272 >  args_info->bad_help = gengetopt_args_info_help[32] ;
273 >  args_info->count_help = gengetopt_args_info_help[33] ;
274 >  args_info->gofr_help = gengetopt_args_info_help[34] ;
275 >  args_info->gofz_help = gengetopt_args_info_help[35] ;
276 >  args_info->r_theta_help = gengetopt_args_info_help[36] ;
277 >  args_info->r_omega_help = gengetopt_args_info_help[37] ;
278 >  args_info->r_z_help = gengetopt_args_info_help[38] ;
279 >  args_info->theta_omega_help = gengetopt_args_info_help[39] ;
280 >  args_info->gxyz_help = gengetopt_args_info_help[40] ;
281 >  args_info->twodgofr_help = gengetopt_args_info_help[41] ;
282 >  args_info->p2_help = gengetopt_args_info_help[42] ;
283 >  args_info->rp2_help = gengetopt_args_info_help[43] ;
284 >  args_info->scd_help = gengetopt_args_info_help[44] ;
285 >  args_info->density_help = gengetopt_args_info_help[45] ;
286 >  args_info->slab_density_help = gengetopt_args_info_help[46] ;
287 >  args_info->p_angle_help = gengetopt_args_info_help[47] ;
288 >  args_info->hxy_help = gengetopt_args_info_help[48] ;
289 >  args_info->rho_r_help = gengetopt_args_info_help[49] ;
290 >  args_info->angle_r_help = gengetopt_args_info_help[50] ;
291 >  args_info->hullvol_help = gengetopt_args_info_help[51] ;
292 >  args_info->rodlength_help = gengetopt_args_info_help[52] ;
293 >  args_info->tet_param_help = gengetopt_args_info_help[53] ;
294 >  args_info->tet_param_z_help = gengetopt_args_info_help[54] ;
295 >  args_info->tet_param_xyz_help = gengetopt_args_info_help[55] ;
296 >  args_info->rnemdz_help = gengetopt_args_info_help[56] ;
297 >  args_info->rnemdr_help = gengetopt_args_info_help[57] ;
298 >  args_info->rnemdrt_help = gengetopt_args_info_help[58] ;
299 >  args_info->nitrile_help = gengetopt_args_info_help[59] ;
300 >  args_info->multipole_help = gengetopt_args_info_help[60] ;
301 >  args_info->surfDiffusion_help = gengetopt_args_info_help[61] ;
302    
303   }
304  
305   void
306   cmdline_parser_print_version (void)
307   {
308 <  printf ("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION);
308 >  printf ("%s %s\n",
309 >     (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE),
310 >     CMDLINE_PARSER_VERSION);
311   }
312  
313   static void print_help_common(void) {
# Line 260 | Line 322 | static void print_help_common(void) {
322    printf("\n");
323  
324    if (strlen(gengetopt_args_info_description) > 0)
325 <    printf("%s\n", gengetopt_args_info_description);
325 >    printf("%s\n\n", gengetopt_args_info_description);
326   }
327  
328   void
# Line 278 | Line 340 | cmdline_parser_init (struct gengetopt_args_info *args_
340    clear_given (args_info);
341    clear_args (args_info);
342    init_args_info (args_info);
281
282  args_info->inputs = NULL;
283  args_info->inputs_num = 0;
343   }
344  
345   void
# Line 319 | Line 378 | cmdline_parser_release (struct gengetopt_args_info *ar
378   static void
379   cmdline_parser_release (struct gengetopt_args_info *args_info)
380   {
381 <  unsigned int i;
381 >
382    free_string_field (&(args_info->input_arg));
383    free_string_field (&(args_info->input_orig));
384    free_string_field (&(args_info->output_arg));
# Line 345 | Line 404 | cmdline_parser_release (struct gengetopt_args_info *ar
404    free_string_field (&(args_info->refsele_orig));
405    free_string_field (&(args_info->comsele_arg));
406    free_string_field (&(args_info->comsele_orig));
407 +  free_string_field (&(args_info->seleoffset_orig));
408 +  free_string_field (&(args_info->seleoffset2_orig));
409    free_string_field (&(args_info->molname_arg));
410    free_string_field (&(args_info->molname_orig));
411    free_string_field (&(args_info->begin_orig));
412    free_string_field (&(args_info->end_orig));
413    free_string_field (&(args_info->radius_orig));
414 +  free_string_field (&(args_info->voxelSize_orig));
415 +  free_string_field (&(args_info->gaussWidth_orig));
416    
417    
355  for (i = 0; i < args_info->inputs_num; ++i)
356    free (args_info->inputs [i]);
418  
358  if (args_info->inputs_num)
359    free (args_info->inputs);
360
419    clear_given (args_info);
420   }
421  
422  
423   static void
424 < write_into_file(FILE *outfile, const char *opt, const char *arg, char *values[])
424 > write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[])
425   {
426 +  FIX_UNUSED (values);
427    if (arg) {
428      fprintf(outfile, "%s=\"%s\"\n", opt, arg);
429    } else {
# Line 424 | Line 483 | cmdline_parser_dump(FILE *outfile, struct gengetopt_ar
483      write_into_file(outfile, "refsele", args_info->refsele_orig, 0);
484    if (args_info->comsele_given)
485      write_into_file(outfile, "comsele", args_info->comsele_orig, 0);
486 +  if (args_info->seleoffset_given)
487 +    write_into_file(outfile, "seleoffset", args_info->seleoffset_orig, 0);
488 +  if (args_info->seleoffset2_given)
489 +    write_into_file(outfile, "seleoffset2", args_info->seleoffset2_orig, 0);
490    if (args_info->molname_given)
491      write_into_file(outfile, "molname", args_info->molname_orig, 0);
492    if (args_info->begin_given)
# Line 432 | Line 495 | cmdline_parser_dump(FILE *outfile, struct gengetopt_ar
495      write_into_file(outfile, "end", args_info->end_orig, 0);
496    if (args_info->radius_given)
497      write_into_file(outfile, "radius", args_info->radius_orig, 0);
498 +  if (args_info->voxelSize_given)
499 +    write_into_file(outfile, "voxelSize", args_info->voxelSize_orig, 0);
500 +  if (args_info->gaussWidth_given)
501 +    write_into_file(outfile, "gaussWidth", args_info->gaussWidth_orig, 0);
502    if (args_info->bo_given)
503      write_into_file(outfile, "bo", 0, 0 );
504 <  if (args_info->bor_given)
505 <    write_into_file(outfile, "bor", 0, 0 );
504 >  if (args_info->ior_given)
505 >    write_into_file(outfile, "ior", 0, 0 );
506 >  if (args_info->for_given)
507 >    write_into_file(outfile, "for", 0, 0 );
508    if (args_info->bad_given)
509      write_into_file(outfile, "bad", 0, 0 );
510 +  if (args_info->count_given)
511 +    write_into_file(outfile, "count", 0, 0 );
512    if (args_info->gofr_given)
513      write_into_file(outfile, "gofr", 0, 0 );
514    if (args_info->gofz_given)
# Line 470 | Line 541 | cmdline_parser_dump(FILE *outfile, struct gengetopt_ar
541      write_into_file(outfile, "hxy", 0, 0 );
542    if (args_info->rho_r_given)
543      write_into_file(outfile, "rho_r", 0, 0 );
544 +  if (args_info->angle_r_given)
545 +    write_into_file(outfile, "angle_r", 0, 0 );
546    if (args_info->hullvol_given)
547      write_into_file(outfile, "hullvol", 0, 0 );
548 +  if (args_info->rodlength_given)
549 +    write_into_file(outfile, "rodlength", 0, 0 );
550 +  if (args_info->tet_param_given)
551 +    write_into_file(outfile, "tet_param", 0, 0 );
552 +  if (args_info->tet_param_z_given)
553 +    write_into_file(outfile, "tet_param_z", 0, 0 );
554 +  if (args_info->tet_param_xyz_given)
555 +    write_into_file(outfile, "tet_param_xyz", 0, 0 );
556 +  if (args_info->rnemdz_given)
557 +    write_into_file(outfile, "rnemdz", 0, 0 );
558 +  if (args_info->rnemdr_given)
559 +    write_into_file(outfile, "rnemdr", 0, 0 );
560 +  if (args_info->rnemdrt_given)
561 +    write_into_file(outfile, "rnemdrt", 0, 0 );
562 +  if (args_info->nitrile_given)
563 +    write_into_file(outfile, "nitrile", 0, 0 );
564 +  if (args_info->multipole_given)
565 +    write_into_file(outfile, "multipole", 0, 0 );
566 +  if (args_info->surfDiffusion_given)
567 +    write_into_file(outfile, "surfDiffusion", 0, 0 );
568    
569  
570    i = EXIT_SUCCESS;
# Line 508 | Line 601 | gengetopt_strdup (const char *s)
601   char *
602   gengetopt_strdup (const char *s)
603   {
604 <  char *result = NULL;
604 >  char *result = 0;
605    if (!s)
606      return result;
607  
# Line 526 | Line 619 | reset_group_staticProps(struct gengetopt_args_info *ar
619      return;
620    
621    args_info->bo_given = 0 ;
622 <  args_info->bor_given = 0 ;
622 >  args_info->ior_given = 0 ;
623 >  args_info->for_given = 0 ;
624    args_info->bad_given = 0 ;
625 +  args_info->count_given = 0 ;
626    args_info->gofr_given = 0 ;
627    args_info->gofz_given = 0 ;
628    args_info->r_theta_given = 0 ;
# Line 544 | Line 639 | reset_group_staticProps(struct gengetopt_args_info *ar
639    args_info->p_angle_given = 0 ;
640    args_info->hxy_given = 0 ;
641    args_info->rho_r_given = 0 ;
642 +  args_info->angle_r_given = 0 ;
643    args_info->hullvol_given = 0 ;
644 +  args_info->rodlength_given = 0 ;
645 +  args_info->tet_param_given = 0 ;
646 +  args_info->tet_param_z_given = 0 ;
647 +  args_info->tet_param_xyz_given = 0 ;
648 +  args_info->rnemdz_given = 0 ;
649 +  args_info->rnemdr_given = 0 ;
650 +  args_info->rnemdrt_given = 0 ;
651 +  args_info->nitrile_given = 0 ;
652 +  args_info->multipole_given = 0 ;
653 +  args_info->surfDiffusion_given = 0 ;
654  
655    args_info->staticProps_group_counter = 0;
656   }
657  
658   int
659 < cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_info)
659 > cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info)
660   {
661    return cmdline_parser2 (argc, argv, args_info, 0, 1, 1);
662   }
663  
664   int
665 < cmdline_parser_ext (int argc, char * const *argv, struct gengetopt_args_info *args_info,
665 > cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info,
666                     struct cmdline_parser_params *params)
667   {
668    int result;
669 <  result = cmdline_parser_internal (argc, argv, args_info, params, NULL);
669 >  result = cmdline_parser_internal (argc, argv, args_info, params, 0);
670  
671    if (result == EXIT_FAILURE)
672      {
# Line 572 | Line 678 | int
678   }
679  
680   int
681 < cmdline_parser2 (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
681 > cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
682   {
683    int result;
684    struct cmdline_parser_params params;
# Line 583 | Line 689 | cmdline_parser2 (int argc, char * const *argv, struct
689    params.check_ambiguity = 0;
690    params.print_errors = 1;
691  
692 <  result = cmdline_parser_internal (argc, argv, args_info, &params, NULL);
692 >  result = cmdline_parser_internal (argc, argv, args_info, &params, 0);
693  
694    if (result == EXIT_FAILURE)
695      {
# Line 599 | Line 705 | cmdline_parser_required (struct gengetopt_args_info *a
705   {
706    int result = EXIT_SUCCESS;
707  
708 <  if (cmdline_parser_required2(args_info, prog_name, NULL) > 0)
708 >  if (cmdline_parser_required2(args_info, prog_name, 0) > 0)
709      result = EXIT_FAILURE;
710  
711    if (result == EXIT_FAILURE)
# Line 615 | Line 721 | cmdline_parser_required2 (struct gengetopt_args_info *
721   cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error)
722   {
723    int error = 0;
724 +  FIX_UNUSED (additional_error);
725  
726    /* checks for required options */
727    if (! args_info->input_given)
# Line 625 | Line 732 | cmdline_parser_required2 (struct gengetopt_args_info *
732    
733    if (args_info->staticProps_group_counter == 0)
734      {
735 <      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 : ""));
735 >      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 : ""));
736        error = 1;
737      }
738    
# Line 659 | Line 766 | int update_arg(void *field, char **orig_field,
766   static
767   int update_arg(void *field, char **orig_field,
768                 unsigned int *field_given, unsigned int *prev_given,
769 <               char *value, char *possible_values[], const char *default_value,
769 >               char *value, const char *possible_values[],
770 >               const char *default_value,
771                 cmdline_parser_arg_type arg_type,
772                 int check_ambiguity, int override,
773                 int no_free, int multiple_option,
# Line 670 | Line 778 | int update_arg(void *field, char **orig_field,
778    const char *val = value;
779    int found;
780    char **string_field;
781 +  FIX_UNUSED (field);
782  
783    stop_char = 0;
784    found = 0;
# Line 687 | Line 796 | int update_arg(void *field, char **orig_field,
796        return 1; /* failure */
797      }
798  
799 +  FIX_UNUSED (default_value);
800      
801    if (field_given && *field_given && ! override)
802      return 0;
# Line 750 | Line 860 | int
860  
861  
862   int
863 < cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info,
863 > cmdline_parser_internal (
864 >  int argc, char **argv, struct gengetopt_args_info *args_info,
865                          struct cmdline_parser_params *params, const char *additional_error)
866   {
867    int c;        /* Character of the parsed option.  */
# Line 805 | Line 916 | cmdline_parser_internal (int argc, char * const *argv,
916          { "sele3",      1, NULL, 0 },
917          { "refsele",    1, NULL, 0 },
918          { "comsele",    1, NULL, 0 },
919 +        { "seleoffset", 1, NULL, 0 },
920 +        { "seleoffset2",        1, NULL, 0 },
921          { "molname",    1, NULL, 0 },
922          { "begin",      1, NULL, 0 },
923          { "end",        1, NULL, 0 },
924          { "radius",     1, NULL, 0 },
925 +        { "voxelSize",  1, NULL, 'v' },
926 +        { "gaussWidth", 1, NULL, 0 },
927          { "bo", 0, NULL, 0 },
928 <        { "bor",        0, NULL, 0 },
928 >        { "ior",        0, NULL, 0 },
929 >        { "for",        0, NULL, 0 },
930          { "bad",        0, NULL, 0 },
931 +        { "count",      0, NULL, 0 },
932          { "gofr",       0, NULL, 'g' },
933          { "gofz",       0, NULL, 0 },
934          { "r_theta",    0, NULL, 0 },
# Line 828 | Line 945 | cmdline_parser_internal (int argc, char * const *argv,
945          { "p_angle",    0, NULL, 0 },
946          { "hxy",        0, NULL, 0 },
947          { "rho_r",      0, NULL, 0 },
948 +        { "angle_r",    0, NULL, 0 },
949          { "hullvol",    0, NULL, 0 },
950 <        { NULL, 0, NULL, 0 }
950 >        { "rodlength",  0, NULL, 0 },
951 >        { "tet_param",  0, NULL, 'Q' },
952 >        { "tet_param_z",        0, NULL, 0 },
953 >        { "tet_param_xyz",      0, NULL, 0 },
954 >        { "rnemdz",     0, NULL, 0 },
955 >        { "rnemdr",     0, NULL, 0 },
956 >        { "rnemdrt",    0, NULL, 0 },
957 >        { "nitrile",    0, NULL, 0 },
958 >        { "multipole",  0, NULL, 'm' },
959 >        { "surfDiffusion",      0, NULL, 0 },
960 >        { 0,  0, 0, 0 }
961        };
962  
963 <      c = getopt_long (argc, argv, "hVi:o:n:b:x:y:a:c:z:gpsd", long_options, &option_index);
963 >      c = getopt_long (argc, argv, "hVi:o:n:b:x:y:a:c:z:v:gpsdQm", long_options, &option_index);
964  
965        if (c == -1) break;       /* Exit from `while (1)' loop.  */
966  
# Line 956 | Line 1084 | cmdline_parser_internal (int argc, char * const *argv,
1084              goto failure;
1085          
1086            break;
1087 +        case 'v':       /* voxel size (angstroms).  */
1088 +        
1089 +        
1090 +          if (update_arg( (void *)&(args_info->voxelSize_arg),
1091 +               &(args_info->voxelSize_orig), &(args_info->voxelSize_given),
1092 +              &(local_args_info.voxelSize_given), optarg, 0, 0, ARG_DOUBLE,
1093 +              check_ambiguity, override, 0, 0,
1094 +              "voxelSize", 'v',
1095 +              additional_error))
1096 +            goto failure;
1097 +        
1098 +          break;
1099          case 'g':       /* g(r).  */
1100          
1101            if (args_info->staticProps_group_counter && override)
# Line 971 | Line 1111 | cmdline_parser_internal (int argc, char * const *argv,
1111              goto failure;
1112          
1113            break;
1114 <        case 'p':       /* p2 order parameter (--sele1 and --sele2 must be specified).  */
1114 >        case 'p':       /* p2 order parameter (--sele1 must be specified, --sele2 is optional).  */
1115          
1116            if (args_info->staticProps_group_counter && override)
1117              reset_group_staticProps (args_info);
# Line 1016 | Line 1156 | cmdline_parser_internal (int argc, char * const *argv,
1156              goto failure;
1157          
1158            break;
1159 +        case 'Q':       /* tetrahedrality order parameter (Qk).  */
1160 +        
1161 +          if (args_info->staticProps_group_counter && override)
1162 +            reset_group_staticProps (args_info);
1163 +          args_info->staticProps_group_counter += 1;
1164 +        
1165 +          if (update_arg( 0 ,
1166 +               0 , &(args_info->tet_param_given),
1167 +              &(local_args_info.tet_param_given), optarg, 0, 0, ARG_NO,
1168 +              check_ambiguity, override, 0, 0,
1169 +              "tet_param", 'Q',
1170 +              additional_error))
1171 +            goto failure;
1172 +        
1173 +          break;
1174 +        case 'm':       /* average multipole moments contained within cutoff spheres as a function of radius.  */
1175 +        
1176 +          if (args_info->staticProps_group_counter && override)
1177 +            reset_group_staticProps (args_info);
1178 +          args_info->staticProps_group_counter += 1;
1179 +        
1180 +          if (update_arg( 0 ,
1181 +               0 , &(args_info->multipole_given),
1182 +              &(local_args_info.multipole_given), optarg, 0, 0, ARG_NO,
1183 +              check_ambiguity, override, 0, 0,
1184 +              "multipole", 'm',
1185 +              additional_error))
1186 +            goto failure;
1187 +        
1188 +          break;
1189  
1190          case 0: /* Long option with no short option */
1191            /* number of bins in z axis.  */
# Line 1144 | Line 1314 | cmdline_parser_internal (int argc, char * const *argv,
1314                goto failure;
1315            
1316            }
1317 +          /* global index offset for a second object (used to define a vector between sites in molecule).  */
1318 +          else if (strcmp (long_options[option_index].name, "seleoffset") == 0)
1319 +          {
1320 +          
1321 +          
1322 +            if (update_arg( (void *)&(args_info->seleoffset_arg),
1323 +                 &(args_info->seleoffset_orig), &(args_info->seleoffset_given),
1324 +                &(local_args_info.seleoffset_given), optarg, 0, 0, ARG_INT,
1325 +                check_ambiguity, override, 0, 0,
1326 +                "seleoffset", '-',
1327 +                additional_error))
1328 +              goto failure;
1329 +          
1330 +          }
1331 +          /* global index offset for a third object (used to define a vector between sites in molecule).  */
1332 +          else if (strcmp (long_options[option_index].name, "seleoffset2") == 0)
1333 +          {
1334 +          
1335 +          
1336 +            if (update_arg( (void *)&(args_info->seleoffset2_arg),
1337 +                 &(args_info->seleoffset2_orig), &(args_info->seleoffset2_given),
1338 +                &(local_args_info.seleoffset2_given), optarg, 0, 0, ARG_INT,
1339 +                check_ambiguity, override, 0, 0,
1340 +                "seleoffset2", '-',
1341 +                additional_error))
1342 +              goto failure;
1343 +          
1344 +          }
1345            /* molecule name.  */
1346            else if (strcmp (long_options[option_index].name, "molname") == 0)
1347            {
# Line 1200 | Line 1398 | cmdline_parser_internal (int argc, char * const *argv,
1398                goto failure;
1399            
1400            }
1401 +          /* Gaussian width (angstroms).  */
1402 +          else if (strcmp (long_options[option_index].name, "gaussWidth") == 0)
1403 +          {
1404 +          
1405 +          
1406 +            if (update_arg( (void *)&(args_info->gaussWidth_arg),
1407 +                 &(args_info->gaussWidth_orig), &(args_info->gaussWidth_given),
1408 +                &(local_args_info.gaussWidth_given), optarg, 0, 0, ARG_DOUBLE,
1409 +                check_ambiguity, override, 0, 0,
1410 +                "gaussWidth", '-',
1411 +                additional_error))
1412 +              goto failure;
1413 +          
1414 +          }
1415            /* bond order parameter (--rcut must be specified).  */
1416            else if (strcmp (long_options[option_index].name, "bo") == 0)
1417            {
# Line 1217 | Line 1429 | cmdline_parser_internal (int argc, char * const *argv,
1429                goto failure;
1430            
1431            }
1432 <          /* bond order parameter as a function of radius (--rcut must be specified).  */
1433 <          else if (strcmp (long_options[option_index].name, "bor") == 0)
1432 >          /* icosahedral bond order parameter as a function of radius (--rcut must be specified).  */
1433 >          else if (strcmp (long_options[option_index].name, "ior") == 0)
1434            {
1435            
1436              if (args_info->staticProps_group_counter && override)
# Line 1226 | Line 1438 | cmdline_parser_internal (int argc, char * const *argv,
1438              args_info->staticProps_group_counter += 1;
1439            
1440              if (update_arg( 0 ,
1441 <                 0 , &(args_info->bor_given),
1442 <                &(local_args_info.bor_given), optarg, 0, 0, ARG_NO,
1441 >                 0 , &(args_info->ior_given),
1442 >                &(local_args_info.ior_given), optarg, 0, 0, ARG_NO,
1443                  check_ambiguity, override, 0, 0,
1444 <                "bor", '-',
1444 >                "ior", '-',
1445                  additional_error))
1446                goto failure;
1447            
1448            }
1449 +          /* FCC bond order parameter as a function of radius (--rcut must be specified).  */
1450 +          else if (strcmp (long_options[option_index].name, "for") == 0)
1451 +          {
1452 +          
1453 +            if (args_info->staticProps_group_counter && override)
1454 +              reset_group_staticProps (args_info);
1455 +            args_info->staticProps_group_counter += 1;
1456 +          
1457 +            if (update_arg( 0 ,
1458 +                 0 , &(args_info->for_given),
1459 +                &(local_args_info.for_given), optarg, 0, 0, ARG_NO,
1460 +                check_ambiguity, override, 0, 0,
1461 +                "for", '-',
1462 +                additional_error))
1463 +              goto failure;
1464 +          
1465 +          }
1466            /* N(theta) bond angle density within (--rcut must be specified).  */
1467            else if (strcmp (long_options[option_index].name, "bad") == 0)
1468            {
# Line 1251 | Line 1480 | cmdline_parser_internal (int argc, char * const *argv,
1480                goto failure;
1481            
1482            }
1483 +          /* count of molecules matching selection criteria (and associated statistics).  */
1484 +          else if (strcmp (long_options[option_index].name, "count") == 0)
1485 +          {
1486 +          
1487 +            if (args_info->staticProps_group_counter && override)
1488 +              reset_group_staticProps (args_info);
1489 +            args_info->staticProps_group_counter += 1;
1490 +          
1491 +            if (update_arg( 0 ,
1492 +                 0 , &(args_info->count_given),
1493 +                &(local_args_info.count_given), optarg, 0, 0, ARG_NO,
1494 +                check_ambiguity, override, 0, 0,
1495 +                "count", '-',
1496 +                additional_error))
1497 +              goto failure;
1498 +          
1499 +          }
1500            /* g(z).  */
1501            else if (strcmp (long_options[option_index].name, "gofz") == 0)
1502            {
# Line 1404 | Line 1650 | cmdline_parser_internal (int argc, char * const *argv,
1650                goto failure;
1651            
1652            }
1653 <          /* p(cos(theta)).  */
1653 >          /* p(cos(theta)) (--sele1 must be specified, --sele2 is optional).  */
1654            else if (strcmp (long_options[option_index].name, "p_angle") == 0)
1655            {
1656            
# Line 1455 | Line 1701 | cmdline_parser_internal (int argc, char * const *argv,
1701                goto failure;
1702            
1703            }
1704 +          /* angle of R.  */
1705 +          else if (strcmp (long_options[option_index].name, "angle_r") == 0)
1706 +          {
1707 +          
1708 +            if (args_info->staticProps_group_counter && override)
1709 +              reset_group_staticProps (args_info);
1710 +            args_info->staticProps_group_counter += 1;
1711 +          
1712 +            if (update_arg( 0 ,
1713 +                 0 , &(args_info->angle_r_given),
1714 +                &(local_args_info.angle_r_given), optarg, 0, 0, ARG_NO,
1715 +                check_ambiguity, override, 0, 0,
1716 +                "angle_r", '-',
1717 +                additional_error))
1718 +              goto failure;
1719 +          
1720 +          }
1721            /* hull volume of nanoparticle.  */
1722            else if (strcmp (long_options[option_index].name, "hullvol") == 0)
1723            {
# Line 1472 | Line 1735 | cmdline_parser_internal (int argc, char * const *argv,
1735                goto failure;
1736            
1737            }
1738 +          /* length of nanorod.  */
1739 +          else if (strcmp (long_options[option_index].name, "rodlength") == 0)
1740 +          {
1741            
1742 +            if (args_info->staticProps_group_counter && override)
1743 +              reset_group_staticProps (args_info);
1744 +            args_info->staticProps_group_counter += 1;
1745 +          
1746 +            if (update_arg( 0 ,
1747 +                 0 , &(args_info->rodlength_given),
1748 +                &(local_args_info.rodlength_given), optarg, 0, 0, ARG_NO,
1749 +                check_ambiguity, override, 0, 0,
1750 +                "rodlength", '-',
1751 +                additional_error))
1752 +              goto failure;
1753 +          
1754 +          }
1755 +          /* spatially-resolved tetrahedrality order parameter Qk(z).  */
1756 +          else if (strcmp (long_options[option_index].name, "tet_param_z") == 0)
1757 +          {
1758 +          
1759 +            if (args_info->staticProps_group_counter && override)
1760 +              reset_group_staticProps (args_info);
1761 +            args_info->staticProps_group_counter += 1;
1762 +          
1763 +            if (update_arg( 0 ,
1764 +                 0 , &(args_info->tet_param_z_given),
1765 +                &(local_args_info.tet_param_z_given), optarg, 0, 0, ARG_NO,
1766 +                check_ambiguity, override, 0, 0,
1767 +                "tet_param_z", '-',
1768 +                additional_error))
1769 +              goto failure;
1770 +          
1771 +          }
1772 +          /* volume-resolved tetrahedrality order parameter Qk(x,y,z).  (voxelSize, rcut, and gaussWidth must be specified).  */
1773 +          else if (strcmp (long_options[option_index].name, "tet_param_xyz") == 0)
1774 +          {
1775 +          
1776 +            if (args_info->staticProps_group_counter && override)
1777 +              reset_group_staticProps (args_info);
1778 +            args_info->staticProps_group_counter += 1;
1779 +          
1780 +            if (update_arg( 0 ,
1781 +                 0 , &(args_info->tet_param_xyz_given),
1782 +                &(local_args_info.tet_param_xyz_given), optarg, 0, 0, ARG_NO,
1783 +                check_ambiguity, override, 0, 0,
1784 +                "tet_param_xyz", '-',
1785 +                additional_error))
1786 +              goto failure;
1787 +          
1788 +          }
1789 +          /* slab-resolved RNEMD statistics (temperature, density, velocity).  */
1790 +          else if (strcmp (long_options[option_index].name, "rnemdz") == 0)
1791 +          {
1792 +          
1793 +            if (args_info->staticProps_group_counter && override)
1794 +              reset_group_staticProps (args_info);
1795 +            args_info->staticProps_group_counter += 1;
1796 +          
1797 +            if (update_arg( 0 ,
1798 +                 0 , &(args_info->rnemdz_given),
1799 +                &(local_args_info.rnemdz_given), optarg, 0, 0, ARG_NO,
1800 +                check_ambiguity, override, 0, 0,
1801 +                "rnemdz", '-',
1802 +                additional_error))
1803 +              goto failure;
1804 +          
1805 +          }
1806 +          /* shell-resolved RNEMD statistics (temperature, density, angular velocity).  */
1807 +          else if (strcmp (long_options[option_index].name, "rnemdr") == 0)
1808 +          {
1809 +          
1810 +            if (args_info->staticProps_group_counter && override)
1811 +              reset_group_staticProps (args_info);
1812 +            args_info->staticProps_group_counter += 1;
1813 +          
1814 +            if (update_arg( 0 ,
1815 +                 0 , &(args_info->rnemdr_given),
1816 +                &(local_args_info.rnemdr_given), optarg, 0, 0, ARG_NO,
1817 +                check_ambiguity, override, 0, 0,
1818 +                "rnemdr", '-',
1819 +                additional_error))
1820 +              goto failure;
1821 +          
1822 +          }
1823 +          /* shell and angle-resolved RNEMD statistics (temperature, density, angular velocity).  */
1824 +          else if (strcmp (long_options[option_index].name, "rnemdrt") == 0)
1825 +          {
1826 +          
1827 +            if (args_info->staticProps_group_counter && override)
1828 +              reset_group_staticProps (args_info);
1829 +            args_info->staticProps_group_counter += 1;
1830 +          
1831 +            if (update_arg( 0 ,
1832 +                 0 , &(args_info->rnemdrt_given),
1833 +                &(local_args_info.rnemdrt_given), optarg, 0, 0, ARG_NO,
1834 +                check_ambiguity, override, 0, 0,
1835 +                "rnemdrt", '-',
1836 +                additional_error))
1837 +              goto failure;
1838 +          
1839 +          }
1840 +          /* electrostatic potential to frequency map based on the Cho nitrile fits.  */
1841 +          else if (strcmp (long_options[option_index].name, "nitrile") == 0)
1842 +          {
1843 +          
1844 +            if (args_info->staticProps_group_counter && override)
1845 +              reset_group_staticProps (args_info);
1846 +            args_info->staticProps_group_counter += 1;
1847 +          
1848 +            if (update_arg( 0 ,
1849 +                 0 , &(args_info->nitrile_given),
1850 +                &(local_args_info.nitrile_given), optarg, 0, 0, ARG_NO,
1851 +                check_ambiguity, override, 0, 0,
1852 +                "nitrile", '-',
1853 +                additional_error))
1854 +              goto failure;
1855 +          
1856 +          }
1857 +          /* X, Y, and R (surface diffusion if Z exposed and bulk immobile) diffusion.  */
1858 +          else if (strcmp (long_options[option_index].name, "surfDiffusion") == 0)
1859 +          {
1860 +          
1861 +            if (args_info->staticProps_group_counter && override)
1862 +              reset_group_staticProps (args_info);
1863 +            args_info->staticProps_group_counter += 1;
1864 +          
1865 +            if (update_arg( 0 ,
1866 +                 0 , &(args_info->surfDiffusion_given),
1867 +                &(local_args_info.surfDiffusion_given), optarg, 0, 0, ARG_NO,
1868 +                check_ambiguity, override, 0, 0,
1869 +                "surfDiffusion", '-',
1870 +                additional_error))
1871 +              goto failure;
1872 +          
1873 +          }
1874 +          
1875            break;
1876          case '?':       /* Invalid option.  */
1877            /* `getopt_long' already printed an error message.  */
# Line 1486 | Line 1885 | cmdline_parser_internal (int argc, char * const *argv,
1885  
1886    if (args_info->staticProps_group_counter > 1)
1887      {
1888 <      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 : ""));
1888 >      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 : ""));
1889        error = 1;
1890      }
1891    
# Line 1502 | Line 1901 | cmdline_parser_internal (int argc, char * const *argv,
1901    if ( error )
1902      return (EXIT_FAILURE);
1903  
1505  if (optind < argc)
1506    {
1507      int i = 0 ;
1508      int found_prog_name = 0;
1509      /* whether program name, i.e., argv[0], is in the remaining args
1510         (this may happen with some implementations of getopt,
1511          but surely not with the one included by gengetopt) */
1512
1513      i = optind;
1514      while (i < argc)
1515        if (argv[i++] == argv[0]) {
1516          found_prog_name = 1;
1517          break;
1518        }
1519      i = 0;
1520
1521      args_info->inputs_num = argc - optind - found_prog_name;
1522      args_info->inputs =
1523        (char **)(malloc ((args_info->inputs_num)*sizeof(char *))) ;
1524      while (optind < argc)
1525        if (argv[optind++] != argv[0])
1526          args_info->inputs[ i++ ] = gengetopt_strdup (argv[optind-1]) ;
1527    }
1528
1904    return 0;
1905  
1906   failure:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines