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

Comparing branches/development/src/rnemd/RNEMD.cpp (file contents):
Revision 1774 by gezelter, Wed Aug 8 16:03:02 2012 UTC vs.
Revision 1776 by gezelter, Thu Aug 9 15:52:59 2012 UTC

# Line 68 | Line 68 | namespace OpenMD {
68      int seedValue;
69      Globals * simParams = info->getSimParams();
70      RNEMDParameters* rnemdParams = simParams->getRNEMDParameters();
71 +
72 +    doRNEMD_ = rnemdParams->getUseRNEMD();
73 +    if (!doRNEMD_) return;
74  
75      stringToMethod_["Swap"]  = rnemdSwap;
76      stringToMethod_["NIVS"]  = rnemdNIVS;
# Line 410 | Line 413 | namespace OpenMD {
413    }
414    
415    RNEMD::~RNEMD() {
416 <    
416 >    if (!doRNEMD_) return;
417   #ifdef IS_MPI
418      if (worldRank == 0) {
419   #endif
# Line 432 | Line 435 | namespace OpenMD {
435    }
436  
437    void RNEMD::doSwap() {
438 <
438 >    if (!doRNEMD_) return;
439      Snapshot* currentSnap_ = info_->getSnapshotManager()->getCurrentSnapshot();
440      Mat3x3d hmat = currentSnap_->getHmat();
441  
# Line 767 | Line 770 | namespace OpenMD {
770    }
771    
772    void RNEMD::doNIVS() {
773 <
773 >    if (!doRNEMD_) return;
774      Snapshot* currentSnap_ = info_->getSnapshotManager()->getCurrentSnapshot();
775      Mat3x3d hmat = currentSnap_->getHmat();
776  
# Line 1216 | Line 1219 | namespace OpenMD {
1219    }
1220  
1221    void RNEMD::doVSS() {
1222 <
1222 >    if (!doRNEMD_) return;
1223      Snapshot* currentSnap_ = info_->getSnapshotManager()->getCurrentSnapshot();
1224      RealType time = currentSnap_->getTime();    
1225      Mat3x3d hmat = currentSnap_->getHmat();
# Line 1394 | Line 1397 | namespace OpenMD {
1397    }
1398  
1399    void RNEMD::doRNEMD() {
1400 <
1400 >    if (!doRNEMD_) return;
1401      trialCount_++;
1402      switch(rnemdMethod_) {
1403      case rnemdSwap:
# Line 1413 | Line 1416 | namespace OpenMD {
1416    }
1417  
1418    void RNEMD::collectData() {
1419 <
1419 >    if (!doRNEMD_) return;
1420      Snapshot* currentSnap_ = info_->getSnapshotManager()->getCurrentSnapshot();
1421      Mat3x3d hmat = currentSnap_->getHmat();
1422  
# Line 1550 | Line 1553 | namespace OpenMD {
1553    }
1554  
1555    void RNEMD::getStarted() {
1556 +    if (!doRNEMD_) return;
1557      collectData();
1558      writeOutputFile();
1559    }
1560  
1561    void RNEMD::parseOutputFileFormat(const std::string& format) {
1562 +    if (!doRNEMD_) return;
1563      StringTokenizer tokenizer(format, " ,;|\t\n\r");
1564      
1565      while(tokenizer.hasMoreTokens()) {
# Line 1575 | Line 1580 | namespace OpenMD {
1580    }
1581    
1582    void RNEMD::writeOutputFile() {
1583 +    if (!doRNEMD_) return;
1584      
1585   #ifdef IS_MPI
1586      // If we're the root node, should we print out the results
# Line 1613 | Line 1619 | namespace OpenMD {
1619            rnemdFile_ << "#    fluxType  = \"" << (*fi).first << "\";\n";
1620        }
1621        
1622 <      rnemdFile_ << "#    exchangeTime = " << exchangeTime_ << "; fs\n";
1622 >      rnemdFile_ << "#    exchangeTime = " << exchangeTime_ << ";\n";
1623  
1624        rnemdFile_ << "#    objectSelection = \""
1625                   << rnemdObjectSelection_ << "\";\n";
# Line 1716 | Line 1722 | namespace OpenMD {
1722    }
1723    
1724    void RNEMD::writeReal(int index, unsigned int bin) {
1725 +    if (!doRNEMD_) return;
1726      assert(index >=0 && index < ENDINDEX);
1727      assert(bin < nBins_);
1728      RealType s;
# Line 1734 | Line 1741 | namespace OpenMD {
1741    }
1742    
1743    void RNEMD::writeVector(int index, unsigned int bin) {
1744 +    if (!doRNEMD_) return;
1745      assert(index >=0 && index < ENDINDEX);
1746      assert(bin < nBins_);
1747      Vector3d s;
# Line 1752 | Line 1760 | namespace OpenMD {
1760    }  
1761  
1762    void RNEMD::writeRealStdDev(int index, unsigned int bin) {
1763 +    if (!doRNEMD_) return;
1764      assert(index >=0 && index < ENDINDEX);
1765      assert(bin < nBins_);
1766      RealType s;
# Line 1770 | Line 1779 | namespace OpenMD {
1779    }
1780    
1781    void RNEMD::writeVectorStdDev(int index, unsigned int bin) {
1782 +    if (!doRNEMD_) return;
1783      assert(index >=0 && index < ENDINDEX);
1784      assert(bin < nBins_);
1785      Vector3d s;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines