Actual source code: mfnregis.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/mfnimpl.h>

     13: SLEPC_EXTERN PetscErrorCode MFNCreate_Krylov(MFN);
     14: SLEPC_EXTERN PetscErrorCode MFNCreate_Expokit(MFN);

     16: /*@C
     17:   MFNRegisterAll - Registers all the matrix functions in the `MFN` package.

     19:   Not Collective

     21:   Level: advanced

     23: .seealso: [](ch:mfn), `MFNRegister()`
     24: @*/
     25: PetscErrorCode MFNRegisterAll(void)
     26: {
     27:   PetscFunctionBegin;
     28:   if (MFNRegisterAllCalled) PetscFunctionReturn(PETSC_SUCCESS);
     29:   MFNRegisterAllCalled = PETSC_TRUE;
     30:   PetscCall(MFNRegister(MFNKRYLOV,MFNCreate_Krylov));
     31:   PetscCall(MFNRegister(MFNEXPOKIT,MFNCreate_Expokit));
     32:   PetscFunctionReturn(PETSC_SUCCESS);
     33: }

     35: /*@C
     36:   MFNMonitorRegisterAll - Registers all the monitors in the `MFN` package.

     38:   Not Collective

     40:   Level: advanced

     42: .seealso: [](ch:mfn), `MFNMonitorRegister()`
     43: @*/
     44: PetscErrorCode MFNMonitorRegisterAll(void)
     45: {
     46:   PetscFunctionBegin;
     47:   if (MFNMonitorRegisterAllCalled) PetscFunctionReturn(PETSC_SUCCESS);
     48:   MFNMonitorRegisterAllCalled = PETSC_TRUE;

     50:   PetscCall(MFNMonitorRegister("error_estimate",PETSCVIEWERASCII,PETSC_VIEWER_DEFAULT,MFNMonitorDefault,NULL,NULL));
     51:   PetscCall(MFNMonitorRegister("error_estimate",PETSCVIEWERDRAW,PETSC_VIEWER_DRAW_LG,MFNMonitorDefaultDrawLG,MFNMonitorDefaultDrawLGCreate,NULL));
     52:   PetscFunctionReturn(PETSC_SUCCESS);
     53: }