| 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 "StaticPropsCmd.h" | 
| 31 | 
  | 
 | 
| 57 | 
  | 
  "      --refsele=selection script\n                                select reference (use and only use with --gxyz)", | 
| 58 | 
  | 
  "      --comsele=selection script\n                                select stunt doubles for center-of-mass \n                                  reference point", | 
| 59 | 
  | 
  "      --seleoffset=INT          global index offset for a second object (used \n                                  to define a vector between sites in molecule)", | 
| 60 | 
+ | 
  "      --seleoffset2=INT         global index offset for a third object (used to \n                                  define a vector between sites in molecule)", | 
| 61 | 
  | 
  "      --molname=STRING          molecule name", | 
| 62 | 
  | 
  "      --begin=INT               begin internal index", | 
| 63 | 
  | 
  "      --end=INT                 end internal index", | 
| 80 | 
  | 
  "  -s, --scd                     scd order parameter (either --sele1, --sele2, \n                                  --sele3 are specified or --molname, --begin, \n                                  --end are specified)", | 
| 81 | 
  | 
  "  -d, --density                 density plot", | 
| 82 | 
  | 
  "      --slab_density            slab density", | 
| 83 | 
< | 
  "      --p_angle                 p(cos(theta))", | 
| 83 | 
> | 
  "      --p_angle                 p(cos(theta)) (--sele1 must be specified, \n                                  --sele2 is optional)", | 
| 84 | 
  | 
  "      --hxy                     hxy", | 
| 85 | 
  | 
  "      --rho_r                   rho of R", | 
| 86 | 
  | 
  "      --angle_r                 angle of R", | 
| 88 | 
  | 
  "      --rodlength               length of nanorod", | 
| 89 | 
  | 
  "  -Q, --tet_param               tetrahedrality order parameter (Qk)", | 
| 90 | 
  | 
  "      --tet_param_z             spatially-resolved tetrahedrality order \n                                  parameter Qk(z)", | 
| 91 | 
+ | 
  "      --rnemdz                  slab-resolved RNEMD statistics (temperature, \n                                  density, velocity)", | 
| 92 | 
+ | 
  "      --rnemdr                  shell-resolved RNEMD statistics (temperature, \n                                  density, angular velocity)", | 
| 93 | 
+ | 
  "      --rnemdrt                 shell and angle-resolved RNEMD statistics \n                                  (temperature, density, angular velocity)", | 
| 94 | 
  | 
    0 | 
| 95 | 
  | 
}; | 
| 96 | 
  | 
 | 
| 139 | 
  | 
  args_info->refsele_given = 0 ; | 
| 140 | 
  | 
  args_info->comsele_given = 0 ; | 
| 141 | 
  | 
  args_info->seleoffset_given = 0 ; | 
| 142 | 
+ | 
  args_info->seleoffset2_given = 0 ; | 
| 143 | 
  | 
  args_info->molname_given = 0 ; | 
| 144 | 
  | 
  args_info->begin_given = 0 ; | 
| 145 | 
  | 
  args_info->end_given = 0 ; | 
| 169 | 
  | 
  args_info->rodlength_given = 0 ; | 
| 170 | 
  | 
  args_info->tet_param_given = 0 ; | 
| 171 | 
  | 
  args_info->tet_param_z_given = 0 ; | 
| 172 | 
+ | 
  args_info->rnemdz_given = 0 ; | 
| 173 | 
+ | 
  args_info->rnemdr_given = 0 ; | 
| 174 | 
+ | 
  args_info->rnemdrt_given = 0 ; | 
| 175 | 
  | 
  args_info->staticProps_group_counter = 0 ; | 
| 176 | 
  | 
} | 
| 177 | 
  | 
 | 
| 212 | 
  | 
  args_info->comsele_arg = NULL; | 
| 213 | 
  | 
  args_info->comsele_orig = NULL; | 
| 214 | 
  | 
  args_info->seleoffset_orig = NULL; | 
| 215 | 
+ | 
  args_info->seleoffset2_orig = NULL; | 
| 216 | 
  | 
  args_info->molname_arg = NULL; | 
| 217 | 
  | 
  args_info->molname_orig = NULL; | 
| 218 | 
  | 
  args_info->begin_orig = NULL; | 
| 247 | 
  | 
  args_info->refsele_help = gengetopt_args_info_help[18] ; | 
| 248 | 
  | 
  args_info->comsele_help = gengetopt_args_info_help[19] ; | 
| 249 | 
  | 
  args_info->seleoffset_help = gengetopt_args_info_help[20] ; | 
| 250 | 
< | 
  args_info->molname_help = gengetopt_args_info_help[21] ; | 
| 251 | 
< | 
  args_info->begin_help = gengetopt_args_info_help[22] ; | 
| 252 | 
< | 
  args_info->end_help = gengetopt_args_info_help[23] ; | 
| 253 | 
< | 
  args_info->radius_help = gengetopt_args_info_help[24] ; | 
| 254 | 
< | 
  args_info->bo_help = gengetopt_args_info_help[26] ; | 
| 255 | 
< | 
  args_info->bor_help = gengetopt_args_info_help[27] ; | 
| 256 | 
< | 
  args_info->bad_help = gengetopt_args_info_help[28] ; | 
| 257 | 
< | 
  args_info->count_help = gengetopt_args_info_help[29] ; | 
| 258 | 
< | 
  args_info->gofr_help = gengetopt_args_info_help[30] ; | 
| 259 | 
< | 
  args_info->gofz_help = gengetopt_args_info_help[31] ; | 
| 260 | 
< | 
  args_info->r_theta_help = gengetopt_args_info_help[32] ; | 
| 261 | 
< | 
  args_info->r_omega_help = gengetopt_args_info_help[33] ; | 
| 262 | 
< | 
  args_info->r_z_help = gengetopt_args_info_help[34] ; | 
| 263 | 
< | 
  args_info->theta_omega_help = gengetopt_args_info_help[35] ; | 
| 264 | 
< | 
  args_info->gxyz_help = gengetopt_args_info_help[36] ; | 
| 265 | 
< | 
  args_info->twodgofr_help = gengetopt_args_info_help[37] ; | 
| 266 | 
< | 
  args_info->p2_help = gengetopt_args_info_help[38] ; | 
| 267 | 
< | 
  args_info->rp2_help = gengetopt_args_info_help[39] ; | 
| 268 | 
< | 
  args_info->scd_help = gengetopt_args_info_help[40] ; | 
| 269 | 
< | 
  args_info->density_help = gengetopt_args_info_help[41] ; | 
| 270 | 
< | 
  args_info->slab_density_help = gengetopt_args_info_help[42] ; | 
| 271 | 
< | 
  args_info->p_angle_help = gengetopt_args_info_help[43] ; | 
| 272 | 
< | 
  args_info->hxy_help = gengetopt_args_info_help[44] ; | 
| 273 | 
< | 
  args_info->rho_r_help = gengetopt_args_info_help[45] ; | 
| 274 | 
< | 
  args_info->angle_r_help = gengetopt_args_info_help[46] ; | 
| 275 | 
< | 
  args_info->hullvol_help = gengetopt_args_info_help[47] ; | 
| 276 | 
< | 
  args_info->rodlength_help = gengetopt_args_info_help[48] ; | 
| 277 | 
< | 
  args_info->tet_param_help = gengetopt_args_info_help[49] ; | 
| 278 | 
< | 
  args_info->tet_param_z_help = gengetopt_args_info_help[50] ; | 
| 250 | 
> | 
  args_info->seleoffset2_help = gengetopt_args_info_help[21] ; | 
| 251 | 
> | 
  args_info->molname_help = gengetopt_args_info_help[22] ; | 
| 252 | 
> | 
  args_info->begin_help = gengetopt_args_info_help[23] ; | 
| 253 | 
> | 
  args_info->end_help = gengetopt_args_info_help[24] ; | 
| 254 | 
> | 
  args_info->radius_help = gengetopt_args_info_help[25] ; | 
| 255 | 
> | 
  args_info->bo_help = gengetopt_args_info_help[27] ; | 
| 256 | 
> | 
  args_info->bor_help = gengetopt_args_info_help[28] ; | 
| 257 | 
> | 
  args_info->bad_help = gengetopt_args_info_help[29] ; | 
| 258 | 
> | 
  args_info->count_help = gengetopt_args_info_help[30] ; | 
| 259 | 
> | 
  args_info->gofr_help = gengetopt_args_info_help[31] ; | 
| 260 | 
> | 
  args_info->gofz_help = gengetopt_args_info_help[32] ; | 
| 261 | 
> | 
  args_info->r_theta_help = gengetopt_args_info_help[33] ; | 
| 262 | 
> | 
  args_info->r_omega_help = gengetopt_args_info_help[34] ; | 
| 263 | 
> | 
  args_info->r_z_help = gengetopt_args_info_help[35] ; | 
| 264 | 
> | 
  args_info->theta_omega_help = gengetopt_args_info_help[36] ; | 
| 265 | 
> | 
  args_info->gxyz_help = gengetopt_args_info_help[37] ; | 
| 266 | 
> | 
  args_info->twodgofr_help = gengetopt_args_info_help[38] ; | 
| 267 | 
> | 
  args_info->p2_help = gengetopt_args_info_help[39] ; | 
| 268 | 
> | 
  args_info->rp2_help = gengetopt_args_info_help[40] ; | 
| 269 | 
> | 
  args_info->scd_help = gengetopt_args_info_help[41] ; | 
| 270 | 
> | 
  args_info->density_help = gengetopt_args_info_help[42] ; | 
| 271 | 
> | 
  args_info->slab_density_help = gengetopt_args_info_help[43] ; | 
| 272 | 
> | 
  args_info->p_angle_help = gengetopt_args_info_help[44] ; | 
| 273 | 
> | 
  args_info->hxy_help = gengetopt_args_info_help[45] ; | 
| 274 | 
> | 
  args_info->rho_r_help = gengetopt_args_info_help[46] ; | 
| 275 | 
> | 
  args_info->angle_r_help = gengetopt_args_info_help[47] ; | 
| 276 | 
> | 
  args_info->hullvol_help = gengetopt_args_info_help[48] ; | 
| 277 | 
> | 
  args_info->rodlength_help = gengetopt_args_info_help[49] ; | 
| 278 | 
> | 
  args_info->tet_param_help = gengetopt_args_info_help[50] ; | 
| 279 | 
> | 
  args_info->tet_param_z_help = gengetopt_args_info_help[51] ; | 
| 280 | 
> | 
  args_info->rnemdz_help = gengetopt_args_info_help[52] ; | 
| 281 | 
> | 
  args_info->rnemdr_help = gengetopt_args_info_help[53] ; | 
| 282 | 
> | 
  args_info->rnemdrt_help = gengetopt_args_info_help[54] ; | 
| 283 | 
  | 
   | 
| 284 | 
  | 
} | 
| 285 | 
  | 
 | 
| 389 | 
  | 
  free_string_field (&(args_info->comsele_arg)); | 
| 390 | 
  | 
  free_string_field (&(args_info->comsele_orig)); | 
| 391 | 
  | 
  free_string_field (&(args_info->seleoffset_orig)); | 
| 392 | 
+ | 
  free_string_field (&(args_info->seleoffset2_orig)); | 
| 393 | 
  | 
  free_string_field (&(args_info->molname_arg)); | 
| 394 | 
  | 
  free_string_field (&(args_info->molname_orig)); | 
| 395 | 
  | 
  free_string_field (&(args_info->begin_orig)); | 
| 472 | 
  | 
    write_into_file(outfile, "comsele", args_info->comsele_orig, 0); | 
| 473 | 
  | 
  if (args_info->seleoffset_given) | 
| 474 | 
  | 
    write_into_file(outfile, "seleoffset", args_info->seleoffset_orig, 0); | 
| 475 | 
+ | 
  if (args_info->seleoffset2_given) | 
| 476 | 
+ | 
    write_into_file(outfile, "seleoffset2", args_info->seleoffset2_orig, 0); | 
| 477 | 
  | 
  if (args_info->molname_given) | 
| 478 | 
  | 
    write_into_file(outfile, "molname", args_info->molname_orig, 0); | 
| 479 | 
  | 
  if (args_info->begin_given) | 
| 532 | 
  | 
    write_into_file(outfile, "tet_param", 0, 0 ); | 
| 533 | 
  | 
  if (args_info->tet_param_z_given) | 
| 534 | 
  | 
    write_into_file(outfile, "tet_param_z", 0, 0 ); | 
| 535 | 
+ | 
  if (args_info->rnemdz_given) | 
| 536 | 
+ | 
    write_into_file(outfile, "rnemdz", 0, 0 ); | 
| 537 | 
+ | 
  if (args_info->rnemdr_given) | 
| 538 | 
+ | 
    write_into_file(outfile, "rnemdr", 0, 0 ); | 
| 539 | 
+ | 
  if (args_info->rnemdrt_given) | 
| 540 | 
+ | 
    write_into_file(outfile, "rnemdrt", 0, 0 ); | 
| 541 | 
  | 
   | 
| 542 | 
  | 
 | 
| 543 | 
  | 
  i = EXIT_SUCCESS; | 
| 616 | 
  | 
  args_info->rodlength_given = 0 ; | 
| 617 | 
  | 
  args_info->tet_param_given = 0 ; | 
| 618 | 
  | 
  args_info->tet_param_z_given = 0 ; | 
| 619 | 
+ | 
  args_info->rnemdz_given = 0 ; | 
| 620 | 
+ | 
  args_info->rnemdr_given = 0 ; | 
| 621 | 
+ | 
  args_info->rnemdrt_given = 0 ; | 
| 622 | 
  | 
 | 
| 623 | 
  | 
  args_info->staticProps_group_counter = 0; | 
| 624 | 
  | 
} | 
| 885 | 
  | 
        { "refsele",    1, NULL, 0 }, | 
| 886 | 
  | 
        { "comsele",    1, NULL, 0 }, | 
| 887 | 
  | 
        { "seleoffset", 1, NULL, 0 }, | 
| 888 | 
+ | 
        { "seleoffset2",        1, NULL, 0 }, | 
| 889 | 
  | 
        { "molname",    1, NULL, 0 }, | 
| 890 | 
  | 
        { "begin",      1, NULL, 0 }, | 
| 891 | 
  | 
        { "end",        1, NULL, 0 }, | 
| 915 | 
  | 
        { "rodlength",  0, NULL, 0 }, | 
| 916 | 
  | 
        { "tet_param",  0, NULL, 'Q' }, | 
| 917 | 
  | 
        { "tet_param_z",        0, NULL, 0 }, | 
| 918 | 
+ | 
        { "rnemdz",     0, NULL, 0 }, | 
| 919 | 
+ | 
        { "rnemdr",     0, NULL, 0 }, | 
| 920 | 
+ | 
        { "rnemdrt",    0, NULL, 0 }, | 
| 921 | 
  | 
        { 0,  0, 0, 0 } | 
| 922 | 
  | 
      }; | 
| 923 | 
  | 
 | 
| 1258 | 
  | 
                &(local_args_info.seleoffset_given), optarg, 0, 0, ARG_INT, | 
| 1259 | 
  | 
                check_ambiguity, override, 0, 0, | 
| 1260 | 
  | 
                "seleoffset", '-', | 
| 1261 | 
+ | 
                additional_error)) | 
| 1262 | 
+ | 
              goto failure; | 
| 1263 | 
+ | 
           | 
| 1264 | 
+ | 
          } | 
| 1265 | 
+ | 
          /* global index offset for a third object (used to define a vector between sites in molecule).  */ | 
| 1266 | 
+ | 
          else if (strcmp (long_options[option_index].name, "seleoffset2") == 0) | 
| 1267 | 
+ | 
          { | 
| 1268 | 
+ | 
           | 
| 1269 | 
+ | 
           | 
| 1270 | 
+ | 
            if (update_arg( (void *)&(args_info->seleoffset2_arg),  | 
| 1271 | 
+ | 
                 &(args_info->seleoffset2_orig), &(args_info->seleoffset2_given), | 
| 1272 | 
+ | 
                &(local_args_info.seleoffset2_given), optarg, 0, 0, ARG_INT, | 
| 1273 | 
+ | 
                check_ambiguity, override, 0, 0, | 
| 1274 | 
+ | 
                "seleoffset2", '-', | 
| 1275 | 
  | 
                additional_error)) | 
| 1276 | 
  | 
              goto failure; | 
| 1277 | 
  | 
           | 
| 1553 | 
  | 
              goto failure; | 
| 1554 | 
  | 
           | 
| 1555 | 
  | 
          } | 
| 1556 | 
< | 
          /* p(cos(theta)).  */ | 
| 1556 | 
> | 
          /* p(cos(theta)) (--sele1 must be specified, --sele2 is optional).  */ | 
| 1557 | 
  | 
          else if (strcmp (long_options[option_index].name, "p_angle") == 0) | 
| 1558 | 
  | 
          { | 
| 1559 | 
  | 
           | 
| 1668 | 
  | 
                &(local_args_info.tet_param_z_given), optarg, 0, 0, ARG_NO, | 
| 1669 | 
  | 
                check_ambiguity, override, 0, 0, | 
| 1670 | 
  | 
                "tet_param_z", '-', | 
| 1671 | 
+ | 
                additional_error)) | 
| 1672 | 
+ | 
              goto failure; | 
| 1673 | 
+ | 
           | 
| 1674 | 
+ | 
          } | 
| 1675 | 
+ | 
          /* slab-resolved RNEMD statistics (temperature, density, velocity).  */ | 
| 1676 | 
+ | 
          else if (strcmp (long_options[option_index].name, "rnemdz") == 0) | 
| 1677 | 
+ | 
          { | 
| 1678 | 
+ | 
           | 
| 1679 | 
+ | 
            if (args_info->staticProps_group_counter && override) | 
| 1680 | 
+ | 
              reset_group_staticProps (args_info); | 
| 1681 | 
+ | 
            args_info->staticProps_group_counter += 1; | 
| 1682 | 
+ | 
           | 
| 1683 | 
+ | 
            if (update_arg( 0 ,  | 
| 1684 | 
+ | 
                 0 , &(args_info->rnemdz_given), | 
| 1685 | 
+ | 
                &(local_args_info.rnemdz_given), optarg, 0, 0, ARG_NO, | 
| 1686 | 
+ | 
                check_ambiguity, override, 0, 0, | 
| 1687 | 
+ | 
                "rnemdz", '-', | 
| 1688 | 
  | 
                additional_error)) | 
| 1689 | 
  | 
              goto failure; | 
| 1690 | 
  | 
           | 
| 1691 | 
  | 
          } | 
| 1692 | 
+ | 
          /* shell-resolved RNEMD statistics (temperature, density, angular velocity).  */ | 
| 1693 | 
+ | 
          else if (strcmp (long_options[option_index].name, "rnemdr") == 0) | 
| 1694 | 
+ | 
          { | 
| 1695 | 
  | 
           | 
| 1696 | 
+ | 
            if (args_info->staticProps_group_counter && override) | 
| 1697 | 
+ | 
              reset_group_staticProps (args_info); | 
| 1698 | 
+ | 
            args_info->staticProps_group_counter += 1; | 
| 1699 | 
+ | 
           | 
| 1700 | 
+ | 
            if (update_arg( 0 ,  | 
| 1701 | 
+ | 
                 0 , &(args_info->rnemdr_given), | 
| 1702 | 
+ | 
                &(local_args_info.rnemdr_given), optarg, 0, 0, ARG_NO, | 
| 1703 | 
+ | 
                check_ambiguity, override, 0, 0, | 
| 1704 | 
+ | 
                "rnemdr", '-', | 
| 1705 | 
+ | 
                additional_error)) | 
| 1706 | 
+ | 
              goto failure; | 
| 1707 | 
+ | 
           | 
| 1708 | 
+ | 
          } | 
| 1709 | 
+ | 
          /* shell and angle-resolved RNEMD statistics (temperature, density, angular velocity).  */ | 
| 1710 | 
+ | 
          else if (strcmp (long_options[option_index].name, "rnemdrt") == 0) | 
| 1711 | 
+ | 
          { | 
| 1712 | 
+ | 
           | 
| 1713 | 
+ | 
            if (args_info->staticProps_group_counter && override) | 
| 1714 | 
+ | 
              reset_group_staticProps (args_info); | 
| 1715 | 
+ | 
            args_info->staticProps_group_counter += 1; | 
| 1716 | 
+ | 
           | 
| 1717 | 
+ | 
            if (update_arg( 0 ,  | 
| 1718 | 
+ | 
                 0 , &(args_info->rnemdrt_given), | 
| 1719 | 
+ | 
                &(local_args_info.rnemdrt_given), optarg, 0, 0, ARG_NO, | 
| 1720 | 
+ | 
                check_ambiguity, override, 0, 0, | 
| 1721 | 
+ | 
                "rnemdrt", '-', | 
| 1722 | 
+ | 
                additional_error)) | 
| 1723 | 
+ | 
              goto failure; | 
| 1724 | 
+ | 
           | 
| 1725 | 
+ | 
          } | 
| 1726 | 
+ | 
           | 
| 1727 | 
  | 
          break; | 
| 1728 | 
  | 
        case '?':       /* Invalid option.  */ | 
| 1729 | 
  | 
          /* `getopt_long' already printed an error message.  */ |