def METHOD_NAME() -> None:
    # Bind to variables in the outer function
    nonlocal prev_sol
    nonlocal sol
    nonlocal error_norm
    nonlocal is_converged
    nonlocal is_diverged
    # Logging.
    logger.info(
        f"Newton iteration number {iteration_counter}"
        + f" of {self.params['max_iterations']}"
    )
    # Re-discretize the nonlinear term
    model.before_nonlinear_iteration()
    sol = self.iteration(model)
    model.after_nonlinear_iteration(sol)
    error_norm, is_converged, is_diverged = model.check_convergence(
        sol, prev_sol, init_sol, self.params
    )
    prev_sol = sol
    errors.append(error_norm)