1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Author: Vatsal Sanjay
# vatsalsanjay@gmail.com
# Physics of Fluids

import numpy as np
import os
import sys

nGFS = 5000
ci = int(sys.argv[1])
Rhor = float(sys.argv[2])
Ohd = float(sys.argv[3])
Ohf = float(sys.argv[4])
Bond  = float(sys.argv[5])

folder = 'bview'  # output folder
if not os.path.isdir(folder):
    os.makedirs(folder)

name = "%d_getEnergy.dat" % ci

if os.path.exists(name):
    print("File %s found! New data will be appended to the file" % name)
for ti in range(nGFS):
    t = 0.01 * ti
    place = "intermediate/snapshot-%5.4f" % t
    ImageName = "bview/%8.8d.png" % int(1e3*t)
    if not os.path.exists(place):
        print("File %s not found!" % place)
    else:
        if os.path.exists(ImageName):
            print("Image %s found!" % ImageName)
        else:
            exe = "./getVideo %s %s" % (place, ImageName)
            os.system(exe)
            print(("Doing %d of %d" % (ti, nGFS)))
            exe = "./getEnergyAxi %s %s %s %s %s %s" % (place, name, Rhor, Ohd, Ohf, Bond)
            os.system(exe)