Detailed imports in loader_mantaflow.py
-from phi.tf.flow import *
+# this example tries to load "pressure_XXXXXX.npz" and "vel_XXXXXX.npz" files
+# from all simulations sim_XXXXXX in the given directory
+
import os # Has to be imported after flow. Why? No damn clue.
import sys
+
import numpy as np
+from phi.data.dataset import Dataset
+from phi.data.reader import BatchReader
+from phi.data.stream import MantaScalar
+from phi.physics import world
+from phi.physics.domain import Domain
+from phi.physics.smoke import Smoke
+from phi.tf.app import TFApp
+from phi.tf.util import placeholder
-# this example tries to load "pressure_XXXXXX.npz" and "vel_XXXXXX.npz" files
-# from all simulations sim_XXXXXX in the given directory
SCENE_PATH = sys.argv[1] if len(sys.argv) >= 2 else '~/phi/data/simpleplume'
SCENE_PATH = os.path.expanduser(SCENE_PATH)
# this is the original resolution of the mantaflow sim
# allocate one size smaller so that velocity matches, and crop
-# scalar fields to (mantaflowRes-1) via MantaScalar() channels
-MANTAFLOWRES = 64
+# scalar fields to (MANTAFLOW_RESOLUTION-1) via MantaScalar() channels
+MANTAFLOW_RESOLUTION = 64
# 2D or 3D
DIMS = 2
@@ -45,8 +54,6 @@ class DataLoader(TFApp):
print("MantaScalar demo done, %d batches read, abs-mean %f " % (idx, np.mean(np.asarray(m_list))))
- exit(1)
-
# note, no GUI, use viewer.py instead to display
-APP = DataLoader(scene_path=SCENE_PATH, dims=DIMS, mantaflowRes=MANTAFLOWRES)
+APP = DataLoader(scene_path=SCENE_PATH, dims=DIMS, mantaflowRes=MANTAFLOW_RESOLUTION)
