Skip to content

Commit

Permalink
backtrack print
Browse files Browse the repository at this point in the history
  • Loading branch information
wortiz committed Mar 8, 2024
1 parent de2532f commit 7c3f8b3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/mm_sol_nonlinear.c
Original file line number Diff line number Diff line change
Expand Up @@ -2067,6 +2067,7 @@ int solve_nonlinear_problem(struct GomaLinearSolverData *ams,
if (best_norm < Epsilon[pg->imtrx][0]) {
skip = TRUE;
}
P0PRINTF("\nNewton Line Search: %f %f\n", damp, best_norm);

while (!skip && (damp > min_damp)) {
damp *= reduction_factor;
Expand All @@ -2087,6 +2088,7 @@ int solve_nonlinear_problem(struct GomaLinearSolverData *ams,
exchange_dof(cx, dpi, R, pg->imtrx);

dbl g_check = L2_norm(R, NumUnknowns[pg->imtrx]);
P0PRINTF("\nNewton Line Search: %f %f\n", damp, g_check);
if (isnan(g_check)) {
break;
}
Expand All @@ -2101,11 +2103,13 @@ int solve_nonlinear_problem(struct GomaLinearSolverData *ams,
g_check = 0.5 * sqrt(g_check * g_check);

if (g_check <= r_check + 0.5 * slope * damp) {
P0PRINTF("\nNewton Line Search: stop reached %f %f %f <= %f\n", slope, damp, g_check,
r_check + 0.5 * slope * damp);
break;
}
}

P0PRINTF("Newton Line Search: best damping factor: %f\n", best_damp);
P0PRINTF("\nNewton Line Search: best damping factor: %f\n", best_damp);
for (i = 0; i < NumUnknowns[pg->imtrx]; i++) {
x[i] = x_save[i] - best_damp * delta_x[i];
}
Expand Down

0 comments on commit 7c3f8b3

Please sign in to comment.