Actual source code: linesearchregi.c

      1: #include <petsc/private/linesearchimpl.h>

      3: PETSC_EXTERN PetscErrorCode SNESLineSearchCreate_Basic(SNESLineSearch);
      4: PETSC_EXTERN PetscErrorCode SNESLineSearchCreate_Secant(SNESLineSearch);
      5: PETSC_EXTERN PetscErrorCode SNESLineSearchCreate_CP(SNESLineSearch);
      6: PETSC_EXTERN PetscErrorCode SNESLineSearchCreate_BT(SNESLineSearch);
      7: PETSC_EXTERN PetscErrorCode SNESLineSearchCreate_NLEQERR(SNESLineSearch);
      8: PETSC_EXTERN PetscErrorCode SNESLineSearchCreate_Shell(SNESLineSearch);
      9: PETSC_EXTERN PetscErrorCode SNESLineSearchCreate_NCGLinear(SNESLineSearch);
     10: PETSC_EXTERN PetscErrorCode SNESLineSearchCreate_Bisection(SNESLineSearch);

     12: /*@C
     13:   SNESLineSearchRegisterAll - Registers all of the nonlinear solver methods in the `SNESLineSearch` package.

     15:   Not Collective

     17:   Level: advanced

     19: .seealso: [](ch_snes), `SNES`, `SNESLineSearch`, `SNESLineSearchRegister()`, `SNESLineSearchRegisterDestroy()`
     20: @*/
     21: PetscErrorCode SNESLineSearchRegisterAll(void)
     22: {
     23:   PetscFunctionBegin;
     24:   if (SNESLineSearchRegisterAllCalled) PetscFunctionReturn(PETSC_SUCCESS);
     25:   SNESLineSearchRegisterAllCalled = PETSC_TRUE;
     26:   PetscCall(SNESLineSearchRegister(SNESLINESEARCHSHELL, SNESLineSearchCreate_Shell));
     27:   PetscCall(SNESLineSearchRegister(SNESLINESEARCHBASIC, SNESLineSearchCreate_Basic));
     28:   PetscCall(SNESLineSearchRegister(SNESLINESEARCHNONE, SNESLineSearchCreate_Basic));
     29:   PetscCall(SNESLineSearchRegister(SNESLINESEARCHSECANT, SNESLineSearchCreate_Secant));
     30:   // PETSC_DEPRECATED 3.24.0 This should eventually be removed
     31:   PetscCall(SNESLineSearchRegister("l2", SNESLineSearchCreate_Secant));
     32:   PetscCall(SNESLineSearchRegister(SNESLINESEARCHBT, SNESLineSearchCreate_BT));
     33:   PetscCall(SNESLineSearchRegister(SNESLINESEARCHNLEQERR, SNESLineSearchCreate_NLEQERR));
     34:   PetscCall(SNESLineSearchRegister(SNESLINESEARCHCP, SNESLineSearchCreate_CP));
     35:   PetscCall(SNESLineSearchRegister(SNESLINESEARCHNCGLINEAR, SNESLineSearchCreate_NCGLinear));
     36:   PetscCall(SNESLineSearchRegister(SNESLINESEARCHBISECTION, SNESLineSearchCreate_Bisection));
     37:   PetscFunctionReturn(PETSC_SUCCESS);
     38: }