Date: 2022-03-31T04:48:39+00:00

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: #if !defined(PETSCTS_H)
      6: #define PETSCTS_H
      7: #include <petscsnes.h>
      8: #include <petscconvest.h>

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

     13:    Level: beginner

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

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

     22:    Level: beginner

     24: .seealso: TSSetType(), TS, TSRegister()
     25: J*/
     26: typedef const char* TSType;
     27: #define TSEULER           "euler"
     28: #define TSBEULER          "beuler"
     29: #define TSBASICSYMPLECTIC "basicsymplectic"
     30: #define TSPSEUDO          "pseudo"
     31: #define TSCN              "cn"
     32: #define TSSUNDIALS        "sundials"
     33: #define TSRK              "rk"
     34: #define TSPYTHON          "python"
     35: #define TSTHETA           "theta"
     36: #define TSALPHA           "alpha"
     37: #define TSALPHA2          "alpha2"
     38: #define TSGLLE            "glle"
     39: #define TSGLEE            "glee"
     40: #define TSSSP             "ssp"
     41: #define TSARKIMEX         "arkimex"
     42: #define TSROSW            "rosw"
     43: #define TSEIMEX           "eimex"
     44: #define TSMIMEX           "mimex"
     45: #define TSBDF             "bdf"
     46: #define TSRADAU5          "radau5"
     47: #define TSMPRK            "mprk"
     48: #define TSDISCGRAD        "discgrad"
     49: #define TSIRK             "irk"

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

     54:    Level: beginner

     56: .seealso: TSCreate()
     57: E*/
     58: typedef enum {TS_LINEAR,TS_NONLINEAR} TSProblemType;

     60: /*E
     61:    TSEquationType - type of TS problem that is solved

     63:    Level: beginner

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

     68:    Supported types are:
     69:      TS_EQ_UNSPECIFIED (default)
     70:      TS_EQ_EXPLICIT {ODE and DAE index 1, 2, 3, HI}: F(t,U,U_t) := M(t) U_t - G(U,t) = 0
     71:      TS_EQ_IMPLICIT {ODE and DAE index 1, 2, 3, HI}: F(t,U,U_t) = 0

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

     92: /*E
     93:    TSConvergedReason - reason a TS method has converged or not

     95:    Level: beginner

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

    100:    Each reason has its own manual page.

    102: .seealso: TSGetConvergedReason()
    103: E*/
    104: typedef enum {
    105:   TS_CONVERGED_ITERATING          = 0,
    106:   TS_CONVERGED_TIME               = 1,
    107:   TS_CONVERGED_ITS                = 2,
    108:   TS_CONVERGED_USER               = 3,
    109:   TS_CONVERGED_EVENT              = 4,
    110:   TS_CONVERGED_PSEUDO_FATOL       = 5,
    111:   TS_CONVERGED_PSEUDO_FRTOL       = 6,
    112:   TS_DIVERGED_NONLINEAR_SOLVE     = -1,
    113:   TS_DIVERGED_STEP_REJECTED       = -2,
    114:   TSFORWARD_DIVERGED_LINEAR_SOLVE = -3,
    115:   TSADJOINT_DIVERGED_LINEAR_SOLVE = -4
    116: } TSConvergedReason;
    117: PETSC_EXTERN const char *const*TSConvergedReasons;

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

    122:    Level: beginner

    124: .seealso: TSSolve(), TSGetConvergedReason(), TSGetAdapt()
    125: M*/

    127: /*MC
    128:    TS_CONVERGED_TIME - the final time was reached

    130:    Level: beginner

    132: .seealso: TSSolve(), TSGetConvergedReason(), TSGetAdapt(), TSSetMaxTime(), TSGetMaxTime(), TSGetSolveTime()
    133: M*/

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

    138:    Level: beginner

    140: .seealso: TSSolve(), TSGetConvergedReason(), TSGetAdapt(), TSSetMaxSteps(), TSGetMaxSteps()
    141: M*/

    143: /*MC
    144:    TS_CONVERGED_USER - user requested termination

    146:    Level: beginner

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

    151: /*MC
    152:    TS_CONVERGED_EVENT - user requested termination on event detection

    154:    Level: beginner

    156: .seealso: TSSolve(), TSGetConvergedReason(), TSSetConvergedReason()
    157: M*/

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

    162:    Level: beginner

    164:    Options Database:
    165: .   -ts_pseudo_frtol <rtol> - use sepcified rtol

    167: .seealso: TSSolve(), TSGetConvergedReason(), TSSetConvergedReason(), TS_CONVERGED_PSEUDO_FATOL
    168: M*/

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

    173:    Level: beginner

    175:    Options Database:
    176: .   -ts_pseudo_fatol <atol> - use specified atol

    178: .seealso: TSSolve(), TSGetConvergedReason(), TSSetConvergedReason(), TS_CONVERGED_PSEUDO_FRTOL
    179: M*/

    181: /*MC
    182:    TS_DIVERGED_NONLINEAR_SOLVE - too many nonlinear solves failed

    184:    Level: beginner

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

    189: .seealso: TSSolve(), TSGetConvergedReason(), TSGetAdapt(), TSGetSNES(), SNESGetConvergedReason(), TSSetMaxSNESFailures()
    190: M*/

    192: /*MC
    193:    TS_DIVERGED_STEP_REJECTED - too many steps were rejected

    195:    Level: beginner

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

    200: .seealso: TSSolve(), TSGetConvergedReason(), TSGetAdapt(), TSSetMaxStepRejections()
    201: M*/

    203: /*E
    204:    TSExactFinalTimeOption - option for handling of final time step

    206:    Level: beginner

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

    211: $  TS_EXACTFINALTIME_STEPOVER    - Don't do anything if final time is exceeded
    212: $  TS_EXACTFINALTIME_INTERPOLATE - Interpolate back to final time
    213: $  TS_EXACTFINALTIME_MATCHSTEP - Adapt final time step to match the final time

    215: .seealso: TSGetConvergedReason(), TSSetExactFinalTime(), TSGetExactFinalTime()

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

    221: /* Logging support */
    222: PETSC_EXTERN PetscClassId TS_CLASSID;
    223: PETSC_EXTERN PetscClassId DMTS_CLASSID;
    224: PETSC_EXTERN PetscClassId TSADAPT_CLASSID;

    226: PETSC_EXTERN PetscErrorCode TSInitializePackage(void);
    227: PETSC_EXTERN PetscErrorCode TSFinalizePackage(void);

    229: PETSC_EXTERN PetscErrorCode TSCreate(MPI_Comm,TS*);
    230: PETSC_EXTERN PetscErrorCode TSClone(TS,TS*);
    231: PETSC_EXTERN PetscErrorCode TSDestroy(TS*);

    233: PETSC_EXTERN PetscErrorCode TSSetProblemType(TS,TSProblemType);
    234: PETSC_EXTERN PetscErrorCode TSGetProblemType(TS,TSProblemType*);
    235: PETSC_EXTERN PetscErrorCode TSMonitor(TS,PetscInt,PetscReal,Vec);
    236: PETSC_EXTERN PetscErrorCode TSMonitorSet(TS,PetscErrorCode(*)(TS,PetscInt,PetscReal,Vec,void*),void *,PetscErrorCode (*)(void**));
    237: PETSC_EXTERN PetscErrorCode TSMonitorSetFromOptions(TS,const char[],const char[],const char[],PetscErrorCode (*)(TS,PetscInt,PetscReal,Vec,PetscViewerAndFormat*),PetscErrorCode (*)(TS,PetscViewerAndFormat*));
    238: PETSC_EXTERN PetscErrorCode TSMonitorCancel(TS);

    240: PETSC_EXTERN PetscErrorCode TSSetOptionsPrefix(TS,const char[]);
    241: PETSC_EXTERN PetscErrorCode TSAppendOptionsPrefix(TS,const char[]);
    242: PETSC_EXTERN PetscErrorCode TSGetOptionsPrefix(TS,const char *[]);
    243: PETSC_EXTERN PetscErrorCode TSSetFromOptions(TS);
    244: PETSC_EXTERN PetscErrorCode TSSetUp(TS);
    245: PETSC_EXTERN PetscErrorCode TSReset(TS);

    247: PETSC_EXTERN PetscErrorCode TSSetSolution(TS,Vec);
    248: PETSC_EXTERN PetscErrorCode TSGetSolution(TS,Vec*);

    250: PETSC_EXTERN PetscErrorCode TS2SetSolution(TS,Vec,Vec);
    251: PETSC_EXTERN PetscErrorCode TS2GetSolution(TS,Vec*,Vec*);

    253: PETSC_EXTERN PetscErrorCode TSGetSolutionComponents(TS,PetscInt*,Vec*);
    254: PETSC_EXTERN PetscErrorCode TSGetAuxSolution(TS,Vec*);
    255: PETSC_EXTERN PetscErrorCode TSGetTimeError(TS,PetscInt,Vec*);
    256: PETSC_EXTERN PetscErrorCode TSSetTimeError(TS,Vec);

    258: PETSC_EXTERN PetscErrorCode TSSetRHSJacobianP(TS,Mat,PetscErrorCode(*)(TS,PetscReal,Vec,Mat,void*),void*);
    259: PETSC_EXTERN PetscErrorCode TSGetRHSJacobianP(TS,Mat*,PetscErrorCode(**)(TS,PetscReal,Vec,Mat,void*),void**);
    260: PETSC_EXTERN PetscErrorCode TSComputeRHSJacobianP(TS,PetscReal,Vec,Mat);
    261: PETSC_EXTERN PetscErrorCode TSSetIJacobianP(TS,Mat,PetscErrorCode(*)(TS,PetscReal,Vec,Vec,PetscReal,Mat,void*),void*);
    262: PETSC_EXTERN PetscErrorCode TSComputeIJacobianP(TS,PetscReal,Vec,Vec,PetscReal,Mat,PetscBool);
    263: PETSC_EXTERN PETSC_DEPRECATED_FUNCTION("Use TSGetQuadratureTS then TSComputeRHSJacobianP") PetscErrorCode TSComputeDRDPFunction(TS,PetscReal,Vec,Vec*);
    264: PETSC_EXTERN PETSC_DEPRECATED_FUNCTION("Use TSGetQuadratureTS then TSComputeRHSJacobian") PetscErrorCode TSComputeDRDUFunction(TS,PetscReal,Vec,Vec*);
    265: PETSC_EXTERN PetscErrorCode TSSetIHessianProduct(TS,Vec*,PetscErrorCode(*)(TS,PetscReal,Vec,Vec*,Vec,Vec*,void*),
    266:                                                     Vec*,PetscErrorCode(*)(TS,PetscReal,Vec,Vec*,Vec,Vec*,void*),
    267:                                                     Vec*,PetscErrorCode(*)(TS,PetscReal,Vec,Vec*,Vec,Vec*,void*),
    268:                                                     Vec*,PetscErrorCode(*)(TS,PetscReal,Vec,Vec*,Vec,Vec*,void*),
    269:                                                     void*);
    270: PETSC_EXTERN PetscErrorCode TSComputeIHessianProductFunctionUU(TS,PetscReal,Vec,Vec*,Vec,Vec*);
    271: PETSC_EXTERN PetscErrorCode TSComputeIHessianProductFunctionUP(TS,PetscReal,Vec,Vec*,Vec,Vec*);
    272: PETSC_EXTERN PetscErrorCode TSComputeIHessianProductFunctionPU(TS,PetscReal,Vec,Vec*,Vec,Vec*);
    273: PETSC_EXTERN PetscErrorCode TSComputeIHessianProductFunctionPP(TS,PetscReal,Vec,Vec*,Vec,Vec*);
    274: PETSC_EXTERN PetscErrorCode TSSetRHSHessianProduct(TS,Vec*,PetscErrorCode(*)(TS,PetscReal,Vec,Vec*,Vec,Vec*,void*),
    275:                                                     Vec*,PetscErrorCode(*)(TS,PetscReal,Vec,Vec*,Vec,Vec*,void*),
    276:                                                     Vec*,PetscErrorCode(*)(TS,PetscReal,Vec,Vec*,Vec,Vec*,void*),
    277:                                                     Vec*,PetscErrorCode(*)(TS,PetscReal,Vec,Vec*,Vec,Vec*,void*),
    278:                                                     void*);
    279: PETSC_EXTERN PetscErrorCode TSComputeRHSHessianProductFunctionUU(TS,PetscReal,Vec,Vec*,Vec,Vec*);
    280: PETSC_EXTERN PetscErrorCode TSComputeRHSHessianProductFunctionUP(TS,PetscReal,Vec,Vec*,Vec,Vec*);
    281: PETSC_EXTERN PetscErrorCode TSComputeRHSHessianProductFunctionPU(TS,PetscReal,Vec,Vec*,Vec,Vec*);
    282: PETSC_EXTERN PetscErrorCode TSComputeRHSHessianProductFunctionPP(TS,PetscReal,Vec,Vec*,Vec,Vec*);
    283: PETSC_EXTERN PetscErrorCode TSSetCostHessianProducts(TS,PetscInt,Vec*,Vec*,Vec);
    284: PETSC_EXTERN PetscErrorCode TSGetCostHessianProducts(TS,PetscInt*,Vec**,Vec**,Vec*);
    285: PETSC_EXTERN PetscErrorCode TSComputeSNESJacobian(TS,Vec,Mat,Mat);

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

    290:    Level: advanced

    292: .seealso:  TSSetSaveTrajectory(), TSTrajectoryCreate(), TSTrajectorySetType(), TSTrajectoryDestroy(), TSTrajectoryReset()
    293: S*/
    294: typedef struct _p_TSTrajectory* TSTrajectory;

    296: /*J
    297:     TSTrajectorySetType - String with the name of a PETSc TS trajectory storage method

    299:    Level: intermediate

    301: .seealso:  TSSetSaveTrajectory(), TSTrajectoryCreate(), TSTrajectoryDestroy()
    302: J*/
    303: typedef const char* TSTrajectoryType;
    304: #define TSTRAJECTORYBASIC         "basic"
    305: #define TSTRAJECTORYSINGLEFILE    "singlefile"
    306: #define TSTRAJECTORYMEMORY        "memory"
    307: #define TSTRAJECTORYVISUALIZATION "visualization"

    309: PETSC_EXTERN PetscFunctionList TSTrajectoryList;
    310: PETSC_EXTERN PetscClassId      TSTRAJECTORY_CLASSID;
    311: PETSC_EXTERN PetscBool         TSTrajectoryRegisterAllCalled;

    313: PETSC_EXTERN PetscErrorCode TSSetSaveTrajectory(TS);
    314: PETSC_EXTERN PetscErrorCode TSResetTrajectory(TS);
    315: PETSC_EXTERN PetscErrorCode TSRemoveTrajectory(TS);

    317: PETSC_EXTERN PetscErrorCode TSTrajectoryCreate(MPI_Comm,TSTrajectory*);
    318: PETSC_EXTERN PetscErrorCode TSTrajectoryReset(TSTrajectory);
    319: PETSC_EXTERN PetscErrorCode TSTrajectoryDestroy(TSTrajectory*);
    320: PETSC_EXTERN PetscErrorCode TSTrajectoryView(TSTrajectory,PetscViewer);
    321: PETSC_EXTERN PetscErrorCode TSTrajectorySetType(TSTrajectory,TS,TSTrajectoryType);
    322: PETSC_EXTERN PetscErrorCode TSTrajectoryGetType(TSTrajectory,TS,TSTrajectoryType*);
    323: PETSC_EXTERN PetscErrorCode TSTrajectorySet(TSTrajectory,TS,PetscInt,PetscReal,Vec);
    324: PETSC_EXTERN PetscErrorCode TSTrajectoryGet(TSTrajectory,TS,PetscInt,PetscReal*);
    325: PETSC_EXTERN PetscErrorCode TSTrajectoryGetVecs(TSTrajectory,TS,PetscInt,PetscReal*,Vec,Vec);
    326: PETSC_EXTERN PetscErrorCode TSTrajectoryGetUpdatedHistoryVecs(TSTrajectory,TS,PetscReal,Vec*,Vec*);
    327: PETSC_EXTERN PetscErrorCode TSTrajectoryGetNumSteps(TSTrajectory,PetscInt*);
    328: PETSC_EXTERN PetscErrorCode TSTrajectoryRestoreUpdatedHistoryVecs(TSTrajectory,Vec*,Vec*);
    329: PETSC_EXTERN PetscErrorCode TSTrajectorySetFromOptions(TSTrajectory,TS);
    330: PETSC_EXTERN PetscErrorCode TSTrajectoryRegister(const char[],PetscErrorCode (*)(TSTrajectory,TS));
    331: PETSC_EXTERN PetscErrorCode TSTrajectoryRegisterAll(void);
    332: PETSC_EXTERN PetscErrorCode TSTrajectorySetUp(TSTrajectory,TS);
    333: PETSC_EXTERN PetscErrorCode TSTrajectorySetUseHistory(TSTrajectory,PetscBool);
    334: PETSC_EXTERN PetscErrorCode TSTrajectorySetMonitor(TSTrajectory,PetscBool);
    335: PETSC_EXTERN PetscErrorCode TSTrajectorySetVariableNames(TSTrajectory,const char * const*);
    336: PETSC_EXTERN PetscErrorCode TSTrajectorySetTransform(TSTrajectory,PetscErrorCode (*)(void*,Vec,Vec*),PetscErrorCode (*)(void*),void*);
    337: PETSC_EXTERN PetscErrorCode TSTrajectorySetSolutionOnly(TSTrajectory,PetscBool);
    338: PETSC_EXTERN PetscErrorCode TSTrajectoryGetSolutionOnly(TSTrajectory,PetscBool*);
    339: PETSC_EXTERN PetscErrorCode TSTrajectorySetKeepFiles(TSTrajectory,PetscBool);
    340: PETSC_EXTERN PetscErrorCode TSTrajectorySetDirname(TSTrajectory,const char[]);
    341: PETSC_EXTERN PetscErrorCode TSTrajectorySetFiletemplate(TSTrajectory,const char[]);
    342: PETSC_EXTERN PetscErrorCode TSGetTrajectory(TS,TSTrajectory*);

    344: PETSC_EXTERN PetscErrorCode TSSetCostGradients(TS,PetscInt,Vec*,Vec*);
    345: PETSC_EXTERN PetscErrorCode TSGetCostGradients(TS,PetscInt*,Vec**,Vec**);
    346: PETSC_EXTERN PETSC_DEPRECATED_FUNCTION("Use TSCreateQuadratureTS() then set up the sub-TS (since version 3.12)") PetscErrorCode TSSetCostIntegrand(TS,PetscInt,Vec,PetscErrorCode (*)(TS,PetscReal,Vec,Vec,void*),PetscErrorCode (*)(TS,PetscReal,Vec,Vec*,void*),PetscErrorCode (*)(TS,PetscReal,Vec,Vec*,void*),PetscBool,void*);
    347: PETSC_EXTERN PetscErrorCode TSGetCostIntegral(TS,Vec*);
    348: PETSC_EXTERN PetscErrorCode TSComputeCostIntegrand(TS,PetscReal,Vec,Vec);
    349: PETSC_EXTERN PetscErrorCode TSCreateQuadratureTS(TS,PetscBool,TS*);
    350: PETSC_EXTERN PetscErrorCode TSGetQuadratureTS(TS,PetscBool*,TS*);

    352: PETSC_EXTERN PetscErrorCode TSAdjointSetFromOptions(PetscOptionItems*,TS);
    353: PETSC_EXTERN PetscErrorCode TSAdjointMonitor(TS,PetscInt,PetscReal,Vec,PetscInt,Vec*,Vec*);
    354: PETSC_EXTERN PetscErrorCode TSAdjointMonitorSet(TS,PetscErrorCode(*)(TS,PetscInt,PetscReal,Vec,PetscInt,Vec*,Vec*,void*),void *,PetscErrorCode (*)(void**));
    355: PETSC_EXTERN PetscErrorCode TSAdjointMonitorCancel(TS);
    356: PETSC_EXTERN PetscErrorCode TSAdjointMonitorSetFromOptions(TS,const char[],const char[],const char[],PetscErrorCode (*)(TS,PetscInt,PetscReal,Vec,PetscInt,Vec*,Vec*,PetscViewerAndFormat*),PetscErrorCode (*)(TS,PetscViewerAndFormat*));

    358: PETSC_EXTERN PETSC_DEPRECATED_FUNCTION("Use TSSetRHSJacobianP()")     PetscErrorCode TSAdjointSetRHSJacobian(TS,Mat,PetscErrorCode(*)(TS,PetscReal,Vec,Mat,void*),void*);
    359: PETSC_EXTERN PETSC_DEPRECATED_FUNCTION("Use TSComputeRHSJacobianP()") PetscErrorCode TSAdjointComputeRHSJacobian(TS,PetscReal,Vec,Mat);
    360: PETSC_EXTERN PETSC_DEPRECATED_FUNCTION("Use TSGetQuadratureTS then TSComputeRHSJacobianP") PetscErrorCode TSAdjointComputeDRDPFunction(TS,PetscReal,Vec,Vec*);
    361: PETSC_EXTERN PETSC_DEPRECATED_FUNCTION("Use TSGetQuadratureTS then TSComputeRHSJacobian") PetscErrorCode TSAdjointComputeDRDYFunction(TS,PetscReal,Vec,Vec*);
    362: PETSC_EXTERN PetscErrorCode TSAdjointSolve(TS);
    363: PETSC_EXTERN PetscErrorCode TSAdjointSetSteps(TS,PetscInt);

    365: PETSC_EXTERN PetscErrorCode TSAdjointStep(TS);
    366: PETSC_EXTERN PetscErrorCode TSAdjointSetUp(TS);
    367: PETSC_EXTERN PetscErrorCode TSAdjointReset(TS);
    368: PETSC_EXTERN PetscErrorCode TSAdjointCostIntegral(TS);
    369: PETSC_EXTERN PetscErrorCode TSAdjointSetForward(TS,Mat);
    370: PETSC_EXTERN PetscErrorCode TSAdjointResetForward(TS);

    372: PETSC_EXTERN PetscErrorCode TSForwardSetSensitivities(TS,PetscInt,Mat);
    373: PETSC_EXTERN PetscErrorCode TSForwardGetSensitivities(TS,PetscInt*,Mat*);
    374: PETSC_EXTERN PETSC_DEPRECATED_FUNCTION("Use TSCreateQuadratureTS() and TSForwardSetSensitivities() (since version 3.12)") PetscErrorCode TSForwardSetIntegralGradients(TS,PetscInt,Vec *);
    375: PETSC_EXTERN PETSC_DEPRECATED_FUNCTION("Use TSForwardGetSensitivities()")                          PetscErrorCode TSForwardGetIntegralGradients(TS,PetscInt*,Vec **);
    376: PETSC_EXTERN PetscErrorCode TSForwardSetUp(TS);
    377: PETSC_EXTERN PetscErrorCode TSForwardReset(TS);
    378: PETSC_EXTERN PetscErrorCode TSForwardCostIntegral(TS);
    379: PETSC_EXTERN PetscErrorCode TSForwardStep(TS);
    380: PETSC_EXTERN PetscErrorCode TSForwardSetInitialSensitivities(TS,Mat);
    381: PETSC_EXTERN PetscErrorCode TSForwardGetStages(TS,PetscInt*,Mat*[]);

    383: PETSC_EXTERN PetscErrorCode TSSetMaxSteps(TS,PetscInt);
    384: PETSC_EXTERN PetscErrorCode TSGetMaxSteps(TS,PetscInt*);
    385: PETSC_EXTERN PetscErrorCode TSSetMaxTime(TS,PetscReal);
    386: PETSC_EXTERN PetscErrorCode TSGetMaxTime(TS,PetscReal*);
    387: PETSC_EXTERN PetscErrorCode TSSetExactFinalTime(TS,TSExactFinalTimeOption);
    388: PETSC_EXTERN PetscErrorCode TSGetExactFinalTime(TS,TSExactFinalTimeOption*);

    390: PETSC_EXTERN PETSC_DEPRECATED_FUNCTION("Use TSSetTime[Step]() (since version 3.8)")      PetscErrorCode TSSetInitialTimeStep(TS,PetscReal,PetscReal);
    391: PETSC_EXTERN PETSC_DEPRECATED_FUNCTION("Use TSSetMax{Steps|Time}() (since version 3.8)") PetscErrorCode TSSetDuration(TS,PetscInt,PetscReal);
    392: PETSC_EXTERN PETSC_DEPRECATED_FUNCTION("Use TSGetMax{Steps|Time}() (since version 3.8)") PetscErrorCode TSGetDuration(TS,PetscInt*,PetscReal*);
    393: PETSC_EXTERN PETSC_DEPRECATED_FUNCTION("Use TSGetStepNumber() (since version 3.8)")      PetscErrorCode TSGetTimeStepNumber(TS,PetscInt*);
    394: PETSC_EXTERN PETSC_DEPRECATED_FUNCTION("Use TSGetStepNumber() (since version 3.8)")      PetscErrorCode TSGetTotalSteps(TS,PetscInt*);

    396: PETSC_EXTERN PetscErrorCode TSMonitorDefault(TS,PetscInt,PetscReal,Vec,PetscViewerAndFormat*);
    397: PETSC_EXTERN PetscErrorCode TSMonitorExtreme(TS,PetscInt,PetscReal,Vec,PetscViewerAndFormat*);

    399: typedef struct _n_TSMonitorDrawCtx*  TSMonitorDrawCtx;
    400: PETSC_EXTERN PetscErrorCode TSMonitorDrawCtxCreate(MPI_Comm,const char[],const char[],int,int,int,int,PetscInt,TSMonitorDrawCtx *);
    401: PETSC_EXTERN PetscErrorCode TSMonitorDrawCtxDestroy(TSMonitorDrawCtx*);
    402: PETSC_EXTERN PetscErrorCode TSMonitorDrawSolution(TS,PetscInt,PetscReal,Vec,void*);
    403: PETSC_EXTERN PetscErrorCode TSMonitorDrawSolutionPhase(TS,PetscInt,PetscReal,Vec,void*);
    404: PETSC_EXTERN PetscErrorCode TSMonitorDrawError(TS,PetscInt,PetscReal,Vec,void*);
    405: PETSC_EXTERN PetscErrorCode TSMonitorDrawSolutionFunction(TS,PetscInt,PetscReal,Vec,void*);

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

    410: PETSC_EXTERN PetscErrorCode TSMonitorSolution(TS,PetscInt,PetscReal,Vec,PetscViewerAndFormat*);
    411: PETSC_EXTERN PetscErrorCode TSMonitorSolutionVTK(TS,PetscInt,PetscReal,Vec,void*);
    412: PETSC_EXTERN PetscErrorCode TSMonitorSolutionVTKDestroy(void*);

    414: PETSC_EXTERN PetscErrorCode TSStep(TS);
    415: PETSC_EXTERN PetscErrorCode TSEvaluateWLTE(TS,NormType,PetscInt*,PetscReal*);
    416: PETSC_EXTERN PetscErrorCode TSEvaluateStep(TS,PetscInt,Vec,PetscBool*);
    417: PETSC_EXTERN PetscErrorCode TSSolve(TS,Vec);
    418: PETSC_EXTERN PetscErrorCode TSGetEquationType(TS,TSEquationType*);
    419: PETSC_EXTERN PetscErrorCode TSSetEquationType(TS,TSEquationType);
    420: PETSC_EXTERN PetscErrorCode TSGetConvergedReason(TS,TSConvergedReason*);
    421: PETSC_EXTERN PetscErrorCode TSSetConvergedReason(TS,TSConvergedReason);
    422: PETSC_EXTERN PetscErrorCode TSGetSolveTime(TS,PetscReal*);
    423: PETSC_EXTERN PetscErrorCode TSGetSNESIterations(TS,PetscInt*);
    424: PETSC_EXTERN PetscErrorCode TSGetKSPIterations(TS,PetscInt*);
    425: PETSC_EXTERN PetscErrorCode TSGetStepRejections(TS,PetscInt*);
    426: PETSC_EXTERN PetscErrorCode TSSetMaxStepRejections(TS,PetscInt);
    427: PETSC_EXTERN PetscErrorCode TSGetSNESFailures(TS,PetscInt*);
    428: PETSC_EXTERN PetscErrorCode TSSetMaxSNESFailures(TS,PetscInt);
    429: PETSC_EXTERN PetscErrorCode TSSetErrorIfStepFails(TS,PetscBool);
    430: PETSC_EXTERN PetscErrorCode TSRestartStep(TS);
    431: PETSC_EXTERN PetscErrorCode TSRollBack(TS);

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

    435: PETSC_EXTERN PetscErrorCode TSGetTime(TS,PetscReal*);
    436: PETSC_EXTERN PetscErrorCode TSSetTime(TS,PetscReal);
    437: PETSC_EXTERN PetscErrorCode TSGetPrevTime(TS,PetscReal*);
    438: PETSC_EXTERN PetscErrorCode TSGetTimeStep(TS,PetscReal*);
    439: PETSC_EXTERN PetscErrorCode TSSetTimeStep(TS,PetscReal);
    440: PETSC_EXTERN PetscErrorCode TSGetStepNumber(TS,PetscInt*);
    441: PETSC_EXTERN PetscErrorCode TSSetStepNumber(TS,PetscInt);

    443: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*TSRHSFunction)(TS,PetscReal,Vec,Vec,void*);
    444: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*TSRHSJacobian)(TS,PetscReal,Vec,Mat,Mat,void*);
    445: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*TSRHSJacobianP)(TS,PetscReal,Vec,Mat,void*);
    446: PETSC_EXTERN PetscErrorCode TSSetRHSFunction(TS,Vec,TSRHSFunction,void*);
    447: PETSC_EXTERN PetscErrorCode TSGetRHSFunction(TS,Vec*,TSRHSFunction*,void**);
    448: PETSC_EXTERN PetscErrorCode TSSetRHSJacobian(TS,Mat,Mat,TSRHSJacobian,void*);
    449: PETSC_EXTERN PetscErrorCode TSGetRHSJacobian(TS,Mat*,Mat*,TSRHSJacobian*,void**);
    450: PETSC_EXTERN PetscErrorCode TSRHSJacobianSetReuse(TS,PetscBool);

    452: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*TSSolutionFunction)(TS,PetscReal,Vec,void*);
    453: PETSC_EXTERN PetscErrorCode TSSetSolutionFunction(TS,TSSolutionFunction,void*);
    454: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*TSForcingFunction)(TS,PetscReal,Vec,void*);
    455: PETSC_EXTERN PetscErrorCode TSSetForcingFunction(TS,TSForcingFunction,void*);

    457: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*TSIFunction)(TS,PetscReal,Vec,Vec,Vec,void*);
    458: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*TSIJacobian)(TS,PetscReal,Vec,Vec,PetscReal,Mat,Mat,void*);
    459: PETSC_EXTERN PetscErrorCode TSSetIFunction(TS,Vec,TSIFunction,void*);
    460: PETSC_EXTERN PetscErrorCode TSGetIFunction(TS,Vec*,TSIFunction*,void**);
    461: PETSC_EXTERN PetscErrorCode TSSetIJacobian(TS,Mat,Mat,TSIJacobian,void*);
    462: PETSC_EXTERN PetscErrorCode TSGetIJacobian(TS,Mat*,Mat*,TSIJacobian*,void**);

    464: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*TSI2Function)(TS,PetscReal,Vec,Vec,Vec,Vec,void*);
    465: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*TSI2Jacobian)(TS,PetscReal,Vec,Vec,Vec,PetscReal,PetscReal,Mat,Mat,void*);
    466: PETSC_EXTERN PetscErrorCode TSSetI2Function(TS,Vec,TSI2Function,void*);
    467: PETSC_EXTERN PetscErrorCode TSGetI2Function(TS,Vec*,TSI2Function*,void**);
    468: PETSC_EXTERN PetscErrorCode TSSetI2Jacobian(TS,Mat,Mat,TSI2Jacobian,void*);
    469: PETSC_EXTERN PetscErrorCode TSGetI2Jacobian(TS,Mat*,Mat*,TSI2Jacobian*,void**);

    471: PETSC_EXTERN PetscErrorCode TSRHSSplitSetIS(TS,const char[],IS);
    472: PETSC_EXTERN PetscErrorCode TSRHSSplitGetIS(TS,const char[],IS*);
    473: PETSC_EXTERN PetscErrorCode TSRHSSplitSetRHSFunction(TS,const char[],Vec,TSRHSFunction,void*);
    474: PETSC_EXTERN PetscErrorCode TSRHSSplitGetSubTS(TS,const char[],TS*);
    475: PETSC_EXTERN PetscErrorCode TSRHSSplitGetSubTSs(TS,PetscInt*,TS*[]);
    476: PETSC_EXTERN PetscErrorCode TSSetUseSplitRHSFunction(TS, PetscBool);
    477: PETSC_EXTERN PetscErrorCode TSGetUseSplitRHSFunction(TS, PetscBool*);

    479: PETSC_EXTERN PetscErrorCode TSComputeRHSFunctionLinear(TS,PetscReal,Vec,Vec,void*);
    480: PETSC_EXTERN PetscErrorCode TSComputeRHSJacobianConstant(TS,PetscReal,Vec,Mat,Mat,void*);
    481: PETSC_EXTERN PetscErrorCode TSComputeIFunctionLinear(TS,PetscReal,Vec,Vec,Vec,void*);
    482: PETSC_EXTERN PetscErrorCode TSComputeIJacobianConstant(TS,PetscReal,Vec,Vec,PetscReal,Mat,Mat,void*);
    483: PETSC_EXTERN PetscErrorCode TSComputeSolutionFunction(TS,PetscReal,Vec);
    484: PETSC_EXTERN PetscErrorCode TSComputeForcingFunction(TS,PetscReal,Vec);
    485: PETSC_EXTERN PetscErrorCode TSComputeIJacobianDefaultColor(TS,PetscReal,Vec,Vec,PetscReal,Mat,Mat,void*);

    487: PETSC_EXTERN PetscErrorCode TSSetPreStep(TS, PetscErrorCode (*)(TS));
    488: PETSC_EXTERN PetscErrorCode TSSetPreStage(TS, PetscErrorCode (*)(TS,PetscReal));
    489: PETSC_EXTERN PetscErrorCode TSSetPostStage(TS, PetscErrorCode (*)(TS,PetscReal,PetscInt,Vec*));
    490: PETSC_EXTERN PetscErrorCode TSSetPostEvaluate(TS, PetscErrorCode(*)(TS));
    491: PETSC_EXTERN PetscErrorCode TSSetPostStep(TS, PetscErrorCode (*)(TS));
    492: PETSC_EXTERN PetscErrorCode TSPreStep(TS);
    493: PETSC_EXTERN PetscErrorCode TSPreStage(TS,PetscReal);
    494: PETSC_EXTERN PetscErrorCode TSPostStage(TS,PetscReal,PetscInt,Vec*);
    495: PETSC_EXTERN PetscErrorCode TSPostEvaluate(TS);
    496: PETSC_EXTERN PetscErrorCode TSPostStep(TS);
    497: PETSC_EXTERN PetscErrorCode TSInterpolate(TS,PetscReal,Vec);
    498: PETSC_EXTERN PetscErrorCode TSSetTolerances(TS,PetscReal,Vec,PetscReal,Vec);
    499: PETSC_EXTERN PetscErrorCode TSGetTolerances(TS,PetscReal*,Vec*,PetscReal*,Vec*);
    500: PETSC_EXTERN PetscErrorCode TSErrorWeightedNormInfinity(TS,Vec,Vec,PetscReal*,PetscReal*,PetscReal*);
    501: PETSC_EXTERN PetscErrorCode TSErrorWeightedNorm2(TS,Vec,Vec,PetscReal*,PetscReal*,PetscReal*);
    502: PETSC_EXTERN PetscErrorCode TSErrorWeightedNorm(TS,Vec,Vec,NormType,PetscReal*,PetscReal*,PetscReal*);
    503: PETSC_EXTERN PetscErrorCode TSErrorWeightedENormInfinity(TS,Vec,Vec,Vec,PetscReal*,PetscReal*,PetscReal*);
    504: PETSC_EXTERN PetscErrorCode TSErrorWeightedENorm2(TS,Vec,Vec,Vec,PetscReal*,PetscReal*,PetscReal*);
    505: PETSC_EXTERN PetscErrorCode TSErrorWeightedENorm(TS,Vec,Vec,Vec,NormType,PetscReal*,PetscReal*,PetscReal*);
    506: PETSC_EXTERN PetscErrorCode TSSetCFLTimeLocal(TS,PetscReal);
    507: PETSC_EXTERN PetscErrorCode TSGetCFLTime(TS,PetscReal*);
    508: PETSC_EXTERN PetscErrorCode TSSetFunctionDomainError(TS, PetscErrorCode (*)(TS,PetscReal,Vec,PetscBool*));
    509: PETSC_EXTERN PetscErrorCode TSFunctionDomainError(TS,PetscReal,Vec,PetscBool*);

    511: PETSC_EXTERN PetscErrorCode TSPseudoSetTimeStep(TS,PetscErrorCode(*)(TS,PetscReal*,void*),void*);
    512: PETSC_EXTERN PetscErrorCode TSPseudoTimeStepDefault(TS,PetscReal*,void*);
    513: PETSC_EXTERN PetscErrorCode TSPseudoComputeTimeStep(TS,PetscReal *);
    514: PETSC_EXTERN PetscErrorCode TSPseudoSetMaxTimeStep(TS,PetscReal);
    515: PETSC_EXTERN PetscErrorCode TSPseudoSetVerifyTimeStep(TS,PetscErrorCode(*)(TS,Vec,void*,PetscReal*,PetscBool *),void*);
    516: PETSC_EXTERN PetscErrorCode TSPseudoVerifyTimeStepDefault(TS,Vec,void*,PetscReal*,PetscBool *);
    517: PETSC_EXTERN PetscErrorCode TSPseudoVerifyTimeStep(TS,Vec,PetscReal*,PetscBool *);
    518: PETSC_EXTERN PetscErrorCode TSPseudoSetTimeStepIncrement(TS,PetscReal);
    519: PETSC_EXTERN PetscErrorCode TSPseudoIncrementDtFromInitialDt(TS);

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

    523: PETSC_EXTERN PetscErrorCode TSComputeRHSFunction(TS,PetscReal,Vec,Vec);
    524: PETSC_EXTERN PetscErrorCode TSComputeRHSJacobian(TS,PetscReal,Vec,Mat,Mat);
    525: PETSC_EXTERN PetscErrorCode TSComputeIFunction(TS,PetscReal,Vec,Vec,Vec,PetscBool);
    526: PETSC_EXTERN PetscErrorCode TSComputeIJacobian(TS,PetscReal,Vec,Vec,PetscReal,Mat,Mat,PetscBool);
    527: PETSC_EXTERN PetscErrorCode TSComputeI2Function(TS,PetscReal,Vec,Vec,Vec,Vec);
    528: PETSC_EXTERN PetscErrorCode TSComputeI2Jacobian(TS,PetscReal,Vec,Vec,Vec,PetscReal,PetscReal,Mat,Mat);
    529: PETSC_EXTERN PetscErrorCode TSComputeLinearStability(TS,PetscReal,PetscReal,PetscReal*,PetscReal*);

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

    533: PETSC_EXTERN PetscErrorCode DMTSSetBoundaryLocal(DM, PetscErrorCode (*)(DM, PetscReal, Vec, Vec, void *), void *);
    534: PETSC_EXTERN PetscErrorCode DMTSSetRHSFunction(DM,TSRHSFunction,void*);
    535: PETSC_EXTERN PetscErrorCode DMTSGetRHSFunction(DM,TSRHSFunction*,void**);
    536: PETSC_EXTERN PetscErrorCode DMTSSetRHSJacobian(DM,TSRHSJacobian,void*);
    537: PETSC_EXTERN PetscErrorCode DMTSGetRHSJacobian(DM,TSRHSJacobian*,void**);
    538: PETSC_EXTERN PetscErrorCode DMTSSetIFunction(DM,TSIFunction,void*);
    539: PETSC_EXTERN PetscErrorCode DMTSGetIFunction(DM,TSIFunction*,void**);
    540: PETSC_EXTERN PetscErrorCode DMTSSetIJacobian(DM,TSIJacobian,void*);
    541: PETSC_EXTERN PetscErrorCode DMTSGetIJacobian(DM,TSIJacobian*,void**);
    542: PETSC_EXTERN PetscErrorCode DMTSSetI2Function(DM,TSI2Function,void*);
    543: PETSC_EXTERN PetscErrorCode DMTSGetI2Function(DM,TSI2Function*,void**);
    544: PETSC_EXTERN PetscErrorCode DMTSSetI2Jacobian(DM,TSI2Jacobian,void*);
    545: PETSC_EXTERN PetscErrorCode DMTSGetI2Jacobian(DM,TSI2Jacobian*,void**);

    547: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*TSTransientVariable)(TS,Vec,Vec,void*);
    548: PETSC_EXTERN PetscErrorCode TSSetTransientVariable(TS,TSTransientVariable,void*);
    549: PETSC_EXTERN PetscErrorCode DMTSSetTransientVariable(DM,TSTransientVariable,void*);
    550: PETSC_EXTERN PetscErrorCode DMTSGetTransientVariable(DM,TSTransientVariable*,void*);
    551: PETSC_EXTERN PetscErrorCode TSComputeTransientVariable(TS,Vec,Vec);
    552: PETSC_EXTERN PetscErrorCode TSHasTransientVariable(TS,PetscBool*);

    554: PETSC_EXTERN PetscErrorCode DMTSSetSolutionFunction(DM,TSSolutionFunction,void*);
    555: PETSC_EXTERN PetscErrorCode DMTSGetSolutionFunction(DM,TSSolutionFunction*,void**);
    556: PETSC_EXTERN PetscErrorCode DMTSSetForcingFunction(DM,TSForcingFunction,void*);
    557: PETSC_EXTERN PetscErrorCode DMTSGetForcingFunction(DM,TSForcingFunction*,void**);
    558: PETSC_EXTERN PetscErrorCode DMTSCheckResidual(TS, DM, PetscReal, Vec, Vec, PetscReal, PetscReal *);
    559: PETSC_EXTERN PetscErrorCode DMTSCheckJacobian(TS, DM, PetscReal, Vec, Vec, PetscReal, PetscBool *, PetscReal *);
    560: PETSC_EXTERN PetscErrorCode DMTSCheckFromOptions(TS, Vec);

    562: PETSC_EXTERN PetscErrorCode DMTSSetIFunctionLocal(DM,PetscErrorCode (*)(DM,PetscReal,Vec,Vec,Vec,void*),void*);
    563: PETSC_EXTERN PetscErrorCode DMTSSetIJacobianLocal(DM,PetscErrorCode (*)(DM,PetscReal,Vec,Vec,PetscReal,Mat,Mat,void*),void*);
    564: PETSC_EXTERN PetscErrorCode DMTSSetRHSFunctionLocal(DM,PetscErrorCode (*)(DM,PetscReal,Vec,Vec,void*),void*);
    565: PETSC_EXTERN PetscErrorCode DMTSCreateRHSMassMatrix(DM);
    566: PETSC_EXTERN PetscErrorCode DMTSCreateRHSMassMatrixLumped(DM);
    567: PETSC_EXTERN PetscErrorCode DMTSDestroyRHSMassMatrix(DM);

    569: PETSC_EXTERN PetscErrorCode DMTSSetIFunctionSerialize(DM,PetscErrorCode (*)(void*,PetscViewer),PetscErrorCode (*)(void**,PetscViewer));
    570: PETSC_EXTERN PetscErrorCode DMTSSetIJacobianSerialize(DM,PetscErrorCode (*)(void*,PetscViewer),PetscErrorCode (*)(void**,PetscViewer));

    572: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*DMDATSRHSFunctionLocal)(DMDALocalInfo*,PetscReal,void*,void*,void*);
    573: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*DMDATSRHSJacobianLocal)(DMDALocalInfo*,PetscReal,void*,Mat,Mat,void*);
    574: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*DMDATSIFunctionLocal)(DMDALocalInfo*,PetscReal,void*,void*,void*,void*);
    575: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*DMDATSIJacobianLocal)(DMDALocalInfo*,PetscReal,void*,void*,PetscReal,Mat,Mat,void*);

    577: PETSC_EXTERN PetscErrorCode DMDATSSetRHSFunctionLocal(DM,InsertMode,PetscErrorCode (*)(DMDALocalInfo*,PetscReal,void*,void*,void*),void *);
    578: PETSC_EXTERN PetscErrorCode DMDATSSetRHSJacobianLocal(DM,PetscErrorCode (*)(DMDALocalInfo*,PetscReal,void*,Mat,Mat,void*),void *);
    579: PETSC_EXTERN PetscErrorCode DMDATSSetIFunctionLocal(DM,InsertMode,PetscErrorCode (*)(DMDALocalInfo*,PetscReal,void*,void*,void*,void*),void *);
    580: PETSC_EXTERN PetscErrorCode DMDATSSetIJacobianLocal(DM,PetscErrorCode (*)(DMDALocalInfo*,PetscReal,void*,void*,PetscReal,Mat,Mat,void*),void *);

    582: PETSC_EXTERN PetscErrorCode DMPlexTSGetGeometryFVM(DM,Vec*,Vec*,PetscReal*);

    584: typedef struct _n_TSMonitorLGCtx*  TSMonitorLGCtx;
    585: typedef struct {
    586:   Vec            ray;
    587:   VecScatter     scatter;
    588:   PetscViewer    viewer;
    589:   TSMonitorLGCtx lgctx;
    590: } TSMonitorDMDARayCtx;
    591: PETSC_EXTERN PetscErrorCode TSMonitorDMDARayDestroy(void**);
    592: PETSC_EXTERN PetscErrorCode TSMonitorDMDARay(TS,PetscInt,PetscReal,Vec,void*);
    593: PETSC_EXTERN PetscErrorCode TSMonitorLGDMDARay(TS,PetscInt,PetscReal,Vec,void*);

    595: /* Dynamic creation and loading functions */
    596: PETSC_EXTERN PetscFunctionList TSList;
    597: PETSC_EXTERN PetscErrorCode TSGetType(TS,TSType*);
    598: PETSC_EXTERN PetscErrorCode TSSetType(TS,TSType);
    599: PETSC_EXTERN PetscErrorCode TSRegister(const char[], PetscErrorCode (*)(TS));

    601: PETSC_EXTERN PetscErrorCode TSGetSNES(TS,SNES*);
    602: PETSC_EXTERN PetscErrorCode TSSetSNES(TS,SNES);
    603: PETSC_EXTERN PetscErrorCode TSGetKSP(TS,KSP*);

    605: PETSC_EXTERN PetscErrorCode TSView(TS,PetscViewer);
    606: PETSC_EXTERN PetscErrorCode TSLoad(TS,PetscViewer);
    607: PETSC_EXTERN PetscErrorCode TSViewFromOptions(TS,PetscObject,const char[]);
    608: PETSC_EXTERN PetscErrorCode TSTrajectoryViewFromOptions(TSTrajectory,PetscObject,const char[]);

    610: #define TS_FILE_CLASSID 1211225

    612: PETSC_EXTERN PetscErrorCode TSSetApplicationContext(TS,void *);
    613: PETSC_EXTERN PetscErrorCode TSGetApplicationContext(TS,void *);

    615: PETSC_EXTERN PetscErrorCode TSMonitorLGCtxCreate(MPI_Comm,const char[],const char[],int,int,int,int,PetscInt,TSMonitorLGCtx *);
    616: PETSC_EXTERN PetscErrorCode TSMonitorLGCtxDestroy(TSMonitorLGCtx*);
    617: PETSC_EXTERN PetscErrorCode TSMonitorLGTimeStep(TS,PetscInt,PetscReal,Vec,void *);
    618: PETSC_EXTERN PetscErrorCode TSMonitorLGSolution(TS,PetscInt,PetscReal,Vec,void *);
    619: PETSC_EXTERN PetscErrorCode TSMonitorLGSetVariableNames(TS,const char * const*);
    620: PETSC_EXTERN PetscErrorCode TSMonitorLGGetVariableNames(TS,const char *const **);
    621: PETSC_EXTERN PetscErrorCode TSMonitorLGCtxSetVariableNames(TSMonitorLGCtx,const char * const *);
    622: PETSC_EXTERN PetscErrorCode TSMonitorLGSetDisplayVariables(TS,const char * const*);
    623: PETSC_EXTERN PetscErrorCode TSMonitorLGCtxSetDisplayVariables(TSMonitorLGCtx,const char * const*);
    624: PETSC_EXTERN PetscErrorCode TSMonitorLGSetTransform(TS,PetscErrorCode (*)(void*,Vec,Vec*),PetscErrorCode (*)(void*),void*);
    625: PETSC_EXTERN PetscErrorCode TSMonitorLGCtxSetTransform(TSMonitorLGCtx,PetscErrorCode (*)(void*,Vec,Vec*),PetscErrorCode (*)(void*),void *);
    626: PETSC_EXTERN PetscErrorCode TSMonitorLGError(TS,PetscInt,PetscReal,Vec,void *);
    627: PETSC_EXTERN PetscErrorCode TSMonitorLGSNESIterations(TS,PetscInt,PetscReal,Vec,void *);
    628: PETSC_EXTERN PetscErrorCode TSMonitorLGKSPIterations(TS,PetscInt,PetscReal,Vec,void *);
    629: PETSC_EXTERN PetscErrorCode TSMonitorError(TS,PetscInt,PetscReal,Vec,PetscViewerAndFormat *);
    630: PETSC_EXTERN PetscErrorCode TSDMSwarmMonitorMoments(TS,PetscInt,PetscReal,Vec,PetscViewerAndFormat *);

    632: struct _n_TSMonitorLGCtxNetwork {
    633:   PetscInt       nlg;
    634:   PetscDrawLG    *lg;
    635:   PetscBool      semilogy;
    636:   PetscInt       howoften;  /* when > 0 uses step % howoften, when negative only final solution plotted */
    637: };
    638: typedef struct _n_TSMonitorLGCtxNetwork*  TSMonitorLGCtxNetwork;
    639: PETSC_EXTERN PetscErrorCode TSMonitorLGCtxNetworkDestroy(TSMonitorLGCtxNetwork*);
    640: PETSC_EXTERN PetscErrorCode TSMonitorLGCtxNetworkCreate(TS,const char[],const char[],int,int,int,int,PetscInt,TSMonitorLGCtxNetwork*);
    641: PETSC_EXTERN PetscErrorCode TSMonitorLGCtxNetworkSolution(TS,PetscInt,PetscReal,Vec,void*);

    643: typedef struct _n_TSMonitorEnvelopeCtx*  TSMonitorEnvelopeCtx;
    644: PETSC_EXTERN PetscErrorCode TSMonitorEnvelopeCtxCreate(TS,TSMonitorEnvelopeCtx*);
    645: PETSC_EXTERN PetscErrorCode TSMonitorEnvelope(TS,PetscInt,PetscReal,Vec,void*);
    646: PETSC_EXTERN PetscErrorCode TSMonitorEnvelopeGetBounds(TS,Vec*,Vec*);
    647: PETSC_EXTERN PetscErrorCode TSMonitorEnvelopeCtxDestroy(TSMonitorEnvelopeCtx*);

    649: typedef struct _n_TSMonitorSPEigCtx*  TSMonitorSPEigCtx;
    650: PETSC_EXTERN PetscErrorCode TSMonitorSPEigCtxCreate(MPI_Comm,const char[],const char[],int,int,int,int,PetscInt,TSMonitorSPEigCtx *);
    651: PETSC_EXTERN PetscErrorCode TSMonitorSPEigCtxDestroy(TSMonitorSPEigCtx*);
    652: PETSC_EXTERN PetscErrorCode TSMonitorSPEig(TS,PetscInt,PetscReal,Vec,void *);

    654: typedef struct _n_TSMonitorSPCtx* TSMonitorSPCtx;
    655: PETSC_EXTERN PetscErrorCode TSMonitorSPCtxCreate(MPI_Comm,const char[],const char[],int,int,int,int,PetscInt,PetscInt,PetscBool,TSMonitorSPCtx*);
    656: PETSC_EXTERN PetscErrorCode TSMonitorSPCtxDestroy(TSMonitorSPCtx*);
    657: PETSC_EXTERN PetscErrorCode TSMonitorSPSwarmSolution(TS,PetscInt,PetscReal,Vec,void*);

    659: PETSC_EXTERN PetscErrorCode TSSetEventHandler(TS,PetscInt,PetscInt[],PetscBool[],PetscErrorCode (*)(TS,PetscReal,Vec,PetscScalar[],void*),PetscErrorCode (*)(TS,PetscInt,PetscInt[],PetscReal,Vec,PetscBool,void*),void*);
    660: PETSC_EXTERN PetscErrorCode TSSetPostEventIntervalStep(TS,PetscReal);
    661: PETSC_EXTERN PetscErrorCode TSSetEventTolerances(TS,PetscReal,PetscReal[]);
    662: PETSC_EXTERN PetscErrorCode TSGetNumEvents(TS,PetscInt*);

    664: /*J
    665:    TSSSPType - string with the name of TSSSP scheme.

    667:    Level: beginner

    669: .seealso: TSSSPSetType(), TS
    670: J*/
    671: typedef const char* TSSSPType;
    672: #define TSSSPRKS2  "rks2"
    673: #define TSSSPRKS3  "rks3"
    674: #define TSSSPRK104 "rk104"

    676: PETSC_EXTERN PetscErrorCode TSSSPSetType(TS,TSSSPType);
    677: PETSC_EXTERN PetscErrorCode TSSSPGetType(TS,TSSSPType*);
    678: PETSC_EXTERN PetscErrorCode TSSSPSetNumStages(TS,PetscInt);
    679: PETSC_EXTERN PetscErrorCode TSSSPGetNumStages(TS,PetscInt*);
    680: PETSC_EXTERN PetscErrorCode TSSSPInitializePackage(void);
    681: PETSC_EXTERN PetscErrorCode TSSSPFinalizePackage(void);
    682: PETSC_EXTERN PetscFunctionList TSSSPList;

    684: /*S
    685:    TSAdapt - Abstract object that manages time-step adaptivity

    687:    Level: beginner

    689: .seealso: TS, TSAdaptCreate(), TSAdaptType
    690: S*/
    691: typedef struct _p_TSAdapt *TSAdapt;

    693: /*J
    694:     TSAdaptType - String with the name of TSAdapt scheme.

    696:    Level: beginner

    698: .seealso: TSAdaptSetType(), TS
    699: J*/
    700: typedef const char *TSAdaptType;
    701: #define TSADAPTNONE    "none"
    702: #define TSADAPTBASIC   "basic"
    703: #define TSADAPTDSP     "dsp"
    704: #define TSADAPTCFL     "cfl"
    705: #define TSADAPTGLEE    "glee"
    706: #define TSADAPTHISTORY "history"

    708: PETSC_EXTERN PetscErrorCode TSGetAdapt(TS,TSAdapt*);
    709: PETSC_EXTERN PetscErrorCode TSAdaptRegister(const char[],PetscErrorCode (*)(TSAdapt));
    710: PETSC_EXTERN PetscErrorCode TSAdaptInitializePackage(void);
    711: PETSC_EXTERN PetscErrorCode TSAdaptFinalizePackage(void);
    712: PETSC_EXTERN PetscErrorCode TSAdaptCreate(MPI_Comm,TSAdapt*);
    713: PETSC_EXTERN PetscErrorCode TSAdaptSetType(TSAdapt,TSAdaptType);
    714: PETSC_EXTERN PetscErrorCode TSAdaptGetType(TSAdapt,TSAdaptType*);
    715: PETSC_EXTERN PetscErrorCode TSAdaptSetOptionsPrefix(TSAdapt,const char[]);
    716: PETSC_EXTERN PetscErrorCode TSAdaptCandidatesClear(TSAdapt);
    717: PETSC_EXTERN PetscErrorCode TSAdaptCandidateAdd(TSAdapt,const char[],PetscInt,PetscInt,PetscReal,PetscReal,PetscBool);
    718: PETSC_EXTERN PetscErrorCode TSAdaptCandidatesGet(TSAdapt,PetscInt*,const PetscInt**,const PetscInt**,const PetscReal**,const PetscReal**);
    719: PETSC_EXTERN PetscErrorCode TSAdaptChoose(TSAdapt,TS,PetscReal,PetscInt*,PetscReal*,PetscBool*);
    720: PETSC_EXTERN PetscErrorCode TSAdaptCheckStage(TSAdapt,TS,PetscReal,Vec,PetscBool*);
    721: PETSC_EXTERN PetscErrorCode TSAdaptView(TSAdapt,PetscViewer);
    722: PETSC_EXTERN PetscErrorCode TSAdaptLoad(TSAdapt,PetscViewer);
    723: PETSC_EXTERN PetscErrorCode TSAdaptSetFromOptions(PetscOptionItems*,TSAdapt);
    724: PETSC_EXTERN PetscErrorCode TSAdaptReset(TSAdapt);
    725: PETSC_EXTERN PetscErrorCode TSAdaptDestroy(TSAdapt*);
    726: PETSC_EXTERN PetscErrorCode TSAdaptSetMonitor(TSAdapt,PetscBool);
    727: PETSC_EXTERN PetscErrorCode TSAdaptSetAlwaysAccept(TSAdapt,PetscBool);
    728: PETSC_EXTERN PetscErrorCode TSAdaptSetSafety(TSAdapt,PetscReal,PetscReal);
    729: PETSC_EXTERN PetscErrorCode TSAdaptGetSafety(TSAdapt,PetscReal*,PetscReal*);
    730: PETSC_EXTERN PetscErrorCode TSAdaptSetMaxIgnore(TSAdapt,PetscReal);
    731: PETSC_EXTERN PetscErrorCode TSAdaptGetMaxIgnore(TSAdapt,PetscReal*);
    732: PETSC_EXTERN PetscErrorCode TSAdaptSetClip(TSAdapt,PetscReal,PetscReal);
    733: PETSC_EXTERN PetscErrorCode TSAdaptGetClip(TSAdapt,PetscReal*,PetscReal*);
    734: PETSC_EXTERN PetscErrorCode TSAdaptSetScaleSolveFailed(TSAdapt,PetscReal);
    735: PETSC_EXTERN PetscErrorCode TSAdaptGetScaleSolveFailed(TSAdapt,PetscReal*);
    736: PETSC_EXTERN PetscErrorCode TSAdaptSetStepLimits(TSAdapt,PetscReal,PetscReal);
    737: PETSC_EXTERN PetscErrorCode TSAdaptGetStepLimits(TSAdapt,PetscReal*,PetscReal*);
    738: PETSC_EXTERN PetscErrorCode TSAdaptSetCheckStage(TSAdapt,PetscErrorCode(*)(TSAdapt,TS,PetscReal,Vec,PetscBool*));
    739: PETSC_EXTERN PetscErrorCode TSAdaptHistorySetHistory(TSAdapt,PetscInt n,PetscReal hist[],PetscBool);
    740: PETSC_EXTERN PetscErrorCode TSAdaptHistorySetTrajectory(TSAdapt,TSTrajectory,PetscBool);
    741: PETSC_EXTERN PetscErrorCode TSAdaptHistoryGetStep(TSAdapt,PetscInt,PetscReal*,PetscReal*);
    742: PETSC_EXTERN PetscErrorCode TSAdaptSetTimeStepIncreaseDelay(TSAdapt,PetscInt);
    743: PETSC_EXTERN PetscErrorCode TSAdaptDSPSetFilter(TSAdapt,const char *);
    744: PETSC_EXTERN PetscErrorCode TSAdaptDSPSetPID(TSAdapt,PetscReal,PetscReal,PetscReal);

    746: /*S
    747:    TSGLLEAdapt - Abstract object that manages time-step adaptivity

    749:    Level: beginner

    751:    Developer Notes:
    752:    This functionality should be replaced by the TSAdapt.

    754: .seealso: TSGLLE, TSGLLEAdaptCreate(), TSGLLEAdaptType
    755: S*/
    756: typedef struct _p_TSGLLEAdapt *TSGLLEAdapt;

    758: /*J
    759:     TSGLLEAdaptType - String with the name of TSGLLEAdapt scheme

    761:    Level: beginner

    763: .seealso: TSGLLEAdaptSetType(), TS
    764: J*/
    765: typedef const char *TSGLLEAdaptType;
    766: #define TSGLLEADAPT_NONE "none"
    767: #define TSGLLEADAPT_SIZE "size"
    768: #define TSGLLEADAPT_BOTH "both"

    770: PETSC_EXTERN PetscErrorCode TSGLLEAdaptRegister(const char[],PetscErrorCode (*)(TSGLLEAdapt));
    771: PETSC_EXTERN PetscErrorCode TSGLLEAdaptInitializePackage(void);
    772: PETSC_EXTERN PetscErrorCode TSGLLEAdaptFinalizePackage(void);
    773: PETSC_EXTERN PetscErrorCode TSGLLEAdaptCreate(MPI_Comm,TSGLLEAdapt*);
    774: PETSC_EXTERN PetscErrorCode TSGLLEAdaptSetType(TSGLLEAdapt,TSGLLEAdaptType);
    775: PETSC_EXTERN PetscErrorCode TSGLLEAdaptSetOptionsPrefix(TSGLLEAdapt,const char[]);
    776: PETSC_EXTERN PetscErrorCode TSGLLEAdaptChoose(TSGLLEAdapt,PetscInt,const PetscInt[],const PetscReal[],const PetscReal[],PetscInt,PetscReal,PetscReal,PetscInt*,PetscReal*,PetscBool *);
    777: PETSC_EXTERN PetscErrorCode TSGLLEAdaptView(TSGLLEAdapt,PetscViewer);
    778: PETSC_EXTERN PetscErrorCode TSGLLEAdaptSetFromOptions(PetscOptionItems*,TSGLLEAdapt);
    779: PETSC_EXTERN PetscErrorCode TSGLLEAdaptDestroy(TSGLLEAdapt*);

    781: /*J
    782:     TSGLLEAcceptType - String with the name of TSGLLEAccept scheme

    784:    Level: beginner

    786: .seealso: TSGLLESetAcceptType(), TS
    787: J*/
    788: typedef const char *TSGLLEAcceptType;
    789: #define TSGLLEACCEPT_ALWAYS "always"

    791: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*TSGLLEAcceptFunction)(TS,PetscReal,PetscReal,const PetscReal[],PetscBool *);
    792: PETSC_EXTERN PetscErrorCode TSGLLEAcceptRegister(const char[],TSGLLEAcceptFunction);

    794: /*J
    795:   TSGLLEType - family of time integration method within the General Linear class

    797:   Level: beginner

    799: .seealso: TSGLLESetType(), TSGLLERegister()
    800: J*/
    801: typedef const char* TSGLLEType;
    802: #define TSGLLE_IRKS   "irks"

    804: PETSC_EXTERN PetscErrorCode TSGLLERegister(const char[],PetscErrorCode(*)(TS));
    805: PETSC_EXTERN PetscErrorCode TSGLLEInitializePackage(void);
    806: PETSC_EXTERN PetscErrorCode TSGLLEFinalizePackage(void);
    807: PETSC_EXTERN PetscErrorCode TSGLLESetType(TS,TSGLLEType);
    808: PETSC_EXTERN PetscErrorCode TSGLLEGetAdapt(TS,TSGLLEAdapt*);
    809: PETSC_EXTERN PetscErrorCode TSGLLESetAcceptType(TS,TSGLLEAcceptType);

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

    814:    Level: beginner

    816: .seealso: TSEIMEXSetType(), TS, TSEIMEX, TSEIMEXRegister()
    817: J*/
    818: #define TSEIMEXType   char*

    820: PETSC_EXTERN PetscErrorCode TSEIMEXSetMaxRows(TS ts,PetscInt);
    821: PETSC_EXTERN PetscErrorCode TSEIMEXSetRowCol(TS ts,PetscInt,PetscInt);
    822: PETSC_EXTERN PetscErrorCode TSEIMEXSetOrdAdapt(TS,PetscBool);

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

    827:    Level: beginner

    829: .seealso: TSRKSetType(), TS, TSRK, TSRKRegister()
    830: J*/
    831: typedef const char* TSRKType;
    832: #define TSRK1FE   "1fe"
    833: #define TSRK2A    "2a"
    834: #define TSRK2B    "2b"
    835: #define TSRK3     "3"
    836: #define TSRK3BS   "3bs"
    837: #define TSRK4     "4"
    838: #define TSRK5F    "5f"
    839: #define TSRK5DP   "5dp"
    840: #define TSRK5BS   "5bs"
    841: #define TSRK6VR   "6vr"
    842: #define TSRK7VR   "7vr"
    843: #define TSRK8VR   "8vr"

    845: PETSC_EXTERN PetscErrorCode TSRKGetOrder(TS,PetscInt*);
    846: PETSC_EXTERN PetscErrorCode TSRKGetType(TS,TSRKType*);
    847: PETSC_EXTERN PetscErrorCode TSRKSetType(TS,TSRKType);
    848: PETSC_EXTERN PetscErrorCode TSRKGetTableau(TS,PetscInt*,const PetscReal**,const PetscReal**,const PetscReal**,const PetscReal**,PetscInt*,const PetscReal**,PetscBool*);
    849: PETSC_EXTERN PetscErrorCode TSRKSetMultirate(TS,PetscBool);
    850: PETSC_EXTERN PetscErrorCode TSRKGetMultirate(TS,PetscBool*);
    851: PETSC_EXTERN PetscErrorCode TSRKRegister(TSRKType,PetscInt,PetscInt,const PetscReal[],const PetscReal[],const PetscReal[],const PetscReal[],PetscInt,const PetscReal[]);
    852: PETSC_EXTERN PetscErrorCode TSRKInitializePackage(void);
    853: PETSC_EXTERN PetscErrorCode TSRKFinalizePackage(void);
    854: PETSC_EXTERN PetscErrorCode TSRKRegisterDestroy(void);

    856: /*J
    857:    TSMPRKType - String with the name of a Partitioned Runge-Kutta method

    859:    Level: beginner

    861: .seealso: TSMPRKSetType(), TS, TSMPRK, TSMPRKRegister()
    862: J*/
    863: typedef const char* TSMPRKType;
    864: #define TSMPRK2A22  "2a22"
    865: #define TSMPRK2A23  "2a23"
    866: #define TSMPRK2A32  "2a32"
    867: #define TSMPRK2A33  "2a33"
    868: #define TSMPRKP2    "p2"
    869: #define TSMPRKP3    "p3"

    871: PETSC_EXTERN PetscErrorCode TSMPRKGetType(TS ts,TSMPRKType*);
    872: PETSC_EXTERN PetscErrorCode TSMPRKSetType(TS ts,TSMPRKType);
    873: 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[]);
    874: PETSC_EXTERN PetscErrorCode TSMPRKInitializePackage(void);
    875: PETSC_EXTERN PetscErrorCode TSMPRKFinalizePackage(void);
    876: PETSC_EXTERN PetscErrorCode TSMPRKRegisterDestroy(void);

    878: /*J
    879:     TSIRKType - String with the name of an implicit Runge-Kutta method.

    881:    Level: beginner

    883: .seealso: TSIRKSetType(), TS, TSIRK, TSIRKRegister()
    884: J*/
    885: typedef const char* TSIRKType;
    886: #define TSIRKGAUSS   "gauss"

    888: PETSC_EXTERN PetscErrorCode TSIRKGetOrder(TS,PetscInt*);
    889: PETSC_EXTERN PetscErrorCode TSIRKGetType(TS,TSIRKType*);
    890: PETSC_EXTERN PetscErrorCode TSIRKSetType(TS,TSIRKType);
    891: PETSC_EXTERN PetscErrorCode TSIRKGetNumStages(TS,PetscInt*);
    892: PETSC_EXTERN PetscErrorCode TSIRKSetNumStages(TS,PetscInt);
    893: PETSC_EXTERN PetscErrorCode TSIRKRegister(const char[],PetscErrorCode (*function)(TS));
    894: PETSC_EXTERN PetscErrorCode TSIRKTableauCreate(TS,PetscInt,const PetscReal*,const PetscReal*,const PetscReal*,const PetscReal*,const PetscScalar*,const PetscScalar*,const PetscScalar*);
    895: PETSC_EXTERN PetscErrorCode TSIRKInitializePackage(void);
    896: PETSC_EXTERN PetscErrorCode TSIRKFinalizePackage(void);
    897: PETSC_EXTERN PetscErrorCode TSIRKRegisterDestroy(void);

    899: /*J
    900:     TSGLEEType - String with the name of a General Linear with Error Estimation method.

    902:    Level: beginner

    904: .seealso: TSGLEESetType(), TS, TSGLEE, TSGLEERegister()
    905: J*/
    906: typedef const char* TSGLEEType;
    907: #define TSGLEEi1      "BE1"
    908: #define TSGLEE23      "23"
    909: #define TSGLEE24      "24"
    910: #define TSGLEE25I     "25i"
    911: #define TSGLEE35      "35"
    912: #define TSGLEEEXRK2A  "exrk2a"
    913: #define TSGLEERK32G1  "rk32g1"
    914: #define TSGLEERK285EX "rk285ex"
    915: /*J
    916:     TSGLEEMode - String with the mode of error estimation for a General Linear with Error Estimation method.

    918:    Level: beginner

    920: .seealso: TSGLEESetMode(), TS, TSGLEE, TSGLEERegister()
    921: J*/
    922: PETSC_EXTERN PetscErrorCode TSGLEEGetType(TS ts,TSGLEEType*);
    923: PETSC_EXTERN PetscErrorCode TSGLEESetType(TS ts,TSGLEEType);
    924: 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[]);
    925: PETSC_EXTERN PetscErrorCode TSGLEEFinalizePackage(void);
    926: PETSC_EXTERN PetscErrorCode TSGLEEInitializePackage(void);
    927: PETSC_EXTERN PetscErrorCode TSGLEERegisterDestroy(void);

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

    932:    Level: beginner

    934: .seealso: TSARKIMEXSetType(), TS, TSARKIMEX, TSARKIMEXRegister()
    935: J*/
    936: typedef const char* TSARKIMEXType;
    937: #define TSARKIMEX1BEE   "1bee"
    938: #define TSARKIMEXA2     "a2"
    939: #define TSARKIMEXL2     "l2"
    940: #define TSARKIMEXARS122 "ars122"
    941: #define TSARKIMEX2C     "2c"
    942: #define TSARKIMEX2D     "2d"
    943: #define TSARKIMEX2E     "2e"
    944: #define TSARKIMEXPRSSP2 "prssp2"
    945: #define TSARKIMEX3      "3"
    946: #define TSARKIMEXBPR3   "bpr3"
    947: #define TSARKIMEXARS443 "ars443"
    948: #define TSARKIMEX4      "4"
    949: #define TSARKIMEX5      "5"
    950: PETSC_EXTERN PetscErrorCode TSARKIMEXGetType(TS ts,TSARKIMEXType*);
    951: PETSC_EXTERN PetscErrorCode TSARKIMEXSetType(TS ts,TSARKIMEXType);
    952: PETSC_EXTERN PetscErrorCode TSARKIMEXSetFullyImplicit(TS,PetscBool);
    953: PETSC_EXTERN PetscErrorCode TSARKIMEXGetFullyImplicit(TS,PetscBool*);
    954: 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[]);
    955: PETSC_EXTERN PetscErrorCode TSARKIMEXInitializePackage(void);
    956: PETSC_EXTERN PetscErrorCode TSARKIMEXFinalizePackage(void);
    957: PETSC_EXTERN PetscErrorCode TSARKIMEXRegisterDestroy(void);

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

    962:    Level: beginner

    964: .seealso: TSRosWSetType(), TS, TSROSW, TSRosWRegister()
    965: J*/
    966: typedef const char* TSRosWType;
    967: #define TSROSW2M          "2m"
    968: #define TSROSW2P          "2p"
    969: #define TSROSWRA3PW       "ra3pw"
    970: #define TSROSWRA34PW2     "ra34pw2"
    971: #define TSROSWRODAS3      "rodas3"
    972: #define TSROSWSANDU3      "sandu3"
    973: #define TSROSWASSP3P3S1C  "assp3p3s1c"
    974: #define TSROSWLASSP3P4S2C "lassp3p4s2c"
    975: #define TSROSWLLSSP3P4S2C "llssp3p4s2c"
    976: #define TSROSWARK3        "ark3"
    977: #define TSROSWTHETA1      "theta1"
    978: #define TSROSWTHETA2      "theta2"
    979: #define TSROSWGRK4T       "grk4t"
    980: #define TSROSWSHAMP4      "shamp4"
    981: #define TSROSWVELDD4      "veldd4"
    982: #define TSROSW4L          "4l"

    984: PETSC_EXTERN PetscErrorCode TSRosWGetType(TS,TSRosWType*);
    985: PETSC_EXTERN PetscErrorCode TSRosWSetType(TS,TSRosWType);
    986: PETSC_EXTERN PetscErrorCode TSRosWSetRecomputeJacobian(TS,PetscBool);
    987: PETSC_EXTERN PetscErrorCode TSRosWRegister(TSRosWType,PetscInt,PetscInt,const PetscReal[],const PetscReal[],const PetscReal[],const PetscReal[],PetscInt,const PetscReal[]);
    988: PETSC_EXTERN PetscErrorCode TSRosWRegisterRos4(TSRosWType,PetscReal,PetscReal,PetscReal,PetscReal,PetscReal);
    989: PETSC_EXTERN PetscErrorCode TSRosWInitializePackage(void);
    990: PETSC_EXTERN PetscErrorCode TSRosWFinalizePackage(void);
    991: PETSC_EXTERN PetscErrorCode TSRosWRegisterDestroy(void);

    993: PETSC_EXTERN PetscErrorCode TSBDFSetOrder(TS,PetscInt);
    994: PETSC_EXTERN PetscErrorCode TSBDFGetOrder(TS,PetscInt*);

    996: /*J
    997:   TSBasicSymplecticType - String with the name of a basic symplectic integration method.

    999:   Level: beginner

    1001:   .seealso: TSBasicSymplecticSetType(), TS, TSBASICSYMPLECTIC, TSBasicSymplecticRegister()
    1002: J*/
    1003: typedef const char* TSBasicSymplecticType;
    1004: #define TSBASICSYMPLECTICSIEULER   "1"
    1005: #define TSBASICSYMPLECTICVELVERLET "2"
    1006: #define TSBASICSYMPLECTIC3         "3"
    1007: #define TSBASICSYMPLECTIC4         "4"
    1008: PETSC_EXTERN PetscErrorCode TSBasicSymplecticSetType(TS,TSBasicSymplecticType);
    1009: PETSC_EXTERN PetscErrorCode TSBasicSymplecticGetType(TS,TSBasicSymplecticType*);
    1010: PETSC_EXTERN PetscErrorCode TSBasicSymplecticRegister(TSBasicSymplecticType,PetscInt,PetscInt,PetscReal[],PetscReal[]);
    1011: PETSC_EXTERN PetscErrorCode TSBasicSymplecticInitializePackage(void);
    1012: PETSC_EXTERN PetscErrorCode TSBasicSymplecticFinalizePackage(void);
    1013: PETSC_EXTERN PetscErrorCode TSBasicSymplecticRegisterDestroy(void);

    1015: /*J
    1016:   TSDiscreteGradient - The Discrete Gradient integrator is a timestepper for hamiltonian systems designed to conserve the first integral (energy), but also has the property for some systems of monotonicity in a functional.

    1018:   Level: beginner

    1020:   .seealso: TS, TSDISCGRAD, TSDiscGradSetFormulation(), TSDiscGradGetFormulation
    1021: J*/
    1022: PETSC_EXTERN PetscErrorCode TSDiscGradSetFormulation(TS, PetscErrorCode(*)(TS, PetscReal, Vec, Mat, void *), PetscErrorCode(*)(TS, PetscReal, Vec, PetscScalar *, void *), PetscErrorCode(*)(TS, PetscReal, Vec, Vec, void *), void *);
    1023: PETSC_EXTERN PetscErrorCode TSDiscGradIsGonzalez(TS,PetscBool*);
    1024: PETSC_EXTERN PetscErrorCode TSDiscGradUseGonzalez(TS,PetscBool);

    1026: /*
    1027:        PETSc interface to Sundials
    1028: */
    1029: #ifdef PETSC_HAVE_SUNDIALS2
    1030: typedef enum { SUNDIALS_ADAMS=1,SUNDIALS_BDF=2} TSSundialsLmmType;
    1031: PETSC_EXTERN const char *const TSSundialsLmmTypes[];
    1032: typedef enum { SUNDIALS_MODIFIED_GS = 1,SUNDIALS_CLASSICAL_GS = 2 } TSSundialsGramSchmidtType;
    1033: PETSC_EXTERN const char *const TSSundialsGramSchmidtTypes[];
    1034: PETSC_EXTERN PetscErrorCode TSSundialsSetType(TS,TSSundialsLmmType);
    1035: PETSC_EXTERN PetscErrorCode TSSundialsGetPC(TS,PC*);
    1036: PETSC_EXTERN PetscErrorCode TSSundialsSetTolerance(TS,PetscReal,PetscReal);
    1037: PETSC_EXTERN PetscErrorCode TSSundialsSetMinTimeStep(TS,PetscReal);
    1038: PETSC_EXTERN PetscErrorCode TSSundialsSetMaxTimeStep(TS,PetscReal);
    1039: PETSC_EXTERN PetscErrorCode TSSundialsGetIterations(TS,PetscInt *,PetscInt *);
    1040: PETSC_EXTERN PetscErrorCode TSSundialsSetGramSchmidtType(TS,TSSundialsGramSchmidtType);
    1041: PETSC_EXTERN PetscErrorCode TSSundialsSetGMRESRestart(TS,PetscInt);
    1042: PETSC_EXTERN PetscErrorCode TSSundialsSetLinearTolerance(TS,PetscReal);
    1043: PETSC_EXTERN PetscErrorCode TSSundialsMonitorInternalSteps(TS,PetscBool);
    1044: PETSC_EXTERN PetscErrorCode TSSundialsGetParameters(TS,PetscInt *,long*[],double*[]);
    1045: PETSC_EXTERN PetscErrorCode TSSundialsSetMaxl(TS,PetscInt);
    1046: PETSC_EXTERN PetscErrorCode TSSundialsSetMaxord(TS,PetscInt);
    1047: PETSC_EXTERN PetscErrorCode TSSundialsSetUseDense(TS,PetscBool);
    1048: #endif

    1050: PETSC_EXTERN PetscErrorCode TSThetaSetTheta(TS,PetscReal);
    1051: PETSC_EXTERN PetscErrorCode TSThetaGetTheta(TS,PetscReal*);
    1052: PETSC_EXTERN PetscErrorCode TSThetaGetEndpoint(TS,PetscBool*);
    1053: PETSC_EXTERN PetscErrorCode TSThetaSetEndpoint(TS,PetscBool);

    1055: PETSC_EXTERN PetscErrorCode TSAlphaSetRadius(TS,PetscReal);
    1056: PETSC_EXTERN PetscErrorCode TSAlphaSetParams(TS,PetscReal,PetscReal,PetscReal);
    1057: PETSC_EXTERN PetscErrorCode TSAlphaGetParams(TS,PetscReal*,PetscReal*,PetscReal*);

    1059: PETSC_EXTERN PetscErrorCode TSAlpha2SetRadius(TS,PetscReal);
    1060: PETSC_EXTERN PetscErrorCode TSAlpha2SetParams(TS,PetscReal,PetscReal,PetscReal,PetscReal);
    1061: PETSC_EXTERN PetscErrorCode TSAlpha2GetParams(TS,PetscReal*,PetscReal*,PetscReal*,PetscReal*);

    1063: PETSC_EXTERN PetscErrorCode TSSetDM(TS,DM);
    1064: PETSC_EXTERN PetscErrorCode TSGetDM(TS,DM*);

    1066: PETSC_EXTERN PetscErrorCode SNESTSFormFunction(SNES,Vec,Vec,void*);
    1067: PETSC_EXTERN PetscErrorCode SNESTSFormJacobian(SNES,Vec,Mat,Mat,void*);

    1069: PETSC_EXTERN PetscErrorCode TSRHSJacobianTest(TS,PetscBool*);
    1070: PETSC_EXTERN PetscErrorCode TSRHSJacobianTestTranspose(TS,PetscBool*);

    1072: PETSC_EXTERN PetscErrorCode TSGetComputeInitialCondition(TS, PetscErrorCode (**)(TS, Vec));
    1073: PETSC_EXTERN PetscErrorCode TSSetComputeInitialCondition(TS, PetscErrorCode (*)(TS, Vec));
    1074: PETSC_EXTERN PetscErrorCode TSComputeInitialCondition(TS, Vec);
    1075: PETSC_EXTERN PetscErrorCode TSGetComputeExactError(TS, PetscErrorCode (**)(TS, Vec, Vec));
    1076: PETSC_EXTERN PetscErrorCode TSSetComputeExactError(TS, PetscErrorCode (*)(TS, Vec, Vec));
    1077: PETSC_EXTERN PetscErrorCode TSComputeExactError(TS, Vec, Vec);
    1078: PETSC_EXTERN PetscErrorCode PetscConvEstUseTS(PetscConvEst, PetscBool);

    1080: PETSC_EXTERN PetscErrorCode TSSetMatStructure(TS,MatStructure);
    1081: #endif