--- trunk/OOPSE/libmdtools/InitializeFromFile.cpp 2003/07/09 22:14:06 586 +++ trunk/OOPSE/libmdtools/InitializeFromFile.cpp 2003/07/21 21:27:40 643 @@ -69,7 +69,7 @@ InitializeFromFile :: ~InitializeFromFile( ){ } -void InitializeFromFile :: read_xyz( SimInfo* the_simnfo ){ +void InitializeFromFile :: readInit( SimInfo* the_simnfo ){ int i, j, done, which_node, which_atom; // loop counter @@ -84,7 +84,7 @@ void InitializeFromFile :: read_xyz( SimInfo* the_simn char *parseErr; int procIndex; double boxMat[9]; - + double theBoxMat3[3][3]; simnfo = the_simnfo; @@ -130,9 +130,12 @@ void InitializeFromFile :: read_xyz( SimInfo* the_simn simError(); } - simnfo->setBoxM( boxMat ); + for(i=0;i<3;i++) + for(j=0;j<3;j++) theBoxMat3[i][j] = boxMat[3*j+i]; + simnfo->setBoxM( theBoxMat3 ); + for( i=0; i < n_atoms; i++){ eof_test = fgets(read_buffer, sizeof(read_buffer), c_in_file); @@ -301,7 +304,11 @@ void InitializeFromFile :: read_xyz( SimInfo* the_simn // last thing last, enable fatalities. painCave.isEventLoop = 0; - simnfo->setBoxM( boxMat ); + + for(i=0;i<3;i++) + for(j=0;j<3;j++) theBoxMat3[i][j] = boxMat[3*j+i]; + + simnfo->setBoxM( theBoxMat3 ); #endif @@ -540,8 +547,15 @@ char* InitializeFromFile::parseBoxLine(char* readLine, // set the string tokenizer foo = strtok(readLine, " ,;\t"); - // ignore the first token which is the time stamp. + // set the timeToken. + if(foo == NULL){ + sprintf( painCave.errMsg, + "error in reading Time from %s\n", + c_in_name ); + return strdup( painCave.errMsg ); + } + simnfo->setTime( atof( foo ) ); // get the Hx vector