| 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 |
|
|
| 43 |
|
" --sele1=selection script select first stuntdouble set", |
| 44 |
|
" --sele2=selection script select second stuntdouble set (if sele2 is not \n set, use script from sele1)", |
| 45 |
|
" --order=INT Lengendre Polynomial Order", |
| 46 |
+ |
" -z, --nzbins=INT Number of Z bins (default=`100')", |
| 47 |
|
" -m, --memory=memory specification\n Available memory (defaults to 2G) \n (default=`2G')", |
| 48 |
|
"\n Group: dynamicProps\n an option of this group is required", |
| 49 |
|
" -s, --selecorr selection correlation function", |
| 51 |
|
" -v, --vcorr velocity correlation function", |
| 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", |
| 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 |
+ |
" -f, --freqfluccorr Frequency Fluctuation correlation function", |
| 65 |
|
0 |
| 66 |
|
}; |
| 67 |
|
|
| 95 |
|
args_info->sele1_given = 0 ; |
| 96 |
|
args_info->sele2_given = 0 ; |
| 97 |
|
args_info->order_given = 0 ; |
| 98 |
+ |
args_info->nzbins_given = 0 ; |
| 99 |
|
args_info->memory_given = 0 ; |
| 100 |
|
args_info->selecorr_given = 0 ; |
| 101 |
|
args_info->rcorr_given = 0 ; |
| 102 |
|
args_info->vcorr_given = 0 ; |
| 103 |
|
args_info->dcorr_given = 0 ; |
| 104 |
|
args_info->lcorr_given = 0 ; |
| 105 |
+ |
args_info->lcorrZ_given = 0 ; |
| 106 |
+ |
args_info->cohZ_given = 0 ; |
| 107 |
|
args_info->sdcorr_given = 0 ; |
| 108 |
|
args_info->r_rcorr_given = 0 ; |
| 109 |
|
args_info->thetacorr_given = 0 ; |
| 111 |
|
args_info->helfandEcorr_given = 0 ; |
| 112 |
|
args_info->momentum_given = 0 ; |
| 113 |
|
args_info->stresscorr_given = 0 ; |
| 114 |
+ |
args_info->bondcorr_given = 0 ; |
| 115 |
+ |
args_info->freqfluccorr_given = 0 ; |
| 116 |
|
args_info->dynamicProps_group_counter = 0 ; |
| 117 |
|
} |
| 118 |
|
|
| 129 |
|
args_info->sele2_arg = NULL; |
| 130 |
|
args_info->sele2_orig = NULL; |
| 131 |
|
args_info->order_orig = NULL; |
| 132 |
+ |
args_info->nzbins_arg = 100; |
| 133 |
+ |
args_info->nzbins_orig = NULL; |
| 134 |
|
args_info->memory_arg = gengetopt_strdup ("2G"); |
| 135 |
|
args_info->memory_orig = NULL; |
| 136 |
|
|
| 148 |
|
args_info->sele1_help = gengetopt_args_info_help[4] ; |
| 149 |
|
args_info->sele2_help = gengetopt_args_info_help[5] ; |
| 150 |
|
args_info->order_help = gengetopt_args_info_help[6] ; |
| 151 |
< |
args_info->memory_help = gengetopt_args_info_help[7] ; |
| 152 |
< |
args_info->selecorr_help = gengetopt_args_info_help[9] ; |
| 153 |
< |
args_info->rcorr_help = gengetopt_args_info_help[10] ; |
| 154 |
< |
args_info->vcorr_help = gengetopt_args_info_help[11] ; |
| 155 |
< |
args_info->dcorr_help = gengetopt_args_info_help[12] ; |
| 156 |
< |
args_info->lcorr_help = gengetopt_args_info_help[13] ; |
| 157 |
< |
args_info->sdcorr_help = gengetopt_args_info_help[14] ; |
| 158 |
< |
args_info->r_rcorr_help = gengetopt_args_info_help[15] ; |
| 159 |
< |
args_info->thetacorr_help = gengetopt_args_info_help[16] ; |
| 160 |
< |
args_info->drcorr_help = gengetopt_args_info_help[17] ; |
| 161 |
< |
args_info->helfandEcorr_help = gengetopt_args_info_help[18] ; |
| 162 |
< |
args_info->momentum_help = gengetopt_args_info_help[19] ; |
| 163 |
< |
args_info->stresscorr_help = gengetopt_args_info_help[20] ; |
| 151 |
> |
args_info->nzbins_help = gengetopt_args_info_help[7] ; |
| 152 |
> |
args_info->memory_help = gengetopt_args_info_help[8] ; |
| 153 |
> |
args_info->selecorr_help = gengetopt_args_info_help[10] ; |
| 154 |
> |
args_info->rcorr_help = gengetopt_args_info_help[11] ; |
| 155 |
> |
args_info->vcorr_help = gengetopt_args_info_help[12] ; |
| 156 |
> |
args_info->dcorr_help = gengetopt_args_info_help[13] ; |
| 157 |
> |
args_info->lcorr_help = gengetopt_args_info_help[14] ; |
| 158 |
> |
args_info->lcorrZ_help = gengetopt_args_info_help[15] ; |
| 159 |
> |
args_info->cohZ_help = gengetopt_args_info_help[16] ; |
| 160 |
> |
args_info->sdcorr_help = gengetopt_args_info_help[17] ; |
| 161 |
> |
args_info->r_rcorr_help = gengetopt_args_info_help[18] ; |
| 162 |
> |
args_info->thetacorr_help = gengetopt_args_info_help[19] ; |
| 163 |
> |
args_info->drcorr_help = gengetopt_args_info_help[20] ; |
| 164 |
> |
args_info->helfandEcorr_help = gengetopt_args_info_help[21] ; |
| 165 |
> |
args_info->momentum_help = gengetopt_args_info_help[22] ; |
| 166 |
> |
args_info->stresscorr_help = gengetopt_args_info_help[23] ; |
| 167 |
> |
args_info->bondcorr_help = gengetopt_args_info_help[24] ; |
| 168 |
> |
args_info->freqfluccorr_help = gengetopt_args_info_help[25] ; |
| 169 |
|
|
| 170 |
|
} |
| 171 |
|
|
| 258 |
|
free_string_field (&(args_info->sele2_arg)); |
| 259 |
|
free_string_field (&(args_info->sele2_orig)); |
| 260 |
|
free_string_field (&(args_info->order_orig)); |
| 261 |
+ |
free_string_field (&(args_info->nzbins_orig)); |
| 262 |
|
free_string_field (&(args_info->memory_arg)); |
| 263 |
|
free_string_field (&(args_info->memory_orig)); |
| 264 |
|
|
| 310 |
|
write_into_file(outfile, "sele2", args_info->sele2_orig, 0); |
| 311 |
|
if (args_info->order_given) |
| 312 |
|
write_into_file(outfile, "order", args_info->order_orig, 0); |
| 313 |
+ |
if (args_info->nzbins_given) |
| 314 |
+ |
write_into_file(outfile, "nzbins", args_info->nzbins_orig, 0); |
| 315 |
|
if (args_info->memory_given) |
| 316 |
|
write_into_file(outfile, "memory", args_info->memory_orig, 0); |
| 317 |
|
if (args_info->selecorr_given) |
| 324 |
|
write_into_file(outfile, "dcorr", 0, 0 ); |
| 325 |
|
if (args_info->lcorr_given) |
| 326 |
|
write_into_file(outfile, "lcorr", 0, 0 ); |
| 327 |
+ |
if (args_info->lcorrZ_given) |
| 328 |
+ |
write_into_file(outfile, "lcorrZ", 0, 0 ); |
| 329 |
+ |
if (args_info->cohZ_given) |
| 330 |
+ |
write_into_file(outfile, "cohZ", 0, 0 ); |
| 331 |
|
if (args_info->sdcorr_given) |
| 332 |
|
write_into_file(outfile, "sdcorr", 0, 0 ); |
| 333 |
|
if (args_info->r_rcorr_given) |
| 342 |
|
write_into_file(outfile, "momentum", 0, 0 ); |
| 343 |
|
if (args_info->stresscorr_given) |
| 344 |
|
write_into_file(outfile, "stresscorr", 0, 0 ); |
| 345 |
+ |
if (args_info->bondcorr_given) |
| 346 |
+ |
write_into_file(outfile, "bondcorr", 0, 0 ); |
| 347 |
+ |
if (args_info->freqfluccorr_given) |
| 348 |
+ |
write_into_file(outfile, "freqfluccorr", 0, 0 ); |
| 349 |
|
|
| 350 |
|
|
| 351 |
|
i = EXIT_SUCCESS; |
| 404 |
|
args_info->vcorr_given = 0 ; |
| 405 |
|
args_info->dcorr_given = 0 ; |
| 406 |
|
args_info->lcorr_given = 0 ; |
| 407 |
+ |
args_info->lcorrZ_given = 0 ; |
| 408 |
+ |
args_info->cohZ_given = 0 ; |
| 409 |
|
args_info->sdcorr_given = 0 ; |
| 410 |
|
args_info->r_rcorr_given = 0 ; |
| 411 |
|
args_info->thetacorr_given = 0 ; |
| 413 |
|
args_info->helfandEcorr_given = 0 ; |
| 414 |
|
args_info->momentum_given = 0 ; |
| 415 |
|
args_info->stresscorr_given = 0 ; |
| 416 |
+ |
args_info->bondcorr_given = 0 ; |
| 417 |
+ |
args_info->freqfluccorr_given = 0 ; |
| 418 |
|
|
| 419 |
|
args_info->dynamicProps_group_counter = 0; |
| 420 |
|
} |
| 663 |
|
{ "sele1", 1, NULL, 0 }, |
| 664 |
|
{ "sele2", 1, NULL, 0 }, |
| 665 |
|
{ "order", 1, NULL, 0 }, |
| 666 |
+ |
{ "nzbins", 1, NULL, 'z' }, |
| 667 |
|
{ "memory", 1, NULL, 'm' }, |
| 668 |
|
{ "selecorr", 0, NULL, 's' }, |
| 669 |
|
{ "rcorr", 0, NULL, 'r' }, |
| 670 |
|
{ "vcorr", 0, NULL, 'v' }, |
| 671 |
|
{ "dcorr", 0, NULL, 'd' }, |
| 672 |
|
{ "lcorr", 0, NULL, 'l' }, |
| 673 |
+ |
{ "lcorrZ", 0, NULL, 0 }, |
| 674 |
+ |
{ "cohZ", 0, NULL, 0 }, |
| 675 |
|
{ "sdcorr", 0, NULL, 'M' }, |
| 676 |
|
{ "r_rcorr", 0, NULL, 0 }, |
| 677 |
|
{ "thetacorr", 0, NULL, 0 }, |
| 679 |
|
{ "helfandEcorr", 0, NULL, 0 }, |
| 680 |
|
{ "momentum", 0, NULL, 'p' }, |
| 681 |
|
{ "stresscorr", 0, NULL, 0 }, |
| 682 |
+ |
{ "bondcorr", 0, NULL, 'b' }, |
| 683 |
+ |
{ "freqfluccorr", 0, NULL, 'f' }, |
| 684 |
|
{ 0, 0, 0, 0 } |
| 685 |
|
}; |
| 686 |
|
|
| 687 |
< |
c = getopt_long (argc, argv, "hVi:o:m:srvdlMp", long_options, &option_index); |
| 687 |
> |
c = getopt_long (argc, argv, "hVi:o:z:m:srvdlMpbf", long_options, &option_index); |
| 688 |
|
|
| 689 |
|
if (c == -1) break; /* Exit from `while (1)' loop. */ |
| 690 |
|
|
| 724 |
|
goto failure; |
| 725 |
|
|
| 726 |
|
break; |
| 727 |
+ |
case 'z': /* Number of Z bins. */ |
| 728 |
+ |
|
| 729 |
+ |
|
| 730 |
+ |
if (update_arg( (void *)&(args_info->nzbins_arg), |
| 731 |
+ |
&(args_info->nzbins_orig), &(args_info->nzbins_given), |
| 732 |
+ |
&(local_args_info.nzbins_given), optarg, 0, "100", ARG_INT, |
| 733 |
+ |
check_ambiguity, override, 0, 0, |
| 734 |
+ |
"nzbins", 'z', |
| 735 |
+ |
additional_error)) |
| 736 |
+ |
goto failure; |
| 737 |
+ |
|
| 738 |
+ |
break; |
| 739 |
|
case 'm': /* Available memory (defaults to 2G). */ |
| 740 |
|
|
| 741 |
|
|
| 849 |
|
&(local_args_info.momentum_given), optarg, 0, 0, ARG_NO, |
| 850 |
|
check_ambiguity, override, 0, 0, |
| 851 |
|
"momentum", 'p', |
| 852 |
+ |
additional_error)) |
| 853 |
+ |
goto failure; |
| 854 |
+ |
|
| 855 |
+ |
break; |
| 856 |
+ |
case 'b': /* Bond extension correlation function. */ |
| 857 |
+ |
|
| 858 |
+ |
if (args_info->dynamicProps_group_counter && override) |
| 859 |
+ |
reset_group_dynamicProps (args_info); |
| 860 |
+ |
args_info->dynamicProps_group_counter += 1; |
| 861 |
+ |
|
| 862 |
+ |
if (update_arg( 0 , |
| 863 |
+ |
0 , &(args_info->bondcorr_given), |
| 864 |
+ |
&(local_args_info.bondcorr_given), optarg, 0, 0, ARG_NO, |
| 865 |
+ |
check_ambiguity, override, 0, 0, |
| 866 |
+ |
"bondcorr", 'b', |
| 867 |
+ |
additional_error)) |
| 868 |
+ |
goto failure; |
| 869 |
+ |
|
| 870 |
+ |
break; |
| 871 |
+ |
case 'f': /* Frequency Fluctuation correlation function. */ |
| 872 |
+ |
|
| 873 |
+ |
if (args_info->dynamicProps_group_counter && override) |
| 874 |
+ |
reset_group_dynamicProps (args_info); |
| 875 |
+ |
args_info->dynamicProps_group_counter += 1; |
| 876 |
+ |
|
| 877 |
+ |
if (update_arg( 0 , |
| 878 |
+ |
0 , &(args_info->freqfluccorr_given), |
| 879 |
+ |
&(local_args_info.freqfluccorr_given), optarg, 0, 0, ARG_NO, |
| 880 |
+ |
check_ambiguity, override, 0, 0, |
| 881 |
+ |
"freqfluccorr", 'f', |
| 882 |
|
additional_error)) |
| 883 |
|
goto failure; |
| 884 |
|
|
| 927 |
|
goto failure; |
| 928 |
|
|
| 929 |
|
} |
| 930 |
+ |
/* Lengendre correlation function binned by Z. */ |
| 931 |
+ |
else if (strcmp (long_options[option_index].name, "lcorrZ") == 0) |
| 932 |
+ |
{ |
| 933 |
+ |
|
| 934 |
+ |
if (args_info->dynamicProps_group_counter && override) |
| 935 |
+ |
reset_group_dynamicProps (args_info); |
| 936 |
+ |
args_info->dynamicProps_group_counter += 1; |
| 937 |
+ |
|
| 938 |
+ |
if (update_arg( 0 , |
| 939 |
+ |
0 , &(args_info->lcorrZ_given), |
| 940 |
+ |
&(local_args_info.lcorrZ_given), optarg, 0, 0, ARG_NO, |
| 941 |
+ |
check_ambiguity, override, 0, 0, |
| 942 |
+ |
"lcorrZ", '-', |
| 943 |
+ |
additional_error)) |
| 944 |
+ |
goto failure; |
| 945 |
+ |
|
| 946 |
+ |
} |
| 947 |
+ |
/* Lengendre correlation function for OH bond vectors binned by Z. */ |
| 948 |
+ |
else if (strcmp (long_options[option_index].name, "cohZ") == 0) |
| 949 |
+ |
{ |
| 950 |
+ |
|
| 951 |
+ |
if (args_info->dynamicProps_group_counter && override) |
| 952 |
+ |
reset_group_dynamicProps (args_info); |
| 953 |
+ |
args_info->dynamicProps_group_counter += 1; |
| 954 |
+ |
|
| 955 |
+ |
if (update_arg( 0 , |
| 956 |
+ |
0 , &(args_info->cohZ_given), |
| 957 |
+ |
&(local_args_info.cohZ_given), optarg, 0, 0, ARG_NO, |
| 958 |
+ |
check_ambiguity, override, 0, 0, |
| 959 |
+ |
"cohZ", '-', |
| 960 |
+ |
additional_error)) |
| 961 |
+ |
goto failure; |
| 962 |
+ |
|
| 963 |
+ |
} |
| 964 |
|
/* Radial rmsd. */ |
| 965 |
|
else if (strcmp (long_options[option_index].name, "r_rcorr") == 0) |
| 966 |
|
{ |