Actual source code: petscksp.h

      1: !
      2: !
      3: !  Include file for Fortran use of the KSP package in PETSc
      4: !
      5: #if !defined (__PETSCKSP_H)

      8: #define KSP PetscFortranAddr
      9: #define KSPType character*(80)
     10: #define KSPCGType PetscEnum
     11: #define KSPConvergedReason PetscEnum
     12: #define KSPNormType PetscEnum
     13: #define KSPGMRESCGSRefinementType PetscEnum
     14: !
     15: !  Various Krylov subspace methods
     16: !
     17: #define KSPRICHARDSON 'richardson'
     18: #define KSPCHEBYCHEV 'chebychev'
     19: #define KSPCG 'cg'
     20: #define KSPGMRES 'gmres'
     21: #define KSPTCQMR 'tcqmr'
     22: #define KSPBCGS 'bcgs'
     23: #define KSPCGS 'cgs'
     24: #define KSPTFQMR 'tfqmr'
     25: #define KSPCR 'cr'
     26: #define KSPLSQR 'lsqr'
     27: #define KSPPREONLY 'preonly'
     28: #define KSPQCG 'qcg'
     29: #define KSPBICG 'bicg'
     30: #define KSPFGMRES 'fgmres'
     31: #define KSPMINRES 'minres'
     32: #define KSPSYMMLQ 'symmlq'
     33: #endif

     36: #if !defined (PETSC_AVOID_DECLARATIONS)

     38: !
     39: !  CG Types
     40: !
     41:       PetscEnum KSP_CG_SYMMETRIC,KSP_CG_HERMITIAN

     43:       parameter (KSP_CG_SYMMETRIC=1,KSP_CG_HERMITIAN=2)

     45:       PetscEnum KSP_CONVERGED_RTOL,KSP_CONVERGED_ATOL
     46:       PetscEnum KSP_CONVERGED_ITS
     47:       PetscEnum KSP_DIVERGED_ITS,KSP_DIVERGED_DTOL
     48:       PetscEnum KSP_DIVERGED_BREAKDOWN,KSP_CONVERGED_ITERATING
     49:       PetscEnum KSP_CONVERGED_QCG_NEG_CURVE
     50:       PetscEnum KSP_CONVERGED_QCG_CONSTRAINED
     51:       PetscEnum KSP_CONVERGED_STEP_LENGTH
     52:       PetscEnum KSP_DIVERGED_BREAKDOWN_BICG
     53:       PetscEnum KSP_DIVERGED_NONSYMMETRIC
     54:       PetscEnum KSP_DIVERGED_INDEFINITE_PC

     56:       parameter (KSP_CONVERGED_RTOL      = 2)
     57:       parameter (KSP_CONVERGED_ATOL      = 3)
     58:       parameter (KSP_CONVERGED_ITS       = 4)
     59:       parameter (KSP_CONVERGED_QCG_NEG_CURVE = 5)
     60:       parameter (KSP_CONVERGED_QCG_CONSTRAINED = 6)
     61:       parameter (KSP_CONVERGED_STEP_LENGTH = 7)

     63:       parameter (KSP_DIVERGED_ITS        = -3)
     64:       parameter (KSP_DIVERGED_DTOL       = -4)
     65:       parameter (KSP_DIVERGED_BREAKDOWN  = -5)
     66:       parameter (KSP_DIVERGED_BREAKDOWN_BICG = -6)
     67:       parameter (KSP_DIVERGED_NONSYMMETRIC = -7)
     68:       parameter (KSP_DIVERGED_INDEFINITE_PC = -8)

     70:       parameter (KSP_CONVERGED_ITERATING = 0)
     71: !
     72: !  Possible arguments to KSPSetNormType()
     73: !
     74:       PetscEnum KSP_NO_NORM
     75:       PetscEnum KSP_PRECONDITIONED_NORM
     76:       PetscEnum KSP_UNPRECONDITIONED_NORM
     77:       PetscEnum KSP_NATURAL_NORM
     78:
     79:       parameter (KSP_NO_NORM=0)
     80:       parameter (KSP_PRECONDITIONED_NORM=1)
     81:       parameter (KSP_UNPRECONDITIONED_NORM=2)
     82:       parameter (KSP_NATURAL_NORM=3)
     83: !
     84: !   Possible arguments to KSPSetMonitor()
     85: !
     86:       external KSPDEFAULTCONVERGED
     87:       external KSPDEFAULTMONITOR
     88:       external KSPTRUEMONITOR
     89:       external KSPLGMONITOR
     90:       external KSPLGTRUEMONITOR
     91:       external KSPVECVIEWMONITOR
     92:       external KSPSINGULARVALUEMONITOR
     93:       external KSPGMRESKRYLOVMONITOR
     94: !
     95: !   Possible arguments to KSPGMRESSetRefinementType()
     96: !
     97:       PetscEnum KSP_GMRES_CGS_REFINE_NEVER
     98:       PetscEnum KSP_GMRES_CGS_REFINE_IFNEEDED
     99:       PetscEnum KSP_GMRES_CGS_REFINE_ALWAYS
    100: !
    101:       parameter (KSP_GMRES_CGS_REFINE_NEVER = 0)
    102:       parameter (KSP_GMRES_CGS_REFINE_IFNEEDED = 1)
    103:       parameter (KSP_GMRES_CGS_REFINE_ALWAYS = 2)
    104: !
    105: !PETSC_DEC_ATTRIBUTES(KSPDEFAULTCONVERGED,'_KSPDEFAULTCONVERGED')
    106: !PETSC_DEC_ATTRIBUTES(KSPDEFAULTMONITOR,'_KSPDEFAULTMONITOR')
    107: !PETSC_DEC_ATTRIBUTES(KSPTRUEMONITOR,'_KSPTRUEMONITOR')
    108: !PETSC_DEC_ATTRIBUTES(KSPLGMONITOR,'_KSPLGMONITOR')
    109: !PETSC_DEC_ATTRIBUTES(KSPLGTRUEMONITOR,'_KSPLGTRUEMONITOR')
    110: !PETSC_DEC_ATTRIBUTES(KSPVECVIEWMONITOR,'_KSPVECVIEWMONITOR')
    111: !PETSC_DEC_ATTRIBUTES(KSPSINGULARVALUEMONITOR,'_KSPSINGULARVALUEMONITOR')
    112: !PETSC_DEC_ATTRIBUTES(KSPGMRESKRYLOVMONITOR,'_KSPGMRESKRYLOVMONITOR')

    114: !
    115: !  End of Fortran include file for the KSP package in PETSc
    116: !

    118: #endif