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

Comparing:
trunk/src/io/RestReader.cpp (file contents), Revision 1409 by gezelter, Fri Jan 22 21:31:12 2010 UTC vs.
branches/development/src/io/RestReader.cpp (file contents), Revision 1875 by gezelter, Fri May 17 14:41:42 2013 UTC

# Line 35 | Line 35
35   *                                                                      
36   * [1]  Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).            
37   * [2]  Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).          
38 < * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008).          
39 < * [4]  Vardeman & Gezelter, in progress (2009).                        
38 > * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008).          
39 > * [4]  Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010).
40 > * [5]  Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
41   */
42  
43  
# Line 67 | Line 68 | namespace OpenMD {
68   namespace OpenMD {
69  
70    void RestReader::scanFile(){
71 <    int lineNo = 0;
71 >
72      std::streampos prevPos;
73      std::streampos  currPos;
74      
# Line 81 | Line 82 | namespace OpenMD {
82        prevPos = currPos;
83        
84        bool foundOpenSnapshotTag = false;
85 <      
85 >      int lineNo = 0;      
86        while(!foundOpenSnapshotTag && inFile_->getline(buffer, bufferSize)) {
87          ++lineNo;
88          
# Line 96 | Line 97 | namespace OpenMD {
97        
98   #ifdef IS_MPI
99      }
100 <    MPI_Bcast(&framePos_, 1, MPI_INT, 0, MPI_COMM_WORLD);
100 >    MPI::COMM_WORLD.Bcast(&framePos_, 1, MPI::INT, 0);
101   #endif // is_mpi
102    }
103  
# Line 131 | Line 132 | namespace OpenMD {
132        }
133        
134        int sendBufferSize = sendBuffer.size();
135 <      MPI_Bcast(&sendBufferSize, 1, MPI_INT, masterNode, MPI_COMM_WORLD);    
136 <      MPI_Bcast((void *)sendBuffer.c_str(), sendBufferSize, MPI_CHAR, masterNode, MPI_COMM_WORLD);    
135 >      MPI::COMM_WORLD.Bcast(&sendBufferSize, 1, MPI::INT, masterNode);
136 >      MPI::COMM_WORLD.Bcast((void *)sendBuffer.c_str(), sendBufferSize,
137 >                            MPI::CHAR, masterNode);
138        
139        sstream.str(sendBuffer);
140      } else {
141        int sendBufferSize;
142 <      MPI_Bcast(&sendBufferSize, 1, MPI_INT, masterNode, MPI_COMM_WORLD);    
142 >      MPI::COMM_WORLD.Bcast(&sendBufferSize, 1, MPI::INT, masterNode);
143        char * recvBuffer = new char[sendBufferSize+1];
144        assert(recvBuffer);
145        recvBuffer[sendBufferSize] = '\0';
146 <      MPI_Bcast(recvBuffer, sendBufferSize, MPI_CHAR, masterNode, MPI_COMM_WORLD);    
146 >      MPI::COMM_WORLD.Bcast(recvBuffer, sendBufferSize, MPI::CHAR, masterNode);
147        sstream.str(recvBuffer);
148        delete [] recvBuffer;
149      }      
# Line 279 | Line 281 | namespace OpenMD {
281  
282      int index = tokenizer.nextTokenAsInt();
283  
284 <    StuntDouble* integrableObject = info_->getIOIndexToIntegrableObject(index);
284 >    StuntDouble* sd = info_->getIOIndexToIntegrableObject(index);
285  
286 <    if (integrableObject == NULL) {
286 >    if (sd == NULL) {
287        return;
288      }
289    
# Line 309 | Line 311 | namespace OpenMD {
311        }
312  
313        case 'q' : {
314 <        if (integrableObject->isDirectional()) {
314 >        if (sd->isDirectional()) {
315            
316            q[0] = tokenizer.nextTokenAsDouble();
317            q[1] = tokenizer.nextTokenAsDouble();
# Line 331 | Line 333 | namespace OpenMD {
333        }  
334        case 'j' : {
335          Vector3d ji;
336 <        if (integrableObject->isDirectional()) {
336 >        if (sd->isDirectional()) {
337            ji[0] = tokenizer.nextTokenAsDouble();
338            ji[1] = tokenizer.nextTokenAsDouble();
339            ji[2] = tokenizer.nextTokenAsDouble();
# Line 365 | Line 367 | namespace OpenMD {
367        all_pos_[index] = pos;      
368          
369        // is this io restrained?
370 <      GenericData* data = integrableObject->getPropertyByName("Restraint");
369 <      ObjectRestraint* oRest;
370 >      GenericData* data = sd->getPropertyByName("Restraint");
371        
372        if (data != NULL) {
373          // make sure we can reinterpret the generic data as restraint data:
# Line 374 | Line 375 | namespace OpenMD {
375          if (restData != NULL) {
376            // make sure we can reinterpet the restraint data as a pointer to
377              // an ObjectRestraint:
378 <          oRest = dynamic_cast<ObjectRestraint*>(restData->getData());
378 >          ObjectRestraint* oRest = dynamic_cast<ObjectRestraint*>(restData->getData());
379            if (oRest != NULL) {          
380 <            if (integrableObject->isDirectional()) {
380 >            if (sd->isDirectional()) {
381                oRest->setReferenceStructure(pos, q.toRotationMatrix3());
382              } else {                          
383                oRest->setReferenceStructure(pos);

Comparing:
trunk/src/io/RestReader.cpp (property svn:keywords), Revision 1409 by gezelter, Fri Jan 22 21:31:12 2010 UTC vs.
branches/development/src/io/RestReader.cpp (property svn:keywords), Revision 1875 by gezelter, Fri May 17 14:41:42 2013 UTC

# Line 0 | Line 1
1 + Author Id Revision Date

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines