Search in sources :

Example 1 with PiOrbitalTorsion

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);
}
Also used : PiOrbitalTorsion(ffx.potential.bonded.PiOrbitalTorsion) PiTorsionType(ffx.potential.parameters.PiTorsionType) OpenMM_System_addConstraint(simtk.openmm.OpenMMLibrary.OpenMM_System_addConstraint) CoordRestraint(ffx.potential.nonbonded.CoordRestraint)

Aggregations

PiOrbitalTorsion (ffx.potential.bonded.PiOrbitalTorsion)1 CoordRestraint (ffx.potential.nonbonded.CoordRestraint)1 PiTorsionType (ffx.potential.parameters.PiTorsionType)1 OpenMM_System_addConstraint (simtk.openmm.OpenMMLibrary.OpenMM_System_addConstraint)1