-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreplay.py
More file actions
32 lines (26 loc) · 1010 Bytes
/
replay.py
File metadata and controls
32 lines (26 loc) · 1010 Bytes
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
if __name__ == "__main__":
###########################
folder_path = "./outputs/2balls_tillotson_2000k_mm_cd10_uc_skewv2_000"
##########################
from balls import ShamPlot
import sham_utilities as shu
import glob
import shamrock
shu.handle_dump(folder_path=folder_path, clear=True, onlyext=".png")
dumps = glob.glob(f"{folder_path}/*.sham")
if not shamrock.sys.is_initialized():
shamrock.change_loglevel(1)
shamrock.sys.init("0:0")
ctx = shamrock.Context()
ctx.pdata_layout_new()
model = shamrock.get_Model_SPH(context=ctx, vector_type="f64_3", sph_kernel="M4")
for i in range(len(dumps)):
dump = dumps[i]
print(f"replaying {i} : {dump}")
model.load_from_dump(dump)
if i == 0:
plot = ShamPlot(model, ctx)
plot.update_pvplot()
img_path = dump.replace(".sham", ".png")
plot.screenshot(img_path)
# ./shamrock --sycl-cfg 0:0 --loglevel 1 --rscript ./replay.py