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

Comparing trunk/OOPSE/libmdtools/DumpWriter.cpp (file contents):
Revision 920 by tim, Sat Jan 10 09:46:47 2004 UTC vs.
Revision 927 by tim, Mon Jan 12 22:54:42 2004 UTC

# Line 309 | Line 309 | void DumpWriter::writeDump( double currentTime ){
309          }
310          
311          if(haveError) DieDieDie();
312        
313        // If we've survived to here, format the line:
312          
313 <        if (!isDirectional) {
314 <
315 <          sprintf( tempBuffer,
316 <                   "%s\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t",
317 <                   atomTypeString,
318 <                   atomData6[0],
319 <                   atomData6[1],
320 <                   atomData6[2],
321 <                   atomData6[3],
322 <                   atomData6[4],
323 <                   atomData6[5]);
324 <          
325 <          strcpy( writeLine, tempBuffer );
326 <          strcat( writeLine, "0.0\t0.0\t0.0\t0.0\t0.0\t0.0\t0.0\n" );
327 <
328 <        } else {
329 <          
330 <          sprintf( tempBuffer,
331 <                   "%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",
332 <                   atomTypeString,
333 <                   atomData13[0],
334 <                   atomData13[1],
335 <                   atomData13[2],
336 <                   atomData13[3],
337 <                   atomData13[4],
338 <                   atomData13[5],
339 <                   atomData13[6],
340 <                   atomData13[7],
341 <                   atomData13[8],
342 <                   atomData13[9],
343 <                   atomData13[10],
344 <                   atomData13[11],
345 <                   atomData13[12]);
346 <          
347 <          strcat( writeLine, tempBuffer );
348 <          
349 <        }
313 >      }
314 >      // If we've survived to here, format the line:
315 >      
316 >      if (!isDirectional) {
317 >        
318 >        sprintf( tempBuffer,
319 >                 "%s\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t",
320 >                 atomTypeString,
321 >                 atomData6[0],
322 >                 atomData6[1],
323 >                 atomData6[2],
324 >                 atomData6[3],
325 >                 atomData6[4],
326 >                 atomData6[5]);
327 >        
328 >        strcpy( writeLine, tempBuffer );
329 >        strcat( writeLine, "0.0\t0.0\t0.0\t0.0\t0.0\t0.0\t0.0\n" );
330 >        
331 >      } else {
332 >        
333 >        sprintf( tempBuffer,
334 >                 "%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",
335 >                 atomTypeString,
336 >                 atomData13[0],
337 >                 atomData13[1],
338 >                 atomData13[2],
339 >                 atomData13[3],
340 >                 atomData13[4],
341 >                 atomData13[5],
342 >                 atomData13[6],
343 >                 atomData13[7],
344 >                 atomData13[8],
345 >                 atomData13[9],
346 >                 atomData13[10],
347 >                 atomData13[11],
348 >                 atomData13[12]);
349 >        
350 >        strcpy( writeLine, tempBuffer );
351          
353        outFile << writeLine;
354        outFile.flush();
352        }
353 +      
354 +      outFile << writeLine;
355 +      outFile.flush();
356      }
357 +    
358  
359      outFile.flush();
360      sprintf( checkPointMsg,
# Line 738 | Line 739 | void DumpWriter::writeFinal(double finalTime){
739          
740          if(haveError) DieDieDie();
741          
742 <        // If we've survived to here, format the line:
742 <        
743 <        if (!isDirectional) {
742 >      }
743  
745          sprintf( tempBuffer,
746                   "%s\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t",
747                   atomTypeString,
748                   atomData6[0],
749                   atomData6[1],
750                   atomData6[2],
751                   atomData6[3],
752                   atomData6[4],
753                   atomData6[5]);
754          
755          strcpy( writeLine, tempBuffer );
756          strcat( writeLine, "0.0\t0.0\t0.0\t0.0\t0.0\t0.0\t0.0\n" );
744  
745 <        } else {
746 <          
747 <          sprintf( tempBuffer,
748 <                   "%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",
749 <                   atomTypeString,
750 <                   atomData13[0],
751 <                   atomData13[1],
752 <                   atomData13[2],
753 <                   atomData13[3],
754 <                   atomData13[4],
755 <                   atomData13[5],
756 <                   atomData13[6],
757 <                   atomData13[7],
758 <                   atomData13[8],
759 <                   atomData13[9],
760 <                   atomData13[10],
761 <                   atomData13[11],
762 <                   atomData13[12]);
763 <          
764 <          strcat( writeLine, tempBuffer );
765 <          
766 <        }
745 >      // If we've survived to here, format the line:
746 >      
747 >      if (!isDirectional) {
748 >        
749 >        sprintf( tempBuffer,
750 >                 "%s\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t",
751 >                 atomTypeString,
752 >                 atomData6[0],
753 >                 atomData6[1],
754 >                 atomData6[2],
755 >                 atomData6[3],
756 >                 atomData6[4],
757 >                 atomData6[5]);
758 >        
759 >        strcpy( writeLine, tempBuffer );
760 >        strcat( writeLine, "0.0\t0.0\t0.0\t0.0\t0.0\t0.0\t0.0\n" );
761 >        
762 >      } else {
763 >        
764 >        sprintf( tempBuffer,
765 >                 "%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",
766 >                 atomTypeString,
767 >                 atomData13[0],
768 >                 atomData13[1],
769 >                 atomData13[2],
770 >                 atomData13[3],
771 >                 atomData13[4],
772 >                 atomData13[5],
773 >                 atomData13[6],
774 >                 atomData13[7],
775 >                 atomData13[8],
776 >                 atomData13[9],
777 >                 atomData13[10],
778 >                 atomData13[11],
779 >                 atomData13[12]);
780 >        
781 >        strcpy( writeLine, tempBuffer );
782          
781        finalOut << writeLine;
782        finalOut.flush();
783        }
784 +        
785 +      finalOut << writeLine;
786 +      finalOut.flush();
787      }
788 <
788 >  
789      finalOut.flush();
790      sprintf( checkPointMsg,
791               "Sucessfully took a dump.\n");
792      delete[] potatoes;
793 <      
793 >    
794      MPIcheckPoint();        
795      
796    } else {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines