jax-am icon indicating copy to clipboard operation
jax-am copied to clipboard

Infinite while loop for non-linear case

Open SNMS95 opened this issue 9 months ago • 0 comments

In solver.py, the following lines

tol = 1e-6
while res_val > tol:
    dofs = linear_incremental_solver(problem, res_vec, A_fn, dofs,
                                     precond, use_petsc)
    res_vec, A_fn = newton_update_helper(dofs)
    # test_jacobi_precond(problem, jacobi_preconditioner(problem, dofs), A_fn)
    res_val = np.linalg.norm(res_vec)
    logger.debug(f"res l_2 = {res_val}")

can result in an infinite loop if there are convergence issues. This should be recified so that we break out of the loop after set number of iterations!

SNMS95 avatar Sep 07 '23 15:09 SNMS95