1: ! 2: ! Include file for Fortran use of the SNES package in PETSc 3: ! 4: #include "petsc/finclude/petscsnes.h" 6: type tSNES 7: PetscFortranAddr:: v PETSC_FORTRAN_TYPE_INITIALIZE 8: end type tSNES 10: type tPetscConvEst 11: PetscFortranAddr:: v PETSC_FORTRAN_TYPE_INITIALIZE 12: end type tPetscConvEst 14: SNES, parameter :: PETSC_NULL_SNES = tSNES(0) 15: PetscConvEst, parameter :: PETSC_NULL_CONVEST = & 16: & tPetscConvEst(0) 17: ! 18: ! Convergence flags 19: ! 20: PetscEnum SNES_CONVERGED_FNORM_ABS 21: PetscEnum SNES_CONVERGED_FNORM_RELATIVE 22: PetscEnum SNES_CONVERGED_SNORM_RELATIVE 23: PetscEnum SNES_CONVERGED_ITS 24: PetscEnum SNES_CONVERGED_TR_DELTA 26: PetscEnum SNES_DIVERGED_FUNCTION_DOMAIN 27: PetscEnum SNES_DIVERGED_FUNCTION_COUNT 28: PetscEnum SNES_DIVERGED_LINEAR_SOLVE 29: PetscEnum SNES_DIVERGED_FNORM_NAN 30: PetscEnum SNES_DIVERGED_MAX_IT 31: PetscEnum SNES_DIVERGED_LINE_SEARCH 32: PetscEnum SNES_DIVERGED_INNER 33: PetscEnum SNES_DIVERGED_LOCAL_MIN 34: PetscEnum SNES_DIVERGED_DTOL 35: PetscEnum SNES_CONVERGED_ITERATING 37: parameter (SNES_CONVERGED_FNORM_ABS = 2) 38: parameter (SNES_CONVERGED_FNORM_RELATIVE = 3) 39: parameter (SNES_CONVERGED_SNORM_RELATIVE = 4) 40: parameter (SNES_CONVERGED_ITS = 5) 41: parameter (SNES_CONVERGED_TR_DELTA = 7) 43: parameter (SNES_DIVERGED_FUNCTION_DOMAIN = -1) 44: parameter (SNES_DIVERGED_FUNCTION_COUNT = -2) 45: parameter (SNES_DIVERGED_LINEAR_SOLVE = -3) 46: parameter (SNES_DIVERGED_FNORM_NAN = -4) 47: parameter (SNES_DIVERGED_MAX_IT = -5) 48: parameter (SNES_DIVERGED_LINE_SEARCH = -6) 49: parameter (SNES_DIVERGED_INNER = -7) 50: parameter (SNES_DIVERGED_LOCAL_MIN = -8) 51: parameter (SNES_DIVERGED_DTOL = -9) 52: parameter (SNES_CONVERGED_ITERATING = 0) 53: ! 54: ! SNESLineSearchReason 55: ! 56: PetscEnum SNES_LINESEARCH_SUCCEEDED 57: PetscEnum SNES_LINESEARCH_FAILED_NANORINF 58: PetscEnum SNES_LINESEARCH_FAILED_DOMAIN 59: PetscEnum SNES_LINESEARCH_FAILED_REDUCT 60: PetscEnum SNES_LINESEARCH_FAILED_USER 61: PetscEnum SNES_LINESEARCH_FAILED_FUNCTION 63: parameter (SNES_LINESEARCH_SUCCEEDED = 0) 64: parameter (SNES_LINESEARCH_FAILED_NANORINF = 1) 65: parameter (SNES_LINESEARCH_FAILED_DOMAIN = 2) 66: parameter (SNES_LINESEARCH_FAILED_REDUCT = 3) 67: parameter (SNES_LINESEARCH_FAILED_USER = 4) 68: parameter (SNES_LINESEARCH_FAILED_FUNCTION = 5) 69: ! 70: ! SNESNormSchedule 71: ! 72: PetscEnum SNES_NORM_DEFAULT 73: PetscEnum SNES_NORM_NONE 74: PetscEnum SNES_NORM_ALWAYS 75: PetscEnum SNES_NORM_INITIAL_ONLY 76: PetscEnum SNES_NORM_FINAL_ONLY 77: PetscEnum SNES_NORM_INITIAL_FINAL_ONLY 79: parameter (SNES_NORM_DEFAULT = -1) 80: parameter (SNES_NORM_NONE = 0) 81: parameter (SNES_NORM_ALWAYS = 1) 82: parameter (SNES_NORM_INITIAL_ONLY = 2) 83: parameter (SNES_NORM_FINAL_ONLY = 3) 84: parameter (SNES_NORM_INITIAL_FINAL_ONLY = 4) 86: ! 87: ! Some PETSc fortran functions that the user might pass as arguments 88: ! 89: external SNESCOMPUTEJACOBIANDEFAULT 90: external MATMFFDCOMPUTEJACOBIAN 91: external SNESCOMPUTEJACOBIANDEFAULTCOLOR 92: external SNESMONITORDEFAULT 93: external SNESMONITORLGRESIDUALNORM 94: external SNESMONITORSOLUTION 95: external SNESMONITORSOLUTIONUPDATE 97: external SNESCONVERGEDDEFAULT 98: external SNESCONVERGEDSKIP 100: ! 101: ! SNESNGMRESRestartType 102: ! 104: PetscEnum SNES_NGMRES_RESTART_NONE 105: PetscEnum SNES_NGMRES_RESTART_PERIODIC 106: PetscEnum SNES_NGMRES_RESTART_DIFFERENCE 108: parameter (SNES_NGMRES_RESTART_NONE = 0) 109: parameter (SNES_NGMRES_RESTART_PERIODIC = 1) 110: parameter (SNES_NGMRES_RESTART_DIFFERENCE = 2) 113: ! 114: ! SNESNGMRESSelectionType 115: ! 117: PetscEnum SNES_NGMRES_SELECT_NONE 118: PetscEnum SNES_NGMRES_SELECT_DIFFERENCE 119: PetscEnum SNES_NGMRES_SELECT_LINESEARCH 121: parameter (SNES_NGMRES_SELECT_NONE = 0) 122: parameter (SNES_NGMRES_SELECT_DIFFERENCE = 1) 123: parameter (SNES_NGMRES_SELECT_LINESEARCH = 2) 125: ! 126: ! SNESQNType 127: ! 129: PetscEnum SNES_QN_LBFGS 130: PetscEnum SNES_QN_BROYDEN 131: PetscEnum SNES_QN_BADBROYDEN 133: parameter(SNES_QN_LBFGS = 0) 134: parameter(SNES_QN_BROYDEN = 1) 135: parameter(SNES_QN_BADBROYDEN = 2) 137: ! 138: ! SNESQNScaleType 139: ! 141: PetscEnum SNES_QN_SCALE_DEFAULT 142: PetscEnum SNES_QN_SCALE_NONE 143: PetscEnum SNES_QN_SCALE_SHANNO 144: PetscEnum SNES_QN_SCALE_LINESEARCH 145: PetscEnum SNES_QN_SCALE_JACOBIAN 147: parameter(SNES_QN_SCALE_DEFAULT = 0) 148: parameter(SNES_QN_SCALE_NONE = 1) 149: parameter(SNES_QN_SCALE_SHANNO = 2) 150: parameter(SNES_QN_SCALE_LINESEARCH = 3) 151: parameter(SNES_QN_SCALE_JACOBIAN = 4) 153: ! 154: ! SNESQNRestartType 155: ! 157: PetscEnum SNES_QN_RESTART_DEFAULT 158: PetscEnum SNES_QN_RESTART_NONE 159: PetscEnum SNES_QN_RESTART_POWELL 160: PetscEnum SNES_QN_RESTART_PERIODIC 162: parameter(SNES_QN_RESTART_DEFAULT = 0) 163: parameter(SNES_QN_RESTART_NONE = 1) 164: parameter(SNES_QN_RESTART_POWELL = 2) 165: parameter(SNES_QN_RESTART_PERIODIC = 3) 167: ! 168: ! SNESNCGType 169: ! 171: PetscEnum SNES_NCG_FR 172: PetscEnum SNES_NCG_PRP 173: PetscEnum SNES_NCG_HS 174: PetscEnum SNES_NCG_DY 175: PetscEnum SNES_NCG_CD 177: parameter(SNES_NCG_FR = 0) 178: parameter(SNES_NCG_PRP = 1) 179: parameter(SNES_NCG_HS = 2) 180: parameter(SNES_NCG_DY = 3) 181: parameter(SNES_NCG_CD = 4) 184: ! End of Fortran include file for the SNES package in PETSc