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>
  9: #include <petscdrawtypes.h>

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

 13: /* SUBMANSEC = TS */

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

 18:    Level: beginner

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

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

 27:    Level: beginner

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

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

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

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

 67:    Level: beginner

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

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

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

 84:    Level: beginner

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

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: /*@
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: /*@
465:   TSGetTimeSpanSolutions - Get the number of solutions and the solutions at the time points specified by the time span.

467:   Not Collective

469:   Input Parameter:
470: . ts - the `TS` context obtained from `TSCreate()`

472:   Output Parameters:
473: + nsol - the number of solutions
474: - Sols - the solution vectors

476:   Level: deprecated

478:   Notes:
479:   Deprecated, use `TSGetEvaluationSolutions()`.

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

483:   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()`.
484:   For example, manipulating the step size, especially with a reduced precision, may cause `TS` to step over certain points in the span.
485:   This issue is alleviated in `TSGetEvaluationSolutions()` by returning the solution times that `Sols` were recorded at.

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

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

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

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

508:   Level: developer

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

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

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

526:   Level: developer

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

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

537:   Level: developer

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

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

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

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

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

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

586:   Level: beginner

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

593: PETSC_EXTERN_TYPEDEF typedef TSRHSFunctionFn *TSRHSFunction PETSC_DEPRECATED_TYPEDEF(3, 26, 0, "TSRHSFunctionFn*", );

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

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

606:   Level: beginner

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

613: PETSC_EXTERN_TYPEDEF typedef TSRHSJacobianFn *TSRHSJacobian PETSC_DEPRECATED_TYPEDEF(3, 26, 0, "TSRHSJacobianFn*", );

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

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

626:   Level: beginner

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

632: PETSC_EXTERN_TYPEDEF typedef TSRHSJacobianPFn *TSRHSJacobianP PETSC_DEPRECATED_TYPEDEF(3, 26, 0, "TSRHSJacobianPFn*", );

634: PETSC_EXTERN PetscErrorCode TSSetRHSFunction(TS, Vec, TSRHSFunctionFn *, PetscCtx);
635: PETSC_EXTERN PetscErrorCode TSGetRHSFunction(TS, Vec *, TSRHSFunctionFn **, PetscCtxRt);
636: PETSC_EXTERN PetscErrorCode TSSetRHSJacobian(TS, Mat, Mat, TSRHSJacobianFn *, PetscCtx);
637: PETSC_EXTERN PetscErrorCode TSGetRHSJacobian(TS, Mat *, Mat *, TSRHSJacobianFn **, PetscCtxRt);
638: PETSC_EXTERN PetscErrorCode TSRHSJacobianSetReuse(TS, PetscBool);

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

643:   Calling Sequence:
644: + ts  - timestep context
645: . t   - current time
646: . u   - output vector
647: - ctx - [optional] user-defined function context

649:   Level: advanced

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

655: PETSC_EXTERN_TYPEDEF typedef TSSolutionFn *TSSolutionFunction PETSC_DEPRECATED_TYPEDEF(3, 26, 0, "TSSolutionFn*", );

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

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

662:   Calling Sequence:
663: + ts  - timestep context
664: . t   - current time
665: . f   - output vector
666: - ctx - [optional] user-defined function context

668:   Level: advanced

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

674: PETSC_EXTERN_TYPEDEF typedef TSForcingFn *TSForcingFunction PETSC_DEPRECATED_TYPEDEF(3, 26, 0, "TSForcingFn*", );

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

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

681:   Calling Sequence:
682: + ts  - the `TS` context obtained from `TSCreate()`
683: . t   - time at step/stage being solved
684: . U   - state vector
685: . U_t - time derivative of state vector
686: . F   - function vector
687: - ctx - [optional] user-defined context for function

689:   Level: beginner

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

695: PETSC_EXTERN_TYPEDEF typedef TSIFunctionFn *TSIFunction PETSC_DEPRECATED_TYPEDEF(3, 26, 0, "TSIFunctionFn*", );

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

700:   Calling Sequence:
701: + ts   - the `TS` context obtained from `TSCreate()`
702: . t    - time at step/stage being solved
703: . U    - state vector
704: . U_t  - time derivative of state vector
705: . a    - shift
706: . Amat - (approximate) Jacobian of F(t,U,W+a*U), equivalent to dF/dU + a*dF/dU_t
707: . Pmat - matrix used for constructing preconditioner, usually the same as `Amat`
708: - ctx  - [optional] user-defined context for Jacobian evaluation routine

710:   Level: beginner

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

716: PETSC_EXTERN_TYPEDEF typedef TSIJacobianFn *TSIJacobian PETSC_DEPRECATED_TYPEDEF(3, 26, 0, "TSIJacobianFn*", );

718: /*S
719:   TSMassMatrixFn - A prototype of a `TS` mass matrix evaluation function that would be passed to `TSSetMassMatrix()`

721:   Calling Sequence:
722: + ts  - the `TS` context obtained from `TSCreate()`
723: . t   - the time at which the mass matrix is evaluated
724: . U   - the state vector at which the mass matrix is evaluated
725: . M   - the mass matrix $\partial F/\partial \dot U$ to be filled; it is pre-created by the framework with the correct layout
726: - ctx - [optional] application context for the mass matrix evaluation routine

728:   Level: intermediate

730:   Notes:
731:   The routine fills the provided matrix `M`; it should not create or destroy it. This mirrors `TSIJacobianFn`. The
732:   integrator supplies `M` pre-created with the correct layout; for `TSIRK` it is a duplicate of the matrix set with
733:   `TSSetIJacobian()`, so `M` has the Jacobian's nonzero pattern.
734:   As for `TSIJacobianFn`, the routine is responsible for zeroing any stale entries and for leaving `M` fully
735:   assembled; `TSComputeMassMatrix()` does not call `MatZeroEntries()` or `MatAssemblyBegin()`/`MatAssemblyEnd()`.

737:   `t` and `U` allow a time- or state-dependent mass matrix. For a constant mass matrix they may be ignored; also call
738:   `TSSetMassMatrixConstant()` so the mass matrix is assembled only once.

740:   The routine receives no `DM`; obtain it with `TSGetDM()` if needed, for example to assemble on a multigrid level. The
741:   integrator sets the current `DM` before calling, exactly as for `TSIFunctionFn` and `TSIJacobianFn`.

743: .seealso: [](ch_ts), `TSSetMassMatrix()`, `DMTSSetMassMatrix()`, `TSSetMassMatrixConstant()`, `TSIJacobianFn`
744: S*/
745: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode TSMassMatrixFn(TS ts, PetscReal t, Vec U, Mat M, PetscCtx ctx);

747: PETSC_EXTERN PetscErrorCode TSSetIFunction(TS, Vec, TSIFunctionFn *, PetscCtx);
748: PETSC_EXTERN PetscErrorCode TSGetIFunction(TS, Vec *, TSIFunctionFn **, PetscCtxRt);
749: PETSC_EXTERN PetscErrorCode TSSetIJacobian(TS, Mat, Mat, TSIJacobianFn *, PetscCtx);
750: PETSC_EXTERN PetscErrorCode TSGetIJacobian(TS, Mat *, Mat *, TSIJacobianFn **, PetscCtxRt);
751: PETSC_EXTERN PetscErrorCode TSSetMassMatrix(TS, TSMassMatrixFn *, PetscCtx);
752: PETSC_EXTERN PetscErrorCode TSGetMassMatrix(TS, TSMassMatrixFn **, PetscCtxRt);
753: PETSC_EXTERN PetscErrorCode TSSetMassMatrixContextDestroy(TS, PetscCtxDestroyFn *);
754: PETSC_EXTERN PetscErrorCode TSSetMassMatrixConstant(TS, PetscBool);
755: PETSC_EXTERN PetscErrorCode TSGetMassMatrixConstant(TS, PetscBool *);
756: PETSC_EXTERN PetscErrorCode TSComputeMassMatrix(TS, PetscReal, Vec, Mat);
757: PETSC_EXTERN PetscErrorCode TSHasMassMatrix(TS, PetscBool *);

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

762:   Calling Sequence:
763: + ts   - the `TS` context obtained from `TSCreate()`
764: . t    - time at step/stage being solved
765: . U    - state vector
766: . U_t  - time derivative of state vector
767: . U_tt - second time derivative of state vector
768: . F    - function vector
769: - ctx  - [optional] user-defined context for matrix evaluation routine (may be `NULL`)

771:   Level: advanced

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

777: PETSC_EXTERN_TYPEDEF typedef TSI2FunctionFn *TSI2Function PETSC_DEPRECATED_TYPEDEF(3, 26, 0, "TSI2FunctionFn*", );

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

782:   Calling Sequence:
783: + ts   - the `TS` context obtained from `TSCreate()`
784: . t    - time at step/stage being solved
785: . U    - state vector
786: . U_t  - time derivative of state vector
787: . U_tt - second time derivative of state vector
788: . v    - shift for U_t
789: . a    - shift for U_tt
790: . 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
791: . jac  - matrix from which to construct the preconditioner, may be same as `J`
792: - ctx  - [optional] user-defined context for matrix evaluation routine

794:   Level: advanced

796: .seealso: [](ch_ts), `TS`, `TSSetI2Jacobian()`, `DMTSSetI2Jacobian()`, `TSIFunctionFn`, `TSIJacobianFn`, `TSRHSFunctionFn`, `TSRHSJacobianFn`
797: S*/
798: 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);

800: PETSC_EXTERN_TYPEDEF typedef TSI2JacobianFn *TSI2Jacobian PETSC_DEPRECATED_TYPEDEF(3, 26, 0, "TSI2JacobianFn*", );

802: PETSC_EXTERN PetscErrorCode TSSetI2Function(TS, Vec, TSI2FunctionFn *, PetscCtx);
803: PETSC_EXTERN PetscErrorCode TSGetI2Function(TS, Vec *, TSI2FunctionFn **, PetscCtxRt);
804: PETSC_EXTERN PetscErrorCode TSSetI2Jacobian(TS, Mat, Mat, TSI2JacobianFn *, PetscCtx);
805: PETSC_EXTERN PetscErrorCode TSGetI2Jacobian(TS, Mat *, Mat *, TSI2JacobianFn **, PetscCtxRt);

807: PETSC_EXTERN PetscErrorCode TSRHSSplitSetIS(TS, const char[], IS);
808: PETSC_EXTERN PetscErrorCode TSRHSSplitGetIS(TS, const char[], IS *);
809: PETSC_EXTERN PetscErrorCode TSRHSSplitSetRHSFunction(TS, const char[], Vec, TSRHSFunctionFn *, PetscCtx);
810: PETSC_EXTERN PetscErrorCode TSRHSSplitSetIFunction(TS, const char[], Vec, TSIFunctionFn *, PetscCtx);
811: PETSC_EXTERN PetscErrorCode TSRHSSplitSetIJacobian(TS, const char[], Mat, Mat, TSIJacobianFn *, PetscCtx);
812: PETSC_EXTERN PetscErrorCode TSRHSSplitGetSubTS(TS, const char[], TS *);
813: PETSC_EXTERN PetscErrorCode TSRHSSplitGetSubTSs(TS, PetscInt *, TS *[]);
814: PETSC_EXTERN PetscErrorCode TSSetUseSplitRHSFunction(TS, PetscBool);
815: PETSC_EXTERN PetscErrorCode TSGetUseSplitRHSFunction(TS, PetscBool *);
816: PETSC_EXTERN PetscErrorCode TSRHSSplitGetSNES(TS, SNES *);
817: PETSC_EXTERN PetscErrorCode TSRHSSplitSetSNES(TS, SNES);

819: PETSC_EXTERN TSRHSFunctionFn TSComputeRHSFunctionLinear;
820: PETSC_EXTERN TSRHSJacobianFn TSComputeRHSJacobianConstant;
821: PETSC_EXTERN PetscErrorCode  TSComputeIFunctionLinear(TS, PetscReal, Vec, Vec, Vec, PetscCtx);
822: PETSC_EXTERN PetscErrorCode  TSComputeIJacobianConstant(TS, PetscReal, Vec, Vec, PetscReal, Mat, Mat, PetscCtx);
823: PETSC_EXTERN PetscErrorCode  TSComputeSolutionFunction(TS, PetscReal, Vec);
824: PETSC_EXTERN PetscErrorCode  TSComputeForcingFunction(TS, PetscReal, Vec);
825: PETSC_EXTERN PetscErrorCode  TSComputeIJacobianDefaultColor(TS, PetscReal, Vec, Vec, PetscReal, Mat, Mat, PetscCtx);
826: PETSC_EXTERN PetscErrorCode  TSPruneIJacobianColor(TS, Mat, Mat);

828: PETSC_EXTERN PetscErrorCode TSSetPreStep(TS, PetscErrorCode (*)(TS));
829: PETSC_EXTERN PetscErrorCode TSSetPreStage(TS, PetscErrorCode (*)(TS, PetscReal));
830: PETSC_EXTERN PetscErrorCode TSSetPostStage(TS, PetscErrorCode (*)(TS, PetscReal, PetscInt, Vec *));
831: PETSC_EXTERN PetscErrorCode TSSetPostEvaluate(TS, PetscErrorCode (*)(TS));
832: PETSC_EXTERN PetscErrorCode TSSetPostStep(TS, PetscErrorCode (*)(TS));
833: PETSC_EXTERN PetscErrorCode TSSetResize(TS, PetscBool, PetscErrorCode (*)(TS, PetscInt, PetscReal, Vec, PetscBool *, PetscCtx), PetscErrorCode (*)(TS, PetscInt, Vec[], Vec[], PetscCtx), PetscCtx);
834: PETSC_EXTERN PetscErrorCode TSPreStep(TS);
835: PETSC_EXTERN PetscErrorCode TSPreStage(TS, PetscReal);
836: PETSC_EXTERN PetscErrorCode TSPostStage(TS, PetscReal, PetscInt, Vec[]);
837: PETSC_EXTERN PetscErrorCode TSPostEvaluate(TS);
838: PETSC_EXTERN PetscErrorCode TSPostStep(TS);
839: PETSC_EXTERN PetscErrorCode TSResize(TS);
840: PETSC_EXTERN PetscErrorCode TSResizeRetrieveVec(TS, const char *, Vec *);
841: PETSC_EXTERN PetscErrorCode TSResizeRegisterVec(TS, const char *, Vec);
842: PETSC_EXTERN PetscErrorCode TSGetStepResize(TS, PetscBool *);

844: PETSC_EXTERN PetscErrorCode TSInterpolate(TS, PetscReal, Vec);
845: PETSC_EXTERN PetscErrorCode TSSetTolerances(TS, PetscReal, Vec, PetscReal, Vec);
846: PETSC_EXTERN PetscErrorCode TSGetTolerances(TS, PetscReal *, Vec *, PetscReal *, Vec *);
847: PETSC_EXTERN PetscErrorCode TSErrorWeightedNorm(TS, Vec, Vec, NormType, PetscReal *, PetscReal *, PetscReal *);
848: PETSC_EXTERN PetscErrorCode TSErrorWeightedENorm(TS, Vec, Vec, Vec, NormType, PetscReal *, PetscReal *, PetscReal *);
849: PETSC_EXTERN PetscErrorCode TSSetCFLTimeLocal(TS, PetscReal);
850: PETSC_EXTERN PetscErrorCode TSGetCFLTime(TS, PetscReal *);
851: PETSC_EXTERN PetscErrorCode TSSetFunctionDomainError(TS, PetscErrorCode (*)(TS, PetscReal, Vec, PetscBool *));
852: PETSC_EXTERN PetscErrorCode TSFunctionDomainError(TS, PetscReal, Vec, PetscBool *);

854: PETSC_EXTERN PetscErrorCode TSPseudoSetTimeStep(TS, PetscErrorCode (*)(TS, PetscReal *, PetscCtx), PetscCtx);
855: PETSC_EXTERN PetscErrorCode TSPseudoTimeStepDefault(TS, PetscReal *, PetscCtx);
856: PETSC_EXTERN PetscErrorCode TSPseudoSetMaxTimeStep(TS, PetscReal);
857: PETSC_EXTERN PetscErrorCode TSPseudoSetVerifyTimeStep(TS, PetscErrorCode (*)(TS, Vec, PetscCtx, PetscReal *, PetscBool *), PetscCtx);
858: PETSC_EXTERN PetscErrorCode TSPseudoSetTimeStepIncrement(TS, PetscReal);
859: PETSC_EXTERN PetscErrorCode TSPseudoIncrementDtFromInitialDt(TS);
860: PETSC_EXTERN PetscErrorCode TSPseudoComputeFunction(TS, Vec, Vec *, PetscReal *);

862: PETSC_EXTERN PetscErrorCode TSPythonSetType(TS, const char[]);
863: PETSC_EXTERN PetscErrorCode TSPythonGetType(TS, const char *[]);

865: PETSC_EXTERN PetscErrorCode TSComputeRHSFunction(TS, PetscReal, Vec, Vec);
866: PETSC_EXTERN PetscErrorCode TSComputeRHSJacobian(TS, PetscReal, Vec, Mat, Mat);
867: PETSC_EXTERN PetscErrorCode TSComputeIFunction(TS, PetscReal, Vec, Vec, Vec, PetscBool);
868: PETSC_EXTERN PetscErrorCode TSComputeIJacobian(TS, PetscReal, Vec, Vec, PetscReal, Mat, Mat, PetscBool);
869: PETSC_EXTERN PetscErrorCode TSComputeI2Function(TS, PetscReal, Vec, Vec, Vec, Vec);
870: PETSC_EXTERN PetscErrorCode TSComputeI2Jacobian(TS, PetscReal, Vec, Vec, Vec, PetscReal, PetscReal, Mat, Mat);
871: PETSC_EXTERN PetscErrorCode TSComputeLinearStability(TS, PetscReal, PetscReal, PetscReal *, PetscReal *);

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

875: PETSC_EXTERN PetscErrorCode DMTSSetBoundaryLocal(DM, PetscErrorCode (*)(DM, PetscReal, Vec, Vec, PetscCtx), PetscCtx);
876: PETSC_EXTERN PetscErrorCode DMTSSetIFunctionPre(DM, PetscErrorCode (*)(DM, PetscReal, Vec, Vec, PetscCtx), PetscCtx);
877: PETSC_EXTERN PetscErrorCode DMTSSetRHSFunction(DM, TSRHSFunctionFn *, PetscCtx);
878: PETSC_EXTERN PetscErrorCode DMTSGetRHSFunction(DM, TSRHSFunctionFn **, PetscCtxRt);
879: PETSC_EXTERN PetscErrorCode DMTSSetRHSFunctionContextDestroy(DM, PetscCtxDestroyFn *);
880: PETSC_EXTERN PetscErrorCode DMTSSetRHSJacobian(DM, TSRHSJacobianFn *, PetscCtx);
881: PETSC_EXTERN PetscErrorCode DMTSGetRHSJacobian(DM, TSRHSJacobianFn **, PetscCtxRt);
882: PETSC_EXTERN PetscErrorCode DMTSSetRHSJacobianContextDestroy(DM, PetscCtxDestroyFn *);
883: PETSC_EXTERN PetscErrorCode DMTSSetIFunction(DM, TSIFunctionFn *, PetscCtx);
884: PETSC_EXTERN PetscErrorCode DMTSGetIFunction(DM, TSIFunctionFn **, PetscCtxRt);
885: PETSC_EXTERN PetscErrorCode DMTSSetIFunctionContextDestroy(DM, PetscCtxDestroyFn *);
886: PETSC_EXTERN PetscErrorCode DMTSSetIJacobian(DM, TSIJacobianFn *, PetscCtx);
887: PETSC_EXTERN PetscErrorCode DMTSGetIJacobian(DM, TSIJacobianFn **, PetscCtxRt);
888: PETSC_EXTERN PetscErrorCode DMTSSetIJacobianContextDestroy(DM, PetscCtxDestroyFn *);
889: PETSC_EXTERN PetscErrorCode DMTSSetMassMatrix(DM, TSMassMatrixFn *, PetscCtx);
890: PETSC_EXTERN PetscErrorCode DMTSGetMassMatrix(DM, TSMassMatrixFn **, PetscCtxRt);
891: PETSC_EXTERN PetscErrorCode DMTSSetMassMatrixContextDestroy(DM, PetscCtxDestroyFn *);
892: PETSC_EXTERN PetscErrorCode DMTSSetI2Function(DM, TSI2FunctionFn *, PetscCtx);
893: PETSC_EXTERN PetscErrorCode DMTSGetI2Function(DM, TSI2FunctionFn **, PetscCtxRt);
894: PETSC_EXTERN PetscErrorCode DMTSSetI2FunctionContextDestroy(DM, PetscCtxDestroyFn *);
895: PETSC_EXTERN PetscErrorCode DMTSSetI2Jacobian(DM, TSI2JacobianFn *, PetscCtx);
896: PETSC_EXTERN PetscErrorCode DMTSGetI2Jacobian(DM, TSI2JacobianFn **, PetscCtxRt);
897: PETSC_EXTERN PetscErrorCode DMTSSetI2JacobianContextDestroy(DM, PetscCtxDestroyFn *);

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

902:   Calling Sequence:
903: + ts  - timestep context
904: . p   - input vector (primitive form)
905: . c   - output vector, transient variables (conservative form)
906: - ctx - [optional] user-defined function context

908:   Level: advanced

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

914: PETSC_EXTERN_TYPEDEF typedef TSTransientVariableFn *TSTransientVariable PETSC_DEPRECATED_TYPEDEF(3, 26, 0, "TSTransientVariableFn*", );

916: PETSC_EXTERN PetscErrorCode TSSetTransientVariable(TS, TSTransientVariableFn *, PetscCtx);
917: PETSC_EXTERN PetscErrorCode DMTSSetTransientVariable(DM, TSTransientVariableFn *, PetscCtx);
918: PETSC_EXTERN PetscErrorCode DMTSGetTransientVariable(DM, TSTransientVariableFn **, PetscCtx);
919: PETSC_EXTERN PetscErrorCode TSComputeTransientVariable(TS, Vec, Vec);
920: PETSC_EXTERN PetscErrorCode TSHasTransientVariable(TS, PetscBool *);

922: PETSC_EXTERN PetscErrorCode DMTSSetSolutionFunction(DM, TSSolutionFn *, PetscCtx);
923: PETSC_EXTERN PetscErrorCode DMTSGetSolutionFunction(DM, TSSolutionFn **, PetscCtxRt);
924: PETSC_EXTERN PetscErrorCode DMTSSetForcingFunction(DM, TSForcingFn *, PetscCtx);
925: PETSC_EXTERN PetscErrorCode DMTSGetForcingFunction(DM, TSForcingFn **, PetscCtxRt);
926: PETSC_EXTERN PetscErrorCode DMTSCheckResidual(TS, DM, PetscReal, Vec, Vec, PetscReal, PetscReal *);
927: PETSC_EXTERN PetscErrorCode DMTSCheckJacobian(TS, DM, PetscReal, Vec, Vec, PetscReal, PetscBool *, PetscReal *);
928: PETSC_EXTERN PetscErrorCode DMTSCheckFromOptions(TS, Vec);

930: PETSC_EXTERN PetscErrorCode DMTSGetIFunctionLocal(DM, PetscErrorCode (**)(DM, PetscReal, Vec, Vec, Vec, PetscCtx), PetscCtxRt);
931: PETSC_EXTERN PetscErrorCode DMTSSetIFunctionLocal(DM, PetscErrorCode (*)(DM, PetscReal, Vec, Vec, Vec, PetscCtx), PetscCtx);
932: PETSC_EXTERN PetscErrorCode DMTSGetIJacobianLocal(DM, PetscErrorCode (**)(DM, PetscReal, Vec, Vec, PetscReal, Mat, Mat, PetscCtx), PetscCtxRt);
933: PETSC_EXTERN PetscErrorCode DMTSSetIJacobianLocal(DM, PetscErrorCode (*)(DM, PetscReal, Vec, Vec, PetscReal, Mat, Mat, PetscCtx), PetscCtx);
934: PETSC_EXTERN PetscErrorCode DMTSGetRHSFunctionLocal(DM, PetscErrorCode (**)(DM, PetscReal, Vec, Vec, PetscCtx), PetscCtxRt);
935: PETSC_EXTERN PetscErrorCode DMTSSetRHSFunctionLocal(DM, PetscErrorCode (*)(DM, PetscReal, Vec, Vec, PetscCtx), PetscCtx);
936: PETSC_EXTERN PetscErrorCode DMTSCreateRHSMassMatrix(DM);
937: PETSC_EXTERN PetscErrorCode DMTSCreateRHSMassMatrixLumped(DM);
938: PETSC_EXTERN PetscErrorCode DMTSDestroyRHSMassMatrix(DM);

940: PETSC_EXTERN PetscErrorCode DMTSSetIFunctionSerialize(DM, PetscErrorCode (*)(PetscCtx, PetscViewer), PetscErrorCode (*)(PetscCtx *, PetscViewer));
941: PETSC_EXTERN PetscErrorCode DMTSSetIJacobianSerialize(DM, PetscErrorCode (*)(PetscCtx, PetscViewer), PetscErrorCode (*)(PetscCtx *, PetscViewer));

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

946:   Calling Sequence:
947: + info - defines the subdomain to evaluate the residual on
948: . t    - time at which to evaluate residual
949: . x    - array of local state information
950: . f    - output array of local residual information
951: - ctx  - optional application context

953:   Level: beginner

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

959: PETSC_EXTERN_TYPEDEF typedef DMDATSRHSFunctionLocalFn *DMDATSRHSFunctionLocal PETSC_DEPRECATED_TYPEDEF(3, 26, 0, "DMDATSRHSFunctionLocalFn*", );

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

964:   Calling Sequence:
965: + info - defines the subdomain to evaluate the residual on
966: . t    - time at which to evaluate residual
967: . x    - array of local state information
968: . J    - Jacobian matrix
969: . B    - matrix from which to construct the preconditioner; often same as `J`
970: - ctx  - optional context

972:   Level: beginner

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

978: PETSC_EXTERN_TYPEDEF typedef DMDATSRHSJacobianLocalFn *DMDATSRHSJacobianLocal PETSC_DEPRECATED_TYPEDEF(3, 26, 0, "DMDATSRHSJacobianLocalFn*", );

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

983:   Calling Sequence:
984: + info  - defines the subdomain to evaluate the residual on
985: . t     - time at which to evaluate residual
986: . x     - array of local state information
987: . xdot  - array of local time derivative information
988: . imode - output array of local function evaluation information
989: - ctx   - optional context

991:   Level: beginner

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

997: PETSC_EXTERN_TYPEDEF typedef DMDATSIFunctionLocalFn *DMDATSIFunctionLocal PETSC_DEPRECATED_TYPEDEF(3, 26, 0, "DMDATSIFunctionLocalFn*", );

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

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

1012:   Level: beginner

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

1018: PETSC_EXTERN_TYPEDEF typedef DMDATSIJacobianLocalFn *DMDATSIJacobianLocal PETSC_DEPRECATED_TYPEDEF(3, 26, 0, "DMDATSIJacobianLocalFn*", );

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

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

1028:   Level: developer

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

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

1037:   Level: developer

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

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

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

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

1067: #define TS_FILE_CLASSID 1211225

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

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

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

1098:   Level: developer

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

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

1110:   Level: developer

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

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

1123:   Level: developer

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

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

1135:   Level: developer

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

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

1147:   Level: developer

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

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

1160:    Level: intermediate

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

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

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

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

1182:    Level: beginner

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

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

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

1202:    Level: beginner

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

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

1211:    Level: beginner

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

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

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

1264:    Level: beginner

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

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

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

1276:    Level: beginner

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

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

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

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

1302:    Level: beginner

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

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

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

1319:   Level: beginner

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

1326: PETSC_EXTERN_TYPEDEF typedef TSGLLEAcceptFn *TSGLLEAcceptFunction PETSC_DEPRECATED_TYPEDEF(3, 26, 0, "TSGLLEAcceptFn*", );

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

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

1333:   Level: beginner

1335: .seealso: [](ch_ts), `TS`, `TSGLLE`, `TSGLLESetType()`, `TSGLLERegister()`, `TSGLLEAccept`
1336: J*/
1337: typedef const char *TSGLLEType;
1338: #define TSGLLE_IRKS "irks"

1340: PETSC_EXTERN PetscErrorCode TSGLLERegister(const char[], PetscErrorCode (*)(TS));
1341: PETSC_EXTERN PetscErrorCode TSGLLEInitializePackage(void);
1342: PETSC_EXTERN PetscErrorCode TSGLLEFinalizePackage(void);
1343: PETSC_EXTERN PetscErrorCode TSGLLESetType(TS, TSGLLEType);
1344: PETSC_EXTERN PetscErrorCode TSGLLEGetAdapt(TS, TSGLLEAdapt *);
1345: PETSC_EXTERN PetscErrorCode TSGLLESetAcceptType(TS, TSGLLEAcceptType);

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

1350:    Level: beginner

1352: .seealso: [](ch_ts), `TSEIMEXSetType()`, `TS`, `TSEIMEX`, `TSEIMEXRegister()`
1353: J*/
1354: #define TSEIMEXType char *

1356: PETSC_EXTERN PetscErrorCode TSEIMEXSetMaxRows(TS, PetscInt);
1357: PETSC_EXTERN PetscErrorCode TSEIMEXSetRowCol(TS, PetscInt, PetscInt);
1358: PETSC_EXTERN PetscErrorCode TSEIMEXSetOrdAdapt(TS, PetscBool);

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

1363:    Level: beginner

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

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

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

1395:    Level: beginner

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

1407: PETSC_EXTERN PetscErrorCode TSMPRKGetType(TS, TSMPRKType *);
1408: PETSC_EXTERN PetscErrorCode TSMPRKSetType(TS, TSMPRKType);
1409: 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[]);
1410: PETSC_EXTERN PetscErrorCode TSMPRKInitializePackage(void);
1411: PETSC_EXTERN PetscErrorCode TSMPRKFinalizePackage(void);
1412: PETSC_EXTERN PetscErrorCode TSMPRKRegisterDestroy(void);

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

1417:    Level: beginner

1419: .seealso: [](ch_ts), `TSIRKSetType()`, `TS`, `TSIRK`, `TSIRKRegister()`
1420: J*/
1421: typedef const char *TSIRKType;
1422: #define TSIRKGAUSS "gauss"

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

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

1437:    Level: beginner

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

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

1454:    Level: beginner

1456: .seealso: [](ch_ts), `TSGLEESetMode()`, `TS`, `TSGLEE`, `TSGLEERegister()`
1457: J*/
1458: PETSC_EXTERN PetscErrorCode TSGLEEGetType(TS, TSGLEEType *);
1459: PETSC_EXTERN PetscErrorCode TSGLEESetType(TS, TSGLEEType);
1460: 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[]);
1461: PETSC_EXTERN PetscErrorCode TSGLEERegisterAll(void);
1462: PETSC_EXTERN PetscErrorCode TSGLEEFinalizePackage(void);
1463: PETSC_EXTERN PetscErrorCode TSGLEEInitializePackage(void);
1464: PETSC_EXTERN PetscErrorCode TSGLEERegisterDestroy(void);

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

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

1472:   Level: beginner

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

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

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

1505:    Level: beginner

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

1527: PETSC_EXTERN PetscErrorCode TSDIRKGetType(TS, TSDIRKType *);
1528: PETSC_EXTERN PetscErrorCode TSDIRKSetType(TS, TSDIRKType);
1529: PETSC_EXTERN PetscErrorCode TSDIRKRegister(TSDIRKType, PetscInt, PetscInt, const PetscReal[], const PetscReal[], const PetscReal[], const PetscReal[], PetscInt, const PetscReal[]);

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

1534:    Level: beginner

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

1560: PETSC_EXTERN PetscErrorCode TSRosWGetType(TS, TSRosWType *);
1561: PETSC_EXTERN PetscErrorCode TSRosWSetType(TS, TSRosWType);
1562: PETSC_EXTERN PetscErrorCode TSRosWSetRecomputeJacobian(TS, PetscBool);
1563: PETSC_EXTERN PetscErrorCode TSRosWRegister(TSRosWType, PetscInt, PetscInt, const PetscReal[], const PetscReal[], const PetscReal[], const PetscReal[], PetscInt, const PetscReal[]);
1564: PETSC_EXTERN PetscErrorCode TSRosWRegisterRos4(TSRosWType, PetscReal, PetscReal, PetscReal, PetscReal, PetscReal);
1565: PETSC_EXTERN PetscErrorCode TSRosWInitializePackage(void);
1566: PETSC_EXTERN PetscErrorCode TSRosWFinalizePackage(void);
1567: PETSC_EXTERN PetscErrorCode TSRosWRegisterDestroy(void);

1569: PETSC_EXTERN PetscErrorCode TSBDFSetOrder(TS, PetscInt);
1570: PETSC_EXTERN PetscErrorCode TSBDFGetOrder(TS, PetscInt *);

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

1575:   Level: beginner

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

1585: PETSC_EXTERN PetscErrorCode TSBasicSymplecticSetType(TS, TSBasicSymplecticType);
1586: PETSC_EXTERN PetscErrorCode TSBasicSymplecticGetType(TS, TSBasicSymplecticType *);
1587: PETSC_EXTERN PetscErrorCode TSBasicSymplecticRegister(TSBasicSymplecticType, PetscInt, PetscInt, PetscReal[], PetscReal[]);
1588: PETSC_EXTERN PetscErrorCode TSBasicSymplecticRegisterAll(void);
1589: PETSC_EXTERN PetscErrorCode TSBasicSymplecticInitializePackage(void);
1590: PETSC_EXTERN PetscErrorCode TSBasicSymplecticFinalizePackage(void);
1591: PETSC_EXTERN PetscErrorCode TSBasicSymplecticRegisterDestroy(void);

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

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

1601:    Level: advanced

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

