Skip to content
Snippets Groups Projects
Commit a02bbafe authored by Stefano Zampini's avatar Stefano Zampini
Browse files

SNESNEWTONTR: skip unneeded fallback when tauk is 1.0

tauk == 1.0 means the cauchy point is on the boundary of the trust region
parent 81b794be
No related branches found
No related tags found
1 merge request!7647SNESNEWTONTR: skip unneeded fallback when tauk is 1.0
......@@ -638,7 +638,7 @@ static PetscErrorCode SNESSolve_NEWTONTR(SNES snes)
PetscCall(VecNorm(Y, neP->norm, &ynorm));
/* decide what to do when the update is outside of trust region */
if (ynorm > delta || ynorm == 0.0) {
if (tauk != 1.0 && (ynorm > delta || ynorm == 0.0)) {
SNESNewtonTRFallbackType fallback = ynorm > 0.0 ? neP->fallback : SNES_TR_FALLBACK_CAUCHY;
PetscCheck(neP->norm == NORM_2 || fallback != SNES_TR_FALLBACK_DOGLEG, PetscObjectComm((PetscObject)snes), PETSC_ERR_SUP, "DOGLEG without l2 norm not implemented");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment