--- trunk/src/applications/staticProps/StaticPropsCmd.cpp 2012/12/13 16:57:39 1819 +++ trunk/src/applications/staticProps/StaticPropsCmd.cpp 2014/04/05 20:56:01 1979 @@ -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 "StaticPropsCmd.h" @@ -75,14 +79,17 @@ const char *gengetopt_args_info_help[] = { " -s, --scd scd order parameter (either --sele1, --sele2, \n --sele3 are specified or --molname, --begin, \n --end are specified)", " -d, --density density plot", " --slab_density slab density", - " --p_angle p(cos(theta))", + " --p_angle p(cos(theta)) (--sele1 must be specified, \n --sele2 is optional)", " --hxy hxy", " --rho_r rho of R", " --angle_r angle of R", " --hullvol hull volume of nanoparticle", " --rodlength length of nanorod", - " -Q, --tet_param tetrahedrality order parameter", - " --tet_param_z tetrahedrality order parameter by zbin(--sele1 \n must be specified)", + " -Q, --tet_param tetrahedrality order parameter (Qk)", + " --tet_param_z spatially-resolved tetrahedrality order \n parameter Qk(z)", + " --rnemdz slab-resolved RNEMD statistics (temperature, \n density, velocity)", + " --rnemdr shell-resolved RNEMD statistics (temperature, \n density, angular velocity)", + " --rnemdrt shell and angle-resolved RNEMD statistics \n (temperature, density, angular velocity)", 0 }; @@ -160,6 +167,9 @@ void clear_given (struct gengetopt_args_info *args_inf args_info->rodlength_given = 0 ; args_info->tet_param_given = 0 ; args_info->tet_param_z_given = 0 ; + args_info->rnemdz_given = 0 ; + args_info->rnemdr_given = 0 ; + args_info->rnemdrt_given = 0 ; args_info->staticProps_group_counter = 0 ; } @@ -263,6 +273,9 @@ void init_args_info(struct gengetopt_args_info *args_i args_info->rodlength_help = gengetopt_args_info_help[48] ; args_info->tet_param_help = gengetopt_args_info_help[49] ; args_info->tet_param_z_help = gengetopt_args_info_help[50] ; + args_info->rnemdz_help = gengetopt_args_info_help[51] ; + args_info->rnemdr_help = gengetopt_args_info_help[52] ; + args_info->rnemdrt_help = gengetopt_args_info_help[53] ; } @@ -512,6 +525,12 @@ cmdline_parser_dump(FILE *outfile, struct gengetopt_ar write_into_file(outfile, "tet_param", 0, 0 ); if (args_info->tet_param_z_given) write_into_file(outfile, "tet_param_z", 0, 0 ); + if (args_info->rnemdz_given) + write_into_file(outfile, "rnemdz", 0, 0 ); + if (args_info->rnemdr_given) + write_into_file(outfile, "rnemdr", 0, 0 ); + if (args_info->rnemdrt_given) + write_into_file(outfile, "rnemdrt", 0, 0 ); i = EXIT_SUCCESS; @@ -590,6 +609,9 @@ reset_group_staticProps(struct gengetopt_args_info *ar args_info->rodlength_given = 0 ; args_info->tet_param_given = 0 ; args_info->tet_param_z_given = 0 ; + args_info->rnemdz_given = 0 ; + args_info->rnemdr_given = 0 ; + args_info->rnemdrt_given = 0 ; args_info->staticProps_group_counter = 0; } @@ -885,6 +907,9 @@ cmdline_parser_internal ( { "rodlength", 0, NULL, 0 }, { "tet_param", 0, NULL, 'Q' }, { "tet_param_z", 0, NULL, 0 }, + { "rnemdz", 0, NULL, 0 }, + { "rnemdr", 0, NULL, 0 }, + { "rnemdrt", 0, NULL, 0 }, { 0, 0, 0, 0 } }; @@ -1072,7 +1097,7 @@ cmdline_parser_internal ( goto failure; break; - case 'Q': /* tetrahedrality order parameter. */ + case 'Q': /* tetrahedrality order parameter (Qk). */ if (args_info->staticProps_group_counter && override) reset_group_staticProps (args_info); @@ -1506,7 +1531,7 @@ cmdline_parser_internal ( goto failure; } - /* p(cos(theta)). */ + /* p(cos(theta)) (--sele1 must be specified, --sele2 is optional). */ else if (strcmp (long_options[option_index].name, "p_angle") == 0) { @@ -1608,7 +1633,7 @@ cmdline_parser_internal ( goto failure; } - /* tetrahedrality order parameter by zbin(--sele1 must be specified). */ + /* spatially-resolved tetrahedrality order parameter Qk(z). */ else if (strcmp (long_options[option_index].name, "tet_param_z") == 0) { @@ -1621,11 +1646,62 @@ cmdline_parser_internal ( &(local_args_info.tet_param_z_given), optarg, 0, 0, ARG_NO, check_ambiguity, override, 0, 0, "tet_param_z", '-', + additional_error)) + goto failure; + + } + /* slab-resolved RNEMD statistics (temperature, density, velocity). */ + else if (strcmp (long_options[option_index].name, "rnemdz") == 0) + { + + if (args_info->staticProps_group_counter && override) + reset_group_staticProps (args_info); + args_info->staticProps_group_counter += 1; + + if (update_arg( 0 , + 0 , &(args_info->rnemdz_given), + &(local_args_info.rnemdz_given), optarg, 0, 0, ARG_NO, + check_ambiguity, override, 0, 0, + "rnemdz", '-', additional_error)) goto failure; } + /* shell-resolved RNEMD statistics (temperature, density, angular velocity). */ + else if (strcmp (long_options[option_index].name, "rnemdr") == 0) + { + if (args_info->staticProps_group_counter && override) + reset_group_staticProps (args_info); + args_info->staticProps_group_counter += 1; + + if (update_arg( 0 , + 0 , &(args_info->rnemdr_given), + &(local_args_info.rnemdr_given), optarg, 0, 0, ARG_NO, + check_ambiguity, override, 0, 0, + "rnemdr", '-', + additional_error)) + goto failure; + + } + /* shell and angle-resolved RNEMD statistics (temperature, density, angular velocity). */ + else if (strcmp (long_options[option_index].name, "rnemdrt") == 0) + { + + if (args_info->staticProps_group_counter && override) + reset_group_staticProps (args_info); + args_info->staticProps_group_counter += 1; + + if (update_arg( 0 , + 0 , &(args_info->rnemdrt_given), + &(local_args_info.rnemdrt_given), optarg, 0, 0, ARG_NO, + check_ambiguity, override, 0, 0, + "rnemdrt", '-', + additional_error)) + goto failure; + + } + break; case '?': /* Invalid option. */ /* `getopt_long' already printed an error message. */