xref: /petsc/src/snes/interface/snesregi.c (revision c6abb9f54bc514de0bbd2300fc0f4b686aaca525)
1eaa2832dSBarry Smith #ifndef lint
2*c6abb9f5SBarry Smith static char vcid[] = "$Id: snesregi.c,v 1.4 1995/04/17 03:11:02 curfman Exp bsmith $";
3eaa2832dSBarry Smith #endif
4eaa2832dSBarry Smith 
5eaa2832dSBarry Smith #include "snesimpl.h"
65e42470aSBarry Smith extern int SNESCreate_LS(SNES);
7fbe28522SBarry Smith extern int SNESCreate_TR(SNES);
8*c6abb9f5SBarry Smith extern int SNESCreate_Test(SNES);
9eaa2832dSBarry Smith 
10eaa2832dSBarry Smith /*@
11eaa2832dSBarry Smith   SNESRegisterAll - This routine registers all of the solution methods
12eaa2832dSBarry Smith   in the SNES package.
13eaa2832dSBarry Smith 
14eaa2832dSBarry Smith   Notes:
15eaa2832dSBarry Smith   Methods within the SNES package for solving systems of nonlinear
16eaa2832dSBarry Smith   equations follow the naming convention SNES_XXXX, while methods
17eaa2832dSBarry Smith   for solving unconstrained minimization problems (within the SUMS
18eaa2832dSBarry Smith   component) follow the naming convention SUMS_XXXX.
19eaa2832dSBarry Smith 
20eaa2832dSBarry Smith   Adding new methods:
21eaa2832dSBarry Smith   To add a new method to the registry
22eaa2832dSBarry Smith $   1.  Copy this routine and modify it to incorporate
23412ae834SLois Curfman McInnes $       a call to SNESRegister() for the new method.
24412ae834SLois Curfman McInnes $   2.  Modify the file "PETSCDIR/include/snes.h"
25eaa2832dSBarry Smith $       by appending the method's identifier as an
26eaa2832dSBarry Smith $       enumerator of the SNESMETHOD enumeration.
27eaa2832dSBarry Smith $       As long as the enumerator is appended to
28eaa2832dSBarry Smith $       the existing list, only the SNESRegisterAll()
29eaa2832dSBarry Smith $       routine requires recompilation.
30eaa2832dSBarry Smith 
31eaa2832dSBarry Smith   The procedure for adding new methods is currently being
32eaa2832dSBarry Smith   revised ... stay tuned for further details.
33eaa2832dSBarry Smith 
34eaa2832dSBarry Smith   Restricting the choices:
35eaa2832dSBarry Smith   To prevent all of the methods from being registered and thus
36eaa2832dSBarry Smith   save memory, copy this routine and modify it to register only
37eaa2832dSBarry Smith   those methods you desire.  Make sure that the replacement routine
38412ae834SLois Curfman McInnes   is linked before petsclibsnes.a .
39412ae834SLois Curfman McInnes 
40412ae834SLois Curfman McInnes .keywords: SNES, nonlinear, register, all
41412ae834SLois Curfman McInnes 
42412ae834SLois Curfman McInnes .seealso: SNESRegister(), SNESRegisterDestroy()
43eaa2832dSBarry Smith @*/
44eaa2832dSBarry Smith int SNESRegisterAll()
45eaa2832dSBarry Smith {
46fbe28522SBarry Smith    SNESRegister((int)SNES_NLS,         "ls",      SNESCreate_LS);
47fbe28522SBarry Smith    SNESRegister((int)SNES_NTR,         "tr",      SNESCreate_TR);
48*c6abb9f5SBarry Smith    SNESRegister((int)SNES_NTEST,       "test",    SNESCreate_Test);
49eaa2832dSBarry Smith /*
50fbe28522SBarry Smith    SNESRegister((int)SNES_NTR_DOG_LEG, "snes_ndog_leg", SNESCreate_DogLeg);
51eaa2832dSBarry Smith */
525e42470aSBarry Smith   return 0;
53eaa2832dSBarry Smith }
54