xref: /petsc/src/snes/interface/snesregi.c (revision 5615d1e584023db9367fb782d85b1b4ebbb8df18)
1eaa2832dSBarry Smith #ifndef lint
2*5615d1e5SSatish Balay static char vcid[] = "$Id: snesregi.c,v 1.14 1996/12/16 20:46:26 balay Exp balay $";
3eaa2832dSBarry Smith #endif
4eaa2832dSBarry Smith 
570f55243SBarry Smith #include "src/snes/snesimpl.h"     /*I  "snes.h"  I*/
640191667SLois Curfman McInnes extern int SNESCreate_EQ_LS(SNES);
740191667SLois Curfman McInnes extern int SNESCreate_EQ_TR(SNES);
840191667SLois Curfman McInnes extern int SNESCreate_UM_TR(SNES);
940191667SLois Curfman McInnes extern int SNESCreate_UM_LS(SNES);
10c6abb9f5SBarry Smith extern int SNESCreate_Test(SNES);
11eaa2832dSBarry Smith 
12*5615d1e5SSatish Balay #undef __FUNC__
13*5615d1e5SSatish Balay #define __FUNC__ "SNESRegisterAll"
1483f0b094SBarry Smith /*@C
1552392280SLois Curfman McInnes   SNESRegisterAll - Registers all of the nonlinear solvers in the SNES
1652392280SLois Curfman McInnes   package.
17eaa2832dSBarry Smith 
18eaa2832dSBarry Smith   Adding new methods:
19eaa2832dSBarry Smith   To add a new method to the registry
20eaa2832dSBarry Smith $   1.  Copy this routine and modify it to incorporate
21412ae834SLois Curfman McInnes $       a call to SNESRegister() for the new method.
22412ae834SLois Curfman McInnes $   2.  Modify the file "PETSCDIR/include/snes.h"
23eaa2832dSBarry Smith $       by appending the method's identifier as an
244b0e389bSBarry Smith $       enumerator of the SNESType enumeration.
25eaa2832dSBarry Smith $       As long as the enumerator is appended to
26eaa2832dSBarry Smith $       the existing list, only the SNESRegisterAll()
27eaa2832dSBarry Smith $       routine requires recompilation.
28eaa2832dSBarry Smith 
29eaa2832dSBarry Smith   Restricting the choices:
30eaa2832dSBarry Smith   To prevent all of the methods from being registered and thus
31eaa2832dSBarry Smith   save memory, copy this routine and modify it to register only
32eaa2832dSBarry Smith   those methods you desire.  Make sure that the replacement routine
3352392280SLois Curfman McInnes   is linked before libpetscsnes.a.
34412ae834SLois Curfman McInnes 
35412ae834SLois Curfman McInnes .keywords: SNES, nonlinear, register, all
36412ae834SLois Curfman McInnes 
37412ae834SLois Curfman McInnes .seealso: SNESRegister(), SNESRegisterDestroy()
38eaa2832dSBarry Smith @*/
39eaa2832dSBarry Smith int SNESRegisterAll()
40eaa2832dSBarry Smith {
4140191667SLois Curfman McInnes   SNESRegister((int)SNES_EQ_LS,         "ls",      SNESCreate_EQ_LS);
4240191667SLois Curfman McInnes   SNESRegister((int)SNES_EQ_TR,         "tr",      SNESCreate_EQ_TR);
4340191667SLois Curfman McInnes   SNESRegister((int)SNES_EQ_TEST,       "test",    SNESCreate_Test);
4440191667SLois Curfman McInnes   SNESRegister((int)SNES_UM_TR,         "umtr",    SNESCreate_UM_TR);
4540191667SLois Curfman McInnes   SNESRegister((int)SNES_UM_LS,         "umls",    SNESCreate_UM_LS);
465e42470aSBarry Smith   return 0;
47eaa2832dSBarry Smith }
48