|
flow 1.3.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
|
Functions | |
| make_sim (kind) | |
| probe (kind) | |
| march (d, n=400, dtstep=0.01) | |
Variables | |
| R1 | |
| R2 | |
| OFF | |
| b = geom.SceneBuilder() | |
| s1 = b.add_leaf("sphere", [R1], translation=[-OFF, 0.0, 0.0]) | |
| s2 = b.add_leaf("sphere", [R2], translation=[+OFF, 0.0, 0.0]) | |
| db = b.add_union(s1, s2) | |
| props = b.body_properties(db, lo=[-0.8, -0.5, -0.5], hi=[0.8, 0.5, 0.5], n=40) | |
| home = b.principal_frame(db, lo=[-0.8, -0.5, -0.5], hi=[0.8, 0.5, 0.5], n=40) | |
| ph = b.body_properties(home, lo=[-0.9, -0.6, -0.6], hi=[0.9, 0.6, 0.6], n=40) | |
| com = np.array(props["com"]) | |
| inv_i_unit = tuple(props["mass"] / np.maximum(np.array(ph["principal"]), 1e-12)) | |
| bound = float(OFF + max(R1, R2) + abs(com[0]) + 0.05) | |
| int | NB = 96 |
| float | half = bound * 1.05 |
| int | sp = 2 * half / (NB - 1) |
| gridf | |
| grid3 = gridf.reshape(NB, NB, NB, order="F") | |
| verts | |
| faces | |
| _ | |
| level | |
| spacing | |
| step = max(1, len(verts) // 400) | |
| shell = np.ascontiguousarray(verts[::step], dtype=np.float32) | |
| a1 = OFF + com[0] | |
| a2 = OFF - com[0] | |
| float | PEN = 0.08 |
| float | DX = a1 + a2 + (R1 + R2) - PEN |
| touch = a1 + a2 + R1 + R2 | |
| st | |
| sg | |
| int | ok1 = abs(st - touch) < 5e-3 and abs(sg - touch) < 3 * sp |
| Tt | |
| Vt | |
| Qt | |
| Tg | |
| Vg | |
| Qg | |
| dpos = np.abs(Tt - Tg).max(axis=(1, 2)) | |
| dvel = np.abs(Vt - Vg).max() | |
| dquat = np.abs(Qt - Qg).max() | |
| int | ok2 = dpos[-1] < 10 * sp |
dem gate: a COMPOSED analytic tree as a particle shape (SHAPE_SCENE).
Two claims, both at OMP_NUM_THREADS=1 (dem's multithreaded step is nondeterministic — §6.0b):
1. STATIC CONTACT PROBE. For hand-placed overlapping pairs, the analytic-tree particle and the
SAME shape baked to a fine grid-SDF particle must report contacts of the same count, with
penetration depths agreeing to the grid's own resolution error, and the tree's depths must
match the EXACT closed form (a dumbbell's lobe is a sphere: depth = 2r − distance).
2. DYNAMICS. Two settling/colliding dumbbells: 400-step single-thread trajectories, tree vs
baked-grid shape. Same physics, different geometry representation: positions must track to
the grid's resolution error, not diverge.
The dumbbell is authored in peclet.geom, mass properties measured by implicit quadrature,
put in its principal frame with principal_frame() (a no-op rotation here, but the COM recentre is
real when the lobes differ), and handed to dem BOTH ways from the SAME builder.
| scene_particle_gate.make_sim | ( | kind | ) |
Definition at line 56 of file scene_particle_gate.py.
Referenced by probe().
| scene_particle_gate.probe | ( | kind | ) |
Definition at line 99 of file scene_particle_gate.py.
References make_sim().
| scene_particle_gate.march | ( | d, | |
n = 400, |
|||
dtstep = 0.01 |
|||
| ) |
Definition at line 122 of file scene_particle_gate.py.
| scene_particle_gate.R1 |
Definition at line 26 of file scene_particle_gate.py.
| scene_particle_gate.R2 |
Definition at line 26 of file scene_particle_gate.py.
| scene_particle_gate.OFF |
Definition at line 26 of file scene_particle_gate.py.
| scene_particle_gate.b = geom.SceneBuilder() |
Definition at line 27 of file scene_particle_gate.py.
Definition at line 28 of file scene_particle_gate.py.
Definition at line 29 of file scene_particle_gate.py.
Definition at line 30 of file scene_particle_gate.py.
| scene_particle_gate.props = b.body_properties(db, lo=[-0.8, -0.5, -0.5], hi=[0.8, 0.5, 0.5], n=40) |
Definition at line 31 of file scene_particle_gate.py.
| scene_particle_gate.home = b.principal_frame(db, lo=[-0.8, -0.5, -0.5], hi=[0.8, 0.5, 0.5], n=40) |
Definition at line 32 of file scene_particle_gate.py.
| scene_particle_gate.ph = b.body_properties(home, lo=[-0.9, -0.6, -0.6], hi=[0.9, 0.6, 0.6], n=40) |
Definition at line 33 of file scene_particle_gate.py.
| scene_particle_gate.com = np.array(props["com"]) |
Definition at line 34 of file scene_particle_gate.py.
| scene_particle_gate.inv_i_unit = tuple(props["mass"] / np.maximum(np.array(ph["principal"]), 1e-12)) |
Definition at line 37 of file scene_particle_gate.py.
Definition at line 38 of file scene_particle_gate.py.
| int scene_particle_gate.NB = 96 |
Definition at line 41 of file scene_particle_gate.py.
| float scene_particle_gate.half = bound * 1.05 |
Definition at line 42 of file scene_particle_gate.py.
Definition at line 43 of file scene_particle_gate.py.
| scene_particle_gate.gridf |
Definition at line 44 of file scene_particle_gate.py.
Definition at line 46 of file scene_particle_gate.py.
| scene_particle_gate.verts |
Definition at line 48 of file scene_particle_gate.py.
| scene_particle_gate.faces |
Definition at line 48 of file scene_particle_gate.py.
|
protected |
Definition at line 48 of file scene_particle_gate.py.
| scene_particle_gate.level |
Definition at line 48 of file scene_particle_gate.py.
| scene_particle_gate.spacing |
Definition at line 49 of file scene_particle_gate.py.
| scene_particle_gate.step = max(1, len(verts) // 400) |
Definition at line 51 of file scene_particle_gate.py.
Definition at line 52 of file scene_particle_gate.py.
Definition at line 92 of file scene_particle_gate.py.
Definition at line 93 of file scene_particle_gate.py.
| float scene_particle_gate.PEN = 0.08 |
Definition at line 94 of file scene_particle_gate.py.
Definition at line 95 of file scene_particle_gate.py.
Definition at line 115 of file scene_particle_gate.py.
| scene_particle_gate.st |
Definition at line 116 of file scene_particle_gate.py.
| scene_particle_gate.sg |
Definition at line 116 of file scene_particle_gate.py.
Definition at line 119 of file scene_particle_gate.py.
| scene_particle_gate.Tt |
Definition at line 130 of file scene_particle_gate.py.
| scene_particle_gate.Vt |
Definition at line 130 of file scene_particle_gate.py.
| scene_particle_gate.Qt |
Definition at line 130 of file scene_particle_gate.py.
| scene_particle_gate.Tg |
Definition at line 131 of file scene_particle_gate.py.
| scene_particle_gate.Vg |
Definition at line 131 of file scene_particle_gate.py.
| scene_particle_gate.Qg |
Definition at line 131 of file scene_particle_gate.py.
Definition at line 132 of file scene_particle_gate.py.
Definition at line 136 of file scene_particle_gate.py.
Definition at line 137 of file scene_particle_gate.py.
Definition at line 139 of file scene_particle_gate.py.