1618: /*
1619:        PETSc interface to Sundials
1620: */
1621: #if PetscDefined(HAVE_SUNDIALS2)
1622: /*E
1623:    TSSundialsLmmType - Selects which linear multistep method is used by the `TSSUNDIALS` interface to SUNDIALS' CVODE integrator

1625:    Values:
1626: +   `SUNDIALS_ADAMS` - variable-order Adams methods (non-stiff problems)
1627: -   `SUNDIALS_BDF`   - variable-order backward differentiation formulas (stiff problems)

1629:    Level: intermediate

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

1641:    Values:
1642: +   `SUNDIALS_MODIFIED_GS`  - modified Gram--Schmidt (more stable)
1643: -   `SUNDIALS_CLASSICAL_GS` - classical Gram--Schmidt (cheaper, less stable)

1645:    Level: advanced

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

1655: PETSC_EXTERN PetscErrorCode TSSundialsSetType(TS, TSSundialsLmmType);
1656: PETSC_EXTERN PetscErrorCode TSSundialsGetPC(TS, PC *);
1657: PETSC_EXTERN PetscErrorCode TSSundialsSetTolerance(TS, PetscReal, PetscReal);
1658: PETSC_EXTERN PetscErrorCode TSSundialsSetMinTimeStep(TS, PetscReal);
1659: PETSC_EXTERN PetscErrorCode TSSundialsSetMaxTimeStep(TS, PetscReal);
1660: PETSC_EXTERN PetscErrorCode TSSundialsGetIterations(TS, PetscInt *, PetscInt *);
1661: PETSC_EXTERN PetscErrorCode TSSundialsSetGramSchmidtType(TS, TSSundialsGramSchmidtType);
1662: PETSC_EXTERN PetscErrorCode TSSundialsSetLinearTolerance(TS, PetscReal);
1663: PETSC_EXTERN PetscErrorCode TSSundialsMonitorInternalSteps(TS, PetscBool);
1664: PETSC_EXTERN PetscErrorCode TSSundialsSetMaxl(TS, PetscInt);
1665: PETSC_EXTERN PetscErrorCode TSSundialsSetMaxord(TS, PetscInt);
1666: PETSC_EXTERN PetscErrorCode TSSundialsSetUseDense(TS, PetscBool);
1667: #endif

1669: PETSC_EXTERN PetscErrorCode TSThetaSetTheta(TS, PetscReal);
1670: PETSC_EXTERN PetscErrorCode TSThetaGetTheta(TS, PetscReal *);
1671: PETSC_EXTERN PetscErrorCode TSThetaGetEndpoint(TS, PetscBool *);
1672: PETSC_EXTERN PetscErrorCode TSThetaSetEndpoint(TS, PetscBool);

1674: PETSC_EXTERN PetscErrorCode TSAlphaSetRadius(TS, PetscReal);
1675: PETSC_EXTERN PetscErrorCode TSAlphaSetParams(TS, PetscReal, PetscReal, PetscReal);
1676: PETSC_EXTERN PetscErrorCode TSAlphaGetParams(TS, PetscReal *, PetscReal *, PetscReal *);

1678: PETSC_EXTERN PetscErrorCode TSAlpha2SetRadius(TS, PetscReal);
1679: PETSC_EXTERN PetscErrorCode TSAlpha2SetParams(TS, PetscReal, PetscReal, PetscReal, PetscReal);
1680: PETSC_EXTERN PetscErrorCode TSAlpha2GetParams(TS, PetscReal *, PetscReal *, PetscReal *, PetscReal *);

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

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

1694:   Level: intermediate

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

1700: PETSC_EXTERN_TYPEDEF typedef TSAlpha2PredictorFn *TSAlpha2Predictor PETSC_DEPRECATED_TYPEDEF(3, 26, 0, "TSAlpha2PredictorFn*", );

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

1704: PETSC_EXTERN PetscErrorCode TSSetDM(TS, DM);
1705: PETSC_EXTERN PetscErrorCode TSGetDM(TS, DM *);

1707: PETSC_EXTERN PetscErrorCode SNESTSFormFunction(SNES, Vec, Vec, void *);
1708: PETSC_EXTERN PetscErrorCode SNESTSFormJacobian(SNES, Vec, Mat, Mat, void *);

1710: PETSC_EXTERN PetscErrorCode TSRHSJacobianTest(TS, PetscBool *);
1711: PETSC_EXTERN PetscErrorCode TSRHSJacobianTestTranspose(TS, PetscBool *);

1713: PETSC_EXTERN PetscErrorCode TSGetComputeInitialCondition(TS, PetscErrorCode (**)(TS, Vec));
1714: PETSC_EXTERN PetscErrorCode TSSetComputeInitialCondition(TS, PetscErrorCode (*)(TS, Vec));
1715: PETSC_EXTERN PetscErrorCode TSComputeInitialCondition(TS, Vec);
1716: PETSC_EXTERN PetscErrorCode TSGetComputeExactError(TS, PetscErrorCode (**)(TS, Vec, Vec));
1717: PETSC_EXTERN PetscErrorCode TSSetComputeExactError(TS, PetscErrorCode (*)(TS, Vec, Vec));
1718: PETSC_EXTERN PetscErrorCode TSComputeExactError(TS, Vec, Vec);
1719: PETSC_EXTERN PetscErrorCode PetscConvEstUseTS(PetscConvEst, PetscBool);

1721: PETSC_EXTERN PetscErrorCode TSSetMatStructure(TS, MatStructure);