forked from 1b-agent/fieldcraft-upstream
solvers, meshers: stop with Cancelled at each loop's natural points
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UhhZMBTviDQxZvwnyP89fo
This commit is contained in:
1 parent
a2d646a75e
commit
5fcbee028e
12 files changed
+47
-1
No files matched your search
@@ -308,6 +308,7 @@ fn factor(a: &Csr, limits: &Limits, mesh: &HeatMesh, eqs: &Reduction) -> Result<
|
||||
}
|
||||
FactorError::OutOfMemory { entries } => Error::Limit(format!("not enough memory for the factorization ({entries} entries)")),
|
||||
FactorError::Internal(what) => Error::Internal(what),
|
||||
FactorError::Cancelled => Error::Model(fieldcraft_model::Error::Cancelled),
|
||||
FactorError::NotPositiveDefinite { column } | FactorError::Singular { column } => {
|
||||
let node = eqs.eq_dof.get(column).and_then(|d| mesh.layout.locate(*d)).map(|(slot, _)| slot);
|
||||
let label = node.and_then(|n| mesh.labels.get(n)).copied().unwrap_or(0);
|
||||
@@ -434,6 +435,7 @@ fn run(model: &Model, resolved: &Resolved, step: &Step, limits: &Limits) -> Resu
|
||||
fieldcraft_model::progress::stage("Time increment", Some(steps as f64), "");
|
||||
for i in 1..=steps {
|
||||
fieldcraft_model::progress::count((i - 1) as f64);
|
||||
fieldcraft_model::progress::check()?;
|
||||
b.mul(&t, &mut rhs);
|
||||
for (r, fj) in rhs.iter_mut().zip(&f) {
|
||||
*r += dt * fj;
|
||||
|
||||
Reference in new issue
Block a user