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

Comparing trunk/src/applications/dynamicProps/DynamicPropsCmd.c (file contents):
Revision 1112 by chuckv, Wed Jan 3 20:47:00 2007 UTC vs.
Revision 1245 by chuckv, Tue May 27 16:39:06 2008 UTC

# Line 1 | Line 1
1   /*
2 <  File autogenerated by gengetopt version 2.15
2 >  File autogenerated by gengetopt version 2.14
3    generated with the following command:
4 <  gengetopt -u -i DynamicProps.ggo -F DynamicPropsCmd
4 >  gengetopt -i DynamicProps.ggo -F DynamicPropsCmd
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 51 | Line 51 | void clear_given (struct gengetopt_args_info *args_inf
51    args_info->lcorr_given = 0 ;
52    args_info->r_rcorr_given = 0 ;
53    args_info->thetacorr_given = 0 ;
54 +  args_info->drcorr_given = 0 ;
55 +  args_info->helfandEcorr_given = 0 ;
56    args_info->dynamicProps_group_counter = 0 ;
57   }
58  
# Line 79 | Line 81 | cmdline_parser_print_help (void)
81   cmdline_parser_print_help (void)
82   {
83    cmdline_parser_print_version ();
84 <  printf("\nUsage: DynamicProps [OPTIONS]... [FILES]...\n\n");
84 >  printf("\nUsage: DynamicProps [OPTIONS]...\n\n");
85    printf("%s\n","  -h, --help                    Print help and exit");
86    printf("%s\n","  -V, --version                 Print version and exit");
87    printf("%s\n","  -i, --input=filename          input dump file");
# Line 94 | Line 96 | cmdline_parser_print_help (void)
96    printf("%s\n","  -l, --lcorr                   Lengendre correlation function");
97    printf("%s\n","      --r_rcorr                 Radial rmsd");
98    printf("%s\n","      --thetacorr               Angular rmsd");
99 +  printf("%s\n","      --drcorr                  Directional rmsd for particles with unit \n                                  vectors");
100 +  printf("%s\n","      --helfandEcorr            Helfand moment for thermal conductvity");
101    
102   }
103  
# Line 102 | Line 106 | cmdline_parser_init (struct gengetopt_args_info *args_
106   {
107    clear_given (args_info);
108    clear_args (args_info);
105
106  args_info->inputs = NULL;
107  args_info->inputs_num = 0;
109   }
110  
111   static void
112   cmdline_parser_release (struct gengetopt_args_info *args_info)
113   {
114    
114  unsigned int i;
115    if (args_info->input_arg)
116      {
117        free (args_info->input_arg); /* free previous argument */
# Line 157 | Line 157 | cmdline_parser_release (struct gengetopt_args_info *ar
157        free (args_info->order_orig); /* free previous argument */
158        args_info->order_orig = 0;
159      }
160  
161  for (i = 0; i < args_info->inputs_num; ++i)
162    free (args_info->inputs [i]);
163  
164  if (args_info->inputs_num)
165    free (args_info->inputs);
160    
161    clear_given (args_info);
162   }
# Line 240 | Line 234 | cmdline_parser_file_save(const char *filename, struct
234    if (args_info->thetacorr_given) {
235      fprintf(outfile, "%s\n", "thetacorr");
236    }
237 +  if (args_info->drcorr_given) {
238 +    fprintf(outfile, "%s\n", "drcorr");
239 +  }
240 +  if (args_info->helfandEcorr_given) {
241 +    fprintf(outfile, "%s\n", "helfandEcorr");
242 +  }
243    
244    fclose (outfile);
245  
# Line 285 | Line 285 | reset_group_dynamicProps(struct gengetopt_args_info *a
285    args_info->lcorr_given = 0 ;
286    args_info->r_rcorr_given = 0 ;
287    args_info->thetacorr_given = 0 ;
288 +  args_info->drcorr_given = 0 ;
289 +  args_info->helfandEcorr_given = 0 ;
290  
291    args_info->dynamicProps_group_counter = 0;
292   }
# Line 385 | Line 387 | cmdline_parser_internal (int argc, char * const *argv,
387          { "lcorr",      0, NULL, 'l' },
388          { "r_rcorr",    0, NULL, 0 },
389          { "thetacorr",  0, NULL, 0 },
390 +        { "drcorr",     0, NULL, 0 },
391 +        { "helfandEcorr",       0, NULL, 0 },
392          { NULL, 0, NULL, 0 }
393        };
394  
# Line 553 | Line 557 | cmdline_parser_internal (int argc, char * const *argv,
557                continue;
558              local_args_info.order_given = 1;
559              args_info->order_given = 1;
560 <            args_info->order_arg = strtol (optarg, &stop_char, 0);
557 <            if (!(stop_char && *stop_char == '\0')) {
558 <              fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg);
559 <              goto failure;
560 <            }
560 >            args_info->order_arg = strtol (optarg,&stop_char,0);
561              if (args_info->order_orig)
562                free (args_info->order_orig); /* free previous string */
563              args_info->order_orig = gengetopt_strdup (optarg);
# Line 596 | Line 596 | cmdline_parser_internal (int argc, char * const *argv,
596              args_info->dynamicProps_group_counter += 1;
597              break;
598            }
599 +          /* Directional rmsd for particles with unit vectors.  */
600 +          else if (strcmp (long_options[option_index].name, "drcorr") == 0)
601 +          {
602 +            if (local_args_info.drcorr_given)
603 +              {
604 +                fprintf (stderr, "%s: `--drcorr' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
605 +                goto failure;
606 +              }
607 +            if (args_info->drcorr_given && ! override)
608 +              continue;
609 +            local_args_info.drcorr_given = 1;
610 +            args_info->drcorr_given = 1;
611 +            if (args_info->dynamicProps_group_counter && override)
612 +              reset_group_dynamicProps (args_info);
613 +            args_info->dynamicProps_group_counter += 1;
614 +            break;
615 +          }
616 +          /* Helfand moment for thermal conductvity.  */
617 +          else if (strcmp (long_options[option_index].name, "helfandEcorr") == 0)
618 +          {
619 +            if (local_args_info.helfandEcorr_given)
620 +              {
621 +                fprintf (stderr, "%s: `--helfandEcorr' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
622 +                goto failure;
623 +              }
624 +            if (args_info->helfandEcorr_given && ! override)
625 +              continue;
626 +            local_args_info.helfandEcorr_given = 1;
627 +            args_info->helfandEcorr_given = 1;
628 +            if (args_info->dynamicProps_group_counter && override)
629 +              reset_group_dynamicProps (args_info);
630 +            args_info->dynamicProps_group_counter += 1;
631 +            break;
632 +          }
633            
634            break;
635          case '?':       /* Invalid option.  */
# Line 626 | Line 660 | cmdline_parser_internal (int argc, char * const *argv,
660    if ( error )
661      return (EXIT_FAILURE);
662  
629  if (optind < argc)
630    {
631      int i = 0 ;
632
633      args_info->inputs_num = argc - optind ;
634      args_info->inputs =
635        (char **)(malloc ((args_info->inputs_num)*sizeof(char *))) ;
636      while (optind < argc)
637        args_info->inputs[ i++ ] = gengetopt_strdup (argv[optind++]) ;
638    }
639
663    return 0;
664  
665   failure:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines