embedded3 S2-3b: the flag driver's span knob (full width = the 2D geometry extruded)
CI / Test (macos-latest) (push) Blocked by required conditions
CI / Test (ubuntu-latest) (push) Blocked by required conditions
CI / Python Bindings (maturin) (macos-latest) (push) Blocked by required conditions
CI / Python Bindings (maturin) (ubuntu-latest) (push) Blocked by required conditions
CI / Build (macos-latest) (push) Waiting to run
CI / WASM Build + Size Check (push) Blocked by required conditions
CI / Distributed Training Tests (push) Blocked by required conditions
CI / CI Success (push) Blocked by required conditions
Documentation / Build API Documentation (push) Failing after 4s
CI / Build CPU-Only (Explicit) (push) Failing after 5s
CI / Format Check (push) Failing after 12s
Documentation / Build User Guide (push) Successful in 4s
CI / Build (ubuntu-latest) (push) Failing after 1m55s
CI / Clippy Check (push) Failing after 2m19s
Performance Benchmarks / Run Benchmarks (push) Successful in 2m43s
CI / Test (macos-latest) (push) Blocked by required conditions
CI / Test (ubuntu-latest) (push) Blocked by required conditions
CI / Python Bindings (maturin) (macos-latest) (push) Blocked by required conditions
CI / Python Bindings (maturin) (ubuntu-latest) (push) Blocked by required conditions
CI / Build (macos-latest) (push) Waiting to run
CI / WASM Build + Size Check (push) Blocked by required conditions
CI / Distributed Training Tests (push) Blocked by required conditions
CI / CI Success (push) Blocked by required conditions
Documentation / Build API Documentation (push) Failing after 4s
CI / Build CPU-Only (Explicit) (push) Failing after 5s
CI / Format Check (push) Failing after 12s
Documentation / Build User Guide (push) Successful in 4s
CI / Build (ubuntu-latest) (push) Failing after 1m55s
CI / Clippy Check (push) Failing after 2m19s
Performance Benchmarks / Run Benchmarks (push) Successful in 2m43s
Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
58a5501cef
commit
fc8d69af29
@@ -95,13 +95,23 @@ fn flag_2d(x: f64, y: f64, t: f64) -> (f64, f64) {
|
|||||||
(best - FLAG_HALF, v_best)
|
(best - FLAG_HALF, v_best)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The flag's span: `RTX_E3_FLAG_SPAN` (default 0.2); at the channel's
|
||||||
|
/// full width the flag is the 2D geometry extruded (S2-3b).
|
||||||
|
fn flag_span() -> f64 {
|
||||||
|
env_f("RTX_E3_FLAG_SPAN", FLAG_SPAN)
|
||||||
|
}
|
||||||
|
|
||||||
/// The flag in 3D: the extruded capsule cut to the span with edges
|
/// The flag in 3D: the extruded capsule cut to the span with edges
|
||||||
/// rounded to radius `r`.
|
/// rounded to radius `r` (no cut at the full width).
|
||||||
fn flag_3d(x: f64, y: f64, z: f64, t: f64, r: f64) -> (f64, f64) {
|
fn flag_3d(x: f64, y: f64, z: f64, t: f64, r: f64) -> (f64, f64) {
|
||||||
let (d2, v) = flag_2d(x, y, t);
|
let (d2, v) = flag_2d(x, y, t);
|
||||||
|
let span = flag_span();
|
||||||
|
if span >= H {
|
||||||
|
return (d2, v);
|
||||||
|
}
|
||||||
let zc = 0.5 * H;
|
let zc = 0.5 * H;
|
||||||
let q1 = d2 + r;
|
let q1 = d2 + r;
|
||||||
let q2 = (z - zc).abs() - 0.5 * FLAG_SPAN + r;
|
let q2 = (z - zc).abs() - 0.5 * span + r;
|
||||||
let outside = (q1.max(0.0).powi(2) + q2.max(0.0).powi(2)).sqrt();
|
let outside = (q1.max(0.0).powi(2) + q2.max(0.0).powi(2)).sqrt();
|
||||||
(outside + q1.max(q2).min(0.0) - r, v)
|
(outside + q1.max(q2).min(0.0) - r, v)
|
||||||
}
|
}
|
||||||
@@ -174,7 +184,8 @@ fn flag_wake_on_the_device() {
|
|||||||
}
|
}
|
||||||
solver.initialize(&mut field);
|
solver.initialize(&mut field);
|
||||||
println!(
|
println!(
|
||||||
" flag wake ny {ny}: {nx}×{ny}×{nz} = {} cells, h {h:.4e}, dt {dt:.3e}, {periods} periods = {t_end:.3} s, {} steps",
|
" flag wake ny {ny} (span {}): {nx}×{ny}×{nz} = {} cells, h {h:.4e}, dt {dt:.3e}, {periods} periods = {t_end:.3} s, {} steps",
|
||||||
|
flag_span(),
|
||||||
g.cells(),
|
g.cells(),
|
||||||
(t_end / dt).ceil() as usize
|
(t_end / dt).ceil() as usize
|
||||||
);
|
);
|
||||||
@@ -256,8 +267,9 @@ fn flag_wake_on_the_device() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if phase_due {
|
if phase_due {
|
||||||
|
let tag = if flag_span() >= H { "full" } else { "free" };
|
||||||
let path = std::path::Path::new(vtk_dir.as_ref().unwrap())
|
let path = std::path::Path::new(vtk_dir.as_ref().unwrap())
|
||||||
.join(format!("flag_ny{ny}_phase{next_phase:02}.vtk"));
|
.join(format!("flag_{tag}_ny{ny}_phase{next_phase:02}.vtk"));
|
||||||
write_vtk(&path, &field, Some(mask)).expect("vtk");
|
write_vtk(&path, &field, Some(mask)).expect("vtk");
|
||||||
next_phase += 1;
|
next_phase += 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user