ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/flucq/FluctuatingChargePropagator.cpp
(Generate patch)

Comparing trunk/src/flucq/FluctuatingChargePropagator.cpp (file contents):
Revision 1913 by jmichalk, Wed Jul 24 20:00:51 2013 UTC vs.
Revision 1981 by gezelter, Mon Apr 14 18:32:51 2014 UTC

# Line 60 | Line 60 | namespace OpenMD {
60      
61      Globals* simParams = info_->getSimParams();
62      fqParams_ = simParams->getFluctuatingChargeParameters();    
63    fqConstraints_ = new FluctuatingChargeConstraints(info_);
64    fqConstraints_->setConstrainRegions( fqParams_->getConstrainRegions() );
63    }
64  
65    FluctuatingChargePropagator::~FluctuatingChargePropagator() {
68    if (fqConstraints_ != NULL) delete fqConstraints_;
66    }
67  
68    void FluctuatingChargePropagator::setForceManager(ForceManager* forceMan) {
# Line 76 | Line 73 | namespace OpenMD {
73      if (info_->usesFluctuatingCharges()) {
74        if (info_->getNFluctuatingCharges() > 0) {
75          hasFlucQ_ = true;
76 +        fqConstraints_ = new FluctuatingChargeConstraints(info_);
77 +        fqConstraints_->setConstrainRegions(fqParams_->getConstrainRegions());
78        }
79      }
80      
# Line 89 | Line 88 | namespace OpenMD {
88      Molecule* mol;
89      Atom* atom;
90      
91 <    for (mol = info_->beginMolecule(i); mol != NULL;
92 <         mol = info_->nextMolecule(i)) {
93 <      for (atom = mol->beginFluctuatingCharge(j); atom != NULL;
94 <           atom = mol->nextFluctuatingCharge(j)) {
95 <        atom->setFlucQPos(0.0);
96 <        atom->setFlucQVel(0.0);
97 <      }
98 <    }
91 >    // For single-minima flucq, this ensures a net neutral system, but
92 >    // for multiple minima, this is no longer the right thing to do:
93 >    //
94 >    // for (mol = info_->beginMolecule(i); mol != NULL;
95 >    //      mol = info_->nextMolecule(i)) {
96 >    //   for (atom = mol->beginFluctuatingCharge(j); atom != NULL;
97 >    //        atom = mol->nextFluctuatingCharge(j)) {
98 >    //     atom->setFlucQPos(0.0);
99 >    //     atom->setFlucQVel(0.0);
100 >    //   }
101 >    // }
102      
103      FluctuatingChargeObjectiveFunction flucQobjf(info_, forceMan_,
104                                                   fqConstraints_);
# Line 112 | Line 114 | namespace OpenMD {
114      DumpStatusFunction dsf(info_);  // we want a dump file written
115                                      // every iteration
116      minim->minimize(problem, endCriteria);
117 +    cerr << "back from minim\n";
118      initialized_ = true;
119    }
120  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines