void IMGDock::storeForces() { int i = 0; for (AtomIterator it = ligand_->beginAtom(); !it.isEnd(); it++) { old_forces_[i] = it->getForce(); i++; } }
// optimal values and old values comared: CHECK(test 1.1: Stretches) HINFile f(BALL_TEST_DATA_PATH(MMFF94_test1.hin)); System s; f >> s; f.close(); TEST_EQUAL(s.countAtoms(), 2) mmff.setup(s); mmff.updateEnergy(); sb.updateStretchForces(); PRECISION(1e-11) // atoms in optimal distance -> forces should be (almost) zero AtomIterator it = s.beginAtom(); TEST_REAL_EQUAL(it->getForce().getDistance(Vector3(0.)), 0) it->setForce(Vector3(0.)); it++; TEST_REAL_EQUAL(it->getForce().getDistance(Vector3(0.)), 0) it->setForce(Vector3(0.)); // move atom by 0.5 to far away it->setPosition(Vector3(2.646,0,0)); mmff.updateEnergy(); sb.updateStretchForces(); it = s.beginAtom(); TEST_REAL_EQUAL(it->getForce().getDistance(Vector3(406.1635825 * FORCES_FACTOR, 0, 0)), 0) it++; TEST_REAL_EQUAL(it->getForce().getDistance(-Vector3(406.1635825 * FORCES_FACTOR, 0, 0)), 0) RESULT