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.cpp (file contents):
Revision 1915 by gezelter, Mon Jul 29 17:55:17 2013 UTC vs.
Revision 1953 by gezelter, Thu Dec 5 18:19:26 2013 UTC

# Line 21 | Line 21
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 "DynamicPropsCmd.h"
31  
# Line 48 | Line 52 | const char *gengetopt_args_info_help[] = {
52    "  -d, --dcorr                   dipole correlation function",
53    "  -l, --lcorr                   Lengendre correlation function",
54    "      --lcorrZ                  Lengendre correlation function binned by Z",
55 +  "      --cohZ                    Lengendre correlation function for OH bond \n                                  vectors binned by Z",
56    "  -M, --sdcorr                  System dipole correlation function",
57    "      --r_rcorr                 Radial rmsd",
58    "      --thetacorr               Angular rmsd",
# Line 55 | Line 60 | const char *gengetopt_args_info_help[] = {
60    "      --helfandEcorr            Helfand moment for thermal conductvity",
61    "  -p, --momentum                Helfand momentum for viscosity",
62    "      --stresscorr              Stress tensor correlation function",
63 +  "  -b, --bondcorr                Bond extension correlation function",
64      0
65   };
66  
# Line 96 | Line 102 | void clear_given (struct gengetopt_args_info *args_inf
102    args_info->dcorr_given = 0 ;
103    args_info->lcorr_given = 0 ;
104    args_info->lcorrZ_given = 0 ;
105 +  args_info->cohZ_given = 0 ;
106    args_info->sdcorr_given = 0 ;
107    args_info->r_rcorr_given = 0 ;
108    args_info->thetacorr_given = 0 ;
# Line 103 | Line 110 | void clear_given (struct gengetopt_args_info *args_inf
110    args_info->helfandEcorr_given = 0 ;
111    args_info->momentum_given = 0 ;
112    args_info->stresscorr_given = 0 ;
113 +  args_info->bondcorr_given = 0 ;
114    args_info->dynamicProps_group_counter = 0 ;
115   }
116  
# Line 146 | Line 154 | void init_args_info(struct gengetopt_args_info *args_i
154    args_info->dcorr_help = gengetopt_args_info_help[13] ;
155    args_info->lcorr_help = gengetopt_args_info_help[14] ;
156    args_info->lcorrZ_help = gengetopt_args_info_help[15] ;
157 <  args_info->sdcorr_help = gengetopt_args_info_help[16] ;
158 <  args_info->r_rcorr_help = gengetopt_args_info_help[17] ;
159 <  args_info->thetacorr_help = gengetopt_args_info_help[18] ;
160 <  args_info->drcorr_help = gengetopt_args_info_help[19] ;
161 <  args_info->helfandEcorr_help = gengetopt_args_info_help[20] ;
162 <  args_info->momentum_help = gengetopt_args_info_help[21] ;
163 <  args_info->stresscorr_help = gengetopt_args_info_help[22] ;
157 >  args_info->cohZ_help = gengetopt_args_info_help[16] ;
158 >  args_info->sdcorr_help = gengetopt_args_info_help[17] ;
159 >  args_info->r_rcorr_help = gengetopt_args_info_help[18] ;
160 >  args_info->thetacorr_help = gengetopt_args_info_help[19] ;
161 >  args_info->drcorr_help = gengetopt_args_info_help[20] ;
162 >  args_info->helfandEcorr_help = gengetopt_args_info_help[21] ;
163 >  args_info->momentum_help = gengetopt_args_info_help[22] ;
164 >  args_info->stresscorr_help = gengetopt_args_info_help[23] ;
165 >  args_info->bondcorr_help = gengetopt_args_info_help[24] ;
166    
167   }
168  
# Line 313 | Line 323 | cmdline_parser_dump(FILE *outfile, struct gengetopt_ar
323      write_into_file(outfile, "lcorr", 0, 0 );
324    if (args_info->lcorrZ_given)
325      write_into_file(outfile, "lcorrZ", 0, 0 );
326 +  if (args_info->cohZ_given)
327 +    write_into_file(outfile, "cohZ", 0, 0 );
328    if (args_info->sdcorr_given)
329      write_into_file(outfile, "sdcorr", 0, 0 );
330    if (args_info->r_rcorr_given)
# Line 327 | Line 339 | cmdline_parser_dump(FILE *outfile, struct gengetopt_ar
339      write_into_file(outfile, "momentum", 0, 0 );
340    if (args_info->stresscorr_given)
341      write_into_file(outfile, "stresscorr", 0, 0 );
342 +  if (args_info->bondcorr_given)
343 +    write_into_file(outfile, "bondcorr", 0, 0 );
344    
345  
346    i = EXIT_SUCCESS;
# Line 386 | Line 400 | reset_group_dynamicProps(struct gengetopt_args_info *a
400    args_info->dcorr_given = 0 ;
401    args_info->lcorr_given = 0 ;
402    args_info->lcorrZ_given = 0 ;
403 +  args_info->cohZ_given = 0 ;
404    args_info->sdcorr_given = 0 ;
405    args_info->r_rcorr_given = 0 ;
406    args_info->thetacorr_given = 0 ;
# Line 393 | Line 408 | reset_group_dynamicProps(struct gengetopt_args_info *a
408    args_info->helfandEcorr_given = 0 ;
409    args_info->momentum_given = 0 ;
410    args_info->stresscorr_given = 0 ;
411 +  args_info->bondcorr_given = 0 ;
412  
413    args_info->dynamicProps_group_counter = 0;
414   }
# Line 649 | Line 665 | cmdline_parser_internal (
665          { "dcorr",      0, NULL, 'd' },
666          { "lcorr",      0, NULL, 'l' },
667          { "lcorrZ",     0, NULL, 0 },
668 +        { "cohZ",       0, NULL, 0 },
669          { "sdcorr",     0, NULL, 'M' },
670          { "r_rcorr",    0, NULL, 0 },
671          { "thetacorr",  0, NULL, 0 },
# Line 656 | Line 673 | cmdline_parser_internal (
673          { "helfandEcorr",       0, NULL, 0 },
674          { "momentum",   0, NULL, 'p' },
675          { "stresscorr", 0, NULL, 0 },
676 +        { "bondcorr",   0, NULL, 'b' },
677          { 0,  0, 0, 0 }
678        };
679  
680 <      c = getopt_long (argc, argv, "hVi:o:z:m:srvdlMp", long_options, &option_index);
680 >      c = getopt_long (argc, argv, "hVi:o:z:m:srvdlMpb", long_options, &option_index);
681  
682        if (c == -1) break;       /* Exit from `while (1)' loop.  */
683  
# Line 828 | Line 846 | cmdline_parser_internal (
846              goto failure;
847          
848            break;
849 +        case 'b':       /* Bond extension correlation function.  */
850 +        
851 +          if (args_info->dynamicProps_group_counter && override)
852 +            reset_group_dynamicProps (args_info);
853 +          args_info->dynamicProps_group_counter += 1;
854 +        
855 +          if (update_arg( 0 ,
856 +               0 , &(args_info->bondcorr_given),
857 +              &(local_args_info.bondcorr_given), optarg, 0, 0, ARG_NO,
858 +              check_ambiguity, override, 0, 0,
859 +              "bondcorr", 'b',
860 +              additional_error))
861 +            goto failure;
862 +        
863 +          break;
864  
865          case 0: /* Long option with no short option */
866            /* select first stuntdouble set.  */
# Line 885 | Line 918 | cmdline_parser_internal (
918                  &(local_args_info.lcorrZ_given), optarg, 0, 0, ARG_NO,
919                  check_ambiguity, override, 0, 0,
920                  "lcorrZ", '-',
921 +                additional_error))
922 +              goto failure;
923 +          
924 +          }
925 +          /* Lengendre correlation function for OH bond vectors binned by Z.  */
926 +          else if (strcmp (long_options[option_index].name, "cohZ") == 0)
927 +          {
928 +          
929 +            if (args_info->dynamicProps_group_counter && override)
930 +              reset_group_dynamicProps (args_info);
931 +            args_info->dynamicProps_group_counter += 1;
932 +          
933 +            if (update_arg( 0 ,
934 +                 0 , &(args_info->cohZ_given),
935 +                &(local_args_info.cohZ_given), optarg, 0, 0, ARG_NO,
936 +                check_ambiguity, override, 0, 0,
937 +                "cohZ", '-',
938                  additional_error))
939                goto failure;
940            

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines