From 8c130c55c8d3912b67a21d051650914df1ebaa27 Mon Sep 17 00:00:00 2001 From: Omar Sobh Date: Wed, 16 Sep 2026 00:50:52 -0500 Subject: [PATCH] =?UTF-8?q?PERF-2=20P2-c:=20RTX=5FFSI2O=5FINNER=5FSTOP=20k?= =?UTF-8?q?nob=20=E2=80=94=20the=20background=20Poisson's=20inner=20stop?= =?UTF-8?q?=20as=20a=20multiple=20of=20the=20Schwarz=20tolerance=20(defaul?= =?UTF-8?q?t=200.1;=20the=20band-gated=20ladder=20on=20the=20CG=20iteratio?= =?UTF-8?q?n=20count)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01YJPeT6WA2e7YvAnS875AHL --- .../src/solvers/incompressible/overset/mod.rs | 8 ++++++++ .../rtx-fsi/tests/fsi2_harness/overset.rs | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/crates/specialized/rtx-cfd/src/solvers/incompressible/overset/mod.rs b/crates/specialized/rtx-cfd/src/solvers/incompressible/overset/mod.rs index ca44415..d37eb0e 100644 --- a/crates/specialized/rtx-cfd/src/solvers/incompressible/overset/mod.rs +++ b/crates/specialized/rtx-cfd/src/solvers/incompressible/overset/mod.rs @@ -329,6 +329,14 @@ impl OversetPisoSolver { }) } + /// PERF-2 P2-c: the background pressure solve's inner stop as a + /// multiple of the Schwarz tolerance (the constructor's 0.1; a knob for + /// the band-gated ladder — an accuracy change, never bit-identical). + pub fn set_inner_stop_multiplier(&mut self, multiplier: f64) { + self.background + .set_inner_stop_factor(multiplier * self.params.schwarz_tolerance); + } + /// PERF-2 P2: threads for the background multigrid's red-black maps. pub fn set_poisson_threads(&mut self, threads: usize) { self.background.set_poisson_threads(threads); diff --git a/crates/specialized/rtx-fsi/tests/fsi2_harness/overset.rs b/crates/specialized/rtx-fsi/tests/fsi2_harness/overset.rs index 4347470..7a40330 100644 --- a/crates/specialized/rtx-fsi/tests/fsi2_harness/overset.rs +++ b/crates/specialized/rtx-fsi/tests/fsi2_harness/overset.rs @@ -451,6 +451,18 @@ impl OversetFluid { ..OversetParameters::default() }; let mut solver = OversetPisoSolver::new(background, patch, (nx, ny, h, h), params)?; + // PERF-2 P2-c: `RTX_FSI2O_INNER_STOP=m` — the background Poisson's inner + // stop at m × the Schwarz tolerance (default 0.1; band-gated ladder). + let mut solver = solver; + if let Some(m) = std::env::var("RTX_FSI2O_INNER_STOP") + .ok() + .and_then(|v| v.parse::().ok()) + { + solver.set_inner_stop_multiplier(m); + println!( + " background Poisson inner stop: {m} × the Schwarz tolerance (RTX_FSI2O_INNER_STOP; default 0.1)" + ); + } let mut field = OversetField { background: FlowField::new(nx, ny, h, h)?, patch: patch_field,