163dd3a1aSKris Buschelman #define PETSCSNES_DLL 2eaa2832dSBarry Smith 37c4f633dSBarry Smith #include "private/snesimpl.h" /*I "petscsnes.h" I*/ 4fb2e594dSBarry Smith 5fb2e594dSBarry Smith EXTERN_C_BEGIN 663dd3a1aSKris Buschelman EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESCreate_LS(SNES); 763dd3a1aSKris Buschelman EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESCreate_TR(SNES); 863dd3a1aSKris Buschelman EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESCreate_Test(SNES); 901647cb9SMatthew Knepley EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESCreate_Picard(SNES); 10b79b07cfSJed Brown EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESCreate_KSPONLY(SNES); 11bc19aedaSShri Abhyankar #if !defined(PETSC_USE_COMPLEX) 12*2b4ed282SShri Abhyankar EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESCreate_VI(SNES); 13559ca921SShri Abhyankar #endif 14fb2e594dSBarry Smith EXTERN_C_END 15eaa2832dSBarry Smith 16647a2e1fSBarry Smith const char *SNESConvergedReasons_Shifted[] = {" "," ","DIVERGED_LOCAL_MIN"," ","DIVERGED_LINE_SEARCH","DIVERGED_MAX_IT", 1764075487SBarry Smith "DIVERGED_FNORM_NAN","DIVERGED_LINEAR_SOLVE","DIVERGED_FUNCTION_COUNT","DIVERGED_FUNCTION_DOMAIN", 189dcbbd2bSBarry Smith "CONVERGED_ITERATING"," ","CONVERGED_FNORM_ABS","CONVERGED_FNORM_RELATIVE", 193f149594SLisandro Dalcin "CONVERGED_PNORM_RELATIVE","CONVERGED_ITS"," ","CONVERGED_TR_DELTA","SNESConvergedReason","",0}; 209dcbbd2bSBarry Smith const char **SNESConvergedReasons = SNESConvergedReasons_Shifted + 10; 219dcbbd2bSBarry Smith 2282bf6240SBarry Smith /* 2382bf6240SBarry Smith This is used by SNESSetType() to make sure that at least one 2482bf6240SBarry Smith SNESRegisterAll() is called. In general, if there is more than one 2582bf6240SBarry Smith DLL then SNESRegisterAll() may be called several times. 2682bf6240SBarry Smith */ 274c49b128SBarry Smith extern PetscTruth SNESRegisterAllCalled; 2882bf6240SBarry Smith 294a2ae208SSatish Balay #undef __FUNCT__ 304a2ae208SSatish Balay #define __FUNCT__ "SNESRegisterAll" 3183f0b094SBarry Smith /*@C 3282bf6240SBarry Smith SNESRegisterAll - Registers all of the nonlinear solver methods in the SNES package. 33eaa2832dSBarry Smith 34fee21e36SBarry Smith Not Collective 35fee21e36SBarry Smith 3636851e7fSLois Curfman McInnes Level: advanced 3736851e7fSLois Curfman McInnes 3882bf6240SBarry Smith .keywords: SNES, register, all 39eaa2832dSBarry Smith 4082bf6240SBarry Smith .seealso: SNESRegisterDestroy() 41eaa2832dSBarry Smith @*/ 4263dd3a1aSKris Buschelman PetscErrorCode PETSCSNES_DLLEXPORT SNESRegisterAll(const char path[]) 43eaa2832dSBarry Smith { 44dfbe8321SBarry Smith PetscErrorCode ierr; 4582bf6240SBarry Smith 463a40ed3dSBarry Smith PetscFunctionBegin; 474c49b128SBarry Smith SNESRegisterAllCalled = PETSC_TRUE; 4882bf6240SBarry Smith 49b79b07cfSJed Brown ierr = SNESRegisterDynamic(SNESLS, path,"SNESCreate_LS", SNESCreate_LS);CHKERRQ(ierr); 50b79b07cfSJed Brown ierr = SNESRegisterDynamic(SNESTR, path,"SNESCreate_TR", SNESCreate_TR);CHKERRQ(ierr); 51b79b07cfSJed Brown ierr = SNESRegisterDynamic(SNESTEST, path,"SNESCreate_Test", SNESCreate_Test);CHKERRQ(ierr); 52b79b07cfSJed Brown ierr = SNESRegisterDynamic(SNESPICARD, path,"SNESCreate_Picard", SNESCreate_Picard);CHKERRQ(ierr); 53b79b07cfSJed Brown ierr = SNESRegisterDynamic(SNESKSPONLY,path,"SNESCreate_KSPONLY",SNESCreate_KSPONLY);CHKERRQ(ierr); 54bc19aedaSShri Abhyankar #if !defined(PETSC_USE_COMPLEX) 55*2b4ed282SShri Abhyankar ierr = SNESRegisterDynamic(SNESVI, path,"SNESCreate_VI", SNESCreate_VI);CHKERRQ(ierr); 56559ca921SShri Abhyankar #endif 573a40ed3dSBarry Smith PetscFunctionReturn(0); 58eaa2832dSBarry Smith } 5982bf6240SBarry Smith 60