PETSc version 3.17.1

Time steppers for ODE and DAE - TS: Examples

The time-stepping (TS) component provides ODE and DAE integrators as well as pseudo-timestepping. TS internally employs SNES to solve the nonlinear problems at each time step (except for the Sundials functions, which use nonlinear solvers within Sundials). TS users can also set SNES options directly in application codes by first extracting the SNES context from the TS context via TSGetSNES() and then directly calling various SNES (and KSP and PC with further unwrapping) routines (e.g., PCSetType() ).

Beginner - Basic usage
DMDATSSetIFunctionLocal TSGLLEAdapt TSSSPSetNumStages
DMDATSSetIJacobianLocal TSGLLEAdaptType TSSSPSetType
DMDATSSetRHSFunctionLocal TSGLLEType TSSSPType
DMDATSSetRHSJacobianLocal TSGetConvergedReason TSSUNDIALS
DMTSSetIFunctionLocal TSGetEquationType TSSetEventTolerances
DMTSSetIJacobianLocal TSGetExactFinalTime TSSetExactFinalTime
DMTSSetRHSFunctionLocal TSGetKSP TSSetForcingFunction
TS TSGetPrevTime TSSetFromOptions
TS2SetSolution TSGetProblemType TSSetI2Function
TSALPHA TSGetSNES TSSetI2Jacobian
TSALPHA2 TSGetSolveTime TSSetIFunction
TSARKIMEX TSGetTime TSSetIJacobian
TSARKIMEXType TSGetTolerances TSSetProblemType
TSAdapt TSIRK TSSetRHSFunction
TSAdaptType TSIRKType TSSetRHSJacobian
TSBDF TSMIMEX TSSetSolution
TSBEULER TSMPRK TSSetSolutionFunction
TSBasicSymplectic TSMPRKType TSSetTolerances
TSBasicSymplecticType TSPSEUDO TSSolve
TSCN TSProblemType TSSundialsMonitorInternalSteps
TSConvergedReason TSRADAU5 TSSundialsSetMaxTimeStep
TSCreate TSRHSSplitSetRHSFunction TSSundialsSetMinTimeStep
TSDestroy TSRK TSTHETA
TSDiscreteGradient TSRKType TSType
TSEIMEX TSROSW TSView
TSEIMEXType TSReset TS_CONVERGED_EVENT
TSEULER TSRosWSetType TS_CONVERGED_ITERATING
TSEquationType TSRosWType TS_CONVERGED_ITS
TSExactFinalTimeOption TSSSP TS_CONVERGED_PSEUDO_FATOL
TSGLEE TSSSPGetNumStages TS_CONVERGED_PSEUDO_FRTOL
TSGLEEMode TSSSPGetType TS_CONVERGED_TIME
TSGLEEType TSSSPRKS104 TS_CONVERGED_USER
TSGLLE TSSSPRKS2 TS_DIVERGED_NONLINEAR_SOLVE
TSGLLEAcceptType TSSSPRKS3 TS_DIVERGED_STEP_REJECTED
Intermediate - Setting options for algorithms and data structures
DMTSSetBoundaryLocal TSGetRHSJacobian TSRKSetType
TS2GetSolution TSGetSNESFailures TSROSW2M
TSADAPTBASIC TSGetSNESIterations TSROSW2P
TSADAPTCFL TSGetSolution TSROSW4L
TSADAPTDSP TSGetStepNumber TSROSWASSP3P3S1C
TSADAPTGLEE TSGetStepRejections TSROSWGRK4T
TSADAPTNONE TSGetTimeError TSROSWLASSP3P4S2C
TSARKIMEXGetFullyImplicit TSGetTimeStep TSROSWLLSSP3P4S2C
TSARKIMEXGetType TSGetType TSROSWRA34PW2
TSARKIMEXSetFullyImplicit TSGetUseSplitRHSFunction TSROSWRA3PW
TSARKIMEXSetType TSIRKGetNumStages TSROSWRODAS3
TSAdaptDSPSetFilter TSIRKGetType TSROSWSANDU3
TSAdaptDSPSetPID TSIRKSetNumStages TSROSWSHAMP4
TSAdaptGetClip TSIRKSetType TSROSWTHETA1
TSAdaptGetMaxIgnore TSInterpolate TSROSWTHETA2
TSAdaptGetSafety TSLoad TSROSWVELDD4
TSAdaptGetScaleSolveFailed TSMPRKGetType TSRemoveTrajectory
TSAdaptGetStepLimits TSMPRKSetType TSResetTrajectory
TSAdaptGetType TSMonitorCancel TSRosWGetType
TSAdaptLoad TSMonitorDefault TSRosWSetRecomputeJacobian
TSAdaptSetAlwaysAccept TSMonitorDrawCtxCreate TSSetApplicationContext
TSAdaptSetClip TSMonitorDrawCtxDestroy TSSetCFLTimeLocal
TSAdaptSetMaxIgnore TSMonitorDrawError TSSetDM
TSAdaptSetMonitor TSMonitorDrawSolution TSSetErrorIfStepFails
TSAdaptSetSafety TSMonitorDrawSolutionFunction TSSetEventHandler
TSAdaptSetScaleSolveFailed TSMonitorDrawSolutionPhase TSSetFunctionDomainError
TSAdaptSetStepLimits TSMonitorEnvelope TSSetMatStructure
TSAdaptSetType TSMonitorEnvelopeCtxCreate TSSetMaxSNESFailures
TSAlpha2SetRadius TSMonitorEnvelopeCtxDestroy TSSetMaxStepRejections
TSAlphaSetRadius TSMonitorEnvelopeGetBounds TSSetMaxSteps
TSBASICSYMPLECTICSIEULER TSMonitorError TSSetMaxTime
TSBASICSYMPLECTICVELVERLET TSMonitorExtreme TSSetPostEvaluate
TSBDFGetOrder TSMonitorLGCtxCreate TSSetPostStage
TSBDFSetOrder TSMonitorLGCtxDestroy TSSetPostStep
TSBasicSymplecticGetType TSMonitorLGCtxSetDisplayVariables TSSetPreStage
TSBasicSymplecticSetType TSMonitorLGCtxSetTransform TSSetPreStep
TSComputeIFunctionLinear TSMonitorLGCtxSetVariableNames TSSetSaveTrajectory
TSComputeIJacobianDefaultColor TSMonitorLGError TSSetTime
TSComputeRHSFunctionLinear TSMonitorLGGetVariableNames TSSetTimeError
TSComputeRHSJacobianConstant TSMonitorLGSetDisplayVariables TSSetTimeStep
TSDISCGRAD TSMonitorLGSetTransform TSSetType
TSDMSwarmMonitorMoments TSMonitorLGSetVariableNames TSSetUseSplitRHSFunction
TSDiscGradGetFormulation TSMonitorLGSolution TSSundialsSetTolerance
TSDiscGradSetFormulation TSMonitorSPEigCtxCreate TSSundialsSetType
TSDiscGradUseGonzalez TSMonitorSPEigCtxDestroy TSTRAJECTORYBASIC
TSEIMEXSetMaxRows TSMonitorSPSwarmSolution TSTRAJECTORYMEMORY
TSEIMEXSetOrdAdapt TSMonitorSet TSTRAJECTORYSINGLEFILE
TSEIMEXSetRowCol TSMonitorSolution TSTRAJECTORYVISUALIZATION
TSGLEEGetType TSMonitorSolutionVTK TSThetaSetEndpoint
TSGLEESetType TSMonitorSolutionVTKDestroy TSThetaSetTheta
TSGLLESetAcceptType TSPseudoSetTimeStep TSTrajectoryMemorySetType
TSGLLESetType TSPythonSetType TSTrajectorySetMaxCpsDisk
TSGetAdapt TSRHSJacobianSetReuse TSTrajectorySetMaxCpsRAM
TSGetApplicationContext TSRHSSplitGetIS TSTrajectorySetMaxUnitsDisk
TSGetAuxSolution TSRHSSplitSetIS TSTrajectorySetMaxUnitsRAM
TSGetDM TSRKGetMultirate TSTrajectorySetTransform
TSGetKSPIterations TSRKGetOrder TSTrajectorySetVariableNames
TSGetNumEvents TSRKGetType TSTrajectoryViewFromOptions
TSGetOptionsPrefix TSRKSetMultirate TSViewFromOptions
Advanced - Setting more advanced options and customization
DMTSGetForcingFunction TSComputeExactError TSPseudoSetVerifyTimeStep
DMTSGetI2Function TSComputeIJacobianConstant TSPseudoTimeStepDefault
DMTSGetI2Jacobian TSComputeInitialCondition TSPseudoVerifyTimeStep
DMTSGetIFunction TSDiscGradIsGonzalez TSPseudoVerifyTimeStepDefault
DMTSGetIJacobian TSEvaluateStep TSRHSJacobianTest
DMTSGetRHSFunction TSEvaluateWLTE TSRHSJacobianTestTranspose
DMTSGetRHSJacobian TSGLEE23 TSRHSSplitGetSubTS
DMTSGetSolutionFunction TSGLEE24 TSRHSSplitGetSubTSs
DMTSGetTransientVariable TSGLEE25i TSRK1FE
DMTSSetForcingFunction TSGLEE35 TSRK2A
DMTSSetI2Function TSGLEEEXRK2A TSRK2B
DMTSSetI2Jacobian TSGLEERK285EX TSRK3
DMTSSetIFunction TSGLEERK32G1 TSRK3BS
DMTSSetIFunctionSerialize TSGLEERegister TSRK4
DMTSSetIJacobian TSGLEERegisterAll TSRK5BS
DMTSSetIJacobianSerialize TSGLEERegisterDestroy TSRK5DP
DMTSSetRHSFunction TSGLLEAcceptRegister TSRK5F
DMTSSetRHSJacobian TSGLLEAdaptRegister TSRK6VR
DMTSSetSolutionFunction TSGLLEAdaptRegisterAll TSRK7VR
DMTSSetTransientVariable TSGLLEGetAdapt TSRK8VR
SNESTSFormFunction TSGLLERegister TSRKRegister
TSARKIMEX1BEE TSGLLERegisterAll TSRKRegisterAll
TSARKIMEX2C TSGetCFLTime TSRKRegisterDestroy
TSARKIMEX2D TSGetComputeExactError TSRegister
TSARKIMEX2E TSGetComputeInitialCondition TSRegisterAll
TSARKIMEX3 TSGetI2Function TSRestartStep
TSARKIMEX4 TSGetI2Jacobian TSRollBack
TSARKIMEX5 TSGetIFunction TSRosWRegister
TSARKIMEXA2 TSGetIJacobian TSRosWRegisterAll
TSARKIMEXARS122 TSGetMaxSteps TSRosWRegisterDestroy
TSARKIMEXARS443 TSGetMaxTime TSSetComputeExactError
TSARKIMEXBPR3 TSGetRHSFunction TSSetComputeInitialCondition
TSARKIMEXL2 TSGetSolutionComponents TSSetConvergedReason
TSARKIMEXPRSSP2 TSGetStages TSSetEquationType
TSARKIMEXRegister TSGetTrajectory TSSetOptionsPrefix
TSARKIMEXRegisterAll TSIRKRegister TSSetPostEventIntervalStep
TSARKIMEXRegisterDestroy TSIRKRegisterAll TSSetStepNumber
TSAdaptHistoryGetStep TSIRKRegisterDestroy TSSetTransientVariable
TSAdaptHistorySetHistory TSIRKTableauCreate TSSetUp
TSAdaptHistorySetTrajectory TSMPRK2A22 TSSundialsGetIterations
TSAdaptRegister TSMPRK2A23 TSSundialsGetPC
TSAdaptRegisterAll TSMPRK2A32 TSSundialsSetGramSchmidtType
TSAdaptSetCheckStage TSMPRK2A33 TSSundialsSetLinearTolerance
TSAdaptSetTimeStepIncreaseDelay TSMPRK3P2M TSSundialsSetMaxl
TSAlpha2GetParams TSMPRKP2 TSSundialsSetMaxord
TSAlpha2SetParams TSMPRKP3 TSSundialsSetUseDense
TSAlphaGetParams TSMPRKRegister TSThetaGetEndpoint
TSAlphaSetParams TSMPRKRegisterAll TSThetaGetTheta
TSAppendOptionsPrefix TSMPRKRegisterDestroy TSTrajectory
TSBasicSymplecticRegister TSPseudoIncrementDtFromInitialDt TSTrajectorySetKeepFiles
TSBasicSymplecticRegisterAll TSPseudoSetMaxTimeStep TSTrajectorySetUseHistory
TSBasicSymplecticRegisterDestroy TSPseudoSetTimeStepIncrement TSVISetVariableBounds
Developer - Interfaces intended primarily for library developers, not for typical applications programmers
DMCopyDMTS TSComputeI2Jacobian TSPreStep
DMGetDMTS TSComputeIFunction TSPseudoComputeTimeStep
DMGetDMTSWrite TSComputeIJacobian TSRKFinalizePackage
DMPlexTSComputeBoundary TSComputeLinearStability TSRKGetTableau
DMPlexTSComputeIFunctionFEM TSComputeRHSFunction TSRKInitializePackage
DMPlexTSComputeIJacobianFEM TSComputeRHSJacobian TSRosWFinalizePackage
DMPlexTSComputeRHSFunctionFEM TSComputeSolutionFunction TSRosWInitializePackage
DMPlexTSComputeRHSFunctionFVM TSComputeTransientVariable TSRosWRegisterRos4
DMTSCheckFromOptions TSErrorWeightedENorm TSSSPFinalizePackage
DMTSCheckJacobian TSErrorWeightedENorm2 TSSSPInitializePackage
DMTSCheckResidual TSErrorWeightedENormInfinity TSSetSNES
DMTSCopy TSErrorWeightedNorm TSStep
DMTSCreateRHSMassMatrix TSErrorWeightedNorm2 TSTrajectoryCreate
DMTSCreateRHSMassMatrixLumped TSErrorWeightedNormInfinity TSTrajectoryDestroy
DMTSDestroyRHSMassMatrix TSFinalizePackage TSTrajectoryGet
SNESTSFormJacobian TSFunctionDomainError TSTrajectoryGetNumSteps
TSADAPTHISTORY TSGLEEFinalizePackage TSTrajectoryGetSolutionOnly
TSARKIMEXFinalizePackage TSGLEEInitializePackage TSTrajectoryGetType
TSARKIMEXInitializePackage TSGLLEAdaptInitializePackage TSTrajectoryGetUpdatedHistoryVecs
TSAdaptCandidateAdd TSGLLEFinalizePackage TSTrajectoryGetVecs
TSAdaptCandidatesClear TSGLLEInitializePackage TSTrajectoryRegister
TSAdaptCandidatesGet TSHasTransientVariable TSTrajectoryRegisterAll
TSAdaptCheckStage TSIRKFinalizePackage TSTrajectoryReset
TSAdaptChoose TSIRKInitializePackage TSTrajectoryRestoreUpdatedHistoryVecs
TSAdaptCreate TSInitializePackage TSTrajectorySet
TSAdaptFinalizePackage TSMPRKFinalizePackage TSTrajectorySetDirname
TSAdaptInitializePackage TSMPRKInitializePackage TSTrajectorySetFiletemplate
TSAdaptReset TSMonitor TSTrajectorySetFromOptions
TSBasicSymplecticFinalizePackage TSMonitorSetFromOptions TSTrajectorySetMonitor
TSBasicSymplecticInitializePackage TSPostEvaluate TSTrajectorySetSolutionOnly
TSClone TSPostStage TSTrajectorySetType
TSComputeForcingFunction TSPostStep TSTrajectorySetUp
TSComputeI2Function TSPreStage TSTrajectoryView
Deprecated - Functionality scheduled for removal in future versions
TSGetDuration TSGetTotalSteps TSSetInitialTimeStep
TSGetTimeStepNumber TSSetDuration

Table of Contents