Actual source code: petscts.h

  1: /*
  2:    User interface for the timestepping package. This package
  3:    is for use in solving time-dependent PDEs.
  4: */
  5: #pragma once

  7: #include <petscsnes.h>
  8: #include <petscconvest.h>

 10: /*I <petscts.h> I*/

 12: /* SUBMANSEC = TS */

 14: /*S
 15:    TS - Abstract PETSc object that manages integrating an ODE.

 17:    Level: beginner

 19: .seealso: [](integrator_table), [](ch_ts), `TSCreate()`, `TSSetType()`, `TSType`, `SNES`, `KSP`, `PC`, `TSDestroy()`
 20: S*/
 21: typedef struct _p_TS *TS;

 23: /*J
 24:    TSType - String with the name of a PETSc `TS` method. These are all the time/ODE integrators that PETSc provides.

 26:    Level: beginner

 28:    Note:
 29:    Use `TSSetType()` or the options database key `-ts_type` to set the ODE integrator method to use with a given `TS` object

 31: .seealso: [](integrator_table), [](ch_ts), `TSSetType()`, `TS`, `TSRegister()`
 32: J*/
 33: typedef const char *TSType;
 34: #define TSEULER           "euler"
 35: #define TSBEULER          "beuler"
 36: #define TSBASICSYMPLECTIC "basicsymplectic"
 37: #define TSPSEUDO          "pseudo"
 38: #define TSCN              "cn"
 39: #define TSSUNDIALS        "sundials"
 40: #define TSRK              "rk"
 41: #define TSPYTHON          "python"
 42: #define TSTHETA           "theta"
 43: #define TSALPHA           "alpha"
 44: #define TSALPHA2          "alpha2"
 45: #define TSGLLE            "glle"
 46: #define TSGLEE            "glee"
 47: #define TSSSP             "ssp"
 48: #define TSARKIMEX         "arkimex"
 49: #define TSROSW            "rosw"
 50: #define TSEIMEX           "eimex"
 51: #define TSMIMEX           "mimex"
 52: #define TSBDF             "bdf"
 53: #define TSRADAU5          "radau5"
 54: #define TSMPRK            "mprk"
 55: #define TSDISCGRAD        "discgrad"
 56: #define TSIRK             "irk"
 57: #define TSDIRK            "dirk"

 59: /*E
 60:    TSProblemType - Determines the type of problem this `TS` object is to be used to solve

 62:    Values:
 63:  + `TS_LINEAR`    - a linear ODE or DAE
 64:  - `TS_NONLINEAR` - a nonlinear ODE or DAE

 66:    Level: beginner

 68: .seealso: [](ch_ts), `TS`, `TSCreate()`
 69: E*/
 70: typedef enum {
 71:   TS_LINEAR,
 72:   TS_NONLINEAR
 73: } TSProblemType;

 75: /*E
 76:    TSEquationType - type of `TS` problem that is solved

 78:    Values:
 79: +  `TS_EQ_UNSPECIFIED` - (default)
 80: .  `TS_EQ_EXPLICIT`    - {ODE and DAE index 1, 2, 3, HI} F(t,U,U_t) := M(t) U_t - G(U,t) = 0
 81: -  `TS_EQ_IMPLICIT`    - {ODE and DAE index 1, 2, 3, HI} F(t,U,U_t) = 0

 83:    Level: beginner

 85: .seealso: [](ch_ts), `TS`, `TSGetEquationType()`, `TSSetEquationType()`
 86: E*/
 87: typedef enum {
 88:   TS_EQ_UNSPECIFIED               = -1,
 89:   TS_EQ_EXPLICIT                  = 0,
 90:   TS_EQ_ODE_EXPLICIT              = 1,
 91:   TS_EQ_DAE_SEMI_EXPLICIT_INDEX1  = 100,
 92:   TS_EQ_DAE_SEMI_EXPLICIT_INDEX2  = 200,
 93:   TS_EQ_DAE_SEMI_EXPLICIT_INDEX3  = 300,
 94:   TS_EQ_DAE_SEMI_EXPLICIT_INDEXHI = 500,
 95:   TS_EQ_IMPLICIT                  = 1000,
 96:   TS_EQ_ODE_IMPLICIT              = 1001,
 97:   TS_EQ_DAE_IMPLICIT_INDEX1       = 1100,
 98:   TS_EQ_DAE_IMPLICIT_INDEX2       = 1200,
 99:   TS_EQ_DAE_IMPLICIT_INDEX3       = 1300,
100:   TS_EQ_DAE_IMPLICIT_INDEXHI      = 1500
101: } TSEquationType;
102: PETSC_EXTERN const char *const *TSEquationTypes;

104: /*E
105:    TSConvergedReason - reason a `TS` method has converged (integrated to the requested time) or not

107:    Values:
108: +  `TS_CONVERGED_ITERATING`          - this only occurs if `TSGetConvergedReason()` is called during the `TSSolve()`
109: .  `TS_CONVERGED_TIME`               - the final time was reached
110: .  `TS_CONVERGED_ITS`                - the maximum number of iterations (time-steps) was reached prior to the final time
111: .  `TS_CONVERGED_USER`               - user requested termination
112: .  `TS_CONVERGED_EVENT`              - user requested termination on event detection
113: .  `TS_CONVERGED_PSEUDO_FATOL`       - stops when function norm decreased by a set amount, used only for `TSPSEUDO`
114: .  `TS_CONVERGED_PSEUDO_FRTOL`       - stops when function norm decreases below a set amount, used only for `TSPSEUDO`
115: .  `TS_DIVERGED_NONLINEAR_SOLVE`     - too many nonlinear solve failures have occurred
116: .  `TS_DIVERGED_STEP_REJECTED`       - too many steps were rejected
117: .  `TSFORWARD_DIVERGED_LINEAR_SOLVE` - tangent linear solve failed
118: -  `TSADJOINT_DIVERGED_LINEAR_SOLVE` - transposed linear solve failed

120:    Level: beginner

122: .seealso: [](ch_ts), `TS`, `TSGetConvergedReason()`
123: E*/
124: typedef enum {
125:   TS_CONVERGED_ITERATING          = 0,
126:   TS_CONVERGED_TIME               = 1,
127:   TS_CONVERGED_ITS                = 2,
128:   TS_CONVERGED_USER               = 3,
129:   TS_CONVERGED_EVENT              = 4,
130:   TS_CONVERGED_PSEUDO_FATOL       = 5,
131:   TS_CONVERGED_PSEUDO_FRTOL       = 6,
132:   TS_DIVERGED_NONLINEAR_SOLVE     = -1,
133:   TS_DIVERGED_STEP_REJECTED       = -2,
134:   TSFORWARD_DIVERGED_LINEAR_SOLVE = -3,
135:   TSADJOINT_DIVERGED_LINEAR_SOLVE = -4
136: } TSConvergedReason;
137: PETSC_EXTERN const char *const *TSConvergedReasons;

139: /*MC
140:    TS_CONVERGED_ITERATING - this only occurs if `TSGetConvergedReason()` is called during the `TSSolve()`

142:    Level: beginner

144: .seealso: [](ch_ts), `TS`, `TSSolve()`, `TSGetConvergedReason()`, `TSGetAdapt()`
145: M*/

147: /*MC
148:    TS_CONVERGED_TIME - the final time was reached

150:    Level: beginner

152: .seealso: [](ch_ts), `TS`, `TSSolve()`, `TSGetConvergedReason()`, `TSGetAdapt()`, `TSSetMaxTime()`, `TSGetMaxTime()`, `TSGetSolveTime()`
153: M*/

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

158:    Level: beginner

160: .seealso: [](ch_ts), `TS`, `TSSolve()`, `TSGetConvergedReason()`, `TSGetAdapt()`, `TSSetMaxSteps()`, `TSGetMaxSteps()`
161: M*/

163: /*MC
164:    TS_CONVERGED_USER - user requested termination

166:    Level: beginner

168: .seealso: [](ch_ts), `TS`, `TSSolve()`, `TSGetConvergedReason()`, `TSSetConvergedReason()`
169: M*/

171: /*MC
172:    TS_CONVERGED_EVENT - user requested termination on event detection

174:    Level: beginner

176: .seealso: [](ch_ts), `TS`, `TSSolve()`, `TSGetConvergedReason()`, `TSSetConvergedReason()`
177: M*/

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

182:    Options Database Key:
183: .   -ts_pseudo_frtol rtol - use specified rtol

185:    Level: beginner

187: .seealso: [](ch_ts), `TS`, `TSSolve()`, `TSGetConvergedReason()`, `TSSetConvergedReason()`, `TS_CONVERGED_PSEUDO_FATOL`
188: M*/

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

193:    Options Database Key:
194: .   -ts_pseudo_fatol atol - use specified atol

196:    Level: beginner

198: .seealso: [](ch_ts), `TS`, `TSSolve()`, `TSGetConvergedReason()`, `TSSetConvergedReason()`, `TS_CONVERGED_PSEUDO_FRTOL`
199: M*/

201: /*MC
202:    TS_DIVERGED_NONLINEAR_SOLVE - too many nonlinear solves failed

204:    Level: beginner

206:    Note:
207:    See `TSSetMaxSNESFailures()` for how to allow more nonlinear solver failures.

209: .seealso: [](ch_ts), `TS`, `TSSolve()`, `TSGetConvergedReason()`, `TSGetAdapt()`, `TSGetSNES()`, `SNESGetConvergedReason()`, `TSSetMaxSNESFailures()`
210: M*/

212: /*MC
213:    TS_DIVERGED_STEP_REJECTED - too many steps were rejected

215:    Level: beginner

217:    Notes:
218:    See `TSSetMaxStepRejections()` for how to allow more step rejections.

220: .seealso: [](ch_ts), `TS`, `TSSolve()`, `TSGetConvergedReason()`, `TSGetAdapt()`, `TSSetMaxStepRejections()`
221: M*/

223: /*E
224:    TSExactFinalTimeOption - option for handling of final time step

226:    Values:
227: +  `TS_EXACTFINALTIME_STEPOVER`    - Don't do anything if requested final time is exceeded
228: .  `TS_EXACTFINALTIME_INTERPOLATE` - Interpolate back to final time
229: -  `TS_EXACTFINALTIME_MATCHSTEP`   - Adapt final time step to match the final time requested

231:    Level: beginner

233: .seealso: [](ch_ts), `TS`, `TSGetConvergedReason()`, `TSSetExactFinalTime()`, `TSGetExactFinalTime()`
234: E*/
235: typedef enum {
236:   TS_EXACTFINALTIME_UNSPECIFIED = 0,
237:   TS_EXACTFINALTIME_STEPOVER    = 1,
238:   TS_EXACTFINALTIME_INTERPOLATE = 2,
239:   TS_EXACTFINALTIME_MATCHSTEP   = 3
240: } TSExactFinalTimeOption;
241: PETSC_EXTERN const char *const TSExactFinalTimeOptions[];

243: /* Logging support */
244: PETSC_EXTERN PetscClassId TS_CLASSID;
245: PETSC_EXTERN PetscClassId DMTS_CLASSID;
246: PETSC_EXTERN PetscClassId TSADAPT_CLASSID;

248: PETSC_EXTERN PetscErrorCode TSInitializePackage(void);
249: PETSC_EXTERN PetscErrorCode TSFinalizePackage(void);

251: PETSC_EXTERN PetscErrorCode TSCreate(MPI_Comm, TS *);
252: PETSC_EXTERN PetscErrorCode TSClone(TS, TS *);
253: PETSC_EXTERN PetscErrorCode TSDestroy(TS *);

255: PETSC_EXTERN PetscErrorCode TSSetProblemType(TS, TSProblemType);
256: PETSC_EXTERN PetscErrorCode TSGetProblemType(TS, TSProblemType *);
257: PETSC_EXTERN PetscErrorCode TSMonitor(TS, PetscInt, PetscReal, Vec);
258: PETSC_EXTERN PetscErrorCode TSMonitorSet(TS, PetscErrorCode (*)(TS, PetscInt, PetscReal, Vec, PetscCtx), PetscCtx, PetscCtxDestroyFn *);
259: PETSC_EXTERN PetscErrorCode TSMonitorSetFromOptions(TS, const char[], const char[], const char[], PetscErrorCode (*)(TS, PetscInt, PetscReal, Vec, PetscViewerAndFormat *), PetscErrorCode (*)(TS, PetscViewerAndFormat *));
260: PETSC_EXTERN PetscErrorCode TSMonitorCancel(TS);

262: PETSC_EXTERN PetscErrorCode TSSetOptionsPrefix(TS, const char[]);
263: PETSC_EXTERN PetscErrorCode TSAppendOptionsPrefix(TS, const char[]);
264: PETSC_EXTERN PetscErrorCode TSGetOptionsPrefix(TS, const char *[]);
265: PETSC_EXTERN PetscErrorCode TSSetFromOptions(TS);
266: PETSC_EXTERN PetscErrorCode TSSetUp(TS);
267: PETSC_EXTERN PetscErrorCode TSReset(TS);

269: PETSC_EXTERN PetscErrorCode TSSetSolution(TS, Vec);
270: PETSC_EXTERN PetscErrorCode TSGetSolution(TS, Vec *);

272: PETSC_EXTERN PetscErrorCode TS2SetSolution(TS, Vec, Vec);
273: PETSC_EXTERN PetscErrorCode TS2GetSolution(TS, Vec *, Vec *);

275: PETSC_EXTERN PetscErrorCode TSGetSolutionComponents(TS, PetscInt *, Vec *);
276: PETSC_EXTERN PetscErrorCode TSGetAuxSolution(TS, Vec *);
277: PETSC_EXTERN PetscErrorCode TSGetTimeError(TS, PetscInt, Vec *);
278: PETSC_EXTERN PetscErrorCode TSSetTimeError(TS, Vec);

280: PETSC_EXTERN PetscErrorCode TSSetRHSJacobianP(TS, Mat, PetscErrorCode (*)(TS, PetscReal, Vec, Mat, PetscCtx), PetscCtx);
281: PETSC_EXTERN PetscErrorCode TSGetRHSJacobianP(TS, Mat *, PetscErrorCode (**)(TS, PetscReal, Vec, Mat, PetscCtx), PetscCtxRt);
282: PETSC_EXTERN PetscErrorCode TSComputeRHSJacobianP(TS, PetscReal, Vec, Mat);
283: PETSC_EXTERN PetscErrorCode TSSetIJacobianP(TS, Mat, PetscErrorCode (*)(TS, PetscReal, Vec, Vec, PetscReal, Mat, PetscCtx), PetscCtx);
284: PETSC_EXTERN PetscErrorCode TSGetIJacobianP(TS, Mat *, PetscErrorCode (**)(TS, PetscReal, Vec, Vec, PetscReal, Mat, PetscCtx), PetscCtxRt);
285: PETSC_EXTERN PetscErrorCode TSComputeIJacobianP(TS, PetscReal, Vec, Vec, PetscReal, Mat, PetscBool);
286: PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 5, 0, "TSGetQuadratureTS() then TSComputeRHSJacobianP()", ) PetscErrorCode TSComputeDRDPFunction(TS, PetscReal, Vec, Vec *);
287: PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 5, 0, "TSGetQuadratureTS() then TSComputeRHSJacobian()", ) PetscErrorCode TSComputeDRDUFunction(TS, PetscReal, Vec, Vec *);
288: PETSC_EXTERN PetscErrorCode TSSetIHessianProduct(TS, Vec *, PetscErrorCode (*)(TS, PetscReal, Vec, Vec *, Vec, Vec *, PetscCtx), Vec *, PetscErrorCode (*)(TS, PetscReal, Vec, Vec *, Vec, Vec *, PetscCtx), Vec *, PetscErrorCode (*)(TS, PetscReal, Vec, Vec *, Vec, Vec *, PetscCtx), Vec *, PetscErrorCode (*)(TS, PetscReal, Vec, Vec *, Vec, Vec *, PetscCtx), PetscCtx);
289: PETSC_EXTERN PetscErrorCode TSComputeIHessianProductFunctionUU(TS, PetscReal, Vec, Vec[], Vec, Vec[]);
290: PETSC_EXTERN PetscErrorCode TSComputeIHessianProductFunctionUP(TS, PetscReal, Vec, Vec[], Vec, Vec[]);
291: PETSC_EXTERN PetscErrorCode TSComputeIHessianProductFunctionPU(TS, PetscReal, Vec, Vec[], Vec, Vec[]);
292: PETSC_EXTERN PetscErrorCode TSComputeIHessianProductFunctionPP(TS, PetscReal, Vec, Vec[], Vec, Vec[]);
293: PETSC_EXTERN PetscErrorCode TSSetRHSHessianProduct(TS, Vec[], PetscErrorCode (*)(TS, PetscReal, Vec, Vec *, Vec, Vec *, PetscCtx), Vec[], PetscErrorCode (*)(TS, PetscReal, Vec, Vec *, Vec, Vec *, PetscCtx), Vec[], PetscErrorCode (*)(TS, PetscReal, Vec, Vec *, Vec, Vec *, PetscCtx), Vec[], PetscErrorCode (*)(TS, PetscReal, Vec, Vec *, Vec, Vec *, PetscCtx), PetscCtx);
294: PETSC_EXTERN PetscErrorCode TSComputeRHSHessianProductFunctionUU(TS, PetscReal, Vec, Vec[], Vec, Vec[]);
295: PETSC_EXTERN PetscErrorCode TSComputeRHSHessianProductFunctionUP(TS, PetscReal, Vec, Vec[], Vec, Vec[]);
296: PETSC_EXTERN PetscErrorCode TSComputeRHSHessianProductFunctionPU(TS, PetscReal, Vec, Vec[], Vec, Vec[]);
297: PETSC_EXTERN PetscErrorCode TSComputeRHSHessianProductFunctionPP(TS, PetscReal, Vec, Vec[], Vec, Vec[]);
298: PETSC_EXTERN PetscErrorCode TSSetCostHessianProducts(TS, PetscInt, Vec[], Vec[], Vec);
299: PETSC_EXTERN PetscErrorCode TSGetCostHessianProducts(TS, PetscInt *, Vec *[], Vec *[], Vec *);
300: PETSC_EXTERN PetscErrorCode TSComputeSNESJacobian(TS, Vec, Mat, Mat);

302: /*S
303:    TSTrajectory - Abstract PETSc object that stores the trajectory (solution of ODE/DAE at each time step)

305:    Level: advanced

307: .seealso: [](ch_ts), `TS`, `TSSetSaveTrajectory()`, `TSTrajectoryCreate()`, `TSTrajectorySetType()`, `TSTrajectoryDestroy()`, `TSTrajectoryReset()`
308: S*/
309: typedef struct _p_TSTrajectory *TSTrajectory;

311: /*J
312:    TSTrajectoryType - String with the name of a PETSc `TS` trajectory storage method

314:    Level: intermediate

316: .seealso: [](ch_ts), `TS`, `TSSetSaveTrajectory()`, `TSTrajectoryCreate()`, `TSTrajectoryDestroy()`
317: J*/
318: typedef const char *TSTrajectoryType;
319: #define TSTRAJECTORYBASIC         "basic"
320: #define TSTRAJECTORYSINGLEFILE    "singlefile"
321: #define TSTRAJECTORYMEMORY        "memory"
322: #define TSTRAJECTORYVISUALIZATION "visualization"

324: PETSC_EXTERN PetscFunctionList TSTrajectoryList;
325: PETSC_EXTERN PetscClassId      TSTRAJECTORY_CLASSID;
326: PETSC_EXTERN PetscBool         TSTrajectoryRegisterAllCalled;

328: PETSC_EXTERN PetscErrorCode TSSetSaveTrajectory(TS);
329: PETSC_EXTERN PetscErrorCode TSResetTrajectory(TS);
330: PETSC_EXTERN PetscErrorCode TSRemoveTrajectory(TS);

332: PETSC_EXTERN PetscErrorCode TSTrajectoryCreate(MPI_Comm, TSTrajectory *);
333: PETSC_EXTERN PetscErrorCode TSTrajectoryReset(TSTrajectory);
334: PETSC_EXTERN PetscErrorCode TSTrajectoryDestroy(TSTrajectory *);
335: PETSC_EXTERN PetscErrorCode TSTrajectoryView(TSTrajectory, PetscViewer);
336: PETSC_EXTERN PetscErrorCode TSTrajectorySetType(TSTrajectory, TS, TSTrajectoryType);
337: PETSC_EXTERN PetscErrorCode TSTrajectoryGetType(TSTrajectory, TS, TSTrajectoryType *);
338: PETSC_EXTERN PetscErrorCode TSTrajectorySet(TSTrajectory, TS, PetscInt, PetscReal, Vec);
339: PETSC_EXTERN PetscErrorCode TSTrajectoryGet(TSTrajectory, TS, PetscInt, PetscReal *);
340: PETSC_EXTERN PetscErrorCode TSTrajectoryGetVecs(TSTrajectory, TS, PetscInt, PetscReal *, Vec, Vec);
341: PETSC_EXTERN PetscErrorCode TSTrajectoryGetUpdatedHistoryVecs(TSTrajectory, TS, PetscReal, Vec *, Vec *);
342: PETSC_EXTERN PetscErrorCode TSTrajectoryGetNumSteps(TSTrajectory, PetscInt *);
343: PETSC_EXTERN PetscErrorCode TSTrajectoryRestoreUpdatedHistoryVecs(TSTrajectory, Vec *, Vec *);
344: PETSC_EXTERN PetscErrorCode TSTrajectorySetFromOptions(TSTrajectory, TS);
345: PETSC_EXTERN PetscErrorCode TSTrajectoryRegister(const char[], PetscErrorCode (*)(TSTrajectory, TS));
346: PETSC_EXTERN PetscErrorCode TSTrajectoryRegisterAll(void);
347: PETSC_EXTERN PetscErrorCode TSTrajectorySetUp(TSTrajectory, TS);
348: PETSC_EXTERN PetscErrorCode TSTrajectorySetUseHistory(TSTrajectory, PetscBool);
349: PETSC_EXTERN PetscErrorCode TSTrajectorySetMonitor(TSTrajectory, PetscBool);
350: PETSC_EXTERN PetscErrorCode TSTrajectorySetVariableNames(TSTrajectory, const char *const *);
351: PETSC_EXTERN PetscErrorCode TSTrajectorySetTransform(TSTrajectory, PetscErrorCode (*)(PetscCtx, Vec, Vec *), PetscCtxDestroyFn *, PetscCtx);
352: PETSC_EXTERN PetscErrorCode TSTrajectorySetSolutionOnly(TSTrajectory, PetscBool);
353: PETSC_EXTERN PetscErrorCode TSTrajectoryGetSolutionOnly(TSTrajectory, PetscBool *);
354: PETSC_EXTERN PetscErrorCode TSTrajectorySetKeepFiles(TSTrajectory, PetscBool);
355: PETSC_EXTERN PetscErrorCode TSTrajectorySetDirname(TSTrajectory, const char[]);
356: PETSC_EXTERN PetscErrorCode TSTrajectorySetFiletemplate(TSTrajectory, const char[]);
357: PETSC_EXTERN PetscErrorCode TSGetTrajectory(TS, TSTrajectory *);

359: /*E
360:    TSTrajectoryMemoryType - Selects the in-memory checkpointing scheme used by `TSTRAJECTORYMEMORY` to store the forward states needed for an adjoint or sensitivity computation

362:    Values:
363: +   `TJ_REVOLVE` - the Revolve binomial checkpointing schedule of Griewank & Walther
364: .   `TJ_CAMS`    - the CAMS (cache-aware multistage) checkpointing schedule
365: -   `TJ_PETSC`   - PETSc's own in-memory checkpointing implementation

367:    Level: advanced

369: .seealso: `TSTrajectory`, `TSTRAJECTORYMEMORY`, `TSTrajectoryMemorySetType()`, `TSSetSaveTrajectory()`
370: E*/
371: typedef enum {
372:   TJ_REVOLVE,
373:   TJ_CAMS,
374:   TJ_PETSC
375: } TSTrajectoryMemoryType;
376: PETSC_EXTERN const char *const TSTrajectoryMemoryTypes[];

378: PETSC_EXTERN PetscErrorCode TSTrajectoryMemorySetType(TSTrajectory, TSTrajectoryMemoryType);
379: PETSC_EXTERN PetscErrorCode TSTrajectorySetMaxCpsRAM(TSTrajectory, PetscInt);
380: PETSC_EXTERN PetscErrorCode TSTrajectorySetMaxCpsDisk(TSTrajectory, PetscInt);
381: PETSC_EXTERN PetscErrorCode TSTrajectorySetMaxUnitsRAM(TSTrajectory, PetscInt);
382: PETSC_EXTERN PetscErrorCode TSTrajectorySetMaxUnitsDisk(TSTrajectory, PetscInt);

384: PETSC_EXTERN PetscErrorCode TSSetCostGradients(TS, PetscInt, Vec[], Vec[]);
385: PETSC_EXTERN PetscErrorCode TSGetCostGradients(TS, PetscInt *, Vec *[], Vec *[]);
386: PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 12, 0, "TSCreateQuadratureTS() and TSForwardSetSensitivities()", ) PetscErrorCode TSSetCostIntegrand(TS, PetscInt, Vec, PetscErrorCode (*)(TS, PetscReal, Vec, Vec, PetscCtx), PetscErrorCode (*)(TS, PetscReal, Vec, Vec *, PetscCtx), PetscErrorCode (*)(TS, PetscReal, Vec, Vec *, PetscCtx), PetscBool, PetscCtx);
387: PETSC_EXTERN PetscErrorCode TSGetCostIntegral(TS, Vec *);
388: PETSC_EXTERN PetscErrorCode TSComputeCostIntegrand(TS, PetscReal, Vec, Vec);
389: PETSC_EXTERN PetscErrorCode TSCreateQuadratureTS(TS, PetscBool, TS *);
390: PETSC_EXTERN PetscErrorCode TSGetQuadratureTS(TS, PetscBool *, TS *);

392: PETSC_EXTERN PetscErrorCode TSAdjointSetFromOptions(TS, PetscOptionItems);
393: PETSC_EXTERN PetscErrorCode TSAdjointMonitor(TS, PetscInt, PetscReal, Vec, PetscInt, Vec[], Vec[]);
394: PETSC_EXTERN PetscErrorCode TSAdjointMonitorSet(TS, PetscErrorCode (*)(TS, PetscInt, PetscReal, Vec, PetscInt, Vec *, Vec *, PetscCtx), PetscCtx, PetscCtxDestroyFn *);
395: PETSC_EXTERN PetscErrorCode TSAdjointMonitorCancel(TS);
396: PETSC_EXTERN PetscErrorCode TSAdjointMonitorSetFromOptions(TS, const char[], const char[], const char[], PetscErrorCode (*)(TS, PetscInt, PetscReal, Vec, PetscInt, Vec *, Vec *, PetscViewerAndFormat *), PetscErrorCode (*)(TS, PetscViewerAndFormat *));

398: PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 5, 0, "TSSetRHSJacobianP()", ) PetscErrorCode TSAdjointSetRHSJacobian(TS, Mat, PetscErrorCode (*)(TS, PetscReal, Vec, Mat, PetscCtx), PetscCtx);
399: PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 5, 0, "TSComputeRHSJacobianP()", ) PetscErrorCode TSAdjointComputeRHSJacobian(TS, PetscReal, Vec, Mat);
400: PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 5, 0, "TSGetQuadratureTS()", ) PetscErrorCode TSAdjointComputeDRDPFunction(TS, PetscReal, Vec, Vec *);
401: PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 5, 0, "TSGetQuadratureTS()", ) PetscErrorCode TSAdjointComputeDRDYFunction(TS, PetscReal, Vec, Vec *);
402: PETSC_EXTERN PetscErrorCode TSAdjointSolve(TS);
403: PETSC_EXTERN PetscErrorCode TSAdjointSetSteps(TS, PetscInt);

405: PETSC_EXTERN PetscErrorCode TSAdjointStep(TS);
406: PETSC_EXTERN PetscErrorCode TSAdjointSetUp(TS);
407: PETSC_EXTERN PetscErrorCode TSAdjointReset(TS);
408: PETSC_EXTERN PetscErrorCode TSAdjointCostIntegral(TS);
409: PETSC_EXTERN PetscErrorCode TSAdjointSetForward(TS, Mat);
410: PETSC_EXTERN PetscErrorCode TSAdjointResetForward(TS);

412: PETSC_EXTERN PetscErrorCode TSForwardSetSensitivities(TS, PetscInt, Mat);
413: PETSC_EXTERN PetscErrorCode TSForwardGetSensitivities(TS, PetscInt *, Mat *);
414: PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 12, 0, "TSCreateQuadratureTS()", ) PetscErrorCode TSForwardSetIntegralGradients(TS, PetscInt, Vec[]);
415: PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 12, 0, "TSForwardGetSensitivities()", ) PetscErrorCode TSForwardGetIntegralGradients(TS, PetscInt *, Vec *[]);
416: PETSC_EXTERN PetscErrorCode TSForwardSetUp(TS);
417: PETSC_EXTERN PetscErrorCode TSForwardReset(TS);
418: PETSC_EXTERN PetscErrorCode TSForwardCostIntegral(TS);
419: PETSC_EXTERN PetscErrorCode TSForwardStep(TS);
420: PETSC_EXTERN PetscErrorCode TSForwardSetInitialSensitivities(TS, Mat);
421: PETSC_EXTERN PetscErrorCode TSForwardGetStages(TS, PetscInt *, Mat *[]);

423: PETSC_EXTERN PetscErrorCode TSSetMaxSteps(TS, PetscInt);
424: PETSC_EXTERN PetscErrorCode TSGetMaxSteps(TS, PetscInt *);
425: PETSC_EXTERN PetscErrorCode TSSetRunSteps(TS, PetscInt);
426: PETSC_EXTERN PetscErrorCode TSGetRunSteps(TS, PetscInt *);
427: PETSC_EXTERN PetscErrorCode TSSetMaxTime(TS, PetscReal);
428: PETSC_EXTERN PetscErrorCode TSGetMaxTime(TS, PetscReal *);
429: PETSC_EXTERN PetscErrorCode TSSetExactFinalTime(TS, TSExactFinalTimeOption);
430: PETSC_EXTERN PetscErrorCode TSGetExactFinalTime(TS, TSExactFinalTimeOption *);
431: PETSC_EXTERN PetscErrorCode TSSetEvaluationTimes(TS, PetscInt, PetscReal[]);
432: PETSC_EXTERN PetscErrorCode TSGetEvaluationTimes(TS, PetscInt *, const PetscReal *[]);
433: PETSC_EXTERN PetscErrorCode TSGetEvaluationSolutions(TS, PetscInt *, const PetscReal *[], Vec *[]);
434: PETSC_EXTERN PetscErrorCode TSSetTimeSpan(TS, PetscInt, PetscReal[]);

436: /*@C
437:   TSGetTimeSpan - gets the time span set with `TSSetTimeSpan()`

439:   Not Collective

441:   Input Parameter:
442: . ts - the time-stepper

444:   Output Parameters:
445: + n          - number of the time points (>=2)
446: - span_times - array of the time points. The first element and the last element are the initial time and the final time respectively.

448:   Level: deprecated

450:   Note:
451:   Deprecated, use `TSGetEvaluationTimes()`.

453:   The values obtained are valid until the `TS` object is destroyed.

455:   Both `n` and `span_times` can be `NULL`.

457: .seealso: [](ch_ts), `TS`, `TSGetEvaluationTimes()`, `TSSetTimeSpan()`, `TSSetEvaluationTimes()`, `TSGetEvaluationSolutions()`
458:  @*/
459: PETSC_DEPRECATED_FUNCTION(3, 23, 0, "TSGetEvaluationTimes()", ) static inline PetscErrorCode TSGetTimeSpan(TS ts, PetscInt *n, const PetscReal *span_times[])
460: {
461:   return TSGetEvaluationTimes(ts, n, span_times);
462: }

464: /*@C
465:   TSGetTimeSpanSolutions - Get the number of solutions and the solutions at the time points specified by the time span.

467:   Input Parameter:
468: . ts - the `TS` context obtained from `TSCreate()`

470:   Output Parameters:
471: + nsol - the number of solutions
472: - Sols - the solution vectors

474:   Level: deprecated

476:   Notes:
477:   Deprecated, use `TSGetEvaluationSolutions()`.

479:   Both `nsol` and `Sols` can be `NULL`.

481:   Some time points in the time span may be skipped by `TS` so that `nsol` is less than the number of points specified by `TSSetTimeSpan()`.
482:   For example, manipulating the step size, especially with a reduced precision, may cause `TS` to step over certain points in the span.
483:   This issue is alleviated in `TSGetEvaluationSolutions()` by returning the solution times that `Sols` were recorded at.

485: .seealso: [](ch_ts), `TS`, `TSGetEvaluationSolutions()`, `TSSetTimeSpan()`, `TSGetEvaluationTimes()`, `TSSetEvaluationTimes()`
486:  @*/
487: PETSC_DEPRECATED_FUNCTION(3, 23, 0, "TSGetEvaluationSolutions()", ) static inline PetscErrorCode TSGetTimeSpanSolutions(TS ts, PetscInt *nsol, Vec **Sols)
488: {
489:   return TSGetEvaluationSolutions(ts, nsol, NULL, Sols);
490: }

492: PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 8, 0, "TSSetTime()", ) PetscErrorCode TSSetInitialTimeStep(TS, PetscReal, PetscReal);
493: PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 8, 0, "TSSetMax()", ) PetscErrorCode TSSetDuration(TS, PetscInt, PetscReal);
494: PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 8, 0, "TSGetMax()", ) PetscErrorCode TSGetDuration(TS, PetscInt *, PetscReal *);
495: PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 8, 0, "TSGetStepNumber()", ) PetscErrorCode TSGetTimeStepNumber(TS, PetscInt *);
496: PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 8, 0, "TSGetStepNumber()", ) PetscErrorCode TSGetTotalSteps(TS, PetscInt *);

498: PETSC_EXTERN PetscErrorCode TSMonitorDefault(TS, PetscInt, PetscReal, Vec, PetscViewerAndFormat *);
499: PETSC_EXTERN PetscErrorCode TSMonitorWallClockTime(TS, PetscInt, PetscReal, Vec, PetscViewerAndFormat *);
500: PETSC_EXTERN PetscErrorCode TSMonitorWallClockTimeSetUp(TS, PetscViewerAndFormat *);
501: PETSC_EXTERN PetscErrorCode TSMonitorExtreme(TS, PetscInt, PetscReal, Vec, PetscViewerAndFormat *);

503: /*S
504:   TSMonitorDrawCtx - Context object for the `TS` graphical monitor routines that draw the solution, phase plot or error using a `PetscDraw`

506:   Level: developer

508: .seealso: `TS`, `TSMonitorDrawCtxCreate()`, `TSMonitorDrawCtxDestroy()`, `TSMonitorDrawSolution()`, `TSMonitorDrawSolutionPhase()`, `TSMonitorDrawError()`, `TSMonitorDrawSolutionFunction()`
509: S*/
510: typedef struct _n_TSMonitorDrawCtx *TSMonitorDrawCtx;
511: PETSC_EXTERN PetscErrorCode         TSMonitorDrawCtxCreate(MPI_Comm, const char[], const char[], int, int, int, int, PetscInt, TSMonitorDrawCtx *);
512: PETSC_EXTERN PetscErrorCode         TSMonitorDrawCtxDestroy(TSMonitorDrawCtx *);
513: PETSC_EXTERN PetscErrorCode         TSMonitorDrawSolution(TS, PetscInt, PetscReal, Vec, PetscCtx);
514: PETSC_EXTERN PetscErrorCode         TSMonitorDrawSolutionPhase(TS, PetscInt, PetscReal, Vec, PetscCtx);
515: PETSC_EXTERN PetscErrorCode         TSMonitorDrawError(TS, PetscInt, PetscReal, Vec, PetscCtx);
516: PETSC_EXTERN PetscErrorCode         TSMonitorDrawSolutionFunction(TS, PetscInt, PetscReal, Vec, PetscCtx);

518: PETSC_EXTERN PetscErrorCode TSAdjointMonitorDefault(TS, PetscInt, PetscReal, Vec, PetscInt, Vec[], Vec[], PetscViewerAndFormat *);
519: PETSC_EXTERN PetscErrorCode TSAdjointMonitorDrawSensi(TS, PetscInt, PetscReal, Vec, PetscInt, Vec[], Vec[], PetscCtx);

521: /*S
522:   TSMonitorSolutionCtx - Context object for the `TS` `TSMonitorSolution()` monitor that views the solution at each time step using a `PetscViewer`

524:   Level: developer

526: .seealso: `TS`, `TSMonitorSet()`, `TSMonitorSolution()`, `TSMonitorSolutionSetup()`
527: S*/
528: typedef struct _n_TSMonitorSolutionCtx *TSMonitorSolutionCtx;
529: PETSC_EXTERN PetscErrorCode             TSMonitorSolution(TS, PetscInt, PetscReal, Vec, PetscViewerAndFormat *);
530: PETSC_EXTERN PetscErrorCode             TSMonitorSolutionSetup(TS, PetscViewerAndFormat *);

532: /*S
533:   TSMonitorVTKCtx - Context object for the `TS` `TSMonitorSolutionVTK()` monitor that dumps the solution to VTK files at each time step

535:   Level: developer

537: .seealso: `TS`, `TSMonitorSet()`, `TSMonitorSolutionVTK()`, `TSMonitorSolutionVTKCtxCreate()`, `TSMonitorSolutionVTKDestroy()`
538: S*/
539: typedef struct _n_TSMonitorVTKCtx *TSMonitorVTKCtx;
540: PETSC_EXTERN PetscErrorCode        TSMonitorSolutionVTK(TS, PetscInt, PetscReal, Vec, TSMonitorVTKCtx);
541: PETSC_EXTERN PetscErrorCode        TSMonitorSolutionVTKDestroy(TSMonitorVTKCtx *);
542: PETSC_EXTERN PetscErrorCode        TSMonitorSolutionVTKCtxCreate(const char *, TSMonitorVTKCtx *);

544: PETSC_EXTERN PetscErrorCode TSStep(TS);
545: PETSC_EXTERN PetscErrorCode TSEvaluateWLTE(TS, NormType, PetscInt *, PetscReal *);
546: PETSC_EXTERN PetscErrorCode TSEvaluateStep(TS, PetscInt, Vec, PetscBool *);
547: PETSC_EXTERN PetscErrorCode TSSolve(TS, Vec);
548: PETSC_EXTERN PetscErrorCode TSGetEquationType(TS, TSEquationType *);
549: PETSC_EXTERN PetscErrorCode TSSetEquationType(TS, TSEquationType);
550: PETSC_EXTERN PetscErrorCode TSGetConvergedReason(TS, TSConvergedReason *);
551: PETSC_EXTERN PetscErrorCode TSSetConvergedReason(TS, TSConvergedReason);
552: PETSC_EXTERN PetscErrorCode TSGetSolveTime(TS, PetscReal *);
553: PETSC_EXTERN PetscErrorCode TSGetSNESIterations(TS, PetscInt *);
554: PETSC_EXTERN PetscErrorCode TSGetKSPIterations(TS, PetscInt *);
555: PETSC_EXTERN PetscErrorCode TSGetStepRejections(TS, PetscInt *);
556: PETSC_EXTERN PetscErrorCode TSSetMaxStepRejections(TS, PetscInt);
557: PETSC_EXTERN PetscErrorCode TSGetSNESFailures(TS, PetscInt *);
558: PETSC_EXTERN PetscErrorCode TSSetMaxSNESFailures(TS, PetscInt);
559: PETSC_EXTERN PetscErrorCode TSSetErrorIfStepFails(TS, PetscBool);
560: PETSC_EXTERN PetscErrorCode TSRestartStep(TS);
561: PETSC_EXTERN PetscErrorCode TSRollBack(TS);
562: PETSC_EXTERN PetscErrorCode TSGetStepRollBack(TS, PetscBool *);

564: PETSC_EXTERN PetscErrorCode TSGetStages(TS, PetscInt *, Vec *[]);

566: PETSC_EXTERN PetscErrorCode TSGetTime(TS, PetscReal *);
567: PETSC_EXTERN PetscErrorCode TSSetTime(TS, PetscReal);
568: PETSC_EXTERN PetscErrorCode TSGetPrevTime(TS, PetscReal *);
569: PETSC_EXTERN PetscErrorCode TSGetTimeStep(TS, PetscReal *);
570: PETSC_EXTERN PetscErrorCode TSSetTimeStep(TS, PetscReal);
571: PETSC_EXTERN PetscErrorCode TSGetStepNumber(TS, PetscInt *);
572: PETSC_EXTERN PetscErrorCode TSSetStepNumber(TS, PetscInt);

574: /*S
575:   TSRHSFunctionFn - A prototype of a `TS` right-hand-side evaluation function that would be passed to `TSSetRHSFunction()`

577:   Calling Sequence:
578: + ts  - timestep context
579: . t   - current time
580: . u   - input vector
581: . F   - function vector
582: - ctx - [optional] user-defined function context

584:   Level: beginner

586:   Note:
587:   The deprecated `TSRHSFunction` still works as a replacement for `TSRHSFunctionFn` *.

589: .seealso: [](ch_ts), `TS`, `TSSetRHSFunction()`, `DMTSSetRHSFunction()`, `TSIFunctionFn`,
590: `TSIJacobianFn`, `TSRHSJacobianFn`
591: S*/
592: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode TSRHSFunctionFn(TS ts, PetscReal t, Vec u, Vec F, PetscCtx ctx);

594: PETSC_EXTERN_TYPEDEF typedef TSRHSFunctionFn *TSRHSFunction;

596: /*S
597:   TSRHSJacobianFn - A prototype of a `TS` right-hand-side Jacobian evaluation function that would be passed to `TSSetRHSJacobian()`

599:   Calling Sequence:
600: + ts   - the `TS` context obtained from `TSCreate()`
601: . t    - current time
602: . u    - input vector
603: . Amat - (approximate) Jacobian matrix
604: . Pmat - matrix from which preconditioner is to be constructed (usually the same as `Amat`)
605: - ctx  - [optional] user-defined context for matrix evaluation routine

607:   Level: beginner

609:   Note:
610:   The deprecated `TSRHSJacobian` still works as a replacement for `TSRHSJacobianFn` *.

612: .seealso: [](ch_ts), `TS`, `TSSetRHSJacobian()`, `DMTSSetRHSJacobian()`, `TSRHSFunctionFn`,
613: `TSIFunctionFn`, `TSIJacobianFn`
614: S*/
615: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode TSRHSJacobianFn(TS ts, PetscReal t, Vec u, Mat Amat, Mat Pmat, PetscCtx ctx);

617: PETSC_EXTERN_TYPEDEF typedef TSRHSJacobianFn *TSRHSJacobian;

619: /*S
620:   TSRHSJacobianPFn - A prototype of a function that computes the Jacobian of G w.r.t. the parameters P where
621:   U_t = G(U,P,t), as well as the location to store the matrix that would be passed to `TSSetRHSJacobianP()`

623:   Calling Sequence:
624: + ts  - the `TS` context
625: . t   - current timestep
626: . U   - input vector (current ODE solution)
627: . A   - output matrix
628: - ctx - [optional] user-defined function context

630:   Level: beginner

632:   Note:
633:   The deprecated `TSRHSJacobianP` still works as a replacement for `TSRHSJacobianPFn` *.

635: .seealso: [](ch_ts), `TS`, `TSSetRHSJacobianP()`, `TSGetRHSJacobianP()`
636: S*/
637: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode TSRHSJacobianPFn(TS ts, PetscReal t, Vec U, Mat A, PetscCtx ctx);

639: PETSC_EXTERN_TYPEDEF typedef TSRHSJacobianPFn *TSRHSJacobianP;

641: PETSC_EXTERN PetscErrorCode TSSetRHSFunction(TS, Vec, TSRHSFunctionFn *, PetscCtx);
642: PETSC_EXTERN PetscErrorCode TSGetRHSFunction(TS, Vec *, TSRHSFunctionFn **, PetscCtxRt);
643: PETSC_EXTERN PetscErrorCode TSSetRHSJacobian(TS, Mat, Mat, TSRHSJacobianFn *, PetscCtx);
644: PETSC_EXTERN PetscErrorCode TSGetRHSJacobian(TS, Mat *, Mat *, TSRHSJacobianFn **, PetscCtxRt);
645: PETSC_EXTERN PetscErrorCode TSRHSJacobianSetReuse(TS, PetscBool);

647: /*S
648:   TSSolutionFn - A prototype of a `TS` solution evaluation function that would be passed to `TSSetSolutionFunction()`

650:   Calling Sequence:
651: + ts  - timestep context
652: . t   - current time
653: . u   - output vector
654: - ctx - [optional] user-defined function context

656:   Level: advanced

658:   Note:
659:   The deprecated `TSSolutionFunction` still works as a replacement for `TSSolutionFn` *.

661: .seealso: [](ch_ts), `TS`, `TSSetSolutionFunction()`, `DMTSSetSolutionFunction()`
662: S*/
663: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode TSSolutionFn(TS ts, PetscReal t, Vec u, PetscCtx ctx);

665: PETSC_EXTERN_TYPEDEF typedef TSSolutionFn *TSSolutionFunction;

667: PETSC_EXTERN PetscErrorCode TSSetSolutionFunction(TS, TSSolutionFn *, PetscCtx);

669: /*S
670:   TSForcingFn - A prototype of a `TS` forcing function evaluation function that would be passed to `TSSetForcingFunction()`

672:   Calling Sequence:
673: + ts  - timestep context
674: . t   - current time
675: . f   - output vector
676: - ctx - [optional] user-defined function context

678:   Level: advanced

680:   Note:
681:   The deprecated `TSForcingFunction` still works as a replacement for `TSForcingFn` *.

683: .seealso: [](ch_ts), `TS`, `TSSetForcingFunction()`, `DMTSSetForcingFunction()`
684: S*/
685: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode TSForcingFn(TS ts, PetscReal t, Vec f, PetscCtx ctx);

687: PETSC_EXTERN_TYPEDEF typedef TSForcingFn *TSForcingFunction;

689: PETSC_EXTERN PetscErrorCode TSSetForcingFunction(TS, TSForcingFn *, PetscCtx);

691: /*S
692:   TSIFunctionFn - A prototype of a `TS` implicit function evaluation function that would be passed to `TSSetIFunction()

694:   Calling Sequence:
695: + ts  - the `TS` context obtained from `TSCreate()`
696: . t   - time at step/stage being solved
697: . U   - state vector
698: . U_t - time derivative of state vector
699: . F   - function vector
700: - ctx - [optional] user-defined context for function

702:   Level: beginner

704:   Note:
705:   The deprecated `TSIFunction` still works as a replacement for `TSIFunctionFn` *.

707: .seealso: [](ch_ts), `TS`, `TSSetIFunction()`, `DMTSSetIFunction()`, `TSIJacobianFn`, `TSRHSFunctionFn`, `TSRHSJacobianFn`
708: S*/
709: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode TSIFunctionFn(TS ts, PetscReal t, Vec U, Vec U_t, Vec F, PetscCtx ctx);

711: PETSC_EXTERN_TYPEDEF typedef TSIFunctionFn *TSIFunction;

713: /*S
714:   TSIJacobianFn - A prototype of a `TS` Jacobian evaluation function that would be passed to `TSSetIJacobian()`

716:   Calling Sequence:
717: + ts   - the `TS` context obtained from `TSCreate()`
718: . t    - time at step/stage being solved
719: . U    - state vector
720: . U_t  - time derivative of state vector
721: . a    - shift
722: . Amat - (approximate) Jacobian of F(t,U,W+a*U), equivalent to dF/dU + a*dF/dU_t
723: . Pmat - matrix used for constructing preconditioner, usually the same as `Amat`
724: - ctx  - [optional] user-defined context for Jacobian evaluation routine

726:   Level: beginner

728:   Note:
729:   The deprecated `TSIJacobian` still works as a replacement for `TSIJacobianFn` *.

731: .seealso: [](ch_ts), `TSSetIJacobian()`, `DMTSSetIJacobian()`, `TSIFunctionFn`, `TSRHSFunctionFn`, `TSRHSJacobianFn`
732: S*/
733: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode TSIJacobianFn(TS ts, PetscReal t, Vec U, Vec U_t, PetscReal a, Mat Amat, Mat Pmat, PetscCtx ctx);

735: PETSC_EXTERN_TYPEDEF typedef TSIJacobianFn *TSIJacobian;

737: PETSC_EXTERN PetscErrorCode TSSetIFunction(TS, Vec, TSIFunctionFn *, PetscCtx);
738: PETSC_EXTERN PetscErrorCode TSGetIFunction(TS, Vec *, TSIFunctionFn **, PetscCtxRt);
739: PETSC_EXTERN PetscErrorCode TSSetIJacobian(TS, Mat, Mat, TSIJacobianFn *, PetscCtx);
740: PETSC_EXTERN PetscErrorCode TSGetIJacobian(TS, Mat *, Mat *, TSIJacobianFn **, PetscCtxRt);

742: /*S
743:   TSI2FunctionFn - A prototype of a `TS` implicit function evaluation function for 2nd order systems that would be passed to `TSSetI2Function()`

745:   Calling Sequence:
746: + ts   - the `TS` context obtained from `TSCreate()`
747: . t    - time at step/stage being solved
748: . U    - state vector
749: . U_t  - time derivative of state vector
750: . U_tt - second time derivative of state vector
751: . F    - function vector
752: - ctx  - [optional] user-defined context for matrix evaluation routine (may be `NULL`)

754:   Level: advanced

756:   Note:
757:   The deprecated `TSI2Function` still works as a replacement for `TSI2FunctionFn` *.

759: .seealso: [](ch_ts), `TS`, `TSSetI2Function()`, `DMTSSetI2Function()`, `TSIFunctionFn`
760: S*/
761: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode TSI2FunctionFn(TS ts, PetscReal t, Vec U, Vec U_t, Vec U_tt, Vec F, PetscCtx ctx);

763: PETSC_EXTERN_TYPEDEF typedef TSI2FunctionFn *TSI2Function;

765: /*S
766:   TSI2JacobianFn - A prototype of a `TS` implicit Jacobian evaluation function for 2nd order systems that would be passed to `TSSetI2Jacobian()`

768:   Calling Sequence:
769: + ts   - the `TS` context obtained from `TSCreate()`
770: . t    - time at step/stage being solved
771: . U    - state vector
772: . U_t  - time derivative of state vector
773: . U_tt - second time derivative of state vector
774: . v    - shift for U_t
775: . a    - shift for U_tt
776: . J    - Jacobian of G(U) = F(t,U,W+v*U,W'+a*U), equivalent to dF/dU + v*dF/dU_t  + a*dF/dU_tt
777: . jac  - matrix from which to construct the preconditioner, may be same as `J`
778: - ctx  - [optional] user-defined context for matrix evaluation routine

780:   Level: advanced

782:   Note:
783:   The deprecated `TSI2Jacobian` still works as a replacement for `TSI2JacobianFn` *.

785: .seealso: [](ch_ts), `TS`, `TSSetI2Jacobian()`, `DMTSSetI2Jacobian()`, `TSIFunctionFn`, `TSIJacobianFn`, `TSRHSFunctionFn`, `TSRHSJacobianFn`
786: S*/
787: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode TSI2JacobianFn(TS ts, PetscReal t, Vec U, Vec U_t, Vec U_tt, PetscReal v, PetscReal a, Mat J, Mat Jac, PetscCtx ctx);

789: PETSC_EXTERN_TYPEDEF typedef TSI2JacobianFn *TSI2Jacobian;

791: PETSC_EXTERN PetscErrorCode TSSetI2Function(TS, Vec, TSI2FunctionFn *, PetscCtx);
792: PETSC_EXTERN PetscErrorCode TSGetI2Function(TS, Vec *, TSI2FunctionFn **, PetscCtxRt);
793: PETSC_EXTERN PetscErrorCode TSSetI2Jacobian(TS, Mat, Mat, TSI2JacobianFn *, PetscCtx);
794: PETSC_EXTERN PetscErrorCode TSGetI2Jacobian(TS, Mat *, Mat *, TSI2JacobianFn **, PetscCtxRt);

796: PETSC_EXTERN PetscErrorCode TSRHSSplitSetIS(TS, const char[], IS);
797: PETSC_EXTERN PetscErrorCode TSRHSSplitGetIS(TS, const char[], IS *);
798: PETSC_EXTERN PetscErrorCode TSRHSSplitSetRHSFunction(TS, const char[], Vec, TSRHSFunctionFn *, PetscCtx);
799: PETSC_EXTERN PetscErrorCode TSRHSSplitSetIFunction(TS, const char[], Vec, TSIFunctionFn *, PetscCtx);
800: PETSC_EXTERN PetscErrorCode TSRHSSplitSetIJacobian(TS, const char[], Mat, Mat, TSIJacobianFn *, PetscCtx);
801: PETSC_EXTERN PetscErrorCode TSRHSSplitGetSubTS(TS, const char[], TS *);
802: PETSC_EXTERN PetscErrorCode TSRHSSplitGetSubTSs(TS, PetscInt *, TS *[]);
803: PETSC_EXTERN PetscErrorCode TSSetUseSplitRHSFunction(TS, PetscBool);
804: PETSC_EXTERN PetscErrorCode TSGetUseSplitRHSFunction(TS, PetscBool *);
805: PETSC_EXTERN PetscErrorCode TSRHSSplitGetSNES(TS, SNES *);
806: PETSC_EXTERN PetscErrorCode TSRHSSplitSetSNES(TS, SNES);

808: PETSC_EXTERN TSRHSFunctionFn TSComputeRHSFunctionLinear;
809: PETSC_EXTERN TSRHSJacobianFn TSComputeRHSJacobianConstant;
810: PETSC_EXTERN PetscErrorCode  TSComputeIFunctionLinear(TS, PetscReal, Vec, Vec, Vec, PetscCtx);
811: PETSC_EXTERN PetscErrorCode  TSComputeIJacobianConstant(TS, PetscReal, Vec, Vec, PetscReal, Mat, Mat, PetscCtx);
812: PETSC_EXTERN PetscErrorCode  TSComputeSolutionFunction(TS, PetscReal, Vec);
813: PETSC_EXTERN PetscErrorCode  TSComputeForcingFunction(TS, PetscReal, Vec);
814: PETSC_EXTERN PetscErrorCode  TSComputeIJacobianDefaultColor(TS, PetscReal, Vec, Vec, PetscReal, Mat, Mat, PetscCtx);
815: PETSC_EXTERN PetscErrorCode  TSPruneIJacobianColor(TS, Mat, Mat);

817: PETSC_EXTERN PetscErrorCode TSSetPreStep(TS, PetscErrorCode (*)(TS));
818: PETSC_EXTERN PetscErrorCode TSSetPreStage(TS, PetscErrorCode (*)(TS, PetscReal));
819: PETSC_EXTERN PetscErrorCode TSSetPostStage(TS, PetscErrorCode (*)(TS, PetscReal, PetscInt, Vec *));
820: PETSC_EXTERN PetscErrorCode TSSetPostEvaluate(TS, PetscErrorCode (*)(TS));
821: PETSC_EXTERN PetscErrorCode TSSetPostStep(TS, PetscErrorCode (*)(TS));
822: PETSC_EXTERN PetscErrorCode TSSetResize(TS, PetscBool, PetscErrorCode (*)(TS, PetscInt, PetscReal, Vec, PetscBool *, PetscCtx), PetscErrorCode (*)(TS, PetscInt, Vec[], Vec[], PetscCtx), PetscCtx);
823: PETSC_EXTERN PetscErrorCode TSPreStep(TS);
824: PETSC_EXTERN PetscErrorCode TSPreStage(TS, PetscReal);
825: PETSC_EXTERN PetscErrorCode TSPostStage(TS, PetscReal, PetscInt, Vec[]);
826: PETSC_EXTERN PetscErrorCode TSPostEvaluate(TS);
827: PETSC_EXTERN PetscErrorCode TSPostStep(TS);
828: PETSC_EXTERN PetscErrorCode TSResize(TS);
829: PETSC_EXTERN PetscErrorCode TSResizeRetrieveVec(TS, const char *, Vec *);
830: PETSC_EXTERN PetscErrorCode TSResizeRegisterVec(TS, const char *, Vec);
831: PETSC_EXTERN PetscErrorCode TSGetStepResize(TS, PetscBool *);

833: PETSC_EXTERN PetscErrorCode TSInterpolate(TS, PetscReal, Vec);
834: PETSC_EXTERN PetscErrorCode TSSetTolerances(TS, PetscReal, Vec, PetscReal, Vec);
835: PETSC_EXTERN PetscErrorCode TSGetTolerances(TS, PetscReal *, Vec *, PetscReal *, Vec *);
836: PETSC_EXTERN PetscErrorCode TSErrorWeightedNorm(TS, Vec, Vec, NormType, PetscReal *, PetscReal *, PetscReal *);
837: PETSC_EXTERN PetscErrorCode TSErrorWeightedENorm(TS, Vec, Vec, Vec, NormType, PetscReal *, PetscReal *, PetscReal *);
838: PETSC_EXTERN PetscErrorCode TSSetCFLTimeLocal(TS, PetscReal);
839: PETSC_EXTERN PetscErrorCode TSGetCFLTime(TS, PetscReal *);
840: PETSC_EXTERN PetscErrorCode TSSetFunctionDomainError(TS, PetscErrorCode (*)(TS, PetscReal, Vec, PetscBool *));
841: PETSC_EXTERN PetscErrorCode TSFunctionDomainError(TS, PetscReal, Vec, PetscBool *);

843: PETSC_EXTERN PetscErrorCode TSPseudoSetTimeStep(TS, PetscErrorCode (*)(TS, PetscReal *, PetscCtx), PetscCtx);
844: PETSC_EXTERN PetscErrorCode TSPseudoTimeStepDefault(TS, PetscReal *, PetscCtx);
845: PETSC_EXTERN PetscErrorCode TSPseudoSetMaxTimeStep(TS, PetscReal);
846: PETSC_EXTERN PetscErrorCode TSPseudoSetVerifyTimeStep(TS, PetscErrorCode (*)(TS, Vec, PetscCtx, PetscReal *, PetscBool *), PetscCtx);
847: PETSC_EXTERN PetscErrorCode TSPseudoSetTimeStepIncrement(TS, PetscReal);
848: PETSC_EXTERN PetscErrorCode TSPseudoIncrementDtFromInitialDt(TS);
849: PETSC_EXTERN PetscErrorCode TSPseudoComputeFunction(TS, Vec, Vec *, PetscReal *);

851: PETSC_EXTERN PetscErrorCode TSPythonSetType(TS, const char[]);
852: PETSC_EXTERN PetscErrorCode TSPythonGetType(TS, const char *[]);

854: PETSC_EXTERN PetscErrorCode TSComputeRHSFunction(TS, PetscReal, Vec, Vec);
855: PETSC_EXTERN PetscErrorCode TSComputeRHSJacobian(TS, PetscReal, Vec, Mat, Mat);
856: PETSC_EXTERN PetscErrorCode TSComputeIFunction(TS, PetscReal, Vec, Vec, Vec, PetscBool);
857: PETSC_EXTERN PetscErrorCode TSComputeIJacobian(TS, PetscReal, Vec, Vec, PetscReal, Mat, Mat, PetscBool);
858: PETSC_EXTERN PetscErrorCode TSComputeI2Function(TS, PetscReal, Vec, Vec, Vec, Vec);
859: PETSC_EXTERN PetscErrorCode TSComputeI2Jacobian(TS, PetscReal, Vec, Vec, Vec, PetscReal, PetscReal, Mat, Mat);
860: PETSC_EXTERN PetscErrorCode TSComputeLinearStability(TS, PetscReal, PetscReal, PetscReal *, PetscReal *);

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

864: PETSC_EXTERN PetscErrorCode DMTSSetBoundaryLocal(DM, PetscErrorCode (*)(DM, PetscReal, Vec, Vec, PetscCtx), PetscCtx);
865: PETSC_EXTERN PetscErrorCode DMTSSetIFunctionPre(DM, PetscErrorCode (*)(DM, PetscReal, Vec, Vec, PetscCtx), PetscCtx);
866: PETSC_EXTERN PetscErrorCode DMTSSetRHSFunction(DM, TSRHSFunctionFn *, PetscCtx);
867: PETSC_EXTERN PetscErrorCode DMTSGetRHSFunction(DM, TSRHSFunctionFn **, PetscCtxRt);
868: PETSC_EXTERN PetscErrorCode DMTSSetRHSFunctionContextDestroy(DM, PetscCtxDestroyFn *);
869: PETSC_EXTERN PetscErrorCode DMTSSetRHSJacobian(DM, TSRHSJacobianFn *, PetscCtx);
870: PETSC_EXTERN PetscErrorCode DMTSGetRHSJacobian(DM, TSRHSJacobianFn **, PetscCtxRt);
871: PETSC_EXTERN PetscErrorCode DMTSSetRHSJacobianContextDestroy(DM, PetscCtxDestroyFn *);
872: PETSC_EXTERN PetscErrorCode DMTSSetIFunction(DM, TSIFunctionFn *, PetscCtx);
873: PETSC_EXTERN PetscErrorCode DMTSGetIFunction(DM, TSIFunctionFn **, PetscCtxRt);
874: PETSC_EXTERN PetscErrorCode DMTSSetIFunctionContextDestroy(DM, PetscCtxDestroyFn *);
875: PETSC_EXTERN PetscErrorCode DMTSSetIJacobian(DM, TSIJacobianFn *, PetscCtx);
876: PETSC_EXTERN PetscErrorCode DMTSGetIJacobian(DM, TSIJacobianFn **, PetscCtxRt);
877: PETSC_EXTERN PetscErrorCode DMTSSetIJacobianContextDestroy(DM, PetscCtxDestroyFn *);
878: PETSC_EXTERN PetscErrorCode DMTSSetI2Function(DM, TSI2FunctionFn *, PetscCtx);
879: PETSC_EXTERN PetscErrorCode DMTSGetI2Function(DM, TSI2FunctionFn **, PetscCtxRt);
880: PETSC_EXTERN PetscErrorCode DMTSSetI2FunctionContextDestroy(DM, PetscCtxDestroyFn *);
881: PETSC_EXTERN PetscErrorCode DMTSSetI2Jacobian(DM, TSI2JacobianFn *, PetscCtx);
882: PETSC_EXTERN PetscErrorCode DMTSGetI2Jacobian(DM, TSI2JacobianFn **, PetscCtxRt);
883: PETSC_EXTERN PetscErrorCode DMTSSetI2JacobianContextDestroy(DM, PetscCtxDestroyFn *);

885: /*S
886:   TSTransientVariableFn - A prototype of a function to transform from state to transient variables that would be passed to `TSSetTransientVariable()`

888:   Calling Sequence:
889: + ts  - timestep context
890: . p   - input vector (primitive form)
891: . c   - output vector, transient variables (conservative form)
892: - ctx - [optional] user-defined function context

894:   Level: advanced

896:   Note:
897:   The deprecated `TSTransientVariable` still works as a replacement for `TSTransientVariableFn` *.

899: .seealso: [](ch_ts), `TS`, `TSSetTransientVariable()`, `DMTSSetTransientVariable()`
900: S*/
901: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode TSTransientVariableFn(TS ts, Vec p, Vec c, PetscCtx ctx);

903: PETSC_EXTERN_TYPEDEF typedef TSTransientVariableFn *TSTransientVariable;

905: PETSC_EXTERN PetscErrorCode TSSetTransientVariable(TS, TSTransientVariableFn *, PetscCtx);
906: PETSC_EXTERN PetscErrorCode DMTSSetTransientVariable(DM, TSTransientVariableFn *, PetscCtx);
907: PETSC_EXTERN PetscErrorCode DMTSGetTransientVariable(DM, TSTransientVariableFn **, PetscCtx);
908: PETSC_EXTERN PetscErrorCode TSComputeTransientVariable(TS, Vec, Vec);
909: PETSC_EXTERN PetscErrorCode TSHasTransientVariable(TS, PetscBool *);

911: PETSC_EXTERN PetscErrorCode DMTSSetSolutionFunction(DM, TSSolutionFn *, PetscCtx);
912: PETSC_EXTERN PetscErrorCode DMTSGetSolutionFunction(DM, TSSolutionFn **, PetscCtxRt);
913: PETSC_EXTERN PetscErrorCode DMTSSetForcingFunction(DM, TSForcingFn *, PetscCtx);
914: PETSC_EXTERN PetscErrorCode DMTSGetForcingFunction(DM, TSForcingFn **, PetscCtxRt);
915: PETSC_EXTERN PetscErrorCode DMTSCheckResidual(TS, DM, PetscReal, Vec, Vec, PetscReal, PetscReal *);
916: PETSC_EXTERN PetscErrorCode DMTSCheckJacobian(TS, DM, PetscReal, Vec, Vec, PetscReal, PetscBool *, PetscReal *);
917: PETSC_EXTERN PetscErrorCode DMTSCheckFromOptions(TS, Vec);

919: PETSC_EXTERN PetscErrorCode DMTSGetIFunctionLocal(DM, PetscErrorCode (**)(DM, PetscReal, Vec, Vec, Vec, PetscCtx), PetscCtxRt);
920: PETSC_EXTERN PetscErrorCode DMTSSetIFunctionLocal(DM, PetscErrorCode (*)(DM, PetscReal, Vec, Vec, Vec, PetscCtx), PetscCtx);
921: PETSC_EXTERN PetscErrorCode DMTSGetIJacobianLocal(DM, PetscErrorCode (**)(DM, PetscReal, Vec, Vec, PetscReal, Mat, Mat, PetscCtx), PetscCtxRt);
922: PETSC_EXTERN PetscErrorCode DMTSSetIJacobianLocal(DM, PetscErrorCode (*)(DM, PetscReal, Vec, Vec, PetscReal, Mat, Mat, PetscCtx), PetscCtx);
923: PETSC_EXTERN PetscErrorCode DMTSGetRHSFunctionLocal(DM, PetscErrorCode (**)(DM, PetscReal, Vec, Vec, PetscCtx), PetscCtxRt);
924: PETSC_EXTERN PetscErrorCode DMTSSetRHSFunctionLocal(DM, PetscErrorCode (*)(DM, PetscReal, Vec, Vec, PetscCtx), PetscCtx);
925: PETSC_EXTERN PetscErrorCode DMTSCreateRHSMassMatrix(DM);
926: PETSC_EXTERN PetscErrorCode DMTSCreateRHSMassMatrixLumped(DM);
927: PETSC_EXTERN PetscErrorCode DMTSDestroyRHSMassMatrix(DM);

929: PETSC_EXTERN PetscErrorCode DMTSSetIFunctionSerialize(DM, PetscErrorCode (*)(PetscCtx, PetscViewer), PetscErrorCode (*)(PetscCtx *, PetscViewer));
930: PETSC_EXTERN PetscErrorCode DMTSSetIJacobianSerialize(DM, PetscErrorCode (*)(PetscCtx, PetscViewer), PetscErrorCode (*)(PetscCtx *, PetscViewer));

932: /*S
933:   DMDATSRHSFunctionLocalFn - A prototype of a local `TS` right-hand side residual evaluation function for use with `DMDA` that would be passed to `DMDATSSetRHSFunctionLocal()`

935:   Calling Sequence:
936: + info - defines the subdomain to evaluate the residual on
937: . t    - time at which to evaluate residual
938: . x    - array of local state information
939: . f    - output array of local residual information
940: - ctx  - optional user context

942:   Level: beginner

944:   Note:
945:   The deprecated `DMDATSRHSFunctionLocal` still works as a replacement for `DMDATSRHSFunctionLocalFn` *.

947: .seealso: `DMDA`, `DMDATSSetRHSFunctionLocal()`, `TSRHSFunctionFn`, `DMDATSRHSJacobianLocalFn`, `DMDATSIJacobianLocalFn`, `DMDATSIFunctionLocalFn`
948: S*/
949: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode DMDATSRHSFunctionLocalFn(DMDALocalInfo *info, PetscReal t, void *x, void *f, PetscCtx ctx);

951: PETSC_EXTERN_TYPEDEF typedef DMDATSRHSFunctionLocalFn *DMDATSRHSFunctionLocal;

953: /*S
954:   DMDATSRHSJacobianLocalFn - A prototype of a local residual evaluation function for use with `DMDA` that would be passed to `DMDATSSetRHSJacobianLocal()`

956:   Calling Sequence:
957: + info - defines the subdomain to evaluate the residual on
958: . t    - time at which to evaluate residual
959: . x    - array of local state information
960: . J    - Jacobian matrix
961: . B    - matrix from which to construct the preconditioner; often same as `J`
962: - ctx  - optional context

964:   Level: beginner

966:   Note:
967:   The deprecated `DMDATSRHSJacobianLocal` still works as a replacement for `DMDATSRHSJacobianLocalFn` *.

969: .seealso: `DMDA`, `DMDATSSetRHSJacobianLocal()`, `TSRHSJacobianFn`, `DMDATSRHSFunctionLocalFn`, `DMDATSIJacobianLocalFn`, `DMDATSIFunctionLocalFn`
970: S*/
971: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode DMDATSRHSJacobianLocalFn(DMDALocalInfo *info, PetscReal t, void *x, Mat J, Mat B, PetscCtx ctx);

973: PETSC_EXTERN_TYPEDEF typedef DMDATSRHSJacobianLocalFn *DMDATSRHSJacobianLocal;

975: /*S
976:   DMDATSIFunctionLocalFn - A prototype of a local residual evaluation function for use with `DMDA` that would be passed to `DMDATSSetIFunctionLocal()`

978:   Calling Sequence:
979: + info  - defines the subdomain to evaluate the residual on
980: . t     - time at which to evaluate residual
981: . x     - array of local state information
982: . xdot  - array of local time derivative information
983: . imode - output array of local function evaluation information
984: - ctx   - optional context

986:   Level: beginner

988:   Note:
989:   The deprecated `DMDATSIFunctionLocal` still works as a replacement for `DMDATSIFunctionLocalFn` *.

991: .seealso: `DMDA`, `DMDATSSetIFunctionLocal()`, `DMDATSIJacobianLocalFn`, `TSIFunctionFn`
992: S*/
993: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode DMDATSIFunctionLocalFn(DMDALocalInfo *info, PetscReal t, void *x, void *xdot, void *imode, PetscCtx ctx);

995: PETSC_EXTERN_TYPEDEF typedef DMDATSIFunctionLocalFn *DMDATSIFunctionLocal;

997: /*S
998:   DMDATSIJacobianLocalFn - A prototype of a local residual evaluation function for use with `DMDA` that would be passed to `DMDATSSetIJacobianLocal()`

1000:   Calling Sequence:
1001: + info  - defines the subdomain to evaluate the residual on
1002: . t     - time at which to evaluate the jacobian
1003: . x     - array of local state information
1004: . xdot  - time derivative at this state
1005: . shift - see `TSSetIJacobian()` for the meaning of this parameter
1006: . J     - Jacobian matrix
1007: . B     - matrix from which to construct the preconditioner; often same as `J`
1008: - ctx   - optional context

1010:   Level: beginner

1012:   Note:
1013:   The deprecated `DMDATSIJacobianLocal` still works as a replacement for `DMDATSIJacobianLocalFn` *.

1015: .seealso: `DMDA`, `DMDATSSetIJacobianLocal()`, `TSIJacobianFn`, `DMDATSIFunctionLocalFn`, `DMDATSRHSFunctionLocalFn`, `DMDATSRHSJacobianlocal()`
1016: S*/
1017: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode DMDATSIJacobianLocalFn(DMDALocalInfo *info, PetscReal t, void *x, void *xdot, PetscReal shift, Mat J, Mat B, PetscCtx ctx);

1019: PETSC_EXTERN_TYPEDEF typedef DMDATSIJacobianLocalFn *DMDATSIJacobianLocal;

1021: PETSC_EXTERN PetscErrorCode DMDATSSetRHSFunctionLocal(DM, InsertMode, DMDATSRHSFunctionLocalFn *, void *);
1022: PETSC_EXTERN PetscErrorCode DMDATSSetRHSJacobianLocal(DM, DMDATSRHSJacobianLocalFn *, void *);
1023: PETSC_EXTERN PetscErrorCode DMDATSSetIFunctionLocal(DM, InsertMode, DMDATSIFunctionLocalFn *, void *);
1024: PETSC_EXTERN PetscErrorCode DMDATSSetIJacobianLocal(DM, DMDATSIJacobianLocalFn *, void *);

1026: /*S
1027:   TSMonitorLGCtx - Context object for `TS` line-graph monitor routines that plot residuals, iteration counts or solution components at each time step on a `PetscDrawLG`

1029:   Level: developer

1031: .seealso: `TS`, `TSMonitorLGCtxCreate()`, `TSMonitorLGCtxDestroy()`, `TSMonitorLGSolution()`, `TSMonitorLGTimeStep()`, `TSMonitorLGError()`
1032: S*/
1033: typedef struct _n_TSMonitorLGCtx *TSMonitorLGCtx;

1035: /*S
1036:   TSMonitorDMDARayCtx - Context object for `TSMonitorDMDARay()`

1038:   Level: developer

1040: .seealso: `TS`, `TSSetMonitor()`, `TSMonitorDMDARay()`, `TSMonitorDMDARayDestroy()`
1041: S*/
1042: typedef struct {
1043:   Vec            ray;
1044:   VecScatter     scatter;
1045:   PetscViewer    viewer;
1046:   TSMonitorLGCtx lgctx;
1047: } TSMonitorDMDARayCtx;
1048: PETSC_EXTERN PetscErrorCode TSMonitorDMDARayDestroy(PetscCtxRt);
1049: PETSC_EXTERN PetscErrorCode TSMonitorDMDARay(TS, PetscInt, PetscReal, Vec, void *);
1050: PETSC_EXTERN PetscErrorCode TSMonitorLGDMDARay(TS, PetscInt, PetscReal, Vec, void *);

1052: /* Dynamic creation and loading functions */
1053: PETSC_EXTERN PetscFunctionList TSList;
1054: PETSC_EXTERN PetscErrorCode    TSGetType(TS, TSType *);
1055: PETSC_EXTERN PetscErrorCode    TSSetType(TS, TSType);
1056: PETSC_EXTERN PetscErrorCode    TSRegister(const char[], PetscErrorCode (*)(TS));

1058: PETSC_EXTERN PetscErrorCode TSGetSNES(TS, SNES *);
1059: PETSC_EXTERN PetscErrorCode TSSetSNES(TS, SNES);
1060: PETSC_EXTERN PetscErrorCode TSGetKSP(TS, KSP *);
1061: PETSC_EXTERN PetscErrorCode TSIsImplicit(TS, PetscBool *);

1063: PETSC_EXTERN PetscErrorCode TSView(TS, PetscViewer);
1064: PETSC_EXTERN PetscErrorCode TSLoad(TS, PetscViewer);
1065: PETSC_EXTERN PetscErrorCode TSViewFromOptions(TS, PetscObject, const char[]);
1066: PETSC_EXTERN PetscErrorCode TSTrajectoryViewFromOptions(TSTrajectory, PetscObject, const char[]);

1068: #define TS_FILE_CLASSID 1211225

1070: PETSC_EXTERN PetscErrorCode TSSetApplicationContext(TS, PetscCtx);
1071: PETSC_EXTERN PetscErrorCode TSGetApplicationContext(TS, PetscCtxRt);

1073: PETSC_EXTERN PetscErrorCode TSMonitorLGCtxCreate(MPI_Comm, const char[], const char[], int, int, int, int, PetscInt, TSMonitorLGCtx *);
1074: PETSC_EXTERN PetscErrorCode TSMonitorLGCtxDestroy(TSMonitorLGCtx *);
1075: PETSC_EXTERN PetscErrorCode TSMonitorLGTimeStep(TS, PetscInt, PetscReal, Vec, void *);
1076: PETSC_EXTERN PetscErrorCode TSMonitorLGSolution(TS, PetscInt, PetscReal, Vec, void *);
1077: PETSC_EXTERN PetscErrorCode TSMonitorLGSetVariableNames(TS, const char *const *);
1078: PETSC_EXTERN PetscErrorCode TSMonitorLGGetVariableNames(TS, const char *const **);
1079: PETSC_EXTERN PetscErrorCode TSMonitorLGCtxSetVariableNames(TSMonitorLGCtx, const char *const *);
1080: PETSC_EXTERN PetscErrorCode TSMonitorLGSetDisplayVariables(TS, const char *const *);
1081: PETSC_EXTERN PetscErrorCode TSMonitorLGCtxSetDisplayVariables(TSMonitorLGCtx, const char *const *);
1082: PETSC_EXTERN PetscErrorCode TSMonitorLGSetTransform(TS, PetscErrorCode (*)(void *, Vec, Vec *), PetscCtxDestroyFn *, void *);
1083: PETSC_EXTERN PetscErrorCode TSMonitorLGCtxSetTransform(TSMonitorLGCtx, PetscErrorCode (*)(void *, Vec, Vec *), PetscCtxDestroyFn *, void *);
1084: PETSC_EXTERN PetscErrorCode TSMonitorLGError(TS, PetscInt, PetscReal, Vec, void *);
1085: PETSC_EXTERN PetscErrorCode TSMonitorLGSNESIterations(TS, PetscInt, PetscReal, Vec, void *);
1086: PETSC_EXTERN PetscErrorCode TSMonitorLGKSPIterations(TS, PetscInt, PetscReal, Vec, void *);
1087: PETSC_EXTERN PetscErrorCode TSMonitorError(TS, PetscInt, PetscReal, Vec, PetscViewerAndFormat *);
1088: PETSC_EXTERN PetscErrorCode TSDMSwarmMonitorMoments(TS, PetscInt, PetscReal, Vec, PetscViewerAndFormat *);

1090: struct _n_TSMonitorLGCtxNetwork {
1091:   PetscInt     nlg;
1092:   PetscDrawLG *lg;
1093:   PetscBool    semilogy;
1094:   PetscInt     howoften; /* when > 0 uses step % howoften, when negative only final solution plotted */
1095: };
1096: /*S
1097:   TSMonitorLGCtxNetwork - Context object for the `TSMonitorLGCtxNetworkSolution()` line-graph monitor that plots solution components on each subnetwork of a `DMNETWORK`

1099:   Level: developer

1101: .seealso: `TS`, `DMNETWORK`, `TSMonitorLGCtxNetworkCreate()`, `TSMonitorLGCtxNetworkDestroy()`, `TSMonitorLGCtxNetworkSolution()`
1102: S*/
1103: typedef struct _n_TSMonitorLGCtxNetwork *TSMonitorLGCtxNetwork;
1104: PETSC_EXTERN PetscErrorCode              TSMonitorLGCtxNetworkDestroy(TSMonitorLGCtxNetwork *);
1105: PETSC_EXTERN PetscErrorCode              TSMonitorLGCtxNetworkCreate(TS, const char[], const char[], int, int, int, int, PetscInt, TSMonitorLGCtxNetwork *);
1106: PETSC_EXTERN PetscErrorCode              TSMonitorLGCtxNetworkSolution(TS, PetscInt, PetscReal, Vec, void *);

1108: /*S
1109:   TSMonitorEnvelopeCtx - Context object for the `TSMonitorEnvelope()` monitor that tracks the per-component min/max envelope of the solution over a time integration

1111:   Level: developer

1113: .seealso: `TS`, `TSMonitorEnvelopeCtxCreate()`, `TSMonitorEnvelopeCtxDestroy()`, `TSMonitorEnvelope()`, `TSMonitorEnvelopeGetBounds()`
1114: S*/
1115: typedef struct _n_TSMonitorEnvelopeCtx *TSMonitorEnvelopeCtx;
1116: PETSC_EXTERN PetscErrorCode             TSMonitorEnvelopeCtxCreate(TS, TSMonitorEnvelopeCtx *);
1117: PETSC_EXTERN PetscErrorCode             TSMonitorEnvelope(TS, PetscInt, PetscReal, Vec, void *);
1118: PETSC_EXTERN PetscErrorCode             TSMonitorEnvelopeGetBounds(TS, Vec *, Vec *);
1119: PETSC_EXTERN PetscErrorCode             TSMonitorEnvelopeCtxDestroy(TSMonitorEnvelopeCtx *);

1121: /*S
1122:   TSMonitorSPEigCtx - Context object for the `TSMonitorSPEig()` monitor that displays an estimate of the spectrum of the operator using a `PetscDrawSP` scatter plot

1124:   Level: developer

1126: .seealso: `TS`, `TSMonitorSPEigCtxCreate()`, `TSMonitorSPEigCtxDestroy()`, `TSMonitorSPEig()`
1127: S*/
1128: typedef struct _n_TSMonitorSPEigCtx *TSMonitorSPEigCtx;
1129: PETSC_EXTERN PetscErrorCode          TSMonitorSPEigCtxCreate(MPI_Comm, const char[], const char[], int, int, int, int, PetscInt, TSMonitorSPEigCtx *);
1130: PETSC_EXTERN PetscErrorCode          TSMonitorSPEigCtxDestroy(TSMonitorSPEigCtx *);
1131: PETSC_EXTERN PetscErrorCode          TSMonitorSPEig(TS, PetscInt, PetscReal, Vec, void *);

1133: /*S
1134:   TSMonitorSPCtx - Context object for the `TSMonitorSPSwarmSolution()` scatter-plot monitor that draws the swarm particle positions at each time step on a `PetscDrawSP`

1136:   Level: developer

1138: .seealso: `TS`, `DMSWARM`, `TSMonitorSPCtxCreate()`, `TSMonitorSPCtxDestroy()`, `TSMonitorSPSwarmSolution()`
1139: S*/
1140: typedef struct _n_TSMonitorSPCtx *TSMonitorSPCtx;
1141: PETSC_EXTERN PetscErrorCode       TSMonitorSPCtxCreate(MPI_Comm, const char[], const char[], int, int, int, int, PetscInt, PetscInt, PetscBool, PetscBool, TSMonitorSPCtx *);
1142: PETSC_EXTERN PetscErrorCode       TSMonitorSPCtxDestroy(TSMonitorSPCtx *);
1143: PETSC_EXTERN PetscErrorCode       TSMonitorSPSwarmSolution(TS, PetscInt, PetscReal, Vec, void *);

1145: /*S
1146:   TSMonitorHGCtx - Context object for the `TSMonitorHGSwarmSolution()` histogram monitor that displays a histogram of `DMSWARM` particle quantities at each time step

1148:   Level: developer

1150: .seealso: `TS`, `DMSWARM`, `TSMonitorHGCtxCreate()`, `TSMonitorHGCtxDestroy()`, `TSMonitorHGSwarmSolution()`
1151: S*/
1152: typedef struct _n_TSMonitorHGCtx *TSMonitorHGCtx;
1153: PETSC_EXTERN PetscErrorCode       TSMonitorHGCtxCreate(MPI_Comm, const char[], const char[], int, int, int, int, PetscInt, PetscInt, PetscInt, PetscBool, TSMonitorHGCtx *);
1154: PETSC_EXTERN PetscErrorCode       TSMonitorHGSwarmSolution(TS, PetscInt, PetscReal, Vec, void *);
1155: PETSC_EXTERN PetscErrorCode       TSMonitorHGCtxDestroy(TSMonitorHGCtx *);
1156: PETSC_EXTERN PetscErrorCode       TSMonitorHGSwarmSolution(TS, PetscInt, PetscReal, Vec, void *);

1158: /*M
1159:    TSEvent - Abstract object to handle event detection in `TS` time integrator

1161:    Level: intermediate

1163:    Note:
1164:    See `TSSetEventHandler()` for the management of events.

1166: .seealso: [](sec_ts_event), `TS`, `TSSetEventHandler()`, `TSSetPostEventStep()`, `TSSetPostEventSecondStep()`, `TSSetEventTolerances()`, `TSGetNumEvents()`
1167: M*/
1168: typedef struct _n_TSEvent *TSEvent;

1170: PETSC_EXTERN PetscErrorCode TSSetEventHandler(TS, PetscInt, PetscInt[], PetscBool[], PetscErrorCode (*)(TS, PetscReal, Vec, PetscReal[], void *), PetscErrorCode (*)(TS, PetscInt, PetscInt[], PetscReal, Vec, PetscBool, void *), void *);
1171: PETSC_EXTERN PetscErrorCode TSSetPostEventStep(TS, PetscReal);
1172: PETSC_EXTERN PetscErrorCode TSSetPostEventSecondStep(TS, PetscReal);
1173: PETSC_DEPRECATED_FUNCTION(3, 21, 0, "TSSetPostEventSecondStep()", ) static inline PetscErrorCode TSSetPostEventIntervalStep(TS ts, PetscReal dt)
1174: {
1175:   return TSSetPostEventSecondStep(ts, dt);
1176: }
1177: PETSC_EXTERN PetscErrorCode TSSetEventTolerances(TS, PetscReal, PetscReal[]);
1178: PETSC_EXTERN PetscErrorCode TSGetNumEvents(TS, PetscInt *);

1180: /*J
1181:    TSSSPType - string with the name of a `TSSSP` scheme.

1183:    Level: beginner

1185: .seealso: [](ch_ts), `TSSSPSetType()`, `TS`, `TSSSP`
1186: J*/
1187: typedef const char *TSSSPType;
1188: #define TSSSPRKS2  "rks2"
1189: #define TSSSPRKS3  "rks3"
1190: #define TSSSPRK104 "rk104"

1192: PETSC_EXTERN PetscErrorCode    TSSSPSetType(TS, TSSSPType);
1193: PETSC_EXTERN PetscErrorCode    TSSSPGetType(TS, TSSSPType *);
1194: PETSC_EXTERN PetscErrorCode    TSSSPSetNumStages(TS, PetscInt);
1195: PETSC_EXTERN PetscErrorCode    TSSSPGetNumStages(TS, PetscInt *);
1196: PETSC_EXTERN PetscErrorCode    TSSSPInitializePackage(void);
1197: PETSC_EXTERN PetscErrorCode    TSSSPFinalizePackage(void);
1198: PETSC_EXTERN PetscFunctionList TSSSPList;

1200: /*S
1201:    TSAdapt - Abstract object that manages time-step adaptivity

1203:    Level: beginner

1205: .seealso: [](ch_ts), [](sec_ts_error_control), `TS`, `TSGetAdapt()`, `TSAdaptCreate()`, `TSAdaptType`
1206: S*/
1207: typedef struct _p_TSAdapt *TSAdapt;

1209: /*J
1210:    TSAdaptType - String with the name of `TSAdapt` scheme.

1212:    Level: beginner

1214: .seealso: [](ch_ts), [](sec_ts_error_control), `TSGetAdapt()`, `TSAdaptSetType()`, `TS`, `TSAdapt`
1215: J*/
1216: typedef const char *TSAdaptType;
1217: #define TSADAPTNONE    "none"
1218: #define TSADAPTBASIC   "basic"
1219: #define TSADAPTDSP     "dsp"
1220: #define TSADAPTCFL     "cfl"
1221: #define TSADAPTGLEE    "glee"
1222: #define TSADAPTHISTORY "history"

1224: PETSC_EXTERN PetscErrorCode TSGetAdapt(TS, TSAdapt *);
1225: PETSC_EXTERN PetscErrorCode TSAdaptRegister(const char[], PetscErrorCode (*)(TSAdapt));
1226: PETSC_EXTERN PetscErrorCode TSAdaptInitializePackage(void);
1227: PETSC_EXTERN PetscErrorCode TSAdaptFinalizePackage(void);
1228: PETSC_EXTERN PetscErrorCode TSAdaptCreate(MPI_Comm, TSAdapt *);
1229: PETSC_EXTERN PetscErrorCode TSAdaptSetType(TSAdapt, TSAdaptType);
1230: PETSC_EXTERN PetscErrorCode TSAdaptGetType(TSAdapt, TSAdaptType *);
1231: PETSC_EXTERN PetscErrorCode TSAdaptSetOptionsPrefix(TSAdapt, const char[]);
1232: PETSC_EXTERN PetscErrorCode TSAdaptCandidatesClear(TSAdapt);
1233: PETSC_EXTERN PetscErrorCode TSAdaptCandidateAdd(TSAdapt, const char[], PetscInt, PetscInt, PetscReal, PetscReal, PetscBool);
1234: PETSC_EXTERN PetscErrorCode TSAdaptCandidatesGet(TSAdapt, PetscInt *, const PetscInt **, const PetscInt **, const PetscReal **, const PetscReal **);
1235: PETSC_EXTERN PetscErrorCode TSAdaptChoose(TSAdapt, TS, PetscReal, PetscInt *, PetscReal *, PetscBool *);
1236: PETSC_EXTERN PetscErrorCode TSAdaptCheckStage(TSAdapt, TS, PetscReal, Vec, PetscBool *);
1237: PETSC_EXTERN PetscErrorCode TSAdaptView(TSAdapt, PetscViewer);
1238: PETSC_EXTERN PetscErrorCode TSAdaptLoad(TSAdapt, PetscViewer);
1239: PETSC_EXTERN PetscErrorCode TSAdaptSetFromOptions(TSAdapt, PetscOptionItems);
1240: PETSC_EXTERN PetscErrorCode TSAdaptReset(TSAdapt);
1241: PETSC_EXTERN PetscErrorCode TSAdaptDestroy(TSAdapt *);
1242: PETSC_EXTERN PetscErrorCode TSAdaptSetMonitor(TSAdapt, PetscBool);
1243: PETSC_EXTERN PetscErrorCode TSAdaptSetAlwaysAccept(TSAdapt, PetscBool);
1244: PETSC_EXTERN PetscErrorCode TSAdaptSetSafety(TSAdapt, PetscReal, PetscReal);
1245: PETSC_EXTERN PetscErrorCode TSAdaptGetSafety(TSAdapt, PetscReal *, PetscReal *);
1246: PETSC_EXTERN PetscErrorCode TSAdaptSetMaxIgnore(TSAdapt, PetscReal);
1247: PETSC_EXTERN PetscErrorCode TSAdaptGetMaxIgnore(TSAdapt, PetscReal *);
1248: PETSC_EXTERN PetscErrorCode TSAdaptSetClip(TSAdapt, PetscReal, PetscReal);
1249: PETSC_EXTERN PetscErrorCode TSAdaptGetClip(TSAdapt, PetscReal *, PetscReal *);
1250: PETSC_EXTERN PetscErrorCode TSAdaptSetScaleSolveFailed(TSAdapt, PetscReal);
1251: PETSC_EXTERN PetscErrorCode TSAdaptGetScaleSolveFailed(TSAdapt, PetscReal *);
1252: PETSC_EXTERN PetscErrorCode TSAdaptSetStepLimits(TSAdapt, PetscReal, PetscReal);
1253: PETSC_EXTERN PetscErrorCode TSAdaptGetStepLimits(TSAdapt, PetscReal *, PetscReal *);
1254: PETSC_EXTERN PetscErrorCode TSAdaptSetCheckStage(TSAdapt, PetscErrorCode (*)(TSAdapt, TS, PetscReal, Vec, PetscBool *));
1255: PETSC_EXTERN PetscErrorCode TSAdaptHistorySetHistory(TSAdapt, PetscInt, PetscReal[], PetscBool);
1256: PETSC_EXTERN PetscErrorCode TSAdaptHistorySetTrajectory(TSAdapt, TSTrajectory, PetscBool);
1257: PETSC_EXTERN PetscErrorCode TSAdaptHistoryGetStep(TSAdapt, PetscInt, PetscReal *, PetscReal *);
1258: PETSC_EXTERN PetscErrorCode TSAdaptSetTimeStepIncreaseDelay(TSAdapt, PetscInt);
1259: PETSC_EXTERN PetscErrorCode TSAdaptDSPSetFilter(TSAdapt, const char *);
1260: PETSC_EXTERN PetscErrorCode TSAdaptDSPSetPID(TSAdapt, PetscReal, PetscReal, PetscReal);

1262: /*S
1263:    TSGLLEAdapt - Abstract object that manages time-step adaptivity for `TSGLLE`

1265:    Level: beginner

1267:    Developer Note:
1268:    This functionality should be replaced by the `TSAdapt`.

1270: .seealso: [](ch_ts), `TS`, `TSGLLE`, `TSGLLEAdaptCreate()`, `TSGLLEAdaptType`
1271: S*/
1272: typedef struct _p_TSGLLEAdapt *TSGLLEAdapt;

1274: /*J
1275:    TSGLLEAdaptType - String with the name of `TSGLLEAdapt` scheme

1277:    Level: beginner

1279:    Developer Note:
1280:    This functionality should be replaced by the `TSAdaptType`.

1282: .seealso: [](ch_ts), `TSGLLEAdaptSetType()`, `TS`
1283: J*/
1284: typedef const char *TSGLLEAdaptType;
1285: #define TSGLLEADAPT_NONE "none"
1286: #define TSGLLEADAPT_SIZE "size"
1287: #define TSGLLEADAPT_BOTH "both"

1289: PETSC_EXTERN PetscErrorCode TSGLLEAdaptRegister(const char[], PetscErrorCode (*)(TSGLLEAdapt));
1290: PETSC_EXTERN PetscErrorCode TSGLLEAdaptInitializePackage(void);
1291: PETSC_EXTERN PetscErrorCode TSGLLEAdaptFinalizePackage(void);
1292: PETSC_EXTERN PetscErrorCode TSGLLEAdaptCreate(MPI_Comm, TSGLLEAdapt *);
1293: PETSC_EXTERN PetscErrorCode TSGLLEAdaptSetType(TSGLLEAdapt, TSGLLEAdaptType);
1294: PETSC_EXTERN PetscErrorCode TSGLLEAdaptSetOptionsPrefix(TSGLLEAdapt, const char[]);
1295: PETSC_EXTERN PetscErrorCode TSGLLEAdaptChoose(TSGLLEAdapt, PetscInt, const PetscInt[], const PetscReal[], const PetscReal[], PetscInt, PetscReal, PetscReal, PetscInt *, PetscReal *, PetscBool *);
1296: PETSC_EXTERN PetscErrorCode TSGLLEAdaptView(TSGLLEAdapt, PetscViewer);
1297: PETSC_EXTERN PetscErrorCode TSGLLEAdaptSetFromOptions(TSGLLEAdapt, PetscOptionItems);
1298: PETSC_EXTERN PetscErrorCode TSGLLEAdaptDestroy(TSGLLEAdapt *);

1300: /*J
1301:    TSGLLEAcceptType - String with the name of `TSGLLEAccept` scheme

1303:    Level: beginner

1305: .seealso: [](ch_ts), `TSGLLESetAcceptType()`, `TS`, `TSGLLEAccept`
1306: J*/
1307: typedef const char *TSGLLEAcceptType;
1308: #define TSGLLEACCEPT_ALWAYS "always"

1310: /*S
1311:   TSGLLEAcceptFn - A prototype of a `TS` accept function that would be passed to `TSGLLEAcceptRegister()`

1313:   Calling Sequence:
1314: + ts     - timestep context
1315: . nt     - time to end of solution time
1316: . h      - the proposed step-size
1317: . enorm  - unknown
1318: - accept - output, if the proposal is accepted

1320:   Level: beginner

1322:   Note:
1323:   The deprecated `TSGLLEAcceptFunction` still works as a replacement for `TSGLLEAcceptFn` *

1325: .seealso: [](ch_ts), `TS`, `TSSetRHSFunction()`, `DMTSSetRHSFunction()`, `TSIFunctionFn`,
1326: `TSIJacobianFn`, `TSRHSJacobianFn`, `TSGLLEAcceptRegister()`
1327: S*/
1328: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode TSGLLEAcceptFn(TS ts, PetscReal nt, PetscReal h, const PetscReal enorm[], PetscBool *accept);

1330: PETSC_EXTERN_TYPEDEF typedef TSGLLEAcceptFn *TSGLLEAcceptFunction;

1332: PETSC_EXTERN PetscErrorCode TSGLLEAcceptRegister(const char[], TSGLLEAcceptFn *);

1334: /*J
1335:   TSGLLEType - string with the name of a General Linear `TSGLLE` type

1337:   Level: beginner

1339: .seealso: [](ch_ts), `TS`, `TSGLLE`, `TSGLLESetType()`, `TSGLLERegister()`, `TSGLLEAccept`
1340: J*/
1341: typedef const char *TSGLLEType;
1342: #define TSGLLE_IRKS "irks"

1344: PETSC_EXTERN PetscErrorCode TSGLLERegister(const char[], PetscErrorCode (*)(TS));
1345: PETSC_EXTERN PetscErrorCode TSGLLEInitializePackage(void);
1346: PETSC_EXTERN PetscErrorCode TSGLLEFinalizePackage(void);
1347: PETSC_EXTERN PetscErrorCode TSGLLESetType(TS, TSGLLEType);
1348: PETSC_EXTERN PetscErrorCode TSGLLEGetAdapt(TS, TSGLLEAdapt *);
1349: PETSC_EXTERN PetscErrorCode TSGLLESetAcceptType(TS, TSGLLEAcceptType);

1351: /*J
1352:    TSEIMEXType - String with the name of an Extrapolated IMEX `TSEIMEX` type

1354:    Level: beginner

1356: .seealso: [](ch_ts), `TSEIMEXSetType()`, `TS`, `TSEIMEX`, `TSEIMEXRegister()`
1357: J*/
1358: #define TSEIMEXType char *

1360: PETSC_EXTERN PetscErrorCode TSEIMEXSetMaxRows(TS, PetscInt);
1361: PETSC_EXTERN PetscErrorCode TSEIMEXSetRowCol(TS, PetscInt, PetscInt);
1362: PETSC_EXTERN PetscErrorCode TSEIMEXSetOrdAdapt(TS, PetscBool);

1364: /*J
1365:    TSRKType - String with the name of a Runge-Kutta `TSRK` type

1367:    Level: beginner

1369: .seealso: [](ch_ts), `TS`, `TSRKSetType()`, `TSRK`, `TSRKRegister()`
1370: J*/
1371: typedef const char *TSRKType;
1372: #define TSRK1FE "1fe"
1373: #define TSRK2A  "2a"
1374: #define TSRK2B  "2b"
1375: #define TSRK3   "3"
1376: #define TSRK3BS "3bs"
1377: #define TSRK4   "4"
1378: #define TSRK5F  "5f"
1379: #define TSRK5DP "5dp"
1380: #define TSRK5BS "5bs"
1381: #define TSRK6VR "6vr"
1382: #define TSRK7VR "7vr"
1383: #define TSRK8VR "8vr"

1385: PETSC_EXTERN PetscErrorCode TSRKGetOrder(TS, PetscInt *);
1386: PETSC_EXTERN PetscErrorCode TSRKGetType(TS, TSRKType *);
1387: PETSC_EXTERN PetscErrorCode TSRKSetType(TS, TSRKType);
1388: PETSC_EXTERN PetscErrorCode TSRKGetTableau(TS, PetscInt *, const PetscReal *[], const PetscReal *[], const PetscReal *[], const PetscReal *[], PetscInt *, const PetscReal *[], PetscBool *);
1389: PETSC_EXTERN PetscErrorCode TSRKSetMultirate(TS, PetscBool);
1390: PETSC_EXTERN PetscErrorCode TSRKGetMultirate(TS, PetscBool *);
1391: PETSC_EXTERN PetscErrorCode TSRKRegister(TSRKType, PetscInt, PetscInt, const PetscReal[], const PetscReal[], const PetscReal[], const PetscReal[], PetscInt, const PetscReal[]);
1392: PETSC_EXTERN PetscErrorCode TSRKInitializePackage(void);
1393: PETSC_EXTERN PetscErrorCode TSRKFinalizePackage(void);
1394: PETSC_EXTERN PetscErrorCode TSRKRegisterDestroy(void);

1396: /*J
1397:    TSMPRKType - String with the name of a partitioned Runge-Kutta `TSMPRK` type

1399:    Level: beginner

1401: .seealso: [](ch_ts), `TSMPRKSetType()`, `TS`, `TSMPRK`, `TSMPRKRegister()`
1402: J*/
1403: typedef const char *TSMPRKType;
1404: #define TSMPRK2A22 "2a22"
1405: #define TSMPRK2A23 "2a23"
1406: #define TSMPRK2A32 "2a32"
1407: #define TSMPRK2A33 "2a33"
1408: #define TSMPRKP2   "p2"
1409: #define TSMPRKP3   "p3"

1411: PETSC_EXTERN PetscErrorCode TSMPRKGetType(TS, TSMPRKType *);
1412: PETSC_EXTERN PetscErrorCode TSMPRKSetType(TS, TSMPRKType);
1413: PETSC_EXTERN PetscErrorCode TSMPRKRegister(TSMPRKType, PetscInt, PetscInt, PetscInt, PetscInt, const PetscReal[], const PetscReal[], const PetscReal[], const PetscInt[], const PetscReal[], const PetscReal[], const PetscReal[], const PetscInt[], const PetscReal[], const PetscReal[], const PetscReal[]);
1414: PETSC_EXTERN PetscErrorCode TSMPRKInitializePackage(void);
1415: PETSC_EXTERN PetscErrorCode TSMPRKFinalizePackage(void);
1416: PETSC_EXTERN PetscErrorCode TSMPRKRegisterDestroy(void);

1418: /*J
1419:    TSIRKType - String with the name of an implicit Runge-Kutta `TSIRK` type

1421:    Level: beginner

1423: .seealso: [](ch_ts), `TSIRKSetType()`, `TS`, `TSIRK`, `TSIRKRegister()`
1424: J*/
1425: typedef const char *TSIRKType;
1426: #define TSIRKGAUSS "gauss"

1428: PETSC_EXTERN PetscErrorCode TSIRKGetType(TS, TSIRKType *);
1429: PETSC_EXTERN PetscErrorCode TSIRKSetType(TS, TSIRKType);
1430: PETSC_EXTERN PetscErrorCode TSIRKGetNumStages(TS, PetscInt *);
1431: PETSC_EXTERN PetscErrorCode TSIRKSetNumStages(TS, PetscInt);
1432: PETSC_EXTERN PetscErrorCode TSIRKRegister(const char[], PetscErrorCode (*function)(TS));
1433: PETSC_EXTERN PetscErrorCode TSIRKTableauCreate(TS, PetscInt, const PetscReal *, const PetscReal *, const PetscReal *, const PetscReal *, const PetscScalar *, const PetscScalar *, const PetscScalar *);
1434: PETSC_EXTERN PetscErrorCode TSIRKInitializePackage(void);
1435: PETSC_EXTERN PetscErrorCode TSIRKFinalizePackage(void);
1436: PETSC_EXTERN PetscErrorCode TSIRKRegisterDestroy(void);

1438: /*J
1439:    TSGLEEType - String with the name of a General Linear with Error Estimation `TSGLEE` type

1441:    Level: beginner

1443: .seealso: [](ch_ts), `TSGLEESetType()`, `TS`, `TSGLEE`, `TSGLEERegister()`
1444: J*/
1445: typedef const char *TSGLEEType;
1446: #define TSGLEEi1      "BE1"
1447: #define TSGLEE23      "23"
1448: #define TSGLEE24      "24"
1449: #define TSGLEE25I     "25i"
1450: #define TSGLEE35      "35"
1451: #define TSGLEEEXRK2A  "exrk2a"
1452: #define TSGLEERK32G1  "rk32g1"
1453: #define TSGLEERK285EX "rk285ex"

1455: /*J
1456:    TSGLEEMode - String with the mode of error estimation for a General Linear with Error Estimation `TSGLEE` type

1458:    Level: beginner

1460: .seealso: [](ch_ts), `TSGLEESetMode()`, `TS`, `TSGLEE`, `TSGLEERegister()`
1461: J*/
1462: PETSC_EXTERN PetscErrorCode TSGLEEGetType(TS, TSGLEEType *);
1463: PETSC_EXTERN PetscErrorCode TSGLEESetType(TS, TSGLEEType);
1464: PETSC_EXTERN PetscErrorCode TSGLEERegister(TSGLEEType, PetscInt, PetscInt, PetscInt, PetscReal, const PetscReal[], const PetscReal[], const PetscReal[], const PetscReal[], const PetscReal[], const PetscReal[], const PetscReal[], const PetscReal[], const PetscReal[], const PetscReal[], PetscInt, const PetscReal[]);
1465: PETSC_EXTERN PetscErrorCode TSGLEERegisterAll(void);
1466: PETSC_EXTERN PetscErrorCode TSGLEEFinalizePackage(void);
1467: PETSC_EXTERN PetscErrorCode TSGLEEInitializePackage(void);
1468: PETSC_EXTERN PetscErrorCode TSGLEERegisterDestroy(void);

1470: /*J
1471:   TSARKIMEXType - String with the name of an Additive Runge-Kutta IMEX `TSARKIMEX` type

1473:   Options Database Key:
1474: . -ts_arkimex_type (1bee|a2|l2|ars122|2c|2d|2e|prssp2|3|bpr3|ars443|4|5) - set `TSARKIMEX` scheme type, see `TSARKIMEXType`

1476:   Level: beginner

1478: .seealso: [](ch_ts), `TSARKIMEXSetType()`, `TS`, `TSARKIMEX`, `TSARKIMEXRegister()`
1479: J*/
1480: typedef const char *TSARKIMEXType;
1481: #define TSARKIMEX1BEE   "1bee"
1482: #define TSARKIMEXA2     "a2"
1483: #define TSARKIMEXL2     "l2"
1484: #define TSARKIMEXARS122 "ars122"
1485: #define TSARKIMEX2C     "2c"
1486: #define TSARKIMEX2D     "2d"
1487: #define TSARKIMEX2E     "2e"
1488: #define TSARKIMEXPRSSP2 "prssp2"
1489: #define TSARKIMEX3      "3"
1490: #define TSARKIMEXBPR3   "bpr3"
1491: #define TSARKIMEXARS443 "ars443"
1492: #define TSARKIMEX4      "4"
1493: #define TSARKIMEX5      "5"

1495: PETSC_EXTERN PetscErrorCode TSARKIMEXGetType(TS, TSARKIMEXType *);
1496: PETSC_EXTERN PetscErrorCode TSARKIMEXSetType(TS, TSARKIMEXType);
1497: PETSC_EXTERN PetscErrorCode TSARKIMEXSetFullyImplicit(TS, PetscBool);
1498: PETSC_EXTERN PetscErrorCode TSARKIMEXGetFullyImplicit(TS, PetscBool *);
1499: PETSC_EXTERN PetscErrorCode TSARKIMEXSetFastSlowSplit(TS, PetscBool);
1500: PETSC_EXTERN PetscErrorCode TSARKIMEXGetFastSlowSplit(TS, PetscBool *);
1501: 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[]);
1502: PETSC_EXTERN PetscErrorCode TSARKIMEXInitializePackage(void);
1503: PETSC_EXTERN PetscErrorCode TSARKIMEXFinalizePackage(void);
1504: PETSC_EXTERN PetscErrorCode TSARKIMEXRegisterDestroy(void);

1506: /*J
1507:    TSDIRKType - String with the name of a Diagonally Implicit Runge-Kutta `TSDIRK` type

1509:    Level: beginner

1511: .seealso: [](ch_ts), `TSDIRKSetType()`, `TS`, `TSDIRK`, `TSDIRKRegister()`
1512: J*/
1513: typedef const char *TSDIRKType;
1514: #define TSDIRKS212      "s212"
1515: #define TSDIRKES122SAL  "es122sal"
1516: #define TSDIRKES213SAL  "es213sal"
1517: #define TSDIRKES324SAL  "es324sal"
1518: #define TSDIRKES325SAL  "es325sal"
1519: #define TSDIRK657A      "657a"
1520: #define TSDIRKES648SA   "es648sa"
1521: #define TSDIRK658A      "658a"
1522: #define TSDIRKS659A     "s659a"
1523: #define TSDIRK7510SAL   "7510sal"
1524: #define TSDIRKES7510SA  "es7510sa"
1525: #define TSDIRK759A      "759a"
1526: #define TSDIRKS7511SAL  "s7511sal"
1527: #define TSDIRK8614A     "8614a"
1528: #define TSDIRK8616SAL   "8616sal"
1529: #define TSDIRKES8516SAL "es8516sal"

1531: PETSC_EXTERN PetscErrorCode TSDIRKGetType(TS, TSDIRKType *);
1532: PETSC_EXTERN PetscErrorCode TSDIRKSetType(TS, TSDIRKType);
1533: PETSC_EXTERN PetscErrorCode TSDIRKRegister(TSDIRKType, PetscInt, PetscInt, const PetscReal[], const PetscReal[], const PetscReal[], const PetscReal[], PetscInt, const PetscReal[]);

1535: /*J
1536:    TSRosWType - String with the name of a Rosenbrock-W `TSROSW` type

1538:    Level: beginner

1540: .seealso: [](ch_ts), `TSRosWSetType()`, `TS`, `TSROSW`, `TSRosWRegister()`
1541: J*/
1542: typedef const char *TSRosWType;
1543: #define TSROSW2M          "2m"
1544: #define TSROSW2P          "2p"
1545: #define TSROSWRA3PW       "ra3pw"
1546: #define TSROSWRA34PW2     "ra34pw2"
1547: #define TSROSWR34PRW      "r34prw"
1548: #define TSROSWR3PRL2      "r3prl2"
1549: #define TSROSWRODAS3      "rodas3"
1550: #define TSROSWRODASPR     "rodaspr"
1551: #define TSROSWRODASPR2    "rodaspr2"
1552: #define TSROSWSANDU3      "sandu3"
1553: #define TSROSWASSP3P3S1C  "assp3p3s1c"
1554: #define TSROSWLASSP3P4S2C "lassp3p4s2c"
1555: #define TSROSWLLSSP3P4S2C "llssp3p4s2c"
1556: #define TSROSWARK3        "ark3"
1557: #define TSROSWTHETA1      "theta1"
1558: #define TSROSWTHETA2      "theta2"
1559: #define TSROSWGRK4T       "grk4t"
1560: #define TSROSWSHAMP4      "shamp4"
1561: #define TSROSWVELDD4      "veldd4"
1562: #define TSROSW4L          "4l"

1564: PETSC_EXTERN PetscErrorCode TSRosWGetType(TS, TSRosWType *);
1565: PETSC_EXTERN PetscErrorCode TSRosWSetType(TS, TSRosWType);
1566: PETSC_EXTERN PetscErrorCode TSRosWSetRecomputeJacobian(TS, PetscBool);
1567: PETSC_EXTERN PetscErrorCode TSRosWRegister(TSRosWType, PetscInt, PetscInt, const PetscReal[], const PetscReal[], const PetscReal[], const PetscReal[], PetscInt, const PetscReal[]);
1568: PETSC_EXTERN PetscErrorCode TSRosWRegisterRos4(TSRosWType, PetscReal, PetscReal, PetscReal, PetscReal, PetscReal);
1569: PETSC_EXTERN PetscErrorCode TSRosWInitializePackage(void);
1570: PETSC_EXTERN PetscErrorCode TSRosWFinalizePackage(void);
1571: PETSC_EXTERN PetscErrorCode TSRosWRegisterDestroy(void);

1573: PETSC_EXTERN PetscErrorCode TSBDFSetOrder(TS, PetscInt);
1574: PETSC_EXTERN PetscErrorCode TSBDFGetOrder(TS, PetscInt *);

1576: /*J
1577:   TSBasicSymplecticType - String with the name of a basic symplectic integration `TSBASICSYMPLECTIC` type

1579:   Level: beginner

1581: .seealso: [](ch_ts), `TSBasicSymplecticSetType()`, `TS`, `TSBASICSYMPLECTIC`, `TSBasicSymplecticRegister()`
1582: J*/
1583: typedef const char *TSBasicSymplecticType;
1584: #define TSBASICSYMPLECTICSIEULER   "1"
1585: #define TSBASICSYMPLECTICVELVERLET "2"
1586: #define TSBASICSYMPLECTIC3         "3"
1587: #define TSBASICSYMPLECTIC4         "4"

1589: PETSC_EXTERN PetscErrorCode TSBasicSymplecticSetType(TS, TSBasicSymplecticType);
1590: PETSC_EXTERN PetscErrorCode TSBasicSymplecticGetType(TS, TSBasicSymplecticType *);
1591: PETSC_EXTERN PetscErrorCode TSBasicSymplecticRegister(TSBasicSymplecticType, PetscInt, PetscInt, PetscReal[], PetscReal[]);
1592: PETSC_EXTERN PetscErrorCode TSBasicSymplecticRegisterAll(void);
1593: PETSC_EXTERN PetscErrorCode TSBasicSymplecticInitializePackage(void);
1594: PETSC_EXTERN PetscErrorCode TSBasicSymplecticFinalizePackage(void);
1595: PETSC_EXTERN PetscErrorCode TSBasicSymplecticRegisterDestroy(void);

1597: /*E
1598:    TSDGType - Selects the discrete-gradient flavor used by `TSDISCGRAD` when integrating gradient-system ODEs

1600:    Values:
1601: +   `TS_DG_GONZALEZ` - Gonzalez's mid-point-style discrete gradient
1602: .   `TS_DG_AVERAGE`  - average vector field (AVF) discrete gradient
1603: -   `TS_DG_NONE`     - do not apply a discrete gradient correction; the integrator falls back to a standard mid-point rule

1605:    Level: advanced

1607: .seealso: `TS`, `TSDISCGRAD`, `TSDiscGradSetType()`, `TSDiscGradGetType()`, `TSDiscGradSetFormulation()`
1608: E*/
1609: typedef enum {
1610:   TS_DG_GONZALEZ,
1611:   TS_DG_AVERAGE,
1612:   TS_DG_NONE
1613: } TSDGType;
1614: PETSC_EXTERN PetscErrorCode TSDiscGradSetFormulation(TS, PetscErrorCode (*)(TS, PetscReal, Vec, Mat, void *), PetscErrorCode (*)(TS, PetscReal, Vec, PetscScalar *, void *), PetscErrorCode (*)(TS, PetscReal, Vec, Vec, void *), void *);
1615: PETSC_EXTERN PetscErrorCode TSDiscGradGetFormulation(TS, PetscErrorCode (**)(TS, PetscReal, Vec, Mat, void *), PetscErrorCode (**)(TS, PetscReal, Vec, PetscScalar *, void *), PetscErrorCode (**)(TS, PetscReal, Vec, Vec, void *), void *);
1616: PETSC_EXTERN PetscErrorCode TSDiscGradSetImplicitFormulation(TS, PetscErrorCode (*)(TS, PetscReal, Vec, Vec, Vec, void *), PetscErrorCode (*)(TS, PetscReal, Vec, Vec, PetscReal, Mat, Mat, void *));
1617: PETSC_EXTERN PetscErrorCode TSDiscGradSetType(TS, TSDGType);
1618: PETSC_EXTERN PetscErrorCode TSDiscGradGetType(TS, TSDGType *);
1619: PETSC_EXTERN PetscErrorCode TSDiscGradGetX0AndXdot(TS, DM, Vec *, Vec *);
1620: PETSC_EXTERN PetscErrorCode TSDiscGradRestoreX0AndXdot(TS, DM, Vec *, Vec *);

1622: /*
1623:        PETSc interface to Sundials
1624: */
1625: #ifdef PETSC_HAVE_SUNDIALS2
1626: /*E
1627:    TSSundialsLmmType - Selects which linear multistep method is used by the `TSSUNDIALS` interface to SUNDIALS' CVODE integrator

1629:    Values:
1630: +   `SUNDIALS_ADAMS` - variable-order Adams methods (non-stiff problems)
1631: -   `SUNDIALS_BDF`   - variable-order backward differentiation formulas (stiff problems)

1633:    Level: intermediate

1635: .seealso: `TS`, `TSSUNDIALS`, `TSSundialsSetType()`, `TSSundialsGramSchmidtType`
1636: E*/
1637: typedef enum {
1638:   SUNDIALS_ADAMS = 1,
1639:   SUNDIALS_BDF   = 2
1640: } TSSundialsLmmType;
1641: PETSC_EXTERN const char *const TSSundialsLmmTypes[];
1642: /*E
1643:    TSSundialsGramSchmidtType - Selects the Gram--Schmidt orthogonalization variant used by SUNDIALS' internal GMRES inside `TSSUNDIALS`

1645:    Values:
1646: +   `SUNDIALS_MODIFIED_GS`  - modified Gram--Schmidt (more stable)
1647: -   `SUNDIALS_CLASSICAL_GS` - classical Gram--Schmidt (cheaper, less stable)

1649:    Level: advanced

1651: .seealso: `TS`, `TSSUNDIALS`, `TSSundialsSetGramSchmidtType()`, `TSSundialsLmmType`
1652: E*/
1653: typedef enum {
1654:   SUNDIALS_MODIFIED_GS  = 1,
1655:   SUNDIALS_CLASSICAL_GS = 2
1656: } TSSundialsGramSchmidtType;
1657: PETSC_EXTERN const char *const TSSundialsGramSchmidtTypes[];

1659: PETSC_EXTERN PetscErrorCode TSSundialsSetType(TS, TSSundialsLmmType);
1660: PETSC_EXTERN PetscErrorCode TSSundialsGetPC(TS, PC *);
1661: PETSC_EXTERN PetscErrorCode TSSundialsSetTolerance(TS, PetscReal, PetscReal);
1662: PETSC_EXTERN PetscErrorCode TSSundialsSetMinTimeStep(TS, PetscReal);
1663: PETSC_EXTERN PetscErrorCode TSSundialsSetMaxTimeStep(TS, PetscReal);
1664: PETSC_EXTERN PetscErrorCode TSSundialsGetIterations(TS, PetscInt *, PetscInt *);
1665: PETSC_EXTERN PetscErrorCode TSSundialsSetGramSchmidtType(TS, TSSundialsGramSchmidtType);
1666: PETSC_EXTERN PetscErrorCode TSSundialsSetGMRESRestart(TS, PetscInt);
1667: PETSC_EXTERN PetscErrorCode TSSundialsSetLinearTolerance(TS, PetscReal);
1668: PETSC_EXTERN PetscErrorCode TSSundialsMonitorInternalSteps(TS, PetscBool);
1669: PETSC_EXTERN PetscErrorCode TSSundialsSetMaxl(TS, PetscInt);
1670: PETSC_EXTERN PetscErrorCode TSSundialsSetMaxord(TS, PetscInt);
1671: PETSC_EXTERN PetscErrorCode TSSundialsSetUseDense(TS, PetscBool);
1672: #endif

1674: PETSC_EXTERN PetscErrorCode TSThetaSetTheta(TS, PetscReal);
1675: PETSC_EXTERN PetscErrorCode TSThetaGetTheta(TS, PetscReal *);
1676: PETSC_EXTERN PetscErrorCode TSThetaGetEndpoint(TS, PetscBool *);
1677: PETSC_EXTERN PetscErrorCode TSThetaSetEndpoint(TS, PetscBool);

1679: PETSC_EXTERN PetscErrorCode TSAlphaSetRadius(TS, PetscReal);
1680: PETSC_EXTERN PetscErrorCode TSAlphaSetParams(TS, PetscReal, PetscReal, PetscReal);
1681: PETSC_EXTERN PetscErrorCode TSAlphaGetParams(TS, PetscReal *, PetscReal *, PetscReal *);

1683: PETSC_EXTERN PetscErrorCode TSAlpha2SetRadius(TS, PetscReal);
1684: PETSC_EXTERN PetscErrorCode TSAlpha2SetParams(TS, PetscReal, PetscReal, PetscReal, PetscReal);
1685: PETSC_EXTERN PetscErrorCode TSAlpha2GetParams(TS, PetscReal *, PetscReal *, PetscReal *, PetscReal *);

1687: /*S
1688:   TSAlpha2PredictorFn - A callback to set the predictor (i.e., the initial guess for the nonlinear solver) in
1689:   a second-order generalized-alpha time integrator.

1691:   Calling Sequence:
1692: + ts   - the `TS` context obtained from `TSCreate()`
1693: . X0   - the previous time step's state vector
1694: . V0   - the previous time step's first derivative of the state vector
1695: . A0   - the previous time step's second derivative of the state vector
1696: . X1   - the vector into which the initial guess for the current time step will be written
1697: - ctx  - [optional] user-defined context for the predictor evaluation routine (may be `NULL`)

1699:   Level: intermediate

1701:   Note:
1702:   The deprecated `TSAlpha2Predictor` still works as a replacement for `TSAlpha2PredictorFn` *.

1704: .seealso: [](ch_ts), `TS`, `TSAlpha2SetPredictor()`
1705: S*/
1706: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode TSAlpha2PredictorFn(TS ts, Vec X0, Vec V0, Vec A0, Vec X1, PetscCtx ctx);

1708: PETSC_EXTERN_TYPEDEF typedef TSAlpha2PredictorFn *TSAlpha2Predictor;

1710: PETSC_EXTERN PetscErrorCode TSAlpha2SetPredictor(TS, TSAlpha2PredictorFn *, void *);

1712: PETSC_EXTERN PetscErrorCode TSSetDM(TS, DM);
1713: PETSC_EXTERN PetscErrorCode TSGetDM(TS, DM *);

1715: PETSC_EXTERN PetscErrorCode SNESTSFormFunction(SNES, Vec, Vec, void *);
1716: PETSC_EXTERN PetscErrorCode SNESTSFormJacobian(SNES, Vec, Mat, Mat, void *);

1718: PETSC_EXTERN PetscErrorCode TSRHSJacobianTest(TS, PetscBool *);
1719: PETSC_EXTERN PetscErrorCode TSRHSJacobianTestTranspose(TS, PetscBool *);

1721: PETSC_EXTERN PetscErrorCode TSGetComputeInitialCondition(TS, PetscErrorCode (**)(TS, Vec));
1722: PETSC_EXTERN PetscErrorCode TSSetComputeInitialCondition(TS, PetscErrorCode (*)(TS, Vec));
1723: PETSC_EXTERN PetscErrorCode TSComputeInitialCondition(TS, Vec);
1724: PETSC_EXTERN PetscErrorCode TSGetComputeExactError(TS, PetscErrorCode (**)(TS, Vec, Vec));
1725: PETSC_EXTERN PetscErrorCode TSSetComputeExactError(TS, PetscErrorCode (*)(TS, Vec, Vec));
1726: PETSC_EXTERN PetscErrorCode TSComputeExactError(TS, Vec, Vec);
1727: PETSC_EXTERN PetscErrorCode PetscConvEstUseTS(PetscConvEst, PetscBool);

1729: PETSC_EXTERN PetscErrorCode TSSetMatStructure(TS, MatStructure);