--- trunk/OOPSE/libmdtools/DumpWriter.cpp 2004/06/03 20:02:48 1230 +++ trunk/OOPSE/libmdtools/DumpWriter.cpp 2004/06/03 21:06:51 1231 @@ -294,11 +294,11 @@ void DumpWriter::writeFrame( vector& outFil } else strcat( writeLine, "0.0\t0.0\t0.0\t0.0\t0.0\t0.0\t0.0\n" ); + + for(k = 0; k < outFile.size(); k++) + *outFile[k] << writeLine; } - - for(k = 0; k < outFile.size(); k++) - *outFile[k] << writeLine; } #else // is_mpi @@ -404,11 +404,53 @@ void DumpWriter::writeFrame( vector& outFil isDirectional = 1; else isDirectional = 0; + + // If we've survived to here, format the line: - } + if (!isDirectional) { + + sprintf( writeLine, + "%s\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t", + atomTypeString, + atomData[0], + atomData[1], + atomData[2], + atomData[3], + atomData[4], + atomData[5]); + + strcat( writeLine, "0.0\t0.0\t0.0\t0.0\t0.0\t0.0\t0.0\n" ); + + } + else { + + sprintf( writeLine, + "%s\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\n", + atomTypeString, + atomData[0], + atomData[1], + atomData[2], + atomData[3], + atomData[4], + atomData[5], + atomData[6], + atomData[7], + atomData[8], + atomData[9], + atomData[10], + atomData[11], + atomData[12]); + + } + + for(k = 0; k < outFile.size(); k++) + *outFile[k] << writeLine; + + }// end for(int l =0) potatoes[which_node] = myPotato; - } else { + } + else { haveError = 0; @@ -453,50 +495,54 @@ void DumpWriter::writeFrame( vector& outFil atomData[12] = ji[2]; } - } + // If we've survived to here, format the line: + + if (!isDirectional) { + + sprintf( writeLine, + "%s\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t", + atomTypeString, + atomData[0], + atomData[1], + atomData[2], + atomData[3], + atomData[4], + atomData[5]); + + strcat( writeLine, "0.0\t0.0\t0.0\t0.0\t0.0\t0.0\t0.0\n" ); + + } + else { + + sprintf( writeLine, + "%s\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\n", + atomTypeString, + atomData[0], + atomData[1], + atomData[2], + atomData[3], + atomData[4], + atomData[5], + atomData[6], + atomData[7], + atomData[8], + atomData[9], + atomData[10], + atomData[11], + atomData[12]); + + } + + for(k = 0; k < outFile.size(); k++) + *outFile[k] << writeLine; + + + }//end for(iter = integrableObject.begin()) currentIndex++; } - // If we've survived to here, format the line: - - if (!isDirectional) { - - sprintf( writeLine, - "%s\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t", - atomTypeString, - atomData[0], - atomData[1], - atomData[2], - atomData[3], - atomData[4], - atomData[5]); - - strcat( writeLine, "0.0\t0.0\t0.0\t0.0\t0.0\t0.0\t0.0\n" ); - - } else { - - sprintf( writeLine, - "%s\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\n", - atomTypeString, - atomData[0], - atomData[1], - atomData[2], - atomData[3], - atomData[4], - atomData[5], - atomData[6], - atomData[7], - atomData[8], - atomData[9], - atomData[10], - atomData[11], - atomData[12]); - - } - - for(k = 0; k < outFile.size(); k++) - *outFile[k] << writeLine; - } + + }//end for(i = 0; i < mpiSim->getNmol()) for(k = 0; k < outFile.size(); k++) outFile[k]->flush();