Report factor value bytes and preserve overflow-safe reduction limits

This commit is contained in:
Preetinder Kalsi authored and Irakli Kourtis committed 2026-10-15 14:00:56 -04:00
1 parent c7d0a82079
commit a530a0d914
7 files changed
+80 -12

No files matched your search

+1 -3
View File
@@ -303,9 +303,7 @@ fn prescribed(model: &Model, resolved: &Resolved, mesh: &HeatMesh, step: &Step)
fn factor(a: &Csr, limits: &Limits, mesh: &HeatMesh, eqs: &Reduction) -> Result<Factor> {
Factor::new(&UpperColumns::from_symmetric(a), limits.max_factor_entries).map_err(|e| match e {
FactorError::TooLarge { entries, limit } => {
Error::Limit(format!("the factorization needs {entries} entries; the limit is {limit} (refine less or raise the limit)"))
}
FactorError::TooLarge { entries, limit } => Error::factor_limit(entries, limit),
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),