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 2024 by gezelter, Thu Oct 16 19:13:51 2014 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 45 | Line 49 | const char *gengetopt_args_info_help[] = {
49    "  -s, --selecorr                selection correlation function",
50    "  -r, --rcorr                   rmsd",
51    "  -v, --vcorr                   velocity correlation function",
52 +  "      --vcorrZ                  velocity correlation function along z-axis",
53 +  "      --vcorrR                  velocity correlation function projected \n                                  radially",
54    "  -d, --dcorr                   dipole correlation function",
55    "  -l, --lcorr                   Lengendre correlation function",
56    "      --lcorrZ                  Lengendre correlation function binned by Z",
57 +  "      --cohZ                    Lengendre correlation function for OH bond \n                                  vectors binned by Z",
58    "  -M, --sdcorr                  System dipole correlation function",
59    "      --r_rcorr                 Radial rmsd",
60    "      --thetacorr               Angular rmsd",
# Line 55 | Line 62 | const char *gengetopt_args_info_help[] = {
62    "      --helfandEcorr            Helfand moment for thermal conductvity",
63    "  -p, --momentum                Helfand momentum for viscosity",
64    "      --stresscorr              Stress tensor correlation function",
65 +  "  -b, --bondcorr                Bond extension correlation function",
66 +  "  -f, --freqfluccorr            Frequency Fluctuation correlation function",
67      0
68   };
69  
# Line 93 | Line 102 | void clear_given (struct gengetopt_args_info *args_inf
102    args_info->selecorr_given = 0 ;
103    args_info->rcorr_given = 0 ;
104    args_info->vcorr_given = 0 ;
105 +  args_info->vcorrZ_given = 0 ;
106 +  args_info->vcorrR_given = 0 ;
107    args_info->dcorr_given = 0 ;
108    args_info->lcorr_given = 0 ;
109    args_info->lcorrZ_given = 0 ;
110 +  args_info->cohZ_given = 0 ;
111    args_info->sdcorr_given = 0 ;
112    args_info->r_rcorr_given = 0 ;
113    args_info->thetacorr_given = 0 ;
# Line 103 | Line 115 | void clear_given (struct gengetopt_args_info *args_inf
115    args_info->helfandEcorr_given = 0 ;
116    args_info->momentum_given = 0 ;
117    args_info->stresscorr_given = 0 ;
118 +  args_info->bondcorr_given = 0 ;
119 +  args_info->freqfluccorr_given = 0 ;
120    args_info->dynamicProps_group_counter = 0 ;
121   }
122  
# Line 143 | Line 157 | void init_args_info(struct gengetopt_args_info *args_i
157    args_info->selecorr_help = gengetopt_args_info_help[10] ;
158    args_info->rcorr_help = gengetopt_args_info_help[11] ;
159    args_info->vcorr_help = gengetopt_args_info_help[12] ;
160 <  args_info->dcorr_help = gengetopt_args_info_help[13] ;
161 <  args_info->lcorr_help = gengetopt_args_info_help[14] ;
162 <  args_info->lcorrZ_help = gengetopt_args_info_help[15] ;
163 <  args_info->sdcorr_help = gengetopt_args_info_help[16] ;
164 <  args_info->r_rcorr_help = gengetopt_args_info_help[17] ;
165 <  args_info->thetacorr_help = gengetopt_args_info_help[18] ;
166 <  args_info->drcorr_help = gengetopt_args_info_help[19] ;
167 <  args_info->helfandEcorr_help = gengetopt_args_info_help[20] ;
168 <  args_info->momentum_help = gengetopt_args_info_help[21] ;
169 <  args_info->stresscorr_help = gengetopt_args_info_help[22] ;
160 >  args_info->vcorrZ_help = gengetopt_args_info_help[13] ;
161 >  args_info->vcorrR_help = gengetopt_args_info_help[14] ;
162 >  args_info->dcorr_help = gengetopt_args_info_help[15] ;
163 >  args_info->lcorr_help = gengetopt_args_info_help[16] ;
164 >  args_info->lcorrZ_help = gengetopt_args_info_help[17] ;
165 >  args_info->cohZ_help = gengetopt_args_info_help[18] ;
166 >  args_info->sdcorr_help = gengetopt_args_info_help[19] ;
167 >  args_info->r_rcorr_help = gengetopt_args_info_help[20] ;
168 >  args_info->thetacorr_help = gengetopt_args_info_help[21] ;
169 >  args_info->drcorr_help = gengetopt_args_info_help[22] ;
170 >  args_info->helfandEcorr_help = gengetopt_args_info_help[23] ;
171 >  args_info->momentum_help = gengetopt_args_info_help[24] ;
172 >  args_info->stresscorr_help = gengetopt_args_info_help[25] ;
173 >  args_info->bondcorr_help = gengetopt_args_info_help[26] ;
174 >  args_info->freqfluccorr_help = gengetopt_args_info_help[27] ;
175    
176   }
177  
# Line 307 | Line 326 | cmdline_parser_dump(FILE *outfile, struct gengetopt_ar
326      write_into_file(outfile, "rcorr", 0, 0 );
327    if (args_info->vcorr_given)
328      write_into_file(outfile, "vcorr", 0, 0 );
329 +  if (args_info->vcorrZ_given)
330 +    write_into_file(outfile, "vcorrZ", 0, 0 );
331 +  if (args_info->vcorrR_given)
332 +    write_into_file(outfile, "vcorrR", 0, 0 );
333    if (args_info->dcorr_given)
334      write_into_file(outfile, "dcorr", 0, 0 );
335    if (args_info->lcorr_given)
336      write_into_file(outfile, "lcorr", 0, 0 );
337    if (args_info->lcorrZ_given)
338      write_into_file(outfile, "lcorrZ", 0, 0 );
339 +  if (args_info->cohZ_given)
340 +    write_into_file(outfile, "cohZ", 0, 0 );
341    if (args_info->sdcorr_given)
342      write_into_file(outfile, "sdcorr", 0, 0 );
343    if (args_info->r_rcorr_given)
# Line 327 | Line 352 | cmdline_parser_dump(FILE *outfile, struct gengetopt_ar
352      write_into_file(outfile, "momentum", 0, 0 );
353    if (args_info->stresscorr_given)
354      write_into_file(outfile, "stresscorr", 0, 0 );
355 +  if (args_info->bondcorr_given)
356 +    write_into_file(outfile, "bondcorr", 0, 0 );
357 +  if (args_info->freqfluccorr_given)
358 +    write_into_file(outfile, "freqfluccorr", 0, 0 );
359    
360  
361    i = EXIT_SUCCESS;
# Line 383 | Line 412 | reset_group_dynamicProps(struct gengetopt_args_info *a
412    args_info->selecorr_given = 0 ;
413    args_info->rcorr_given = 0 ;
414    args_info->vcorr_given = 0 ;
415 +  args_info->vcorrZ_given = 0 ;
416 +  args_info->vcorrR_given = 0 ;
417    args_info->dcorr_given = 0 ;
418    args_info->lcorr_given = 0 ;
419    args_info->lcorrZ_given = 0 ;
420 +  args_info->cohZ_given = 0 ;
421    args_info->sdcorr_given = 0 ;
422    args_info->r_rcorr_given = 0 ;
423    args_info->thetacorr_given = 0 ;
# Line 393 | Line 425 | reset_group_dynamicProps(struct gengetopt_args_info *a
425    args_info->helfandEcorr_given = 0 ;
426    args_info->momentum_given = 0 ;
427    args_info->stresscorr_given = 0 ;
428 +  args_info->bondcorr_given = 0 ;
429 +  args_info->freqfluccorr_given = 0 ;
430  
431    args_info->dynamicProps_group_counter = 0;
432   }
# Line 646 | Line 680 | cmdline_parser_internal (
680          { "selecorr",   0, NULL, 's' },
681          { "rcorr",      0, NULL, 'r' },
682          { "vcorr",      0, NULL, 'v' },
683 +        { "vcorrZ",     0, NULL, 0 },
684 +        { "vcorrR",     0, NULL, 0 },
685          { "dcorr",      0, NULL, 'd' },
686          { "lcorr",      0, NULL, 'l' },
687          { "lcorrZ",     0, NULL, 0 },
688 +        { "cohZ",       0, NULL, 0 },
689          { "sdcorr",     0, NULL, 'M' },
690          { "r_rcorr",    0, NULL, 0 },
691          { "thetacorr",  0, NULL, 0 },
# Line 656 | Line 693 | cmdline_parser_internal (
693          { "helfandEcorr",       0, NULL, 0 },
694          { "momentum",   0, NULL, 'p' },
695          { "stresscorr", 0, NULL, 0 },
696 +        { "bondcorr",   0, NULL, 'b' },
697 +        { "freqfluccorr",       0, NULL, 'f' },
698          { 0,  0, 0, 0 }
699        };
700  
701 <      c = getopt_long (argc, argv, "hVi:o:z:m:srvdlMp", long_options, &option_index);
701 >      c = getopt_long (argc, argv, "hVi:o:z:m:srvdlMpbf", long_options, &option_index);
702  
703        if (c == -1) break;       /* Exit from `while (1)' loop.  */
704  
# Line 824 | Line 863 | cmdline_parser_internal (
863                &(local_args_info.momentum_given), optarg, 0, 0, ARG_NO,
864                check_ambiguity, override, 0, 0,
865                "momentum", 'p',
866 +              additional_error))
867 +            goto failure;
868 +        
869 +          break;
870 +        case 'b':       /* Bond extension correlation function.  */
871 +        
872 +          if (args_info->dynamicProps_group_counter && override)
873 +            reset_group_dynamicProps (args_info);
874 +          args_info->dynamicProps_group_counter += 1;
875 +        
876 +          if (update_arg( 0 ,
877 +               0 , &(args_info->bondcorr_given),
878 +              &(local_args_info.bondcorr_given), optarg, 0, 0, ARG_NO,
879 +              check_ambiguity, override, 0, 0,
880 +              "bondcorr", 'b',
881                additional_error))
882              goto failure;
883          
884            break;
885 +        case 'f':       /* Frequency Fluctuation correlation function.  */
886 +        
887 +          if (args_info->dynamicProps_group_counter && override)
888 +            reset_group_dynamicProps (args_info);
889 +          args_info->dynamicProps_group_counter += 1;
890 +        
891 +          if (update_arg( 0 ,
892 +               0 , &(args_info->freqfluccorr_given),
893 +              &(local_args_info.freqfluccorr_given), optarg, 0, 0, ARG_NO,
894 +              check_ambiguity, override, 0, 0,
895 +              "freqfluccorr", 'f',
896 +              additional_error))
897 +            goto failure;
898 +        
899 +          break;
900  
901          case 0: /* Long option with no short option */
902            /* select first stuntdouble set.  */
# Line 872 | Line 941 | cmdline_parser_internal (
941                goto failure;
942            
943            }
944 +          /* velocity correlation function along z-axis.  */
945 +          else if (strcmp (long_options[option_index].name, "vcorrZ") == 0)
946 +          {
947 +          
948 +            if (args_info->dynamicProps_group_counter && override)
949 +              reset_group_dynamicProps (args_info);
950 +            args_info->dynamicProps_group_counter += 1;
951 +          
952 +            if (update_arg( 0 ,
953 +                 0 , &(args_info->vcorrZ_given),
954 +                &(local_args_info.vcorrZ_given), optarg, 0, 0, ARG_NO,
955 +                check_ambiguity, override, 0, 0,
956 +                "vcorrZ", '-',
957 +                additional_error))
958 +              goto failure;
959 +          
960 +          }
961 +          /* velocity correlation function projected radially.  */
962 +          else if (strcmp (long_options[option_index].name, "vcorrR") == 0)
963 +          {
964 +          
965 +            if (args_info->dynamicProps_group_counter && override)
966 +              reset_group_dynamicProps (args_info);
967 +            args_info->dynamicProps_group_counter += 1;
968 +          
969 +            if (update_arg( 0 ,
970 +                 0 , &(args_info->vcorrR_given),
971 +                &(local_args_info.vcorrR_given), optarg, 0, 0, ARG_NO,
972 +                check_ambiguity, override, 0, 0,
973 +                "vcorrR", '-',
974 +                additional_error))
975 +              goto failure;
976 +          
977 +          }
978            /* Lengendre correlation function binned by Z.  */
979            else if (strcmp (long_options[option_index].name, "lcorrZ") == 0)
980            {
# Line 889 | Line 992 | cmdline_parser_internal (
992                goto failure;
993            
994            }
995 +          /* Lengendre correlation function for OH bond vectors binned by Z.  */
996 +          else if (strcmp (long_options[option_index].name, "cohZ") == 0)
997 +          {
998 +          
999 +            if (args_info->dynamicProps_group_counter && override)
1000 +              reset_group_dynamicProps (args_info);
1001 +            args_info->dynamicProps_group_counter += 1;
1002 +          
1003 +            if (update_arg( 0 ,
1004 +                 0 , &(args_info->cohZ_given),
1005 +                &(local_args_info.cohZ_given), optarg, 0, 0, ARG_NO,
1006 +                check_ambiguity, override, 0, 0,
1007 +                "cohZ", '-',
1008 +                additional_error))
1009 +              goto failure;
1010 +          
1011 +          }
1012            /* Radial rmsd.  */
1013            else if (strcmp (long_options[option_index].name, "r_rcorr") == 0)
1014            {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines