Date: 2026-05-01T10:02:25+00:00

Actual source code: nepregis.c

      1: /*
      2:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      3:    SLEPc - Scalable Library for Eigenvalue Problem Computations
      4:    Copyright (c) 2002-, Universitat Politecnica de Valencia, Spain

      6:    This file is part of SLEPc.
      7:    SLEPc is distributed under a 2-clause BSD license (see LICENSE).
      8:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      9: */

     11: #include <slepc/private/nepimpl.h>

     13: SLEPC_EXTERN PetscErrorCode NEPCreate_RII(NEP);
     14: SLEPC_EXTERN PetscErrorCode NEPCreate_SLP(NEP);
     15: SLEPC_EXTERN PetscErrorCode NEPCreate_NArnoldi(NEP);
     16: SLEPC_EXTERN PetscErrorCode NEPCreate_Interpol(NEP);
     17: #if defined(PETSC_USE_COMPLEX)
     18: SLEPC_EXTERN PetscErrorCode NEPCreate_CISS(NEP);
     19: #endif
     20: SLEPC_EXTERN PetscErrorCode NEPCreate_NLEIGS(NEP);

     22: /*@C
     23:    NEPRegisterAll - Registers all the solvers in the `NEP` package.

     25:    Not Collective

     27:    Level: advanced

     29: .seealso: [](ch:nep), `NEPRegister()`
     30: @*/
     31: PetscErrorCode NEPRegisterAll(void)
     32: {
     33:   PetscFunctionBegin;
     34:   if (NEPRegisterAllCalled) PetscFunctionReturn(PETSC_SUCCESS);
     35:   NEPRegisterAllCalled = PETSC_TRUE;
     36:   PetscCall(NEPRegister(NEPRII,NEPCreate_RII));
     37:   PetscCall(NEPRegister(NEPSLP,NEPCreate_SLP));
     38:   PetscCall(NEPRegister(NEPNARNOLDI,NEPCreate_NArnoldi));
     39:   PetscCall(NEPRegister(NEPINTERPOL,NEPCreate_Interpol));
     40: #if defined(PETSC_USE_COMPLEX)
     41:   PetscCall(NEPRegister(NEPCISS,NEPCreate_CISS));
     42: #endif
     43:   PetscCall(NEPRegister(NEPNLEIGS,NEPCreate_NLEIGS));
     44:   PetscFunctionReturn(PETSC_SUCCESS);
     45: }

     47: /*@C
     48:   NEPMonitorRegisterAll - Registers all the monitors in the `NEP` package.

     50:   Not Collective

     52:   Level: advanced

     54: .seealso: [](ch:nep), `NEPMonitorRegister()`
     55: @*/
     56: PetscErrorCode NEPMonitorRegisterAll(void)
     57: {
     58:   PetscFunctionBegin;
     59:   if (NEPMonitorRegisterAllCalled) PetscFunctionReturn(PETSC_SUCCESS);
     60:   NEPMonitorRegisterAllCalled = PETSC_TRUE;

     62:   PetscCall(NEPMonitorRegister("first_approximation",PETSCVIEWERASCII,PETSC_VIEWER_DEFAULT,NEPMonitorFirst,NULL,NULL));
     63:   PetscCall(NEPMonitorRegister("first_approximation",PETSCVIEWERDRAW,PETSC_VIEWER_DRAW_LG,NEPMonitorFirstDrawLG,NEPMonitorFirstDrawLGCreate,NULL));
     64:   PetscCall(NEPMonitorRegister("all_approximations",PETSCVIEWERASCII,PETSC_VIEWER_DEFAULT,NEPMonitorAll,NULL,NULL));
     65:   PetscCall(NEPMonitorRegister("all_approximations",PETSCVIEWERDRAW,PETSC_VIEWER_DRAW_LG,NEPMonitorAllDrawLG,NEPMonitorAllDrawLGCreate,NULL));
     66:   PetscCall(NEPMonitorRegister("convergence_history",PETSCVIEWERASCII,PETSC_VIEWER_DEFAULT,NEPMonitorConverged,NEPMonitorConvergedCreate,PetscViewerAndFormatDestroy));
     67:   PetscCall(NEPMonitorRegister("convergence_history",PETSCVIEWERDRAW,PETSC_VIEWER_DRAW_LG,NEPMonitorConvergedDrawLG,NEPMonitorConvergedDrawLGCreate,PetscViewerAndFormatDestroy));
     68:   PetscFunctionReturn(PETSC_SUCCESS);
     69: }