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

Comparing trunk/src/brains/ForceManager.cpp (file contents):
Revision 1126 by gezelter, Fri Apr 6 21:53:43 2007 UTC vs.
Revision 1245 by chuckv, Tue May 27 16:39:06 2008 UTC

# Line 53 | Line 53
53   #define __C
54   #include "UseTheForce/DarkSide/fInteractionMap.h"
55   #include "utils/simError.h"
56 + #include "primitives/Bond.hpp"
57   #include "primitives/Bend.hpp"
57 #include "primitives/Bend.hpp"
58   namespace oopse {
59  
60    void ForceManager::calcForces(bool needPotential, bool needStress) {
# Line 83 | Line 83 | namespace oopse {
83      
84      // forces are zeroed here, before any are accumulated.
85      // NOTE: do not rezero the forces in Fortran.
86 <
86 >    
87      for (mol = info_->beginMolecule(mi); mol != NULL;
88           mol = info_->nextMolecule(mi)) {
89        for(atom = mol->beginAtom(ai); atom != NULL; atom = mol->nextAtom(ai)) {
90          atom->zeroForcesAndTorques();
91        }
92 <      
92 >          
93        //change the positions of atoms which belong to the rigidbodies
94        for (rb = mol->beginRigidBody(rbIter); rb != NULL;
95             rb = mol->nextRigidBody(rbIter)) {
96          rb->zeroForcesAndTorques();
97        }        
98 +          
99      }
100      
101      // Zero out the stress tensor
# Line 201 | Line 202 | namespace oopse {
202      RealType* A;
203      RealType* electroFrame;
204      RealType* rc;
205 +    RealType* particlePot;
206      
207      //get current snapshot from SimInfo
208      curSnapshot = info_->getSnapshotManager()->getCurrentSnapshot();
# Line 212 | Line 214 | namespace oopse {
214      trq = config->getArrayPointer(DataStorage::dslTorque);
215      A   = config->getArrayPointer(DataStorage::dslAmat);
216      electroFrame = config->getArrayPointer(DataStorage::dslElectroFrame);
217 +    particlePot = config->getArrayPointer(DataStorage::dslParticlePot);
218  
219      //calculate the center of mass of cutoff group
220      SimInfo::MoleculeIterator mi;
# Line 251 | Line 254 | namespace oopse {
254        longRangePotential[i]=0.0; //Initialize array
255      }
256      
257 <    doForceLoop( pos,
258 <                 rc,
259 <                 A,
260 <                 electroFrame,
261 <                 frc,
262 <                 trq,
263 <                 tau.getArrayPointer(),
264 <                 longRangePotential,
265 <                 &passedCalcPot,
266 <                 &passedCalcStress,
267 <                 &isError );
268 <
257 >    doForceLoop(pos,
258 >                rc,
259 >                A,
260 >                electroFrame,
261 >                frc,
262 >                trq,
263 >                tau.getArrayPointer(),
264 >                longRangePotential,
265 >                particlePot,
266 >                &passedCalcPot,
267 >                &passedCalcStress,
268 >                &isError );
269 >    
270      if( isError ){
271        sprintf( painCave.errMsg,
272                 "Error returned from the fortran force calculation.\n" );

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines