xref: /petsc/src/snes/interface/snesregi.c (revision ee0de897fec99be7c10c7637bbd068d61b2ce625)
1 #ifndef lint
2 static char vcid[] = "$Id: snesregi.c,v 1.10 1995/08/22 16:33:01 bsmith Exp bsmith $";
3 #endif
4 
5 #include "snesimpl.h"     /*I  "snes.h"  I*/
6 extern int SNESCreate_LS(SNES);
7 extern int SNESCreate_TR(SNES);
8 extern int SNESCreate_UMTR(SNES);
9 extern int SNESCreate_UMLS(SNES);
10 extern int SNESCreate_Test(SNES);
11 
12 /*@C
13   SNESRegisterAll - Registers all of the nonlinear solvers in the SNES
14   package.
15 
16   Adding new methods:
17   To add a new method to the registry
18 $   1.  Copy this routine and modify it to incorporate
19 $       a call to SNESRegister() for the new method.
20 $   2.  Modify the file "PETSCDIR/include/snes.h"
21 $       by appending the method's identifier as an
22 $       enumerator of the SNESType enumeration.
23 $       As long as the enumerator is appended to
24 $       the existing list, only the SNESRegisterAll()
25 $       routine requires recompilation.
26 
27   Restricting the choices:
28   To prevent all of the methods from being registered and thus
29   save memory, copy this routine and modify it to register only
30   those methods you desire.  Make sure that the replacement routine
31   is linked before libpetscsnes.a.
32 
33 .keywords: SNES, nonlinear, register, all
34 
35 .seealso: SNESRegister(), SNESRegisterDestroy()
36 @*/
37 int SNESRegisterAll()
38 {
39   SNESRegister((int)SNES_EQ_NLS,         "ls",      SNESCreate_LS);
40   SNESRegister((int)SNES_EQ_NTR,         "tr",      SNESCreate_TR);
41   SNESRegister((int)SNES_EQ_NTEST,       "test",    SNESCreate_Test);
42   SNESRegister((int)SNES_UM_NTR,         "umtr",    SNESCreate_UMTR);
43   SNESRegister((int)SNES_UM_NLS,         "umls",    SNESCreate_UMLS);
44   return 0;
45 }
46