xref: /petsc/src/snes/interface/snesregi.c (revision 64075487abb64f282fbbbeb1cd75f6936ec16d51)
163dd3a1aSKris Buschelman #define PETSCSNES_DLL
2eaa2832dSBarry Smith 
3e090d566SSatish Balay #include "src/snes/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);
9fb2e594dSBarry Smith EXTERN_C_END
10eaa2832dSBarry Smith 
11273b700bSMatthew Knepley const char *SNESConvergedReasons_Shifted[]  = {" "," ","DIVERGED_LOCAL_MIN"," ","DIVERGED_LS_FAILURE","DIVERGED_MAX_IT",
12*64075487SBarry Smith                                                "DIVERGED_FNORM_NAN","DIVERGED_LINEAR_SOLVE","DIVERGED_FUNCTION_COUNT","DIVERGED_FUNCTION_DOMAIN",
139dcbbd2bSBarry Smith                                                "CONVERGED_ITERATING"," ","CONVERGED_FNORM_ABS","CONVERGED_FNORM_RELATIVE",
149dcbbd2bSBarry Smith                                                "CONVERGED_PNORM_RELATIVE"," "," ","CONVERGED_TR_DELTA","SNESConvergedReason","",0};
159dcbbd2bSBarry Smith const char **SNESConvergedReasons = SNESConvergedReasons_Shifted + 10;
169dcbbd2bSBarry Smith 
1782bf6240SBarry Smith /*
1882bf6240SBarry Smith       This is used by SNESSetType() to make sure that at least one
1982bf6240SBarry Smith     SNESRegisterAll() is called. In general, if there is more than one
2082bf6240SBarry Smith     DLL then SNESRegisterAll() may be called several times.
2182bf6240SBarry Smith */
224c49b128SBarry Smith extern PetscTruth SNESRegisterAllCalled;
2382bf6240SBarry Smith 
244a2ae208SSatish Balay #undef __FUNCT__
254a2ae208SSatish Balay #define __FUNCT__ "SNESRegisterAll"
2683f0b094SBarry Smith /*@C
2782bf6240SBarry Smith    SNESRegisterAll - Registers all of the nonlinear solver methods in the SNES package.
28eaa2832dSBarry Smith 
29fee21e36SBarry Smith    Not Collective
30fee21e36SBarry Smith 
3136851e7fSLois Curfman McInnes    Level: advanced
3236851e7fSLois Curfman McInnes 
3382bf6240SBarry Smith .keywords: SNES, register, all
34eaa2832dSBarry Smith 
3582bf6240SBarry Smith .seealso:  SNESRegisterDestroy()
36eaa2832dSBarry Smith @*/
3763dd3a1aSKris Buschelman PetscErrorCode PETSCSNES_DLLEXPORT SNESRegisterAll(const char path[])
38eaa2832dSBarry Smith {
39dfbe8321SBarry Smith   PetscErrorCode ierr;
4082bf6240SBarry Smith 
413a40ed3dSBarry Smith   PetscFunctionBegin;
424c49b128SBarry Smith   SNESRegisterAllCalled = PETSC_TRUE;
4382bf6240SBarry Smith 
444b27c08aSLois Curfman McInnes   ierr = SNESRegisterDynamic("ls",   path,"SNESCreate_LS",SNESCreate_LS);CHKERRQ(ierr);
454b27c08aSLois Curfman McInnes   ierr = SNESRegisterDynamic("tr",   path,"SNESCreate_TR",SNESCreate_TR);CHKERRQ(ierr);
46f1af5d2fSBarry Smith   ierr = SNESRegisterDynamic("test", path,"SNESCreate_Test", SNESCreate_Test);CHKERRQ(ierr);
4782bf6240SBarry Smith 
483a40ed3dSBarry Smith   PetscFunctionReturn(0);
49eaa2832dSBarry Smith }
5082bf6240SBarry Smith 
51