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); 11*18aee929SShri Abhyankar EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESCreate_LSVI(SNES); 12fb2e594dSBarry Smith EXTERN_C_END 13eaa2832dSBarry Smith 14273b700bSMatthew Knepley const char *SNESConvergedReasons_Shifted[] = {" "," ","DIVERGED_LOCAL_MIN"," ","DIVERGED_LS_FAILURE","DIVERGED_MAX_IT", 1564075487SBarry Smith "DIVERGED_FNORM_NAN","DIVERGED_LINEAR_SOLVE","DIVERGED_FUNCTION_COUNT","DIVERGED_FUNCTION_DOMAIN", 169dcbbd2bSBarry Smith "CONVERGED_ITERATING"," ","CONVERGED_FNORM_ABS","CONVERGED_FNORM_RELATIVE", 173f149594SLisandro Dalcin "CONVERGED_PNORM_RELATIVE","CONVERGED_ITS"," ","CONVERGED_TR_DELTA","SNESConvergedReason","",0}; 189dcbbd2bSBarry Smith const char **SNESConvergedReasons = SNESConvergedReasons_Shifted + 10; 199dcbbd2bSBarry Smith 2082bf6240SBarry Smith /* 2182bf6240SBarry Smith This is used by SNESSetType() to make sure that at least one 2282bf6240SBarry Smith SNESRegisterAll() is called. In general, if there is more than one 2382bf6240SBarry Smith DLL then SNESRegisterAll() may be called several times. 2482bf6240SBarry Smith */ 254c49b128SBarry Smith extern PetscTruth SNESRegisterAllCalled; 2682bf6240SBarry Smith 274a2ae208SSatish Balay #undef __FUNCT__ 284a2ae208SSatish Balay #define __FUNCT__ "SNESRegisterAll" 2983f0b094SBarry Smith /*@C 3082bf6240SBarry Smith SNESRegisterAll - Registers all of the nonlinear solver methods in the SNES package. 31eaa2832dSBarry Smith 32fee21e36SBarry Smith Not Collective 33fee21e36SBarry Smith 3436851e7fSLois Curfman McInnes Level: advanced 3536851e7fSLois Curfman McInnes 3682bf6240SBarry Smith .keywords: SNES, register, all 37eaa2832dSBarry Smith 3882bf6240SBarry Smith .seealso: SNESRegisterDestroy() 39eaa2832dSBarry Smith @*/ 4063dd3a1aSKris Buschelman PetscErrorCode PETSCSNES_DLLEXPORT SNESRegisterAll(const char path[]) 41eaa2832dSBarry Smith { 42dfbe8321SBarry Smith PetscErrorCode ierr; 4382bf6240SBarry Smith 443a40ed3dSBarry Smith PetscFunctionBegin; 454c49b128SBarry Smith SNESRegisterAllCalled = PETSC_TRUE; 4682bf6240SBarry Smith 47b79b07cfSJed Brown ierr = SNESRegisterDynamic(SNESLS, path,"SNESCreate_LS", SNESCreate_LS);CHKERRQ(ierr); 48b79b07cfSJed Brown ierr = SNESRegisterDynamic(SNESTR, path,"SNESCreate_TR", SNESCreate_TR);CHKERRQ(ierr); 49b79b07cfSJed Brown ierr = SNESRegisterDynamic(SNESTEST, path,"SNESCreate_Test", SNESCreate_Test);CHKERRQ(ierr); 50b79b07cfSJed Brown ierr = SNESRegisterDynamic(SNESPICARD, path,"SNESCreate_Picard", SNESCreate_Picard);CHKERRQ(ierr); 51b79b07cfSJed Brown ierr = SNESRegisterDynamic(SNESKSPONLY,path,"SNESCreate_KSPONLY",SNESCreate_KSPONLY);CHKERRQ(ierr); 52*18aee929SShri Abhyankar ierr = SNESRegisterDynamic(SNESLSVI, path,"SNESCreate_LSVI", SNESCreate_LSVI);CHKERRQ(ierr); 5382bf6240SBarry Smith 543a40ed3dSBarry Smith PetscFunctionReturn(0); 55eaa2832dSBarry Smith } 5682bf6240SBarry Smith 57