Actual source code: petscts.h

petsc-3.7.2 2016-06-05
Report Typos and Errors
  1: /*
  2:    User interface for the timestepping package. This package
  3:    is for use in solving time-dependent PDEs.
  4: */
  7: #include <petscsnes.h>

  9: /*S
 10:      TS - Abstract PETSc object that manages all time-steppers (ODE integrators)

 12:    Level: beginner

 14:   Concepts: ODE solvers

 16: .seealso:  TSCreate(), TSSetType(), TSType, SNES, KSP, PC, TSDestroy()
 17: S*/
 18: typedef struct _p_TS* TS;

 20: /*J
 21:     TSType - String with the name of a PETSc TS method.

 23:    Level: beginner

 25: .seealso: TSSetType(), TS, TSRegister()
 26: J*/
 27: typedef const char* TSType;
 28: #define TSEULER           "euler"
 29: #define TSBEULER          "beuler"
 30: #define TSPSEUDO          "pseudo"
 31: #define TSCN              "cn"
 32: #define TSSUNDIALS        "sundials"
 33: #define TSRK              "rk"
 34: #define TSPYTHON          "python"
 35: #define TSTHETA           "theta"
 36: #define TSALPHA           "alpha"
 37: #define TSALPHA2          "alpha2"
 38: #define TSGL              "gl"
 39: #define TSSSP             "ssp"
 40: #define TSARKIMEX         "arkimex"
 41: #define TSROSW            "rosw"
 42: #define TSEIMEX           "eimex"
 43: #define TSMIMEX           "mimex"
 44: #define TSBDF             "bdf"

 46: /*E
 47:     TSProblemType - Determines the type of problem this TS object is to be used to solve

 49:    Level: beginner

 51: .seealso: TSCreate()
 52: E*/
 53: typedef enum {TS_LINEAR,TS_NONLINEAR} TSProblemType;

 55: /*E
 56:    TSEquationType - type of TS problem that is solved

 58:    Level: beginner

 60:    Developer Notes: this must match petsc/finclude/petscts.h

 62:    Supported types are:
 63:      TS_EQ_UNSPECIFIED (default)
 64:      TS_EQ_EXPLICIT {ODE and DAE index 1, 2, 3, HI}: F(t,U,U_t) := M(t) U_t - G(U,t) = 0
 65:      TS_EQ_IMPLICIT {ODE and DAE index 1, 2, 3, HI}: F(t,U,U_t) = 0

 67: .seealso: TSGetEquationType(), TSSetEquationType()
 68: E*/
 69: typedef enum {
 70:   TS_EQ_UNSPECIFIED               = -1,
 71:   TS_EQ_EXPLICIT                  = 0,
 72:   TS_EQ_ODE_EXPLICIT              = 1,
 73:   TS_EQ_DAE_SEMI_EXPLICIT_INDEX1  = 100,
 74:   TS_EQ_DAE_SEMI_EXPLICIT_INDEX2  = 200,
 75:   TS_EQ_DAE_SEMI_EXPLICIT_INDEX3  = 300,
 76:   TS_EQ_DAE_SEMI_EXPLICIT_INDEXHI = 500,
 77:   TS_EQ_IMPLICIT                  = 1000,
 78:   TS_EQ_ODE_IMPLICIT              = 1001,
 79:   TS_EQ_DAE_IMPLICIT_INDEX1       = 1100,
 80:   TS_EQ_DAE_IMPLICIT_INDEX2       = 1200,
 81:   TS_EQ_DAE_IMPLICIT_INDEX3       = 1300,
 82:   TS_EQ_DAE_IMPLICIT_INDEXHI      = 1500
 83: } TSEquationType;
 84: PETSC_EXTERN const char *const*TSEquationTypes;

 86: /*E
 87:    TSConvergedReason - reason a TS method has converged or not

 89:    Level: beginner

 91:    Developer Notes: this must match petsc/finclude/petscts.h

 93:    Each reason has its own manual page.

 95: .seealso: TSGetConvergedReason()
 96: E*/
 97: typedef enum {
 98:   TS_CONVERGED_ITERATING      = 0,
 99:   TS_CONVERGED_TIME           = 1,
100:   TS_CONVERGED_ITS            = 2,
101:   TS_CONVERGED_USER           = 3,
102:   TS_CONVERGED_EVENT          = 4,
103:   TS_CONVERGED_PSEUDO_FATOL   = 5,
104:   TS_CONVERGED_PSEUDO_FRTOL   = 6,
105:   TS_DIVERGED_NONLINEAR_SOLVE = -1,
106:   TS_DIVERGED_STEP_REJECTED   = -2
107: } TSConvergedReason;
108: PETSC_EXTERN const char *const*TSConvergedReasons;

110: /*MC
111:    TS_CONVERGED_ITERATING - this only occurs if TSGetConvergedReason() is called during the TSSolve()

113:    Level: beginner

115: .seealso: TSSolve(), TSGetConvergedReason(), TSGetAdapt()
116: M*/

118: /*MC
119:    TS_CONVERGED_TIME - the final time was reached

121:    Level: beginner

123: .seealso: TSSolve(), TSGetConvergedReason(), TSGetAdapt(), TSSetDuration(), TSGetSolveTime()
124: M*/

126: /*MC
127:    TS_CONVERGED_ITS - the maximum number of iterations (time-steps) was reached prior to the final time

129:    Level: beginner

131: .seealso: TSSolve(), TSGetConvergedReason(), TSGetAdapt(), TSSetDuration()
132: M*/

134: /*MC
135:    TS_CONVERGED_USER - user requested termination

137:    Level: beginner

139: .seealso: TSSolve(), TSGetConvergedReason(), TSSetConvergedReason(), TSSetDuration()
140: M*/

142: /*MC
143:    TS_CONVERGED_EVENT - user requested termination on event detection

145:    Level: beginner

147: .seealso: TSSolve(), TSGetConvergedReason(), TSSetConvergedReason(), TSSetDuration()
148: M*/

150: /*MC
151:    TS_CONVERGED_PSEUDO_FRTOL - stops when function norm decreased by a set amount, used only for TSPSEUDO

153:    Level: beginner

155:    Options Database:
156: .   -ts_pseudo_frtol <rtol>

158: .seealso: TSSolve(), TSGetConvergedReason(), TSSetConvergedReason(), TSSetDuration(), TS_CONVERGED_PSEUDO_FATOL
159: M*/

161: /*MC
162:    TS_CONVERGED_PSEUDO_FATOL - stops when function norm decreases below a set amount, used only for TSPSEUDO

164:    Level: beginner

166:    Options Database:
167: .   -ts_pseudo_fatol <atol>

169: .seealso: TSSolve(), TSGetConvergedReason(), TSSetConvergedReason(), TSSetDuration(), TS_CONVERGED_PSEUDO_FRTOL
170: M*/

172: /*MC
173:    TS_DIVERGED_NONLINEAR_SOLVE - too many nonlinear solves failed

175:    Level: beginner

177:    Notes: See TSSetMaxSNESFailures() for how to allow more nonlinear solver failures.

179: .seealso: TSSolve(), TSGetConvergedReason(), TSGetAdapt(), TSGetSNES(), SNESGetConvergedReason(), TSSetMaxSNESFailures()
180: M*/

182: /*MC
183:    TS_DIVERGED_STEP_REJECTED - too many steps were rejected

185:    Level: beginner

187:    Notes: See TSSetMaxStepRejections() for how to allow more step rejections.

189: .seealso: TSSolve(), TSGetConvergedReason(), TSGetAdapt(), TSSetMaxStepRejections()
190: M*/

192: /*E
193:    TSExactFinalTimeOption - option for handling of final time step

195:    Level: beginner

197:    Developer Notes: this must match petsc/finclude/petscts.h

199: $  TS_EXACTFINALTIME_STEPOVER    - Don't do anything if final time is exceeded
200: $  TS_EXACTFINALTIME_INTERPOLATE - Interpolate back to final time
201: $  TS_EXACTFINALTIME_MATCHSTEP - Adapt final time step to match the final time

203: .seealso: TSGetConvergedReason(), TSSetExactFinalTime()

205: E*/
206: typedef enum {TS_EXACTFINALTIME_UNSPECIFIED=0,TS_EXACTFINALTIME_STEPOVER=1,TS_EXACTFINALTIME_INTERPOLATE=2,TS_EXACTFINALTIME_MATCHSTEP=3} TSExactFinalTimeOption;
207: PETSC_EXTERN const char *const TSExactFinalTimeOptions[];


210: /* Logging support */
211: PETSC_EXTERN PetscClassId TS_CLASSID;
212: PETSC_EXTERN PetscClassId DMTS_CLASSID;
213: PETSC_EXTERN PetscClassId TSADAPT_CLASSID;

215: PETSC_EXTERN PetscErrorCode TSInitializePackage(void);
216: PETSC_EXTERN PetscErrorCode TSFinalizePackage(void);

218: PETSC_EXTERN PetscErrorCode TSCreate(MPI_Comm,TS*);
219: PETSC_EXTERN PetscErrorCode TSClone(TS,TS*);
220: PETSC_EXTERN PetscErrorCode TSDestroy(TS*);

222: PETSC_EXTERN PetscErrorCode TSSetProblemType(TS,TSProblemType);
223: PETSC_EXTERN PetscErrorCode TSGetProblemType(TS,TSProblemType*);
224: PETSC_EXTERN PetscErrorCode TSMonitor(TS,PetscInt,PetscReal,Vec);
225: PETSC_EXTERN PetscErrorCode TSMonitorSet(TS,PetscErrorCode(*)(TS,PetscInt,PetscReal,Vec,void*),void *,PetscErrorCode (*)(void**));
226: PETSC_EXTERN PetscErrorCode TSMonitorSetFromOptions(TS,const char[],const char[],const char[],PetscErrorCode (*)(TS,PetscInt,PetscReal,Vec,PetscViewerAndFormat*),PetscErrorCode (*)(TS,PetscViewerAndFormat*));
227: PETSC_EXTERN PetscErrorCode TSMonitorCancel(TS);

229: PETSC_EXTERN PetscErrorCode TSAdjointMonitor(TS,PetscInt,PetscReal,Vec,PetscInt,Vec*,Vec*);
230: PETSC_EXTERN PetscErrorCode TSAdjointMonitorSet(TS,PetscErrorCode(*)(TS,PetscInt,PetscReal,Vec,PetscInt,Vec*,Vec*,void*),void *,PetscErrorCode (*)(void**));
231: PETSC_EXTERN PetscErrorCode TSAdjointMonitorCancel(TS);
232: PETSC_EXTERN PetscErrorCode TSAdjointMonitorSetFromOptions(TS,const char[],const char[],const char[],PetscErrorCode (*)(TS,PetscInt,PetscReal,Vec,PetscInt,Vec*,Vec*,PetscViewerAndFormat*),PetscErrorCode (*)(TS,PetscViewerAndFormat*));

234: PETSC_EXTERN PetscErrorCode TSSetOptionsPrefix(TS,const char[]);
235: PETSC_EXTERN PetscErrorCode TSAppendOptionsPrefix(TS,const char[]);
236: PETSC_EXTERN PetscErrorCode TSGetOptionsPrefix(TS,const char *[]);
237: PETSC_EXTERN PetscErrorCode TSSetFromOptions(TS);
238: PETSC_EXTERN PetscErrorCode TSSetUp(TS);
239: PETSC_EXTERN PetscErrorCode TSReset(TS);

241: PETSC_EXTERN PetscErrorCode TSSetSolution(TS,Vec);
242: PETSC_EXTERN PetscErrorCode TSGetSolution(TS,Vec*);

244: PETSC_EXTERN PetscErrorCode TS2SetSolution(TS,Vec,Vec);
245: PETSC_EXTERN PetscErrorCode TS2GetSolution(TS,Vec*,Vec*);

247: /*S
248:      TSTrajectory - Abstract PETSc object that storing the trajectory (solution of ODE/ADE at each time step and stage)

250:    Level: advanced

252:   Concepts: ODE solvers, adjoint

254: .seealso:  TSCreate(), TSSetType(), TSType, SNES, KSP, PC, TSDestroy()
255: S*/
256: typedef struct _p_TSTrajectory* TSTrajectory;

258: /*J
259:     TSTrajectoryType - String with the name of a PETSc TS trajectory storage method

261:    Level: intermediate

263: .seealso: TSSetType(), TS, TSRegister(), TSTrajectoryCreate(), TSTrajectorySetType()
264: J*/
265: typedef const char* TSTrajectoryType;
266: #define TSTRAJECTORYBASIC         "basic"
267: #define TSTRAJECTORYSINGLEFILE    "singlefile"
268: #define TSTRAJECTORYMEMORY        "memory"
269: #define TSTRAJECTORYVISUALIZATION "visualization"

271: PETSC_EXTERN PetscFunctionList TSTrajectoryList;
272: PETSC_EXTERN PetscClassId      TSTRAJECTORY_CLASSID;
273: PETSC_EXTERN PetscBool         TSTrajectoryRegisterAllCalled;

275: PETSC_EXTERN PetscErrorCode TSSetSaveTrajectory(TS);

277: PETSC_EXTERN PetscErrorCode TSTrajectoryCreate(MPI_Comm,TSTrajectory*);
278: PETSC_EXTERN PetscErrorCode TSTrajectoryDestroy(TSTrajectory*);
279: PETSC_EXTERN PetscErrorCode TSTrajectoryView(TSTrajectory,PetscViewer);
280: PETSC_EXTERN PetscErrorCode TSTrajectorySetType(TSTrajectory,TS,const TSTrajectoryType);
281: PETSC_EXTERN PetscErrorCode TSTrajectorySet(TSTrajectory,TS,PetscInt,PetscReal,Vec);
282: PETSC_EXTERN PetscErrorCode TSTrajectoryGet(TSTrajectory,TS,PetscInt,PetscReal*);
283: PETSC_EXTERN PetscErrorCode TSTrajectorySetFromOptions(TSTrajectory,TS);
284: PETSC_EXTERN PetscErrorCode TSTrajectoryRegister(const char[],PetscErrorCode (*)(TSTrajectory,TS));
285: PETSC_EXTERN PetscErrorCode TSTrajectoryRegisterAll(void);
286: PETSC_EXTERN PetscErrorCode TSTrajectorySetUp(TSTrajectory,TS);

288: PETSC_EXTERN PetscErrorCode TSSetCostGradients(TS,PetscInt,Vec*,Vec*);
289: PETSC_EXTERN PetscErrorCode TSGetCostGradients(TS,PetscInt*,Vec**,Vec**);
290: PETSC_EXTERN PetscErrorCode TSSetCostIntegrand(TS,PetscInt,PetscErrorCode (*)(TS,PetscReal,Vec,Vec,void*),PetscErrorCode (*)(TS,PetscReal,Vec,Vec*,void*),PetscErrorCode (*)(TS,PetscReal,Vec,Vec*,void*),PetscBool,void*);
291: PETSC_EXTERN PetscErrorCode TSGetCostIntegral(TS,Vec*);

293: PETSC_EXTERN PetscErrorCode TSAdjointSetRHSJacobian(TS,Mat,PetscErrorCode(*)(TS,PetscReal,Vec,Mat,void*),void*);
294: PETSC_EXTERN PetscErrorCode TSAdjointSolve(TS);
295: PETSC_EXTERN PetscErrorCode TSAdjointSetSteps(TS,PetscInt);

297: PETSC_EXTERN PetscErrorCode TSAdjointComputeRHSJacobian(TS,PetscReal,Vec,Mat);
298: PETSC_EXTERN PetscErrorCode TSAdjointStep(TS);
299: PETSC_EXTERN PetscErrorCode TSAdjointSetUp(TS);
300: PETSC_EXTERN PetscErrorCode TSAdjointComputeDRDPFunction(TS,PetscReal,Vec,Vec*);
301: PETSC_EXTERN PetscErrorCode TSAdjointComputeDRDYFunction(TS,PetscReal,Vec,Vec*);
302: PETSC_EXTERN PetscErrorCode TSAdjointComputeCostIntegrand(TS,PetscReal,Vec,Vec);
303: PETSC_EXTERN PetscErrorCode TSAdjointCostIntegral(TS);
304: PETSC_EXTERN PetscErrorCode TSForwardCostIntegral(TS);

306: PETSC_EXTERN PetscErrorCode TSSetDuration(TS,PetscInt,PetscReal);
307: PETSC_EXTERN PetscErrorCode TSGetDuration(TS,PetscInt*,PetscReal*);
308: PETSC_EXTERN PetscErrorCode TSSetExactFinalTime(TS,TSExactFinalTimeOption);

310: PETSC_EXTERN PetscErrorCode TSMonitorDefault(TS,PetscInt,PetscReal,Vec,PetscViewerAndFormat*);

312: typedef struct _n_TSMonitorDrawCtx*  TSMonitorDrawCtx;
313: PETSC_EXTERN PetscErrorCode TSMonitorDrawCtxCreate(MPI_Comm,const char[],const char[],int,int,int,int,PetscInt,TSMonitorDrawCtx *);
314: PETSC_EXTERN PetscErrorCode TSMonitorDrawCtxDestroy(TSMonitorDrawCtx*);
315: PETSC_EXTERN PetscErrorCode TSMonitorDrawSolution(TS,PetscInt,PetscReal,Vec,void*);
316: PETSC_EXTERN PetscErrorCode TSMonitorDrawSolutionPhase(TS,PetscInt,PetscReal,Vec,void*);
317: PETSC_EXTERN PetscErrorCode TSMonitorDrawError(TS,PetscInt,PetscReal,Vec,void*);

319: PETSC_EXTERN PetscErrorCode TSAdjointMonitorDefault(TS,PetscInt,PetscReal,Vec,PetscInt,Vec*,Vec*,PetscViewerAndFormat *);
320: PETSC_EXTERN PetscErrorCode TSAdjointMonitorDrawSensi(TS,PetscInt,PetscReal,Vec,PetscInt,Vec*,Vec*,void*);

322: PETSC_EXTERN PetscErrorCode TSMonitorSolution(TS,PetscInt,PetscReal,Vec,PetscViewerAndFormat*);
323: PETSC_EXTERN PetscErrorCode TSMonitorSolutionVTK(TS,PetscInt,PetscReal,Vec,void*);
324: PETSC_EXTERN PetscErrorCode TSMonitorSolutionVTKDestroy(void*);

326: PETSC_EXTERN PetscErrorCode TSStep(TS);
327: PETSC_EXTERN PetscErrorCode TSEvaluateWLTE(TS,NormType,PetscInt*,PetscReal*);
328: PETSC_EXTERN PetscErrorCode TSEvaluateStep(TS,PetscInt,Vec,PetscBool*);
329: PETSC_EXTERN PetscErrorCode TSSolve(TS,Vec);
330: PETSC_EXTERN PetscErrorCode TSGetEquationType(TS,TSEquationType*);
331: PETSC_EXTERN PetscErrorCode TSSetEquationType(TS,TSEquationType);
332: PETSC_EXTERN PetscErrorCode TSGetConvergedReason(TS,TSConvergedReason*);
333: PETSC_EXTERN PetscErrorCode TSSetConvergedReason(TS,TSConvergedReason);
334: PETSC_EXTERN PetscErrorCode TSGetSolveTime(TS,PetscReal*);
335: PETSC_EXTERN PetscErrorCode TSGetSNESIterations(TS,PetscInt*);
336: PETSC_EXTERN PetscErrorCode TSGetKSPIterations(TS,PetscInt*);
337: PETSC_EXTERN PetscErrorCode TSGetStepRejections(TS,PetscInt*);
338: PETSC_EXTERN PetscErrorCode TSSetMaxStepRejections(TS,PetscInt);
339: PETSC_EXTERN PetscErrorCode TSGetSNESFailures(TS,PetscInt*);
340: PETSC_EXTERN PetscErrorCode TSSetMaxSNESFailures(TS,PetscInt);
341: PETSC_EXTERN PetscErrorCode TSSetErrorIfStepFails(TS,PetscBool);
342: PETSC_EXTERN PetscErrorCode TSRollBack(TS);
343: PETSC_EXTERN PetscErrorCode TSGetTotalSteps(TS,PetscInt*);

345: PETSC_EXTERN PetscErrorCode TSGetStages(TS,PetscInt*,Vec**);

347: PETSC_EXTERN PetscErrorCode TSSetInitialTimeStep(TS,PetscReal,PetscReal);
348: PETSC_EXTERN PetscErrorCode TSGetTimeStep(TS,PetscReal*);
349: PETSC_EXTERN PetscErrorCode TSGetTime(TS,PetscReal*);
350: PETSC_EXTERN PetscErrorCode TSSetTime(TS,PetscReal);
351: PETSC_EXTERN PetscErrorCode TSGetTimeStepNumber(TS,PetscInt*);
352: PETSC_EXTERN PetscErrorCode TSSetTimeStep(TS,PetscReal);
353: PETSC_EXTERN PetscErrorCode TSGetPrevTime(TS,PetscReal*);

355: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*TSRHSFunction)(TS,PetscReal,Vec,Vec,void*);
356: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*TSRHSJacobian)(TS,PetscReal,Vec,Mat,Mat,void*);
357: PETSC_EXTERN PetscErrorCode TSSetRHSFunction(TS,Vec,TSRHSFunction,void*);
358: PETSC_EXTERN PetscErrorCode TSGetRHSFunction(TS,Vec*,TSRHSFunction*,void**);
359: PETSC_EXTERN PetscErrorCode TSSetRHSJacobian(TS,Mat,Mat,TSRHSJacobian,void*);
360: PETSC_EXTERN PetscErrorCode TSGetRHSJacobian(TS,Mat*,Mat*,TSRHSJacobian*,void**);
361: PETSC_EXTERN PetscErrorCode TSRHSJacobianSetReuse(TS,PetscBool);

363: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*TSSolutionFunction)(TS,PetscReal,Vec,void*);
364: PETSC_EXTERN PetscErrorCode TSSetSolutionFunction(TS,TSSolutionFunction,void*);
365: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*TSForcingFunction)(TS,PetscReal,Vec,void*);
366: PETSC_EXTERN PetscErrorCode TSSetForcingFunction(TS,TSForcingFunction,void*);

368: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*TSIFunction)(TS,PetscReal,Vec,Vec,Vec,void*);
369: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*TSIJacobian)(TS,PetscReal,Vec,Vec,PetscReal,Mat,Mat,void*);
370: PETSC_EXTERN PetscErrorCode TSSetIFunction(TS,Vec,TSIFunction,void*);
371: PETSC_EXTERN PetscErrorCode TSGetIFunction(TS,Vec*,TSIFunction*,void**);
372: PETSC_EXTERN PetscErrorCode TSSetIJacobian(TS,Mat,Mat,TSIJacobian,void*);
373: PETSC_EXTERN PetscErrorCode TSGetIJacobian(TS,Mat*,Mat*,TSIJacobian*,void**);

375: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*TSI2Function)(TS,PetscReal,Vec,Vec,Vec,Vec,void*);
376: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*TSI2Jacobian)(TS,PetscReal,Vec,Vec,Vec,PetscReal,PetscReal,Mat,Mat,void*);
377: PETSC_EXTERN PetscErrorCode TSSetI2Function(TS,Vec,TSI2Function,void*);
378: PETSC_EXTERN PetscErrorCode TSGetI2Function(TS,Vec*,TSI2Function*,void**);
379: PETSC_EXTERN PetscErrorCode TSSetI2Jacobian(TS,Mat,Mat,TSI2Jacobian,void*);
380: PETSC_EXTERN PetscErrorCode TSGetI2Jacobian(TS,Mat*,Mat*,TSI2Jacobian*,void**);

382: PETSC_EXTERN PetscErrorCode TSComputeRHSFunctionLinear(TS,PetscReal,Vec,Vec,void*);
383: PETSC_EXTERN PetscErrorCode TSComputeRHSJacobianConstant(TS,PetscReal,Vec,Mat,Mat,void*);
384: PETSC_EXTERN PetscErrorCode TSComputeIFunctionLinear(TS,PetscReal,Vec,Vec,Vec,void*);
385: PETSC_EXTERN PetscErrorCode TSComputeIJacobianConstant(TS,PetscReal,Vec,Vec,PetscReal,Mat,Mat,void*);
386: PETSC_EXTERN PetscErrorCode TSComputeSolutionFunction(TS,PetscReal,Vec);
387: PETSC_EXTERN PetscErrorCode TSComputeForcingFunction(TS,PetscReal,Vec);
388: PETSC_EXTERN PetscErrorCode TSComputeIJacobianDefaultColor(TS,PetscReal,Vec,Vec,PetscReal,Mat,Mat,void*);

390: PETSC_EXTERN PetscErrorCode TSSetPreStep(TS, PetscErrorCode (*)(TS));
391: PETSC_EXTERN PetscErrorCode TSSetPreStage(TS, PetscErrorCode (*)(TS,PetscReal));
392: PETSC_EXTERN PetscErrorCode TSSetPostStage(TS, PetscErrorCode (*)(TS,PetscReal,PetscInt,Vec*));
393: PETSC_EXTERN PetscErrorCode TSSetPostStep(TS, PetscErrorCode (*)(TS));
394: PETSC_EXTERN PetscErrorCode TSPreStep(TS);
395: PETSC_EXTERN PetscErrorCode TSPreStage(TS,PetscReal);
396: PETSC_EXTERN PetscErrorCode TSPostStage(TS,PetscReal,PetscInt,Vec*);
397: PETSC_EXTERN PetscErrorCode TSPostStep(TS);
398: PETSC_EXTERN PetscErrorCode TSInterpolate(TS,PetscReal,Vec);
399: PETSC_EXTERN PetscErrorCode TSSetTolerances(TS,PetscReal,Vec,PetscReal,Vec);
400: PETSC_EXTERN PetscErrorCode TSGetTolerances(TS,PetscReal*,Vec*,PetscReal*,Vec*);
401: PETSC_EXTERN PetscErrorCode TSErrorWeightedNormInfinity(TS,Vec,Vec,PetscReal*);
402: PETSC_EXTERN PetscErrorCode TSErrorWeightedNorm2(TS,Vec,Vec,PetscReal*);
403: PETSC_EXTERN PetscErrorCode TSErrorWeightedNorm(TS,Vec,Vec,NormType,PetscReal*);
404: PETSC_EXTERN PetscErrorCode TSSetCFLTimeLocal(TS,PetscReal);
405: PETSC_EXTERN PetscErrorCode TSGetCFLTime(TS,PetscReal*);
406: PETSC_EXTERN PetscErrorCode TSSetFunctionDomainError(TS, PetscErrorCode (*)(TS,PetscReal,Vec,PetscBool*));
407: PETSC_EXTERN PetscErrorCode TSFunctionDomainError(TS,PetscReal,Vec,PetscBool*);

409: PETSC_EXTERN PetscErrorCode TSPseudoSetTimeStep(TS,PetscErrorCode(*)(TS,PetscReal*,void*),void*);
410: PETSC_EXTERN PetscErrorCode TSPseudoTimeStepDefault(TS,PetscReal*,void*);
411: PETSC_EXTERN PetscErrorCode TSPseudoComputeTimeStep(TS,PetscReal *);
412: PETSC_EXTERN PetscErrorCode TSPseudoSetMaxTimeStep(TS,PetscReal);
413: PETSC_EXTERN PetscErrorCode TSPseudoSetVerifyTimeStep(TS,PetscErrorCode(*)(TS,Vec,void*,PetscReal*,PetscBool *),void*);
414: PETSC_EXTERN PetscErrorCode TSPseudoVerifyTimeStepDefault(TS,Vec,void*,PetscReal*,PetscBool *);
415: PETSC_EXTERN PetscErrorCode TSPseudoVerifyTimeStep(TS,Vec,PetscReal*,PetscBool *);
416: PETSC_EXTERN PetscErrorCode TSPseudoSetTimeStepIncrement(TS,PetscReal);
417: PETSC_EXTERN PetscErrorCode TSPseudoIncrementDtFromInitialDt(TS);

419: PETSC_EXTERN PetscErrorCode TSPythonSetType(TS,const char[]);

421: PETSC_EXTERN PetscErrorCode TSComputeRHSFunction(TS,PetscReal,Vec,Vec);
422: PETSC_EXTERN PetscErrorCode TSComputeRHSJacobian(TS,PetscReal,Vec,Mat,Mat);
423: PETSC_EXTERN PetscErrorCode TSComputeIFunction(TS,PetscReal,Vec,Vec,Vec,PetscBool);
424: PETSC_EXTERN PetscErrorCode TSComputeIJacobian(TS,PetscReal,Vec,Vec,PetscReal,Mat,Mat,PetscBool);
425: PETSC_EXTERN PetscErrorCode TSComputeI2Function(TS,PetscReal,Vec,Vec,Vec,Vec);
426: PETSC_EXTERN PetscErrorCode TSComputeI2Jacobian(TS,PetscReal,Vec,Vec,Vec,PetscReal,PetscReal,Mat,Mat);
427: PETSC_EXTERN PetscErrorCode TSComputeLinearStability(TS,PetscReal,PetscReal,PetscReal*,PetscReal*);

429: PETSC_EXTERN PetscErrorCode TSVISetVariableBounds(TS,Vec,Vec);

431: PETSC_EXTERN PetscErrorCode DMTSSetBoundaryLocal(DM, PetscErrorCode (*)(DM, PetscReal, Vec, Vec, void *), void *);
432: PETSC_EXTERN PetscErrorCode DMTSSetRHSFunction(DM,TSRHSFunction,void*);
433: PETSC_EXTERN PetscErrorCode DMTSGetRHSFunction(DM,TSRHSFunction*,void**);
434: PETSC_EXTERN PetscErrorCode DMTSSetRHSJacobian(DM,TSRHSJacobian,void*);
435: PETSC_EXTERN PetscErrorCode DMTSGetRHSJacobian(DM,TSRHSJacobian*,void**);
436: PETSC_EXTERN PetscErrorCode DMTSSetIFunction(DM,TSIFunction,void*);
437: PETSC_EXTERN PetscErrorCode DMTSGetIFunction(DM,TSIFunction*,void**);
438: PETSC_EXTERN PetscErrorCode DMTSSetIJacobian(DM,TSIJacobian,void*);
439: PETSC_EXTERN PetscErrorCode DMTSGetIJacobian(DM,TSIJacobian*,void**);
440: PETSC_EXTERN PetscErrorCode DMTSSetI2Function(DM,TSI2Function,void*);
441: PETSC_EXTERN PetscErrorCode DMTSGetI2Function(DM,TSI2Function*,void**);
442: PETSC_EXTERN PetscErrorCode DMTSSetI2Jacobian(DM,TSI2Jacobian,void*);
443: PETSC_EXTERN PetscErrorCode DMTSGetI2Jacobian(DM,TSI2Jacobian*,void**);

445: PETSC_EXTERN PetscErrorCode DMTSSetSolutionFunction(DM,TSSolutionFunction,void*);
446: PETSC_EXTERN PetscErrorCode DMTSGetSolutionFunction(DM,TSSolutionFunction*,void**);
447: PETSC_EXTERN PetscErrorCode DMTSSetForcingFunction(DM,TSForcingFunction,void*);
448: PETSC_EXTERN PetscErrorCode DMTSGetForcingFunction(DM,TSForcingFunction*,void**);
449: PETSC_EXTERN PetscErrorCode DMTSGetMinRadius(DM,PetscReal*);
450: PETSC_EXTERN PetscErrorCode DMTSSetMinRadius(DM,PetscReal);
451: PETSC_EXTERN PetscErrorCode DMTSCheckFromOptions(TS, Vec, PetscErrorCode (**)(PetscInt, PetscReal, const PetscReal[], PetscInt, PetscScalar *, void *), void **);

453: PETSC_EXTERN PetscErrorCode DMTSSetIFunctionLocal(DM,PetscErrorCode (*)(DM,PetscReal,Vec,Vec,Vec,void*),void*);
454: PETSC_EXTERN PetscErrorCode DMTSSetIJacobianLocal(DM,PetscErrorCode (*)(DM,PetscReal,Vec,Vec,PetscReal,Mat,Mat,void*),void*);
455: PETSC_EXTERN PetscErrorCode DMTSSetRHSFunctionLocal(DM,PetscErrorCode (*)(DM,PetscReal,Vec,Vec,void*),void*);

457: PETSC_EXTERN PetscErrorCode DMTSSetIFunctionSerialize(DM,PetscErrorCode (*)(void*,PetscViewer),PetscErrorCode (*)(void**,PetscViewer));
458: PETSC_EXTERN PetscErrorCode DMTSSetIJacobianSerialize(DM,PetscErrorCode (*)(void*,PetscViewer),PetscErrorCode (*)(void**,PetscViewer));

460: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*DMDATSRHSFunctionLocal)(DMDALocalInfo*,PetscReal,void*,void*,void*);
461: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*DMDATSRHSJacobianLocal)(DMDALocalInfo*,PetscReal,void*,Mat,Mat,void*);
462: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*DMDATSIFunctionLocal)(DMDALocalInfo*,PetscReal,void*,void*,void*,void*);
463: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*DMDATSIJacobianLocal)(DMDALocalInfo*,PetscReal,void*,void*,PetscReal,Mat,Mat,void*);

465: PETSC_EXTERN PetscErrorCode DMDATSSetRHSFunctionLocal(DM,InsertMode,PetscErrorCode (*)(DMDALocalInfo*,PetscReal,void*,void*,void*),void *);
466: PETSC_EXTERN PetscErrorCode DMDATSSetRHSJacobianLocal(DM,PetscErrorCode (*)(DMDALocalInfo*,PetscReal,void*,Mat,Mat,void*),void *);
467: PETSC_EXTERN PetscErrorCode DMDATSSetIFunctionLocal(DM,InsertMode,PetscErrorCode (*)(DMDALocalInfo*,PetscReal,void*,void*,void*,void*),void *);
468: PETSC_EXTERN PetscErrorCode DMDATSSetIJacobianLocal(DM,PetscErrorCode (*)(DMDALocalInfo*,PetscReal,void*,void*,PetscReal,Mat,Mat,void*),void *);

470: PETSC_EXTERN PetscErrorCode DMPlexTSGetGeometryFVM(DM,Vec*,Vec*,PetscReal*);
471: PETSC_EXTERN PetscErrorCode DMPlexTSGetGradientDM(DM,PetscFV,DM*);

473: typedef struct _n_TSMonitorLGCtx*  TSMonitorLGCtx;
474: typedef struct {
475:   Vec            ray;
476:   VecScatter     scatter;
477:   PetscViewer    viewer;
478:   TSMonitorLGCtx lgctx;
479: } TSMonitorDMDARayCtx;
480: PETSC_EXTERN PetscErrorCode TSMonitorDMDARayDestroy(void**);
481: PETSC_EXTERN PetscErrorCode TSMonitorDMDARay(TS,PetscInt,PetscReal,Vec,void*);
482: PETSC_EXTERN PetscErrorCode TSMonitorLGDMDARay(TS,PetscInt,PetscReal,Vec,void*);


485: /* Dynamic creation and loading functions */
486: PETSC_EXTERN PetscFunctionList TSList;
487: PETSC_EXTERN PetscErrorCode TSGetType(TS,TSType*);
488: PETSC_EXTERN PetscErrorCode TSSetType(TS,TSType);
489: PETSC_EXTERN PetscErrorCode TSRegister(const char[], PetscErrorCode (*)(TS));

491: PETSC_EXTERN PetscErrorCode TSGetSNES(TS,SNES*);
492: PETSC_EXTERN PetscErrorCode TSSetSNES(TS,SNES);
493: PETSC_EXTERN PetscErrorCode TSGetKSP(TS,KSP*);

495: PETSC_EXTERN PetscErrorCode TSView(TS,PetscViewer);
496: PETSC_EXTERN PetscErrorCode TSLoad(TS,PetscViewer);
497: PETSC_STATIC_INLINE PetscErrorCode TSViewFromOptions(TS A,PetscObject obj,const char name[]) {return PetscObjectViewFromOptions((PetscObject)A,obj,name);}
498: PETSC_STATIC_INLINE PetscErrorCode TSTrajectoryViewFromOptions(TSTrajectory A,PetscObject obj,const char name[]) {return PetscObjectViewFromOptions((PetscObject)A,obj,name);}

500: #define TS_FILE_CLASSID 1211225

502: PETSC_EXTERN PetscErrorCode TSSetApplicationContext(TS,void *);
503: PETSC_EXTERN PetscErrorCode TSGetApplicationContext(TS,void *);

505: PETSC_EXTERN PetscErrorCode TSMonitorLGCtxCreate(MPI_Comm,const char[],const char[],int,int,int,int,PetscInt,TSMonitorLGCtx *);
506: PETSC_EXTERN PetscErrorCode TSMonitorLGCtxDestroy(TSMonitorLGCtx*);
507: PETSC_EXTERN PetscErrorCode TSMonitorLGTimeStep(TS,PetscInt,PetscReal,Vec,void *);
508: PETSC_EXTERN PetscErrorCode TSMonitorLGSolution(TS,PetscInt,PetscReal,Vec,void *);
509: PETSC_EXTERN PetscErrorCode TSMonitorLGSetVariableNames(TS,const char * const*);
510: PETSC_EXTERN PetscErrorCode TSMonitorLGGetVariableNames(TS,const char *const **);
511: PETSC_EXTERN PetscErrorCode TSMonitorLGCtxSetVariableNames(TSMonitorLGCtx,const char * const *);
512: PETSC_EXTERN PetscErrorCode TSMonitorLGSetDisplayVariables(TS,const char * const*);
513: PETSC_EXTERN PetscErrorCode TSMonitorLGCtxSetDisplayVariables(TSMonitorLGCtx,const char * const*);
514: PETSC_EXTERN PetscErrorCode TSMonitorLGSetTransform(TS,PetscErrorCode (*)(void*,Vec,Vec*),PetscErrorCode (*)(void*),void*);
515: PETSC_EXTERN PetscErrorCode TSMonitorLGCtxSetTransform(TSMonitorLGCtx,PetscErrorCode (*)(void*,Vec,Vec*),PetscErrorCode (*)(void*),void *);
516: PETSC_EXTERN PetscErrorCode TSMonitorLGError(TS,PetscInt,PetscReal,Vec,void *);
517: PETSC_EXTERN PetscErrorCode TSMonitorLGSNESIterations(TS,PetscInt,PetscReal,Vec,void *);
518: PETSC_EXTERN PetscErrorCode TSMonitorLGKSPIterations(TS,PetscInt,PetscReal,Vec,void *);

520: typedef struct _n_TSMonitorEnvelopeCtx*  TSMonitorEnvelopeCtx;
521: PETSC_EXTERN PetscErrorCode TSMonitorEnvelopeCtxCreate(TS,TSMonitorEnvelopeCtx*);
522: PETSC_EXTERN PetscErrorCode TSMonitorEnvelope(TS,PetscInt,PetscReal,Vec,void*);
523: PETSC_EXTERN PetscErrorCode TSMonitorEnvelopeGetBounds(TS,Vec*,Vec*);
524: PETSC_EXTERN PetscErrorCode TSMonitorEnvelopeCtxDestroy(TSMonitorEnvelopeCtx*);

526: typedef struct _n_TSMonitorSPEigCtx*  TSMonitorSPEigCtx;
527: PETSC_EXTERN PetscErrorCode TSMonitorSPEigCtxCreate(MPI_Comm,const char[],const char[],int,int,int,int,PetscInt,TSMonitorSPEigCtx *);
528: PETSC_EXTERN PetscErrorCode TSMonitorSPEigCtxDestroy(TSMonitorSPEigCtx*);
529: PETSC_EXTERN PetscErrorCode TSMonitorSPEig(TS,PetscInt,PetscReal,Vec,void *);

531: PETSC_EXTERN PetscErrorCode TSSetEventHandler(TS,PetscInt,PetscInt[],PetscBool[],PetscErrorCode (*)(TS,PetscReal,Vec,PetscScalar[],void*),PetscErrorCode (*)(TS,PetscInt,PetscInt[],PetscReal,Vec,PetscBool,void*),void*);
532: PETSC_EXTERN PetscErrorCode TSSetEventTolerances(TS,PetscReal,PetscReal[]);
533: /*J
534:    TSSSPType - string with the name of TSSSP scheme.

536:    Level: beginner

538: .seealso: TSSSPSetType(), TS
539: J*/
540: typedef const char* TSSSPType;
541: #define TSSSPRKS2  "rks2"
542: #define TSSSPRKS3  "rks3"
543: #define TSSSPRK104 "rk104"

545: PETSC_EXTERN PetscErrorCode TSSSPSetType(TS,TSSSPType);
546: PETSC_EXTERN PetscErrorCode TSSSPGetType(TS,TSSSPType*);
547: PETSC_EXTERN PetscErrorCode TSSSPSetNumStages(TS,PetscInt);
548: PETSC_EXTERN PetscErrorCode TSSSPGetNumStages(TS,PetscInt*);
549: PETSC_EXTERN PetscErrorCode TSSSPInitializePackage(void);
550: PETSC_EXTERN PetscErrorCode TSSSPFinalizePackage(void);
551: PETSC_EXTERN PetscFunctionList TSSSPList;

553: /*S
554:    TSAdapt - Abstract object that manages time-step adaptivity

556:    Level: beginner

558: .seealso: TS, TSAdaptCreate(), TSAdaptType
559: S*/
560: typedef struct _p_TSAdapt *TSAdapt;

562: /*E
563:     TSAdaptType - String with the name of TSAdapt scheme.

565:    Level: beginner

567: .seealso: TSAdaptSetType(), TS
568: E*/
569: typedef const char *TSAdaptType;
570: #define TSADAPTBASIC "basic"
571: #define TSADAPTNONE  "none"
572: #define TSADAPTCFL   "cfl"

574: PETSC_EXTERN PetscErrorCode TSGetAdapt(TS,TSAdapt*);
575: PETSC_EXTERN PetscErrorCode TSAdaptRegister(const char[],PetscErrorCode (*)(TSAdapt));
576: PETSC_EXTERN PetscErrorCode TSAdaptInitializePackage(void);
577: PETSC_EXTERN PetscErrorCode TSAdaptFinalizePackage(void);
578: PETSC_EXTERN PetscErrorCode TSAdaptCreate(MPI_Comm,TSAdapt*);
579: PETSC_EXTERN PetscErrorCode TSAdaptSetType(TSAdapt,TSAdaptType);
580: PETSC_EXTERN PetscErrorCode TSAdaptSetOptionsPrefix(TSAdapt,const char[]);
581: PETSC_EXTERN PetscErrorCode TSAdaptCandidatesClear(TSAdapt);
582: PETSC_EXTERN PetscErrorCode TSAdaptCandidateAdd(TSAdapt,const char[],PetscInt,PetscInt,PetscReal,PetscReal,PetscBool);
583: PETSC_EXTERN PetscErrorCode TSAdaptCandidatesGet(TSAdapt,PetscInt*,const PetscInt**,const PetscInt**,const PetscReal**,const PetscReal**);
584: PETSC_EXTERN PetscErrorCode TSAdaptChoose(TSAdapt,TS,PetscReal,PetscInt*,PetscReal*,PetscBool*);
585: PETSC_EXTERN PetscErrorCode TSAdaptCheckStage(TSAdapt,TS,PetscReal,Vec,PetscBool*);
586: PETSC_EXTERN PetscErrorCode TSAdaptView(TSAdapt,PetscViewer);
587: PETSC_EXTERN PetscErrorCode TSAdaptLoad(TSAdapt,PetscViewer);
588: PETSC_EXTERN PetscErrorCode TSAdaptSetFromOptions(PetscOptionItems*,TSAdapt);
589: PETSC_EXTERN PetscErrorCode TSAdaptReset(TSAdapt);
590: PETSC_EXTERN PetscErrorCode TSAdaptDestroy(TSAdapt*);
591: PETSC_EXTERN PetscErrorCode TSAdaptSetMonitor(TSAdapt,PetscBool);
592: PETSC_EXTERN PetscErrorCode TSAdaptSetStepLimits(TSAdapt,PetscReal,PetscReal);
593: PETSC_EXTERN PetscErrorCode TSAdaptSetCheckStage(TSAdapt,PetscErrorCode(*)(TSAdapt,TS,PetscReal,Vec,PetscBool*));

595: PETSC_EXTERN PetscErrorCode TSAdaptBasicSetClip(TSAdapt,PetscReal,PetscReal);
596: PETSC_EXTERN PetscErrorCode TSAdaptBasicGetClip(TSAdapt,PetscReal*,PetscReal*);

598: /*S
599:    TSGLAdapt - Abstract object that manages time-step adaptivity

601:    Level: beginner

603:    Developer Notes:
604:    This functionality should be replaced by the TSAdapt.

606: .seealso: TSGL, TSGLAdaptCreate(), TSGLAdaptType
607: S*/
608: typedef struct _p_TSGLAdapt *TSGLAdapt;

610: /*J
611:     TSGLAdaptType - String with the name of TSGLAdapt scheme

613:    Level: beginner

615: .seealso: TSGLAdaptSetType(), TS
616: J*/
617: typedef const char *TSGLAdaptType;
618: #define TSGLADAPT_NONE "none"
619: #define TSGLADAPT_SIZE "size"
620: #define TSGLADAPT_BOTH "both"

622: PETSC_EXTERN PetscErrorCode TSGLAdaptRegister(const char[],PetscErrorCode (*)(TSGLAdapt));
623: PETSC_EXTERN PetscErrorCode TSGLAdaptInitializePackage(void);
624: PETSC_EXTERN PetscErrorCode TSGLAdaptFinalizePackage(void);
625: PETSC_EXTERN PetscErrorCode TSGLAdaptCreate(MPI_Comm,TSGLAdapt*);
626: PETSC_EXTERN PetscErrorCode TSGLAdaptSetType(TSGLAdapt,TSGLAdaptType);
627: PETSC_EXTERN PetscErrorCode TSGLAdaptSetOptionsPrefix(TSGLAdapt,const char[]);
628: PETSC_EXTERN PetscErrorCode TSGLAdaptChoose(TSGLAdapt,PetscInt,const PetscInt[],const PetscReal[],const PetscReal[],PetscInt,PetscReal,PetscReal,PetscInt*,PetscReal*,PetscBool *);
629: PETSC_EXTERN PetscErrorCode TSGLAdaptView(TSGLAdapt,PetscViewer);
630: PETSC_EXTERN PetscErrorCode TSGLAdaptSetFromOptions(PetscOptionItems*,TSGLAdapt);
631: PETSC_EXTERN PetscErrorCode TSGLAdaptDestroy(TSGLAdapt*);

633: /*J
634:     TSGLAcceptType - String with the name of TSGLAccept scheme

636:    Level: beginner

638: .seealso: TSGLSetAcceptType(), TS
639: J*/
640: typedef const char *TSGLAcceptType;
641: #define TSGLACCEPT_ALWAYS "always"

643: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*TSGLAcceptFunction)(TS,PetscReal,PetscReal,const PetscReal[],PetscBool *);
644: PETSC_EXTERN PetscErrorCode TSGLAcceptRegister(const char[],TSGLAcceptFunction);

646: /*J
647:   TSGLType - family of time integration method within the General Linear class

649:   Level: beginner

651: .seealso: TSGLSetType(), TSGLRegister()
652: J*/
653: typedef const char* TSGLType;
654: #define TSGL_IRKS   "irks"

656: PETSC_EXTERN PetscErrorCode TSGLRegister(const char[],PetscErrorCode(*)(TS));
657: PETSC_EXTERN PetscErrorCode TSGLInitializePackage(void);
658: PETSC_EXTERN PetscErrorCode TSGLFinalizePackage(void);
659: PETSC_EXTERN PetscErrorCode TSGLSetType(TS,TSGLType);
660: PETSC_EXTERN PetscErrorCode TSGLGetAdapt(TS,TSGLAdapt*);
661: PETSC_EXTERN PetscErrorCode TSGLSetAcceptType(TS,TSGLAcceptType);

663: /*J
664:     TSEIMEXType - String with the name of an Extrapolated IMEX method.

666:    Level: beginner

668: .seealso: TSEIMEXSetType(), TS, TSEIMEX, TSEIMEXRegister()
669: J*/
670: #define TSEIMEXType   char*

672: PETSC_EXTERN PetscErrorCode TSEIMEXSetMaxRows(TS ts,PetscInt);
673: PETSC_EXTERN PetscErrorCode TSEIMEXSetRowCol(TS ts,PetscInt,PetscInt);
674: PETSC_EXTERN PetscErrorCode TSEIMEXSetOrdAdapt(TS,PetscBool);

676: /*J
677:     TSRKType - String with the name of a Runge-Kutta method.

679:    Level: beginner

681: .seealso: TSRKSetType(), TS, TSRK, TSRKRegister()
682: J*/
683: typedef const char* TSRKType;
684: #define TSRK1FE   "1fe"
685: #define TSRK2A    "2a"
686: #define TSRK3     "3"
687: #define TSRK3BS   "3bs"
688: #define TSRK4     "4"
689: #define TSRK5F    "5f"
690: #define TSRK5DP   "5dp"
691: PETSC_EXTERN PetscErrorCode TSRKGetType(TS ts,TSRKType*);
692: PETSC_EXTERN PetscErrorCode TSRKSetType(TS ts,TSRKType);
693: PETSC_EXTERN PetscErrorCode TSRKSetFullyImplicit(TS,PetscBool);
694: PETSC_EXTERN PetscErrorCode TSRKRegister(TSRKType,PetscInt,PetscInt,const PetscReal[],const PetscReal[],const PetscReal[],const PetscReal[],PetscInt,const PetscReal[]);
695: PETSC_EXTERN PetscErrorCode TSRKInitializePackage(void);
696: PETSC_EXTERN PetscErrorCode TSRKFinalizePackage(void);
697: PETSC_EXTERN PetscErrorCode TSRKRegisterDestroy(void);

699: /*J
700:     TSARKIMEXType - String with the name of an Additive Runge-Kutta IMEX method.

702:    Level: beginner

704: .seealso: TSARKIMEXSetType(), TS, TSARKIMEX, TSARKIMEXRegister()
705: J*/
706: typedef const char* TSARKIMEXType;
707: #define TSARKIMEX1BEE   "1bee"
708: #define TSARKIMEXA2     "a2"
709: #define TSARKIMEXL2     "l2"
710: #define TSARKIMEXARS122 "ars122"
711: #define TSARKIMEX2C     "2c"
712: #define TSARKIMEX2D     "2d"
713: #define TSARKIMEX2E     "2e"
714: #define TSARKIMEXPRSSP2 "prssp2"
715: #define TSARKIMEX3      "3"
716: #define TSARKIMEXBPR3   "bpr3"
717: #define TSARKIMEXARS443 "ars443"
718: #define TSARKIMEX4      "4"
719: #define TSARKIMEX5      "5"
720: PETSC_EXTERN PetscErrorCode TSARKIMEXGetType(TS ts,TSARKIMEXType*);
721: PETSC_EXTERN PetscErrorCode TSARKIMEXSetType(TS ts,TSARKIMEXType);
722: PETSC_EXTERN PetscErrorCode TSARKIMEXSetFullyImplicit(TS,PetscBool);
723: PETSC_EXTERN PetscErrorCode TSARKIMEXRegister(TSARKIMEXType,PetscInt,PetscInt,const PetscReal[],const PetscReal[],const PetscReal[],const PetscReal[],const PetscReal[],const PetscReal[],const PetscReal[],const PetscReal[],PetscInt,const PetscReal[],const PetscReal[]);
724: PETSC_EXTERN PetscErrorCode TSARKIMEXInitializePackage(void);
725: PETSC_EXTERN PetscErrorCode TSARKIMEXFinalizePackage(void);
726: PETSC_EXTERN PetscErrorCode TSARKIMEXRegisterDestroy(void);

728: /*J
729:     TSRosWType - String with the name of a Rosenbrock-W method.

731:    Level: beginner

733: .seealso: TSRosWSetType(), TS, TSROSW, TSRosWRegister()
734: J*/
735: typedef const char* TSRosWType;
736: #define TSROSW2M          "2m"
737: #define TSROSW2P          "2p"
738: #define TSROSWRA3PW       "ra3pw"
739: #define TSROSWRA34PW2     "ra34pw2"
740: #define TSROSWRODAS3      "rodas3"
741: #define TSROSWSANDU3      "sandu3"
742: #define TSROSWASSP3P3S1C  "assp3p3s1c"
743: #define TSROSWLASSP3P4S2C "lassp3p4s2c"
744: #define TSROSWLLSSP3P4S2C "llssp3p4s2c"
745: #define TSROSWARK3        "ark3"
746: #define TSROSWTHETA1      "theta1"
747: #define TSROSWTHETA2      "theta2"
748: #define TSROSWGRK4T       "grk4t"
749: #define TSROSWSHAMP4      "shamp4"
750: #define TSROSWVELDD4      "veldd4"
751: #define TSROSW4L          "4l"

753: PETSC_EXTERN PetscErrorCode TSRosWGetType(TS ts,TSRosWType*);
754: PETSC_EXTERN PetscErrorCode TSRosWSetType(TS ts,TSRosWType);
755: PETSC_EXTERN PetscErrorCode TSRosWSetRecomputeJacobian(TS,PetscBool);
756: PETSC_EXTERN PetscErrorCode TSRosWRegister(TSRosWType,PetscInt,PetscInt,const PetscReal[],const PetscReal[],const PetscReal[],const PetscReal[],PetscInt,const PetscReal[]);
757: PETSC_EXTERN PetscErrorCode TSRosWRegisterRos4(TSRosWType,PetscReal,PetscReal,PetscReal,PetscReal,PetscReal);
758: PETSC_EXTERN PetscErrorCode TSRosWInitializePackage(void);
759: PETSC_EXTERN PetscErrorCode TSRosWFinalizePackage(void);
760: PETSC_EXTERN PetscErrorCode TSRosWRegisterDestroy(void);

762: PETSC_EXTERN PetscErrorCode TSBDFSetOrder(TS,PetscInt);
763: PETSC_EXTERN PetscErrorCode TSBDFGetOrder(TS,PetscInt*);
764: PETSC_EXTERN PetscErrorCode TSBDFUseAdapt(TS,PetscBool);

766: /*
767:        PETSc interface to Sundials
768: */
769: #ifdef PETSC_HAVE_SUNDIALS
770: typedef enum { SUNDIALS_ADAMS=1,SUNDIALS_BDF=2} TSSundialsLmmType;
771: PETSC_EXTERN const char *const TSSundialsLmmTypes[];
772: typedef enum { SUNDIALS_MODIFIED_GS = 1,SUNDIALS_CLASSICAL_GS = 2 } TSSundialsGramSchmidtType;
773: PETSC_EXTERN const char *const TSSundialsGramSchmidtTypes[];
774: PETSC_EXTERN PetscErrorCode TSSundialsSetType(TS,TSSundialsLmmType);
775: PETSC_EXTERN PetscErrorCode TSSundialsGetPC(TS,PC*);
776: PETSC_EXTERN PetscErrorCode TSSundialsSetTolerance(TS,PetscReal,PetscReal);
777: PETSC_EXTERN PetscErrorCode TSSundialsSetMinTimeStep(TS,PetscReal);
778: PETSC_EXTERN PetscErrorCode TSSundialsSetMaxTimeStep(TS,PetscReal);
779: PETSC_EXTERN PetscErrorCode TSSundialsGetIterations(TS,PetscInt *,PetscInt *);
780: PETSC_EXTERN PetscErrorCode TSSundialsSetGramSchmidtType(TS,TSSundialsGramSchmidtType);
781: PETSC_EXTERN PetscErrorCode TSSundialsSetGMRESRestart(TS,PetscInt);
782: PETSC_EXTERN PetscErrorCode TSSundialsSetLinearTolerance(TS,PetscReal);
783: PETSC_EXTERN PetscErrorCode TSSundialsMonitorInternalSteps(TS,PetscBool );
784: PETSC_EXTERN PetscErrorCode TSSundialsGetParameters(TS,PetscInt *,long*[],double*[]);
785: PETSC_EXTERN PetscErrorCode TSSundialsSetMaxl(TS,PetscInt);
786: #endif

788: PETSC_EXTERN PetscErrorCode TSThetaSetTheta(TS,PetscReal);
789: PETSC_EXTERN PetscErrorCode TSThetaGetTheta(TS,PetscReal*);
790: PETSC_EXTERN PetscErrorCode TSThetaGetEndpoint(TS,PetscBool*);
791: PETSC_EXTERN PetscErrorCode TSThetaSetEndpoint(TS,PetscBool);

793: PETSC_EXTERN PetscErrorCode TSAlphaUseAdapt(TS,PetscBool);
794: PETSC_EXTERN PetscErrorCode TSAlphaSetRadius(TS,PetscReal);
795: PETSC_EXTERN PetscErrorCode TSAlphaSetParams(TS,PetscReal,PetscReal,PetscReal);
796: PETSC_EXTERN PetscErrorCode TSAlphaGetParams(TS,PetscReal*,PetscReal*,PetscReal*);

798: PETSC_EXTERN PetscErrorCode TSAlpha2UseAdapt(TS,PetscBool);
799: PETSC_EXTERN PetscErrorCode TSAlpha2SetRadius(TS,PetscReal);
800: PETSC_EXTERN PetscErrorCode TSAlpha2SetParams(TS,PetscReal,PetscReal,PetscReal,PetscReal);
801: PETSC_EXTERN PetscErrorCode TSAlpha2GetParams(TS,PetscReal*,PetscReal*,PetscReal*,PetscReal*);

803: PETSC_EXTERN PetscErrorCode TSSetDM(TS,DM);
804: PETSC_EXTERN PetscErrorCode TSGetDM(TS,DM*);

806: PETSC_EXTERN PetscErrorCode SNESTSFormFunction(SNES,Vec,Vec,void*);
807: PETSC_EXTERN PetscErrorCode SNESTSFormJacobian(SNES,Vec,Mat,Mat,void*);

809: #endif