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

Comparing branches/development/src/io/DumpReader.cpp (file contents):
Revision 1763 by gezelter, Sun Jun 10 14:05:02 2012 UTC vs.
Revision 1764 by gezelter, Tue Jul 3 18:32:27 2012 UTC

# Line 58 | Line 58
58   #include "utils/simError.h"
59   #include "utils/MemoryUtils.hpp"
60   #include "utils/StringTokenizer.hpp"
61 + #include "brains/Thermo.hpp"
62  
63   #ifdef IS_MPI
63
64   #include <mpi.h>
65 < #define TAKE_THIS_TAG_CHAR 0
66 < #define TAKE_THIS_TAG_INT 1
65 > #endif
66  
68 #endif // is_mpi
67  
70
68   namespace OpenMD {
69    
70    DumpReader::DumpReader(SimInfo* info, const std::string& filename)
# Line 245 | Line 242 | namespace OpenMD {
242  
243      if (needCOMprops_) {
244        Snapshot* s = info_->getSnapshotManager()->getCurrentSnapshot();
245 +      Thermo thermo(info_);
246        Vector3d com;
249      Vector3d comvel;
250      Vector3d comw;
251      if (needPos_ && needVel_){
252        info_->getComAll(com, comvel);
253        comw = info_->getAngularMomentum();
254      }else{
255        com = info_->getCom();
256        comvel = 0.0;
257        comw   = 0.0;
258      }
259      s->setCOMprops(com, comvel, comw);      
260    }
247  
248 +      if (needPos_ && needVel_) {
249 +        Vector3d comvel;
250 +        Vector3d comw;
251 +        thermo.getComAll(com, comvel);
252 +        comw = thermo.getAngularMomentum();
253 +      } else {
254 +        com = thermo.getCom();
255 +      }                    
256 +    }
257    }
258    
259    void DumpReader::readSet(int whichFrame) {    
# Line 714 | Line 709 | namespace OpenMD {
709          hmat(2, 2) = tokenizer.nextTokenAsDouble();
710          s->setHmat(hmat);      
711        } else if (propertyName == "Thermostat") {
712 <        RealType chi = tokenizer.nextTokenAsDouble();
713 <        RealType integralOfChiDt = tokenizer.nextTokenAsDouble();
714 <        s->setChi(chi);
715 <        s->setIntegralOfChiDt(integralOfChiDt);        
712 >        pair<RealType, RealType> thermostat;
713 >        thermostat.first = tokenizer.nextTokenAsDouble();
714 >        thermostat.second = tokenizer.nextTokenAsDouble();
715 >        s->setThermostat(thermostat);
716       } else if (propertyName == "Barostat") {
717          Mat3x3d eta;
718          eta(0, 0) = tokenizer.nextTokenAsDouble();
# Line 729 | Line 724 | namespace OpenMD {
724          eta(2, 0) = tokenizer.nextTokenAsDouble();
725          eta(2, 1) = tokenizer.nextTokenAsDouble();
726          eta(2, 2) = tokenizer.nextTokenAsDouble();
727 <        s->setEta(eta);
727 >        s->setBarostat(eta);
728        } else {
729          sprintf(painCave.errMsg,
730                  "DumpReader Error: %s is an invalid property in <FrameData>\n", propertyName.c_str());

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines