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

Comparing branches/development/src/flucq/FluctuatingChargeLangevin.cpp (file contents):
Revision 1873 by gezelter, Wed Feb 20 15:39:39 2013 UTC vs.
Revision 1874 by gezelter, Wed May 15 15:09:35 2013 UTC

# Line 141 | Line 141 | namespace OpenMD {
141           mol = info_->nextMolecule(i)) {
142        for (atom = mol->beginFluctuatingCharge(j); atom != NULL;
143             atom = mol->nextFluctuatingCharge(j)) {
144 <
145 <        cvel = atom->getFlucQVel();
146 <        cfrc = atom->getFlucQFrc();
147 <        cmass = atom->getChargeMass();      
148 <
144 >        
145          randomForce = randNumGen_.randNorm(0, variance_ );
146          atom->addFlucQFrc(randomForce);        
147          
# Line 153 | Line 149 | namespace OpenMD {
149          // required is at the full step: v(t + h), while we have
150          // initially the velocity at the half step: v(t + h/2).  We
151          // need to iterate to converge the friction force vector.
152 <          
152 >        
153          // this is the velocity at the half-step:
154 <            
154 >        
155          cvel = atom->getFlucQVel();
156 <
156 >        
157          // estimate velocity at full-step using everything but
158          // friction forces:
159          
160          cfrc = atom->getFlucQFrc();
161 +        cmass = atom->getChargeMass();
162          velStep = cvel + dt2_ * cfrc / cmass;
163 <
163 >        
164          frictionForce = 0.0;
165 +        
166          //iteration starts here:
167          
168          for (int k = 0; k < maxIterNum_; k++) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines