--- trunk/OOPSE/libmdtools/InitializeFromFile.cpp 2003/07/21 21:27:40 643 +++ trunk/OOPSE/libmdtools/InitializeFromFile.cpp 2003/07/22 16:41:08 644 @@ -83,6 +83,7 @@ void InitializeFromFile :: readInit( SimInfo* the_simn char *eof_test; // ptr to see when we reach the end of the file char *parseErr; int procIndex; + double currTime; double boxMat[9]; double theBoxMat3[3][3]; @@ -123,7 +124,7 @@ void InitializeFromFile :: readInit( SimInfo* the_simn simError(); } - parseErr = parseBoxLine( read_buffer, boxMat ); + parseErr = parseBoxLine( read_buffer, boxMat, currTime ); if( parseErr != NULL ){ strcpy( painCave.errMsg, parseErr ); painCave.isFatal = 1; @@ -134,6 +135,7 @@ void InitializeFromFile :: readInit( SimInfo* the_simn for(j=0;j<3;j++) theBoxMat3[i][j] = boxMat[3*j+i]; simnfo->setBoxM( theBoxMat3 ); + simnfo->setTime( currTime ); for( i=0; i < n_atoms; i++){ @@ -210,7 +212,7 @@ void InitializeFromFile :: readInit( SimInfo* the_simn simError(); } - parseErr = parseBoxLine( read_buffer, boxMat ); + parseErr = parseBoxLine( read_buffer, boxMat, currTime ); if( parseErr != NULL ){ strcpy( painCave.errMsg, parseErr ); haveError = 1; @@ -218,6 +220,7 @@ void InitializeFromFile :: readInit( SimInfo* the_simn } MPI_Bcast(boxMat, 9, MPI_DOUBLE, 0, MPI_COMM_WORLD ); + MPI_Bcast(&currTime, 1, MPI_DOUBLE, 0, MPI_COMM_WORLD ); if(haveError) nodeZeroError(); @@ -272,6 +275,7 @@ void InitializeFromFile :: readInit( SimInfo* the_simn } else { MPI_Bcast(boxMat, 9, MPI_DOUBLE, 0, MPI_COMM_WORLD); + MPI_Bcast(&currTime, 1, MPI_DOUBLE, 0, MPI_COMM_WORLD); done = 0; while (!done) { @@ -309,6 +313,7 @@ void InitializeFromFile :: readInit( SimInfo* the_simn for(j=0;j<3;j++) theBoxMat3[i][j] = boxMat[3*j+i]; simnfo->setBoxM( theBoxMat3 ); + simnfo->setTime( currTime ); #endif @@ -539,7 +544,8 @@ char* InitializeFromFile::parseBoxLine(char* readLine, } -char* InitializeFromFile::parseBoxLine(char* readLine, double boxMat[9]){ +char* InitializeFromFile::parseBoxLine(char* readLine, double boxMat[9], + double &time ){ char *foo; // the pointer to the current string token int j; @@ -555,7 +561,7 @@ char* InitializeFromFile::parseBoxLine(char* readLine, c_in_name ); return strdup( painCave.errMsg ); } - simnfo->setTime( atof( foo ) ); + time = atof( foo ); // get the Hx vector