xref: /petsc/src/snes/interface/snesregi.c (revision eaa2832de4c8c4ee7603eea4e7d1f3cd6050bcea)
1*eaa2832dSBarry Smith #ifndef lint
2*eaa2832dSBarry Smith static char vcid[] = "$Id: nldregis.c,v 1.1 1995/03/20 00:11:19 bsmith Exp bsmith $";
3*eaa2832dSBarry Smith #endif
4*eaa2832dSBarry Smith 
5*eaa2832dSBarry Smith #include "snesimpl.h"
6*eaa2832dSBarry Smith extern int SNESNewtonLS1Create(SNES);
7*eaa2832dSBarry Smith 
8*eaa2832dSBarry Smith /*@
9*eaa2832dSBarry Smith   SNESRegisterAll - This routine registers all of the solution methods
10*eaa2832dSBarry Smith   in the SNES package.
11*eaa2832dSBarry Smith 
12*eaa2832dSBarry Smith   Notes:
13*eaa2832dSBarry Smith   Methods within the SNES package for solving systems of nonlinear
14*eaa2832dSBarry Smith   equations follow the naming convention SNES_XXXX, while methods
15*eaa2832dSBarry Smith   for solving unconstrained minimization problems (within the SUMS
16*eaa2832dSBarry Smith   component) follow the naming convention SUMS_XXXX.
17*eaa2832dSBarry Smith 
18*eaa2832dSBarry Smith   Adding new methods:
19*eaa2832dSBarry Smith   To add a new method to the registry
20*eaa2832dSBarry Smith $   1.  Copy this routine and modify it to incorporate
21*eaa2832dSBarry Smith $       a call to NLRegister() for the new method.
22*eaa2832dSBarry Smith $   2.  Modify the file "TOOLSDIR/include/snes.h"
23*eaa2832dSBarry Smith $       by appending the method's identifier as an
24*eaa2832dSBarry Smith $       enumerator of the SNESMETHOD enumeration.
25*eaa2832dSBarry Smith $       As long as the enumerator is appended to
26*eaa2832dSBarry Smith $       the existing list, only the SNESRegisterAll()
27*eaa2832dSBarry Smith $       routine requires recompilation.
28*eaa2832dSBarry Smith 
29*eaa2832dSBarry Smith   The procedure for adding new methods is currently being
30*eaa2832dSBarry Smith   revised ... stay tuned for further details.
31*eaa2832dSBarry Smith 
32*eaa2832dSBarry Smith   Restricting the choices:
33*eaa2832dSBarry Smith   To prevent all of the methods from being registered and thus
34*eaa2832dSBarry Smith   save memory, copy this routine and modify it to register only
35*eaa2832dSBarry Smith   those methods you desire.  Make sure that the replacement routine
36*eaa2832dSBarry Smith   is linked before libsnes.a .
37*eaa2832dSBarry Smith @*/
38*eaa2832dSBarry Smith int SNESRegisterAll()
39*eaa2832dSBarry Smith {
40*eaa2832dSBarry Smith    SNESRegister((int)SNES_NLS1,     "enls1",     SNESNewtonLS1Create);
41*eaa2832dSBarry Smith /*
42*eaa2832dSBarry Smith    SNESRegister((int)SNES_NTR1,     "entr1",     SNESNewtonTR1Create);
43*eaa2832dSBarry Smith    SNESRegister((int)SNES_NTR2_DOG, "entr2_dog", SNESNewtonTR2DoglegCreate);
44*eaa2832dSBarry Smith    SNESRegister((int)SNES_NTR2_LIN, "entr2_lin", SNESNewtonTR2LinearCreate);
45*eaa2832dSBarry Smith    SNESRegister((int)SNES_NBASIC,   "enbasic",   SNESNewtonBasicCreate);
46*eaa2832dSBarry Smith    SNESRegister((int)SUMS_NLS1,     "mnls1",     SUMSNewtonLS1Create);
47*eaa2832dSBarry Smith    SNESRegister((int)SUMS_NTR1,     "mntr1",     SUMSNewtonTR1Create);
48*eaa2832dSBarry Smith */
49*eaa2832dSBarry Smith }
50