* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
* Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team.
- * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
}
/* Grid params for each axis */
- int eGeom = pull_params.coord[dimParams->coordIndex].eGeom;
+ PullGroupGeometry eGeom = pull_params.coord[dimParams->coordIndex].eGeom;
/* Check that the requested interval is in allowed range */
- if (eGeom == epullgDIST)
+ if (eGeom == PullGroupGeometry::Distance)
{
if (dimParams->origin < 0 || dimParams->end < 0)
{
dimParams->origin,
prefix.c_str(),
dimParams->end,
- EPULLGEOM(epullgDIR));
+ enumValueToString(PullGroupGeometry::Direction));
}
}
- else if (eGeom == epullgANGLE || eGeom == epullgANGLEAXIS)
+ else if (eGeom == PullGroupGeometry::Angle || eGeom == PullGroupGeometry::AngleAxis)
{
if (dimParams->origin < 0 || dimParams->end > 180)
{
dimParams->origin,
prefix.c_str(),
dimParams->end,
- EPULLGEOM(epullgANGLE),
- EPULLGEOM(epullgANGLEAXIS));
+ enumValueToString(PullGroupGeometry::Angle),
+ enumValueToString(PullGroupGeometry::AngleAxis));
}
}
- else if (eGeom == epullgDIHEDRAL)
+ else if (eGeom == PullGroupGeometry::Dihedral)
{
if (dimParams->origin < -180 || dimParams->end > 180)
{
dimParams->origin,
prefix.c_str(),
dimParams->end,
- EPULLGEOM(epullgDIHEDRAL));
+ enumValueToString(PullGroupGeometry::Dihedral));
}
}
}
* \param[in] efep This is the type of FEP calculation (efep enumerator).
* \param[in,out] wi Struct for bookeeping warnings.
*/
-void checkFepLambdaDimParams(const std::string& prefix,
- const AwhDimParams* dimParams,
- const t_lambda* lambdaParams,
- const int efep,
- warninp_t wi)
+void checkFepLambdaDimParams(const std::string& prefix,
+ const AwhDimParams* dimParams,
+ const t_lambda* lambdaParams,
+ const FreeEnergyPerturbationType efep,
+ warninp_t wi)
{
std::string opt;
-1);
}
- if (efep == efepSLOWGROWTH || lambdaParams->delta_lambda != 0)
+ if (efep == FreeEnergyPerturbationType::SlowGrowth || lambdaParams->delta_lambda != 0)
{
gmx_fatal(FARGS,
"AWH coupled to the free energy lambda state is not compatible with slow-growth "
"and delta-lambda must be 0.");
}
- if (efep == efepEXPANDED)
+ if (efep == FreeEnergyPerturbationType::Expanded)
{
gmx_fatal(FARGS,
"AWH is not treated like other expanded ensemble methods. Do not use expanded.");
}
else if (dimParams->eCoordProvider == eawhcoordproviderFREE_ENERGY_LAMBDA)
{
- if (ir->efep == efepNO)
+ if (ir->efep == FreeEnergyPerturbationType::No)
{
gmx_fatal(FARGS,
"AWH biasing along a free energy lambda state dimension is only compatible "
"with free energy turned on");
}
- checkFepLambdaDimParams(prefix, dimParams, ir->fepvals, ir->efep, wi);
+ checkFepLambdaDimParams(prefix, dimParams, ir->fepvals.get(), ir->efep, wi);
}
else
{
"distribution: no or yes");
}
opt = prefix + "-equilibrate-histogram";
- awhBiasParams->equilibrateHistogram = (get_eeenum(inp, opt, yesno_names, wi) != 0);
+ awhBiasParams->equilibrateHistogram = (getEnum<Boolean>(inp, opt.c_str(), wi) != Boolean::No);
if (bComment)
{
printStringNoNewline(inp, "Initialize PMF and target with user data: no or yes");
}
opt = prefix + "-user-data";
- awhBiasParams->bUserData = get_eeenum(inp, opt, yesno_names, wi);
+ awhBiasParams->bUserData = getEnum<Boolean>(inp, opt.c_str(), wi) != Boolean::No;
if (bComment)
{
printStringNoNewline(
inp, "When true, biases with share-group>0 are shared between multiple simulations");
opt = "awh-share-multisim";
- awhParams->shareBiasMultisim = (get_eeenum(inp, opt, yesno_names, wi) != 0);
+ awhParams->shareBiasMultisim = (getEnum<Boolean>(inp, opt.c_str(), wi) != Boolean::No);
printStringNoNewline(inp, "The number of independent AWH biases");
opt = "awh-nbias";
{
double period = 0;
- if (pullCoordParams.eGeom == epullgDIR)
+ if (pullCoordParams.eGeom == PullGroupGeometry::Direction)
{
const real margin = 0.001;
// Make dims periodic when the interval covers > 95%
}
}
}
- else if (pullCoordParams.eGeom == epullgDIHEDRAL)
+ else if (pullCoordParams.eGeom == PullGroupGeometry::Dihedral)
{
/* The dihedral angle is periodic in -180 to 180 deg */
period = 360;
{
const t_pull_coord& pullCoordParams = pull_params->coord[dimParams->coordIndex];
- if (pullCoordParams.eGeom == epullgDIRPBC)
+ if (pullCoordParams.eGeom == PullGroupGeometry::DirectionPBC)
{
gmx_fatal(FARGS,
"AWH does not support pull geometry '%s'. "
"If the maximum distance between the groups is always "
"less than half the box size, "
"you can use geometry '%s' instead.",
- EPULLGEOM(epullgDIRPBC),
- EPULLGEOM(epullgDIR));
+ enumValueToString(PullGroupGeometry::DirectionPBC),
+ enumValueToString(PullGroupGeometry::Direction));
}
dimParams->period = get_pull_coord_period(pullCoordParams, pbc, dimParams->end - dimParams->origin);
// We would like to check for scaling, but we don't have the full inputrec available here
if (dimParams->period > 0
- && !(pullCoordParams.eGeom == epullgANGLE || pullCoordParams.eGeom == epullgDIHEDRAL))
+ && !(pullCoordParams.eGeom == PullGroupGeometry::Angle
+ || pullCoordParams.eGeom == PullGroupGeometry::Dihedral))
{
bool coordIsScaled = false;
for (int d2 = 0; d2 < DIM; d2++)
"corresponding box vector, this is not supported.",
dimIndex + 1,
biasIndex + 1,
- EPULLGEOM(pullCoordParams.eGeom));
+ enumValueToString(pullCoordParams.eGeom));
warning(wi, mesg.c_str());
}
}