[Swift-commit] r8134 - SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/05-md

wozniak at ci.uchicago.edu wozniak at ci.uchicago.edu
Wed Aug 13 11:42:54 CDT 2014


Author: wozniak
Date: 2014-08-13 11:42:54 -0500 (Wed, 13 Aug 2014)
New Revision: 8134

Modified:
   SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/05-md/md.c
Log:
Prepend time in snap file


Modified: SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/05-md/md.c
===================================================================
--- SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/05-md/md.c	2014-08-13 16:37:09 UTC (rev 8133)
+++ SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/05-md/md.c	2014-08-13 16:42:54 UTC (rev 8134)
@@ -15,7 +15,7 @@
 double r8_uniform_01 ( int *seed );
 void update ( int np, int nd, double pos[], double vel[], double f[],
   double acc[], double mass, double dt );
-void snap ( int np, int nd, double pos[], double vel[], double f[],
+void snap ( int np, int nd, double t, double pos[], double vel[], double f[],
   double acc[], double mass, double dt );
 
 static void snap_file_open(void);
@@ -103,7 +103,7 @@
                 ( potential + kinetic - e0 ) / e0 );
       step_print_index = step_print_index + 1;
       step_print = ( step_print_index * step_num ) / step_print_num;
-      snap ( np, nd, pos, vel, force, acc, mass, dt );
+      snap (np, nd, step*dt, pos, vel, force, acc, mass, dt );
     }
     update ( np, nd, pos, vel, force, acc, mass, dt );
   }
@@ -596,15 +596,15 @@
   snap_file = NULL;
 }
 
-void snap ( int np, int nd, double pos[], double vel[], double f[], 
+void snap ( int np, int nd, double t, double pos[], double vel[], double f[],
   double acc[], double mass, double dt )
 {
   int j;
 
   for ( j = 0; j < np; j++ )
   {
-    fprintf(snap_file, "s %f %f %f %s\n",
-            scale(pos[0+j*nd]), scale(pos[1+j*nd]), scale(pos[2+j*nd]), printinfo);
+    fprintf(snap_file, "%f s %f %f %f %s\n",
+            t, scale(pos[0+j*nd]), scale(pos[1+j*nd]), scale(pos[2+j*nd]), printinfo);
   }
 
   snapid++;




More information about the Swift-commit mailing list