xref: /petsc/src/ts/interface/tsregall.c (revision 82bf6240e2c962f3f106f2e53a46e3db58a7d347)
1 #ifdef PETSC_RCS_HEADER
2 static char vcid[] = "$Id: tsregall.c,v 1.13 1998/01/17 17:38:11 bsmith Exp bsmith $";
3 #endif
4 
5 #include "src/ts/tsimpl.h"     /*I  "ts.h"  I*/
6 extern int TSCreate_Euler(TS);
7 extern int TSCreate_BEuler(TS);
8 extern int TSCreate_Pseudo(TS);
9 extern int TSCreate_PVode(TS);
10 
11 #if defined(USE_DYNAMIC_LIBRARIES)
12 #define TSRegister(a,b,c,d) TSRegister_Private(a,b,c,0)
13 #else
14 #define TSRegister(a,b,c,d) TSRegister_Private(a,b,c,d)
15 #endif
16 
17 #undef __FUNC__
18 #define __FUNC__ "TSRegister_Private"
19 static int TSRegister_Private(char *sname,char *path,char *name,int (*function)(TS))
20 {
21   char fullname[256];
22 
23   PetscFunctionBegin;
24   PetscStrcpy(fullname,path); PetscStrcat(fullname,":"); PetscStrcat(fullname,name);
25   DLRegister(&TSList,sname,fullname,        (int (*)(void*))function);
26   PetscFunctionReturn(0);
27 }
28 
29 #undef __FUNC__
30 #define __FUNC__ "TSRegisterAll"
31 /*@C
32   TSRegisterAll - Registers all of the timesteppers in the TS
33   package.
34 
35 .keywords: TS, timestepper, register, all
36 
37 .seealso: TSRegisterDestroy()
38 @*/
39 int TSRegisterAll(char *path)
40 {
41   PetscFunctionBegin;
42   TSRegisterAllCalled = 1;
43 
44   TSRegister(TS_EULER,      path,"TSCreate_Euler", TSCreate_Euler);
45   TSRegister(TS_BEULER,     path,"TSCreate_BEuler",TSCreate_BEuler);
46   TSRegister(TS_PSEUDO,     path,"TSCreate_Pseudo",TSCreate_Pseudo);
47 #if defined(HAVE_PVODE) && !defined(__cplusplus)
48   TSRegister(TS_PVODE,      path,"TSCreate_PVode", TSCreate_PVode);
49 #endif
50   PetscFunctionReturn(0);
51 }
52