xref: /petsc/src/snes/interface/snesregi.c (revision 4b0e389b2accb070e9f94a7c5aef9e462c8b7c96)
1eaa2832dSBarry Smith #ifndef lint
2*4b0e389bSBarry Smith static char vcid[] = "$Id: snesregi.c,v 1.10 1995/08/22 16:33:01 bsmith Exp bsmith $";
3eaa2832dSBarry Smith #endif
4eaa2832dSBarry Smith 
5b1f0a012SBarry Smith #include "snesimpl.h"     /*I  "snes.h"  I*/
65e42470aSBarry Smith extern int SNESCreate_LS(SNES);
7fbe28522SBarry Smith extern int SNESCreate_TR(SNES);
852392280SLois Curfman McInnes extern int SNESCreate_UMTR(SNES);
952392280SLois Curfman McInnes extern int SNESCreate_UMLS(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
22*4b0e389bSBarry 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 {
3952392280SLois Curfman McInnes   SNESRegister((int)SNES_EQ_NLS,         "ls",      SNESCreate_LS);
4052392280SLois Curfman McInnes   SNESRegister((int)SNES_EQ_NTR,         "tr",      SNESCreate_TR);
4152392280SLois Curfman McInnes   SNESRegister((int)SNES_EQ_NTEST,       "test",    SNESCreate_Test);
4252392280SLois Curfman McInnes   SNESRegister((int)SNES_UM_NTR,         "umtr",    SNESCreate_UMTR);
430e6aa300SLois Curfman McInnes   SNESRegister((int)SNES_UM_NLS,         "umls",    SNESCreate_UMLS);
445e42470aSBarry Smith   return 0;
45eaa2832dSBarry Smith }
46