Commit 612fc60b authored by Michael Schnieders's avatar Michael Schnieders
Browse files

Fixed units in swigInputConfig.py for new Alchemical AMOEBA vdW methods...

Fixed units in swigInputConfig.py for new Alchemical AMOEBA vdW methods exposed in the OpenMM API; implemented the getDefaultParameters() on the AmoebaVdwForceImpl to return 1.0 for AmoebaVdwAlpha; Use AmoebaVdwForce::Lambda() to refer to this parameter rather than the String AmoebaVdwAlpha
parent 36ad9ee7
......@@ -258,12 +258,12 @@ public:
/**
* Set the softcore power on lambda (default = 5).
*/
void setSoftcorePower(double n);
void setSoftcorePower(int n);
/**
* Get the softcore power on lambda.
*/
double getSoftcorePower() const;
int getSoftcorePower() const;
/**
* Set the softcore alpha value (default = 0.7).
......
......@@ -60,7 +60,9 @@ public:
}
double calcForcesAndEnergy(ContextImpl& context, bool includeForces, bool includeEnergy, int groups);
std::map<std::string, double> getDefaultParameters() {
return std::map<std::string, double>(); // This force field doesn't define any parameters.
std::map<std::string, double> parameters;
parameters[AmoebaVdwForce::Lambda()] = 1.0;
return parameters;
}
std::vector<std::string> getKernelNames();
/**
......
......@@ -140,11 +140,11 @@ void AmoebaVdwForce::setAlchemicalMethod(AlchemicalMethod method) {
alchemicalMethod = method;
}
void AmoebaVdwForce::setSoftcorePower(double power) {
void AmoebaVdwForce::setSoftcorePower(int power) {
n = power;
}
double AmoebaVdwForce::getSoftcorePower() const {
int AmoebaVdwForce::getSoftcorePower() const {
return n;
}
......
......@@ -260,3 +260,5 @@ std::vector<std::string> AmoebaVdwForceImpl::getKernelNames() {
void AmoebaVdwForceImpl::updateParametersInContext(ContextImpl& context) {
kernel.getAs<CalcAmoebaVdwForceKernel>().copyParametersToContext(context, owner);
}
......@@ -1059,7 +1059,7 @@ double ReferenceCalcAmoebaVdwForceKernel::execute(ContextImpl& context, bool inc
vector<Vec3>& forceData = extractForces(context);
AmoebaReferenceVdwForce vdwForce(sigmaCombiningRule, epsilonCombiningRule);
double energy;
double lambda = context.getParameter("AmoebaVdwLambda");
double lambda = context.getParameter(AmoebaVdwForce::Lambda());
if (useCutoff) {
vdwForce.setCutoff(cutoff);
computeNeighborListVoxelHash(*neighborList, numParticles, posData, allExclusions, extractBoxVectors(context), usePBC, cutoff, 0.0);
......
......@@ -309,15 +309,14 @@ UNITS = {
("AmoebaTorsionTorsionForce", "getTorsionTorsionParameters") : ( None, ()),
("AmoebaTorsionTorsionForce", "getTorsionTorsionGrid") : ( None, ()),
# LPW 2012-10 : Is this a duplicate entry?
#("AmoebaVdwForce", "getParticleParameters") : ( None, (None, None, None, 'unit.nanometer', 'unit.kilojoule_per_mole', None)),
("AmoebaVdwForce", "getSigmaCombiningRule") : ( None, ()),
("AmoebaVdwForce", "getEpsilonCombiningRule") : ( None, ()),
("AmoebaVdwForce", "getParticleExclusions") : ( None, ()),
("AmoebaVdwForce", "getAlchemicalMethod") : ( None, ()),
("AmoebaVdwForce", "getSoftcorePower") : ( None, ()),
("AmoebaVdwForce", "getSoftcoreAlpha") : ( None, ()),
("AmoebaVdwForce", "getCutoff") : ( 'unit.nanometer', ()),
# LPW 2012-10 Modified because it no longer returns ivIndex and classIndex.
# ("AmoebaVdwForce", "getParticleParameters") : ( None, (None, None, 'unit.nanometer', 'unit.kilojoule_per_mole', None)),
("AmoebaVdwForce", "getParticleParameters") : ( None, (None, 'unit.nanometer', 'unit.kilojoule_per_mole', None)),
("AmoebaVdwForce", "getParticleParameters") : ( None, (None, 'unit.nanometer', 'unit.kilojoule_per_mole', None, None)),
("AmoebaWcaDispersionForce", "getParticleParameters") : ( None, ('unit.nanometer', 'unit.kilojoule_per_mole')),
("AmoebaWcaDispersionForce", "getAwater") : ( '1/(unit.nanometer*unit.nanometer*unit.nanometer)',()),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment