xref: /petsc/src/ts/interface/tsregall.c (revision fee21e364a2af8f69c0e7984443fdef19f844ae9)
1 #ifdef PETSC_RCS_HEADER
2 static char vcid[] = "$Id: tsregall.c,v 1.14 1998/03/06 00:17:24 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    Not Collective
36 
37 .keywords: TS, timestepper, register, all
38 
39 .seealso: TSRegisterDestroy()
40 @*/
41 int TSRegisterAll(char *path)
42 {
43   PetscFunctionBegin;
44   TSRegisterAllCalled = 1;
45 
46   TSRegister(TS_EULER,      path,"TSCreate_Euler", TSCreate_Euler);
47   TSRegister(TS_BEULER,     path,"TSCreate_BEuler",TSCreate_BEuler);
48   TSRegister(TS_PSEUDO,     path,"TSCreate_Pseudo",TSCreate_Pseudo);
49 #if defined(HAVE_PVODE) && !defined(__cplusplus)
50   TSRegister(TS_PVODE,      path,"TSCreate_PVode", TSCreate_PVode);
51 #endif
52   PetscFunctionReturn(0);
53 }
54