Repository navigation
Solver and return-map failures throw cutback_error - #231
Merged
Merged
Conversation
Non-convergence, a negative plastic multiplier and a non-positive det F are recoverable with a smaller increment, so hosts that classify by type can retry them. Configuration errors keep their types.
This was referenced Oct 29, 2026
petlenz
added a commit
that referenced
this pull request
Oct 29, 2026
The return-map and convergence failures from #231 included umat/errors.h and threw umat::cutback_error; the same type now comes from core/errors.h, so no material header pulls in umat/. test_host_neutral_includes covers the six headers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What / why
Hosts classify a failure by its type (
umat/errors.h):fatal_errorstops the analysis,cutback_error(astd::runtime_error) means "retry with a smaller increment". Return-map and Newton non-convergence in the library threw plainstd::runtime_error, so a host that classifies by type could not tell a step-size problem from a setup fault.Contract
cutback_errorwith the unchanged message.runtime_error,invalid_argument,logic_error); a smaller step cannot fix them.cutback_errorderives fromruntime_error, so the UMAT catch order inumat_interface.his untouched (fatal_errorfirst, thenstd::exception->pnewdt = 0.25). Callers that catchruntime_errorstill work.Changed sites
materials/j2_plasticity.h(2)materials/j2_rk_plasticity.hmaterials/drucker_prager_plasticity.h(2)materials/j2_kinematic_plasticity.h(2)mean_field/kernels.hself_consistentdid not convergematerials/neo_hooke.hstd::domain_error)Deviations from the brief
vector_newton.hlines named in the brief (275, 298, 530) are not step-size failures:solve_with_factorization()called without a converged solve (API misuse),check_names(input validation) and thezero_blockscheck (model definition).vector_newton::solve()itself never throws; it reportsconverged()and the materials throw. They are left as they are.j2_kinematic_plasticity.hgraph-driven solver check (configuration, with a test that it is not acutback_error),orientation.hACG fit (preprocessing, not part of a step), allweighted_sum/property_engine/material_context/IO errors.self_consistent(non-convergence) andneo_hooke(det F <= 0, previouslydomain_error; an inverted element is the usual reason for a cutback, andstd::domain_errorwould not be caught by a host catchingruntime_error).umat/errors.hfor now; the type is still defined there.Independence from #222
This PR does not depend on #222. #222 moves
cutback_errortocore/errors.hand keepsumat::cutback_errorthrough a using-declaration, so both spellings stay valid. If #222 merges first, the only conflict to expect is the added#include "numsim-materials/umat/errors.h"lines, which still resolve through the forwarder, so no change is needed beyond taking either side.Tests
Each family forces the failure and expects
cutback_error; all were red first (the plainruntime_error/domain_errorwas thrown) and are green now.J2Softening.UnstableSofteningIsRejectedRatherThanClamped,J2Softening.ANonConvergedReturnMapAsksForASmallerStep(zero tolerance)J2Kinematic.ANonConvergedReturnMapAsksForASmallerStep,ANegativeMultiplierAsksForASmallerStep,AGraphDrivenSolverIsAConfigurationErrorNotACutbackRkConvergence.AJ2RkStageThatRunsOutOfIterationsThrows,AFailedStageDoesNotInfluenceTheNextCallDruckerPragerErrors.ANegativeMultiplierAsksForASmallerStep,WhenBothNewtonsFailTheStepIsRetryableMeanFieldKernels.SelfConsistentThrowsWhenItDoesNotConvergeNeoHooke.ANonPositiveDeterminantAsksForASmallerStepGate
Full gate (GCC 14, -O1): BUILD=0 TEST=0 warnings=0, 1454 of 1454 tests passed.