xref: /petsc/include/petscts.h (revision df8cb225c41499038255de3240f054b567d37e2b)
1*df8cb225SBarry Smith /* $Id: ts.h,v 1.21 1998/01/14 02:47:08 bsmith Exp bsmith $ */
2818ad0c1SBarry Smith /*
3f64a0f93SLois Curfman McInnes    User interface for the timestepping package. This is package
4f64a0f93SLois Curfman McInnes    is for use in solving time-dependent PDEs.
5818ad0c1SBarry Smith */
66d84be18SBarry Smith #if !defined(__TS_PACKAGE)
76d84be18SBarry Smith #define __TS_PACKAGE
86d84be18SBarry Smith #include "snes.h"
9818ad0c1SBarry Smith 
10f09e8eb9SSatish Balay typedef struct _p_TS* TS;
116d84be18SBarry Smith #define TS_COOKIE PETSC_COOKIE+18
12818ad0c1SBarry Smith 
13*df8cb225SBarry Smith typedef enum { TS_UNKNOWN = -1,TS_EULER, TS_BEULER, TS_PSEUDO, TS_PVODE, TS_NEW} TSType;
1419bcc07fSBarry Smith typedef enum { TS_LINEAR, TS_NONLINEAR} TSProblemType;
15818ad0c1SBarry Smith 
166d84be18SBarry Smith extern int TSCreate(MPI_Comm,TSProblemType,TS*);
176d84be18SBarry Smith extern int TSSetType(TS,TSType);
18d4bb536fSBarry Smith extern int TSGetProblemType(TS,TSProblemType*);
196d84be18SBarry Smith extern int TSDestroy(TS);
20818ad0c1SBarry Smith 
2121c89e3eSBarry Smith extern int TSSetMonitor(TS,int(*)(TS,int,double,Vec,void*),void *);
226d84be18SBarry Smith extern int TSGetType(TS,TSType*,char**);
23818ad0c1SBarry Smith 
24d4bb536fSBarry Smith extern int TSSetOptionsPrefix(TS, char *);
25d4bb536fSBarry Smith extern int TSAppendOptionsPrefix(TS, char *);
26d4bb536fSBarry Smith extern int TSGetOptionsPrefix(TS, char **);
276d84be18SBarry Smith extern int TSSetFromOptions(TS);
286d84be18SBarry Smith extern int TSSetUp(TS);
29818ad0c1SBarry Smith 
306d84be18SBarry Smith extern int TSSetSolution(TS,Vec);
316d84be18SBarry Smith extern int TSGetSolution(TS,Vec*);
32818ad0c1SBarry Smith 
3321c89e3eSBarry Smith extern int TSSetDuration(TS,int,double);
346d84be18SBarry Smith extern int TSPrintHelp(TS);
35818ad0c1SBarry Smith 
3621c89e3eSBarry Smith extern int TSDefaultMonitor(TS,int,double,Vec,void*);
3721c89e3eSBarry Smith extern int TSStep(TS,int *,double*);
38818ad0c1SBarry Smith 
39c3e30b67SBarry Smith extern int TSSetInitialTimeStep(TS,double,double);
40c3e30b67SBarry Smith extern int TSGetTimeStep(TS,double*);
41d4bb536fSBarry Smith extern int TSGetTime(TS,double*);
4221c89e3eSBarry Smith extern int TSGetTimeStepNumber(TS,int*);
43c3e30b67SBarry Smith extern int TSSetTimeStep(TS,double);
44818ad0c1SBarry Smith 
4521c89e3eSBarry Smith extern int TSSetRHSFunction(TS,int (*)(TS,double,Vec,Vec,void*),void*);
46c3e30b67SBarry Smith extern int TSSetRHSMatrix(TS,Mat,Mat,int (*)(TS,double,Mat*,Mat*,MatStructure*,void*),void*);
47c3e30b67SBarry Smith extern int TSSetRHSJacobian(TS,Mat,Mat,int(*)(TS,double,Vec,Mat*,Mat*,MatStructure*,void*),void*);
48818ad0c1SBarry Smith 
49e34be4c2SBarry Smith extern int TSDefaultComputeJacobianWithColoring(TS,double,Vec,Mat*,Mat*,MatStructure*,void*);
50453b9e1bSBarry Smith extern int TSSetRHSJacobianDefault(TS,MatFDColoring,Mat,Mat);
51453b9e1bSBarry Smith extern int TSDefaultComputeJacobianSlow(TS,double,Vec,Mat*,Mat*,MatStructure*,void*);
52e34be4c2SBarry Smith 
53d4bb536fSBarry Smith extern int TSGetRHSMatrix(TS,Mat*,Mat*,void**);
54d4bb536fSBarry Smith extern int TSGetRHSJacobian(TS,Mat*,Mat*,void**);
55d4bb536fSBarry Smith 
56d8345c25SBarry Smith extern int TSPseudoSetTimeStep(TS,int(*)(TS,double*,void*),void*);
57d8345c25SBarry Smith extern int TSPseudoDefaultTimeStep(TS,double*,void* );
58d8345c25SBarry Smith extern int TSPseudoComputeTimeStep(TS,double *);
59d8345c25SBarry Smith 
60d8345c25SBarry Smith extern int TSPseudoSetVerifyTimeStep(TS,int(*)(TS,Vec,void*,double*,int*),void*);
61d8345c25SBarry Smith extern int TSPseudoDefaultVerifyTimeStep(TS,Vec,void*,double*,int*);
62d8345c25SBarry Smith extern int TSPseudoVerifyTimeStep(TS,Vec,double*,int*);
63bc223fc0SBarry Smith extern int TSPseudoSetTimeStepIncrement(TS,double);
640513a670SBarry Smith extern int TSPseudoIncrementDtFromInitialDt(TS);
6521c89e3eSBarry Smith 
66c3e30b67SBarry Smith extern int TSComputeRHSFunction(TS,double,Vec,Vec);
67818ad0c1SBarry Smith 
686d84be18SBarry Smith extern int TSRegisterAll();
6984cb2905SBarry Smith extern int TSRegisterDestroy();
7084cb2905SBarry Smith extern int TSRegisterAllCalled;
71*df8cb225SBarry Smith extern int TSRegister_Private(TSType,char *,char *,int (*)(TS),TSType*);
72*df8cb225SBarry Smith #if defined(USE_DYNAMIC_LIBRARIES)
73*df8cb225SBarry Smith #define    TSRegister(a,b,c,d,e)  TSRegister_Private(a,b,c,0,e)
74*df8cb225SBarry Smith #else
75*df8cb225SBarry Smith #define    TSRegister(a,b,c,d,e)  TSRegister_Private(a,b,c,d,e)
76*df8cb225SBarry Smith #endif
77818ad0c1SBarry Smith 
786d84be18SBarry Smith extern int TSGetSNES(TS,SNES*);
796d84be18SBarry Smith extern int TSGetSLES(TS,SLES*);
80818ad0c1SBarry Smith 
81c3e30b67SBarry Smith extern int TSView(TS,Viewer);
8221c89e3eSBarry Smith 
8321c89e3eSBarry Smith extern int TSSetApplicationContext(TS,void *);
8421c89e3eSBarry Smith extern int TSGetApplicationContext(TS,void **);
8521c89e3eSBarry Smith 
863914022bSBarry Smith extern int TSLGMonitorCreate(char *,char *,int,int,int,int, DrawLG *);
873914022bSBarry Smith extern int TSLGMonitor(TS,int,double,Vec,void *);
883914022bSBarry Smith extern int TSLGMonitorDestroy(DrawLG);
893914022bSBarry Smith 
9083e2fdc7SBarry Smith /*
9183e2fdc7SBarry Smith        PETSc interface to PVode
9283e2fdc7SBarry Smith */
93453b9e1bSBarry Smith typedef enum { PVODE_ADAMS, PVODE_BDF } TSPVodeType;
94453b9e1bSBarry Smith extern int TSPVodeSetType(TS,TSPVodeType);
9583e2fdc7SBarry Smith extern int TSPVodeGetPC(TS,PC*);
9690e6f1a8SBarry Smith extern int TSPVodeSetTolerance(TS,double,double);
9776be9ce4SBarry Smith typedef enum { PVODE_MODIFIED_GS = 0, PVODE_CLASSICAL_GS = 1 } TSPVodeGramSchmidtType;
9876be9ce4SBarry Smith #define PVODE_UNMODIFIED_GS PVODE_CLASSICAL_GS
9976be9ce4SBarry Smith extern int TSPVodeSetGramSchmidtType(TS,TSPVodeGramSchmidtType);
10076be9ce4SBarry Smith extern int TSPVodeSetGMRESRestart(TS,int);
101*df8cb225SBarry Smith extern int TSPVodeSetLinearTolerance(TS,double);
10283e2fdc7SBarry Smith 
103818ad0c1SBarry Smith #endif
104818ad0c1SBarry Smith 
10521c89e3eSBarry Smith 
10621c89e3eSBarry Smith 
10721c89e3eSBarry Smith 
10821c89e3eSBarry Smith 
109