Date: 2022-03-04T17:39:00+00:00

Actual source code: itregis.c

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

      3: PETSC_EXTERN PetscErrorCode KSPCreate_Richardson(KSP);
      4: PETSC_EXTERN PetscErrorCode KSPCreate_Chebyshev(KSP);
      5: PETSC_EXTERN PetscErrorCode KSPCreate_CG(KSP);
      6: PETSC_EXTERN PetscErrorCode KSPCreate_GROPPCG(KSP);
      7: PETSC_EXTERN PetscErrorCode KSPCreate_PIPECG(KSP);
      8: PETSC_EXTERN PetscErrorCode KSPCreate_PIPECGRR(KSP);
      9: PETSC_EXTERN PetscErrorCode KSPCreate_PIPELCG(KSP);
     10: PETSC_EXTERN PetscErrorCode KSPCreate_PIPEPRCG(KSP);
     11: PETSC_EXTERN PetscErrorCode KSPCreate_PIPECG2(KSP);
     12: PETSC_EXTERN PetscErrorCode KSPCreate_CGNE(KSP);
     13: PETSC_EXTERN PetscErrorCode KSPCreate_NASH(KSP);
     14: PETSC_EXTERN PetscErrorCode KSPCreate_STCG(KSP);
     15: PETSC_EXTERN PetscErrorCode KSPCreate_GLTR(KSP);
     16: PETSC_EXTERN PetscErrorCode KSPCreate_TCQMR(KSP);
     17: PETSC_EXTERN PetscErrorCode KSPCreate_FCG(KSP);
     18: PETSC_EXTERN PetscErrorCode KSPCreate_PIPEFCG(KSP);
     19: PETSC_EXTERN PetscErrorCode KSPCreate_GMRES(KSP);
     20: PETSC_EXTERN PetscErrorCode KSPCreate_BCGS(KSP);
     21: PETSC_EXTERN PetscErrorCode KSPCreate_IBCGS(KSP);
     22: PETSC_EXTERN PetscErrorCode KSPCreate_FBCGS(KSP);
     23: PETSC_EXTERN PetscErrorCode KSPCreate_PIPEBCGS(KSP);
     24: PETSC_EXTERN PetscErrorCode KSPCreate_FBCGSR(KSP);
     25: PETSC_EXTERN PetscErrorCode KSPCreate_BCGSL(KSP);
     26: PETSC_EXTERN PetscErrorCode KSPCreate_CGS(KSP);
     27: PETSC_EXTERN PetscErrorCode KSPCreate_TFQMR(KSP);
     28: PETSC_EXTERN PetscErrorCode KSPCreate_LSQR(KSP);
     29: PETSC_EXTERN PetscErrorCode KSPCreate_PREONLY(KSP);
     30: PETSC_EXTERN PetscErrorCode KSPCreate_CR(KSP);
     31: PETSC_EXTERN PetscErrorCode KSPCreate_PIPECR(KSP);
     32: PETSC_EXTERN PetscErrorCode KSPCreate_QCG(KSP);
     33: PETSC_EXTERN PetscErrorCode KSPCreate_BiCG(KSP);
     34: PETSC_EXTERN PetscErrorCode KSPCreate_FGMRES(KSP);
     35: PETSC_EXTERN PetscErrorCode KSPCreate_PIPEFGMRES(KSP);
     36: PETSC_EXTERN PetscErrorCode KSPCreate_MINRES(KSP);
     37: PETSC_EXTERN PetscErrorCode KSPCreate_SYMMLQ(KSP);
     38: PETSC_EXTERN PetscErrorCode KSPCreate_LGMRES(KSP);
     39: PETSC_EXTERN PetscErrorCode KSPCreate_LCD(KSP);
     40: PETSC_EXTERN PetscErrorCode KSPCreate_GCR(KSP);
     41: PETSC_EXTERN PetscErrorCode KSPCreate_PIPEGCR(KSP);
     42: PETSC_EXTERN PetscErrorCode KSPCreate_PGMRES(KSP);
     43: #if !defined(PETSC_USE_COMPLEX)
     44: PETSC_EXTERN PetscErrorCode KSPCreate_DGMRES(KSP);
     45: #endif
     46: PETSC_EXTERN PetscErrorCode KSPCreate_TSIRM(KSP);
     47: PETSC_EXTERN PetscErrorCode KSPCreate_CGLS(KSP);
     48: PETSC_EXTERN PetscErrorCode KSPCreate_FETIDP(KSP);
     49: #if defined(PETSC_HAVE_HPDDM)
     50: PETSC_EXTERN PetscErrorCode KSPCreate_HPDDM(KSP);
     51: #endif

     53: /*@C
     54:   KSPRegisterAll - Registers all of the Krylov subspace methods in the KSP package.

     56:   Not Collective

     58:   Level: advanced
     59: @*/
     60: PetscErrorCode KSPRegisterAll(void)
     61: {

     65:   if (KSPRegisterAllCalled) return(0);
     66:   KSPRegisterAllCalled = PETSC_TRUE;

     68:   KSPRegister(KSPCG,          KSPCreate_CG);
     69:   KSPRegister(KSPGROPPCG,     KSPCreate_GROPPCG);
     70:   KSPRegister(KSPPIPECG,      KSPCreate_PIPECG);
     71:   KSPRegister(KSPPIPECGRR,    KSPCreate_PIPECGRR);
     72:   KSPRegister(KSPPIPELCG,     KSPCreate_PIPELCG);
     73:   KSPRegister(KSPPIPEPRCG,    KSPCreate_PIPEPRCG);
     74:   KSPRegister(KSPPIPECG2,     KSPCreate_PIPECG2);
     75:   KSPRegister(KSPCGNE,        KSPCreate_CGNE);
     76:   KSPRegister(KSPNASH,        KSPCreate_NASH);
     77:   KSPRegister(KSPSTCG,        KSPCreate_STCG);
     78:   KSPRegister(KSPGLTR,        KSPCreate_GLTR);
     79:   KSPRegister(KSPRICHARDSON,  KSPCreate_Richardson);
     80:   KSPRegister(KSPCHEBYSHEV,   KSPCreate_Chebyshev);
     81:   KSPRegister(KSPGMRES,       KSPCreate_GMRES);
     82:   KSPRegister(KSPTCQMR,       KSPCreate_TCQMR);
     83:   KSPRegister(KSPFCG  ,       KSPCreate_FCG);
     84:   KSPRegister(KSPPIPEFCG,     KSPCreate_PIPEFCG);
     85:   KSPRegister(KSPBCGS,        KSPCreate_BCGS);
     86:   KSPRegister(KSPIBCGS,       KSPCreate_IBCGS);
     87:   KSPRegister(KSPFBCGS,       KSPCreate_FBCGS);
     88:   KSPRegister(KSPPIPEBCGS,    KSPCreate_PIPEBCGS);
     89:   KSPRegister(KSPFBCGSR,      KSPCreate_FBCGSR);
     90:   KSPRegister(KSPBCGSL,       KSPCreate_BCGSL);
     91:   KSPRegister(KSPCGS,         KSPCreate_CGS);
     92:   KSPRegister(KSPTFQMR,       KSPCreate_TFQMR);
     93:   KSPRegister(KSPCR,          KSPCreate_CR);
     94:   KSPRegister(KSPPIPECR,      KSPCreate_PIPECR);
     95:   KSPRegister(KSPLSQR,        KSPCreate_LSQR);
     96:   KSPRegister(KSPPREONLY,     KSPCreate_PREONLY);
     97:   KSPRegister(KSPQCG,         KSPCreate_QCG);
     98:   KSPRegister(KSPBICG,        KSPCreate_BiCG);
     99:   KSPRegister(KSPFGMRES,      KSPCreate_FGMRES);
    100:   KSPRegister(KSPPIPEFGMRES,  KSPCreate_PIPEFGMRES);
    101:   KSPRegister(KSPMINRES,      KSPCreate_MINRES);
    102:   KSPRegister(KSPSYMMLQ,      KSPCreate_SYMMLQ);
    103:   KSPRegister(KSPLGMRES,      KSPCreate_LGMRES);
    104:   KSPRegister(KSPLCD,         KSPCreate_LCD);
    105:   KSPRegister(KSPGCR,         KSPCreate_GCR);
    106:   KSPRegister(KSPPIPEGCR,     KSPCreate_PIPEGCR);
    107:   KSPRegister(KSPPGMRES,      KSPCreate_PGMRES);
    108: #if !defined(PETSC_USE_COMPLEX)
    109:   KSPRegister(KSPDGMRES,      KSPCreate_DGMRES);
    110: #endif
    111:   KSPRegister(KSPTSIRM,       KSPCreate_TSIRM);
    112:   KSPRegister(KSPCGLS,        KSPCreate_CGLS);
    113:   KSPRegister(KSPFETIDP,      KSPCreate_FETIDP);
    114: #if defined(PETSC_HAVE_HPDDM)
    115:   KSPRegister(KSPHPDDM,       KSPCreate_HPDDM);
    116: #endif
    117:   return(0);
    118: }

    120: /*@C
    121:   KSPMonitoRegisterAll - Registers all of the Krylov subspace monitors in the KSP package.

    123:   Not Collective

    125:   Level: advanced
    126: @*/
    127: PetscErrorCode KSPMonitorRegisterAll(void)
    128: {

    132:   if (KSPMonitorRegisterAllCalled) return(0);
    133:   KSPMonitorRegisterAllCalled = PETSC_TRUE;

    135:   KSPMonitorRegister("preconditioned_residual",       PETSCVIEWERASCII, PETSC_VIEWER_DEFAULT, KSPMonitorResidual,           NULL, NULL);
    136:   KSPMonitorRegister("preconditioned_residual",       PETSCVIEWERDRAW,  PETSC_VIEWER_DEFAULT, KSPMonitorResidualDraw,       NULL, NULL);
    137:   KSPMonitorRegister("preconditioned_residual",       PETSCVIEWERDRAW,  PETSC_VIEWER_DRAW_LG, KSPMonitorResidualDrawLG,     KSPMonitorResidualDrawLGCreate, NULL);
    138:   KSPMonitorRegister("preconditioned_residual_short", PETSCVIEWERASCII, PETSC_VIEWER_DEFAULT, KSPMonitorResidualShort,      NULL, NULL);
    139:   KSPMonitorRegister("preconditioned_residual_range", PETSCVIEWERASCII, PETSC_VIEWER_DEFAULT, KSPMonitorResidualRange,      NULL, NULL);
    140:   KSPMonitorRegister("true_residual",                 PETSCVIEWERASCII, PETSC_VIEWER_DEFAULT, KSPMonitorTrueResidual,       NULL, NULL);
    141:   KSPMonitorRegister("true_residual",                 PETSCVIEWERDRAW,  PETSC_VIEWER_DEFAULT, KSPMonitorTrueResidualDraw,   NULL, NULL);
    142:   KSPMonitorRegister("true_residual",                 PETSCVIEWERDRAW,  PETSC_VIEWER_DRAW_LG, KSPMonitorTrueResidualDrawLG, KSPMonitorTrueResidualDrawLGCreate, NULL);
    143:   KSPMonitorRegister("true_residual_max",             PETSCVIEWERASCII, PETSC_VIEWER_DEFAULT, KSPMonitorTrueResidualMax,    NULL, NULL);
    144:   KSPMonitorRegister("error",                         PETSCVIEWERASCII, PETSC_VIEWER_DEFAULT, KSPMonitorError,              NULL, NULL);
    145:   KSPMonitorRegister("error",                         PETSCVIEWERDRAW,  PETSC_VIEWER_DEFAULT, KSPMonitorErrorDraw,          NULL, NULL);
    146:   KSPMonitorRegister("error",                         PETSCVIEWERDRAW,  PETSC_VIEWER_DRAW_LG, KSPMonitorErrorDrawLG,        KSPMonitorErrorDrawLGCreate, NULL);
    147:   KSPMonitorRegister("solution",                      PETSCVIEWERASCII, PETSC_VIEWER_DEFAULT, KSPMonitorSolution,           NULL, NULL);
    148:   KSPMonitorRegister("solution",                      PETSCVIEWERDRAW,  PETSC_VIEWER_DEFAULT, KSPMonitorSolutionDraw,       NULL, NULL);
    149:   KSPMonitorRegister("solution",                      PETSCVIEWERDRAW,  PETSC_VIEWER_DRAW_LG, KSPMonitorSolutionDrawLG,     KSPMonitorSolutionDrawLGCreate, NULL);
    150:   KSPMonitorRegister("singular_value",                PETSCVIEWERASCII, PETSC_VIEWER_DEFAULT, KSPMonitorSingularValue,      KSPMonitorSingularValueCreate, NULL);
    151:   KSPMonitorRegister("lsqr_residual",                 PETSCVIEWERASCII, PETSC_VIEWER_DEFAULT, KSPLSQRMonitorResidual,       NULL, NULL);
    152:   KSPMonitorRegister("lsqr_residual",                 PETSCVIEWERDRAW,  PETSC_VIEWER_DRAW_LG, KSPLSQRMonitorResidualDrawLG, KSPLSQRMonitorResidualDrawLGCreate, NULL);
    153:   return(0);
    154: }