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 1920 by jmichalk, Wed Jul 31 19:30:46 2013 UTC vs.
Revision 2071 by gezelter, Sat Mar 7 21:41:51 2015 UTC

# Line 56 | Line 56 | namespace OpenMD {
56   namespace OpenMD {
57  
58    FluctuatingChargePropagator::FluctuatingChargePropagator(SimInfo* info) :
59 <    info_(info), hasFlucQ_(false), forceMan_(NULL), initialized_(false) {
59 >    info_(info), forceMan_(NULL), hasFlucQ_(false), initialized_(false) {
60      
61      Globals* simParams = info_->getSimParams();
62      fqParams_ = simParams->getFluctuatingChargeParameters();    
63    }
64  
65    FluctuatingChargePropagator::~FluctuatingChargePropagator() {
66    if (fqConstraints_ != NULL) delete fqConstraints_;
66    }
67  
68    void FluctuatingChargePropagator::setForceManager(ForceManager* forceMan) {
# Line 84 | Line 83 | namespace OpenMD {
83        return;
84      }
85  
86 <    SimInfo::MoleculeIterator i;
87 <    Molecule::FluctuatingChargeIterator  j;
88 <    Molecule* mol;
89 <    Atom* atom;
86 >    // SimInfo::MoleculeIterator i;
87 >    // Molecule::FluctuatingChargeIterator  j;
88 >    // Molecule* mol;
89 >    // Atom* atom;
90 >    //  
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      
92    for (mol = info_->beginMolecule(i); mol != NULL;
93         mol = info_->nextMolecule(i)) {
94      for (atom = mol->beginFluctuatingCharge(j); atom != NULL;
95           atom = mol->nextFluctuatingCharge(j)) {
96        atom->setFlucQPos(0.0);
97        atom->setFlucQVel(0.0);
98      }
99    }
100    
103      FluctuatingChargeObjectiveFunction flucQobjf(info_, forceMan_,
104                                                   fqConstraints_);
105  
# 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