[Swift-commit] r8183 - SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/md-src

wilde at ci.uchicago.edu wilde at ci.uchicago.edu
Thu Aug 14 11:34:57 CDT 2014


Author: wilde
Date: 2014-08-14 11:34:57 -0500 (Thu, 14 Aug 2014)
New Revision: 8183

Modified:
   SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/md-src/main.c
   SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/md-src/md.c
   SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/md-src/md.h
Log:
Adjust arguments and order.

Modified: SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/md-src/main.c
===================================================================
--- SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/md-src/main.c	2014-08-14 16:29:11 UTC (rev 8182)
+++ SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/md-src/main.c	2014-08-14 16:34:57 UTC (rev 8183)
@@ -13,8 +13,8 @@
 
 char *outfile = "md.dat";
 char *trjfile = "md.trj";
+char *printinfo = "0.1 1.0 0.2 0.05 50.0 0.1";
 
-
 /******************************************************************************/
 
 int main ( int argc, char *argv[] )
@@ -83,6 +83,8 @@
   int step_print;
   int step_print_index = 0;
   int step_print_num = 10;
+  double scale_factor = 2.5;
+  double scale_offset = 2.0;
   double *vel;
 
   timestamp ( );
@@ -188,10 +190,16 @@
 
   ctime1 = cpu_time ( );
 
+  /*
   simulate (step_num, step_print_num, step_print, step_print_index,
             np, nd, mass,
             dt, seed, outfile, trjfile);
+  */
 
+  simulate (nd, np, step_num, step_print_num, 
+            dt, mass, printinfo, scale_factor, scale_offset,
+            seed, outfile, trjfile);
+
   ctime2 = cpu_time ( );
   ctime = ctime2 - ctime1;
 

Modified: SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/md-src/md.c
===================================================================
--- SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/md-src/md.c	2014-08-14 16:29:11 UTC (rev 8182)
+++ SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/md-src/md.c	2014-08-14 16:34:57 UTC (rev 8183)
@@ -6,10 +6,12 @@
 
 #include "md.h"
 
-double scale_factor = 2.5, scale_offset = -2.0;
+double scale_factor_g, scale_offset_g; /* FIXME */
+
+/*
 char *printinfo = "0.05 1.0 0.2 0.05 50.0 0.1";
+*/
 
-
 double dist ( int nd, double r1[], double r2[], double dr[] );
 
 double r8_uniform_01 ( int *seed );
@@ -21,15 +23,21 @@
 static void trj_file_open(char *trjfile);
 static void trj_file_close(void);
 
-void simulate (int step_num, int step_print_num,
-               int step_print, int step_print_index,
-               int np, int nd,
-               double mass,
-               double dt,
-               int seed,
-               char* outfile,
-               char* trjfile)
+void simulate ( int nd, int np,
+		int step_num, int step_print_num,
+		double dt,
+		double mass,
+		char *printinfo,
+		double scale_factor,
+		double scale_offset,
+		int seed,
+		char* outfile,
+		char* trjfile)
 {
+   int step_print, step_print_index;
+   scale_factor_g = scale_factor;
+   scale_offset_g = scale_offset;
+
   /*
     Allocate memory.
   */
@@ -575,7 +583,7 @@
 
 double scale (double x)
 {
-  return( (x / scale_factor) - scale_offset);
+  return( (x / scale_factor_g) - scale_offset_g);
   /* return( (x / 2.5) - 2.0); */
 }
 

Modified: SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/md-src/md.h
===================================================================
--- SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/md-src/md.h	2014-08-14 16:29:11 UTC (rev 8182)
+++ SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/md-src/md.h	2014-08-14 16:34:57 UTC (rev 8183)
@@ -21,6 +21,7 @@
 void compute ( int np, int nd, double pos[], double vel[],
   double mass, double f[], double *pot, double *kin );
 
+/*
 void simulate (int step_num, int step_print_num,
                int step_print, int step_print_index,
                int np, int nd,
@@ -29,5 +30,16 @@
                int seed,
                char* outfile,
                char* trjfile);
+*/
 
+void simulate ( int nd, int np,
+		int step_num, int step_print_num,
+		double dt,
+		double mass,
+		char *printinfo,
+		double scale_factor,
+		double scale_offset,
+		int seed,
+		char* outfile,
+		char* trjfile);
 #endif




More information about the Swift-commit mailing list