--- trunk/src/applications/staticProps/StaticPropsCmd.cpp 2014/05/30 19:48:35 1998 +++ trunk/src/applications/staticProps/StaticPropsCmd.cpp 2015/01/06 21:44:10 2049 @@ -47,6 +47,7 @@ const char *gengetopt_args_info_help[] = { " --nbins_z=INT number of bins in z axis (default=`100')", " -a, --nanglebins=INT number of bins for cos(angle) (default=`50')", " -c, --rcut=DOUBLE cutoff radius (rcut)", + " --thetacut=DOUBLE cutoff angle (thetacut)", " --dz=DOUBLE slab width (dz)", " --length=DOUBLE maximum length (Defaults to 1/2 smallest length \n of first frame)", " --zlength=DOUBLE maximum length (Defaults to 1/2 smallest length \n of first frame)", @@ -62,6 +63,8 @@ const char *gengetopt_args_info_help[] = { " --begin=INT begin internal index", " --end=INT end internal index", " --radius=DOUBLE nanoparticle radius", + " -v, --voxelSize=DOUBLE voxel size (angstroms)", + " --gaussWidth=DOUBLE Gaussian width (angstroms)", "\n Group: staticProps\n an option of this group is required", " --bo bond order parameter (--rcut must be specified)", " --ior icosahedral bond order parameter as a function \n of radius (--rcut must be specified)", @@ -89,11 +92,14 @@ const char *gengetopt_args_info_help[] = { " --rodlength length of nanorod", " -Q, --tet_param tetrahedrality order parameter (Qk)", " --tet_param_z spatially-resolved tetrahedrality order \n parameter Qk(z)", + " --tet_param_xyz volume-resolved tetrahedrality order parameter \n Qk(x,y,z). (voxelSize, rcut, and gaussWidth \n must be specified)", " --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)", " --nitrile electrostatic potential to frequency map based \n on the Cho nitrile fits", - " -m, --multipole average multipole moment contained within a \n cutoff sphere", + " -m, --multipole average multipole moments contained within \n cutoff spheres as a function of radius", + " --surfDiffusion X, Y, and R (surface diffusion if Z exposed and \n bulk immobile) diffusion", + " --hbond Hydrogen Bonding statistics using geometric \n criteria (rcut and thetacut must be \n specified)", 0 }; @@ -132,6 +138,7 @@ void clear_given (struct gengetopt_args_info *args_inf args_info->nbins_z_given = 0 ; args_info->nanglebins_given = 0 ; args_info->rcut_given = 0 ; + args_info->thetacut_given = 0 ; args_info->dz_given = 0 ; args_info->length_given = 0 ; args_info->zlength_given = 0 ; @@ -147,6 +154,8 @@ void clear_given (struct gengetopt_args_info *args_inf args_info->begin_given = 0 ; args_info->end_given = 0 ; args_info->radius_given = 0 ; + args_info->voxelSize_given = 0 ; + args_info->gaussWidth_given = 0 ; args_info->bo_given = 0 ; args_info->ior_given = 0 ; args_info->for_given = 0 ; @@ -173,11 +182,14 @@ 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->tet_param_xyz_given = 0 ; args_info->rnemdz_given = 0 ; args_info->rnemdr_given = 0 ; args_info->rnemdrt_given = 0 ; args_info->nitrile_given = 0 ; args_info->multipole_given = 0 ; + args_info->surfDiffusion_given = 0 ; + args_info->hbond_given = 0 ; args_info->staticProps_group_counter = 0 ; } @@ -202,6 +214,7 @@ void clear_args (struct gengetopt_args_info *args_info args_info->nanglebins_arg = 50; args_info->nanglebins_orig = NULL; args_info->rcut_orig = NULL; + args_info->thetacut_orig = NULL; args_info->dz_orig = NULL; args_info->length_orig = NULL; args_info->zlength_orig = NULL; @@ -224,6 +237,8 @@ void clear_args (struct gengetopt_args_info *args_info args_info->begin_orig = NULL; args_info->end_orig = NULL; args_info->radius_orig = NULL; + args_info->voxelSize_orig = NULL; + args_info->gaussWidth_orig = NULL; } @@ -243,52 +258,58 @@ void init_args_info(struct gengetopt_args_info *args_i args_info->nbins_z_help = gengetopt_args_info_help[8] ; args_info->nanglebins_help = gengetopt_args_info_help[9] ; args_info->rcut_help = gengetopt_args_info_help[10] ; - args_info->dz_help = gengetopt_args_info_help[11] ; - args_info->length_help = gengetopt_args_info_help[12] ; - args_info->zlength_help = gengetopt_args_info_help[13] ; - args_info->zoffset_help = gengetopt_args_info_help[14] ; - args_info->sele1_help = gengetopt_args_info_help[15] ; - args_info->sele2_help = gengetopt_args_info_help[16] ; - args_info->sele3_help = gengetopt_args_info_help[17] ; - args_info->refsele_help = gengetopt_args_info_help[18] ; - args_info->comsele_help = gengetopt_args_info_help[19] ; - args_info->seleoffset_help = gengetopt_args_info_help[20] ; - args_info->seleoffset2_help = gengetopt_args_info_help[21] ; - args_info->molname_help = gengetopt_args_info_help[22] ; - args_info->begin_help = gengetopt_args_info_help[23] ; - args_info->end_help = gengetopt_args_info_help[24] ; - args_info->radius_help = gengetopt_args_info_help[25] ; - args_info->bo_help = gengetopt_args_info_help[27] ; - args_info->ior_help = gengetopt_args_info_help[28] ; - args_info->for_help = gengetopt_args_info_help[29] ; - args_info->bad_help = gengetopt_args_info_help[30] ; - args_info->count_help = gengetopt_args_info_help[31] ; - args_info->gofr_help = gengetopt_args_info_help[32] ; - args_info->gofz_help = gengetopt_args_info_help[33] ; - args_info->r_theta_help = gengetopt_args_info_help[34] ; - args_info->r_omega_help = gengetopt_args_info_help[35] ; - args_info->r_z_help = gengetopt_args_info_help[36] ; - args_info->theta_omega_help = gengetopt_args_info_help[37] ; - args_info->gxyz_help = gengetopt_args_info_help[38] ; - args_info->twodgofr_help = gengetopt_args_info_help[39] ; - args_info->p2_help = gengetopt_args_info_help[40] ; - args_info->rp2_help = gengetopt_args_info_help[41] ; - args_info->scd_help = gengetopt_args_info_help[42] ; - args_info->density_help = gengetopt_args_info_help[43] ; - args_info->slab_density_help = gengetopt_args_info_help[44] ; - args_info->p_angle_help = gengetopt_args_info_help[45] ; - args_info->hxy_help = gengetopt_args_info_help[46] ; - args_info->rho_r_help = gengetopt_args_info_help[47] ; - args_info->angle_r_help = gengetopt_args_info_help[48] ; - args_info->hullvol_help = gengetopt_args_info_help[49] ; - args_info->rodlength_help = gengetopt_args_info_help[50] ; - args_info->tet_param_help = gengetopt_args_info_help[51] ; - args_info->tet_param_z_help = gengetopt_args_info_help[52] ; - args_info->rnemdz_help = gengetopt_args_info_help[53] ; - args_info->rnemdr_help = gengetopt_args_info_help[54] ; - args_info->rnemdrt_help = gengetopt_args_info_help[55] ; - args_info->nitrile_help = gengetopt_args_info_help[56] ; - args_info->multipole_help = gengetopt_args_info_help[57] ; + args_info->thetacut_help = gengetopt_args_info_help[11] ; + args_info->dz_help = gengetopt_args_info_help[12] ; + args_info->length_help = gengetopt_args_info_help[13] ; + args_info->zlength_help = gengetopt_args_info_help[14] ; + args_info->zoffset_help = gengetopt_args_info_help[15] ; + args_info->sele1_help = gengetopt_args_info_help[16] ; + args_info->sele2_help = gengetopt_args_info_help[17] ; + args_info->sele3_help = gengetopt_args_info_help[18] ; + args_info->refsele_help = gengetopt_args_info_help[19] ; + args_info->comsele_help = gengetopt_args_info_help[20] ; + args_info->seleoffset_help = gengetopt_args_info_help[21] ; + args_info->seleoffset2_help = gengetopt_args_info_help[22] ; + args_info->molname_help = gengetopt_args_info_help[23] ; + args_info->begin_help = gengetopt_args_info_help[24] ; + args_info->end_help = gengetopt_args_info_help[25] ; + args_info->radius_help = gengetopt_args_info_help[26] ; + args_info->voxelSize_help = gengetopt_args_info_help[27] ; + args_info->gaussWidth_help = gengetopt_args_info_help[28] ; + args_info->bo_help = gengetopt_args_info_help[30] ; + args_info->ior_help = gengetopt_args_info_help[31] ; + args_info->for_help = gengetopt_args_info_help[32] ; + args_info->bad_help = gengetopt_args_info_help[33] ; + args_info->count_help = gengetopt_args_info_help[34] ; + args_info->gofr_help = gengetopt_args_info_help[35] ; + args_info->gofz_help = gengetopt_args_info_help[36] ; + args_info->r_theta_help = gengetopt_args_info_help[37] ; + args_info->r_omega_help = gengetopt_args_info_help[38] ; + args_info->r_z_help = gengetopt_args_info_help[39] ; + args_info->theta_omega_help = gengetopt_args_info_help[40] ; + args_info->gxyz_help = gengetopt_args_info_help[41] ; + args_info->twodgofr_help = gengetopt_args_info_help[42] ; + args_info->p2_help = gengetopt_args_info_help[43] ; + args_info->rp2_help = gengetopt_args_info_help[44] ; + args_info->scd_help = gengetopt_args_info_help[45] ; + args_info->density_help = gengetopt_args_info_help[46] ; + args_info->slab_density_help = gengetopt_args_info_help[47] ; + args_info->p_angle_help = gengetopt_args_info_help[48] ; + args_info->hxy_help = gengetopt_args_info_help[49] ; + args_info->rho_r_help = gengetopt_args_info_help[50] ; + args_info->angle_r_help = gengetopt_args_info_help[51] ; + args_info->hullvol_help = gengetopt_args_info_help[52] ; + args_info->rodlength_help = gengetopt_args_info_help[53] ; + args_info->tet_param_help = gengetopt_args_info_help[54] ; + args_info->tet_param_z_help = gengetopt_args_info_help[55] ; + args_info->tet_param_xyz_help = gengetopt_args_info_help[56] ; + args_info->rnemdz_help = gengetopt_args_info_help[57] ; + args_info->rnemdr_help = gengetopt_args_info_help[58] ; + args_info->rnemdrt_help = gengetopt_args_info_help[59] ; + args_info->nitrile_help = gengetopt_args_info_help[60] ; + args_info->multipole_help = gengetopt_args_info_help[61] ; + args_info->surfDiffusion_help = gengetopt_args_info_help[62] ; + args_info->hbond_help = gengetopt_args_info_help[63] ; } @@ -383,6 +404,7 @@ cmdline_parser_release (struct gengetopt_args_info *ar free_string_field (&(args_info->nbins_z_orig)); free_string_field (&(args_info->nanglebins_orig)); free_string_field (&(args_info->rcut_orig)); + free_string_field (&(args_info->thetacut_orig)); free_string_field (&(args_info->dz_orig)); free_string_field (&(args_info->length_orig)); free_string_field (&(args_info->zlength_orig)); @@ -404,6 +426,8 @@ cmdline_parser_release (struct gengetopt_args_info *ar free_string_field (&(args_info->begin_orig)); free_string_field (&(args_info->end_orig)); free_string_field (&(args_info->radius_orig)); + free_string_field (&(args_info->voxelSize_orig)); + free_string_field (&(args_info->gaussWidth_orig)); for (i = 0; i < args_info->inputs_num; ++i) @@ -461,6 +485,8 @@ cmdline_parser_dump(FILE *outfile, struct gengetopt_ar write_into_file(outfile, "nanglebins", args_info->nanglebins_orig, 0); if (args_info->rcut_given) write_into_file(outfile, "rcut", args_info->rcut_orig, 0); + if (args_info->thetacut_given) + write_into_file(outfile, "thetacut", args_info->thetacut_orig, 0); if (args_info->dz_given) write_into_file(outfile, "dz", args_info->dz_orig, 0); if (args_info->length_given) @@ -491,6 +517,10 @@ cmdline_parser_dump(FILE *outfile, struct gengetopt_ar write_into_file(outfile, "end", args_info->end_orig, 0); if (args_info->radius_given) write_into_file(outfile, "radius", args_info->radius_orig, 0); + if (args_info->voxelSize_given) + write_into_file(outfile, "voxelSize", args_info->voxelSize_orig, 0); + if (args_info->gaussWidth_given) + write_into_file(outfile, "gaussWidth", args_info->gaussWidth_orig, 0); if (args_info->bo_given) write_into_file(outfile, "bo", 0, 0 ); if (args_info->ior_given) @@ -543,6 +573,8 @@ 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->tet_param_xyz_given) + write_into_file(outfile, "tet_param_xyz", 0, 0 ); if (args_info->rnemdz_given) write_into_file(outfile, "rnemdz", 0, 0 ); if (args_info->rnemdr_given) @@ -553,6 +585,10 @@ cmdline_parser_dump(FILE *outfile, struct gengetopt_ar write_into_file(outfile, "nitrile", 0, 0 ); if (args_info->multipole_given) write_into_file(outfile, "multipole", 0, 0 ); + if (args_info->surfDiffusion_given) + write_into_file(outfile, "surfDiffusion", 0, 0 ); + if (args_info->hbond_given) + write_into_file(outfile, "hbond", 0, 0 ); i = EXIT_SUCCESS; @@ -632,11 +668,14 @@ 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->tet_param_xyz_given = 0 ; args_info->rnemdz_given = 0 ; args_info->rnemdr_given = 0 ; args_info->rnemdrt_given = 0 ; args_info->nitrile_given = 0 ; args_info->multipole_given = 0 ; + args_info->surfDiffusion_given = 0 ; + args_info->hbond_given = 0 ; args_info->staticProps_group_counter = 0; } @@ -893,6 +932,7 @@ cmdline_parser_internal ( { "nbins_z", 1, NULL, 0 }, { "nanglebins", 1, NULL, 'a' }, { "rcut", 1, NULL, 'c' }, + { "thetacut", 1, NULL, 0 }, { "dz", 1, NULL, 0 }, { "length", 1, NULL, 0 }, { "zlength", 1, NULL, 0 }, @@ -908,6 +948,8 @@ cmdline_parser_internal ( { "begin", 1, NULL, 0 }, { "end", 1, NULL, 0 }, { "radius", 1, NULL, 0 }, + { "voxelSize", 1, NULL, 'v' }, + { "gaussWidth", 1, NULL, 0 }, { "bo", 0, NULL, 0 }, { "ior", 0, NULL, 0 }, { "for", 0, NULL, 0 }, @@ -934,15 +976,18 @@ cmdline_parser_internal ( { "rodlength", 0, NULL, 0 }, { "tet_param", 0, NULL, 'Q' }, { "tet_param_z", 0, NULL, 0 }, + { "tet_param_xyz", 0, NULL, 0 }, { "rnemdz", 0, NULL, 0 }, { "rnemdr", 0, NULL, 0 }, { "rnemdrt", 0, NULL, 0 }, { "nitrile", 0, NULL, 0 }, { "multipole", 0, NULL, 'm' }, + { "surfDiffusion", 0, NULL, 0 }, + { "hbond", 0, NULL, 0 }, { 0, 0, 0, 0 } }; - c = getopt_long (argc, argv, "hVi:o:n:b:x:y:a:c:z:gpsdQm", long_options, &option_index); + c = getopt_long (argc, argv, "hVi:o:n:b:x:y:a:c:z:v:gpsdQm", long_options, &option_index); if (c == -1) break; /* Exit from `while (1)' loop. */ @@ -1062,6 +1107,18 @@ cmdline_parser_internal ( &(local_args_info.zoffset_given), optarg, 0, "0", ARG_DOUBLE, check_ambiguity, override, 0, 0, "zoffset", 'z', + additional_error)) + goto failure; + + break; + case 'v': /* voxel size (angstroms). */ + + + if (update_arg( (void *)&(args_info->voxelSize_arg), + &(args_info->voxelSize_orig), &(args_info->voxelSize_given), + &(local_args_info.voxelSize_given), optarg, 0, 0, ARG_DOUBLE, + check_ambiguity, override, 0, 0, + "voxelSize", 'v', additional_error)) goto failure; @@ -1141,7 +1198,7 @@ cmdline_parser_internal ( goto failure; break; - case 'm': /* average multipole moment contained within a cutoff sphere. */ + case 'm': /* average multipole moments contained within cutoff spheres as a function of radius. */ if (args_info->staticProps_group_counter && override) reset_group_staticProps (args_info); @@ -1168,6 +1225,20 @@ cmdline_parser_internal ( &(local_args_info.nbins_z_given), optarg, 0, "100", ARG_INT, check_ambiguity, override, 0, 0, "nbins_z", '-', + additional_error)) + goto failure; + + } + /* cutoff angle (thetacut). */ + else if (strcmp (long_options[option_index].name, "thetacut") == 0) + { + + + if (update_arg( (void *)&(args_info->thetacut_arg), + &(args_info->thetacut_orig), &(args_info->thetacut_given), + &(local_args_info.thetacut_given), optarg, 0, 0, ARG_DOUBLE, + check_ambiguity, override, 0, 0, + "thetacut", '-', additional_error)) goto failure; @@ -1364,6 +1435,20 @@ cmdline_parser_internal ( &(local_args_info.radius_given), optarg, 0, 0, ARG_DOUBLE, check_ambiguity, override, 0, 0, "radius", '-', + additional_error)) + goto failure; + + } + /* Gaussian width (angstroms). */ + else if (strcmp (long_options[option_index].name, "gaussWidth") == 0) + { + + + if (update_arg( (void *)&(args_info->gaussWidth_arg), + &(args_info->gaussWidth_orig), &(args_info->gaussWidth_given), + &(local_args_info.gaussWidth_given), optarg, 0, 0, ARG_DOUBLE, + check_ambiguity, override, 0, 0, + "gaussWidth", '-', additional_error)) goto failure; @@ -1721,6 +1806,23 @@ 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; + + } + /* volume-resolved tetrahedrality order parameter Qk(x,y,z). (voxelSize, rcut, and gaussWidth must be specified). */ + else if (strcmp (long_options[option_index].name, "tet_param_xyz") == 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->tet_param_xyz_given), + &(local_args_info.tet_param_xyz_given), optarg, 0, 0, ARG_NO, + check_ambiguity, override, 0, 0, + "tet_param_xyz", '-', additional_error)) goto failure; @@ -1793,7 +1895,41 @@ cmdline_parser_internal ( goto failure; } + /* X, Y, and R (surface diffusion if Z exposed and bulk immobile) diffusion. */ + else if (strcmp (long_options[option_index].name, "surfDiffusion") == 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->surfDiffusion_given), + &(local_args_info.surfDiffusion_given), optarg, 0, 0, ARG_NO, + check_ambiguity, override, 0, 0, + "surfDiffusion", '-', + additional_error)) + goto failure; + + } + /* Hydrogen Bonding statistics using geometric criteria (rcut and thetacut must be specified). */ + else if (strcmp (long_options[option_index].name, "hbond") == 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->hbond_given), + &(local_args_info.hbond_given), optarg, 0, 0, ARG_NO, + check_ambiguity, override, 0, 0, + "hbond", '-', + additional_error)) + goto failure; + + } + break; case '?': /* Invalid option. */ /* `getopt_long' already printed an error message. */