flow 1.3.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
Loading...
Searching...
No Matches
scene_particle_gate Namespace Reference

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
 

Detailed Description

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.

Function Documentation

◆ make_sim()

scene_particle_gate.make_sim (   kind)

Definition at line 56 of file scene_particle_gate.py.

Referenced by probe().

◆ probe()

scene_particle_gate.probe (   kind)

Definition at line 99 of file scene_particle_gate.py.

References make_sim().

◆ march()

scene_particle_gate.march (   d,
  n = 400,
  dtstep = 0.01 
)

Definition at line 122 of file scene_particle_gate.py.

Variable Documentation

◆ R1

scene_particle_gate.R1

Definition at line 26 of file scene_particle_gate.py.

◆ R2

scene_particle_gate.R2

Definition at line 26 of file scene_particle_gate.py.

◆ OFF

scene_particle_gate.OFF

Definition at line 26 of file scene_particle_gate.py.

◆ b

scene_particle_gate.b = geom.SceneBuilder()

Definition at line 27 of file scene_particle_gate.py.

◆ s1

scene_particle_gate.s1 = b.add_leaf("sphere", [R1], translation=[-OFF, 0.0, 0.0])

Definition at line 28 of file scene_particle_gate.py.

◆ s2

scene_particle_gate.s2 = b.add_leaf("sphere", [R2], translation=[+OFF, 0.0, 0.0])

Definition at line 29 of file scene_particle_gate.py.

◆ db

scene_particle_gate.db = b.add_union(s1, s2)

Definition at line 30 of file scene_particle_gate.py.

◆ props

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.

◆ home

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.

◆ ph

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.

◆ com

scene_particle_gate.com = np.array(props["com"])

Definition at line 34 of file scene_particle_gate.py.

◆ inv_i_unit

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.

◆ bound

scene_particle_gate.bound = float(OFF + max(R1, R2) + abs(com[0]) + 0.05)

Definition at line 38 of file scene_particle_gate.py.

◆ NB

int scene_particle_gate.NB = 96

Definition at line 41 of file scene_particle_gate.py.

◆ half

float scene_particle_gate.half = bound * 1.05

Definition at line 42 of file scene_particle_gate.py.

◆ sp

int scene_particle_gate.sp = 2 * half / (NB - 1)

Definition at line 43 of file scene_particle_gate.py.

◆ gridf

scene_particle_gate.gridf
Initial value:
1= np.asarray(b.bake(home, origin=[-half, -half, -half], spacing=[sp, sp, sp],
2 dims=[NB, NB, NB]))

Definition at line 44 of file scene_particle_gate.py.

◆ grid3

scene_particle_gate.grid3 = gridf.reshape(NB, NB, NB, order="F")

Definition at line 46 of file scene_particle_gate.py.

◆ verts

scene_particle_gate.verts

Definition at line 48 of file scene_particle_gate.py.

◆ faces

scene_particle_gate.faces

Definition at line 48 of file scene_particle_gate.py.

◆ _

scene_particle_gate._
protected

Definition at line 48 of file scene_particle_gate.py.

◆ level

scene_particle_gate.level

Definition at line 48 of file scene_particle_gate.py.

◆ spacing

scene_particle_gate.spacing

Definition at line 49 of file scene_particle_gate.py.

◆ step

scene_particle_gate.step = max(1, len(verts) // 400)

Definition at line 51 of file scene_particle_gate.py.

◆ shell

scene_particle_gate.shell = np.ascontiguousarray(verts[::step], dtype=np.float32)

Definition at line 52 of file scene_particle_gate.py.

◆ a1

scene_particle_gate.a1 = OFF + com[0]

Definition at line 92 of file scene_particle_gate.py.

◆ a2

scene_particle_gate.a2 = OFF - com[0]

Definition at line 93 of file scene_particle_gate.py.

◆ PEN

float scene_particle_gate.PEN = 0.08

Definition at line 94 of file scene_particle_gate.py.

◆ DX

float scene_particle_gate.DX = a1 + a2 + (R1 + R2) - PEN

Definition at line 95 of file scene_particle_gate.py.

◆ touch

scene_particle_gate.touch = a1 + a2 + R1 + R2

Definition at line 115 of file scene_particle_gate.py.

◆ st

scene_particle_gate.st

Definition at line 116 of file scene_particle_gate.py.

◆ sg

scene_particle_gate.sg

Definition at line 116 of file scene_particle_gate.py.

◆ ok1

int scene_particle_gate.ok1 = abs(st - touch) < 5e-3 and abs(sg - touch) < 3 * sp

Definition at line 119 of file scene_particle_gate.py.

◆ Tt

scene_particle_gate.Tt

Definition at line 130 of file scene_particle_gate.py.

◆ Vt

scene_particle_gate.Vt

Definition at line 130 of file scene_particle_gate.py.

◆ Qt

scene_particle_gate.Qt

Definition at line 130 of file scene_particle_gate.py.

◆ Tg

scene_particle_gate.Tg

Definition at line 131 of file scene_particle_gate.py.

◆ Vg

scene_particle_gate.Vg

Definition at line 131 of file scene_particle_gate.py.

◆ Qg

scene_particle_gate.Qg

Definition at line 131 of file scene_particle_gate.py.

◆ dpos

scene_particle_gate.dpos = np.abs(Tt - Tg).max(axis=(1, 2))

Definition at line 132 of file scene_particle_gate.py.

◆ dvel

scene_particle_gate.dvel = np.abs(Vt - Vg).max()

Definition at line 136 of file scene_particle_gate.py.

◆ dquat

scene_particle_gate.dquat = np.abs(Qt - Qg).max()

Definition at line 137 of file scene_particle_gate.py.

◆ ok2

int scene_particle_gate.ok2 = dpos[-1] < 10 * sp

Definition at line 139 of file scene_particle_gate.py.