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); 10*b79b07cfSJed Brown EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESCreate_KSPONLY(SNES); 11fb2e594dSBarry Smith EXTERN_C_END 12eaa2832dSBarry Smith 13273b700bSMatthew Knepley const char *SNESConvergedReasons_Shifted[] = {" "," ","DIVERGED_LOCAL_MIN"," ","DIVERGED_LS_FAILURE","DIVERGED_MAX_IT", 1464075487SBarry Smith "DIVERGED_FNORM_NAN","DIVERGED_LINEAR_SOLVE","DIVERGED_FUNCTION_COUNT","DIVERGED_FUNCTION_DOMAIN", 159dcbbd2bSBarry Smith "CONVERGED_ITERATING"," ","CONVERGED_FNORM_ABS","CONVERGED_FNORM_RELATIVE", 163f149594SLisandro Dalcin "CONVERGED_PNORM_RELATIVE","CONVERGED_ITS"," ","CONVERGED_TR_DELTA","SNESConvergedReason","",0}; 179dcbbd2bSBarry Smith const char **SNESConvergedReasons = SNESConvergedReasons_Shifted + 10; 189dcbbd2bSBarry Smith 1982bf6240SBarry Smith /* 2082bf6240SBarry Smith This is used by SNESSetType() to make sure that at least one 2182bf6240SBarry Smith SNESRegisterAll() is called. In general, if there is more than one 2282bf6240SBarry Smith DLL then SNESRegisterAll() may be called several times. 2382bf6240SBarry Smith */ 244c49b128SBarry Smith extern PetscTruth SNESRegisterAllCalled; 2582bf6240SBarry Smith 264a2ae208SSatish Balay #undef __FUNCT__ 274a2ae208SSatish Balay #define __FUNCT__ "SNESRegisterAll" 2883f0b094SBarry Smith /*@C 2982bf6240SBarry Smith SNESRegisterAll - Registers all of the nonlinear solver methods in the SNES package. 30eaa2832dSBarry Smith 31fee21e36SBarry Smith Not Collective 32fee21e36SBarry Smith 3336851e7fSLois Curfman McInnes Level: advanced 3436851e7fSLois Curfman McInnes 3582bf6240SBarry Smith .keywords: SNES, register, all 36eaa2832dSBarry Smith 3782bf6240SBarry Smith .seealso: SNESRegisterDestroy() 38eaa2832dSBarry Smith @*/ 3963dd3a1aSKris Buschelman PetscErrorCode PETSCSNES_DLLEXPORT SNESRegisterAll(const char path[]) 40eaa2832dSBarry Smith { 41dfbe8321SBarry Smith PetscErrorCode ierr; 4282bf6240SBarry Smith 433a40ed3dSBarry Smith PetscFunctionBegin; 444c49b128SBarry Smith SNESRegisterAllCalled = PETSC_TRUE; 4582bf6240SBarry Smith 46*b79b07cfSJed Brown ierr = SNESRegisterDynamic(SNESLS, path,"SNESCreate_LS", SNESCreate_LS);CHKERRQ(ierr); 47*b79b07cfSJed Brown ierr = SNESRegisterDynamic(SNESTR, path,"SNESCreate_TR", SNESCreate_TR);CHKERRQ(ierr); 48*b79b07cfSJed Brown ierr = SNESRegisterDynamic(SNESTEST, path,"SNESCreate_Test", SNESCreate_Test);CHKERRQ(ierr); 49*b79b07cfSJed Brown ierr = SNESRegisterDynamic(SNESPICARD, path,"SNESCreate_Picard", SNESCreate_Picard);CHKERRQ(ierr); 50*b79b07cfSJed Brown ierr = SNESRegisterDynamic(SNESKSPONLY,path,"SNESCreate_KSPONLY",SNESCreate_KSPONLY);CHKERRQ(ierr); 5182bf6240SBarry Smith 523a40ed3dSBarry Smith PetscFunctionReturn(0); 53eaa2832dSBarry Smith } 5482bf6240SBarry Smith 55