Skip to content

Change solver defaults - #941

Merged
gertjanvanzwieten merged 11 commits into
mainfrom
solver-defaults
Nov 23, 2026
Merged

gertjanvanzwieten merged 11 commits into
mainfrom
solver-defaults

Conversation

@gertjanvanzwieten

Copy link
Copy Markdown
Contributor

No description provided.

This patch adds a missing droptol in a boundary constraints projection.
@gertjanvanzwieten
gertjanvanzwieten force-pushed the solver-defaults branch 5 times, most recently from 926e550 to 7574fd0 Compare November 19, 2026 21:41
Comment thread src/nutils/matrix/_base.py Resolved
This patch adds exlicit solver= keys to the arguments in the matrix test grid,
to make the tests insensitive to later changes in the solver defaults.
This patch removes the base solver logic that skips the actual solve step if
the residual norm is already below atol. While technically correct, this
behaviour is almost never desired, and may leads to unexpected time series
stagnations and other mysterious failures.
This patch introduces miniter and maxiter to the arnoldi solver and set the
default miniter to 1. This is related to commit 94bfe85: formerly the Arnoldi
solver would not be invoked if resnorm < atol, but now that it is, we want it
to do at least one solve.
This patch changes the default solver from "arnoldi" to "direct", which is a
more natural default that is faster (doing only one iteration) and should be
fine in the majority of situations that the matrix is well conditioned.
This patch instructs the Newton solver to do at least one iteration by default,
regardless of the residual of the initial guess. This is the nonlinear
equivalent of 94bfe85 and 4826528 that similarly aims to make the default
settings more robust against unexpected stagnations.
This patch cleans up some solver.System code by introducing an __initargs
attribute that is referenced from both __reduce__ and __nutils_hash__.
This patch adds an explicit copy in System.construct so that the function can
be relied upon to always return a new dictionary.
This patch cleans up the logic by which solver.System evaluates its jacobians,
residuals and values. The caching mechanism is simplified by introducing
_cached_eval, and otherwise caching only constant matrices under key "jac".
@gertjanvanzwieten
gertjanvanzwieten merged commit 59d15e3 into main Nov 23, 2026
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants