use of ffx.potential.nonbonded.GeneralizedKirkwood.NonPolar in project ffx by mjschnie.
the class ForceFieldEnergyOpenMM method addGKForce.
private void addGKForce() {
GeneralizedKirkwood gk = super.getGK();
amoebaGeneralizedKirkwoodForce = OpenMM_AmoebaGeneralizedKirkwoodForce_create();
OpenMM_AmoebaGeneralizedKirkwoodForce_setSolventDielectric(amoebaGeneralizedKirkwoodForce, 78.3);
OpenMM_AmoebaGeneralizedKirkwoodForce_setSoluteDielectric(amoebaGeneralizedKirkwoodForce, 1.0);
double[] overlapScale = gk.getOverlapScale();
double[] baseRadii = gk.getBaseRadii();
Atom[] atoms = molecularAssembly.getAtomArray();
int nAtoms = atoms.length;
for (int i = 0; i < nAtoms; i++) {
MultipoleType multipoleType = atoms[i].getMultipoleType();
OpenMM_AmoebaGeneralizedKirkwoodForce_addParticle(amoebaGeneralizedKirkwoodForce, multipoleType.charge, OpenMM_NmPerAngstrom * baseRadii[i], overlapScale[i]);
}
OpenMM_AmoebaGeneralizedKirkwoodForce_setProbeRadius(amoebaGeneralizedKirkwoodForce, 1.4 * OpenMM_NmPerAngstrom);
NonPolar nonpolar = gk.getNonPolarModel();
switch(nonpolar) {
case BORN_SOLV:
case BORN_CAV_DISP:
default:
// Configure a Born Radii based surface area term.
double surfaceTension = gk.getSurfaceTension() * OpenMM_KJPerKcal * OpenMM_AngstromsPerNm * OpenMM_AngstromsPerNm;
OpenMM_AmoebaGeneralizedKirkwoodForce_setIncludeCavityTerm(amoebaGeneralizedKirkwoodForce, OpenMM_True);
OpenMM_AmoebaGeneralizedKirkwoodForce_setSurfaceAreaFactor(amoebaGeneralizedKirkwoodForce, -surfaceTension);
break;
case CAV:
case CAV_DISP:
case HYDROPHOBIC_PMF:
case NONE:
// This NonPolar model does not use a Born Radii based surface area term.
OpenMM_AmoebaGeneralizedKirkwoodForce_setIncludeCavityTerm(amoebaGeneralizedKirkwoodForce, OpenMM_False);
break;
}
OpenMM_System_addForce(system, amoebaGeneralizedKirkwoodForce);
switch(nonpolar) {
case CAV_DISP:
case BORN_CAV_DISP:
addWCAForce();
break;
case CAV:
case HYDROPHOBIC_PMF:
case BORN_SOLV:
case NONE:
default:
}
logger.log(Level.INFO, " Added generalized Kirkwood force.");
}
Aggregations