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