use of ffx.potential.bonded.PiOrbitalTorsion in project ffx by mjschnie.
the class ForceFieldEnergyOpenMM method addPiTorsionForce.
private void addPiTorsionForce() {
PiOrbitalTorsion[] piOrbitalTorsions = super.getPiOrbitalTorsions();
if (piOrbitalTorsions == null || piOrbitalTorsions.length < 1) {
return;
}
int nPiOrbitalTorsions = piOrbitalTorsions.length;
amoebaPiTorsionForce = OpenMM_AmoebaPiTorsionForce_create();
double units = PiTorsionType.units;
for (int i = 0; i < nPiOrbitalTorsions; i++) {
PiOrbitalTorsion piOrbitalTorsion = piOrbitalTorsions[i];
int a1 = piOrbitalTorsion.getAtom(0).getXyzIndex() - 1;
int a2 = piOrbitalTorsion.getAtom(1).getXyzIndex() - 1;
int a3 = piOrbitalTorsion.getAtom(2).getXyzIndex() - 1;
int a4 = piOrbitalTorsion.getAtom(3).getXyzIndex() - 1;
int a5 = piOrbitalTorsion.getAtom(4).getXyzIndex() - 1;
int a6 = piOrbitalTorsion.getAtom(5).getXyzIndex() - 1;
PiTorsionType type = piOrbitalTorsion.piTorsionType;
OpenMM_AmoebaPiTorsionForce_addPiTorsion(amoebaPiTorsionForce, a1, a2, a3, a4, a5, a6, OpenMM_KJPerKcal * type.forceConstant * units);
}
OpenMM_System_addForce(system, amoebaPiTorsionForce);
logger.log(Level.INFO, " Added Pi-Orbital Torsions ({0})", nPiOrbitalTorsions);
}
Aggregations