Perhaps this behavior is the result of a "scaling" issue in how various terms affect the residual? In particular perhaps the terms for enforcing boundary conditions are scaled differently than terms for the PDE enforcement?
> On Nov 16, 2021, at 11:19 AM, Francesc Levrero-Florencio > <f.levrero-floren...@onscale.com> wrote: > > Dear PETSc team and users, > > We are running a simple cantilever beam bending, where the profile of the > beam is I-shaped, where we apply a bending force on one end and fully > constrained displacements on the other end. The formulation is a large strain > formulation in Total Lagrangian form, where the material of the beam is a > Saint Venant-Kirchhoff hyperelastic material that uses the same constants as > steel (200E9 GPa Young’s modulus and 0.3 Poisson’s ratio). > > The simulation finishes in the requested number of time steps by using the > “basic” type of line-search in the SNES (i.e. traditional Newton method > without line-search) in a reasonable number of Newton iterations per time > step (3 or 4 iterations). However, when using the “bt” (or “l2”, and in fact > no type of line-search ends up yielding convergence) line-search type, the > convergence never happens within the SNES default maximum number of > iterations of 50. > > During solving with traditional Newton, the general behaviour of each time > step is that the norm of the residual increases on the second call to the > residual function, but then hugely decreases in the following one or two, up > to the point where convergence is achieved. Using “bt” line-search, the > line-search discards the step at lambda=1 immediately because the norm of the > residual is higher than that produced in the first call to the residual > function, cutting down the value of lambda to a value significantly lower > than 1. The simulation then progresses in following Newton iterations in a > similar fashion, the line-search step at lambda=1 is always discarded, and > then smaller steps are taken but convergence never occurs, for even the first > time step. > > Here are a few values of the relevant norms (using traditional Newton) in the > first time step: > > BASIC NEWTON LS > Norm of the internal forces is 0 > Norm of the external forces is 1374.49 > Norm of the residual is 1374.49 > Norm of the solution with Dirichlet BCs is 0 > Number of SNES iteration is 0 > --------------------------------------------------------------------- > Norm of the internal forces is 113498 > Norm of the external forces is 1374.49 > Norm of the residual is 105053 > Norm of the solution with Dirichlet BCs is 0.441466 > Number of SNES iteration is 0 > --------------------------------------------------------------------- > Norm of the internal forces is 42953.5 > Norm of the external forces is 1374.49 > Norm of the residual is 11.3734 > Norm of the solution with Dirichlet BCs is 0.441438 > Number of SNES iteration is 1 > > Here are a few values of the relevant norms (using “bt” line-search) in the > first time step: > > BT NEWTONLS > Norm of the internal forces is 0 > Norm of the external forces is 1374.49 > Norm of the residual is 1374.49 > Norm of the solution with Dirichlet BCs is 0 > Number of SNES iteration is 0 > --------------------------------------------------------------------- > Norm of the internal forces is 113498 > Norm of the external forces is 1374.49 > Norm of the residual is 105053 > Norm of the solution with Dirichlet BCs is 0.441466 > Number of SNES iteration is 0 > (I assume this is the first try at lambda=1) > --------------------------------------------------------------------- > Norm of the internal forces is 4422.12 > Norm of the external forces is 1374.49 > Norm of the residual is 1622.74 > Norm of the solution with Dirichlet BCs is 0.0441466 > Number of SNES iteration is 0 > Line search: gnorm after quadratic fit 1.622742343614e+03 > (I assume that in this line-search iteration 0.05 < lambda < 1, but the > corresponding residual is not smaller than the one in the first call, 1622 > > 1374) > --------------------------------------------------------------------- > Norm of the internal forces is 2163.76 > Norm of the external forces is 1374.49 > Norm of the residual is 1331.88 > Norm of the solution with Dirichlet BCs is 0.0220733 > Number of SNES iteration is 0 > Line search: Cubically determined step, current gnorm 1.331884625811e+03 > lambda=5.0000000000000003e-02 > (This is the accepted lambda for the current Newton iteration) > --------------------------------------------------------------------- > Norm of the internal forces is 104020 > Norm of the external forces is 1374.49 > Norm of the residual is 94739 > Norm of the solution with Dirichlet BCs is 0.441323 > Number of SNES iteration is 1 > > My question would be, any idea on how to deal with this situation? I would > imagine a “hack” would be to bypass the first residual norm, and have the > line-search use the following one as the “base norm” to check its reduction > in further iterations, but we are open to any ideas. > > Thanks for your help in advance and please keep up the good work! > > Regards, > Francesc.