Meshes can be loaded directly from .su2
files using geom.load_su2
or .msh
files using geom.load_gmsh
.
However, ΦFlow allows you to easily build simple meshes for a given domain and obstacle configuration.
%pip install --quiet phiflow
from phi.flow import *
# from phi.flow import * # If JAX is not installed. You can use phi.torch or phi.tf as well.
from tqdm.notebook import trange
domain = Box(x=2, y=1)
sphere_x = math.sin(math.linspace(0, 1.5, batch(time=30))) * .5
sphere = Sphere(x=sphere_x, y=.5, radius=.3)
box = Box(x=(1, 3), y=(-1, .5))
mesh = geom.build_mesh(domain, x=30, y=10, obstacles=union(sphere, box))
plot(mesh, animate='time')
c:\ProgramData\Anaconda3\envs\phiflow2\lib\site-packages\phiml\backend\_backend.py:1632: RuntimeWarning: invalid value encountered in power return base ** exp