tadded script to continue simulations where they ended - sphere - GPU-based 3D discrete element method algorithm with optional fluid coupling
(HTM) git clone git://src.adamsgaard.dk/sphere
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
(DIR) commit c72bb0d5a18abae1b8ca2983d757fa813cf625b6
(DIR) parent 782ab30d3a9320b25581637664f1fdb0ca0d3844
(HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
Date: Thu, 4 Sep 2014 12:35:11 +0200
added script to continue simulations where they ended
Diffstat:
A python/continue_sim.py | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/python/continue_sim.py b/python/continue_sim.py
t@@ -0,0 +1,22 @@
+#!/usr/bin/env python
+import sphere
+import sys
+
+def print_usage():
+ print('Usage: ' + sys.argv[0]
+ + ' <simulation id> <fluid> <device> [end_time]')
+ print('where "simulation id" is a string and "fluid" is either 0 or 1.')
+ print('"device" is the number of the GPU device.')
+ print('The total simulation can optionally be changed with the end_time '
+ 'parameter')
+
+if len(sys.argv) < 2:
+ print_usage()
+ sys.exit(1)
+
+else:
+ sim = sphere.sim(sys.argv[1], fluid = int(sys.argv[2]))
+ sim.readlast()
+ if len(sys.argv) == 5:
+ sim.time_total = float(sys.argv[4])
+ sim.run(device=sys.argv[3])