--- trunk/OOPSE/libmdtools/DumpReader.cpp 2003/10/31 18:28:52 847 +++ trunk/OOPSE/libmdtools/DumpReader.cpp 2004/04/12 20:32:20 1097 @@ -1,3 +1,4 @@ +#define _LARGEFILE_SOURCE64 #define _FILE_OFFSET_BITS 64 #include @@ -33,7 +34,7 @@ using namespace dumpRead; using namespace dumpRead; -DumpReader :: DumpReader( char *in_name ){ +DumpReader :: DumpReader(const char *in_name ){ isScanned = false; headFP = new FilePos; @@ -221,14 +222,13 @@ void DumpReader :: readSet( int whichFrame ){ double time; fpos_t *framePos; + framePos = frameStart[whichFrame]->getPos(); #ifndef IS_MPI - framePos = frameStart[whichFrame]->getPos(); - + fsetpos(inFile, framePos); - eof_test = fgets(read_buffer, sizeof(read_buffer), inFile); if( eof_test == NULL ){ sprintf( painCave.errMsg, @@ -316,7 +316,7 @@ void DumpReader :: readSet( int whichFrame ){ haveError = 0; if (worldRank == 0) { - + fsetpos(inFile, framePos); eof_test = fgets(read_buffer, sizeof(read_buffer), inFile); if( eof_test == NULL ){ sprintf( painCave.errMsg, @@ -465,10 +465,10 @@ char* DumpReader::parseDumpLine(char* readLine, int gl char *foo; // the pointer to the current string token - double pos[3]; // position place holders - double vel[3]; // velocity placeholders - double q[4]; // the quaternions - double jx, jy, jz; // angular velocity placeholders; + double pos[3]; // position place holders + double vel[3]; // velocity placeholders + double q[4]; // the quaternions + double ji[3]; // angular velocity placeholders; double qSqr, qLength; // needed to normalize the quaternion vector. Atom **atoms = simnfo->atoms; @@ -497,17 +497,17 @@ char* DumpReader::parseDumpLine(char* readLine, int gl // set the string tokenizer foo = strtok(readLine, " ,;\t"); - + atoms[atomIndex]->setType(foo); // check the atom name to the current atom - if( strcmp( foo, atoms[atomIndex]->getType() ) ){ - sprintf( painCave.errMsg, - "Initialize from file error. Atom %s at index %d " - "in file %s does not" - " match the BASS atom %s.\n", - foo, atomIndex, inName, atoms[atomIndex]->getType() ); - return strdup( painCave.errMsg ); - } + //if( strcmp( foo, atoms[atomIndex]->getType() ) ){ + // sprintf( painCave.errMsg, + // "Initialize from file error. Atom %s at index %d " + // "in file %s does not" + // " match the BASS atom %s.\n", + // foo, atomIndex, inName, atoms[atomIndex]->getType() ); + // return strdup( painCave.errMsg ); + //} // get the positions @@ -629,7 +629,7 @@ char* DumpReader::parseDumpLine(char* readLine, int gl inName, n_atoms, atomIndex ); return strdup( painCave.errMsg ); } - jx = atof( foo ); + ji[0] = atof( foo ); foo = strtok(NULL, " ,;\t"); if(foo == NULL){ @@ -639,7 +639,7 @@ char* DumpReader::parseDumpLine(char* readLine, int gl inName, n_atoms, atomIndex ); return strdup( painCave.errMsg ); } - jy = atof(foo ); + ji[1] = atof(foo ); foo = strtok(NULL, " ,;\t"); if(foo == NULL){ @@ -649,7 +649,7 @@ char* DumpReader::parseDumpLine(char* readLine, int gl inName, n_atoms, atomIndex ); return strdup( painCave.errMsg ); } - jz = atof( foo ); + ji[2] = atof( foo ); dAtom = ( DirectionalAtom* )atoms[atomIndex]; @@ -667,9 +667,7 @@ char* DumpReader::parseDumpLine(char* readLine, int gl // add the angular velocities - dAtom->setJx( jx ); - dAtom->setJy( jy ); - dAtom->setJz( jz ); + dAtom->setJ( ji ); } // add the positions and velocities to the atom