Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/VSM/core/Solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -1444,6 +1444,10 @@ def finite(state):
trial = evaluate(current["x"] + direction)
evaluations += 1
ratio = np.inf if finite(trial) and norm(trial) == 0 else (norm(current) / norm(trial) if finite(trial) else 0.0)
crossed_gate = finite(trial) and trial["gate"] != current["gate"]
if not finite(trial) or (
ratio < self._newton_reject_ratio
and not (crossed_gate and dt <= dt_restart)
):
# Residual grew too much: reject and shrink. EXCEPT across
# the viscosity gate, the residual's one discontinuity:
Expand Down
Loading