ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/InitializeFromFile.cpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/InitializeFromFile.cpp (file contents):
Revision 586 by mmeineke, Wed Jul 9 22:14:06 2003 UTC vs.
Revision 641 by mmeineke, Mon Jul 21 16:23:10 2003 UTC

# Line 69 | Line 69 | void InitializeFromFile :: read_xyz( SimInfo* the_simn
69   }
70  
71  
72 < void InitializeFromFile :: read_xyz( SimInfo* the_simnfo ){
72 > void InitializeFromFile :: readInit( SimInfo* the_simnfo ){
73  
74    int i, j, done, which_node, which_atom; // loop counter
75  
# Line 84 | Line 84 | void InitializeFromFile :: read_xyz( SimInfo* the_simn
84    char *parseErr;
85    int procIndex;
86    double boxMat[9];
87 <  
87 >  double theBoxMat3[3][3];
88  
89    simnfo = the_simnfo;
90  
# Line 130 | Line 130 | void InitializeFromFile :: read_xyz( SimInfo* the_simn
130      simError();
131    }
132  
133 <  simnfo->setBoxM( boxMat );
133 >  for(i=0;i<3;i++)
134 >    for(j=0;j<3;j++) theBoxMat3[i][j] = boxMat[3*j+i];
135  
136 +  simnfo->setBoxM( theBoxMat3 );
137  
138 +
139    for( i=0; i < n_atoms; i++){
140      
141      eof_test = fgets(read_buffer, sizeof(read_buffer), c_in_file);
# Line 301 | Line 304 | void InitializeFromFile :: read_xyz( SimInfo* the_simn
304      
305   // last  thing last, enable  fatalities.
306    painCave.isEventLoop = 0;
307 <  simnfo->setBoxM( boxMat );
307 >
308 >  for(i=0;i<3;i++)
309 >    for(j=0;j<3;j++) theBoxMat3[i][j] = boxMat[3*j+i];
310 >
311 >  simnfo->setBoxM( theBoxMat3 );
312  
313    
314   #endif
# Line 540 | Line 547 | char* InitializeFromFile::parseBoxLine(char* readLine,
547    // set the string tokenizer
548    
549    foo = strtok(readLine, " ,;\t");
550 <  // ignore the first token which is the time stamp.
550 >  // set the timeToken.
551  
552 +  if(foo == NULL){
553 +    sprintf( painCave.errMsg,
554 +             "error in reading Time from %s\n",
555 +             c_in_name );
556 +    return strdup( painCave.errMsg );
557 +  }
558 +  simnfo->currentTime = atof( foo );
559  
560    // get the Hx vector
561  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines