--- branches/development/src/flucq/FluctuatingChargeObjectiveFunction.cpp 2012/06/21 19:26:46 1760 +++ branches/development/src/flucq/FluctuatingChargeObjectiveFunction.cpp 2013/02/20 15:39:39 1850 @@ -35,7 +35,7 @@ * * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). - * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). + * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008). * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). */ @@ -56,20 +56,17 @@ namespace OpenMD{ Snapshot* curSnapshot = info_->getSnapshotManager()->getCurrentSnapshot(); potVec pot = curSnapshot->getLongRangePotentials(); potVec exPot = curSnapshot->getExcludedPotentials(); - cerr << "val p= " << pot[ELECTROSTATIC_FAMILY] << "\n"; - cerr << "val e= " << exPot[ELECTROSTATIC_FAMILY] << "\n"; return pot[ELECTROSTATIC_FAMILY] + exPot[ELECTROSTATIC_FAMILY]; } void FluctuatingChargeObjectiveFunction::gradient(DynamicVector& grad, const DynamicVector& x) { - int shakeStatus; setCoor(x); forceMan_->calcForces(); fqConstraints_->applyConstraints(); - cerr << "grad\n"; + getGrad(grad); } @@ -86,8 +83,6 @@ namespace OpenMD{ Snapshot* curSnapshot = info_->getSnapshotManager()->getCurrentSnapshot(); potVec pot = curSnapshot->getLongRangePotentials(); potVec exPot = curSnapshot->getExcludedPotentials(); - cerr << "vang p= " << pot[ELECTROSTATIC_FAMILY] << "\n"; - cerr << "vang e= " << exPot[ELECTROSTATIC_FAMILY] << "\n"; return pot[ELECTROSTATIC_FAMILY] + exPot[ELECTROSTATIC_FAMILY]; } @@ -106,7 +101,6 @@ namespace OpenMD{ atom = mol->nextFluctuatingCharge(j)) { atom->setFlucQPos(x[index++]); - cerr << "setting charge = " << x[index -1] << "\n"; } } } @@ -125,8 +119,7 @@ namespace OpenMD{ for (atom = mol->beginFluctuatingCharge(j); atom != NULL; atom = mol->nextFluctuatingCharge(j)) { - grad[index++] = atom->getFlucQFrc(); - cerr << "getting grad = " << grad[index -1] << "\n"; + grad[index++] = -atom->getFlucQFrc(); } } }