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 1442 by gezelter, Mon May 10 17:28:26 2010 UTC vs.
trunk/src/applications/staticProps/StaticPropsCmd.cpp (file contents), Revision 1795 by gezelter, Fri Sep 7 18:13:55 2012 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 -c cpp -F StaticPropsCmd -u
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 + #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 = "";
# Line 38 | Line 46 | const char *gengetopt_args_info_help[] = {
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')",
41  "      --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",
# Line 54 | Line 64 | const char *gengetopt_args_info_help[] = {
64    "      --bo                      bond order parameter (--rcut must be specified)",
65    "      --bor                     bond order parameter as a function of radius \n                                  (--rcut must be specified)",
66    "      --bad                     N(theta) bond angle density within (--rcut must \n                                  be specified)",
67 +  "      --count                   count of molecules matching selection criteria \n                                  (and associated statistics)",
68    "  -g, --gofr                    g(r)",
69    "      --gofz                    g(z)",
70    "      --r_theta                 g(r, cos(theta))",
# Line 61 | Line 72 | const char *gengetopt_args_info_help[] = {
72    "      --r_z                     g(r, z)",
73    "      --theta_omega             g(cos(theta), cos(omega))",
74    "      --gxyz                    g(x, y, z)",
75 <  "  -p, --p2                      p2 order parameter (--sele1 and --sele2 must be \n                                  specified)",
75 >  "      --twodgofr                2D g(r) (Slab width --dz must be specified)",
76 >  "  -p, --p2                      p2 order parameter (--sele1 must be specified, \n                                  --sele2 is optional)",
77    "      --rp2                     rp2 order parameter (--sele1 and --sele2 must \n                                  be specified)",
78    "  -s, --scd                     scd order parameter (either --sele1, --sele2, \n                                  --sele3 are specified or --molname, --begin, \n                                  --end are specified)",
79    "  -d, --density                 density plot",
# Line 69 | Line 81 | const char *gengetopt_args_info_help[] = {
81    "      --p_angle                 p(cos(theta))",
82    "      --hxy                     hxy",
83    "      --rho_r                   rho of R",
84 +  "      --angle_r                 angle of R",
85    "      --hullvol                 hull volume of nanoparticle",
86 +  "      --rodlength               length of nanorod",
87 +  "  -Q, --tet_param               tetrahedrality order parameter",
88 +  "      --tet_param_z             tetrahedrality order parameter by zbin(--sele1 \n                                  must be specified)",
89      0
90   };
91  
# Line 85 | Line 101 | static int
101   void clear_args (struct gengetopt_args_info *args_info);
102  
103   static int
104 < cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info,
104 > cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info,
105                          struct cmdline_parser_params *params, const char *additional_error);
106  
107   static int
# Line 107 | Line 123 | void clear_given (struct gengetopt_args_info *args_inf
123    args_info->nbins_y_given = 0 ;
124    args_info->nbins_z_given = 0 ;
125    args_info->nanglebins_given = 0 ;
110  args_info->length_given = 0 ;
126    args_info->rcut_given = 0 ;
127 +  args_info->dz_given = 0 ;
128 +  args_info->length_given = 0 ;
129 +  args_info->zlength_given = 0 ;
130    args_info->zoffset_given = 0 ;
131    args_info->sele1_given = 0 ;
132    args_info->sele2_given = 0 ;
# Line 122 | Line 140 | void clear_given (struct gengetopt_args_info *args_inf
140    args_info->bo_given = 0 ;
141    args_info->bor_given = 0 ;
142    args_info->bad_given = 0 ;
143 +  args_info->count_given = 0 ;
144    args_info->gofr_given = 0 ;
145    args_info->gofz_given = 0 ;
146    args_info->r_theta_given = 0 ;
# Line 129 | Line 148 | void clear_given (struct gengetopt_args_info *args_inf
148    args_info->r_z_given = 0 ;
149    args_info->theta_omega_given = 0 ;
150    args_info->gxyz_given = 0 ;
151 +  args_info->twodgofr_given = 0 ;
152    args_info->p2_given = 0 ;
153    args_info->rp2_given = 0 ;
154    args_info->scd_given = 0 ;
# Line 137 | Line 157 | void clear_given (struct gengetopt_args_info *args_inf
157    args_info->p_angle_given = 0 ;
158    args_info->hxy_given = 0 ;
159    args_info->rho_r_given = 0 ;
160 +  args_info->angle_r_given = 0 ;
161    args_info->hullvol_given = 0 ;
162 +  args_info->rodlength_given = 0 ;
163 +  args_info->tet_param_given = 0 ;
164 +  args_info->tet_param_z_given = 0 ;
165    args_info->staticProps_group_counter = 0 ;
166   }
167  
168   static
169   void clear_args (struct gengetopt_args_info *args_info)
170   {
171 +  FIX_UNUSED (args_info);
172    args_info->input_arg = NULL;
173    args_info->input_orig = NULL;
174    args_info->output_arg = NULL;
# Line 160 | Line 185 | void clear_args (struct gengetopt_args_info *args_info
185    args_info->nbins_z_orig = NULL;
186    args_info->nanglebins_arg = 50;
187    args_info->nanglebins_orig = NULL;
163  args_info->length_orig = NULL;
188    args_info->rcut_orig = NULL;
189 +  args_info->dz_orig = NULL;
190 +  args_info->length_orig = NULL;
191 +  args_info->zlength_orig = NULL;
192    args_info->zoffset_arg = 0;
193    args_info->zoffset_orig = NULL;
194    args_info->sele1_arg = NULL;
# Line 197 | Line 224 | void init_args_info(struct gengetopt_args_info *args_i
224    args_info->nbins_y_help = gengetopt_args_info_help[7] ;
225    args_info->nbins_z_help = gengetopt_args_info_help[8] ;
226    args_info->nanglebins_help = gengetopt_args_info_help[9] ;
227 <  args_info->length_help = gengetopt_args_info_help[10] ;
228 <  args_info->rcut_help = gengetopt_args_info_help[11] ;
229 <  args_info->zoffset_help = gengetopt_args_info_help[12] ;
230 <  args_info->sele1_help = gengetopt_args_info_help[13] ;
231 <  args_info->sele2_help = gengetopt_args_info_help[14] ;
232 <  args_info->sele3_help = gengetopt_args_info_help[15] ;
233 <  args_info->refsele_help = gengetopt_args_info_help[16] ;
234 <  args_info->comsele_help = gengetopt_args_info_help[17] ;
235 <  args_info->molname_help = gengetopt_args_info_help[18] ;
236 <  args_info->begin_help = gengetopt_args_info_help[19] ;
237 <  args_info->end_help = gengetopt_args_info_help[20] ;
238 <  args_info->radius_help = gengetopt_args_info_help[21] ;
239 <  args_info->bo_help = gengetopt_args_info_help[23] ;
240 <  args_info->bor_help = gengetopt_args_info_help[24] ;
241 <  args_info->bad_help = gengetopt_args_info_help[25] ;
242 <  args_info->gofr_help = gengetopt_args_info_help[26] ;
243 <  args_info->gofz_help = gengetopt_args_info_help[27] ;
244 <  args_info->r_theta_help = gengetopt_args_info_help[28] ;
245 <  args_info->r_omega_help = gengetopt_args_info_help[29] ;
246 <  args_info->r_z_help = gengetopt_args_info_help[30] ;
247 <  args_info->theta_omega_help = gengetopt_args_info_help[31] ;
248 <  args_info->gxyz_help = gengetopt_args_info_help[32] ;
249 <  args_info->p2_help = gengetopt_args_info_help[33] ;
250 <  args_info->rp2_help = gengetopt_args_info_help[34] ;
251 <  args_info->scd_help = gengetopt_args_info_help[35] ;
252 <  args_info->density_help = gengetopt_args_info_help[36] ;
253 <  args_info->slab_density_help = gengetopt_args_info_help[37] ;
254 <  args_info->p_angle_help = gengetopt_args_info_help[38] ;
255 <  args_info->hxy_help = gengetopt_args_info_help[39] ;
256 <  args_info->rho_r_help = gengetopt_args_info_help[40] ;
257 <  args_info->hullvol_help = gengetopt_args_info_help[41] ;
227 >  args_info->rcut_help = gengetopt_args_info_help[10] ;
228 >  args_info->dz_help = gengetopt_args_info_help[11] ;
229 >  args_info->length_help = gengetopt_args_info_help[12] ;
230 >  args_info->zlength_help = gengetopt_args_info_help[13] ;
231 >  args_info->zoffset_help = gengetopt_args_info_help[14] ;
232 >  args_info->sele1_help = gengetopt_args_info_help[15] ;
233 >  args_info->sele2_help = gengetopt_args_info_help[16] ;
234 >  args_info->sele3_help = gengetopt_args_info_help[17] ;
235 >  args_info->refsele_help = gengetopt_args_info_help[18] ;
236 >  args_info->comsele_help = gengetopt_args_info_help[19] ;
237 >  args_info->molname_help = gengetopt_args_info_help[20] ;
238 >  args_info->begin_help = gengetopt_args_info_help[21] ;
239 >  args_info->end_help = gengetopt_args_info_help[22] ;
240 >  args_info->radius_help = gengetopt_args_info_help[23] ;
241 >  args_info->bo_help = gengetopt_args_info_help[25] ;
242 >  args_info->bor_help = gengetopt_args_info_help[26] ;
243 >  args_info->bad_help = gengetopt_args_info_help[27] ;
244 >  args_info->count_help = gengetopt_args_info_help[28] ;
245 >  args_info->gofr_help = gengetopt_args_info_help[29] ;
246 >  args_info->gofz_help = gengetopt_args_info_help[30] ;
247 >  args_info->r_theta_help = gengetopt_args_info_help[31] ;
248 >  args_info->r_omega_help = gengetopt_args_info_help[32] ;
249 >  args_info->r_z_help = gengetopt_args_info_help[33] ;
250 >  args_info->theta_omega_help = gengetopt_args_info_help[34] ;
251 >  args_info->gxyz_help = gengetopt_args_info_help[35] ;
252 >  args_info->twodgofr_help = gengetopt_args_info_help[36] ;
253 >  args_info->p2_help = gengetopt_args_info_help[37] ;
254 >  args_info->rp2_help = gengetopt_args_info_help[38] ;
255 >  args_info->scd_help = gengetopt_args_info_help[39] ;
256 >  args_info->density_help = gengetopt_args_info_help[40] ;
257 >  args_info->slab_density_help = gengetopt_args_info_help[41] ;
258 >  args_info->p_angle_help = gengetopt_args_info_help[42] ;
259 >  args_info->hxy_help = gengetopt_args_info_help[43] ;
260 >  args_info->rho_r_help = gengetopt_args_info_help[44] ;
261 >  args_info->angle_r_help = gengetopt_args_info_help[45] ;
262 >  args_info->hullvol_help = gengetopt_args_info_help[46] ;
263 >  args_info->rodlength_help = gengetopt_args_info_help[47] ;
264 >  args_info->tet_param_help = gengetopt_args_info_help[48] ;
265 >  args_info->tet_param_z_help = gengetopt_args_info_help[49] ;
266    
267   }
268  
269   void
270   cmdline_parser_print_version (void)
271   {
272 <  printf ("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION);
272 >  printf ("%s %s\n",
273 >     (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE),
274 >     CMDLINE_PARSER_VERSION);
275   }
276  
277   static void print_help_common(void) {
# Line 249 | Line 286 | static void print_help_common(void) {
286    printf("\n");
287  
288    if (strlen(gengetopt_args_info_description) > 0)
289 <    printf("%s\n", gengetopt_args_info_description);
289 >    printf("%s\n\n", gengetopt_args_info_description);
290   }
291  
292   void
# Line 268 | Line 305 | cmdline_parser_init (struct gengetopt_args_info *args_
305    clear_args (args_info);
306    init_args_info (args_info);
307  
308 <  args_info->inputs = NULL;
308 >  args_info->inputs = 0;
309    args_info->inputs_num = 0;
310   }
311  
# Line 319 | Line 356 | cmdline_parser_release (struct gengetopt_args_info *ar
356    free_string_field (&(args_info->nbins_y_orig));
357    free_string_field (&(args_info->nbins_z_orig));
358    free_string_field (&(args_info->nanglebins_orig));
322  free_string_field (&(args_info->length_orig));
359    free_string_field (&(args_info->rcut_orig));
360 +  free_string_field (&(args_info->dz_orig));
361 +  free_string_field (&(args_info->length_orig));
362 +  free_string_field (&(args_info->zlength_orig));
363    free_string_field (&(args_info->zoffset_orig));
364    free_string_field (&(args_info->sele1_arg));
365    free_string_field (&(args_info->sele1_orig));
# Line 350 | Line 389 | static void
389  
390  
391   static void
392 < write_into_file(FILE *outfile, const char *opt, const char *arg, char *values[])
392 > write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[])
393   {
394 +  FIX_UNUSED (values);
395    if (arg) {
396      fprintf(outfile, "%s=\"%s\"\n", opt, arg);
397    } else {
# Line 391 | Line 431 | cmdline_parser_dump(FILE *outfile, struct gengetopt_ar
431      write_into_file(outfile, "nbins_z", args_info->nbins_z_orig, 0);
432    if (args_info->nanglebins_given)
433      write_into_file(outfile, "nanglebins", args_info->nanglebins_orig, 0);
394  if (args_info->length_given)
395    write_into_file(outfile, "length", args_info->length_orig, 0);
434    if (args_info->rcut_given)
435      write_into_file(outfile, "rcut", args_info->rcut_orig, 0);
436 +  if (args_info->dz_given)
437 +    write_into_file(outfile, "dz", args_info->dz_orig, 0);
438 +  if (args_info->length_given)
439 +    write_into_file(outfile, "length", args_info->length_orig, 0);
440 +  if (args_info->zlength_given)
441 +    write_into_file(outfile, "zlength", args_info->zlength_orig, 0);
442    if (args_info->zoffset_given)
443      write_into_file(outfile, "zoffset", args_info->zoffset_orig, 0);
444    if (args_info->sele1_given)
# Line 421 | Line 465 | cmdline_parser_dump(FILE *outfile, struct gengetopt_ar
465      write_into_file(outfile, "bor", 0, 0 );
466    if (args_info->bad_given)
467      write_into_file(outfile, "bad", 0, 0 );
468 +  if (args_info->count_given)
469 +    write_into_file(outfile, "count", 0, 0 );
470    if (args_info->gofr_given)
471      write_into_file(outfile, "gofr", 0, 0 );
472    if (args_info->gofz_given)
# Line 435 | Line 481 | cmdline_parser_dump(FILE *outfile, struct gengetopt_ar
481      write_into_file(outfile, "theta_omega", 0, 0 );
482    if (args_info->gxyz_given)
483      write_into_file(outfile, "gxyz", 0, 0 );
484 +  if (args_info->twodgofr_given)
485 +    write_into_file(outfile, "twodgofr", 0, 0 );
486    if (args_info->p2_given)
487      write_into_file(outfile, "p2", 0, 0 );
488    if (args_info->rp2_given)
# Line 451 | Line 499 | cmdline_parser_dump(FILE *outfile, struct gengetopt_ar
499      write_into_file(outfile, "hxy", 0, 0 );
500    if (args_info->rho_r_given)
501      write_into_file(outfile, "rho_r", 0, 0 );
502 +  if (args_info->angle_r_given)
503 +    write_into_file(outfile, "angle_r", 0, 0 );
504    if (args_info->hullvol_given)
505      write_into_file(outfile, "hullvol", 0, 0 );
506 +  if (args_info->rodlength_given)
507 +    write_into_file(outfile, "rodlength", 0, 0 );
508 +  if (args_info->tet_param_given)
509 +    write_into_file(outfile, "tet_param", 0, 0 );
510 +  if (args_info->tet_param_z_given)
511 +    write_into_file(outfile, "tet_param_z", 0, 0 );
512    
513  
514    i = EXIT_SUCCESS;
# Line 489 | Line 545 | gengetopt_strdup (const char *s)
545   char *
546   gengetopt_strdup (const char *s)
547   {
548 <  char *result = NULL;
548 >  char *result = 0;
549    if (!s)
550      return result;
551  
# Line 509 | Line 565 | reset_group_staticProps(struct gengetopt_args_info *ar
565    args_info->bo_given = 0 ;
566    args_info->bor_given = 0 ;
567    args_info->bad_given = 0 ;
568 +  args_info->count_given = 0 ;
569    args_info->gofr_given = 0 ;
570    args_info->gofz_given = 0 ;
571    args_info->r_theta_given = 0 ;
# Line 516 | Line 573 | reset_group_staticProps(struct gengetopt_args_info *ar
573    args_info->r_z_given = 0 ;
574    args_info->theta_omega_given = 0 ;
575    args_info->gxyz_given = 0 ;
576 +  args_info->twodgofr_given = 0 ;
577    args_info->p2_given = 0 ;
578    args_info->rp2_given = 0 ;
579    args_info->scd_given = 0 ;
# Line 524 | Line 582 | reset_group_staticProps(struct gengetopt_args_info *ar
582    args_info->p_angle_given = 0 ;
583    args_info->hxy_given = 0 ;
584    args_info->rho_r_given = 0 ;
585 +  args_info->angle_r_given = 0 ;
586    args_info->hullvol_given = 0 ;
587 +  args_info->rodlength_given = 0 ;
588 +  args_info->tet_param_given = 0 ;
589 +  args_info->tet_param_z_given = 0 ;
590  
591    args_info->staticProps_group_counter = 0;
592   }
593  
594   int
595 < cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_info)
595 > cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info)
596   {
597    return cmdline_parser2 (argc, argv, args_info, 0, 1, 1);
598   }
599  
600   int
601 < cmdline_parser_ext (int argc, char * const *argv, struct gengetopt_args_info *args_info,
601 > cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info,
602                     struct cmdline_parser_params *params)
603   {
604    int result;
605 <  result = cmdline_parser_internal (argc, argv, args_info, params, NULL);
605 >  result = cmdline_parser_internal (argc, argv, args_info, params, 0);
606  
607    if (result == EXIT_FAILURE)
608      {
# Line 552 | Line 614 | int
614   }
615  
616   int
617 < cmdline_parser2 (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
617 > cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
618   {
619    int result;
620    struct cmdline_parser_params params;
# Line 563 | Line 625 | cmdline_parser2 (int argc, char * const *argv, struct
625    params.check_ambiguity = 0;
626    params.print_errors = 1;
627  
628 <  result = cmdline_parser_internal (argc, argv, args_info, &params, NULL);
628 >  result = cmdline_parser_internal (argc, argv, args_info, &params, 0);
629  
630    if (result == EXIT_FAILURE)
631      {
# Line 579 | Line 641 | cmdline_parser_required (struct gengetopt_args_info *a
641   {
642    int result = EXIT_SUCCESS;
643  
644 <  if (cmdline_parser_required2(args_info, prog_name, NULL) > 0)
644 >  if (cmdline_parser_required2(args_info, prog_name, 0) > 0)
645      result = EXIT_FAILURE;
646  
647    if (result == EXIT_FAILURE)
# Line 595 | Line 657 | cmdline_parser_required2 (struct gengetopt_args_info *
657   cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error)
658   {
659    int error = 0;
660 +  FIX_UNUSED (additional_error);
661  
662    /* checks for required options */
663    if (! args_info->input_given)
# Line 605 | Line 668 | cmdline_parser_required2 (struct gengetopt_args_info *
668    
669    if (args_info->staticProps_group_counter == 0)
670      {
671 <      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 : ""));
671 >      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 : ""));
672        error = 1;
673      }
674    
# Line 639 | Line 702 | int update_arg(void *field, char **orig_field,
702   static
703   int update_arg(void *field, char **orig_field,
704                 unsigned int *field_given, unsigned int *prev_given,
705 <               char *value, char *possible_values[], const char *default_value,
705 >               char *value, const char *possible_values[],
706 >               const char *default_value,
707                 cmdline_parser_arg_type arg_type,
708                 int check_ambiguity, int override,
709                 int no_free, int multiple_option,
# Line 650 | Line 714 | int update_arg(void *field, char **orig_field,
714    const char *val = value;
715    int found;
716    char **string_field;
717 +  FIX_UNUSED (field);
718  
719    stop_char = 0;
720    found = 0;
# Line 667 | Line 732 | int update_arg(void *field, char **orig_field,
732        return 1; /* failure */
733      }
734  
735 +  FIX_UNUSED (default_value);
736      
737    if (field_given && *field_given && ! override)
738      return 0;
# Line 730 | Line 796 | int
796  
797  
798   int
799 < cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info,
799 > cmdline_parser_internal (
800 >  int argc, char **argv, struct gengetopt_args_info *args_info,
801                          struct cmdline_parser_params *params, const char *additional_error)
802   {
803    int c;        /* Character of the parsed option.  */
# Line 775 | Line 842 | cmdline_parser_internal (int argc, char * const *argv,
842          { "nbins_y",    1, NULL, 'y' },
843          { "nbins_z",    1, NULL, 0 },
844          { "nanglebins", 1, NULL, 'a' },
778        { "length",     1, NULL, 0 },
845          { "rcut",       1, NULL, 'c' },
846 +        { "dz", 1, NULL, 0 },
847 +        { "length",     1, NULL, 0 },
848 +        { "zlength",    1, NULL, 0 },
849          { "zoffset",    1, NULL, 'z' },
850          { "sele1",      1, NULL, 0 },
851          { "sele2",      1, NULL, 0 },
# Line 790 | Line 859 | cmdline_parser_internal (int argc, char * const *argv,
859          { "bo", 0, NULL, 0 },
860          { "bor",        0, NULL, 0 },
861          { "bad",        0, NULL, 0 },
862 +        { "count",      0, NULL, 0 },
863          { "gofr",       0, NULL, 'g' },
864          { "gofz",       0, NULL, 0 },
865          { "r_theta",    0, NULL, 0 },
# Line 797 | Line 867 | cmdline_parser_internal (int argc, char * const *argv,
867          { "r_z",        0, NULL, 0 },
868          { "theta_omega",        0, NULL, 0 },
869          { "gxyz",       0, NULL, 0 },
870 +        { "twodgofr",   0, NULL, 0 },
871          { "p2", 0, NULL, 'p' },
872          { "rp2",        0, NULL, 0 },
873          { "scd",        0, NULL, 's' },
# Line 805 | Line 876 | cmdline_parser_internal (int argc, char * const *argv,
876          { "p_angle",    0, NULL, 0 },
877          { "hxy",        0, NULL, 0 },
878          { "rho_r",      0, NULL, 0 },
879 +        { "angle_r",    0, NULL, 0 },
880          { "hullvol",    0, NULL, 0 },
881 <        { NULL, 0, NULL, 0 }
881 >        { "rodlength",  0, NULL, 0 },
882 >        { "tet_param",  0, NULL, 'Q' },
883 >        { "tet_param_z",        0, NULL, 0 },
884 >        { 0,  0, 0, 0 }
885        };
886  
887 <      c = getopt_long (argc, argv, "hVi:o:n:b:x:y:a:c:z:gpsd", long_options, &option_index);
887 >      c = getopt_long (argc, argv, "hVi:o:n:b:x:y:a:c:z:gpsdQ", long_options, &option_index);
888  
889        if (c == -1) break;       /* Exit from `while (1)' loop.  */
890  
# Line 948 | Line 1023 | cmdline_parser_internal (int argc, char * const *argv,
1023              goto failure;
1024          
1025            break;
1026 <        case 'p':       /* p2 order parameter (--sele1 and --sele2 must be specified).  */
1026 >        case 'p':       /* p2 order parameter (--sele1 must be specified, --sele2 is optional).  */
1027          
1028            if (args_info->staticProps_group_counter && override)
1029              reset_group_staticProps (args_info);
# Line 993 | Line 1068 | cmdline_parser_internal (int argc, char * const *argv,
1068              goto failure;
1069          
1070            break;
1071 +        case 'Q':       /* tetrahedrality order parameter.  */
1072 +        
1073 +          if (args_info->staticProps_group_counter && override)
1074 +            reset_group_staticProps (args_info);
1075 +          args_info->staticProps_group_counter += 1;
1076 +        
1077 +          if (update_arg( 0 ,
1078 +               0 , &(args_info->tet_param_given),
1079 +              &(local_args_info.tet_param_given), optarg, 0, 0, ARG_NO,
1080 +              check_ambiguity, override, 0, 0,
1081 +              "tet_param", 'Q',
1082 +              additional_error))
1083 +            goto failure;
1084 +        
1085 +          break;
1086  
1087          case 0: /* Long option with no short option */
1088            /* number of bins in z axis.  */
# Line 1009 | Line 1099 | cmdline_parser_internal (int argc, char * const *argv,
1099                goto failure;
1100            
1101            }
1102 +          /* slab width (dz).  */
1103 +          else if (strcmp (long_options[option_index].name, "dz") == 0)
1104 +          {
1105 +          
1106 +          
1107 +            if (update_arg( (void *)&(args_info->dz_arg),
1108 +                 &(args_info->dz_orig), &(args_info->dz_given),
1109 +                &(local_args_info.dz_given), optarg, 0, 0, ARG_DOUBLE,
1110 +                check_ambiguity, override, 0, 0,
1111 +                "dz", '-',
1112 +                additional_error))
1113 +              goto failure;
1114 +          
1115 +          }
1116            /* maximum length (Defaults to 1/2 smallest length of first frame).  */
1117            else if (strcmp (long_options[option_index].name, "length") == 0)
1118            {
# Line 1023 | Line 1127 | cmdline_parser_internal (int argc, char * const *argv,
1127                goto failure;
1128            
1129            }
1130 +          /* maximum length (Defaults to 1/2 smallest length of first frame).  */
1131 +          else if (strcmp (long_options[option_index].name, "zlength") == 0)
1132 +          {
1133 +          
1134 +          
1135 +            if (update_arg( (void *)&(args_info->zlength_arg),
1136 +                 &(args_info->zlength_orig), &(args_info->zlength_given),
1137 +                &(local_args_info.zlength_given), optarg, 0, 0, ARG_DOUBLE,
1138 +                check_ambiguity, override, 0, 0,
1139 +                "zlength", '-',
1140 +                additional_error))
1141 +              goto failure;
1142 +          
1143 +          }
1144            /* select the first stuntdouble set.  */
1145            else if (strcmp (long_options[option_index].name, "sele1") == 0)
1146            {
# Line 1196 | Line 1314 | cmdline_parser_internal (int argc, char * const *argv,
1314                  &(local_args_info.bad_given), optarg, 0, 0, ARG_NO,
1315                  check_ambiguity, override, 0, 0,
1316                  "bad", '-',
1317 +                additional_error))
1318 +              goto failure;
1319 +          
1320 +          }
1321 +          /* count of molecules matching selection criteria (and associated statistics).  */
1322 +          else if (strcmp (long_options[option_index].name, "count") == 0)
1323 +          {
1324 +          
1325 +            if (args_info->staticProps_group_counter && override)
1326 +              reset_group_staticProps (args_info);
1327 +            args_info->staticProps_group_counter += 1;
1328 +          
1329 +            if (update_arg( 0 ,
1330 +                 0 , &(args_info->count_given),
1331 +                &(local_args_info.count_given), optarg, 0, 0, ARG_NO,
1332 +                check_ambiguity, override, 0, 0,
1333 +                "count", '-',
1334                  additional_error))
1335                goto failure;
1336            
# Line 1302 | Line 1437 | cmdline_parser_internal (int argc, char * const *argv,
1437                goto failure;
1438            
1439            }
1440 +          /* 2D g(r) (Slab width --dz must be specified).  */
1441 +          else if (strcmp (long_options[option_index].name, "twodgofr") == 0)
1442 +          {
1443 +          
1444 +            if (args_info->staticProps_group_counter && override)
1445 +              reset_group_staticProps (args_info);
1446 +            args_info->staticProps_group_counter += 1;
1447 +          
1448 +            if (update_arg( 0 ,
1449 +                 0 , &(args_info->twodgofr_given),
1450 +                &(local_args_info.twodgofr_given), optarg, 0, 0, ARG_NO,
1451 +                check_ambiguity, override, 0, 0,
1452 +                "twodgofr", '-',
1453 +                additional_error))
1454 +              goto failure;
1455 +          
1456 +          }
1457            /* rp2 order parameter (--sele1 and --sele2 must be specified).  */
1458            else if (strcmp (long_options[option_index].name, "rp2") == 0)
1459            {
# Line 1383 | Line 1535 | cmdline_parser_internal (int argc, char * const *argv,
1535                  &(local_args_info.rho_r_given), optarg, 0, 0, ARG_NO,
1536                  check_ambiguity, override, 0, 0,
1537                  "rho_r", '-',
1538 +                additional_error))
1539 +              goto failure;
1540 +          
1541 +          }
1542 +          /* angle of R.  */
1543 +          else if (strcmp (long_options[option_index].name, "angle_r") == 0)
1544 +          {
1545 +          
1546 +            if (args_info->staticProps_group_counter && override)
1547 +              reset_group_staticProps (args_info);
1548 +            args_info->staticProps_group_counter += 1;
1549 +          
1550 +            if (update_arg( 0 ,
1551 +                 0 , &(args_info->angle_r_given),
1552 +                &(local_args_info.angle_r_given), optarg, 0, 0, ARG_NO,
1553 +                check_ambiguity, override, 0, 0,
1554 +                "angle_r", '-',
1555                  additional_error))
1556                goto failure;
1557            
# Line 1404 | Line 1573 | cmdline_parser_internal (int argc, char * const *argv,
1573                goto failure;
1574            
1575            }
1576 +          /* length of nanorod.  */
1577 +          else if (strcmp (long_options[option_index].name, "rodlength") == 0)
1578 +          {
1579            
1580 +            if (args_info->staticProps_group_counter && override)
1581 +              reset_group_staticProps (args_info);
1582 +            args_info->staticProps_group_counter += 1;
1583 +          
1584 +            if (update_arg( 0 ,
1585 +                 0 , &(args_info->rodlength_given),
1586 +                &(local_args_info.rodlength_given), optarg, 0, 0, ARG_NO,
1587 +                check_ambiguity, override, 0, 0,
1588 +                "rodlength", '-',
1589 +                additional_error))
1590 +              goto failure;
1591 +          
1592 +          }
1593 +          /* tetrahedrality order parameter by zbin(--sele1 must be specified).  */
1594 +          else if (strcmp (long_options[option_index].name, "tet_param_z") == 0)
1595 +          {
1596 +          
1597 +            if (args_info->staticProps_group_counter && override)
1598 +              reset_group_staticProps (args_info);
1599 +            args_info->staticProps_group_counter += 1;
1600 +          
1601 +            if (update_arg( 0 ,
1602 +                 0 , &(args_info->tet_param_z_given),
1603 +                &(local_args_info.tet_param_z_given), optarg, 0, 0, ARG_NO,
1604 +                check_ambiguity, override, 0, 0,
1605 +                "tet_param_z", '-',
1606 +                additional_error))
1607 +              goto failure;
1608 +          
1609 +          }
1610 +          
1611            break;
1612          case '?':       /* Invalid option.  */
1613            /* `getopt_long' already printed an error message.  */
# Line 1418 | Line 1621 | cmdline_parser_internal (int argc, char * const *argv,
1621  
1622    if (args_info->staticProps_group_counter > 1)
1623      {
1624 <      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 : ""));
1624 >      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 : ""));
1625        error = 1;
1626      }
1627    

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines