tcontinue_sim.py - 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
---
tcontinue_sim.py (704B)
---
1 #!/usr/bin/env python
2 import sphere
3 import sys
4
5 def print_usage():
6 print('Usage: ' + sys.argv[0]
7 + ' <simulation id> <fluid> <device> [duration]')
8 print('where "simulation id" is a string and "fluid" is either 0 or 1.')
9 print('"device" is the number of the GPU device.')
10 print('The total simulation can optionally be defined to continue from the '
11 'current time and "duration" seconds more.')
12
13 if len(sys.argv) < 2:
14 print_usage()
15 sys.exit(1)
16
17 else:
18 sim = sphere.sim(sys.argv[1], fluid = int(sys.argv[2]))
19 sim.readlast()
20 if len(sys.argv) == 5:
21 sim.time_total[0] = sim.time_current[0] + float(sys.argv[4])
22 sim.run(device=sys.argv[3])