embedded3 S2-2b (host lever): narrow-band φ re-evaluation for moving bodies (max_surface_speed) — bit-identical, the flag body's ny 62 rebuild 3.54 → 0.30 s; the flag driver uses it
CI / Format Check (push) Failing after 4s
CI / Clippy Check (push) Failing after 3s
CI / Build (ubuntu-latest) (push) Failing after 4s
Performance Benchmarks / Run Benchmarks (push) Failing after 5s
Documentation / Build User Guide (push) Successful in 6s
CI / Build CPU-Only (Explicit) (push) Failing after 1m5s
Documentation / Build API Documentation (push) Failing after 1m8s
CI / Build (macos-latest) (push) Canceled after 0s
CI / Test (macos-latest) (push) Canceled after 0s
CI / Test (ubuntu-latest) (push) Canceled after 0s
CI / Python Bindings (maturin) (macos-latest) (push) Canceled after 0s
CI / Python Bindings (maturin) (ubuntu-latest) (push) Canceled after 0s
CI / WASM Build + Size Check (push) Canceled after 0s
CI / Distributed Training Tests (push) Canceled after 0s
CI / CI Success (push) Canceled after 0s
CI / Format Check (push) Failing after 4s
CI / Clippy Check (push) Failing after 3s
CI / Build (ubuntu-latest) (push) Failing after 4s
Performance Benchmarks / Run Benchmarks (push) Failing after 5s
Documentation / Build User Guide (push) Successful in 6s
CI / Build CPU-Only (Explicit) (push) Failing after 1m5s
Documentation / Build API Documentation (push) Failing after 1m8s
CI / Build (macos-latest) (push) Canceled after 0s
CI / Test (macos-latest) (push) Canceled after 0s
CI / Test (ubuntu-latest) (push) Canceled after 0s
CI / Python Bindings (maturin) (macos-latest) (push) Canceled after 0s
CI / Python Bindings (maturin) (ubuntu-latest) (push) Canceled after 0s
CI / WASM Build + Size Check (push) Canceled after 0s
CI / Distributed Training Tests (push) Canceled after 0s
CI / CI Success (push) Canceled after 0s
Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
aa096465a6
commit
c30e3dba34
@@ -28,6 +28,11 @@ pub struct CutGeometry {
|
||||
pub d_u: Vec<f64>,
|
||||
pub d_v: Vec<f64>,
|
||||
pub d_w: Vec<f64>,
|
||||
/// A lower bound on |φ| per corner (the narrow band of a moving body:
|
||||
/// a corner is re-evaluated only when its bound, decayed by the body's
|
||||
/// motion, comes within the band; far corners keep a stale value with
|
||||
/// the right sign, which is all their cells use).
|
||||
pub bound: Vec<f64>,
|
||||
}
|
||||
|
||||
impl CutGeometry {
|
||||
@@ -36,16 +41,41 @@ impl CutGeometry {
|
||||
(k * (g.ny + 1) + j) * (g.nx + 1) + i
|
||||
}
|
||||
|
||||
/// Build the cut data of `body` at time `t`.
|
||||
/// Build the cut data of `body` at time `t` (every corner evaluated).
|
||||
pub fn build(body: &Body, grid: Grid, t: f64) -> Self {
|
||||
Self::build_from(body, grid, t, None)
|
||||
}
|
||||
|
||||
/// Build the cut data of `body` at `t`, re-evaluating only the corners
|
||||
/// of `prev` whose |φ| bound, decayed by `motion` (the body's largest
|
||||
/// displacement since `prev`), falls within `band` of the surface.
|
||||
/// Identical to [`Self::build`] in every cut cell.
|
||||
pub fn build_from(
|
||||
body: &Body,
|
||||
grid: Grid,
|
||||
t: f64,
|
||||
prev: Option<(&CutGeometry, f64, f64)>,
|
||||
) -> Self {
|
||||
let g = grid;
|
||||
let (nx, ny, nz, dx, dy, dz) = (g.nx, g.ny, g.nz, g.dx, g.dy, g.dz);
|
||||
let mut phi = vec![0.0; (nx + 1) * (ny + 1) * (nz + 1)];
|
||||
let n_nodes = (nx + 1) * (ny + 1) * (nz + 1);
|
||||
let mut phi = vec![0.0; n_nodes];
|
||||
let mut bound = vec![0.0; n_nodes];
|
||||
for k in 0..=nz {
|
||||
for j in 0..=ny {
|
||||
for i in 0..=nx {
|
||||
phi[Self::node(g, k, j, i)] =
|
||||
body.phi(i as f64 * dx, j as f64 * dy, k as f64 * dz, t);
|
||||
let n = Self::node(g, k, j, i);
|
||||
if let Some((p, band, motion)) = prev {
|
||||
let b = p.bound[n] - motion;
|
||||
if b > band {
|
||||
phi[n] = p.phi[n];
|
||||
bound[n] = b;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
let v = body.phi(i as f64 * dx, j as f64 * dy, k as f64 * dz, t);
|
||||
phi[n] = v;
|
||||
bound[n] = v.abs();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -181,6 +211,7 @@ impl CutGeometry {
|
||||
d_u,
|
||||
d_v,
|
||||
d_w,
|
||||
bound,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user