use of ffx.potential.bonded.ImproperTorsion in project ffx by mjschnie.
the class ForceFieldEnergyOpenMM method addImproperTorsionForce.
private void addImproperTorsionForce() {
ImproperTorsion[] impropers = super.getImproperTorsions();
if (impropers == null || impropers.length < 1) {
return;
}
int nImpropers = impropers.length;
amoebaImproperTorsionForce = OpenMM_PeriodicTorsionForce_create();
for (int i = 0; i < nImpropers; i++) {
ImproperTorsion improperTorsion = impropers[i];
int a1 = improperTorsion.getAtom(0).getXyzIndex() - 1;
int a2 = improperTorsion.getAtom(1).getXyzIndex() - 1;
int a3 = improperTorsion.getAtom(2).getXyzIndex() - 1;
int a4 = improperTorsion.getAtom(3).getXyzIndex() - 1;
ImproperTorsionType improperTorsionType = improperTorsion.improperType;
OpenMM_PeriodicTorsionForce_addTorsion(amoebaImproperTorsionForce, a1, a2, a3, a4, improperTorsionType.periodicity, improperTorsionType.phase * OpenMM_RadiansPerDegree, OpenMM_KJPerKcal * improperTorsion.units * improperTorsion.scaleFactor * improperTorsionType.k);
}
OpenMM_System_addForce(system, amoebaImproperTorsionForce);
logger.log(Level.INFO, " Added improper torsions ({0})", nImpropers);
}
Aggregations