use of simtk.openmm.AmoebaOpenMMLibrary.OpenMM_AmoebaInPlaneAngleForce_addAngle in project ffx by mjschnie.
the class ForceFieldEnergyOpenMM method addInPlaneAngleForce.
private void addInPlaneAngleForce() {
Angle[] angles = super.getAngles();
if (angles == null || angles.length < 1) {
return;
}
int nAngles = angles.length;
List<Angle> inPlaneAngles = new ArrayList<>();
// Sort all in-plane angles from normal angles
for (int i = 0; i < nAngles; i++) {
if (angles[i].getAngleMode() == Angle.AngleMode.IN_PLANE) {
inPlaneAngles.add(angles[i]);
}
}
nAngles = inPlaneAngles.size();
if (nAngles < 1) {
return;
}
amoebaInPlaneAngleForce = OpenMM_AmoebaInPlaneAngleForce_create();
for (int i = 0; i < nAngles; i++) {
Angle angle = inPlaneAngles.get(i);
int i1 = angle.getAtom(0).getXyzIndex() - 1;
int i2 = angle.getAtom(1).getXyzIndex() - 1;
int i3 = angle.getAtom(2).getXyzIndex() - 1;
int i4 = angle.getAtom4().getXyzIndex() - 1;
int nh = angle.nh;
OpenMM_AmoebaInPlaneAngleForce_addAngle(amoebaInPlaneAngleForce, i1, i2, i3, i4, angle.angleType.angle[nh], OpenMM_KJPerKcal * AngleType.units * angle.angleType.forceConstant);
}
OpenMM_AmoebaInPlaneAngleForce_setAmoebaGlobalInPlaneAngleCubic(amoebaInPlaneAngleForce, AngleType.cubic);
OpenMM_AmoebaInPlaneAngleForce_setAmoebaGlobalInPlaneAngleQuartic(amoebaInPlaneAngleForce, AngleType.quartic);
OpenMM_AmoebaInPlaneAngleForce_setAmoebaGlobalInPlaneAnglePentic(amoebaInPlaneAngleForce, AngleType.quintic);
OpenMM_AmoebaInPlaneAngleForce_setAmoebaGlobalInPlaneAngleSextic(amoebaInPlaneAngleForce, AngleType.sextic);
OpenMM_System_addForce(system, amoebaInPlaneAngleForce);
logger.log(Level.INFO, " Added in-plane angles ({0})", nAngles);
}
Aggregations