diff --git a/crates/specialized/rtx-cfd/tests/embedded3_flag_wake.rs b/crates/specialized/rtx-cfd/tests/embedded3_flag_wake.rs index 187c888..82f9dd1 100644 --- a/crates/specialized/rtx-cfd/tests/embedded3_flag_wake.rs +++ b/crates/specialized/rtx-cfd/tests/embedded3_flag_wake.rs @@ -388,8 +388,13 @@ fn flag_wake_on_the_device() { f }); let vtk_dir = std::env::var("RTX_E3_FLAG_VTK").ok(); - let phases = 32; - let last_period_start = t_end - period; + // `RTX_E3_FLAG_PHASES` phases per period (32); `RTX_E3_FLAG_VTK_FROM` = the period + // index the export starts at (the last period by default; 0 = the whole onset from + // rest, the viewer's sequence mode of 2026-09-22). + let phases = env_f("RTX_E3_FLAG_PHASES", 32.0) as usize; + let vtk_from = env_f("RTX_E3_FLAG_VTK_FROM", (periods - 1.0).max(0.0)) as f64; + let last_period_start = vtk_from * period; + let total_phases = ((periods - vtk_from) * phases as f64).round() as usize; let mut next_phase = 0; let mid = nz / 2; let slab = if slab_nz > 0 { @@ -414,7 +419,7 @@ fn flag_wake_on_the_device() { let sample = (step + 1) % 10 == 0 || step + 1 == steps; let phase_due = vtk_dir.is_some() && t >= last_period_start + next_phase as f64 * period / phases as f64 - && next_phase < phases; + && next_phase < total_phases; if sample || phase_due { device.download(&mut field); let solver = &device.solver; @@ -506,7 +511,11 @@ fn flag_wake_on_the_device() { if phase_due { let tag = if flag_span() >= duct_depth() { "full" } else { "free" }; let path = std::path::Path::new(vtk_dir.as_ref().unwrap()) - .join(format!("flag_{tag}_ny{ny}_phase{next_phase:02}.vtk")); + .join(if total_phases > 100 { + format!("flag_{tag}_ny{ny}_phase{next_phase:03}.vtk") + } else { + format!("flag_{tag}_ny{ny}_phase{next_phase:02}.vtk") + }); write_vtk(&path, &field, Some(mask)).expect("vtk"); next_phase += 1; }