trestart_tests.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
       ---
       trestart_tests.py (906B)
       ---
            1 #!/usr/bin/env python
            2 from pytestutils import *
            3 import sphere
            4 
            5 print("### Restart tests ###")
            6 
            7 # Generate data in python
            8 orig = sphere.sim(np=10000, nw=1, sid="test-initgrid")
            9 orig.generateRadii(histogram=False)
           10 orig.defaultParams()
           11 orig.g[2] = 0.0
           12 orig.initRandomGridPos(gridnum = [100, 100, 100])
           13 orig.initTemporal(current=0.0, total=0.0)
           14 orig.time_total[0] = 1e-7
           15 orig.time_file_dt[0] = 1e-8
           16 orig.writebin(verbose = False)
           17 orig.run(dry=True)
           18 orig.run()
           19 
           20 restart = sphere.sim()
           21 restart.readbin("../output/" + orig.sid + ".output{:0=5}.bin".format(orig.status()))
           22 restart.time_total[0] += 1e-7
           23 restart.time_file_dt[0] = 1e-8
           24 restart.run(dry=True)
           25 restart.run()
           26 restart.readlast()
           27 restart.time_current = orig.time_current
           28 restart.time_step_count = orig.time_step_count
           29 restart.time_total = orig.time_total
           30 
           31 compare(orig, restart, "Restart test:  ")
           32 
           33 # Remove temporary files
           34 cleanup(orig)
           35 cleanup(restart)