tshow last output file in status, add debugging output - slidergrid - grid of elastic sliders on a frictional surface
git clone git://src.adamsgaard.dk/slidergrid
Log
Files
Refs
README
LICENSE
---
commit bb5690a5dfaf1895126205eceaf2f36aff4155a4
parent e74cb395a9425ba9819ff606866e77e5ee9dfa93
Author: Anders Damsgaard 
Date:   Tue, 22 Mar 2016 14:50:34 -0700

show last output file in status, add debugging output

Diffstat:
  M slidergrid/main.c                   |      23 ++++++++++++++++++++---
  M test.c                              |       8 --------

2 files changed, 20 insertions(+), 11 deletions(-)
---
diff --git a/slidergrid/main.c b/slidergrid/main.c
t@@ -35,9 +35,11 @@ void print_version(char* argv0)
 
 void print_status(simulation sim)
 {
-    printf("\r%s: t = %.3f s, t_end = %.3f s (%2.0f%%)             ",
+    printf("\r%s: t = %.3f s, t_end = %.3f s (%2.0f%%), "
+            "last output = %06d             ",
             sim.id, sim.time, sim.time_end,
-            sim.time/sim.time_end*100.);
+            sim.time/sim.time_end*100.,
+            sim.file_number);
 }
 
 int main(int argc, char** argv)
t@@ -70,7 +72,7 @@ int main(int argc, char** argv)
     // external function which defines the simulation setup and parameters
     simulation sim = setup_simulation();
 
-    if (verbose == 1) {
+    if (verbose) {
         sim.verbose = 1;
         printf("Sliders N = %d\n", sim.N);
     }
t@@ -127,8 +129,23 @@ int main(int argc, char** argv)
             sim.time += sim.dt) {
 
         for (i=0; i
diff --git a/test.c b/test.c
t@@ -40,13 +40,5 @@ simulation setup_simulation()
     sim.time_end = 1.0;
     sim.file_interval = 0.1;
 
-    if (write_simulation_output(&sim, ".")) {
-        fprintf(stderr, "\nFatal error: Could not write one or more "
-                "output files.\n");
-    }
-
-
-
-
     return sim;
 }