model: progress of long commands, reported by the solvers and the tet mesher

fieldcraft_model::progress: a host installs a Progress on the worker thread
and reads its snapshot from another; the engine names the step being solved,
the nonlinear solver its load factor, the explicit solver its time, the
fluid solver its steps, transient heat its increments and the tet mesher its
stage and pass. Without one installed every report is a no-op (#322, #357).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UhhZMBTviDQxZvwnyP89fo
This commit is contained in:
jyvikoandClaude Opus 5.5 authored and Irakli Kourtis committed 2026-10-15 09:14:34 -04:00
1 parent a7bb67c452
commit 0e0d8bd114
12 files changed
+218 -11

No files matched your search

+7
View File
@@ -23,6 +23,9 @@
//! The run starts from u = 0 and the initial velocities with the half increment
//! v^{½} = v^0 + ½Δt^{½} a^0.
/// Increments between progress reports (each takes a lock).
const PROGRESS_EVERY: u64 = 64;
use fieldcraft_model::{ExplicitDynamic, Model, OutputVariable, Procedure, Step};
use crate::contact::{Evaluation, Interface};
@@ -356,7 +359,11 @@ pub fn solve_explicit(model: &Model, step: Option<&str>, limits: &Limits) -> Res
let mut v_now = v0;
let mut completed = true;
let mut v_new = vec![0.0; n];
fieldcraft_model::progress::stage("Time", Some(end), "");
loop {
if increments.is_multiple_of(PROGRESS_EVERY) {
fieldcraft_model::progress::count(t);
}
if increments >= max_increments {
completed = false;
warnings.push(format!("stopped at time {t:.6e} after {increments} increments (the cap); the step ends at {end:.6e}"));