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