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 1390 by gezelter, Wed Nov 25 20:02:06 2009 UTC vs.
Revision 1440 by gezelter, Thu Apr 29 14:41:48 2010 UTC

# Line 1 | Line 1
1   /*
2    File autogenerated by gengetopt version 2.22
3    generated with the following command:
4 <  gengetopt -F StaticPropsCmd
4 >  gengetopt -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 23 | Line 23 | const char *gengetopt_args_info_purpose = "";
23  
24   const char *gengetopt_args_info_purpose = "";
25  
26 < const char *gengetopt_args_info_usage = "Usage: StaticProps [OPTIONS]...";
26 > const char *gengetopt_args_info_usage = "Usage: StaticProps [OPTIONS]... [FILES]...";
27  
28   const char *gengetopt_args_info_description = "";
29  
# Line 36 | Line 36 | const char *gengetopt_args_info_help[] = {
36    "  -b, --nbins=INT               number of bins (general purpose)  \n                                  (default=`100')",
37    "  -x, --nbins_x=INT             number of bins in x axis  (default=`100')",
38    "  -y, --nbins_y=INT             number of bins in y axis  (default=`100')",
39 +  "      --nbins_z=INT             number of bins in z axis  (default=`100')",
40    "  -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)",
42    "  -c, --rcut=DOUBLE             cutoff radius (rcut)",
# Line 57 | Line 58 | const char *gengetopt_args_info_help[] = {
58    "      --gofz                    g(z)",
59    "      --r_theta                 g(r, cos(theta))",
60    "      --r_omega                 g(r, cos(omega))",
61 +  "      --r_z                     g(r, z)",
62    "      --theta_omega             g(cos(theta), cos(omega))",
63    "      --gxyz                    g(x, y, z)",
64    "  -p, --p2                      p2 order parameter (--sele1 and --sele2 must be \n                                  specified)",
# Line 64 | Line 66 | const char *gengetopt_args_info_help[] = {
66    "  -s, --scd                     scd order parameter (either --sele1, --sele2, \n                                  --sele3 are specified or --molname, --begin, \n                                  --end are specified)",
67    "  -d, --density                 density plot",
68    "      --slab_density            slab density",
69 +  "      --p_angle                 p(cos(theta))",
70    "      --hxy                     hxy",
71    "      --rho_r                   rho of R",
72    "      --hullvol                 hull volume of nanoparticle",
# Line 102 | Line 105 | void clear_given (struct gengetopt_args_info *args_inf
105    args_info->nbins_given = 0 ;
106    args_info->nbins_x_given = 0 ;
107    args_info->nbins_y_given = 0 ;
108 +  args_info->nbins_z_given = 0 ;
109    args_info->nanglebins_given = 0 ;
110    args_info->length_given = 0 ;
111    args_info->rcut_given = 0 ;
# Line 122 | Line 126 | void clear_given (struct gengetopt_args_info *args_inf
126    args_info->gofz_given = 0 ;
127    args_info->r_theta_given = 0 ;
128    args_info->r_omega_given = 0 ;
129 +  args_info->r_z_given = 0 ;
130    args_info->theta_omega_given = 0 ;
131    args_info->gxyz_given = 0 ;
132    args_info->p2_given = 0 ;
# Line 129 | Line 134 | void clear_given (struct gengetopt_args_info *args_inf
134    args_info->scd_given = 0 ;
135    args_info->density_given = 0 ;
136    args_info->slab_density_given = 0 ;
137 +  args_info->p_angle_given = 0 ;
138    args_info->hxy_given = 0 ;
139    args_info->rho_r_given = 0 ;
140    args_info->hullvol_given = 0 ;
# Line 150 | Line 156 | void clear_args (struct gengetopt_args_info *args_info
156    args_info->nbins_x_orig = NULL;
157    args_info->nbins_y_arg = 100;
158    args_info->nbins_y_orig = NULL;
159 +  args_info->nbins_z_arg = 100;
160 +  args_info->nbins_z_orig = NULL;
161    args_info->nanglebins_arg = 50;
162    args_info->nanglebins_orig = NULL;
163    args_info->length_orig = NULL;
# Line 187 | Line 195 | void init_args_info(struct gengetopt_args_info *args_i
195    args_info->nbins_help = gengetopt_args_info_help[5] ;
196    args_info->nbins_x_help = gengetopt_args_info_help[6] ;
197    args_info->nbins_y_help = gengetopt_args_info_help[7] ;
198 <  args_info->nanglebins_help = gengetopt_args_info_help[8] ;
199 <  args_info->length_help = gengetopt_args_info_help[9] ;
200 <  args_info->rcut_help = gengetopt_args_info_help[10] ;
201 <  args_info->zoffset_help = gengetopt_args_info_help[11] ;
202 <  args_info->sele1_help = gengetopt_args_info_help[12] ;
203 <  args_info->sele2_help = gengetopt_args_info_help[13] ;
204 <  args_info->sele3_help = gengetopt_args_info_help[14] ;
205 <  args_info->refsele_help = gengetopt_args_info_help[15] ;
206 <  args_info->comsele_help = gengetopt_args_info_help[16] ;
207 <  args_info->molname_help = gengetopt_args_info_help[17] ;
208 <  args_info->begin_help = gengetopt_args_info_help[18] ;
209 <  args_info->end_help = gengetopt_args_info_help[19] ;
210 <  args_info->radius_help = gengetopt_args_info_help[20] ;
211 <  args_info->bo_help = gengetopt_args_info_help[22] ;
212 <  args_info->bor_help = gengetopt_args_info_help[23] ;
213 <  args_info->bad_help = gengetopt_args_info_help[24] ;
214 <  args_info->gofr_help = gengetopt_args_info_help[25] ;
215 <  args_info->gofz_help = gengetopt_args_info_help[26] ;
216 <  args_info->r_theta_help = gengetopt_args_info_help[27] ;
217 <  args_info->r_omega_help = gengetopt_args_info_help[28] ;
218 <  args_info->theta_omega_help = gengetopt_args_info_help[29] ;
219 <  args_info->gxyz_help = gengetopt_args_info_help[30] ;
220 <  args_info->p2_help = gengetopt_args_info_help[31] ;
221 <  args_info->rp2_help = gengetopt_args_info_help[32] ;
222 <  args_info->scd_help = gengetopt_args_info_help[33] ;
223 <  args_info->density_help = gengetopt_args_info_help[34] ;
224 <  args_info->slab_density_help = gengetopt_args_info_help[35] ;
225 <  args_info->hxy_help = gengetopt_args_info_help[36] ;
226 <  args_info->rho_r_help = gengetopt_args_info_help[37] ;
227 <  args_info->hullvol_help = gengetopt_args_info_help[38] ;
198 >  args_info->nbins_z_help = gengetopt_args_info_help[8] ;
199 >  args_info->nanglebins_help = gengetopt_args_info_help[9] ;
200 >  args_info->length_help = gengetopt_args_info_help[10] ;
201 >  args_info->rcut_help = gengetopt_args_info_help[11] ;
202 >  args_info->zoffset_help = gengetopt_args_info_help[12] ;
203 >  args_info->sele1_help = gengetopt_args_info_help[13] ;
204 >  args_info->sele2_help = gengetopt_args_info_help[14] ;
205 >  args_info->sele3_help = gengetopt_args_info_help[15] ;
206 >  args_info->refsele_help = gengetopt_args_info_help[16] ;
207 >  args_info->comsele_help = gengetopt_args_info_help[17] ;
208 >  args_info->molname_help = gengetopt_args_info_help[18] ;
209 >  args_info->begin_help = gengetopt_args_info_help[19] ;
210 >  args_info->end_help = gengetopt_args_info_help[20] ;
211 >  args_info->radius_help = gengetopt_args_info_help[21] ;
212 >  args_info->bo_help = gengetopt_args_info_help[23] ;
213 >  args_info->bor_help = gengetopt_args_info_help[24] ;
214 >  args_info->bad_help = gengetopt_args_info_help[25] ;
215 >  args_info->gofr_help = gengetopt_args_info_help[26] ;
216 >  args_info->gofz_help = gengetopt_args_info_help[27] ;
217 >  args_info->r_theta_help = gengetopt_args_info_help[28] ;
218 >  args_info->r_omega_help = gengetopt_args_info_help[29] ;
219 >  args_info->r_z_help = gengetopt_args_info_help[30] ;
220 >  args_info->theta_omega_help = gengetopt_args_info_help[31] ;
221 >  args_info->gxyz_help = gengetopt_args_info_help[32] ;
222 >  args_info->p2_help = gengetopt_args_info_help[33] ;
223 >  args_info->rp2_help = gengetopt_args_info_help[34] ;
224 >  args_info->scd_help = gengetopt_args_info_help[35] ;
225 >  args_info->density_help = gengetopt_args_info_help[36] ;
226 >  args_info->slab_density_help = gengetopt_args_info_help[37] ;
227 >  args_info->p_angle_help = gengetopt_args_info_help[38] ;
228 >  args_info->hxy_help = gengetopt_args_info_help[39] ;
229 >  args_info->rho_r_help = gengetopt_args_info_help[40] ;
230 >  args_info->hullvol_help = gengetopt_args_info_help[41] ;
231    
232   }
233  
# Line 256 | Line 267 | cmdline_parser_init (struct gengetopt_args_info *args_
267    clear_given (args_info);
268    clear_args (args_info);
269    init_args_info (args_info);
270 +
271 +  args_info->inputs = NULL;
272 +  args_info->inputs_num = 0;
273   }
274  
275   void
# Line 294 | Line 308 | cmdline_parser_release (struct gengetopt_args_info *ar
308   static void
309   cmdline_parser_release (struct gengetopt_args_info *args_info)
310   {
311 <
311 >  unsigned int i;
312    free_string_field (&(args_info->input_arg));
313    free_string_field (&(args_info->input_orig));
314    free_string_field (&(args_info->output_arg));
# Line 303 | Line 317 | cmdline_parser_release (struct gengetopt_args_info *ar
317    free_string_field (&(args_info->nbins_orig));
318    free_string_field (&(args_info->nbins_x_orig));
319    free_string_field (&(args_info->nbins_y_orig));
320 +  free_string_field (&(args_info->nbins_z_orig));
321    free_string_field (&(args_info->nanglebins_orig));
322    free_string_field (&(args_info->length_orig));
323    free_string_field (&(args_info->rcut_orig));
# Line 324 | Line 339 | cmdline_parser_release (struct gengetopt_args_info *ar
339    free_string_field (&(args_info->radius_orig));
340    
341    
342 +  for (i = 0; i < args_info->inputs_num; ++i)
343 +    free (args_info->inputs [i]);
344  
345 +  if (args_info->inputs_num)
346 +    free (args_info->inputs);
347 +
348    clear_given (args_info);
349   }
350  
# Line 367 | Line 387 | cmdline_parser_dump(FILE *outfile, struct gengetopt_ar
387      write_into_file(outfile, "nbins_x", args_info->nbins_x_orig, 0);
388    if (args_info->nbins_y_given)
389      write_into_file(outfile, "nbins_y", args_info->nbins_y_orig, 0);
390 +  if (args_info->nbins_z_given)
391 +    write_into_file(outfile, "nbins_z", args_info->nbins_z_orig, 0);
392    if (args_info->nanglebins_given)
393      write_into_file(outfile, "nanglebins", args_info->nanglebins_orig, 0);
394    if (args_info->length_given)
# Line 407 | Line 429 | cmdline_parser_dump(FILE *outfile, struct gengetopt_ar
429      write_into_file(outfile, "r_theta", 0, 0 );
430    if (args_info->r_omega_given)
431      write_into_file(outfile, "r_omega", 0, 0 );
432 +  if (args_info->r_z_given)
433 +    write_into_file(outfile, "r_z", 0, 0 );
434    if (args_info->theta_omega_given)
435      write_into_file(outfile, "theta_omega", 0, 0 );
436    if (args_info->gxyz_given)
# Line 421 | Line 445 | cmdline_parser_dump(FILE *outfile, struct gengetopt_ar
445      write_into_file(outfile, "density", 0, 0 );
446    if (args_info->slab_density_given)
447      write_into_file(outfile, "slab_density", 0, 0 );
448 +  if (args_info->p_angle_given)
449 +    write_into_file(outfile, "p_angle", 0, 0 );
450    if (args_info->hxy_given)
451      write_into_file(outfile, "hxy", 0, 0 );
452    if (args_info->rho_r_given)
# Line 487 | Line 513 | reset_group_staticProps(struct gengetopt_args_info *ar
513    args_info->gofz_given = 0 ;
514    args_info->r_theta_given = 0 ;
515    args_info->r_omega_given = 0 ;
516 +  args_info->r_z_given = 0 ;
517    args_info->theta_omega_given = 0 ;
518    args_info->gxyz_given = 0 ;
519    args_info->p2_given = 0 ;
# Line 494 | Line 521 | reset_group_staticProps(struct gengetopt_args_info *ar
521    args_info->scd_given = 0 ;
522    args_info->density_given = 0 ;
523    args_info->slab_density_given = 0 ;
524 +  args_info->p_angle_given = 0 ;
525    args_info->hxy_given = 0 ;
526    args_info->rho_r_given = 0 ;
527    args_info->hullvol_given = 0 ;
# Line 745 | Line 773 | cmdline_parser_internal (int argc, char * const *argv,
773          { "nbins",      1, NULL, 'b' },
774          { "nbins_x",    1, NULL, 'x' },
775          { "nbins_y",    1, NULL, 'y' },
776 +        { "nbins_z",    1, NULL, 0 },
777          { "nanglebins", 1, NULL, 'a' },
778          { "length",     1, NULL, 0 },
779          { "rcut",       1, NULL, 'c' },
# Line 765 | Line 794 | cmdline_parser_internal (int argc, char * const *argv,
794          { "gofz",       0, NULL, 0 },
795          { "r_theta",    0, NULL, 0 },
796          { "r_omega",    0, NULL, 0 },
797 +        { "r_z",        0, NULL, 0 },
798          { "theta_omega",        0, NULL, 0 },
799          { "gxyz",       0, NULL, 0 },
800          { "p2", 0, NULL, 'p' },
# Line 772 | Line 802 | cmdline_parser_internal (int argc, char * const *argv,
802          { "scd",        0, NULL, 's' },
803          { "density",    0, NULL, 'd' },
804          { "slab_density",       0, NULL, 0 },
805 +        { "p_angle",    0, NULL, 0 },
806          { "hxy",        0, NULL, 0 },
807          { "rho_r",      0, NULL, 0 },
808          { "hullvol",    0, NULL, 0 },
# Line 964 | Line 995 | cmdline_parser_internal (int argc, char * const *argv,
995            break;
996  
997          case 0: /* Long option with no short option */
998 +          /* number of bins in z axis.  */
999 +          if (strcmp (long_options[option_index].name, "nbins_z") == 0)
1000 +          {
1001 +          
1002 +          
1003 +            if (update_arg( (void *)&(args_info->nbins_z_arg),
1004 +                 &(args_info->nbins_z_orig), &(args_info->nbins_z_given),
1005 +                &(local_args_info.nbins_z_given), optarg, 0, "100", ARG_INT,
1006 +                check_ambiguity, override, 0, 0,
1007 +                "nbins_z", '-',
1008 +                additional_error))
1009 +              goto failure;
1010 +          
1011 +          }
1012            /* maximum length (Defaults to 1/2 smallest length of first frame).  */
1013 <          if (strcmp (long_options[option_index].name, "length") == 0)
1013 >          else if (strcmp (long_options[option_index].name, "length") == 0)
1014            {
1015            
1016            
# Line 1206 | Line 1251 | cmdline_parser_internal (int argc, char * const *argv,
1251                goto failure;
1252            
1253            }
1254 +          /* g(r, z).  */
1255 +          else if (strcmp (long_options[option_index].name, "r_z") == 0)
1256 +          {
1257 +          
1258 +            if (args_info->staticProps_group_counter && override)
1259 +              reset_group_staticProps (args_info);
1260 +            args_info->staticProps_group_counter += 1;
1261 +          
1262 +            if (update_arg( 0 ,
1263 +                 0 , &(args_info->r_z_given),
1264 +                &(local_args_info.r_z_given), optarg, 0, 0, ARG_NO,
1265 +                check_ambiguity, override, 0, 0,
1266 +                "r_z", '-',
1267 +                additional_error))
1268 +              goto failure;
1269 +          
1270 +          }
1271            /* g(cos(theta), cos(omega)).  */
1272            else if (strcmp (long_options[option_index].name, "theta_omega") == 0)
1273            {
# Line 1274 | Line 1336 | cmdline_parser_internal (int argc, char * const *argv,
1336                goto failure;
1337            
1338            }
1339 +          /* p(cos(theta)).  */
1340 +          else if (strcmp (long_options[option_index].name, "p_angle") == 0)
1341 +          {
1342 +          
1343 +            if (args_info->staticProps_group_counter && override)
1344 +              reset_group_staticProps (args_info);
1345 +            args_info->staticProps_group_counter += 1;
1346 +          
1347 +            if (update_arg( 0 ,
1348 +                 0 , &(args_info->p_angle_given),
1349 +                &(local_args_info.p_angle_given), optarg, 0, 0, ARG_NO,
1350 +                check_ambiguity, override, 0, 0,
1351 +                "p_angle", '-',
1352 +                additional_error))
1353 +              goto failure;
1354 +          
1355 +          }
1356            /* hxy.  */
1357            else if (strcmp (long_options[option_index].name, "hxy") == 0)
1358            {
# Line 1355 | Line 1434 | cmdline_parser_internal (int argc, char * const *argv,
1434    if ( error )
1435      return (EXIT_FAILURE);
1436  
1437 +  if (optind < argc)
1438 +    {
1439 +      int i = 0 ;
1440 +      int found_prog_name = 0;
1441 +      /* whether program name, i.e., argv[0], is in the remaining args
1442 +         (this may happen with some implementations of getopt,
1443 +          but surely not with the one included by gengetopt) */
1444 +
1445 +      i = optind;
1446 +      while (i < argc)
1447 +        if (argv[i++] == argv[0]) {
1448 +          found_prog_name = 1;
1449 +          break;
1450 +        }
1451 +      i = 0;
1452 +
1453 +      args_info->inputs_num = argc - optind - found_prog_name;
1454 +      args_info->inputs =
1455 +        (char **)(malloc ((args_info->inputs_num)*sizeof(char *))) ;
1456 +      while (optind < argc)
1457 +        if (argv[optind++] != argv[0])
1458 +          args_info->inputs[ i++ ] = gengetopt_strdup (argv[optind-1]) ;
1459 +    }
1460 +
1461    return 0;
1462  
1463   failure:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines