--- trunk/src/flucq/FluctuatingChargePropagator.cpp 2013/07/31 19:30:46 1920 +++ trunk/src/flucq/FluctuatingChargePropagator.cpp 2014/04/14 18:32:51 1981 @@ -63,7 +63,6 @@ namespace OpenMD { } FluctuatingChargePropagator::~FluctuatingChargePropagator() { - if (fqConstraints_ != NULL) delete fqConstraints_; } void FluctuatingChargePropagator::setForceManager(ForceManager* forceMan) { @@ -89,14 +88,17 @@ namespace OpenMD { Molecule* mol; Atom* atom; - for (mol = info_->beginMolecule(i); mol != NULL; - mol = info_->nextMolecule(i)) { - for (atom = mol->beginFluctuatingCharge(j); atom != NULL; - atom = mol->nextFluctuatingCharge(j)) { - atom->setFlucQPos(0.0); - atom->setFlucQVel(0.0); - } - } + // For single-minima flucq, this ensures a net neutral system, but + // for multiple minima, this is no longer the right thing to do: + // + // for (mol = info_->beginMolecule(i); mol != NULL; + // mol = info_->nextMolecule(i)) { + // for (atom = mol->beginFluctuatingCharge(j); atom != NULL; + // atom = mol->nextFluctuatingCharge(j)) { + // atom->setFlucQPos(0.0); + // atom->setFlucQVel(0.0); + // } + // } FluctuatingChargeObjectiveFunction flucQobjf(info_, forceMan_, fqConstraints_); @@ -112,6 +114,7 @@ namespace OpenMD { DumpStatusFunction dsf(info_); // we want a dump file written // every iteration minim->minimize(problem, endCriteria); + cerr << "back from minim\n"; initialized_ = true; }