1"""Time AmrFlow set_solid on the RCP graded bed — the Layer-2-for-core acceptance driver.
2Reuses the study script's own mesh builder so the mesh is exactly the campaign's."""
3import importlib.util, sys, time, os
4spec = importlib.util.spec_from_file_location(
5 "bed",
"/home/frankp/Codes/suite/core/tests/study/amr_bed_graded.py")
6bed = importlib.util.module_from_spec(spec)
7sys.modules[
"bed"] = bed
8spec.loader.exec_module(bed)
12depth = int(sys.argv[1])
if len(sys.argv) > 1
else 6
15gapfn, _ = bed.make_gap_lookup(N)
16tree = bed.build(
"g", N, gapfn)
18print(f
"depth={depth} N={N} leaves={n} (mesh build {time.time()-t0:.1f}s)")
19fl = amr.Flow(tree, 1.0, bed.MU, 60.0)
20fl.set_body_force(bed.FX, 0.0, 0.0)
21fl.set_advection(
False)
22fl.set_ghost_sampled(
True)
24C, R = bed.load_pack(N)
26fl.set_solid_spheres(C, np.array([R]),
True)
28print(f
"set_solid: {dt:.2f} s = {1e6*dt/n:.1f} us/leaf")
30m = np.asarray(fl.is_fluid())
31print(f
"fluid mask: {int(m.sum())}/{n} fluid hash={hash(m.tobytes())}")
32np.save(sys.argv[2], m)
if len(sys.argv) > 2
else None