fedoo.problem.NonLinear.set_nr_criterion

NonLinear.set_nr_criterion(criterion='Force', **kargs)

Define the convergence criterion of the newton raphson algorithm.

For a problem pb, the newton raphson parameters can also be directly set in the pb.nr_parameters dict.

Parameter:
  • criterion: str in [‘Displacement’, ‘Force’, ‘Work’], default = “Displacement”. Type of convergence test.

Optional parameters that can be set as kargs:
  • ‘err0’: float or None, default = None. The reference error. If None (default), err0 is automatically computed. For Force, the current total force norm is recomputed at each iteration. A zero norm uses one for that evaluation only, making tol an absolute residual tolerance in force units.

  • ‘tol’: float, default is 5e-3. Error tolerance for convergence.

  • ‘max_subiter’: int, default = 16. Number of nr iterations before returning a convergence error.

  • ‘dt_increase_niter’: int or None, default = None. Number of nr iterations threshold that define an easy convergence. In problem allowing automatic convergence, if the Newton–Raphson loop converges in at most that many iterations, the time step is increased. If None, defaults to max_subiter//3.

  • ‘norm_type’: int or numpy.inf, default = 2. Define the norm used to test the criterion.

  • ‘force_elastic_stiffness’: bool, default = False. If True, always forces the use of the elastic stiffness matrix (KE) for all NR iterations (Quasi-Newton / Initial Stiffness method).

  • ‘elastic_initial_guess’: bool, default = False. If True, forces the use of the elastic matrix for the initial guess (first iteration) of a time increment. Ignored if force_elastic_stiffness is True.

  • ‘adaptive_stiffness’: bool, default = False. Enable adaptive stiffness algorithm with xi-blending between safe (often elastic) and tangent stiffness matrices to enhance convergence robustness. Only works if the weak form provides an elastic stiffness matrix at the beginning of the increment, when set_start is triggered (e.g. not for contact problems). Ignored if force_elastic_stiffness is True.

  • ‘assume_cvg_at_max_subiter’: bool, default = False. WARNING: DANGEROUS PARAMETER. If True, assumes convergence when max_subiter iterations are reached, regardless of tolerance criterion. Use only for special cases requiring forced convergence. Skips convergence tolerance check when iteration limit is reached.

  • ‘check_early_divergence’: bool, default = True. If True, aborts the time step early if convergence trends are poor. A step is considered diverging if: 1. The error remains “unproductive” (new_error > 0.999 * previous_error)

    for early_divergence_niter consecutive Newton-Raphson iterations.

    2. The error spikes to more than 100 times the previous error. With automatic beam/shell tangents (consistent_tangent=None), three iterations without a 1% improvement of a reference error activate the consistent tangent. The current error becomes a fresh reference; four further nonproductive iterations trigger adaptive stiffness if available; early_divergence_niter controls the early abort. Significant improvements reset the counter and update the reference. Immediate failure checks remain active throughout.

  • ‘early_divergence_niter’: positive int, default = 4. Number of nonproductive iterations before early rejection. Ignored when check_early_divergence=False. Does not change the automatic tangent or adaptive stiffness triggers, or the immediate spike check.