xref: /petsc/src/snes/interface/snesregi.c (revision 7c4f633dc6bb6149cca88d301ead35a99e103cbb)
163dd3a1aSKris Buschelman #define PETSCSNES_DLL
2eaa2832dSBarry Smith 
3*7c4f633dSBarry 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);
10fb2e594dSBarry Smith EXTERN_C_END
11eaa2832dSBarry Smith 
12273b700bSMatthew Knepley const char *SNESConvergedReasons_Shifted[]  = {" "," ","DIVERGED_LOCAL_MIN"," ","DIVERGED_LS_FAILURE","DIVERGED_MAX_IT",
1364075487SBarry Smith                                                "DIVERGED_FNORM_NAN","DIVERGED_LINEAR_SOLVE","DIVERGED_FUNCTION_COUNT","DIVERGED_FUNCTION_DOMAIN",
149dcbbd2bSBarry Smith                                                "CONVERGED_ITERATING"," ","CONVERGED_FNORM_ABS","CONVERGED_FNORM_RELATIVE",
153f149594SLisandro Dalcin                                                "CONVERGED_PNORM_RELATIVE","CONVERGED_ITS"," ","CONVERGED_TR_DELTA","SNESConvergedReason","",0};
169dcbbd2bSBarry Smith const char **SNESConvergedReasons = SNESConvergedReasons_Shifted + 10;
179dcbbd2bSBarry Smith 
1882bf6240SBarry Smith /*
1982bf6240SBarry Smith       This is used by SNESSetType() to make sure that at least one
2082bf6240SBarry Smith     SNESRegisterAll() is called. In general, if there is more than one
2182bf6240SBarry Smith     DLL then SNESRegisterAll() may be called several times.
2282bf6240SBarry Smith */
234c49b128SBarry Smith extern PetscTruth SNESRegisterAllCalled;
2482bf6240SBarry Smith 
254a2ae208SSatish Balay #undef __FUNCT__
264a2ae208SSatish Balay #define __FUNCT__ "SNESRegisterAll"
2783f0b094SBarry Smith /*@C
2882bf6240SBarry Smith    SNESRegisterAll - Registers all of the nonlinear solver methods in the SNES package.
29eaa2832dSBarry Smith 
30fee21e36SBarry Smith    Not Collective
31fee21e36SBarry Smith 
3236851e7fSLois Curfman McInnes    Level: advanced
3336851e7fSLois Curfman McInnes 
3482bf6240SBarry Smith .keywords: SNES, register, all
35eaa2832dSBarry Smith 
3682bf6240SBarry Smith .seealso:  SNESRegisterDestroy()
37eaa2832dSBarry Smith @*/
3863dd3a1aSKris Buschelman PetscErrorCode PETSCSNES_DLLEXPORT SNESRegisterAll(const char path[])
39eaa2832dSBarry Smith {
40dfbe8321SBarry Smith   PetscErrorCode ierr;
4182bf6240SBarry Smith 
423a40ed3dSBarry Smith   PetscFunctionBegin;
434c49b128SBarry Smith   SNESRegisterAllCalled = PETSC_TRUE;
4482bf6240SBarry Smith 
454b27c08aSLois Curfman McInnes   ierr = SNESRegisterDynamic("ls",   path,"SNESCreate_LS",SNESCreate_LS);CHKERRQ(ierr);
464b27c08aSLois Curfman McInnes   ierr = SNESRegisterDynamic("tr",   path,"SNESCreate_TR",SNESCreate_TR);CHKERRQ(ierr);
47f1af5d2fSBarry Smith   ierr = SNESRegisterDynamic("test", path,"SNESCreate_Test", SNESCreate_Test);CHKERRQ(ierr);
4801647cb9SMatthew Knepley   ierr = SNESRegisterDynamic("picard", path,"SNESCreate_Picard",SNESCreate_Picard);CHKERRQ(ierr);
4982bf6240SBarry Smith 
503a40ed3dSBarry Smith   PetscFunctionReturn(0);
51eaa2832dSBarry Smith }
5282bf6240SBarry Smith 
53