xref: /petsc/src/snes/interface/snesregi.c (revision 70f55243aafb320636e2a54ff30cab5d1e8d3d7b)
1eaa2832dSBarry Smith #ifndef lint
2*70f55243SBarry Smith static char vcid[] = "$Id: snesregi.c,v 1.12 1996/03/26 00:11:24 curfman Exp bsmith $";
3eaa2832dSBarry Smith #endif
4eaa2832dSBarry Smith 
5*70f55243SBarry 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 
1283f0b094SBarry Smith /*@C
1352392280SLois Curfman McInnes   SNESRegisterAll - Registers all of the nonlinear solvers in the SNES
1452392280SLois Curfman McInnes   package.
15eaa2832dSBarry Smith 
16eaa2832dSBarry Smith   Adding new methods:
17eaa2832dSBarry Smith   To add a new method to the registry
18eaa2832dSBarry Smith $   1.  Copy this routine and modify it to incorporate
19412ae834SLois Curfman McInnes $       a call to SNESRegister() for the new method.
20412ae834SLois Curfman McInnes $   2.  Modify the file "PETSCDIR/include/snes.h"
21eaa2832dSBarry Smith $       by appending the method's identifier as an
224b0e389bSBarry Smith $       enumerator of the SNESType enumeration.
23eaa2832dSBarry Smith $       As long as the enumerator is appended to
24eaa2832dSBarry Smith $       the existing list, only the SNESRegisterAll()
25eaa2832dSBarry Smith $       routine requires recompilation.
26eaa2832dSBarry Smith 
27eaa2832dSBarry Smith   Restricting the choices:
28eaa2832dSBarry Smith   To prevent all of the methods from being registered and thus
29eaa2832dSBarry Smith   save memory, copy this routine and modify it to register only
30eaa2832dSBarry Smith   those methods you desire.  Make sure that the replacement routine
3152392280SLois Curfman McInnes   is linked before libpetscsnes.a.
32412ae834SLois Curfman McInnes 
33412ae834SLois Curfman McInnes .keywords: SNES, nonlinear, register, all
34412ae834SLois Curfman McInnes 
35412ae834SLois Curfman McInnes .seealso: SNESRegister(), SNESRegisterDestroy()
36eaa2832dSBarry Smith @*/
37eaa2832dSBarry Smith int SNESRegisterAll()
38eaa2832dSBarry Smith {
3940191667SLois Curfman McInnes   SNESRegister((int)SNES_EQ_LS,         "ls",      SNESCreate_EQ_LS);
4040191667SLois Curfman McInnes   SNESRegister((int)SNES_EQ_TR,         "tr",      SNESCreate_EQ_TR);
4140191667SLois Curfman McInnes   SNESRegister((int)SNES_EQ_TEST,       "test",    SNESCreate_Test);
4240191667SLois Curfman McInnes   SNESRegister((int)SNES_UM_TR,         "umtr",    SNESCreate_UM_TR);
4340191667SLois Curfman McInnes   SNESRegister((int)SNES_UM_LS,         "umls",    SNESCreate_UM_LS);
445e42470aSBarry Smith   return 0;
45eaa2832dSBarry Smith }
46