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

Comparing branches/development/src/brains/ForceManager.cpp (file contents):
Revision 1469 by gezelter, Mon Jul 19 14:07:59 2010 UTC vs.
Revision 1535 by gezelter, Fri Dec 31 18:31:56 2010 UTC

# Line 62 | Line 62 | namespace OpenMD {
62    
63    ForceManager::ForceManager(SimInfo * info) : info_(info),
64                                                 NBforcesInitialized_(false) {
65    std::cerr << __PRETTY_FUNCTION__ << "\n";
66    lj_ = new LJ(info_->getForceField());
65    }
66  
67    void ForceManager::calcForces() {
68      
69 <    std::cerr << __PRETTY_FUNCTION__ << "\n";
69 >
70      if (!info_->isFortranInitialized()) {
71        info_->update();
72 +      nbiMan_->setSimInfo(info_);
73 +      nbiMan_->initialize();    
74 +      info_->setupFortran();
75      }
76      
76    if (!NBforcesInitialized_) {
77      lj_->initialize();    
78    }
79
77      preCalculation();
78      
79      calcShortRangeInteraction();
# Line 287 | Line 284 | namespace OpenMD {
284      //initialize data before passing to fortran
285      RealType longRangePotential[LR_POT_TYPES];
286      RealType lrPot = 0.0;
290    Vector3d totalDipole;
287      int isError = 0;
288  
289      for (int i=0; i<LR_POT_TYPES;i++){
# Line 314 | Line 310 | namespace OpenMD {
310      for (int i=0; i<LR_POT_TYPES;i++){
311        lrPot += longRangePotential[i]; //Quick hack
312      }
313 <    
318 <    // grab the simulation box dipole moment if specified
319 <    if (info_->getCalcBoxDipole()){
320 <      getAccumulatedBoxDipole(totalDipole.getArrayPointer());
321 <      
322 <      curSnapshot->statData[Stats::BOX_DIPOLE_X] = totalDipole(0);
323 <      curSnapshot->statData[Stats::BOX_DIPOLE_Y] = totalDipole(1);
324 <      curSnapshot->statData[Stats::BOX_DIPOLE_Z] = totalDipole(2);
325 <    }
326 <    
313 >        
314      //store the tau and long range potential    
315      curSnapshot->statData[Stats::LONG_RANGE_POTENTIAL] = lrPot;
316      curSnapshot->statData[Stats::VANDERWAALS_POTENTIAL] = longRangePotential[VDW_POT];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines