embedded3 S2-7: oblique instrument gains registration sweep / slope subset / z-flow skip / merged-cell count (RTX_E3_OBLIQUE_{C0_SHIFTS,SLOPES,ZFLOW,NS}) and the operator probe (oblique_operator_probe: predictor acceleration on the exact centroid-valued field by aperture band, cut-cell divergence under four valuations, spurious pressure; z-flow control); two host prototypes, default off, device refuses them: RTX_E3_CV_SIDES=exact (the momentum CV's side apertures from the interpolant on the half faces / cell-centre planes) and RTX_E3_WALL_ORDER2=centroid (the quadratic wall gradient's second point at the neighbour's centroid distance); quad_fraction / tri_area_fraction lifted to module fns (default path digit-identical: oblique record, host suite 21/21, device cut tests)
CI / Build (macos-latest) (push) Waiting to run
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 / 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
CI / Build CPU-Only (Explicit) (push) Failing after 4s
Documentation / Build API Documentation (push) Failing after 6s
Documentation / Build User Guide (push) Successful in 5s
CI / Format Check (push) Failing after 10s
CI / Build (ubuntu-latest) (push) Failing after 1m30s
CI / Clippy Check (push) Failing after 1m50s
Performance Benchmarks / Run Benchmarks (push) Successful in 2m15s
CI / Build (macos-latest) (push) Waiting to run
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 / 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
CI / Build CPU-Only (Explicit) (push) Failing after 4s
Documentation / Build API Documentation (push) Failing after 6s
Documentation / Build User Guide (push) Successful in 5s
CI / Format Check (push) Failing after 10s
CI / Build (ubuntu-latest) (push) Failing after 1m30s
CI / Clippy Check (push) Failing after 1m50s
Performance Benchmarks / Run Benchmarks (push) Successful in 2m15s
Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
0cf9d20afb
commit
b80af59ca4
@@ -90,29 +90,7 @@ impl CutGeometry {
|
||||
// (0, 0) to its (1, 1) corner in the face's own (a, b) order — the
|
||||
// Kuhn split's diagonals: for an x-face (y, z), a y-face (x, z), a
|
||||
// z-face (x, y); the same triangles seen from either cell.
|
||||
let tri_area_fraction = |p0: f64, p1: f64, p2: f64| -> f64 {
|
||||
let v = [p0, p1, p2];
|
||||
let pos = v.iter().filter(|&&q| q >= 0.0).count();
|
||||
match pos {
|
||||
0 => 0.0,
|
||||
3 => 1.0,
|
||||
1 => {
|
||||
let a = v.iter().position(|&q| q >= 0.0).unwrap();
|
||||
let (b, c) = ((a + 1) % 3, (a + 2) % 3);
|
||||
(v[a] / (v[a] - v[b])) * (v[a] / (v[a] - v[c]))
|
||||
}
|
||||
_ => {
|
||||
let a = v.iter().position(|&q| q < 0.0).unwrap();
|
||||
let (b, c) = ((a + 1) % 3, (a + 2) % 3);
|
||||
1.0 - (v[a] / (v[a] - v[b])) * (v[a] / (v[a] - v[c]))
|
||||
}
|
||||
}
|
||||
};
|
||||
// Quad corners in (a, b) order: q00, q10, q01, q11; triangles
|
||||
// (q00, q10, q11) and (q00, q11, q01).
|
||||
let quad_fraction = |q00: f64, q10: f64, q01: f64, q11: f64| -> f64 {
|
||||
0.5 * (tri_area_fraction(q00, q10, q11) + tri_area_fraction(q00, q11, q01))
|
||||
};
|
||||
let quad_fraction = quad_fraction;
|
||||
let mut a_u = vec![0.0; (nx + 1) * ny * nz];
|
||||
let mut a_v = vec![0.0; nx * (ny + 1) * nz];
|
||||
let mut a_w = vec![0.0; nx * ny * (nz + 1)];
|
||||
@@ -221,6 +199,13 @@ impl CutGeometry {
|
||||
}
|
||||
}
|
||||
|
||||
/// φ at the corner `(k, j, i)` of the corner lattice.
|
||||
#[inline]
|
||||
#[must_use]
|
||||
pub fn corner_phi(&self, k: usize, j: usize, i: usize) -> f64 {
|
||||
self.phi[Self::node(self.grid, k, j, i)]
|
||||
}
|
||||
|
||||
/// Total fluid volume.
|
||||
#[must_use]
|
||||
pub fn fluid_volume(&self) -> f64 {
|
||||
@@ -244,6 +229,34 @@ impl CutGeometry {
|
||||
}
|
||||
}
|
||||
|
||||
/// The fluid fraction of a triangle from its three corner values of φ
|
||||
/// (the linear interpolant; fluid where φ ≥ 0).
|
||||
pub(super) fn tri_area_fraction(p0: f64, p1: f64, p2: f64) -> f64 {
|
||||
let v = [p0, p1, p2];
|
||||
let pos = v.iter().filter(|&&q| q >= 0.0).count();
|
||||
match pos {
|
||||
0 => 0.0,
|
||||
3 => 1.0,
|
||||
1 => {
|
||||
let a = v.iter().position(|&q| q >= 0.0).unwrap();
|
||||
let (b, c) = ((a + 1) % 3, (a + 2) % 3);
|
||||
(v[a] / (v[a] - v[b])) * (v[a] / (v[a] - v[c]))
|
||||
}
|
||||
_ => {
|
||||
let a = v.iter().position(|&q| q < 0.0).unwrap();
|
||||
let (b, c) = ((a + 1) % 3, (a + 2) % 3);
|
||||
1.0 - (v[a] / (v[a] - v[b])) * (v[a] / (v[a] - v[c]))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The fluid fraction of a quad from its corner values in (a, b) order
|
||||
/// (q00, q10, q01, q11): the two triangles along the (0, 0)–(1, 1)
|
||||
/// diagonal (the Kuhn split's).
|
||||
pub(super) fn quad_fraction(q00: f64, q10: f64, q01: f64, q11: f64) -> f64 {
|
||||
0.5 * (tri_area_fraction(q00, q10, q11) + tri_area_fraction(q00, q11, q01))
|
||||
}
|
||||
|
||||
fn det3(a: [f64; 3], b: [f64; 3], c: [f64; 3]) -> f64 {
|
||||
a[0] * (b[1] * c[2] - b[2] * c[1]) - a[1] * (b[0] * c[2] - b[2] * c[0])
|
||||
+ a[2] * (b[0] * c[1] - b[1] * c[0])
|
||||
|
||||
Reference in New Issue
Block a user