--- trunk/src/applications/dynamicProps/DynamicPropsCmd.cpp 2013/07/29 17:55:17 1915 +++ trunk/src/applications/dynamicProps/DynamicPropsCmd.cpp 2014/10/16 19:13:51 2024 @@ -21,7 +21,11 @@ #define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */ #endif +#ifdef WIN32 +#include "utils/wingetopt.h" +#else #include +#endif #include "DynamicPropsCmd.h" @@ -45,9 +49,12 @@ const char *gengetopt_args_info_help[] = { " -s, --selecorr selection correlation function", " -r, --rcorr rmsd", " -v, --vcorr velocity correlation function", + " --vcorrZ velocity correlation function along z-axis", + " --vcorrR velocity correlation function projected \n radially", " -d, --dcorr dipole correlation function", " -l, --lcorr Lengendre correlation function", " --lcorrZ Lengendre correlation function binned by Z", + " --cohZ Lengendre correlation function for OH bond \n vectors binned by Z", " -M, --sdcorr System dipole correlation function", " --r_rcorr Radial rmsd", " --thetacorr Angular rmsd", @@ -55,6 +62,8 @@ const char *gengetopt_args_info_help[] = { " --helfandEcorr Helfand moment for thermal conductvity", " -p, --momentum Helfand momentum for viscosity", " --stresscorr Stress tensor correlation function", + " -b, --bondcorr Bond extension correlation function", + " -f, --freqfluccorr Frequency Fluctuation correlation function", 0 }; @@ -93,9 +102,12 @@ void clear_given (struct gengetopt_args_info *args_inf args_info->selecorr_given = 0 ; args_info->rcorr_given = 0 ; args_info->vcorr_given = 0 ; + args_info->vcorrZ_given = 0 ; + args_info->vcorrR_given = 0 ; args_info->dcorr_given = 0 ; args_info->lcorr_given = 0 ; args_info->lcorrZ_given = 0 ; + args_info->cohZ_given = 0 ; args_info->sdcorr_given = 0 ; args_info->r_rcorr_given = 0 ; args_info->thetacorr_given = 0 ; @@ -103,6 +115,8 @@ void clear_given (struct gengetopt_args_info *args_inf args_info->helfandEcorr_given = 0 ; args_info->momentum_given = 0 ; args_info->stresscorr_given = 0 ; + args_info->bondcorr_given = 0 ; + args_info->freqfluccorr_given = 0 ; args_info->dynamicProps_group_counter = 0 ; } @@ -143,16 +157,21 @@ void init_args_info(struct gengetopt_args_info *args_i args_info->selecorr_help = gengetopt_args_info_help[10] ; args_info->rcorr_help = gengetopt_args_info_help[11] ; args_info->vcorr_help = gengetopt_args_info_help[12] ; - args_info->dcorr_help = gengetopt_args_info_help[13] ; - args_info->lcorr_help = gengetopt_args_info_help[14] ; - args_info->lcorrZ_help = gengetopt_args_info_help[15] ; - args_info->sdcorr_help = gengetopt_args_info_help[16] ; - args_info->r_rcorr_help = gengetopt_args_info_help[17] ; - args_info->thetacorr_help = gengetopt_args_info_help[18] ; - args_info->drcorr_help = gengetopt_args_info_help[19] ; - args_info->helfandEcorr_help = gengetopt_args_info_help[20] ; - args_info->momentum_help = gengetopt_args_info_help[21] ; - args_info->stresscorr_help = gengetopt_args_info_help[22] ; + args_info->vcorrZ_help = gengetopt_args_info_help[13] ; + args_info->vcorrR_help = gengetopt_args_info_help[14] ; + args_info->dcorr_help = gengetopt_args_info_help[15] ; + args_info->lcorr_help = gengetopt_args_info_help[16] ; + args_info->lcorrZ_help = gengetopt_args_info_help[17] ; + args_info->cohZ_help = gengetopt_args_info_help[18] ; + args_info->sdcorr_help = gengetopt_args_info_help[19] ; + args_info->r_rcorr_help = gengetopt_args_info_help[20] ; + args_info->thetacorr_help = gengetopt_args_info_help[21] ; + args_info->drcorr_help = gengetopt_args_info_help[22] ; + args_info->helfandEcorr_help = gengetopt_args_info_help[23] ; + args_info->momentum_help = gengetopt_args_info_help[24] ; + args_info->stresscorr_help = gengetopt_args_info_help[25] ; + args_info->bondcorr_help = gengetopt_args_info_help[26] ; + args_info->freqfluccorr_help = gengetopt_args_info_help[27] ; } @@ -307,12 +326,18 @@ cmdline_parser_dump(FILE *outfile, struct gengetopt_ar write_into_file(outfile, "rcorr", 0, 0 ); if (args_info->vcorr_given) write_into_file(outfile, "vcorr", 0, 0 ); + if (args_info->vcorrZ_given) + write_into_file(outfile, "vcorrZ", 0, 0 ); + if (args_info->vcorrR_given) + write_into_file(outfile, "vcorrR", 0, 0 ); if (args_info->dcorr_given) write_into_file(outfile, "dcorr", 0, 0 ); if (args_info->lcorr_given) write_into_file(outfile, "lcorr", 0, 0 ); if (args_info->lcorrZ_given) write_into_file(outfile, "lcorrZ", 0, 0 ); + if (args_info->cohZ_given) + write_into_file(outfile, "cohZ", 0, 0 ); if (args_info->sdcorr_given) write_into_file(outfile, "sdcorr", 0, 0 ); if (args_info->r_rcorr_given) @@ -327,6 +352,10 @@ cmdline_parser_dump(FILE *outfile, struct gengetopt_ar write_into_file(outfile, "momentum", 0, 0 ); if (args_info->stresscorr_given) write_into_file(outfile, "stresscorr", 0, 0 ); + if (args_info->bondcorr_given) + write_into_file(outfile, "bondcorr", 0, 0 ); + if (args_info->freqfluccorr_given) + write_into_file(outfile, "freqfluccorr", 0, 0 ); i = EXIT_SUCCESS; @@ -383,9 +412,12 @@ reset_group_dynamicProps(struct gengetopt_args_info *a args_info->selecorr_given = 0 ; args_info->rcorr_given = 0 ; args_info->vcorr_given = 0 ; + args_info->vcorrZ_given = 0 ; + args_info->vcorrR_given = 0 ; args_info->dcorr_given = 0 ; args_info->lcorr_given = 0 ; args_info->lcorrZ_given = 0 ; + args_info->cohZ_given = 0 ; args_info->sdcorr_given = 0 ; args_info->r_rcorr_given = 0 ; args_info->thetacorr_given = 0 ; @@ -393,6 +425,8 @@ reset_group_dynamicProps(struct gengetopt_args_info *a args_info->helfandEcorr_given = 0 ; args_info->momentum_given = 0 ; args_info->stresscorr_given = 0 ; + args_info->bondcorr_given = 0 ; + args_info->freqfluccorr_given = 0 ; args_info->dynamicProps_group_counter = 0; } @@ -646,9 +680,12 @@ cmdline_parser_internal ( { "selecorr", 0, NULL, 's' }, { "rcorr", 0, NULL, 'r' }, { "vcorr", 0, NULL, 'v' }, + { "vcorrZ", 0, NULL, 0 }, + { "vcorrR", 0, NULL, 0 }, { "dcorr", 0, NULL, 'd' }, { "lcorr", 0, NULL, 'l' }, { "lcorrZ", 0, NULL, 0 }, + { "cohZ", 0, NULL, 0 }, { "sdcorr", 0, NULL, 'M' }, { "r_rcorr", 0, NULL, 0 }, { "thetacorr", 0, NULL, 0 }, @@ -656,10 +693,12 @@ cmdline_parser_internal ( { "helfandEcorr", 0, NULL, 0 }, { "momentum", 0, NULL, 'p' }, { "stresscorr", 0, NULL, 0 }, + { "bondcorr", 0, NULL, 'b' }, + { "freqfluccorr", 0, NULL, 'f' }, { 0, 0, 0, 0 } }; - c = getopt_long (argc, argv, "hVi:o:z:m:srvdlMp", long_options, &option_index); + c = getopt_long (argc, argv, "hVi:o:z:m:srvdlMpbf", long_options, &option_index); if (c == -1) break; /* Exit from `while (1)' loop. */ @@ -824,10 +863,40 @@ cmdline_parser_internal ( &(local_args_info.momentum_given), optarg, 0, 0, ARG_NO, check_ambiguity, override, 0, 0, "momentum", 'p', + additional_error)) + goto failure; + + break; + case 'b': /* Bond extension correlation function. */ + + if (args_info->dynamicProps_group_counter && override) + reset_group_dynamicProps (args_info); + args_info->dynamicProps_group_counter += 1; + + if (update_arg( 0 , + 0 , &(args_info->bondcorr_given), + &(local_args_info.bondcorr_given), optarg, 0, 0, ARG_NO, + check_ambiguity, override, 0, 0, + "bondcorr", 'b', additional_error)) goto failure; break; + case 'f': /* Frequency Fluctuation correlation function. */ + + if (args_info->dynamicProps_group_counter && override) + reset_group_dynamicProps (args_info); + args_info->dynamicProps_group_counter += 1; + + if (update_arg( 0 , + 0 , &(args_info->freqfluccorr_given), + &(local_args_info.freqfluccorr_given), optarg, 0, 0, ARG_NO, + check_ambiguity, override, 0, 0, + "freqfluccorr", 'f', + additional_error)) + goto failure; + + break; case 0: /* Long option with no short option */ /* select first stuntdouble set. */ @@ -872,6 +941,40 @@ cmdline_parser_internal ( goto failure; } + /* velocity correlation function along z-axis. */ + else if (strcmp (long_options[option_index].name, "vcorrZ") == 0) + { + + if (args_info->dynamicProps_group_counter && override) + reset_group_dynamicProps (args_info); + args_info->dynamicProps_group_counter += 1; + + if (update_arg( 0 , + 0 , &(args_info->vcorrZ_given), + &(local_args_info.vcorrZ_given), optarg, 0, 0, ARG_NO, + check_ambiguity, override, 0, 0, + "vcorrZ", '-', + additional_error)) + goto failure; + + } + /* velocity correlation function projected radially. */ + else if (strcmp (long_options[option_index].name, "vcorrR") == 0) + { + + if (args_info->dynamicProps_group_counter && override) + reset_group_dynamicProps (args_info); + args_info->dynamicProps_group_counter += 1; + + if (update_arg( 0 , + 0 , &(args_info->vcorrR_given), + &(local_args_info.vcorrR_given), optarg, 0, 0, ARG_NO, + check_ambiguity, override, 0, 0, + "vcorrR", '-', + additional_error)) + goto failure; + + } /* Lengendre correlation function binned by Z. */ else if (strcmp (long_options[option_index].name, "lcorrZ") == 0) { @@ -889,6 +992,23 @@ cmdline_parser_internal ( goto failure; } + /* Lengendre correlation function for OH bond vectors binned by Z. */ + else if (strcmp (long_options[option_index].name, "cohZ") == 0) + { + + if (args_info->dynamicProps_group_counter && override) + reset_group_dynamicProps (args_info); + args_info->dynamicProps_group_counter += 1; + + if (update_arg( 0 , + 0 , &(args_info->cohZ_given), + &(local_args_info.cohZ_given), optarg, 0, 0, ARG_NO, + check_ambiguity, override, 0, 0, + "cohZ", '-', + additional_error)) + goto failure; + + } /* Radial rmsd. */ else if (strcmp (long_options[option_index].name, "r_rcorr") == 0) {