TS (Time Stepping) - Low-level Interface
<a id="ch_ts"></a>
The TS (Time Stepping) component provides methods for solving time-dependent differential equations, including ordinary differential equations (ODEs), differential-algebraic equations (DAEs), and time-dependent partial differential equations (PDEs).
Overview
TS supports various time integration methods including:
- Explicit methods: Forward Euler, Runge-Kutta methods (RK2, RK3, RK4, etc.)
- Implicit methods: Backward Euler, Crank-Nicolson, BDF methods
- IMEX methods: Implicit-Explicit combinations for stiff-nonstiff problems
- Adaptive methods: Adaptive time stepping with error control
- Specialized methods: Theta methods, Rosenbrock methods, SSP methods
The TS object manages the time integration loop, adaptive time stepping, event detection, and provides interfaces to various time stepping schemes.
Basic Usage
using PETSc, MPI
# Initialize MPI and PETSc
MPI.Init()
petsclib = PETSc.getlib()
PETSc.initialize(petsclib)
# Create a TS object
ts = LibPETSc.TSCreate(petsclib, LibPETSc.PETSC_COMM_SELF)
# Set the problem type (ODE or DAE)
LibPETSc.TSSetProblemType(petsclib, ts, LibPETSc.TS_NONLINEAR)
# Set the time stepping method (e.g., BDF, RK, Theta)
LibPETSc.TSSetType(petsclib, ts, "bdf") # String convenience wrapper
# Set time span
LibPETSc.TSSetTime(petsclib, ts, 0.0) # Initial time
LibPETSc.TSSetMaxTime(petsclib, ts, 1.0) # Final time
LibPETSc.TSSetExactFinalTime(petsclib, ts, LibPETSc.TS_EXACTFINALTIME_STEPOVER)
# Set initial time step
LibPETSc.TSSetTimeStep(petsclib, ts, 0.01)
# Set the right-hand side function (for ODE: du/dt = f(t,u))
# LibPETSc.TSSetRHSFunction(petsclib, ts, C_NULL, rhs_function_ptr, C_NULL)
# Set options from command line/options database
LibPETSc.TSSetFromOptions(petsclib, ts)
# Set initial condition
# LibPETSc.TSSetSolution(petsclib, ts, initial_vec)
# Solve
# LibPETSc.TSSolve(petsclib, ts, solution_vec)
# Get solution time (returns value directly)
final_time = LibPETSc.TSGetSolveTime(petsclib, ts)
# Cleanup
LibPETSc.TSDestroy(petsclib, ts)
# Finalize PETSc and MPI
PETSc.finalize(petsclib)
MPI.Finalize()Common Workflow
- Create and configure TS: Use
TSCreate,TSSetType,TSSetProblemType - Set time parameters:
TSSetTime,TSSetMaxTime,TSSetTimeStep,TSSetMaxSteps - Define equations:
TSSetRHSFunction,TSSetIFunction,TSSetIJacobian - Configure adaptivity:
TSAdaptSetType,TSSetTolerances - Set initial condition:
TSSetSolution - Solve:
TSSolve - Retrieve solution:
TSGetSolution,TSGetTime,TSGetStepNumber
Time Integration Schemes
Available through TSSetType:
TSEULER: Forward/Backward EulerTSRK: Runge-Kutta methods (various orders)TSBDF: Backward Differentiation FormulasTSTHETA: Theta method (generalizes Euler, Crank-Nicolson)TSROSW: Rosenbrock-W methods for stiff problemsTSARKIMEX: Additive Runge-Kutta IMEX methodsTSGLEE: Generalized Linear Evolution EquationsTSALPHA: Alpha methods for second-order systemsTSSSP: Strong Stability Preserving methods
Event Detection
TS supports event detection (zero-crossing of event functions) during time integration:
TSSetEventHandler: Configure events to detect- Events can trigger actions like termination, adaptation, or post-event processing
Adaptive Time Stepping
TS includes sophisticated adaptive time stepping:
TSAdaptChoose: Select time step based on error estimates- Various adapt types:
TSADAPTBASIC,TSADAPTNONE,TSADAPTDSP - Tolerance control:
TSSetTolerancesfor absolute/relative error
Function Reference
PETSc.LibPETSc.TS2GetSolution — Method
TS2GetSolution(petsclib::PetscLibType,ts::TS, u::PetscVec, v::PetscVec)Returns the solution and time derivative at the present timestep for second order equations.
Not Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Output Parameters:
u- the vector containing the solutionv- the vector containing the time derivative
Level: intermediate
-seealso: , TS, TS2SetSolution(), TSGetTimeStep(), TSGetTime()
External Links
- PETSc Manual:
Ts/TS2GetSolution
PETSc.LibPETSc.TS2SetSolution — Method
TS2SetSolution(petsclib::PetscLibType,ts::TS, u::PetscVec, v::PetscVec)Sets the initial solution and time derivative vectors for use by the TS routines handling second order equations.
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()u- the solution vectorv- the time derivative vector
Level: beginner
External Links
- PETSc Manual:
Ts/TS2SetSolution
PETSc.LibPETSc.TSARKIMEXFinalizePackage — Method
TSARKIMEXFinalizePackage(petsclib::PetscLibType)This function destroys everything in the TSARKIMEX package. It is called from PetscFinalize().
Level: developer
-seealso: , PetscFinalize(), TSARKIMEXInitializePackage()
External Links
- PETSc Manual:
Ts/TSARKIMEXFinalizePackage
PETSc.LibPETSc.TSARKIMEXGetFastSlowSplit — Method
fastslow::PetscBool = TSARKIMEXGetFastSlowSplit(petsclib::PetscLibType,ts::TS)Gets whether to use TSARKIMEX for a fast
Not Collective
Input Parameter:
ts- timestepping context
Output Parameter:
fastslow-PETSC_TRUEifTSARKIMEXwill be used for solving a fast-slow system,PETSC_FALSEotherwise
Level: intermediate
-seealso: , TSARKIMEX, TSARKIMEXSetFastSlowSplit()
External Links
- PETSc Manual:
Ts/TSARKIMEXGetFastSlowSplit
PETSc.LibPETSc.TSARKIMEXGetFullyImplicit — Method
flg::PetscBool = TSARKIMEXGetFullyImplicit(petsclib::PetscLibType,ts::TS)Inquires if both parts of the equation are solved implicitly
Logically Collective
Input Parameter:
ts- timestepping context
Output Parameter:
flg-PETSC_TRUEfor fully implicit
Level: intermediate
-seealso: , TSARKIMEXGetType(), TSARKIMEXSetFullyImplicit()
External Links
- PETSc Manual:
Ts/TSARKIMEXGetFullyImplicit
PETSc.LibPETSc.TSARKIMEXGetType — Method
arktype::TSARKIMEXType = TSARKIMEXGetType(petsclib::PetscLibType,ts::TS)Get the type of TSARKIMEX scheme
Logically Collective
Input Parameter:
ts- timestepping context
Output Parameter:
arktype- type ofTSARKIMEXscheme
Level: intermediate
External Links
- PETSc Manual:
Ts/TSARKIMEXGetType
PETSc.LibPETSc.TSARKIMEXInitializePackage — Method
TSARKIMEXInitializePackage(petsclib::PetscLibType)This function initializes everything in the TSARKIMEX package. It is called from TSInitializePackage().
Level: developer
-seealso: , PetscInitialize(), TSARKIMEXFinalizePackage()
External Links
- PETSc Manual:
Ts/TSARKIMEXInitializePackage
PETSc.LibPETSc.TSARKIMEXRegister — Method
TSARKIMEXRegister(petsclib::PetscLibType,name::TSARKIMEXType, order::PetscInt, s::PetscInt, At::Vector{PetscReal}, bt::Vector{PetscReal}, ct::Vector{PetscReal}, A::Vector{PetscReal}, b::Vector{PetscReal}, c::Vector{PetscReal}, bembedt::Vector{PetscReal}, bembed::Vector{PetscReal}, pinterp::PetscInt, binterpt::Vector{PetscReal}, binterp::Vector{PetscReal})register a TSARKIMEX scheme by providing the entries in the Butcher tableau and optionally embedded approximations and interpolation
Logically Collective
Input Parameters:
name- identifier for methodorder- approximation order of methods- number of stages, this is the dimension of the matrices belowAt- Butcher table of stage coefficients for stiff part (dimension s*s, row-major)bt- Butcher table for completing the stiff part of the step (dimension s; NULL to use the last row of At)ct- Abscissa of each stiff stage (dimension s, NULL to use row sums of At)A- Non-stiff stage coefficients (dimension s*s, row-major)b- Non-stiff step completion table (dimension s; NULL to use last row of At)c- Non-stiff abscissa (dimension s; NULL to use row sums of A)bembedt- Stiff part of completion table for embedded method (dimension s; NULL if not available)bembed- Non-stiff part of completion table for embedded method (dimension s; NULL to use bembedt if provided)pinterp- Order of the interpolation scheme, equal to the number of columns of binterpt and binterpbinterpt- Coefficients of the interpolation formula for the stiff part (dimension s*pinterp)binterp- Coefficients of the interpolation formula for the non-stiff part (dimension s*pinterp; NULL to reuse binterpt)
Level: advanced
-seealso: , TSARKIMEX, TSType, TS
External Links
- PETSc Manual:
Ts/TSARKIMEXRegister
PETSc.LibPETSc.TSARKIMEXRegisterDestroy — Method
TSARKIMEXRegisterDestroy(petsclib::PetscLibType)Frees the list of schemes that were registered by TSARKIMEXRegister().
Not Collective
Level: advanced
-seealso: , TSARKIMEX, TSARKIMEXRegister(), TSARKIMEXRegisterAll()
External Links
- PETSc Manual:
Ts/TSARKIMEXRegisterDestroy
PETSc.LibPETSc.TSARKIMEXSetFastSlowSplit — Method
TSARKIMEXSetFastSlowSplit(petsclib::PetscLibType,ts::TS, fastslow::PetscBool)Use TSARKIMEX for solving a fast
Logically Collective
Input Parameters:
ts- timestepping contextfastslow-PETSC_TRUEenables theTSARKIMEXsolver for a fast-slow system where the RHS is split component-wise.
Options Database Key:
-ts_arkimex_fastslowsplit- <true,false>
Level: intermediate
-seealso: , TSARKIMEX, TSARKIMEXGetFastSlowSplit()
External Links
- PETSc Manual:
Ts/TSARKIMEXSetFastSlowSplit
PETSc.LibPETSc.TSARKIMEXSetFullyImplicit — Method
TSARKIMEXSetFullyImplicit(petsclib::PetscLibType,ts::TS, flg::PetscBool)Solve both parts of the equation implicitly, including the part that is normally solved explicitly
Logically Collective
Input Parameters:
ts- timestepping contextflg-PETSC_TRUEfor fully implicit
Level: intermediate
-seealso: , TSARKIMEX, TSARKIMEXGetType(), TSARKIMEXGetFullyImplicit()
External Links
- PETSc Manual:
Ts/TSARKIMEXSetFullyImplicit
PETSc.LibPETSc.TSARKIMEXSetType — Method
TSARKIMEXSetType(petsclib::PetscLibType,ts::TS, arktype::TSARKIMEXType)Set the type of TSARKIMEX scheme
Logically Collective
Input Parameters:
ts- timestepping contextarktype- type ofTSARKIMEXscheme
Options Database Key:
-ts_arkimex_type <1bee,a2,l2,ars122,2c,2d,2e,prssp2,3,bpr3,ars443,4,5>- setTSARKIMEXscheme type
Level: intermediate
-seealso: , TSARKIMEXGetType(), TSARKIMEX, TSARKIMEXType, TSARKIMEX1BEE, TSARKIMEXA2, TSARKIMEXL2, TSARKIMEXARS122, TSARKIMEX2C, TSARKIMEX2D, TSARKIMEX2E, TSARKIMEXPRSSP2, TSARKIMEX3, TSARKIMEXBPR3, TSARKIMEXARS443, TSARKIMEX4, TSARKIMEX5
External Links
- PETSc Manual:
Ts/TSARKIMEXSetType
PETSc.LibPETSc.TSAdjointCostIntegral — Method
TSAdjointCostIntegral(petsclib::PetscLibType,ts::TS)Evaluate the cost integral in the adjoint run.
Collective
Input Parameter:
ts- time stepping context
Level: advanced
-seealso: , TSAdjointSolve(), TSAdjointStep()
External Links
- PETSc Manual:
Ts/TSAdjointCostIntegral
PETSc.LibPETSc.TSAdjointMonitor — Method
TSAdjointMonitor(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, numcost::PetscInt, lambda::Vector{PetscVec}, mu::Vector{PetscVec})Runs all user
Collective
Input Parameters:
ts- time stepping context obtained fromTSCreate()step- step number that has just completedptime- model time of the stateu- state at the current model timenumcost- number of cost functions (dimension of lambda or mu)lambda- vectors containing the gradients of the cost functions with respect to the ODE/DAE solution variablesmu- vectors containing the gradients of the cost functions with respect to the problem parameters
Level: developer
-seealso: TSAdjointMonitorSet(), TSAdjointSolve()
External Links
- PETSc Manual:
Ts/TSAdjointMonitor
PETSc.LibPETSc.TSAdjointMonitorCancel — Method
TSAdjointMonitorCancel(petsclib::PetscLibType,ts::TS)Clears all the adjoint monitors that have been set on a time
Logically Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
-seealso: , TS, TSAdjointSolve(), TSAdjointMonitorSet()
External Links
- PETSc Manual:
Ts/TSAdjointMonitorCancel
PETSc.LibPETSc.TSAdjointMonitorDefault — Method
TSAdjointMonitorDefault(petsclib::PetscLibType,ts::TS, step::PetscInt, time::PetscReal, v::PetscVec, numcost::PetscInt, lambda::Vector{PetscVec}, mu::Vector{PetscVec}, vf::PetscViewerAndFormat)the default monitor of adjoint computations
Input Parameters:
ts- theTScontextstep- iteration number (after the final time step the monitor routine is called with a
step of -1, this is at the final time which may have been interpolated to)
time- current timev- current iteratenumcost- number of cost functionoslambda- sensitivities to initial conditionsmu- sensitivities to parametersvf- the viewer and format
Level: intermediate
-seealso: , TS, TSAdjointSolve(), TSAdjointMonitorSet()
External Links
- PETSc Manual:
Ts/TSAdjointMonitorDefault
PETSc.LibPETSc.TSAdjointMonitorDrawSensi — Method
TSAdjointMonitorDrawSensi(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, numcost::PetscInt, lambda::Vector{PetscVec}, mu::Vector{PetscVec}, dummy::Cvoid)Monitors progress of the adjoint TS solvers by calling VecView() for the sensitivities to initial states at each timestep
Collective
Input Parameters:
ts- theTScontextstep- current time-stepptime- current timeu- current statenumcost- number of cost functionslambda- sensitivities to initial conditionsmu- sensitivities to parametersdummy- either a viewer orNULL
Level: intermediate
-seealso: , TSAdjointSolve(), TSAdjointMonitorSet(), TSAdjointMonitorDefault(), VecView()
External Links
- PETSc Manual:
Ts/TSAdjointMonitorDrawSensi
PETSc.LibPETSc.TSAdjointMonitorSet — Method
TSAdjointMonitorSet(petsclib::PetscLibType,ts::TS, adjointmonitor::external, adjointmctx::Cvoid, adjointmdestroy::PetscCtxDestroyFn)Sets an ADDITIONAL function that is to be used at every timestep to display the iteration's progress.
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()adjointmonitor- monitoring routineadjointmctx- [optional] user-defined context for private data for the monitor routine
(use NULL if no context is desired)
adjointmdestroy- [optional] routine that frees monitor context (may beNULL), seePetscCtxDestroyFnfor its calling sequence
Calling sequence of adjointmonitor:
ts- theTScontextsteps- iteration number (after the final time step the monitor routine is called with
a step of -1, this is at the final time which may have been interpolated to)
time- current timeu- current iteratenumcost- number of cost functionoslambda- sensitivities to initial conditionsmu- sensitivities to parametersadjointmctx- [optional] adjoint monitoring context
Level: intermediate
-seealso: , TS, TSAdjointSolve(), TSAdjointMonitorCancel(), PetscCtxDestroyFn
External Links
- PETSc Manual:
Ts/TSAdjointMonitorSet
PETSc.LibPETSc.TSAdjointMonitorSetFromOptions — Method
TSAdjointMonitorSetFromOptions(petsclib::PetscLibType,ts::TS, name::String, help::String, manual::String, monitor::external, monitorsetup::external)Sets a monitor function and viewer appropriate for the type indicated by the user
Collective
Input Parameters:
ts-TSobject you wish to monitorname- the monitor type one is seekinghelp- message indicating what monitoring is donemanual- manual page for the monitormonitor- the monitor function, its context must be aPetscViewerAndFormatmonitorsetup- a function that is called once ONLY if the user selected this monitor that may set additional features of theTSorPetscViewerobjects
Level: developer
-seealso: , PetscOptionsCreateViewer(), PetscOptionsGetReal(), PetscOptionsHasName(), PetscOptionsGetString(), PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsBool() PetscOptionsInt(), PetscOptionsString(), PetscOptionsReal(), PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHeadBegin(), PetscOptionsStringArray(), PetscOptionsRealArray(), PetscOptionsScalar(), PetscOptionsBoolGroupBegin(), PetscOptionsBoolGroup(), PetscOptionsBoolGroupEnd(), PetscOptionsFList(), PetscOptionsEList(), PetscViewerAndFormat
External Links
- PETSc Manual:
Ts/TSAdjointMonitorSetFromOptions
PETSc.LibPETSc.TSAdjointReset — Method
TSAdjointReset(petsclib::PetscLibType,ts::TS)Resets a TS adjoint context and removes any allocated Vecs and Mats.
Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Level: beginner
-seealso: , TSCreate(), TSAdjointSetUp(), TSDestroy()
External Links
- PETSc Manual:
Ts/TSAdjointReset
PETSc.LibPETSc.TSAdjointResetForward — Method
TSAdjointResetForward(petsclib::PetscLibType,ts::TS)Reset the tangent linear solver and destroy the tangent linear context
Logically Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Level: intermediate
-seealso: , TSAdjointSetForward()
External Links
- PETSc Manual:
Ts/TSAdjointResetForward
PETSc.LibPETSc.TSAdjointSetForward — Method
TSAdjointSetForward(petsclib::PetscLibType,ts::TS, didp::PetscMat)Trigger the tangent linear solver and initialize the forward sensitivities
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()didp- the derivative of initial values w.r.t. parameters
Level: intermediate
-seealso: , TSAdjointSolve(), TSSetCostHessianProducts(), TSAdjointResetForward()
External Links
- PETSc Manual:
Ts/TSAdjointSetForward
PETSc.LibPETSc.TSAdjointSetFromOptions — Method
TSAdjointSetFromOptions(petsclib::PetscLibType,ts::TS, PetscOptionsObject::PetscOptionItems)Sets various TS adjoint parameters from options database.
Collective
Input Parameters:
ts- theTScontextPetscOptionsObject- the options context
Options Database Keys:
-ts_adjoint_solve <yes,no>- After solving the ODE/DAE solve the adjoint problem (requires-ts_save_trajectory)-ts_adjoint_monitor- print information at each adjoint time step-ts_adjoint_monitor_draw_sensi- monitor the sensitivity of the first cost function wrt initial conditions (lambda[0]) graphically
Level: developer
-seealso: , TSSetSaveTrajectory(), TSTrajectorySetUp()
External Links
- PETSc Manual:
Ts/TSAdjointSetFromOptions
PETSc.LibPETSc.TSAdjointSetSteps — Method
TSAdjointSetSteps(petsclib::PetscLibType,ts::TS, steps::PetscInt)Sets the number of steps the adjoint solver should take backward in time
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()steps- number of steps to use
Level: intermediate
-seealso: , TSAdjointSolve(), TS, TSSetExactFinalTime()
External Links
- PETSc Manual:
Ts/TSAdjointSetSteps
PETSc.LibPETSc.TSAdjointSetUp — Method
TSAdjointSetUp(petsclib::PetscLibType,ts::TS)Sets up the internal data structures for the later use of an adjoint solver
Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Level: advanced
-seealso: , TSCreate(), TSAdjointStep(), TSSetCostGradients()
External Links
- PETSc Manual:
Ts/TSAdjointSetUp
PETSc.LibPETSc.TSAdjointSolve — Method
TSAdjointSolve(petsclib::PetscLibType,ts::TS)Solves the discrete ajoint problem for an ODE/DAE
Collective `
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Options Database Key:
-ts_adjoint_view_solution <viewerinfo>- views the first gradient with respect to the initial values
Level: intermediate
-seealso: , TSCreate(), TSSetCostGradients(), TSSetSolution(), TSAdjointStep()
External Links
- PETSc Manual:
Ts/TSAdjointSolve
PETSc.LibPETSc.TSAdjointStep — Method
TSAdjointStep(petsclib::PetscLibType,ts::TS)Steps one time step backward in the adjoint run
Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Level: intermediate
-seealso: , TSAdjointSetUp(), TSAdjointSolve()
External Links
- PETSc Manual:
Ts/TSAdjointStep
PETSc.LibPETSc.TSAlpha2GetParams — Method
alpha_m::PetscReal,alpha_f::PetscReal,gamma::PetscReal,beta::PetscReal = TSAlpha2GetParams(petsclib::PetscLibType,ts::TS)gets the algorithmic parameters for TSALPHA2
Not Collective
Input Parameter:
ts- timestepping context
Output Parameters:
alpha_m- algorithmic parameteralpha_f- algorithmic parametergamma- algorithmic parameterbeta- algorithmic parameter
Level: advanced
-seealso: , TS, TSALPHA2, TSAlpha2SetRadius(), TSAlpha2SetParams()
External Links
- PETSc Manual:
Ts/TSAlpha2GetParams
PETSc.LibPETSc.TSAlpha2SetParams — Method
TSAlpha2SetParams(petsclib::PetscLibType,ts::TS, alpha_m::PetscReal, alpha_f::PetscReal, gamma::PetscReal, beta::PetscReal)sets the algorithmic parameters for TSALPHA2
Logically Collective
Input Parameters:
ts- timestepping contextalpha_m- algorithmic parameteralpha_f- algorithmic parametergamma- algorithmic parameterbeta- algorithmic parameter
Options Database Keys:
-ts_alpha_alpha_m <alpha_m>- set alpha_m-ts_alpha_alpha_f <alpha_f>- set alpha_f-ts_alpha_gamma <gamma>- set gamma-ts_alpha_beta <beta>- set beta
Level: advanced
-seealso: , TS, TSALPHA2, TSAlpha2SetRadius(), TSAlpha2GetParams()
External Links
- PETSc Manual:
Ts/TSAlpha2SetParams
PETSc.LibPETSc.TSAlpha2SetPredictor — Method
TSAlpha2SetPredictor(petsclib::PetscLibType,ts::TS, predictor::TSAlpha2PredictorFn, ctx::Cvoid)sets the callback for computing a predictor (i.e., initial guess for the nonlinear solver).
Input Parameters:
ts- timestepping contextpredictor- callback to set the predictor in each stepctx- the application context, which may be set toNULLif not used
Level: intermediate
-seealso: , TS, TSALPHA2, TSAlpha2PredictorFn
External Links
- PETSc Manual:
Ts/TSAlpha2SetPredictor
PETSc.LibPETSc.TSAlpha2SetRadius — Method
TSAlpha2SetRadius(petsclib::PetscLibType,ts::TS, radius::PetscReal)sets the desired spectral radius of the method for TSALPHA2 (i.e. high-frequency numerical damping)
Logically Collective
Input Parameters:
ts- timestepping contextradius- the desired spectral radius
Options Database Key:
-ts_alpha_radius <radius>- set the desired spectral radius
Level: intermediate
-seealso: , TS, TSALPHA2, TSAlpha2SetParams(), TSAlpha2GetParams()
External Links
- PETSc Manual:
Ts/TSAlpha2SetRadius
PETSc.LibPETSc.TSAlphaGetParams — Method
alpha_m::PetscReal,alpha_f::PetscReal,gamma::PetscReal = TSAlphaGetParams(petsclib::PetscLibType,ts::TS)gets the algorithmic parameters for TSALPHA
Not Collective
Input Parameter:
ts- timestepping context
Output Parameters:
alpha_m- algorithmic parameteralpha_f- algorithmic parametergamma- algorithmic parameter
Level: advanced
-seealso: , TS, TSALPHA, TSAlphaSetRadius(), TSAlphaSetParams()
External Links
- PETSc Manual:
Ts/TSAlphaGetParams
PETSc.LibPETSc.TSAlphaSetParams — Method
TSAlphaSetParams(petsclib::PetscLibType,ts::TS, alpha_m::PetscReal, alpha_f::PetscReal, gamma::PetscReal)sets the algorithmic parameters for TSALPHA
Logically Collective
Input Parameters:
ts- timestepping contextalpha_m- algorithmic parameteralpha_f- algorithmic parametergamma- algorithmic parameter
Options Database Keys:
-ts_alpha_alpha_m <alpha_m>- set alpha_m-ts_alpha_alpha_f <alpha_f>- set alpha_f-ts_alpha_gamma <gamma>- set gamma
Level: advanced
-seealso: , TS, TSALPHA, TSAlphaSetRadius(), TSAlphaGetParams()
External Links
- PETSc Manual:
Ts/TSAlphaSetParams
PETSc.LibPETSc.TSAlphaSetRadius — Method
TSAlphaSetRadius(petsclib::PetscLibType,ts::TS, radius::PetscReal)sets the desired spectral radius of the method for TSALPHA (i.e. high-frequency numerical damping)
Logically Collective
Input Parameters:
ts- timestepping contextradius- the desired spectral radius
Options Database Key:
-ts_alpha_radius <radius>- set alpha radius
Level: intermediate
-seealso: , TS, TSALPHA, TSAlphaSetParams(), TSAlphaGetParams()
External Links
- PETSc Manual:
Ts/TSAlphaSetRadius
PETSc.LibPETSc.TSAppendOptionsPrefix — Method
TSAppendOptionsPrefix(petsclib::PetscLibType,ts::TS, prefix::String)Appends to the prefix used for searching for all TS options in the database.
Logically Collective
Input Parameters:
ts- TheTScontextprefix- The prefix to prepend to all option names
Level: advanced
-seealso: , TS, TSGetOptionsPrefix(), TSSetOptionsPrefix(), TSSetFromOptions()
External Links
- PETSc Manual:
Ts/TSAppendOptionsPrefix
PETSc.LibPETSc.TSBDFGetOrder — Method
order::PetscInt = TSBDFGetOrder(petsclib::PetscLibType,ts::TS)Get the order of the TSBDF method
Not Collective
Input Parameter:
ts- timestepping context
Output Parameter:
order- order of the method
Level: intermediate
-seealso: TSBDFSetOrder(), TS, TSBDF
External Links
- PETSc Manual:
Ts/TSBDFGetOrder
PETSc.LibPETSc.TSBDFSetOrder — Method
TSBDFSetOrder(petsclib::PetscLibType,ts::TS, order::PetscInt)Set the order of the TSBDF method
Logically Collective
Input Parameters:
ts- timestepping contextorder- order of the method
Options Database Key:
-ts_bdf_order <order>- select the order
Level: intermediate
-seealso: TSBDFGetOrder(), TS, TSBDF
External Links
- PETSc Manual:
Ts/TSBDFSetOrder
PETSc.LibPETSc.TSBasicSymplecticFinalizePackage — Method
TSBasicSymplecticFinalizePackage(petsclib::PetscLibType)This function destroys everything in the TSBASICSYMPLECTIC package. It is called from PetscFinalize().
Level: developer
-seealso: , PetscFinalize(), TSBASICSYMPLECTIC
External Links
- PETSc Manual:
Ts/TSBasicSymplecticFinalizePackage
PETSc.LibPETSc.TSBasicSymplecticGetType — Method
TSBasicSymplecticGetType(petsclib::PetscLibType,ts::TS, bsymptype::TSBasicSymplecticType)Get the type of the basic symplectic method
Logically Collective
Input Parameters:
ts- timestepping contextbsymptype- type of the basic symplectic scheme
Level: intermediate
-seealso: , TSBASICSYMPLECTIC, TSBasicSymplecticType, TSBasicSymplecticSetType()
External Links
- PETSc Manual:
Ts/TSBasicSymplecticGetType
PETSc.LibPETSc.TSBasicSymplecticInitializePackage — Method
TSBasicSymplecticInitializePackage(petsclib::PetscLibType)This function initializes everything in the TSBASICSYMPLECTIC package. It is called from TSInitializePackage().
Level: developer
-seealso: , PetscInitialize(), TSBASICSYMPLECTIC
External Links
- PETSc Manual:
Ts/TSBasicSymplecticInitializePackage
PETSc.LibPETSc.TSBasicSymplecticRegister — Method
TSBasicSymplecticRegister(petsclib::PetscLibType,name::TSRosWType, order::PetscInt, s::PetscInt, c::Vector{PetscReal}, d::Vector{PetscReal})register a basic symplectic integration scheme by providing the coefficients.
Not Collective, but the same schemes should be registered on all processes on which they will be used
Input Parameters:
name- identifier for methodorder- approximation order of methods- number of stages, this is the dimension of the matrices belowc- coefficients for updating generalized position (dimension s)d- coefficients for updating generalized momentum (dimension s)
Level: advanced
External Links
- PETSc Manual:
Ts/TSBasicSymplecticRegister
PETSc.LibPETSc.TSBasicSymplecticRegisterAll — Method
TSBasicSymplecticRegisterAll(petsclib::PetscLibType)Registers all of the basic symplectic integration methods in TSBASICSYMPLECTIC
Not Collective, but should be called by all processes which will need the schemes to be registered
Level: advanced
-seealso: , TSBASICSYMPLECTIC, TSBasicSymplecticRegisterDestroy()
External Links
- PETSc Manual:
Ts/TSBasicSymplecticRegisterAll
PETSc.LibPETSc.TSBasicSymplecticRegisterDestroy — Method
TSBasicSymplecticRegisterDestroy(petsclib::PetscLibType)Frees the list of schemes that were registered by TSBasicSymplecticRegister().
Not Collective
Level: advanced
-seealso: , TSBasicSymplecticRegister(), TSBasicSymplecticRegisterAll(), TSBASICSYMPLECTIC
External Links
- PETSc Manual:
Ts/TSBasicSymplecticRegisterDestroy
PETSc.LibPETSc.TSBasicSymplecticSetType — Method
TSBasicSymplecticSetType(petsclib::PetscLibType,ts::TS, bsymptype::TSBasicSymplecticType)Set the type of the basic symplectic method
Logically Collective
Input Parameters:
ts- timestepping contextbsymptype- type of the symplectic scheme
Options Database Key:
-ts_basicsymplectic_type <scheme>- select the scheme
Level: intermediate
-seealso: , TSBASICSYMPLECTIC, TSBasicSymplecticType
External Links
- PETSc Manual:
Ts/TSBasicSymplecticSetType
PETSc.LibPETSc.TSClone — Method
TSClone(petsclib::PetscLibType,tsin::TS, tsout::TS)This function clones a time step TS object.
Collective
Input Parameter:
tsin- The inputTS
Output Parameter:
tsout- The outputTS(cloned)
Level: developer
-seealso: , TS, SNES, TSCreate(), TSSetType(), TSSetUp(), TSDestroy(), TSSetProblemType()
External Links
- PETSc Manual:
Ts/TSClone
PETSc.LibPETSc.TSComputeCostIntegrand — Method
TSComputeCostIntegrand(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Q::PetscVec)Evaluates the integral function in the cost functions.
Input Parameters:
ts- theTScontextt- current timeU- state vector, i.e. current solution
Output Parameter:
Q- vector of size numcost to hold the outputs
Level: deprecated
-seealso: , TS, TSAdjointSolve(), TSSetCostIntegrand()
External Links
- PETSc Manual:
Ts/TSComputeCostIntegrand
PETSc.LibPETSc.TSComputeExactError — Method
TSComputeExactError(petsclib::PetscLibType,ts::TS, u::PetscVec, e::PetscVec)Compute the solution error for the timestepping using the function previously set with TSSetComputeExactError()
Collective
Input Parameters:
ts- time stepping contextu- The approximate solutione- TheVecused to store the error
Level: advanced
-seealso: , TS, TSGetComputeInitialCondition(), TSSetComputeInitialCondition(), TSSolve()
External Links
- PETSc Manual:
Ts/TSComputeExactError
PETSc.LibPETSc.TSComputeForcingFunction — Method
TSComputeForcingFunction(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec)Evaluates the forcing function.
Collective
Input Parameters:
ts- theTScontextt- current time
Output Parameter:
U- the function value
Level: developer
-seealso: , TS, TSSetSolutionFunction(), TSSetRHSFunction(), TSComputeIFunction()
External Links
- PETSc Manual:
Ts/TSComputeForcingFunction
PETSc.LibPETSc.TSComputeI2Function — Method
TSComputeI2Function(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, V::PetscVec, A::PetscVec, F::PetscVec)Evaluates the DAE residual written in implicit form F(t,U,Ut,Utt) = 0
Collective
Input Parameters:
ts- theTScontextt- current timeU- state vectorV- time derivative of state vector (U_t)A- second time derivative of state vector (U_tt)
Output Parameter:
F- the residual vector
Level: developer
-seealso: , TS, TSSetI2Function(), TSGetI2Function()
External Links
- PETSc Manual:
Ts/TSComputeI2Function
PETSc.LibPETSc.TSComputeI2Jacobian — Method
TSComputeI2Jacobian(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, V::PetscVec, A::PetscVec, shiftV::PetscReal, shiftA::PetscReal, J::PetscMat, P::PetscMat)Evaluates the Jacobian of the DAE
Collective
Input Parameters:
ts- theTScontextt- current timestepU- state vectorV- time derivative of state vectorA- second time derivative of state vectorshiftV- shift to apply, see note belowshiftA- shift to apply, see note below
Output Parameters:
J- Jacobian matrixP- optional matrix used to construct the preconditioner
Level: developer
-seealso: , TS, TSSetI2Jacobian()
External Links
- PETSc Manual:
Ts/TSComputeI2Jacobian
PETSc.LibPETSc.TSComputeIFunction — Method
TSComputeIFunction(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Udot::PetscVec, Y::PetscVec, imex::PetscBool)Evaluates the DAE residual written in the implicit form F(t,U,Udot)=0
Collective
Input Parameters:
ts- theTScontextt- current timeU- state vectorUdot- time derivative of state vectorimex- flag indicates if the method isTSARKIMEXso that the RHSFunction should be kept separate
Output Parameter:
Y- right-hand side
Level: developer
-seealso: , TS, TSSetIFunction(), TSComputeRHSFunction()
External Links
- PETSc Manual:
Ts/TSComputeIFunction
PETSc.LibPETSc.TSComputeIFunctionLinear — Method
TSComputeIFunctionLinear(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Udot::PetscVec, F::PetscVec, ctx::Cvoid)Evaluate the left hand side via the user
Collective
Input Parameters:
ts- time stepping contextt- time at which to evaluateU- state at which to evaluateUdot- time derivative of state vectorctx- context
Output Parameter:
F- left hand side
Level: intermediate
-seealso: , TS, TSSetIFunction(), TSSetIJacobian(), TSComputeIJacobianConstant(), TSComputeRHSFunctionLinear()
External Links
- PETSc Manual:
Ts/TSComputeIFunctionLinear
PETSc.LibPETSc.TSComputeIHessianProductFunctionPP — Method
TSComputeIHessianProductFunctionPP(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Vl::Vector{PetscVec}, Vr::PetscVec, VHV::Vector{PetscVec})Runs the user
Collective
Input Parameters:
ts- TheTScontext obtained fromTSCreate()t- the timeU- the solution at which to compute the Hessian productVl- the array of input vectors to be multiplied with the Hessian from the leftVr- the input vector to be multiplied with the Hessian from the right
Output Parameter:
VHV- the array of output vectors that store the Hessian product
Level: developer
-seealso: , TSSetIHessianProduct()
External Links
- PETSc Manual:
Ts/TSComputeIHessianProductFunctionPP
PETSc.LibPETSc.TSComputeIHessianProductFunctionPU — Method
TSComputeIHessianProductFunctionPU(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Vl::Vector{PetscVec}, Vr::PetscVec, VHV::Vector{PetscVec})Runs the user
Collective
Input Parameters:
ts- TheTScontext obtained fromTSCreate()t- the timeU- the solution at which to compute the Hessian productVl- the array of input vectors to be multiplied with the Hessian from the leftVr- the input vector to be multiplied with the Hessian from the right
Output Parameter:
VHV- the array of output vectors that store the Hessian product
Level: developer
-seealso: , TSSetIHessianProduct()
External Links
- PETSc Manual:
Ts/TSComputeIHessianProductFunctionPU
PETSc.LibPETSc.TSComputeIHessianProductFunctionUP — Method
TSComputeIHessianProductFunctionUP(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Vl::Vector{PetscVec}, Vr::PetscVec, VHV::Vector{PetscVec})Runs the user
Collective
Input Parameters:
ts- TheTScontext obtained fromTSCreate()t- the timeU- the solution at which to compute the Hessian productVl- the array of input vectors to be multiplied with the Hessian from the leftVr- the input vector to be multiplied with the Hessian from the right
Output Parameter:
VHV- the array of output vectors that store the Hessian product
Level: developer
-seealso: , TSSetIHessianProduct()
External Links
- PETSc Manual:
Ts/TSComputeIHessianProductFunctionUP
PETSc.LibPETSc.TSComputeIHessianProductFunctionUU — Method
TSComputeIHessianProductFunctionUU(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Vl::Vector{PetscVec}, Vr::PetscVec, VHV::Vector{PetscVec})Runs the user
Collective
Input Parameters:
ts- TheTScontext obtained fromTSCreate()t- the timeU- the solution at which to compute the Hessian productVl- the array of input vectors to be multiplied with the Hessian from the leftVr- the input vector to be multiplied with the Hessian from the right
Output Parameter:
VHV- the array of output vectors that store the Hessian product
Level: developer
-seealso: , TSSetIHessianProduct()
External Links
- PETSc Manual:
Ts/TSComputeIHessianProductFunctionUU
PETSc.LibPETSc.TSComputeIJacobian — Method
TSComputeIJacobian(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Udot::PetscVec, shift::PetscReal, A::PetscMat, B::PetscMat, imex::PetscBool)Evaluates the Jacobian of the DAE
Collective
Input Parameters:
ts- theTScontextt- current timestepU- state vectorUdot- time derivative of state vectorshift- shift to apply, see note belowimex- flag indicates if the method isTSARKIMEXso that the RHSJacobian should be kept separate
Output Parameters:
A- Jacobian matrixB- matrix from which the preconditioner is constructed; often the same asA
Level: developer
-seealso: , TS, TSSetIJacobian()
External Links
- PETSc Manual:
Ts/TSComputeIJacobian
PETSc.LibPETSc.TSComputeIJacobianConstant — Method
TSComputeIJacobianConstant(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Udot::PetscVec, shift::PetscReal, A::PetscMat, B::PetscMat, ctx::Cvoid)Reuses the matrix previously computed with the provided TSIJacobianFn for a semi
Collective
Input Parameters:
ts- time stepping contextt- time at which to evaluateU- state at which to evaluateUdot- time derivative of state vectorshift- shift to applyctx- context
Output Parameters:
A- pointer to operatorB- pointer to matrix from which the preconditioner is built (oftenA)
Level: advanced
-seealso: , TS, TSROSW, TSARKIMEX, TSSetIFunction(), TSSetIJacobian(), TSComputeIFunctionLinear()
External Links
- PETSc Manual:
Ts/TSComputeIJacobianConstant
PETSc.LibPETSc.TSComputeIJacobianDefaultColor — Method
TSComputeIJacobianDefaultColor(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Udot::PetscVec, shift::PetscReal, J::PetscMat, B::PetscMat, ctx::Cvoid)Computes the Jacobian using finite differences and coloring to exploit matrix sparsity.
Collective
Input Parameters:
ts- theTScontextt- current timestepU- state vectorUdot- time derivative of state vectorshift- shift to apply, see note belowctx- an optional user context
Output Parameters:
J- Jacobian matrix (not altered in this routine)B- newly computed Jacobian matrix to use with preconditioner (generally the same asJ)
Level: intermediate
-seealso: , TS, TSSetIJacobian(), MatFDColoringCreate(), MatFDColoringSetFunction()
External Links
- PETSc Manual:
Ts/TSComputeIJacobianDefaultColor
PETSc.LibPETSc.TSComputeIJacobianP — Method
TSComputeIJacobianP(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Udot::PetscVec, shift::PetscReal, Amat::PetscMat, imex::PetscBool)Runs the user
Collective
Input Parameters:
ts- theTScontextt- current timestepU- state vectorUdot- time derivative of state vectorshift- shift to apply, see note belowimex- flag indicates if the method is IMEX so that theRHSJacobianPshould be kept separate
Output Parameter:
Amat- Jacobian matrix
Level: developer
-seealso: , TS, TSSetIJacobianP()
External Links
- PETSc Manual:
Ts/TSComputeIJacobianP
PETSc.LibPETSc.TSComputeInitialCondition — Method
TSComputeInitialCondition(petsclib::PetscLibType,ts::TS, u::PetscVec)Compute an initial condition for the timestepping using the function previously set with TSSetComputeInitialCondition()
Collective
Input Parameters:
ts- time stepping contextu- TheVecto store the condition in which will be used inTSSolve()
Level: advanced
-seealso: , TS, TSGetComputeInitialCondition(), TSSetComputeInitialCondition(), TSSolve()
External Links
- PETSc Manual:
Ts/TSComputeInitialCondition
PETSc.LibPETSc.TSComputeLinearStability — Method
yr::PetscReal,yi::PetscReal = TSComputeLinearStability(petsclib::PetscLibType,ts::TS, xr::PetscReal, xi::PetscReal)computes the linear stability function at a point
Collective
Input Parameters:
ts- theTScontextxr- real part of input argumentxi- imaginary part of input argument
Output Parameters:
yr- real part of function valueyi- imaginary part of function value
Level: developer
-seealso: , TS, TSSetRHSFunction(), TSComputeIFunction()
External Links
- PETSc Manual:
Ts/TSComputeLinearStability
PETSc.LibPETSc.TSComputeRHSFunction — Method
TSComputeRHSFunction(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, y::PetscVec)Evaluates the right
Collective
Input Parameters:
ts- theTScontextt- current timeU- state vector
Output Parameter:
y- right-hand side
Level: developer
-seealso: , TS, TSSetRHSFunction(), TSComputeIFunction()
External Links
- PETSc Manual:
Ts/TSComputeRHSFunction
PETSc.LibPETSc.TSComputeRHSFunctionLinear — Method
TSComputeRHSFunctionLinear(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, F::PetscVec, ctx::Cvoid)Evaluate the right
Collective
Input Parameters:
ts- time stepping contextt- time at which to evaluateU- state at which to evaluatectx- context
Output Parameter:
F- right-hand side
Level: intermediate
-seealso: , TS, TSSetRHSFunction(), TSSetRHSJacobian(), TSComputeRHSJacobianConstant()
External Links
- PETSc Manual:
Ts/TSComputeRHSFunctionLinear
PETSc.LibPETSc.TSComputeRHSHessianProductFunctionPP — Method
TSComputeRHSHessianProductFunctionPP(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Vl::Vector{PetscVec}, Vr::PetscVec, VHV::Vector{PetscVec})Runs the user
Collective
Input Parameters:
ts- TheTScontext obtained fromTSCreate()t- the timeU- the solution at which to compute the Hessian productVl- the array of input vectors to be multiplied with the Hessian from the leftVr- the input vector to be multiplied with the Hessian from the right
Output Parameter:
VHV- the array of output vectors that store the Hessian product
Level: developer
-seealso: , TSSetRHSHessianProduct()
External Links
- PETSc Manual:
Ts/TSComputeRHSHessianProductFunctionPP
PETSc.LibPETSc.TSComputeRHSHessianProductFunctionPU — Method
TSComputeRHSHessianProductFunctionPU(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Vl::Vector{PetscVec}, Vr::PetscVec, VHV::Vector{PetscVec})Runs the user
Collective
Input Parameters:
ts- TheTScontext obtained fromTSCreate()t- the timeU- the solution at which to compute the Hessian productVl- the array of input vectors to be multiplied with the Hessian from the leftVr- the input vector to be multiplied with the Hessian from the right
Output Parameter:
VHV- the array of output vectors that store the Hessian product
Level: developer
-seealso: , TSSetRHSHessianProduct()
External Links
- PETSc Manual:
Ts/TSComputeRHSHessianProductFunctionPU
PETSc.LibPETSc.TSComputeRHSHessianProductFunctionUP — Method
TSComputeRHSHessianProductFunctionUP(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Vl::Vector{PetscVec}, Vr::PetscVec, VHV::Vector{PetscVec})Runs the user
Collective
Input Parameters:
ts- TheTScontext obtained fromTSCreate()t- the timeU- the solution at which to compute the Hessian productVl- the array of input vectors to be multiplied with the Hessian from the leftVr- the input vector to be multiplied with the Hessian from the right
Output Parameter:
VHV- the array of output vectors that store the Hessian product
Level: developer
-seealso: , TS, TSSetRHSHessianProduct()
External Links
- PETSc Manual:
Ts/TSComputeRHSHessianProductFunctionUP
PETSc.LibPETSc.TSComputeRHSHessianProductFunctionUU — Method
TSComputeRHSHessianProductFunctionUU(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Vl::Vector{PetscVec}, Vr::PetscVec, VHV::Vector{PetscVec})Runs the user
Collective
Input Parameters:
ts- TheTScontext obtained fromTSCreate()t- the timeU- the solution at which to compute the Hessian productVl- the array of input vectors to be multiplied with the Hessian from the leftVr- the input vector to be multiplied with the Hessian from the right
Output Parameter:
VHV- the array of output vectors that store the Hessian product
Level: developer
-seealso: , TS, TSSetRHSHessianProduct()
External Links
- PETSc Manual:
Ts/TSComputeRHSHessianProductFunctionUU
PETSc.LibPETSc.TSComputeRHSJacobian — Method
TSComputeRHSJacobian(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, A::PetscMat, B::PetscMat)Computes the Jacobian matrix that has been set with TSSetRHSJacobian().
Collective
Input Parameters:
ts- theTScontextt- current timestepU- input vector
Output Parameters:
A- Jacobian matrixB- optional matrix used to compute the preconditioner, often the same asA
Level: developer
-seealso: , TS, TSSetRHSJacobian(), KSPSetOperators()
External Links
- PETSc Manual:
Ts/TSComputeRHSJacobian
PETSc.LibPETSc.TSComputeRHSJacobianConstant — Method
TSComputeRHSJacobianConstant(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, A::PetscMat, B::PetscMat, ctx::Cvoid)Reuses a Jacobian that is time
Collective
Input Parameters:
ts- time stepping contextt- time at which to evaluateU- state at which to evaluatectx- context
Output Parameters:
A- JacobianB- matrix used to construct the preconditioner, often the same asA
Level: intermediate
-seealso: , TS, TSSetRHSFunction(), TSSetRHSJacobian(), TSComputeRHSFunctionLinear()
External Links
- PETSc Manual:
Ts/TSComputeRHSJacobianConstant
PETSc.LibPETSc.TSComputeRHSJacobianP — Method
TSComputeRHSJacobianP(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Amat::PetscMat)Runs the user
Collective
Input Parameters:
ts- TheTScontext obtained fromTSCreate()t- the timeU- the solution at which to compute the Jacobian
Output Parameter:
Amat- the computed Jacobian
Level: developer
-seealso: , TSSetRHSJacobianP(), TS
External Links
- PETSc Manual:
Ts/TSComputeRHSJacobianP
PETSc.LibPETSc.TSComputeSNESJacobian — Method
TSComputeSNESJacobian(petsclib::PetscLibType,ts::TS, x::PetscVec, J::PetscMat, Jpre::PetscMat)Compute the Jacobian needed for the SNESSolve() in TS
Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()x- state vector
Output Parameters:
J- Jacobian matrixJpre- matrix used to compute the preconditioner forJ(may be same asJ)
Level: developer
-seealso: SNES, TS, SNESSetJacobian(), TSSetRHSJacobian(), TSSetIJacobian()
External Links
- PETSc Manual:
Ts/TSComputeSNESJacobian
PETSc.LibPETSc.TSComputeSolutionFunction — Method
TSComputeSolutionFunction(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec)Evaluates the solution function.
Collective
Input Parameters:
ts- theTScontextt- current time
Output Parameter:
U- the solution
Level: developer
-seealso: , TS, TSSetSolutionFunction(), TSSetRHSFunction(), TSComputeIFunction()
External Links
- PETSc Manual:
Ts/TSComputeSolutionFunction
PETSc.LibPETSc.TSComputeTransientVariable — Method
TSComputeTransientVariable(petsclib::PetscLibType,ts::TS, U::PetscVec, C::PetscVec)transforms state (primitive) variables to transient (conservative) variables
Logically Collective
Input Parameters:
ts- TS on which to computeU- state vector to be transformed to transient variables
Output Parameter:
C- transient (conservative) variable
Level: developer
-seealso: , TS, TSBDF, DMTSSetTransientVariable(), TSComputeIFunction(), TSComputeIJacobian()
External Links
- PETSc Manual:
Ts/TSComputeTransientVariable
PETSc.LibPETSc.TSCreate — Method
ts::TS = TSCreate(petsclib::PetscLibType,comm::MPI_Comm)This function creates an empty timestepper. The problem type can then be set with TSSetProblemType() and the type of solver can then be set with TSSetType().
Collective
Input Parameter:
comm- The communicator
Output Parameter:
ts- TheTS
Level: beginner
-seealso: , TS, SNES, TSSetType(), TSSetUp(), TSDestroy(), TSSetProblemType()
External Links
- PETSc Manual:
Ts/TSCreate
PETSc.LibPETSc.TSCreateQuadratureTS — Method
quadts::TS = TSCreateQuadratureTS(petsclib::PetscLibType,ts::TS, fwd::PetscBool)Create a sub
Input Parameters:
ts- theTScontext obtained fromTSCreate()fwd- flag indicating whether to evaluate cost integral in the forward run or the adjoint run
Output Parameter:
quadts- the childTScontext
Level: intermediate
-seealso: , TSGetQuadratureTS()
External Links
- PETSc Manual:
Ts/TSCreateQuadratureTS
PETSc.LibPETSc.TSDIRKGetType — Method
dirktype::TSDIRKType = TSDIRKGetType(petsclib::PetscLibType,ts::TS)Get the type of TSDIRK scheme
Logically Collective
Input Parameter:
ts- timestepping context
Output Parameter:
dirktype- type ofTSDIRKscheme
Level: intermediate
External Links
- PETSc Manual:
Ts/TSDIRKGetType
PETSc.LibPETSc.TSDIRKRegister — Method
TSDIRKRegister(petsclib::PetscLibType,name::TSDIRKType, order::PetscInt, s::PetscInt, At::Vector{PetscReal}, bt::Vector{PetscReal}, ct::Vector{PetscReal}, bembedt::Vector{PetscReal}, pinterp::PetscInt, binterpt::Vector{PetscReal})register a TSDIRK scheme by providing the entries in its Butcher tableau and, optionally, embedded approximations and interpolation
Logically Collective.
Input Parameters:
name- identifier for methodorder- approximation order of methods- number of stages, this is the dimension of the matrices belowAt- Butcher table of stage coefficients (dimensions*s, row-major order)bt- Butcher table for completing the step (dimensions; passNULLto use the last row ofAt)ct- Abscissa of each stage (dimension s, NULL to use row sums of At)bembedt- Stiff part of completion table for embedded method (dimension s;NULLif not available)pinterp- Order of the interpolation scheme, equal to the number of columns ofbinterptandbinterpbinterpt- Coefficients of the interpolation formula (dimension s*pinterp)
Level: advanced
-seealso: , TSDIRK, TSType, TS
External Links
- PETSc Manual:
Ts/TSDIRKRegister
PETSc.LibPETSc.TSDIRKSetType — Method
TSDIRKSetType(petsclib::PetscLibType,ts::TS, dirktype::TSDIRKType)Set the type of TSDIRK scheme
Logically Collective
Input Parameters:
ts- timestepping contextdirktype- type ofTSDIRKscheme
Options Database Key:
-ts_dirkimex_type- setTSDIRKscheme type
Level: intermediate
-seealso: , TSDIRKGetType(), TSDIRK, TSDIRKType
External Links
- PETSc Manual:
Ts/TSDIRKSetType
PETSc.LibPETSc.TSDMSwarmMonitorMoments — Method
TSDMSwarmMonitorMoments(petsclib::PetscLibType,ts::TS, step::PetscInt, t::PetscReal, U::PetscVec, vf::PetscViewerAndFormat)Monitors the first three moments of a DMSWARM being evolved by the TS
Not Collective
Input Parameters:
ts- theTScontextstep- current timestept- current timeU- current solutionvf- not used
Options Database Key:
-ts_dmswarm_monitor_moments- Monitor moments of particle distribution-ts_dmswarm_monitor_moments_interval- Interval of timesteps between monitor outputs
Level: intermediate
-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), DMSWARM
External Links
- PETSc Manual:
Ts/TSDMSwarmMonitorMoments
PETSc.LibPETSc.TSDestroy — Method
TSDestroy(petsclib::PetscLibType,ts::TS)Destroys the timestepper context that was created with TSCreate().
Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Level: beginner
-seealso: , TS, TSCreate(), TSSetUp(), TSSolve()
External Links
- PETSc Manual:
Ts/TSDestroy
PETSc.LibPETSc.TSDiscGradGetType — Method
dgtype::TSDGType = TSDiscGradGetType(petsclib::PetscLibType,ts::TS)Checks for which discrete gradient to use in formulation for TSDISCGRAD
Not Collective
Input Parameter:
ts- timestepping context
Output Parameter:
dgtype- Discrete gradient type <none, gonzalez, average>
Level: advanced
-seealso: , TSDISCGRAD, TSDiscGradSetType()
External Links
- PETSc Manual:
Ts/TSDiscGradGetType
PETSc.LibPETSc.TSDiscGradSetFormulation — Method
TSDiscGradSetFormulation(petsclib::PetscLibType,ts::TS, Sfunc::external, Ffunc::external, Gfunc::external, ctx::Cvoid)Set the construction method for S, F, and grad F from the formulation u_t = S(u) abla F(u) for TSDISCGRAD
Not Collective
Input Parameters:
ts- timestepping contextSfunc- constructor for the S matrix from the formulationFfunc- functional F from the formulationGfunc- constructor for the gradient of F from the formulationctx- optional context for the functions
Calling sequence of Sfunc:
ts- the integratortime- the current timeu- the solutionS- the S-matrix from the formulationctx- the user context
Calling sequence of Ffunc:
ts- the integratortime- the current timeu- the solutionF- the computed function from the formulationctx- the user context
Calling sequence of Gfunc:
ts- the integratortime- the current timeu- the solutionG- the gradient of the computed function from the formulationctx- the user context
Level: intermediate
-seealso: , TSDISCGRAD, TSDiscGradGetFormulation()
External Links
- PETSc Manual:
Ts/TSDiscGradSetFormulation
PETSc.LibPETSc.TSDiscGradSetType — Method
TSDiscGradSetType(petsclib::PetscLibType,ts::TS, dgtype::TSDGType)Sets discrete gradient formulation.
Not Collective
Input Parameters:
ts- timestepping contextdgtype- Discrete gradient type <none, gonzalez, average>
Options Database Key:
-ts_discgrad_type <type>- flag to choose discrete gradient type
Level: intermediate
External Links
- PETSc Manual:
Ts/TSDiscGradSetType
PETSc.LibPETSc.TSEIMEXSetMaxRows — Method
TSEIMEXSetMaxRows(petsclib::PetscLibType,ts::TS, nrows::PetscInt)Set the maximum number of rows for TSEIMEX schemes
Logically Collective
Input Parameters:
ts- timestepping contextnrows- maximum number of rows
Level: intermediate
-seealso: , TSEIMEXSetRowCol(), TSEIMEXSetOrdAdapt(), TSEIMEX
External Links
- PETSc Manual:
Ts/TSEIMEXSetMaxRows
PETSc.LibPETSc.TSEIMEXSetOrdAdapt — Method
TSEIMEXSetOrdAdapt(petsclib::PetscLibType,ts::TS, flg::PetscBool)Set the order adaptativity for the TSEIMEX schemes
Logically Collective
Input Parameters:
ts- timestepping contextflg- index in the T table
Level: intermediate
-seealso: , TSEIMEXSetRowCol(), TSEIMEX
External Links
- PETSc Manual:
Ts/TSEIMEXSetOrdAdapt
PETSc.LibPETSc.TSEIMEXSetRowCol — Method
TSEIMEXSetRowCol(petsclib::PetscLibType,ts::TS, row::PetscInt, col::PetscInt)Set the number of rows and the number of columns for the tableau that represents the T solution in the TSEIMEX scheme
Logically Collective
Input Parameters:
ts- timestepping contextrow- the rowcol- the column
Level: intermediate
-seealso: , TSEIMEXSetMaxRows(), TSEIMEXSetOrdAdapt(), TSEIMEX
External Links
- PETSc Manual:
Ts/TSEIMEXSetRowCol
PETSc.LibPETSc.TSErrorWeightedENorm — Method
norm::PetscReal,norma::PetscReal,normr::PetscReal = TSErrorWeightedENorm(petsclib::PetscLibType,ts::TS, E::PetscVec, U::PetscVec, Y::PetscVec, wnormtype::NormType)compute a weighted error norm based on supplied absolute and relative tolerances
Collective
Input Parameters:
ts- time stepping contextE- error vectorU- state vector, usually ts->vec_solY- state vector, previous time stepwnormtype- norm type, eitherNORM_2orNORM_INFINITY
Output Parameters:
norm- weighted norm, a value of 1.0 achieves a balance between absolute and relative tolerancesnorma- weighted norm, a value of 1.0 means that the error meets the absolute tolerance set by the usernormr- weighted norm, a value of 1.0 means that the error meets the relative tolerance set by the user
Options Database Key:
-ts_adapt_wnormtype <wnormtype>- 2, INFINITY
Level: developer
-seealso: , TS, VecErrorWeightedNorms(), TSErrorWeightedNorm()
External Links
- PETSc Manual:
Ts/TSErrorWeightedENorm
PETSc.LibPETSc.TSErrorWeightedNorm — Method
norm::PetscReal,norma::PetscReal,normr::PetscReal = TSErrorWeightedNorm(petsclib::PetscLibType,ts::TS, U::PetscVec, Y::PetscVec, wnormtype::NormType)compute a weighted norm of the difference between two state vectors based on supplied absolute and relative tolerances
Collective
Input Parameters:
ts- time stepping contextU- state vector, usually ts->vec_solY- state vector to be compared to Uwnormtype- norm type, eitherNORM_2orNORM_INFINITY
Output Parameters:
norm- weighted norm, a value of 1.0 achieves a balance between absolute and relative tolerancesnorma- weighted norm, a value of 1.0 means that the error meets the absolute tolerance set by the usernormr- weighted norm, a value of 1.0 means that the error meets the relative tolerance set by the user
Options Database Key:
-ts_adapt_wnormtype <wnormtype>- 2, INFINITY
Level: developer
-seealso: , TS, VecErrorWeightedNorms(), TSErrorWeightedENorm()
External Links
- PETSc Manual:
Ts/TSErrorWeightedNorm
PETSc.LibPETSc.TSEvaluateStep — Method
TSEvaluateStep(petsclib::PetscLibType,ts::TS, order::PetscInt, U::PetscVec, done::PetscBool)Evaluate the solution at the end of a time step with a given order of accuracy.
Collective
Input Parameters:
ts- time stepping contextorder- desired order of accuracydone- whether the step was evaluated at this order (passNULLto generate an error if not available)
Output Parameter:
U- state at the end of the current step
Level: advanced
-seealso: , TS, TSStep(), TSAdapt
External Links
- PETSc Manual:
Ts/TSEvaluateStep
PETSc.LibPETSc.TSEvaluateWLTE — Method
order::PetscInt,wlte::PetscReal = TSEvaluateWLTE(petsclib::PetscLibType,ts::TS, wnormtype::NormType)Evaluate the weighted local truncation error norm at the end of a time step with a given order of accuracy.
Collective
Input Parameters:
ts- time stepping contextwnormtype- norm type, eitherNORM_2orNORM_INFINITY
Input/Output Parameter:
order- optional, desired order for the error evaluation orPETSC_DECIDE;
on output, the actual order of the error evaluation
Output Parameter:
wlte- the weighted local truncation error norm
Level: advanced
-seealso: , TS, TSStep(), TSAdapt, TSErrorWeightedNorm()
External Links
- PETSc Manual:
Ts/TSEvaluateWLTE
PETSc.LibPETSc.TSFinalizePackage — Method
TSFinalizePackage(petsclib::PetscLibType)This function destroys everything in the PETSc interface to TS. It is called from PetscFinalize().
Level: developer
-seealso: , TS, PetscFinalize(), TSInitializePackage()
External Links
- PETSc Manual:
Ts/TSFinalizePackage
PETSc.LibPETSc.TSForwardCostIntegral — Method
TSForwardCostIntegral(petsclib::PetscLibType,ts::TS)Evaluate the cost integral in the forward run.
Collective
Input Parameter:
ts- time stepping context
Level: advanced
-seealso: , TS, TSSolve(), TSAdjointCostIntegral()
External Links
- PETSc Manual:
Ts/TSForwardCostIntegral
PETSc.LibPETSc.TSForwardGetSensitivities — Method
nump::PetscInt = TSForwardGetSensitivities(petsclib::PetscLibType,ts::TS, Smat::PetscMat)Returns the trajectory sensitivities
Not Collective, but Smat returned is parallel if ts is parallel
Output Parameters:
ts- theTScontext obtained fromTSCreate()nump- number of parametersSmat- sensitivities with respect to the parameters, the number of entries in these vectors is the same as the number of parameters
Level: intermediate
-seealso: , TSForwardSetSensitivities(), TSForwardSetIntegralGradients(), TSForwardGetIntegralGradients(), TSForwardStep()
External Links
- PETSc Manual:
Ts/TSForwardGetSensitivities
PETSc.LibPETSc.TSForwardGetStages — Method
ns::PetscInt = TSForwardGetStages(petsclib::PetscLibType,ts::TS, S::PetscMat)Get the number of stages and the tangent linear sensitivities at the intermediate stages
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Output Parameters:
ns- number of stagesS- tangent linear sensitivities at the intermediate stages
Level: advanced
-seealso: TS
External Links
- PETSc Manual:
Ts/TSForwardGetStages
PETSc.LibPETSc.TSForwardReset — Method
TSForwardReset(petsclib::PetscLibType,ts::TS)Reset the internal data structures used by forward sensitivity analysis
Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Level: advanced
-seealso: , TSCreate(), TSDestroy(), TSForwardSetUp()
External Links
- PETSc Manual:
Ts/TSForwardReset
PETSc.LibPETSc.TSForwardSetInitialSensitivities — Method
TSForwardSetInitialSensitivities(petsclib::PetscLibType,ts::TS, didp::PetscMat)Set initial values for tangent linear sensitivities
Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()didp- parametric sensitivities of the initial condition
Level: intermediate
-seealso: , TS, TSForwardSetSensitivities()
External Links
- PETSc Manual:
Ts/TSForwardSetInitialSensitivities
PETSc.LibPETSc.TSForwardSetSensitivities — Method
TSForwardSetSensitivities(petsclib::PetscLibType,ts::TS, nump::PetscInt, Smat::PetscMat)Sets the initial value of the trajectory sensitivities of solution w.r.t. the problem parameters and initial values.
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()nump- number of parametersSmat- sensitivities with respect to the parameters, the number of entries in these vectors is the same as the number of parameters
Level: beginner
-seealso: , TSForwardGetSensitivities(), TSForwardSetIntegralGradients(), TSForwardGetIntegralGradients(), TSForwardStep()
External Links
- PETSc Manual:
Ts/TSForwardSetSensitivities
PETSc.LibPETSc.TSForwardSetUp — Method
TSForwardSetUp(petsclib::PetscLibType,ts::TS)Sets up the internal data structures for the later use of forward sensitivity analysis
Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Level: advanced
-seealso: , TS, TSCreate(), TSDestroy(), TSSetUp()
External Links
- PETSc Manual:
Ts/TSForwardSetUp
PETSc.LibPETSc.TSForwardStep — Method
TSForwardStep(petsclib::PetscLibType,ts::TS)Compute the forward sensitivity for one time step.
Collective
Input Parameter:
ts- time stepping context
Level: advanced
-seealso: , TSForwardSetSensitivities(), TSForwardGetSensitivities(), TSForwardSetIntegralGradients(), TSForwardGetIntegralGradients(), TSForwardSetUp()
External Links
- PETSc Manual:
Ts/TSForwardStep
PETSc.LibPETSc.TSFunctionDomainError — Method
accept::PetscBool = TSFunctionDomainError(petsclib::PetscLibType,ts::TS, stagetime::PetscReal, Y::PetscVec)Checks if the current state is valid
Collective
Input Parameters:
ts- theTScontextstagetime- time of the simulationY- state vector to check.
Output Parameter:
accept- Set toPETSC_FALSEif the current state vector is valid.
Level: developer
-seealso: , TS, TSSetFunctionDomainError()
External Links
- PETSc Manual:
Ts/TSFunctionDomainError
PETSc.LibPETSc.TSGLEEFinalizePackage — Method
TSGLEEFinalizePackage(petsclib::PetscLibType)This function destroys everything in the TSGLEE package. It is called from PetscFinalize().
Level: developer
External Links
- PETSc Manual:
Ts/TSGLEEFinalizePackage
PETSc.LibPETSc.TSGLEEGetType — Method
gleetype::TSGLEEType = TSGLEEGetType(petsclib::PetscLibType,ts::TS)Get the type of TSGLEE scheme
Logically Collective
Input Parameter:
ts- timestepping context
Output Parameter:
gleetype- type ofTSGLEEscheme
Level: intermediate
-seealso: , TSGLEE, TSGLEESetType()
External Links
- PETSc Manual:
Ts/TSGLEEGetType
PETSc.LibPETSc.TSGLEEInitializePackage — Method
TSGLEEInitializePackage(petsclib::PetscLibType)This function initializes everything in the TSGLEE package. It is called from TSInitializePackage().
Level: developer
External Links
- PETSc Manual:
Ts/TSGLEEInitializePackage
PETSc.LibPETSc.TSGLEERegister — Method
TSGLEERegister(petsclib::PetscLibType,name::TSGLEEType, order::PetscInt, s::PetscInt, r::PetscInt, gamma::PetscReal, A::Vector{PetscReal}, B::Vector{PetscReal}, U::Vector{PetscReal}, V::Vector{PetscReal}, S::Vector{PetscReal}, F::Vector{PetscReal}, c::Vector{PetscReal}, Fembed::Vector{PetscReal}, Ferror::Vector{PetscReal}, Serror::Vector{PetscReal}, pinterp::PetscInt, binterp::Vector{PetscReal})register a new TSGLEE scheme by providing the entries in the Butcher tableau
Not Collective, but the same schemes should be registered on all processes on which they will be used, No Fortran Support
Input Parameters:
name- identifier for methodorder- order of methods- number of stagesr- number of stepsgamma- LTE ratioA- stage coefficients (dimension s*s, row-major)B- step completion coefficients (dimension r*s, row-major)U- method coefficients (dimension s*r, row-major)V- method coefficients (dimension r*r, row-major)S- starting coefficientsF- finishing coefficientsc- abscissa (dimension s; NULL to use row sums of A)Fembed- step completion coefficients for embedded methodFerror- error computation coefficientsSerror- error initialization coefficientspinterp- order of interpolation (0 if unavailable)binterp- array of interpolation coefficients (NULL if unavailable)
Level: advanced
External Links
- PETSc Manual:
Ts/TSGLEERegister
PETSc.LibPETSc.TSGLEERegisterAll — Method
TSGLEERegisterAll(petsclib::PetscLibType)Registers all of the General Linear with Error Estimation methods in TSGLEE
Not Collective, but should be called by all processes which will need the schemes to be registered
Level: advanced
-seealso: , TSGLEERegisterDestroy()
External Links
- PETSc Manual:
Ts/TSGLEERegisterAll
PETSc.LibPETSc.TSGLEERegisterDestroy — Method
TSGLEERegisterDestroy(petsclib::PetscLibType)Frees the list of schemes that were registered by TSGLEERegister().
Not Collective
Level: advanced
-seealso: , TSGLEERegister(), TSGLEERegisterAll()
External Links
- PETSc Manual:
Ts/TSGLEERegisterDestroy
PETSc.LibPETSc.TSGLEESetType — Method
TSGLEESetType(petsclib::PetscLibType,ts::TS, gleetype::TSGLEEType)Set the type of TSGLEE scheme
Logically Collective
Input Parameters:
ts- timestepping contextgleetype- type ofTSGLEEscheme
Level: intermediate
-seealso: , TSGLEEGetType(), TSGLEE
External Links
- PETSc Manual:
Ts/TSGLEESetType
PETSc.LibPETSc.TSGLLEAcceptRegister — Method
TSGLLEAcceptRegister(petsclib::PetscLibType,sname::String, fnc::TSGLLEAcceptFn)adds a TSGLLE acceptance scheme
Not Collective
Input Parameters:
sname- name of user-defined acceptance schemefunction- routine to create method context, seeTSGLLEAcceptFnfor the calling sequence
Level: advanced
-seealso: , TSGLLE, TSGLLEType, TSGLLERegisterAll(), TSGLLEAcceptFn
External Links
- PETSc Manual:
Ts/TSGLLEAcceptRegister
PETSc.LibPETSc.TSGLLEFinalizePackage — Method
TSGLLEFinalizePackage(petsclib::PetscLibType)This function destroys everything in the TSGLLE package. It is called from PetscFinalize().
Level: developer
-seealso: , PetscFinalize(), TSGLLEInitializePackage(), TSInitializePackage()
External Links
- PETSc Manual:
Ts/TSGLLEFinalizePackage
PETSc.LibPETSc.TSGLLEGetAdapt — Method
TSGLLEGetAdapt(petsclib::PetscLibType,ts::TS, adapt::TSGLLEAdapt)gets the TSGLLEAdapt object from the TS
Not Collective
Input Parameter:
ts- theTScontext
Output Parameter:
adapt- theTSGLLEAdaptcontext
Level: advanced
-seealso: , TS, TSGLLE, TSGLLEAdapt, TSGLLEAdaptRegister()
External Links
- PETSc Manual:
Ts/TSGLLEGetAdapt
PETSc.LibPETSc.TSGLLEInitializePackage — Method
TSGLLEInitializePackage(petsclib::PetscLibType)This function initializes everything in the TSGLLE package. It is called from TSInitializePackage().
Level: developer
-seealso: , PetscInitialize(), TSInitializePackage(), TSGLLEFinalizePackage()
External Links
- PETSc Manual:
Ts/TSGLLEInitializePackage
PETSc.LibPETSc.TSGLLERegister — Method
TSGLLERegister(petsclib::PetscLibType,sname::String, fnc::external)adds a TSGLLE implementation
Not Collective, No Fortran Support
Input Parameters:
sname- name of user-defined general linear schemefunction- routine to create method context
Level: advanced
-seealso: , TSGLLE, TSGLLEType, TSGLLERegisterAll()
External Links
- PETSc Manual:
Ts/TSGLLERegister
PETSc.LibPETSc.TSGLLESetAcceptType — Method
TSGLLESetAcceptType(petsclib::PetscLibType,ts::TS, type::TSGLLEAcceptType)sets the acceptance test for TSGLLE
Logically Collective
Input Parameters:
ts- theTScontexttype- the type
Options Database Key:
-ts_gl_accept_type <type>- sets the method used to determine whether to accept or reject a step
Level: intermediate
-seealso: , TS, TSGLLE, TSGLLEAcceptRegister(), TSGLLEAdapt
External Links
- PETSc Manual:
Ts/TSGLLESetAcceptType
PETSc.LibPETSc.TSGLLESetType — Method
TSGLLESetType(petsclib::PetscLibType,ts::TS, type::TSGLLEType)sets the class of general linear method, TSGLLE to use for time
Collective
Input Parameters:
ts- theTScontexttype- a method
Options Database Key:
-ts_gl_type <type>- sets the method, use -help for a list of available method (e.g. irks)
Level: intermediate
-seealso: , TS, TSGLLEType, TSGLLE
External Links
- PETSc Manual:
Ts/TSGLLESetType
PETSc.LibPETSc.TSGetAdapt — Method
TSGetAdapt(petsclib::PetscLibType,ts::TS, adapt::TSAdapt)Get the adaptive controller context for the current method
Collective if controller has not yet been created
Input Parameter:
ts- time stepping context
Output Parameter:
adapt- adaptive controller
Level: intermediate
-seealso: , TS, TSAdapt, TSAdaptSetType(), TSAdaptChoose()
External Links
- PETSc Manual:
Ts/TSGetAdapt
PETSc.LibPETSc.TSGetApplicationContext — Method
TSGetApplicationContext(petsclib::PetscLibType,ts::TS, ctx::Cvoid)Gets the user timestepper that was set with TSSetApplicationContext()
Not Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Output Parameter:
ctx- a pointer to the user context
Level: intermediate
-seealso: , TS, TSSetApplicationContext()
External Links
- PETSc Manual:
Ts/TSGetApplicationContext
PETSc.LibPETSc.TSGetAuxSolution — Method
TSGetAuxSolution(petsclib::PetscLibType,ts::TS, v::PetscVec)Returns an auxiliary solution at the present timestep, if available for the time integration method being used.
Not Collective, but v returned is parallel if ts is parallel
Input Parameters:
ts- theTScontext obtained fromTSCreate()(input parameter).v- the vector containing the auxiliary solution
Level: intermediate
-seealso: , TS, TSGetSolution()
External Links
- PETSc Manual:
Ts/TSGetAuxSolution
PETSc.LibPETSc.TSGetCFLTime — Method
cfltime::PetscReal = TSGetCFLTime(petsclib::PetscLibType,ts::TS)Get the maximum stable time step according to CFL criteria applied to forward Euler
Collective
Input Parameter:
ts- time stepping context
Output Parameter:
cfltime- maximum stable time step for forward Euler
Level: advanced
-seealso: , TSSetCFLTimeLocal()
External Links
- PETSc Manual:
Ts/TSGetCFLTime
PETSc.LibPETSc.TSGetConvergedReason — Method
TSGetConvergedReason(petsclib::PetscLibType,ts::TS, reason::TSConvergedReason)Gets the reason the TS iteration was stopped.
Not Collective
Input Parameter:
ts- theTScontext
Output Parameter:
reason- negative value indicates diverged, positive value converged, seeTSConvergedReasonor the
manual pages for the individual convergence tests for complete lists
Level: beginner
-seealso: , TS, TSSolve(), TSConvergedReason
External Links
- PETSc Manual:
Ts/TSGetConvergedReason
PETSc.LibPETSc.TSGetCostGradients — Method
numcost::PetscInt = TSGetCostGradients(petsclib::PetscLibType,ts::TS, lambda::Vector{PetscVec}, mu::Vector{PetscVec})Returns the gradients from the TSAdjointSolve()
Not Collective, but the vectors returned are parallel if TS is parallel
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Output Parameters:
numcost- size of returned arrayslambda- vectors containing the gradients of the cost functions with respect to the ODE/DAE solution variablesmu- vectors containing the gradients of the cost functions with respect to the problem parameters
Level: intermediate
-seealso: , TS, TSAdjointSolve(), TSSetCostGradients()
External Links
- PETSc Manual:
Ts/TSGetCostGradients
PETSc.LibPETSc.TSGetCostHessianProducts — Method
numcost::PetscInt = TSGetCostHessianProducts(petsclib::PetscLibType,ts::TS, lambda2::Vector{PetscVec}, mu2::Vector{PetscVec}, dir::PetscVec)Returns the gradients from the TSAdjointSolve()
Not Collective, but vectors returned are parallel if TS is parallel
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Output Parameters:
numcost- number of cost functionslambda2- Hessian-vector product with respect to the initial condition variables, the dimension and parallel layout of these vectors is the same as the ODE solution vectormu2- Hessian-vector product with respect to the parameters, the number of entries in these vectors is the same as the number of parametersdir- the direction vector that are multiplied with the Hessian of the cost functions
Level: intermediate
-seealso: , TSAdjointSolve(), TSSetCostHessianProducts()
External Links
- PETSc Manual:
Ts/TSGetCostHessianProducts
PETSc.LibPETSc.TSGetCostIntegral — Method
TSGetCostIntegral(petsclib::PetscLibType,ts::TS, v::PetscVec)Returns the values of the integral term in the cost functions. It is valid to call the routine after a backward run.
Not Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Output Parameter:
v- the vector containing the integrals for each cost function
Level: intermediate
-seealso: , TS, TSAdjointSolve(), TSSetCostIntegrand()
External Links
- PETSc Manual:
Ts/TSGetCostIntegral
PETSc.LibPETSc.TSGetDM — Method
dm::PetscDM = TSGetDM(petsclib::PetscLibType,ts::TS, dm::PetscDM)Gets the DM that may be used by some preconditioners
Not Collective
Input Parameter:
ts- theTS
Output Parameter:
dm- theDM
Level: intermediate
-seealso: , TS, DM, TSSetDM(), SNESSetDM(), SNESGetDM()
External Links
- PETSc Manual:
Ts/TSGetDM
PETSc.LibPETSc.TSGetEquationType — Method
equation_type::TSEquationType = TSGetEquationType(petsclib::PetscLibType,ts::TS)Gets the type of the equation that TS is solving.
Not Collective
Input Parameter:
ts- theTScontext
Output Parameter:
equation_type- seeTSEquationType
Level: beginner
-seealso: , TS, TSSetEquationType(), TSEquationType
External Links
- PETSc Manual:
Ts/TSGetEquationType
PETSc.LibPETSc.TSGetEvaluationSolutions — Method
nsol::PetscInt,sol_times::Vector{PetscReal} = TSGetEvaluationSolutions(petsclib::PetscLibType,ts::TS, Sols::Vector{PetscVec})Get the number of solutions and the solutions at the evaluation time points specified
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Output Parameters:
nsol- the number of solutionssol_times- array of solution times corresponding to the solution vectors. See note belowSols- the solution vectors
Level: intermediate
-seealso: , TS, TSSetEvaluationTimes(), TSGetEvaluationTimes()
External Links
- PETSc Manual:
Ts/TSGetEvaluationSolutions
PETSc.LibPETSc.TSGetEvaluationTimes — Method
n::PetscInt,time_points::Vector{PetscReal} = TSGetEvaluationTimes(petsclib::PetscLibType,ts::TS)gets the evaluation times set with TSSetEvaluationTimes()
Not Collective
Input Parameter:
ts- the time-stepper
Output Parameters:
n- number of the time pointstime_points- array of the time points
Level: beginner
-seealso: , TS, TSSetEvaluationTimes(), TSGetEvaluationSolutions()
External Links
- PETSc Manual:
Ts/TSGetEvaluationTimes
PETSc.LibPETSc.TSGetExactFinalTime — Method
TSGetExactFinalTime(petsclib::PetscLibType,ts::TS, eftopt::TSExactFinalTimeOption)Gets the exact final time option set with TSSetExactFinalTime()
Not Collective
Input Parameter:
ts- theTScontext
Output Parameter:
eftopt- exact final time option
Level: beginner
-seealso: , TS, TSExactFinalTimeOption, TSSetExactFinalTime()
External Links
- PETSc Manual:
Ts/TSGetExactFinalTime
PETSc.LibPETSc.TSGetI2Function — Method
TSGetI2Function(petsclib::PetscLibType,ts::TS, r::PetscVec, fun::TSI2FunctionFn, ctx::Cvoid)Returns the vector where the implicit residual is stored and the function/context to compute it.
Not Collective
Input Parameter:
ts- theTScontext
Output Parameters:
r- vector to hold residual (orNULL)fun- the function to compute residual (orNULL)ctx- the function context (orNULL)
Level: advanced
-seealso: , TS, TSSetIFunction(), SNESGetFunction(), TSCreate()
External Links
- PETSc Manual:
Ts/TSGetI2Function
PETSc.LibPETSc.TSGetI2Jacobian — Method
TSGetI2Jacobian(petsclib::PetscLibType,ts::TS, J::PetscMat, P::PetscMat, jac::TSI2JacobianFn, ctx::Cvoid)Returns the implicit Jacobian at the present timestep.
Not Collective, but parallel objects are returned if TS is parallel
Input Parameter:
ts- TheTScontext obtained fromTSCreate()
Output Parameters:
J- The (approximate) Jacobian of F(t,U,Ut,Utt)P- The matrix from which the preconditioner is constructed, often the same asJjac- The function to compute the Jacobian matricesctx- User-defined context for Jacobian evaluation routine
Level: advanced
-seealso: , TS, TSGetTimeStep(), TSGetMatrices(), TSGetTime(), TSGetStepNumber(), TSSetI2Jacobian(), TSGetI2Function(), TSCreate()
External Links
- PETSc Manual:
Ts/TSGetI2Jacobian
PETSc.LibPETSc.TSGetIFunction — Method
TSGetIFunction(petsclib::PetscLibType,ts::TS, r::PetscVec, func::TSIFunctionFn, ctx::Cvoid)Returns the vector where the implicit residual is stored and the function/context to compute it.
Not Collective
Input Parameter:
ts- theTScontext
Output Parameters:
r- vector to hold residual (orNULL)func- the function to compute residual (orNULL)ctx- the function context (orNULL)
Level: advanced
-seealso: , TS, TSSetIFunction(), SNESGetFunction()
External Links
- PETSc Manual:
Ts/TSGetIFunction
PETSc.LibPETSc.TSGetIJacobian — Method
TSGetIJacobian(petsclib::PetscLibType,ts::TS, Amat::PetscMat, Pmat::PetscMat, f::TSIJacobianFn, ctx::Cvoid)Returns the implicit Jacobian at the present timestep.
Not Collective, but parallel objects are returned if ts is parallel
Input Parameter:
ts- TheTScontext obtained fromTSCreate()
Output Parameters:
Amat- The (approximate) Jacobian of F(t,U,U_t)Pmat- The matrix from which the preconditioner is constructed, often the same asAmatf- The function to compute the matricesctx- User-defined context for Jacobian evaluation routine
Level: advanced
-seealso: , TS, TSGetTimeStep(), TSGetRHSJacobian(), TSGetMatrices(), TSGetTime(), TSGetStepNumber()
External Links
- PETSc Manual:
Ts/TSGetIJacobian
PETSc.LibPETSc.TSGetKSP — Method
TSGetKSP(petsclib::PetscLibType,ts::TS, ksp::PetscKSP)Returns the KSP (linear solver) associated with a TS (timestepper) context.
Not Collective, but ksp is parallel if ts is parallel
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Output Parameter:
ksp- the nonlinear solver context
Level: beginner
-seealso: , TS, SNES, KSP, TSCreate(), TSSetUp(), TSSolve(), TSGetSNES()
External Links
- PETSc Manual:
Ts/TSGetKSP
PETSc.LibPETSc.TSGetKSPIterations — Method
lits::PetscInt = TSGetKSPIterations(petsclib::PetscLibType,ts::TS)Gets the total number of linear iterations used by the time integrator.
Not Collective
Input Parameter:
ts-TScontext
Output Parameter:
lits- number of linear iterations
Level: intermediate
-seealso: , TS, TSSolve(), TSGetSNESIterations()
External Links
- PETSc Manual:
Ts/TSGetKSPIterations
PETSc.LibPETSc.TSGetMaxSteps — Method
maxsteps::PetscInt = TSGetMaxSteps(petsclib::PetscLibType,ts::TS)Gets the maximum number of steps to use.
Not Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Output Parameter:
maxsteps- maximum number of steps to use
Level: advanced
-seealso: , TS, TSSetMaxSteps(), TSGetMaxTime(), TSSetMaxTime()
External Links
- PETSc Manual:
Ts/TSGetMaxSteps
PETSc.LibPETSc.TSGetMaxTime — Method
maxtime::PetscReal = TSGetMaxTime(petsclib::PetscLibType,ts::TS)Gets the maximum (or final) time for timestepping.
Not Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Output Parameter:
maxtime- final time to step to
Level: advanced
-seealso: , TS, TSSetMaxTime(), TSGetMaxSteps(), TSSetMaxSteps()
External Links
- PETSc Manual:
Ts/TSGetMaxTime
PETSc.LibPETSc.TSGetNumEvents — Method
nevents::PetscInt = TSGetNumEvents(petsclib::PetscLibType,ts::TS)Get the number of events defined on the given MPI process
Logically Collective
Input Parameter:
ts- theTScontext
Output Parameter:
nevents- the number of local events on each MPI process
Level: intermediate
-seealso: , TSEvent, TSSetEventHandler()
External Links
- PETSc Manual:
Ts/TSGetNumEvents
PETSc.LibPETSc.TSGetOptionsPrefix — Method
TSGetOptionsPrefix(petsclib::PetscLibType,ts::TS, prefix::String)Sets the prefix used for searching for all TS options in the database.
Not Collective
Input Parameter:
ts- TheTScontext
Output Parameter:
prefix- A pointer to the prefix string used
Level: intermediate
-seealso: , TS, TSAppendOptionsPrefix(), TSSetFromOptions()
External Links
- PETSc Manual:
Ts/TSGetOptionsPrefix
PETSc.LibPETSc.TSGetPrevTime — Method
t::PetscReal = TSGetPrevTime(petsclib::PetscLibType,ts::TS)Gets the starting time of the previously completed step.
Not Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Output Parameter:
t- the previous time
Level: beginner
-seealso: , TS, TSGetTime(), TSGetSolveTime(), TSGetTimeStep()
External Links
- PETSc Manual:
Ts/TSGetPrevTime
PETSc.LibPETSc.TSGetProblemType — Method
type::TSProblemType = TSGetProblemType(petsclib::PetscLibType,ts::TS)Gets the type of problem to be solved.
Not collective
Input Parameter:
ts- TheTS
Output Parameter:
type- One ofTS_LINEAR,TS_NONLINEARwhere these types refer to problems of the forms
-seealso: , TSSetUp(), TSProblemType, TS
External Links
- PETSc Manual:
Ts/TSGetProblemType
PETSc.LibPETSc.TSGetQuadratureTS — Method
fwd::PetscBool = TSGetQuadratureTS(petsclib::PetscLibType,ts::TS, quadts::TS)Return the sub
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Output Parameters:
fwd- flag indicating whether to evaluate cost integral in the forward run or the adjoint runquadts- the childTScontext
Level: intermediate
-seealso: , TSCreateQuadratureTS()
External Links
- PETSc Manual:
Ts/TSGetQuadratureTS
PETSc.LibPETSc.TSGetRHSFunction — Method
TSGetRHSFunction(petsclib::PetscLibType,ts::TS, r::PetscVec, func::TSRHSFunctionFn, ctx::Cvoid)Returns the vector where the right
Not Collective
Input Parameter:
ts- theTScontext
Output Parameters:
r- vector to hold computed right-hand side (orNULL)func- the function to compute right-hand side (orNULL)ctx- the function context (orNULL)
Level: advanced
-seealso: , TS, TSSetRHSFunction(), SNESGetFunction()
External Links
- PETSc Manual:
Ts/TSGetRHSFunction
PETSc.LibPETSc.TSGetRHSJacobian — Method
TSGetRHSJacobian(petsclib::PetscLibType,ts::TS, Amat::PetscMat, Pmat::PetscMat, func::TSRHSJacobianFn, ctx::Cvoid)Returns the Jacobian J at the present timestep.
Not Collective, but parallel objects are returned if ts is parallel
Input Parameter:
ts- TheTScontext obtained fromTSCreate()
Output Parameters:
Amat- The (approximate) Jacobian J of G, where U_t = G(U,t) (orNULL)Pmat- The matrix from which the preconditioner is constructed, usually the same asAmat(orNULL)func- Function to compute the Jacobian of the RHS (orNULL)ctx- User-defined context for Jacobian evaluation routine (orNULL)
Level: intermediate
-seealso: , TS, TSGetTimeStep(), TSGetMatrices(), TSGetTime(), TSGetStepNumber()
External Links
- PETSc Manual:
Ts/TSGetRHSJacobian
PETSc.LibPETSc.TSGetRHSJacobianP — Method
TSGetRHSJacobianP(petsclib::PetscLibType,ts::TS, Amat::PetscMat, func::TSRHSJacobianPFn, ctx::Cvoid)Gets the function that computes the Jacobian of G w.r.t. the parameters p where U_t = G(U,p,t), as well as the location to store the matrix.
Logically Collective
Input Parameter:
ts-TScontext obtained fromTSCreate()
Output Parameters:
Amat- JacobianP matrixfunc- functionctx- [optional] user-defined function context
Level: intermediate
-seealso: , TSSetRHSJacobianP(), TS, TSRHSJacobianPFn
External Links
- PETSc Manual:
Ts/TSGetRHSJacobianP
PETSc.LibPETSc.TSGetRunSteps — Method
runsteps::PetscInt = TSGetRunSteps(petsclib::PetscLibType,ts::TS)Gets the maximum number of steps to take in each call to TSSolve().
Not Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Output Parameter:
runsteps- maximum number of steps to take in each call toTSSolve.
Level: advanced
-seealso: , TS, TSSetRunSteps(), TSGetMaxTime(), TSSetMaxTime(), TSGetMaxSteps()
External Links
- PETSc Manual:
Ts/TSGetRunSteps
PETSc.LibPETSc.TSGetSNES — Method
TSGetSNES(petsclib::PetscLibType,ts::TS, snes::PetscSNES)Returns the SNES (nonlinear solver) associated with a TS (timestepper) context. Valid only for nonlinear problems.
Not Collective, but snes is parallel if ts is parallel
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Output Parameter:
snes- the nonlinear solver context
Level: beginner
-seealso: , TS, SNES, TSCreate(), TSSetUp(), TSSolve()
External Links
- PETSc Manual:
Ts/TSGetSNES
PETSc.LibPETSc.TSGetSNESFailures — Method
fails::PetscInt = TSGetSNESFailures(petsclib::PetscLibType,ts::TS)Gets the total number of failed SNES solves in a TS
Not Collective
Input Parameter:
ts-TScontext
Output Parameter:
fails- number of failed nonlinear solves
Level: intermediate
-seealso: , TS, TSSolve(), TSGetSNESIterations(), TSGetKSPIterations(), TSSetMaxStepRejections(), TSGetStepRejections(), TSSetMaxSNESFailures()
External Links
- PETSc Manual:
Ts/TSGetSNESFailures
PETSc.LibPETSc.TSGetSNESIterations — Method
nits::PetscInt = TSGetSNESIterations(petsclib::PetscLibType,ts::TS)Gets the total number of nonlinear iterations used by the time integrator.
Not Collective
Input Parameter:
ts-TScontext
Output Parameter:
nits- number of nonlinear iterations
Level: intermediate
-seealso: , TS, TSSolve(), TSGetKSPIterations()
External Links
- PETSc Manual:
Ts/TSGetSNESIterations
PETSc.LibPETSc.TSGetSolution — Method
TSGetSolution(petsclib::PetscLibType,ts::TS, v::PetscVec)Returns the solution at the present timestep. It is valid to call this routine inside the function that you are evaluating in order to move to the new timestep. This vector not changed until the solution at the next timestep has been calculated.
Not Collective, but v returned is parallel if ts is parallel
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Output Parameter:
v- the vector containing the solution
Level: intermediate
-seealso: , TS, TSGetTimeStep(), TSGetTime(), TSGetSolveTime(), TSGetSolutionComponents(), TSSetSolutionFunction()
External Links
- PETSc Manual:
Ts/TSGetSolution
PETSc.LibPETSc.TSGetSolutionComponents — Method
TSGetSolutionComponents(petsclib::PetscLibType,ts::TS, n::PetscInt, v::PetscVec)Returns any solution components at the present timestep, if available for the time integration method being used. Solution components are quantities that share the same size and structure as the solution vector.
Not Collective, but v returned is parallel if ts is parallel
Input Parameters:
ts- theTScontext obtained fromTSCreate()(input parameter).n- If v isNULL, then the number of solution components is
returned through n, else the n-th solution component is returned in v.
v- the vector containing the n-th solution component
(may be NULL to use this function to find out the number of solutions components).
Level: advanced
-seealso: , TS, TSGetSolution()
External Links
- PETSc Manual:
Ts/TSGetSolutionComponents
PETSc.LibPETSc.TSGetSolveTime — Method
ftime::PetscReal = TSGetSolveTime(petsclib::PetscLibType,ts::TS)Gets the time after a call to TSSolve()
Not Collective
Input Parameter:
ts- theTScontext
Output Parameter:
ftime- the final time. This time corresponds to the final time set withTSSetMaxTime()
Level: beginner
-seealso: , TS, TSSolve(), TSConvergedReason
External Links
- PETSc Manual:
Ts/TSGetSolveTime
PETSc.LibPETSc.TSGetStages — Method
ns::PetscInt = TSGetStages(petsclib::PetscLibType,ts::TS, Y::PetscVec)Get the number of stages and stage values
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Output Parameters:
ns- the number of stagesY- the current stage vectors
Level: advanced
External Links
- PETSc Manual:
Ts/TSGetStages
PETSc.LibPETSc.TSGetStepNumber — Method
steps::PetscInt = TSGetStepNumber(petsclib::PetscLibType,ts::TS)Gets the number of time steps completed.
Not Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Output Parameter:
steps- number of steps completed so far
Level: intermediate
-seealso: , TS, TSGetTime(), TSGetTimeStep(), TSSetPreStep(), TSSetPreStage(), TSSetPostStage(), TSSetPostStep()
External Links
- PETSc Manual:
Ts/TSGetStepNumber
PETSc.LibPETSc.TSGetStepRejections — Method
rejects::PetscInt = TSGetStepRejections(petsclib::PetscLibType,ts::TS)Gets the total number of rejected steps.
Not Collective
Input Parameter:
ts-TScontext
Output Parameter:
rejects- number of steps rejected
Level: intermediate
-seealso: , TS, TSSolve(), TSGetSNESIterations(), TSGetKSPIterations(), TSSetMaxStepRejections(), TSGetSNESFailures(), TSSetMaxSNESFailures(), TSSetErrorIfStepFails()
External Links
- PETSc Manual:
Ts/TSGetStepRejections
PETSc.LibPETSc.TSGetStepResize — Method
flg::PetscBool = TSGetStepResize(petsclib::PetscLibType,ts::TS)Get the internal flag indicating if the current step is after a resize.
Not collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Output Parameter:
flg- the resize flag
Level: advanced
-seealso: , TS, TSCreate(), TSSetResize()
External Links
- PETSc Manual:
Ts/TSGetStepResize
PETSc.LibPETSc.TSGetStepRollBack — Method
flg::PetscBool = TSGetStepRollBack(petsclib::PetscLibType,ts::TS)Get the internal flag indicating if you are rolling back a step
Not collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Output Parameter:
flg- the rollback flag
Level: advanced
-seealso: , TS, TSCreate(), TSRollBack()
External Links
- PETSc Manual:
Ts/TSGetStepRollBack
PETSc.LibPETSc.TSGetTime — Method
t::PetscReal = TSGetTime(petsclib::PetscLibType,ts::TS)Gets the time of the most recently completed step.
Not Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Output Parameter:
t- the current time. This time may not corresponds to the final time set withTSSetMaxTime(), useTSGetSolveTime().
Level: beginner
-seealso: , TS, TSGetSolveTime(), TSSetTime(), TSGetTimeStep(), TSGetStepNumber()
External Links
- PETSc Manual:
Ts/TSGetTime
PETSc.LibPETSc.TSGetTimeError — Method
TSGetTimeError(petsclib::PetscLibType,ts::TS, n::PetscInt, v::PetscVec)Returns the estimated error vector, if the chosen TSType has an error estimation functionality and TSSetTimeError() was called
Not Collective, but v returned is parallel if ts is parallel
Input Parameters:
ts- theTScontext obtained fromTSCreate()(input parameter).n- current estimate (n=0) or previous one (n=-1)v- the vector containing the error (same size as the solution).
Level: intermediate
-seealso: , TSGetSolution(), TSSetTimeError()
External Links
- PETSc Manual:
Ts/TSGetTimeError
PETSc.LibPETSc.TSGetTimeStep — Method
dt::PetscReal = TSGetTimeStep(petsclib::PetscLibType,ts::TS)Gets the current timestep size.
Not Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Output Parameter:
dt- the current timestep size
Level: intermediate
-seealso: , TS, TSSetTimeStep(), TSGetTime()
External Links
- PETSc Manual:
Ts/TSGetTimeStep
PETSc.LibPETSc.TSGetTolerances — Method
atol::PetscReal,rtol::PetscReal = TSGetTolerances(petsclib::PetscLibType,ts::TS, vatol::PetscVec, vrtol::PetscVec)Get tolerances for local truncation error when using adaptive controller
Logically Collective
Input Parameter:
ts- time integration context
Output Parameters:
atol- scalar absolute tolerances,NULLto ignorevatol- vector of absolute tolerances,NULLto ignorertol- scalar relative tolerances,NULLto ignorevrtol- vector of relative tolerances,NULLto ignore
Level: beginner
-seealso: , TS, TSAdapt, TSErrorWeightedNorm(), TSSetTolerances()
External Links
- PETSc Manual:
Ts/TSGetTolerances
PETSc.LibPETSc.TSGetTrajectory — Method
TSGetTrajectory(petsclib::PetscLibType,ts::TS, tr::TSTrajectory)Gets the trajectory from a TS if it exists
Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Output Parameter:
tr- theTSTrajectoryobject, if it exists
Level: advanced
-seealso: , TS, TSTrajectory, TSAdjointSolve(), TSTrajectoryCreate()
External Links
- PETSc Manual:
Ts/TSGetTrajectory
PETSc.LibPETSc.TSGetType — Method
type::TSType = TSGetType(petsclib::PetscLibType,ts::TS)Gets the TS method type (as a string) that is being used to solve the ODE with the given TS
Not Collective
Input Parameter:
ts- TheTS
Output Parameter:
type- TheTSType
Level: intermediate
-seealso: , TS, TSType, TSSetType()
External Links
- PETSc Manual:
Ts/TSGetType
PETSc.LibPETSc.TSGetUseSplitRHSFunction — Method
use_splitrhsfnc::PetscBool = TSGetUseSplitRHSFunction(petsclib::PetscLibType,ts::TS)Gets whether to use the split RHSFunction when a multirate method is used.
Not Collective
Input Parameter:
ts- timestepping context
Output Parameter:
use_splitrhsfunction-PETSC_TRUEindicates that the split RHSFunction will be used
Level: intermediate
-seealso: , TS, TSSetUseSplitRHSFunction()
External Links
- PETSc Manual:
Ts/TSGetUseSplitRHSFunction
PETSc.LibPETSc.TSHasTransientVariable — Method
has::PetscBool = TSHasTransientVariable(petsclib::PetscLibType,ts::TS)determine whether transient variables have been set
Logically Collective
Input Parameter:
ts-TSon which to compute
Output Parameter:
has-PETSC_TRUEif transient variables have been set
Level: developer
-seealso: , TS, TSBDF, DMTSSetTransientVariable(), TSComputeTransientVariable()
External Links
- PETSc Manual:
Ts/TSHasTransientVariable
PETSc.LibPETSc.TSIRKFinalizePackage — Method
TSIRKFinalizePackage(petsclib::PetscLibType)This function destroys everything in the TSIRK package. It is called from PetscFinalize().
Level: developer
-seealso: , TSIRK, PetscFinalize(), TSInitializePackage()
External Links
- PETSc Manual:
Ts/TSIRKFinalizePackage
PETSc.LibPETSc.TSIRKGetNumStages — Method
TSIRKGetNumStages(petsclib::PetscLibType,ts::TS, nstages::PetscInt)Get the number of stages of TSIRK scheme
Logically Collective
Input Parameters:
ts- timestepping contextnstages- number of stages ofTSIRKscheme
Level: intermediate
-seealso: , TSIRKSetNumStages(), TSIRK
External Links
- PETSc Manual:
Ts/TSIRKGetNumStages
PETSc.LibPETSc.TSIRKGetType — Method
irktype::TSIRKType = TSIRKGetType(petsclib::PetscLibType,ts::TS)Get the type of TSIRK IMEX scheme being used
Logically Collective
Input Parameter:
ts- timestepping context
Output Parameter:
irktype- type ofTSIRKIMEX scheme
Level: intermediate
-seealso: , TSIRK, TSIRKType, TSIRKGAUSS
External Links
- PETSc Manual:
Ts/TSIRKGetType
PETSc.LibPETSc.TSIRKInitializePackage — Method
TSIRKInitializePackage(petsclib::PetscLibType)This function initializes everything in the TSIRK package. It is called from TSInitializePackage().
Level: developer
-seealso: , TSIRK, PetscInitialize(), TSIRKFinalizePackage(), TSInitializePackage()
External Links
- PETSc Manual:
Ts/TSIRKInitializePackage
PETSc.LibPETSc.TSIRKRegister — Method
TSIRKRegister(petsclib::PetscLibType,sname::String, fnc::external)adds a TSIRK implementation
Not Collective, No Fortran Support
Input Parameters:
sname- name of user-defined IRK schemefunction- function to create method context
Level: advanced
-seealso: , TSIRK, TSIRKRegisterAll()
External Links
- PETSc Manual:
Ts/TSIRKRegister
PETSc.LibPETSc.TSIRKRegisterDestroy — Method
TSIRKRegisterDestroy(petsclib::PetscLibType)Frees the list of schemes that were registered by TSIRKRegister().
Not Collective
Level: advanced
-seealso: , TSIRK, TSIRKRegister(), TSIRKRegisterAll()
External Links
- PETSc Manual:
Ts/TSIRKRegisterDestroy
PETSc.LibPETSc.TSIRKSetNumStages — Method
TSIRKSetNumStages(petsclib::PetscLibType,ts::TS, nstages::PetscInt)Set the number of stages of TSIRK scheme to use
Logically Collective
Input Parameters:
ts- timestepping contextnstages- number of stages ofTSIRKscheme
Options Database Key:
-ts_irk_nstages <int>- set number of stages
Level: intermediate
-seealso: , TSIRKGetNumStages(), TSIRK
External Links
- PETSc Manual:
Ts/TSIRKSetNumStages
PETSc.LibPETSc.TSIRKSetType — Method
TSIRKSetType(petsclib::PetscLibType,ts::TS, irktype::TSIRKType)Set the type of TSIRK scheme to use
Logically Collective
Input Parameters:
ts- timestepping contextirktype- type ofTSIRKscheme
Options Database Key:
-ts_irk_type <gauss>- set irk type
Level: intermediate
-seealso: , TSIRKGetType(), TSIRK, TSIRKType, TSIRKGAUSS
External Links
- PETSc Manual:
Ts/TSIRKSetType
PETSc.LibPETSc.TSIRKTableauCreate — Method
TSIRKTableauCreate(petsclib::PetscLibType,ts::TS, nstages::PetscInt, A::PetscReal, b::PetscReal, c::PetscReal, binterp::PetscReal, A_inv::PetscScalar, A_inv_rowsum::PetscScalar, I_s::PetscScalar)create the tableau for TSIRK and provide the entries
Not Collective
Input Parameters:
ts- timestepping contextnstages- number of stages, this is the dimension of the matrices belowA- stage coefficients (dimension nstages*nstages, row-major)b- step completion table (dimension nstages)c- abscissa (dimension nstages)binterp- coefficients of the interpolation formula (dimension nstages)A_inv- inverse of A (dimension nstages*nstages, row-major)A_inv_rowsum- row sum of the inverse of A (dimension nstages)I_s- identity matrix (dimension nstages*nstages)
Level: advanced
-seealso: , TSIRK, TSIRKRegister()
External Links
- PETSc Manual:
Ts/TSIRKTableauCreate
PETSc.LibPETSc.TSInitializePackage — Method
TSInitializePackage(petsclib::PetscLibType)This function initializes everything in the TS package. It is called from PetscDLLibraryRegister_petscts() when using dynamic libraries, and on the first call to TSCreate() when using shared or static libraries.
Level: developer
-seealso: , TS, PetscInitialize(), TSFinalizePackage()
External Links
- PETSc Manual:
Ts/TSInitializePackage
PETSc.LibPETSc.TSInterpolate — Method
TSInterpolate(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec)Interpolate the solution computed during the previous step to an arbitrary location in the interval
Collective
Input Parameters:
ts- time stepping contextt- time to interpolate to
Output Parameter:
U- state at given time
Level: intermediate
-seealso: , TS, TSSetExactFinalTime(), TSSolve()
External Links
- PETSc Manual:
Ts/TSInterpolate
PETSc.LibPETSc.TSLoad — Method
TSLoad(petsclib::PetscLibType,ts::TS, viewer::PetscViewer)Loads a TS that has been stored in binary with TSView().
Collective
Input Parameters:
ts- the newly loadedTS, this needs to have been created withTSCreate()or
some related function before a call to TSLoad().
viewer- binary file viewer, obtained fromPetscViewerBinaryOpen()
Level: intermediate
-seealso: , TS, PetscViewer, PetscViewerBinaryOpen(), TSView(), MatLoad(), VecLoad()
External Links
- PETSc Manual:
Ts/TSLoad
PETSc.LibPETSc.TSMPRKFinalizePackage — Method
TSMPRKFinalizePackage(petsclib::PetscLibType)This function destroys everything in the TSMPRK package. It is called from PetscFinalize().
Level: developer
-seealso: , TSMPRK, PetscFinalize()
External Links
- PETSc Manual:
Ts/TSMPRKFinalizePackage
PETSc.LibPETSc.TSMPRKGetType — Method
mprktype::TSMPRKType = TSMPRKGetType(petsclib::PetscLibType,ts::TS)Get the type of TSMPRK scheme
Not Collective
Input Parameter:
ts- timestepping context
Output Parameter:
mprktype- type ofTSMPRKscheme
Level: intermediate
External Links
- PETSc Manual:
Ts/TSMPRKGetType
PETSc.LibPETSc.TSMPRKInitializePackage — Method
TSMPRKInitializePackage(petsclib::PetscLibType)This function initializes everything in the TSMPRK package. It is called from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to TSCreate_MPRK() when using static libraries.
Level: developer
-seealso: , TSMPRK, PetscInitialize()
External Links
- PETSc Manual:
Ts/TSMPRKInitializePackage
PETSc.LibPETSc.TSMPRKRegister — Method
TSMPRKRegister(petsclib::PetscLibType,name::TSMPRKType, order::PetscInt, sbase::PetscInt, ratio1::PetscInt, ratio2::PetscInt, Asb::Vector{PetscReal}, bsb::Vector{PetscReal}, csb::Vector{PetscReal}, rsb::Vector{PetscInt}, Amb::Vector{PetscReal}, bmb::Vector{PetscReal}, cmb::Vector{PetscReal}, rmb::Vector{PetscInt}, Af::Vector{PetscReal}, bf::Vector{PetscReal}, cf::Vector{PetscReal})register a TSMPRK scheme by providing the entries in the Butcher tableau
Not Collective, but the same schemes should be registered on all processes on which they will be used, No Fortran Support
Input Parameters:
name- identifier for methodorder- approximation order of methodsbase- number of stages in the base methodsratio1- stepsize ratio at 1st level (e.g. slow/medium)ratio2- stepsize ratio at 2nd level (e.g. medium/fast)Asb- stage coefficients for slow components(dimension s*s, row-major)bsb- step completion table for slow components(dimension s)csb- abscissa for slow components(dimension s)rsb- array of flags for repeated stages for slow components (dimension s)Amb- stage coefficients for medium components(dimension s*s, row-major)bmb- step completion table for medium components(dimension s)cmb- abscissa for medium components(dimension s)rmb- array of flags for repeated stages for medium components (dimension s)Af- stage coefficients for fast components(dimension s*s, row-major)bf- step completion table for fast components(dimension s)cf- abscissa for fast components(dimension s)
Level: advanced
External Links
- PETSc Manual:
Ts/TSMPRKRegister
PETSc.LibPETSc.TSMPRKRegisterDestroy — Method
TSMPRKRegisterDestroy(petsclib::PetscLibType)Frees the list of schemes that were registered by TSMPRKRegister().
Not Collective
Level: advanced
-seealso: , TSMPRK, TSMPRKRegister(), TSMPRKRegisterAll()
External Links
- PETSc Manual:
Ts/TSMPRKRegisterDestroy
PETSc.LibPETSc.TSMPRKSetType — Method
TSMPRKSetType(petsclib::PetscLibType,ts::TS, mprktype::TSMPRKType)Set the type of TSMPRK scheme
Not Collective
Input Parameters:
ts- timestepping contextmprktype- type ofTSMPRKscheme
Options Database Key:
-ts_mprk_type- <pm2,p2,p3> - select the specific scheme
Level: intermediate
-seealso: , TSMPRKGetType(), TSMPRK, TSMPRKType
External Links
- PETSc Manual:
Ts/TSMPRKSetType
PETSc.LibPETSc.TSMonitor — Method
TSMonitor(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec)Runs all user
Collective
Input Parameters:
ts- time stepping context obtained fromTSCreate()step- step number that has just completedptime- model time of the stateu- state at the current model time
Level: developer
-seealso: TS, TSMonitorSet(), TSMonitorSetFromOptions()
External Links
- PETSc Manual:
Ts/TSMonitor
PETSc.LibPETSc.TSMonitorCancel — Method
TSMonitorCancel(petsclib::PetscLibType,ts::TS)Clears all the monitors that have been set on a time
Logically Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Level: intermediate
-seealso: , TS, TSMonitorDefault(), TSMonitorSet()
External Links
- PETSc Manual:
Ts/TSMonitorCancel
PETSc.LibPETSc.TSMonitorDMDARay — Method
TSMonitorDMDARay(petsclib::PetscLibType,ts::TS, steps::PetscInt, time::PetscReal, u::PetscVec, mctx::Cvoid)External Links
- PETSc Manual:
Ts/TSMonitorDMDARay
PETSc.LibPETSc.TSMonitorDMDARayDestroy — Method
TSMonitorDMDARayDestroy(petsclib::PetscLibType,mctx::Cvoid)External Links
- PETSc Manual:
Ts/TSMonitorDMDARayDestroy
PETSc.LibPETSc.TSMonitorDefault — Method
TSMonitorDefault(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, v::PetscVec, vf::PetscViewerAndFormat)The default monitor, prints the timestep and time for each step
Input Parameters:
ts- theTScontextstep- iteration number (after the final time step the monitor routine may be called with a step of -1, this indicates the solution has been interpolated to this time)ptime- current timev- current iteratevf- the viewer and format
Options Database Key:
-ts_monitor- monitors the time integration
Level: intermediate
-seealso: , TSMonitorSet(), TSDMSwarmMonitorMoments(), TSMonitorWallClockTime(), TSMonitorExtreme(), TSMonitorDrawSolution(), TSMonitorDrawSolutionPhase(), TSMonitorDrawSolutionFunction(), TSMonitorDrawError(), TSMonitorSolution(), TSMonitorSolutionVTK(), TSMonitorLGSolution(), TSMonitorLGError(), TSMonitorSPSwarmSolution(), TSMonitorError(), TSMonitorEnvelope()
External Links
- PETSc Manual:
Ts/TSMonitorDefault
PETSc.LibPETSc.TSMonitorDrawError — Method
TSMonitorDrawError(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, dummy::Cvoid)Monitors progress of the TS solvers by calling VecView() for the error at each timestep
Collective
Input Parameters:
ts- theTScontextstep- current time-stepptime- current timeu- solution at current timedummy- either a viewer orNULL
Options Database Key:
-ts_monitor_draw_error- Monitor error graphically, requires user to have providedTSSetSolutionFunction()
Level: intermediate
-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSSetSolutionFunction()
External Links
- PETSc Manual:
Ts/TSMonitorDrawError
PETSc.LibPETSc.TSMonitorDrawSolution — Method
TSMonitorDrawSolution(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, dummy::Cvoid)Monitors progress of the TS solvers by calling VecView() for the solution at each timestep
Collective
Input Parameters:
ts- theTScontextstep- current time-stepptime- current timeu- the solution at the current timedummy- either a viewer orNULL
Options Database Keys:
-ts_monitor_draw_solution- draw the solution at each time-step-ts_monitor_draw_solution_initial- show initial solution as well as current solution
Level: intermediate
-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorDrawCtxCreate(), TSMonitorDrawCtxDestroy()
External Links
- PETSc Manual:
Ts/TSMonitorDrawSolution
PETSc.LibPETSc.TSMonitorDrawSolutionFunction — Method
TSMonitorDrawSolutionFunction(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, dummy::Cvoid)Monitors progress of the TS solvers by calling VecView() for the solution provided by TSSetSolutionFunction() at each timestep
Collective
Input Parameters:
ts- theTScontextstep- current time-stepptime- current timeu- solution at current timedummy- either a viewer orNULL
Options Database Key:
-ts_monitor_draw_solution_function- Monitor error graphically, requires user to have providedTSSetSolutionFunction()
Level: intermediate
-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSSetSolutionFunction()
External Links
- PETSc Manual:
Ts/TSMonitorDrawSolutionFunction
PETSc.LibPETSc.TSMonitorDrawSolutionPhase — Method
TSMonitorDrawSolutionPhase(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, dummy::Cvoid)Monitors progress of the TS solvers by plotting the solution as a phase diagram
Collective
Input Parameters:
ts- theTScontextstep- current time-stepptime- current timeu- the solution at the current timedummy- either a viewer orNULL
Level: intermediate
-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), VecView()
External Links
- PETSc Manual:
Ts/TSMonitorDrawSolutionPhase
PETSc.LibPETSc.TSMonitorEnvelope — Method
TSMonitorEnvelope(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, dctx::Cvoid)Monitors the maximum and minimum value of each component of the solution
Collective
Input Parameters:
ts- theTScontextstep- current time-stepptime- current timeu- current solutiondctx- the envelope context
Options Database Key:
-ts_monitor_envelope- determine maximum and minimum value of each component of the solution over the solution time
Level: intermediate
-seealso: , TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorEnvelopeGetBounds(), TSMonitorEnvelopeCtxCreate()
External Links
- PETSc Manual:
Ts/TSMonitorEnvelope
PETSc.LibPETSc.TSMonitorEnvelopeGetBounds — Method
TSMonitorEnvelopeGetBounds(petsclib::PetscLibType,ts::TS, max::PetscVec, min::PetscVec)Gets the bounds for the components of the solution
Collective
Input Parameter:
ts- theTScontext
Output Parameters:
max- the maximum valuesmin- the minimum values
Level: intermediate
-seealso: , TSMonitorEnvelopeCtx, TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorLGSetDisplayVariables()
External Links
- PETSc Manual:
Ts/TSMonitorEnvelopeGetBounds
PETSc.LibPETSc.TSMonitorError — Method
TSMonitorError(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, vf::PetscViewerAndFormat)Monitors progress of the TS solvers by printing the 2 norm of the error at each timestep
Collective
Input Parameters:
ts- theTScontextstep- current time-stepptime- current timeu- current solutionvf- unused context
Options Database Key:
-ts_monitor_error- create a graphical monitor of error history
Level: intermediate
-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSSetSolutionFunction()
External Links
- PETSc Manual:
Ts/TSMonitorError
PETSc.LibPETSc.TSMonitorExtreme — Method
TSMonitorExtreme(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, v::PetscVec, vf::PetscViewerAndFormat)Prints the extreme values of the solution at each timestep
Input Parameters:
ts- theTScontextstep- iteration number (after the final time step the monitor routine may be called with a step of -1, this indicates the solution has been interpolated to this time)ptime- current timev- current iteratevf- the viewer and format
Level: intermediate
-seealso: , TS, TSMonitorSet()
External Links
- PETSc Manual:
Ts/TSMonitorExtreme
PETSc.LibPETSc.TSMonitorHGSwarmSolution — Method
TSMonitorHGSwarmSolution(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, dctx::Cvoid)Graphically displays histograms of DMSWARM particles
Input Parameters:
ts- theTScontextstep- current time-stepptime- current timeu- current solutiondctx- theTSMonitorSPCtxobject that contains all the options for the monitoring, this is created withTSMonitorHGCtxCreate()
Options Database Keys:
-ts_monitor_hg_swarm <n>- Monitor the solution every n steps, or -1 for plotting only the final solution-ts_monitor_hg_swarm_species <num>- Number of species to histogram-ts_monitor_hg_swarm_bins <num>- Number of histogram bins-ts_monitor_hg_swarm_velocity <bool>- Plot in velocity space, as opposed to coordinate space
Level: intermediate
-seealso: TSMonitorSet()
External Links
- PETSc Manual:
Ts/TSMonitorHGSwarmSolution
PETSc.LibPETSc.TSMonitorLGDMDARay — Method
TSMonitorLGDMDARay(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, ctx::Cvoid)External Links
- PETSc Manual:
Ts/TSMonitorLGDMDARay
PETSc.LibPETSc.TSMonitorLGError — Method
TSMonitorLGError(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, dummy::Cvoid)Monitors progress of the TS solvers by plotting each component of the error in a time based line graph
Collective
Input Parameters:
ts- theTScontextstep- current time-stepptime- current timeu- current solutiondummy-TSMonitorLGCtxobject created withTSMonitorLGCtxCreate()
Options Database Key:
-ts_monitor_lg_error- create a graphical monitor of error history
Level: intermediate
-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSSetSolutionFunction()
External Links
- PETSc Manual:
Ts/TSMonitorLGError
PETSc.LibPETSc.TSMonitorLGGetVariableNames — Method
TSMonitorLGGetVariableNames(petsclib::PetscLibType,ts::TS, names::Cchar)Gets the name of each component in the solution vector so that it may be displayed in the plot
Collective
Input Parameter:
ts- theTScontext
Output Parameter:
names- the names of the components, final string must beNULL
Level: intermediate
-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorLGSetDisplayVariables()
External Links
- PETSc Manual:
Ts/TSMonitorLGGetVariableNames
PETSc.LibPETSc.TSMonitorLGKSPIterations — Method
TSMonitorLGKSPIterations(petsclib::PetscLibType,ts::TS, n::PetscInt, ptime::PetscReal, v::PetscVec, monctx::Cvoid)External Links
- PETSc Manual:
Ts/TSMonitorLGKSPIterations
PETSc.LibPETSc.TSMonitorLGSNESIterations — Method
TSMonitorLGSNESIterations(petsclib::PetscLibType,ts::TS, n::PetscInt, ptime::PetscReal, v::PetscVec, monctx::Cvoid)External Links
- PETSc Manual:
Ts/TSMonitorLGSNESIterations
PETSc.LibPETSc.TSMonitorLGSetDisplayVariables — Method
TSMonitorLGSetDisplayVariables(petsclib::PetscLibType,ts::TS, displaynames::Cchar)Sets the variables that are to be display in the monitor
Collective
Input Parameters:
ts- theTScontextdisplaynames- the names of the components, final string must beNULL
Level: intermediate
-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorLGSetVariableNames()
External Links
- PETSc Manual:
Ts/TSMonitorLGSetDisplayVariables
PETSc.LibPETSc.TSMonitorLGSetTransform — Method
TSMonitorLGSetTransform(petsclib::PetscLibType,ts::TS, transform::external, destroy::PetscCtxDestroyFn, tctx::Cvoid)Solution vector will be transformed by provided function before being displayed
Collective
Input Parameters:
ts- theTScontexttransform- the transform functiondestroy- function to destroy the optional context, seePetscCtxDestroyFnfor its calling sequencetctx- optional context used by transform function
Level: intermediate
-seealso: , TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorLGSetVariableNames(), TSMonitorLGCtxSetTransform(), PetscCtxDestroyFn
External Links
- PETSc Manual:
Ts/TSMonitorLGSetTransform
PETSc.LibPETSc.TSMonitorLGSetVariableNames — Method
TSMonitorLGSetVariableNames(petsclib::PetscLibType,ts::TS, names::Cchar)Sets the name of each component in the solution vector so that it may be displayed in the plot
Collective
Input Parameters:
ts- theTScontextnames- the names of the components, final string must beNULL
Level: intermediate
-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorLGSetDisplayVariables(), TSMonitorLGCtxSetVariableNames()
External Links
- PETSc Manual:
Ts/TSMonitorLGSetVariableNames
PETSc.LibPETSc.TSMonitorLGSolution — Method
TSMonitorLGSolution(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, dctx::Cvoid)Monitors progress of the TS solvers by plotting each component of the solution vector in a time based line graph
Collective
Input Parameters:
ts- theTScontextstep- current time-stepptime- current timeu- current solutiondctx- theTSMonitorLGCtxobject that contains all the options for the monitoring, this is created withTSMonitorLGCtxCreate()
Options Database Key:
-ts_monitor_lg_solution_variables- enable monitor of lg solution variables
Level: intermediate
-seealso: , TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorLGCtxCreate(), TSMonitorLGCtxSetVariableNames(), TSMonitorLGCtxGetVariableNames(), TSMonitorLGSetVariableNames(), TSMonitorLGGetVariableNames(), TSMonitorLGSetDisplayVariables(), TSMonitorLGCtxSetDisplayVariables(), TSMonitorLGCtxSetTransform(), TSMonitorLGSetTransform(), TSMonitorLGError(), TSMonitorLGSNESIterations(), TSMonitorLGKSPIterations(), TSMonitorEnvelopeCtxCreate(), TSMonitorEnvelopeGetBounds(), TSMonitorEnvelopeCtxDestroy(), TSMonitorEnvelop()
External Links
- PETSc Manual:
Ts/TSMonitorLGSolution
PETSc.LibPETSc.TSMonitorLGTimeStep — Method
TSMonitorLGTimeStep(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, v::PetscVec, monctx::Cvoid)Monitors a TS by printing the time
Collective
Input Parameters:
ts- the time integratorstep- the current time stepptime- the current timev- the current statemonctx- the monitor context obtained withTSMonitorLGCtxCreate()
Level: advanced
-seealso: , TS, TSMonitorLGCtxCreate(), TSMonitorSet(), TSMonitorLGCtxDestroy()
External Links
- PETSc Manual:
Ts/TSMonitorLGTimeStep
PETSc.LibPETSc.TSMonitorSPEig — Method
TSMonitorSPEig(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, v::PetscVec, monctx::Cvoid)External Links
- PETSc Manual:
Ts/TSMonitorSPEig
PETSc.LibPETSc.TSMonitorSPSwarmSolution — Method
TSMonitorSPSwarmSolution(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, dctx::Cvoid)Graphically displays phase plots of DMSWARM particles on a scatter plot
Input Parameters:
ts- theTScontextstep- current time-stepptime- current timeu- current solutiondctx- theTSMonitorSPCtxobject that contains all the options for the monitoring, this is created withTSMonitorSPCtxCreate()
Options Database Keys:
-ts_monitor_sp_swarm <n>- Monitor the solution every n steps, or -1 for plotting only the final solution-ts_monitor_sp_swarm_retain <n>- Retain n old points so we can see the history, or -1 for all points-ts_monitor_sp_swarm_multi_species <bool>- Color each species differently-ts_monitor_sp_swarm_phase <bool>- Plot in phase space, as opposed to coordinate space
Level: intermediate
-seealso: , TS, TSMonitorSet(), DMSWARM, TSMonitorSPCtxCreate()
External Links
- PETSc Manual:
Ts/TSMonitorSPSwarmSolution
PETSc.LibPETSc.TSMonitorSet — Method
TSMonitorSet(petsclib::PetscLibType,ts::TS, monitor::external, mctx::Cvoid, mdestroy::PetscCtxDestroyFn)Sets an ADDITIONAL function that is to be used at every timestep to display the iteration's progress.
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()monitor- monitoring routinemctx- [optional] user-defined context for private data for the monitor routine (useNULLif no context is desired)mdestroy- [optional] routine that frees monitor context (may beNULL), seePetscCtxDestroyFnfor the calling sequence
Calling sequence of monitor:
ts- theTScontextsteps- iteration number (after the final time step the monitor routine may be called with a step of -1, this indicates the solution has been interpolated to this time)time- current timeu- current iteratectx- [optional] monitoring context
Level: intermediate
-seealso: , TSMonitorDefault(), TSMonitorCancel(), TSDMSwarmMonitorMoments(), TSMonitorExtreme(), TSMonitorDrawSolution(), TSMonitorDrawSolutionPhase(), TSMonitorDrawSolutionFunction(), TSMonitorDrawError(), TSMonitorSolution(), TSMonitorSolutionVTK(), TSMonitorLGSolution(), TSMonitorLGError(), TSMonitorSPSwarmSolution(), TSMonitorError(), TSMonitorEnvelope(), PetscCtxDestroyFn
External Links
- PETSc Manual:
Ts/TSMonitorSet
PETSc.LibPETSc.TSMonitorSetFromOptions — Method
TSMonitorSetFromOptions(petsclib::PetscLibType,ts::TS, name::String, help::String, manual::String, monitor::external, monitorsetup::external)Sets a monitor function and viewer appropriate for the type indicated by the user
Collective
Input Parameters:
ts-TSobject you wish to monitorname- the monitor type one is seekinghelp- message indicating what monitoring is donemanual- manual page for the monitormonitor- the monitor function, this must use aPetscViewerFormatas its contextmonitorsetup- a function that is called once ONLY if the user selected this monitor that may set additional features of theTSorPetscViewerobjects
Level: developer
-seealso: , TS, TSMonitorSet(), PetscOptionsCreateViewer(), PetscOptionsGetReal(), PetscOptionsHasName(), PetscOptionsGetString(), PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsBool() PetscOptionsInt(), PetscOptionsString(), PetscOptionsReal(), PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHeadBegin(), PetscOptionsStringArray(), PetscOptionsRealArray(), PetscOptionsScalar(), PetscOptionsBoolGroupBegin(), PetscOptionsBoolGroup(), PetscOptionsBoolGroupEnd(), PetscOptionsFList(), PetscOptionsEList()
External Links
- PETSc Manual:
Ts/TSMonitorSetFromOptions
PETSc.LibPETSc.TSMonitorSolution — Method
TSMonitorSolution(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, vf::PetscViewerAndFormat)Monitors progress of the TS solvers by VecView() for the solution at each timestep. Normally the viewer is a binary file or a PetscDraw object
Collective
Input Parameters:
ts- theTScontextstep- current time-stepptime- current timeu- current statevf- viewer and its format
Level: intermediate
-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorSolutionSetup(),
External Links
- PETSc Manual:
Ts/TSMonitorSolution
PETSc.LibPETSc.TSMonitorSolutionSetup — Method
TSMonitorSolutionSetup(petsclib::PetscLibType,ts::TS, vf::PetscViewerAndFormat)Setups the context for TSMonitorSolution()
Collective
Input Parameters:
ts- theTScontextvf- viewer and its format
Level: intermediate
-seealso: , TS, TSMonitorSolution(), TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorSetFromOptions()
External Links
- PETSc Manual:
Ts/TSMonitorSolutionSetup
PETSc.LibPETSc.TSMonitorSolutionVTK — Method
TSMonitorSolutionVTK(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, ctx::TSMonitorVTKCtx)Monitors progress of the TS solvers by VecView() for the solution at selected timesteps.
Collective
Input Parameters:
ts- theTScontextstep- current time-stepptime- current timeu- current statectx- monitor context obtained withTSMonitorSolutionVTKCtxCreate()
Level: developer
-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), VecView()
External Links
- PETSc Manual:
Ts/TSMonitorSolutionVTK
PETSc.LibPETSc.TSMonitorSolutionVTKCtxCreate — Method
ctx::TSMonitorVTKCtx = TSMonitorSolutionVTKCtxCreate(petsclib::PetscLibType,filenametemplate::String)Create the monitor context to be used in TSMonitorSolutionVTK()
Not collective
Input Parameter:
filenametemplate- the template file name, e.g. foo-%03d.vts
Output Parameter:
ctx- the monitor context
Level: developer
-seealso: , TSMonitorSet(), TSMonitorSolutionVTK(), TSMonitorSolutionVTKDestroy()
External Links
- PETSc Manual:
Ts/TSMonitorSolutionVTKCtxCreate
PETSc.LibPETSc.TSMonitorSolutionVTKDestroy — Method
TSMonitorSolutionVTKDestroy(petsclib::PetscLibType,ctx::TSMonitorVTKCtx)Destroy the monitor context created with TSMonitorSolutionVTKCtxCreate()
Not Collective
Input Parameter:
ctx- the monitor context
Level: developer
-seealso: , TSMonitorSet(), TSMonitorSolutionVTK()
External Links
- PETSc Manual:
Ts/TSMonitorSolutionVTKDestroy
PETSc.LibPETSc.TSMonitorWallClockTime — Method
TSMonitorWallClockTime(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, v::PetscVec, vf::PetscViewerAndFormat)Monitor wall
Input Parameters:
ts- theTScontextstep- iteration number (after the final time step the monitor routine may be called with a step of -1, this indicates the solution has been interpolated to this time)ptime- current timev- current solutionvf- the viewer and format
Options Database Key:
-ts_monitor_wall_clock_time- Monitor wall-clock time, KSP iterations, and SNES iterations per step.
Level: intermediate
-seealso: , TSMonitorSet(), TSMonitorDefault(), TSMonitorExtreme(), TSMonitorDrawSolution(), TSMonitorDrawSolutionPhase(), TSMonitorDrawSolutionFunction(), TSMonitorDrawError(), TSMonitorSolution(), TSMonitorSolutionVTK(), TSMonitorLGSolution(), TSMonitorLGError(), TSMonitorSPSwarmSolution(), TSMonitorError(), TSMonitorEnvelope(), TSDMSwarmMonitorMoments()
External Links
- PETSc Manual:
Ts/TSMonitorWallClockTime
PETSc.LibPETSc.TSMonitorWallClockTimeSetUp — Method
TSMonitorWallClockTimeSetUp(petsclib::PetscLibType,ts::TS, vf::PetscViewerAndFormat)Setup routine passed to TSMonitorSetFromOptions() when using `
Input Parameters:
ts- theTScontextvf- the viewer and format
Level: intermediate
External Links
- PETSc Manual:
Ts/TSMonitorWallClockTimeSetUp
PETSc.LibPETSc.TSPostEvaluate — Method
TSPostEvaluate(petsclib::PetscLibType,ts::TS)Runs the user
Collective
Input Parameter:
ts- TheTScontext obtained fromTSCreate()
Level: developer
-seealso: , TS, TSSetPostEvaluate(), TSSetPreStep(), TSPreStep(), TSPostStep()
External Links
- PETSc Manual:
Ts/TSPostEvaluate
PETSc.LibPETSc.TSPostStage — Method
TSPostStage(petsclib::PetscLibType,ts::TS, stagetime::PetscReal, stageindex::PetscInt, Y::Vector{PetscVec})Runs the user
Collective
Input Parameters:
ts- TheTScontext obtained fromTSCreate()stagetime- The absolute time of the current stagestageindex- Stage numberY- Array of vectors (of size = total number of stages) with the stage solutions
Level: developer
-seealso: , TS, TSPreStage(), TSSetPreStep(), TSPreStep(), TSPostStep()
External Links
- PETSc Manual:
Ts/TSPostStage
PETSc.LibPETSc.TSPostStep — Method
TSPostStep(petsclib::PetscLibType,ts::TS)Runs the user
Collective
Input Parameter:
ts- TheTScontext obtained fromTSCreate()
-seealso: , TS, TSSetPreStep(), TSSetPreStage(), TSSetPostEvaluate(), TSGetTimeStep(), TSGetStepNumber(), TSGetTime(), TSSetPostStep()
External Links
- PETSc Manual:
Ts/TSPostStep
PETSc.LibPETSc.TSPreStage — Method
TSPreStage(petsclib::PetscLibType,ts::TS, stagetime::PetscReal)Runs the user
Collective
Input Parameters:
ts- TheTScontext obtained fromTSCreate()stagetime- The absolute time of the current stage
Level: developer
-seealso: , TS, TSPostStage(), TSSetPreStep(), TSPreStep(), TSPostStep()
External Links
- PETSc Manual:
Ts/TSPreStage
PETSc.LibPETSc.TSPreStep — Method
TSPreStep(petsclib::PetscLibType,ts::TS)Runs the user
Collective
Input Parameter:
ts- TheTScontext obtained fromTSCreate()
Level: developer
-seealso: , TS, TSSetPreStep(), TSPreStage(), TSPostStage(), TSPostStep()
External Links
- PETSc Manual:
Ts/TSPreStep
PETSc.LibPETSc.TSPruneIJacobianColor — Method
TSPruneIJacobianColor(petsclib::PetscLibType,ts::TS, J::PetscMat, B::PetscMat)Remove nondiagonal zeros in the Jacobian matrix and update the MatMFFD coloring information.
Collective
Input Parameters:
ts- theTScontextJ- Jacobian matrix (not altered in this routine)B- newly computed Jacobian matrix to use with preconditioner
Level: intermediate
-seealso: , TS, MatFDColoring, TSComputeIJacobianDefaultColor(), MatEliminateZeros(), MatFDColoringCreate(), MatFDColoringSetFunction()
External Links
- PETSc Manual:
Ts/TSPruneIJacobianColor
PETSc.LibPETSc.TSPseudoComputeTimeStep — Method
dt::PetscReal = TSPseudoComputeTimeStep(petsclib::PetscLibType,ts::TS)Computes the next timestep for a currently running pseudo-timestepping process.
Collective
Input Parameter:
ts- timestep context
Output Parameter:
dt- newly computed timestep
Level: developer
-seealso: , TSPSEUDO, TSPseudoTimeStepDefault(), TSPseudoSetTimeStep()
External Links
- PETSc Manual:
Ts/TSPseudoComputeTimeStep
PETSc.LibPETSc.TSPseudoIncrementDtFromInitialDt — Method
TSPseudoIncrementDtFromInitialDt(petsclib::PetscLibType,ts::TS)Indicates that a new timestep is computed via the formula dt = initialdt*initialfnorm/currentfnorm rather than the default update, dt = currentdt*previousfnorm/currentfnorm.
Logically Collective
Input Parameter:
ts- the timestep context
Options Database Key:
-ts_pseudo_increment_dt_from_initial_dt <true,false>- use the initial dt to determine increment
Level: advanced
-seealso: , TSPSEUDO, TSPseudoSetTimeStep(), TSPseudoTimeStepDefault()
External Links
- PETSc Manual:
Ts/TSPseudoIncrementDtFromInitialDt
PETSc.LibPETSc.TSPseudoSetMaxTimeStep — Method
TSPseudoSetMaxTimeStep(petsclib::PetscLibType,ts::TS, maxdt::PetscReal)Sets the maximum time step when using the TSPseudoTimeStepDefault() routine.
Logically Collective
Input Parameters:
ts- the timestep contextmaxdt- the maximum time step, use a non-positive value to deactivate
Options Database Key:
-ts_pseudo_max_dt <increment>- set pseudo max dt
Level: advanced
-seealso: , TSPSEUDO, TSPseudoSetTimeStep(), TSPseudoTimeStepDefault()
External Links
- PETSc Manual:
Ts/TSPseudoSetMaxTimeStep
PETSc.LibPETSc.TSPseudoSetTimeStep — Method
TSPseudoSetTimeStep(petsclib::PetscLibType,ts::TS, dt::external, ctx::Cvoid)Sets the user called at each pseudo-timestep to update the timestep.
Logically Collective
Input Parameters:
ts- timestep contextdt- function to compute timestepctx- [optional] user-defined context for private data required by the function (may beNULL)
Calling sequence of dt:
ts- theTScontextnewdt- the newly computed timestepctx- [optional] user-defined context
Level: intermediate
-seealso: , TSPSEUDO, TSPseudoTimeStepDefault(), TSPseudoComputeTimeStep()
External Links
- PETSc Manual:
Ts/TSPseudoSetTimeStep
PETSc.LibPETSc.TSPseudoSetTimeStepIncrement — Method
TSPseudoSetTimeStepIncrement(petsclib::PetscLibType,ts::TS, inc::PetscReal)Sets the scaling increment applied to dt when using the TSPseudoTimeStepDefault() routine.
Logically Collective
Input Parameters:
ts- the timestep contextinc- the scaling factor >= 1.0
Options Database Key:
-ts_pseudo_increment <increment>- set pseudo increment
Level: advanced
-seealso: , TSPSEUDO, TSPseudoSetTimeStep(), TSPseudoTimeStepDefault()
External Links
- PETSc Manual:
Ts/TSPseudoSetTimeStepIncrement
PETSc.LibPETSc.TSPseudoSetVerifyTimeStep — Method
TSPseudoSetVerifyTimeStep(petsclib::PetscLibType,ts::TS, dt::external, ctx::Cvoid)Sets a user last timestep.
Logically Collective
Input Parameters:
ts- timestep contextdt- user-defined function to verify timestepctx- [optional] user-defined context for private data for the timestep verification routine (may beNULL)
Calling sequence of func:
ts- the time-step contextupdate- latest solution vectorctx- [optional] user-defined timestep contextnewdt- the timestep to use for the next stepflag- flag indicating whether the last time step was acceptable
Level: advanced
-seealso: , TSPSEUDO, TSPseudoVerifyTimeStepDefault(), TSPseudoVerifyTimeStep()
External Links
- PETSc Manual:
Ts/TSPseudoSetVerifyTimeStep
PETSc.LibPETSc.TSPseudoTimeStepDefault — Method
newdt::PetscReal = TSPseudoTimeStepDefault(petsclib::PetscLibType,ts::TS, dtctx::Cvoid)Default code to compute pseudo
Collective, No Fortran Support
Input Parameters:
ts- the timestep contextdtctx- unused timestep context
Output Parameter:
newdt- the timestep to use for the next step
Level: advanced
-seealso: , TSPseudoSetTimeStep(), TSPseudoComputeTimeStep(), TSPSEUDO
External Links
- PETSc Manual:
Ts/TSPseudoTimeStepDefault
PETSc.LibPETSc.TSPseudoVerifyTimeStep — Method
dt::PetscReal,flag::PetscBool = TSPseudoVerifyTimeStep(petsclib::PetscLibType,ts::TS, update::PetscVec)Verifies whether the last timestep was acceptable.
Collective
Input Parameters:
ts- timestep contextupdate- latest solution vector
Output Parameters:
dt- newly computed timestep (if it had to shrink)flag- indicates if current timestep was ok
Level: advanced
-seealso: , TSPSEUDO, TSPseudoSetVerifyTimeStep(), TSPseudoVerifyTimeStepDefault()
External Links
- PETSc Manual:
Ts/TSPseudoVerifyTimeStep
PETSc.LibPETSc.TSPseudoVerifyTimeStepDefault — Method
newdt::PetscReal,flag::PetscBool = TSPseudoVerifyTimeStepDefault(petsclib::PetscLibType,ts::TS, update::PetscVec, dtctx::Cvoid)Default code to verify the quality of the last timestep.
Collective, No Fortran Support
Input Parameters:
ts- the timestep contextdtctx- unused timestep contextupdate- latest solution vector
Output Parameters:
newdt- the timestep to use for the next stepflag- flag indicating whether the last time step was acceptable
Level: advanced
-seealso: , TSPSEUDO, TSPseudoSetVerifyTimeStep(), TSPseudoVerifyTimeStep()
External Links
- PETSc Manual:
Ts/TSPseudoVerifyTimeStepDefault
PETSc.LibPETSc.TSPythonGetType — Method
pyname::String = TSPythonGetType(petsclib::PetscLibType,ts::TS)Get the type of a TS object implemented in Python.
Not Collective
Input Parameter:
ts- theTScontext
Output Parameter:
pyname- full dotted Python name [package].module[.{class|function}]
Level: intermediate
-seealso: , TSCreate(), TSSetType(), TSPYTHON, PetscPythonInitialize(), TSPythonSetType()
External Links
- PETSc Manual:
Ts/TSPythonGetType
PETSc.LibPETSc.TSPythonSetType — Method
TSPythonSetType(petsclib::PetscLibType,ts::TS, pyname::String)Initialize a TS object implemented in Python.
Collective
Input Parameters:
ts- theTScontextpyname- full dotted Python name [package].module[.{class|function}]
Options Database Key:
-ts_python_type <pyname>- python class
Level: intermediate
-seealso: , TSCreate(), TSSetType(), TSPYTHON, PetscPythonInitialize()
External Links
- PETSc Manual:
Ts/TSPythonSetType
PETSc.LibPETSc.TSRHSJacobianSetReuse — Method
TSRHSJacobianSetReuse(petsclib::PetscLibType,ts::TS, reuse::PetscBool)restore the RHS Jacobian before calling the user
Logically Collective
Input Parameters:
ts-TScontext obtained fromTSCreate()reuse-PETSC_TRUEif the RHS Jacobian
Level: intermediate
-seealso: , TS, TSSetRHSJacobian(), TSComputeRHSJacobianConstant()
External Links
- PETSc Manual:
Ts/TSRHSJacobianSetReuse
PETSc.LibPETSc.TSRHSJacobianTest — Method
flg::PetscBool = TSRHSJacobianTest(petsclib::PetscLibType,ts::TS)Compares the multiply routine provided to the MATSHELL with differencing on the TS given RHS function.
Logically Collective
Input Parameter:
ts- the time stepping routine
Output Parameter:
flg-PETSC_TRUEif the multiply is likely correct
Options Database Key:
-ts_rhs_jacobian_test_mult -mat_shell_test_mult_view- run the test at each timestep of the integrator
Level: advanced
-seealso: , TS, Mat, MATSHELL, MatCreateShell(), MatShellGetContext(), MatShellGetOperation(), MatShellTestMultTranspose(), TSRHSJacobianTestTranspose()
External Links
- PETSc Manual:
Ts/TSRHSJacobianTest
PETSc.LibPETSc.TSRHSJacobianTestTranspose — Method
flg::PetscBool = TSRHSJacobianTestTranspose(petsclib::PetscLibType,ts::TS)Compares the multiply transpose routine provided to the MATSHELL with differencing on the TS given RHS function.
Logically Collective
Input Parameter:
ts- the time stepping routine
Output Parameter:
flg-PETSC_TRUEif the multiply is likely correct
Options Database Key:
-ts_rhs_jacobian_test_mult_transpose -mat_shell_test_mult_transpose_view- run the test at each timestep of the integrator
Level: advanced
-seealso: , TS, Mat, MatCreateShell(), MatShellGetContext(), MatShellGetOperation(), MatShellTestMultTranspose(), TSRHSJacobianTest()
External Links
- PETSc Manual:
Ts/TSRHSJacobianTestTranspose
PETSc.LibPETSc.TSRHSSplitGetIS — Method
TSRHSSplitGetIS(petsclib::PetscLibType,ts::TS, splitname::String, is::IS)Retrieves the elements for a split as an IS
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()splitname- name of this split
Output Parameter:
is- the index set for part of the solution vector
Level: intermediate
-seealso: , TS, IS, TSRHSSplitSetIS()
External Links
- PETSc Manual:
Ts/TSRHSSplitGetIS
PETSc.LibPETSc.TSRHSSplitGetSNES — Method
TSRHSSplitGetSNES(petsclib::PetscLibType,ts::TS, snes::PetscSNES)Returns the SNES (nonlinear solver) associated with a TS (timestepper) context when RHS splits are used.
Not Collective, but snes is parallel if ts is parallel
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Output Parameter:
snes- the nonlinear solver context
Level: intermediate
-seealso: , TS, SNES, TSCreate(), TSRHSSplitSetSNES()
External Links
- PETSc Manual:
Ts/TSRHSSplitGetSNES
PETSc.LibPETSc.TSRHSSplitGetSubTS — Method
TSRHSSplitGetSubTS(petsclib::PetscLibType,ts::TS, splitname::String, subts::TS)Get the sub
Logically Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Output Parameters:
splitname- the number of the splitsubts- the sub-TS
Level: advanced
-seealso: , TS, IS, TSGetRHSSplitFunction()
External Links
- PETSc Manual:
Ts/TSRHSSplitGetSubTS
PETSc.LibPETSc.TSRHSSplitGetSubTSs — Method
n::PetscInt = TSRHSSplitGetSubTSs(petsclib::PetscLibType,ts::TS, subts::Vector{TS})Get an array of all sub
Logically Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Output Parameters:
n- the number of splitssubts- the array ofTScontexts
Level: advanced
-seealso: , TS, IS, TSGetRHSSplitFunction()
External Links
- PETSc Manual:
Ts/TSRHSSplitGetSubTSs
PETSc.LibPETSc.TSRHSSplitSetIFunction — Method
TSRHSSplitSetIFunction(petsclib::PetscLibType,ts::TS, splitname::String, r::PetscVec, ifunc::TSIFunctionFn, ctx::Cvoid)Set the split implicit function for TSARKIMEX
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()splitname- name of this splitr- vector to hold the residual (orNULLto have it created internally)ifunc- the implicit function evaluation routinectx- user-defined context for private data for the split function evaluation routine (may beNULL)
Level: intermediate
-seealso: , TS, TSIFunctionFn, IS, TSRHSSplitSetIS(), TSARKIMEX
External Links
- PETSc Manual:
Ts/TSRHSSplitSetIFunction
PETSc.LibPETSc.TSRHSSplitSetIJacobian — Method
TSRHSSplitSetIJacobian(petsclib::PetscLibType,ts::TS, splitname::String, Amat::PetscMat, Pmat::PetscMat, ijac::TSIJacobianFn, ctx::Cvoid)Set the Jacobian for the split implicit function with TSARKIMEX
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()splitname- name of this splitAmat- (approximate) matrix to store Jacobian entries computed byfPmat- matrix used to compute preconditioner (usually the same asAmat)ijac- the Jacobian evaluation routinectx- user-defined context for private data for the split function evaluation routine (may beNULL)
Level: intermediate
-seealso: , TS, TSRHSSplitSetIFunction, TSIJacobianFn, IS, TSRHSSplitSetIS()
External Links
- PETSc Manual:
Ts/TSRHSSplitSetIJacobian
PETSc.LibPETSc.TSRHSSplitSetIS — Method
TSRHSSplitSetIS(petsclib::PetscLibType,ts::TS, splitname::String, is::IS)Set the index set for the specified split
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()splitname- name of this split, ifNULLthe number of the split is usedis- the index set for part of the solution vector
Level: intermediate
-seealso: , TS, IS, TSRHSSplitGetIS()
External Links
- PETSc Manual:
Ts/TSRHSSplitSetIS
PETSc.LibPETSc.TSRHSSplitSetRHSFunction — Method
TSRHSSplitSetRHSFunction(petsclib::PetscLibType,ts::TS, splitname::String, r::PetscVec, rhsfunc::TSRHSFunctionFn, ctx::Cvoid)Set the split right
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()splitname- name of this splitr- vector to hold the residual (orNULLto have it created internally)rhsfunc- the RHS function evaluation routinectx- user-defined context for private data for the split function evaluation routine (may beNULL)
Level: intermediate
-seealso: , TS, TSRHSFunctionFn, IS, TSRHSSplitSetIS()
External Links
- PETSc Manual:
Ts/TSRHSSplitSetRHSFunction
PETSc.LibPETSc.TSRHSSplitSetSNES — Method
TSRHSSplitSetSNES(petsclib::PetscLibType,ts::TS, snes::PetscSNES)Set the SNES (nonlinear solver) to be used by the timestepping context when RHS splits are used.
Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()snes- the nonlinear solver context
Level: intermediate
-seealso: , TS, SNES, TSCreate(), TSRHSSplitGetSNES()
External Links
- PETSc Manual:
Ts/TSRHSSplitSetSNES
PETSc.LibPETSc.TSRKFinalizePackage — Method
TSRKFinalizePackage(petsclib::PetscLibType)This function destroys everything in the TSRK package. It is called from PetscFinalize().
Level: developer
-seealso: , PetscFinalize(), TSRKInitializePackage()
External Links
- PETSc Manual:
Ts/TSRKFinalizePackage
PETSc.LibPETSc.TSRKGetMultirate — Method
use_multirate::PetscBool = TSRKGetMultirate(petsclib::PetscLibType,ts::TS)Gets whether to use the interpolation
Not Collective
Input Parameter:
ts- timestepping context
Output Parameter:
use_multirate-PETSC_TRUEif the multirate RK method is enabled,PETSC_FALSEotherwise
Level: intermediate
-seealso: , TSRK, TSRKSetMultirate()
External Links
- PETSc Manual:
Ts/TSRKGetMultirate
PETSc.LibPETSc.TSRKGetOrder — Method
order::PetscInt = TSRKGetOrder(petsclib::PetscLibType,ts::TS)Get the order of the TSRK scheme
Not Collective
Input Parameter:
ts- timestepping context
Output Parameter:
order- order ofTSRKscheme
Level: intermediate
-seealso: , TSRK, TSRKGetType()
External Links
- PETSc Manual:
Ts/TSRKGetOrder
PETSc.LibPETSc.TSRKGetTableau — Method
s::PetscInt,A::PetscReal,b::PetscReal,c::PetscReal,bembed::PetscReal,p::PetscInt,binterp::PetscReal,FSAL::PetscBool = TSRKGetTableau(petsclib::PetscLibType,ts::TS)Get info on the TSRK tableau
Not Collective
Input Parameter:
ts- timestepping context
Output Parameters:
s- number of stages, this is the dimension of the matrices belowA- stage coefficients (dimension s*s, row-major)b- step completion table (dimension s)c- abscissa (dimension s)bembed- completion table for embedded method (dimension s; NULL if not available)p- Order of the interpolation scheme, equal to the number of columns of binterpbinterp- Coefficients of the interpolation formula (dimension s*p)FSAL- whether or not the scheme has the First Same As Last property
Level: developer
-seealso: , TSRK, TSRKRegister(), TSRKSetType()
External Links
- PETSc Manual:
Ts/TSRKGetTableau
PETSc.LibPETSc.TSRKGetType — Method
rktype::TSRKType = TSRKGetType(petsclib::PetscLibType,ts::TS)Get the type of TSRK scheme
Not Collective
Input Parameter:
ts- timestepping context
Output Parameter:
rktype- type ofTSRK-scheme
Level: intermediate
External Links
- PETSc Manual:
Ts/TSRKGetType
PETSc.LibPETSc.TSRKInitializePackage — Method
TSRKInitializePackage(petsclib::PetscLibType)This function initializes everything in the TSRK package. It is called from TSInitializePackage().
Level: developer
-seealso: , TSInitializePackage(), PetscInitialize(), TSRKFinalizePackage()
External Links
- PETSc Manual:
Ts/TSRKInitializePackage
PETSc.LibPETSc.TSRKRegister — Method
TSRKRegister(petsclib::PetscLibType,name::TSRKType, order::PetscInt, s::PetscInt, A::Vector{PetscReal}, b::Vector{PetscReal}, c::Vector{PetscReal}, bembed::Vector{PetscReal}, p::PetscInt, binterp::Vector{PetscReal})register an TSRK scheme by providing the entries in the Butcher tableau and optionally embedded approximations and interpolation
Not Collective, but the same schemes should be registered on all processes on which they will be used, No Fortran Support
Input Parameters:
name- identifier for methodorder- approximation order of methods- number of stages, this is the dimension of the matrices belowA- stage coefficients (dimension s*s, row-major)b- step completion table (dimension s; NULL to use last row of A)c- abscissa (dimension s; NULL to use row sums of A)bembed- completion table for embedded method (dimension s; NULL if not available)p- Order of the interpolation scheme, equal to the number of columns of binterpbinterp- Coefficients of the interpolation formula (dimension s*p; NULL to reuse b with p=1)
Level: advanced
External Links
- PETSc Manual:
Ts/TSRKRegister
PETSc.LibPETSc.TSRKRegisterDestroy — Method
TSRKRegisterDestroy(petsclib::PetscLibType)Frees the list of schemes that were registered by TSRKRegister().
Not Collective
Level: advanced
-seealso: , TSRK, TSRKRegister(), TSRKRegisterAll()
External Links
- PETSc Manual:
Ts/TSRKRegisterDestroy
PETSc.LibPETSc.TSRKSetMultirate — Method
TSRKSetMultirate(petsclib::PetscLibType,ts::TS, use_multirate::PetscBool)Use the interpolation
Logically Collective
Input Parameters:
ts- timestepping contextuse_multirate-PETSC_TRUEenables the multirateTSRKmethod, sets the basic method to be RK2A and sets the ratio between slow stepsize and fast stepsize to be 2
Options Database Key:
-ts_rk_multirate- <true,false>
Level: intermediate
-seealso: , TSRK, TSRKGetMultirate()
External Links
- PETSc Manual:
Ts/TSRKSetMultirate
PETSc.LibPETSc.TSRKSetType — Method
TSRKSetType(petsclib::PetscLibType,ts::TS, rktype::TSRKType)Set the type of the TSRK scheme
Logically Collective
Input Parameters:
ts- timestepping contextrktype- type ofTSRKscheme
Options Database Key:
-ts_rk_type- <1fe,2a,3,3bs,4,5f,5dp,5bs>
Level: intermediate
-seealso: , TSRKGetType(), TSRK, TSRKType, TSRK1FE, TSRK2A, TSRK2B, TSRK3, TSRK3BS, TSRK4, TSRK5F, TSRK5DP, TSRK5BS, TSRK6VR, TSRK7VR, TSRK8VR
External Links
- PETSc Manual:
Ts/TSRKSetType
PETSc.LibPETSc.TSRegister — Method
TSRegister(petsclib::PetscLibType,sname::String, fnc::external)Adds a creation method to the TS package.
Not Collective, No Fortran Support
Input Parameters:
sname- The name of a new user-defined creation routinefunction- The creation routine itself
Level: advanced
-seealso: , TSSetType(), TSType, TSRegisterAll(), TSRegisterDestroy()
External Links
- PETSc Manual:
Ts/TSRegister
PETSc.LibPETSc.TSRemoveTrajectory — Method
TSRemoveTrajectory(petsclib::PetscLibType,ts::TS)Destroys and removes the internal TSTrajectory object from a TS
Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Level: intermediate
-seealso: , TSTrajectory, TSResetTrajectory(), TSAdjointSolve()
External Links
- PETSc Manual:
Ts/TSRemoveTrajectory
PETSc.LibPETSc.TSReset — Method
TSReset(petsclib::PetscLibType,ts::TS)Resets a TS context to the state it was in before TSSetUp() was called and removes any allocated Vec and Mat from its data structures
Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Level: developer
-seealso: , TS, TSCreate(), TSSetUp(), TSDestroy(), TSSetResize()
External Links
- PETSc Manual:
Ts/TSReset
PETSc.LibPETSc.TSResetTrajectory — Method
TSResetTrajectory(petsclib::PetscLibType,ts::TS)Destroys and recreates the internal TSTrajectory object
Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Level: intermediate
-seealso: , TSTrajectory, TSGetTrajectory(), TSAdjointSolve(), TSRemoveTrajectory()
External Links
- PETSc Manual:
Ts/TSResetTrajectory
PETSc.LibPETSc.TSResize — Method
TSResize(petsclib::PetscLibType,ts::TS)Runs the user
Collective
Input Parameter:
ts- TheTScontext obtained fromTSCreate()
Level: developer
External Links
- PETSc Manual:
Ts/TSResize
PETSc.LibPETSc.TSResizeRegisterVec — Method
TSResizeRegisterVec(petsclib::PetscLibType,ts::TS, name::String, vec::PetscVec)Register a vector to be transferred with TSResize().
Collective
Input Parameters:
ts- TheTScontext obtained fromTSCreate()name- A string identifying the vectorvec- The vector
Level: developer
-seealso: , TS, TSSetResize(), TSResize(), TSResizeRetrieveVec()
External Links
- PETSc Manual:
Ts/TSResizeRegisterVec
PETSc.LibPETSc.TSResizeRetrieveVec — Method
TSResizeRetrieveVec(petsclib::PetscLibType,ts::TS, name::String, vec::PetscVec)Retrieve a vector registered with TSResizeRegisterVec().
Collective
Input Parameters:
ts- TheTScontext obtained fromTSCreate()name- A string identifying the vectorvec- The vector
Level: developer
-seealso: , TS, TSSetResize(), TSResize(), TSResizeRegisterVec()
External Links
- PETSc Manual:
Ts/TSResizeRetrieveVec
PETSc.LibPETSc.TSRestartStep — Method
TSRestartStep(petsclib::PetscLibType,ts::TS)Flags the solver to restart the next step
Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Level: advanced
-seealso: , TS, TSBDF, TSSolve(), TSSetPreStep(), TSSetPostStep()
External Links
- PETSc Manual:
Ts/TSRestartStep
PETSc.LibPETSc.TSRollBack — Method
TSRollBack(petsclib::PetscLibType,ts::TS)Rolls back one time step
Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Level: advanced
-seealso: , TS, TSGetStepRollBack(), TSCreate(), TSSetUp(), TSDestroy(), TSSolve(), TSSetPreStep(), TSSetPreStage(), TSInterpolate()
External Links
- PETSc Manual:
Ts/TSRollBack
PETSc.LibPETSc.TSRosWFinalizePackage — Method
TSRosWFinalizePackage(petsclib::PetscLibType)This function destroys everything in the TSROSW package. It is called from PetscFinalize().
Level: developer
-seealso: , TSROSW, PetscFinalize(), TSRosWInitializePackage()
External Links
- PETSc Manual:
Ts/TSRosWFinalizePackage
PETSc.LibPETSc.TSRosWGetType — Method
rostype::TSRosWType = TSRosWGetType(petsclib::PetscLibType,ts::TS)Get the type of Rosenbrock
Logically Collective
Input Parameter:
ts- timestepping context
Output Parameter:
rostype- type of Rosenbrock-W scheme
Level: intermediate
-seealso: , TSRosWType, TSRosWSetType()
External Links
- PETSc Manual:
Ts/TSRosWGetType
PETSc.LibPETSc.TSRosWInitializePackage — Method
TSRosWInitializePackage(petsclib::PetscLibType)This function initializes everything in the TSROSW package. It is called from TSInitializePackage().
Level: developer
-seealso: , TSROSW, PetscInitialize(), TSRosWFinalizePackage()
External Links
- PETSc Manual:
Ts/TSRosWInitializePackage
PETSc.LibPETSc.TSRosWRegister — Method
TSRosWRegister(petsclib::PetscLibType,name::TSRosWType, order::PetscInt, s::PetscInt, A::Vector{PetscReal}, Gamma::Vector{PetscReal}, b::Vector{PetscReal}, bembed::Vector{PetscReal}, pinterp::PetscInt, binterpt::Vector{PetscReal})register a TSROSW, Rosenbrock W scheme by providing the entries in the Butcher tableau and optionally embedded approximations and interpolation
Not Collective, but the same schemes should be registered on all processes on which they will be used
Input Parameters:
name- identifier for methodorder- approximation order of methods- number of stages, this is the dimension of the matrices belowA- Table of propagated stage coefficients (dimension s*s, row-major), strictly lower triangularGamma- Table of coefficients in implicit stage equations (dimension s*s, row-major), lower triangular with nonzero diagonalb- Step completion table (dimension s)bembed- Step completion table for a scheme of order one less (dimension s, NULL if no embedded scheme is available)pinterp- Order of the interpolation scheme, equal to the number of columns of binterptbinterpt- Coefficients of the interpolation formula (dimension s*pinterp)
Level: advanced
External Links
- PETSc Manual:
Ts/TSRosWRegister
PETSc.LibPETSc.TSRosWRegisterDestroy — Method
TSRosWRegisterDestroy(petsclib::PetscLibType)Frees the list of schemes that were registered by TSRosWRegister().
Not Collective
Level: advanced
-seealso: , TSRosWRegister(), TSRosWRegisterAll()
External Links
- PETSc Manual:
Ts/TSRosWRegisterDestroy
PETSc.LibPETSc.TSRosWRegisterRos4 — Method
TSRosWRegisterRos4(petsclib::PetscLibType,name::TSRosWType, gamma::PetscReal, a2::PetscReal, a3::PetscReal, b3::PetscReal, e4::PetscReal)register a fourth order Rosenbrock scheme by providing parameter choices
Not Collective, but the same schemes should be registered on all processes on which they will be used
Input Parameters:
name- identifier for methodgamma- leading coefficient (diagonal entry)a2- design parameter, see Table 7.2 of {cite}wanner1996solvinga3- design parameter orPETSC_DETERMINEto satisfy one of the order five conditions (Eq 7.22)b3- design parameter, see Table 7.2 of {cite}wanner1996solvinge4- design parameter for embedded method, see coefficient E4 in ros4.f code from Hairer
Level: developer
-seealso: , TSROSW, TSRosWRegister()
External Links
- PETSc Manual:
Ts/TSRosWRegisterRos4
PETSc.LibPETSc.TSRosWSetRecomputeJacobian — Method
TSRosWSetRecomputeJacobian(petsclib::PetscLibType,ts::TS, flg::PetscBool)Set whether to recompute the Jacobian at each stage. The default is to update the Jacobian once per step.
Logically Collective
Input Parameters:
ts- timestepping contextflg-PETSC_TRUEto recompute the Jacobian at each stage
Level: intermediate
-seealso: , TSRosWType, TSRosWGetType()
External Links
- PETSc Manual:
Ts/TSRosWSetRecomputeJacobian
PETSc.LibPETSc.TSRosWSetType — Method
TSRosWSetType(petsclib::PetscLibType,ts::TS, roswtype::TSRosWType)Set the type of Rosenbrock
Logically Collective
Input Parameters:
ts- timestepping contextroswtype- type of Rosenbrock-W scheme
Level: beginner
-seealso: , TSRosWGetType(), TSROSW, TSROSW2M, TSROSW2P, TSROSWRA3PW, TSROSWRA34PW2, TSROSWRODAS3, TSROSWSANDU3, TSROSWASSP3P3S1C, TSROSWLASSP3P4S2C, TSROSWLLSSP3P4S2C, TSROSWARK3
External Links
- PETSc Manual:
Ts/TSRosWSetType
PETSc.LibPETSc.TSSSPFinalizePackage — Method
TSSSPFinalizePackage(petsclib::PetscLibType)This function destroys everything in the TSSSP package. It is called from PetscFinalize().
Level: developer
-seealso: , PetscFinalize(), TSSSPInitiallizePackage(), TSInitializePackage()
External Links
- PETSc Manual:
Ts/TSSSPFinalizePackage
PETSc.LibPETSc.TSSSPGetNumStages — Method
nstages::PetscInt = TSSSPGetNumStages(petsclib::PetscLibType,ts::TS)get the number of stages in the TSSSP time integration scheme
Logically Collective
Input Parameter:
ts- time stepping object
Output Parameter:
nstages- number of stages
Level: beginner
-seealso: , TSSSP, TSSSPGetType(), TSSSPSetNumStages(), TSSSPRKS2, TSSSPRKS3, TSSSPRK104
External Links
- PETSc Manual:
Ts/TSSSPGetNumStages
PETSc.LibPETSc.TSSSPGetType — Method
type::TSSSPType = TSSSPGetType(petsclib::PetscLibType,ts::TS)get the TSSSP time integration scheme
Logically Collective
Input Parameter:
ts- time stepping object
Output Parameter:
type- type of scheme being used
Level: beginner
-seealso: , TSSSP, TSSSPSetType(), TSSSPSetNumStages(), TSSSPRKS2, TSSSPRKS3, TSSSPRK104
External Links
- PETSc Manual:
Ts/TSSSPGetType
PETSc.LibPETSc.TSSSPInitializePackage — Method
TSSSPInitializePackage(petsclib::PetscLibType)This function initializes everything in the TSSSP package. It is called from TSInitializePackage().
Level: developer
-seealso: , PetscInitialize(), TSSSPFinalizePackage(), TSInitializePackage()
External Links
- PETSc Manual:
Ts/TSSSPInitializePackage
PETSc.LibPETSc.TSSSPSetNumStages — Method
TSSSPSetNumStages(petsclib::PetscLibType,ts::TS, nstages::PetscInt)set the number of stages to use with the TSSSP method. Must be called after TSSSPSetType().
Logically Collective
Input Parameters:
ts- time stepping objectnstages- number of stages
Options Database Keys:
-ts_ssp_type <rks2>- Type ofTSSSPmethod (one of) rks2 rks3 rk104-ts_ssp_nstages<rks2: 5, rks3: 9>- Number of stages
Level: beginner
-seealso: , TSSSP, TSSSPGetNumStages(), TSSSPRKS2, TSSSPRKS3, TSSSPRK104
External Links
- PETSc Manual:
Ts/TSSSPSetNumStages
PETSc.LibPETSc.TSSSPSetType — Method
TSSSPSetType(petsclib::PetscLibType,ts::TS, ssptype::TSSSPType)set the TSSSP time integration scheme to use
Logically Collective
Input Parameters:
ts- time stepping objectssptype- type of scheme to use
Options Database Keys:
-ts_ssp_type <rks2>- Type ofTSSSPmethod (one of) rks2 rks3 rk104-ts_ssp_nstages<rks2: 5, rks3: 9>- Number of stages
Level: beginner
-seealso: , TSSSP, TSSSPGetType(), TSSSPSetNumStages(), TSSSPRKS2, TSSSPRKS3, TSSSPRK104
External Links
- PETSc Manual:
Ts/TSSSPSetType
PETSc.LibPETSc.TSSetApplicationContext — Method
TSSetApplicationContext(petsclib::PetscLibType,ts::TS, ctx::PeCtx)Sets an optional user TS callbacks with TSGetApplicationContext()
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()ctx- user context
Level: intermediate
-seealso: , TS, TSGetApplicationContext()
External Links
- PETSc Manual:
Ts/TSSetApplicationContext
PETSc.LibPETSc.TSSetCFLTimeLocal — Method
TSSetCFLTimeLocal(petsclib::PetscLibType,ts::TS, cfltime::PetscReal)Set the local CFL constraint relative to forward Euler
Logically Collective
Input Parameters:
ts- time stepping contextcfltime- maximum stable time step if using forward Euler (value can be different on each process)
-seealso: , TSGetCFLTime(), TSADAPTCFL
External Links
- PETSc Manual:
Ts/TSSetCFLTimeLocal
PETSc.LibPETSc.TSSetComputeExactError — Method
TSSetComputeExactError(petsclib::PetscLibType,ts::TS, exactError::external)Set the function used to automatically compute the exact error for the timestepping.
Logically collective
Input Parameters:
ts- time stepping contextexactError- The function which computes the solution error
Calling sequence of exactError:
ts- The timestepping contextu- The approximate solution vectore- The vector in which the error is stored
Level: advanced
-seealso: , TS, TSGetComputeExactError(), TSComputeExactError()
External Links
- PETSc Manual:
Ts/TSSetComputeExactError
PETSc.LibPETSc.TSSetComputeInitialCondition — Method
TSSetComputeInitialCondition(petsclib::PetscLibType,ts::TS, initCondition::external)Set the function used to automatically compute an initial condition for the timestepping.
Logically collective
Input Parameters:
ts- time stepping contextinitCondition- The function which computes an initial condition
Calling sequence of initCondition:
ts- The timestepping contexte- The input vector in which the initial condition is to be stored
Level: advanced
-seealso: , TS, TSGetComputeInitialCondition(), TSComputeInitialCondition()
External Links
- PETSc Manual:
Ts/TSSetComputeInitialCondition
PETSc.LibPETSc.TSSetConvergedReason — Method
TSSetConvergedReason(petsclib::PetscLibType,ts::TS, reason::TSConvergedReason)Sets the reason for handling the convergence of TSSolve().
Logically Collective; reason must contain common value
Input Parameters:
ts- theTScontextreason- negative value indicates diverged, positive value converged, seeTSConvergedReasonor the
manual pages for the individual convergence tests for complete lists
Level: advanced
-seealso: , TS, TSSolve(), TSConvergedReason
External Links
- PETSc Manual:
Ts/TSSetConvergedReason
PETSc.LibPETSc.TSSetCostGradients — Method
TSSetCostGradients(petsclib::PetscLibType,ts::TS, numcost::PetscInt, lambda::Vector{PetscVec}, mu::Vector{PetscVec})Sets the initial value of the gradients of the cost function w.r.t. initial values and w.r.t. the problem parameters for use by the TS adjoint routines.
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()numcost- number of gradients to be computed, this is the number of cost functionslambda- gradients with respect to the initial condition variables, the dimension and parallel layout of these vectors is the same as the ODE solution vectormu- gradients with respect to the parameters, the number of entries in these vectors is the same as the number of parameters
Level: beginner
-seealso: TS, TSAdjointSolve(), TSGetCostGradients()
External Links
- PETSc Manual:
Ts/TSSetCostGradients
PETSc.LibPETSc.TSSetCostHessianProducts — Method
TSSetCostHessianProducts(petsclib::PetscLibType,ts::TS, numcost::PetscInt, lambda2::Vector{PetscVec}, mu2::Vector{PetscVec}, dir::PetscVec)Sets the initial value of the Hessian for use by the TS adjoint routines.
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()numcost- number of cost functionslambda2- Hessian-vector product with respect to the initial condition variables, the dimension and parallel layout of these vectors is the same as the ODE solution vectormu2- Hessian-vector product with respect to the parameters, the number of entries in these vectors is the same as the number of parametersdir- the direction vector that are multiplied with the Hessian of the cost functions
Level: beginner
-seealso: , TS, TSAdjointSolve(), TSAdjointSetForward()
External Links
- PETSc Manual:
Ts/TSSetCostHessianProducts
PETSc.LibPETSc.TSSetDM — Method
TSSetDM(petsclib::PetscLibType,ts::TS, dm::PetscDM)Sets the DM that may be used by some nonlinear solvers or preconditioners under the TS
Logically Collective
Input Parameters:
ts- theTSintegrator objectdm- the dm, cannot beNULL
Level: intermediate
-seealso: , TS, DM, TSGetDM(), SNESSetDM(), SNESGetDM()
External Links
- PETSc Manual:
Ts/TSSetDM
PETSc.LibPETSc.TSSetEquationType — Method
TSSetEquationType(petsclib::PetscLibType,ts::TS, equation_type::TSEquationType)Sets the type of the equation that TS is solving.
Not Collective
Input Parameters:
ts- theTScontextequation_type- seeTSEquationType
Level: advanced
-seealso: , TS, TSGetEquationType(), TSEquationType
External Links
- PETSc Manual:
Ts/TSSetEquationType
PETSc.LibPETSc.TSSetErrorIfStepFails — Method
TSSetErrorIfStepFails(petsclib::PetscLibType,ts::TS, err::PetscBool)Immediately error if no step succeeds during TSSolve()
Not Collective
Input Parameters:
ts-TScontexterr-PETSC_TRUEto error if no step succeeds,PETSC_FALSEto return without failure
Options Database Key:
-ts_error_if_step_fails- Error if no step succeeds
Level: intermediate
-seealso: , TS, TSGetSNESIterations(), TSGetKSPIterations(), TSSetMaxStepRejections(), TSGetStepRejections(), TSGetSNESFailures(), TSGetConvergedReason()
External Links
- PETSc Manual:
Ts/TSSetErrorIfStepFails
PETSc.LibPETSc.TSSetEvaluationTimes — Method
TSSetEvaluationTimes(petsclib::PetscLibType,ts::TS, n::PetscInt, time_points::Vector{PetscReal})sets the evaluation points. The solution will be computed and stored for each time requested
Collective
Input Parameters:
ts- the time-steppern- number of the time pointstime_points- array of the time points, must be increasing
Options Database Key:
-ts_eval_times <t0,...tn>- Sets the evaluation times
Level: intermediate
-seealso: , TS, TSGetEvaluationTimes(), TSGetEvaluationSolutions(), TSSetTimeSpan()
External Links
- PETSc Manual:
Ts/TSSetEvaluationTimes
PETSc.LibPETSc.TSSetEventHandler — Method
TSSetEventHandler(petsclib::PetscLibType,ts::TS, nevents::PetscInt, direction::Vector{PetscInt}, terminate::Vector{PetscBool}, indicator::external, postevent::external, ctx::Cvoid)Sets functions and parameters used for indicating events and handling them
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()nevents- number of local events (i.e. managed by the given MPI process)direction- direction of zero crossing to be detected (one for each local event).
-1 => zero crossing in negative direction, +1 => zero crossing in positive direction, 0 => both ways
terminate- flag to indicate whether time stepping should be terminated after
an event is detected (one for each local event)
indicator- callback defininig the user indicator functions whose sign changes (seedirection) mark presence of the eventspostevent- [optional] user post-event callback; it can change the solution, ODE etc at the time of the eventctx- [optional] user-defined context for private data for the
indicator() and postevent() routines (use NULL if no context is desired)
Calling sequence of indicator:
ts- theTScontextt- current timeU- current solutionfvalue- output array with values of local indicator functions (length ==nevents) for time t and state-vector Uctx- the context passed as the final argument toTSSetEventHandler()
Calling sequence of postevent:
ts- theTScontextnevents_zero- number of triggered local events (whose indicator function is marked as crossing zero, and direction is appropriate)events_zero- indices of the triggered local eventst- current timeU- current solutionforwardsolve- flag to indicate whetherTSis doing a forward solve (PETSC_TRUE) or adjoint solve (PETSC_FALSE)ctx- the context passed as the final argument toTSSetEventHandler()
Options Database Keys:
-ts_event_tol <tol>- tolerance for zero crossing check of indicator functions-ts_event_monitor- print choices made by event handler-ts_event_recorder_initial_size <recsize>- initial size of event recorder-ts_event_post_event_step <dt1>- first time step after event-ts_event_post_event_second_step <dt2>- second time step after event-ts_event_dt_min <dt>- minimum time step considered for TSEvent
Level: intermediate
-seealso: , TSEvent, TSCreate(), TSSetTimeStep(), TSSetConvergedReason()
External Links
- PETSc Manual:
Ts/TSSetEventHandler
PETSc.LibPETSc.TSSetEventTolerances — Method
TSSetEventTolerances(petsclib::PetscLibType,ts::TS, tol::PetscReal, vtol::Vector{PetscReal})Set tolerances for event (indicator function) zero crossings
Logically Collective
Input Parameters:
ts- time integration contexttol- tolerance,PETSC_CURRENTto leave the current valuevtol- array of tolerances orNULL, used in preference totolif present
Options Database Key:
-ts_event_tol <tol>- tolerance for event (indicator function) zero crossing
Level: beginner
-seealso: , TS, TSEvent, TSSetEventHandler()
External Links
- PETSc Manual:
Ts/TSSetEventTolerances
PETSc.LibPETSc.TSSetExactFinalTime — Method
TSSetExactFinalTime(petsclib::PetscLibType,ts::TS, eftopt::TSExactFinalTimeOption)Determines whether to adapt the final time step to match the exact final time, to interpolate the solution to the exact final time, or to just return at the final time TS computed (which may be slightly larger than the requested final time).
Logically Collective
Input Parameters:
ts- the time-step contexteftopt- exact final time option
-seealso: , TS, TSExactFinalTimeOption, TSGetExactFinalTime()
External Links
- PETSc Manual:
Ts/TSSetExactFinalTime
PETSc.LibPETSc.TSSetForcingFunction — Method
TSSetForcingFunction(petsclib::PetscLibType,ts::TS, func::TSForcingFn, ctx::Cvoid)Provide a function that computes a forcing term for a ODE or PDE
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()func- routine for evaluating the forcing functionctx- [optional] user-defined context for private data for the function evaluation routine
(may be NULL)
Level: intermediate
-seealso: , TS, TSForcingFn, TSSetRHSJacobian(), TSSetIJacobian(), TSComputeSolutionFunction(), TSSetSolutionFunction()
External Links
- PETSc Manual:
Ts/TSSetForcingFunction
PETSc.LibPETSc.TSSetFromOptions — Method
TSSetFromOptions(petsclib::PetscLibType,ts::TS)Sets various TS parameters from the options database
Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Options Database Keys:
-ts_type <type>- EULER, BEULER, SUNDIALS, PSEUDO, CN, RK, THETA, ALPHA, GLLE, SSP, GLEE, BSYMP, IRK, seeTSType-ts_save_trajectory- checkpoint the solution at each time-step-ts_max_time <time>- maximum time to compute to-ts_time_span <t0,...tf>- sets the time span, solutions are computed and stored for each indicated time, inittime and maxtime are set-ts_eval_times <t0,...tn>- time points where solutions are computed and stored for each indicated time-ts_max_steps <steps>- maximum time-step number to execute until (possibly with nonzero starting value)-ts_run_steps <steps>- maximum number of time steps for TSSolve to take on each call-ts_init_time <time>- initial time to start computation-ts_final_time <time>- final time to compute to (deprecated: use-ts_max_time)-ts_dt <dt>- initial time step-ts_exact_final_time <stepover,interpolate,matchstep>- whether to stop at the exact given final time and how to compute the solution at that time-ts_max_snes_failures <maxfailures>- Maximum number of nonlinear solve failures allowed-ts_max_reject <maxrejects>- Maximum number of step rejections before step fails-ts_error_if_step_fails <true,false>- Error if no step succeeds-ts_rtol <rtol>- relative tolerance for local truncation error-ts_atol <atol>- Absolute tolerance for local truncation error-ts_rhs_jacobian_test_mult -mat_shell_test_mult_view- test the Jacobian at each iteration against finite difference with RHS function-ts_rhs_jacobian_test_mult_transpose- test the Jacobian at each iteration against finite difference with RHS function-ts_adjoint_solve <yes,no>- After solving the ODE/DAE solve the adjoint problem (requires-ts_save_trajectory)-ts_fd_color- Use finite differences with coloring to compute IJacobian-ts_monitor- print information at each timestep-ts_monitor_cancel- Cancel all monitors-ts_monitor_wall_clock_time- Monitor wall-clock time, KSP iterations, and SNES iterations per step-ts_monitor_lg_solution- Monitor solution graphically-ts_monitor_lg_error- Monitor error graphically-ts_monitor_error- Monitors norm of error-ts_monitor_lg_timestep- Monitor timestep size graphically-ts_monitor_lg_timestep_log- Monitor log timestep size graphically-ts_monitor_lg_snes_iterations- Monitor number nonlinear iterations for each timestep graphically-ts_monitor_lg_ksp_iterations- Monitor number nonlinear iterations for each timestep graphically-ts_monitor_sp_eig- Monitor eigenvalues of linearized operator graphically-ts_monitor_draw_solution- Monitor solution graphically-ts_monitor_draw_solution_phase <xleft,yleft,xright,yright>- Monitor solution graphically with phase diagram, requires problem with exactly 2 degrees of freedom-ts_monitor_draw_error- Monitor error graphically, requires use to have provided TSSetSolutionFunction()-ts_monitor_solution [ascii binary draw][:filename][:viewerformat]- monitors the solution at each timestep-ts_monitor_solution_interval <interval>- output once every interval (default=1) time steps. Use -1 to only output at the end of the simulation-ts_monitor_solution_skip_initial- skip writing of initial condition-ts_monitor_solution_vtk <filename.vts,filename.vtu>- Save each time step to a binary file, use filename-%%03" PetscIntFMT ".vts (filename-%%03" PetscIntFMT ".vtu)-ts_monitor_solution_vtk_interval <interval>- output once every interval (default=1) time steps. Use -1 to only output at the end of the simulation-ts_monitor_envelope- determine maximum and minimum value of each component of the solution over the solution time
Level: beginner
External Links
- PETSc Manual:
Ts/TSSetFromOptions
PETSc.LibPETSc.TSSetFunctionDomainError — Method
TSSetFunctionDomainError(petsclib::PetscLibType,ts::TS, func::external)Set a function that tests if the current state vector is valid
Logically collective
Input Parameters:
ts- theTScontextfunc- function called withinTSFunctionDomainError()
Calling sequence of func:
ts- theTScontexttime- the current time (of the stage)state- the state to check if it is validaccept- (output parameter)PETSC_FALSEif the state is not acceptable,PETSC_TRUEif acceptable
Level: intermediate
-seealso: , TSAdaptCheckStage(), TSFunctionDomainError(), SNESSetFunctionDomainError(), TSGetSNES()
External Links
- PETSc Manual:
Ts/TSSetFunctionDomainError
PETSc.LibPETSc.TSSetI2Function — Method
TSSetI2Function(petsclib::PetscLibType,ts::TS, F::PetscVec, fun::TSI2FunctionFn, ctx::Cvoid)Set the function to compute F(t,U,Ut,Utt) where F = 0 is the DAE to be solved.
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()F- vector to hold the residual (orNULLto have it created internally)fun- the function evaluation routinectx- user-defined context for private data for the function evaluation routine (may beNULL)
Level: beginner
-seealso: , TS, TSI2FunctionFn, TSSetI2Jacobian(), TSSetIFunction(), TSCreate(), TSSetRHSFunction()
External Links
- PETSc Manual:
Ts/TSSetI2Function
PETSc.LibPETSc.TSSetI2Jacobian — Method
TSSetI2Jacobian(petsclib::PetscLibType,ts::TS, J::PetscMat, P::PetscMat, jac::TSI2JacobianFn, ctx::Cvoid)Set the function to compute the matrix dF/dU + vdF/dU_t + adF/dUtt where F(t,U,Ut,U_tt) is the function you provided with TSSetI2Function().
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()J- matrix to hold the Jacobian valuesP- matrix for constructing the preconditioner (may be same asJ)jac- the Jacobian evaluation routine, seeTSI2JacobianFnfor the calling sequencectx- user-defined context for private data for the Jacobian evaluation routine (may beNULL)
Level: beginner
-seealso: , TS, TSI2JacobianFn, TSSetI2Function(), TSGetI2Jacobian()
External Links
- PETSc Manual:
Ts/TSSetI2Jacobian
PETSc.LibPETSc.TSSetIFunction — Method
TSSetIFunction(petsclib::PetscLibType,ts::TS, r::PetscVec, f::TSIFunctionFn, ctx::Cvoid)Set the function to compute F(t,U,U_t) where F() = 0 is the DAE to be solved.
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()r- vector to hold the residual (orNULLto have it created internally)f- the function evaluation routinectx- user-defined context for private data for the function evaluation routine (may beNULL)
Level: beginner
-seealso: , TS, TSIFunctionFn, TSSetRHSJacobian(), TSSetRHSFunction(), TSSetIJacobian()
External Links
- PETSc Manual:
Ts/TSSetIFunction
PETSc.LibPETSc.TSSetIHessianProduct — Method
TSSetIHessianProduct(petsclib::PetscLibType,ts::TS, ihp1::PetscVec, ihessianproductfunc1::external, ihp2::PetscVec, ihessianproductfunc2::external, ihp3::PetscVec, ihessianproductfunc3::external, ihp4::PetscVec, ihessianproductfunc4::external, ctx::Cvoid)Sets the function that computes the vector
Logically Collective
Input Parameters:
ts-TScontext obtained fromTSCreate()ihp1- an array of vectors storing the result of vector-Hessian-vector product for F_UUhessianproductfunc1- vector-Hessian-vector product function for F_UUihp2- an array of vectors storing the result of vector-Hessian-vector product for F_UPhessianproductfunc2- vector-Hessian-vector product function for F_UPihp3- an array of vectors storing the result of vector-Hessian-vector product for F_PUhessianproductfunc3- vector-Hessian-vector product function for F_PUihp4- an array of vectors storing the result of vector-Hessian-vector product for F_PPhessianproductfunc4- vector-Hessian-vector product function for F_PP
Calling sequence of ihessianproductfunc1:
ts- theTScontextt- current timestepU- input vector (current ODE solution)Vl- an array of input vectors to be left-multiplied with the HessianVr- input vector to be right-multiplied with the HessianVHV- an array of output vectors for vector-Hessian-vector productctx- [optional] user-defined function context
Level: intermediate
External Links
- PETSc Manual:
Ts/TSSetIHessianProduct
PETSc.LibPETSc.TSSetIJacobian — Method
TSSetIJacobian(petsclib::PetscLibType,ts::TS, Amat::PetscMat, Pmat::PetscMat, f::TSIJacobianFn, ctx::Cvoid)Set the function to compute the matrix dF/dU + a*dF/dUt where F(t,U,Ut) is the function provided with TSSetIFunction().
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()Amat- (approximate) matrix to store Jacobian entries computed byfPmat- matrix used to compute preconditioner (usually the same asAmat)f- the Jacobian evaluation routinectx- user-defined context for private data for the Jacobian evaluation routine (may beNULL)
Level: beginner
-seealso: , TS, TSIJacobianFn, TSSetIFunction(), TSSetRHSJacobian(), SNESComputeJacobianDefaultColor(), SNESComputeJacobianDefault(), TSSetRHSFunction()
External Links
- PETSc Manual:
Ts/TSSetIJacobian
PETSc.LibPETSc.TSSetIJacobianP — Method
TSSetIJacobianP(petsclib::PetscLibType,ts::TS, Amat::PetscMat, func::external, ctx::Cvoid)Sets the function that computes the Jacobian of F w.r.t. the parameters p where F(Udot,U,p,t) = G(U,p,t), as well as the location to store the matrix.
Logically Collective
Input Parameters:
ts-TScontext obtained fromTSCreate()Amat- JacobianP matrixfunc- functionctx- [optional] user-defined function context
Calling sequence of func:
ts- theTScontextt- current timestepU- input vector (current ODE solution)Udot- time derivative of state vectorshift- shift to apply, see the note inTSSetIJacobian()A- output matrixctx- [optional] user-defined function context
Level: intermediate
-seealso: , TSSetRHSJacobianP(), TS
External Links
- PETSc Manual:
Ts/TSSetIJacobianP
PETSc.LibPETSc.TSSetMatStructure — Method
TSSetMatStructure(petsclib::PetscLibType,ts::TS, str::MatStructure)sets the relationship between the nonzero structure of the RHS Jacobian matrix to the IJacobian matrix.
Logically Collective
Input Parameters:
ts- the time-stepperstr- the structure (the default isUNKNOWN_NONZERO_PATTERN)
Level: intermediate
-seealso: , TS, MatAXPY(), MatStructure
External Links
- PETSc Manual:
Ts/TSSetMatStructure
PETSc.LibPETSc.TSSetMaxSNESFailures — Method
TSSetMaxSNESFailures(petsclib::PetscLibType,ts::TS, fails::PetscInt)Sets the maximum number of failed SNES solves
Not Collective
Input Parameters:
ts-TScontextfails- maximum number of failed nonlinear solves, passPETSC_UNLIMITEDto allow any number of failures.
Options Database Key:
-ts_max_snes_failures- Maximum number of nonlinear solve failures
Level: intermediate
-seealso: , TS, SNES, TSGetSNESIterations(), TSGetKSPIterations(), TSSetMaxStepRejections(), TSGetStepRejections(), TSGetSNESFailures(), SNESGetConvergedReason(), TSGetConvergedReason()
External Links
- PETSc Manual:
Ts/TSSetMaxSNESFailures
PETSc.LibPETSc.TSSetMaxStepRejections — Method
TSSetMaxStepRejections(petsclib::PetscLibType,ts::TS, rejects::PetscInt)Sets the maximum number of step rejections before a time step fails
Not Collective
Input Parameters:
ts-TScontextrejects- maximum number of rejected steps, passPETSC_UNLIMITEDfor unlimited
Options Database Key:
-ts_max_reject- Maximum number of step rejections before a step fails
Level: intermediate
-seealso: , TS, SNES, TSGetSNESIterations(), TSGetKSPIterations(), TSSetMaxSNESFailures(), TSGetStepRejections(), TSGetSNESFailures(), TSSetErrorIfStepFails(), TSGetConvergedReason()
External Links
- PETSc Manual:
Ts/TSSetMaxStepRejections
PETSc.LibPETSc.TSSetMaxSteps — Method
TSSetMaxSteps(petsclib::PetscLibType,ts::TS, maxsteps::PetscInt)Sets the maximum number of steps to use.
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()maxsteps- maximum number of steps to use
Options Database Key:
-ts_max_steps <maxsteps>- Sets maxsteps
Level: intermediate
-seealso: , TS, TSGetMaxSteps(), TSSetMaxTime(), TSSetExactFinalTime()
External Links
- PETSc Manual:
Ts/TSSetMaxSteps
PETSc.LibPETSc.TSSetMaxTime — Method
TSSetMaxTime(petsclib::PetscLibType,ts::TS, maxtime::PetscReal)Sets the maximum (or final) time for timestepping.
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()maxtime- final time to step to
Options Database Key:
-ts_max_time <maxtime>- Sets maxtime
Level: intermediate
-seealso: , TS, TSGetMaxTime(), TSSetMaxSteps(), TSSetExactFinalTime()
External Links
- PETSc Manual:
Ts/TSSetMaxTime
PETSc.LibPETSc.TSSetOptionsPrefix — Method
TSSetOptionsPrefix(petsclib::PetscLibType,ts::TS, prefix::String)Sets the prefix used for searching for all TS options in the database.
Logically Collective
Input Parameters:
ts- TheTScontextprefix- The prefix to prepend to all option names
Level: advanced
-seealso: , TS, TSSetFromOptions(), TSAppendOptionsPrefix()
External Links
- PETSc Manual:
Ts/TSSetOptionsPrefix
PETSc.LibPETSc.TSSetPostEvaluate — Method
TSSetPostEvaluate(petsclib::PetscLibType,ts::TS, func::external)Sets the general called at the end of each step evaluation.
Logically Collective
Input Parameters:
ts- TheTScontext obtained fromTSCreate()func- The function
Calling sequence of func:
ts- theTScontext
Level: intermediate
-seealso: , TS, TSSetPreStage(), TSSetPreStep(), TSSetPostStep(), TSGetApplicationContext()
External Links
- PETSc Manual:
Ts/TSSetPostEvaluate
PETSc.LibPETSc.TSSetPostEventSecondStep — Method
TSSetPostEventSecondStep(petsclib::PetscLibType,ts::TS, dt2::PetscReal)Set the second time step to use after the event
Logically Collective
Input Parameters:
ts- time integration contextdt2- second post event step
Options Database Key:
-ts_event_post_event_second_step <dt2>- second time step after the event
Level: advanced
-seealso: , TS, TSEvent, TSSetEventHandler(), TSSetPostEventStep()
External Links
- PETSc Manual:
Ts/TSSetPostEventSecondStep
PETSc.LibPETSc.TSSetPostEventStep — Method
TSSetPostEventStep(petsclib::PetscLibType,ts::TS, dt1::PetscReal)Set the first time step to use after the event
Logically Collective
Input Parameters:
ts- time integration contextdt1- first post event step
Options Database Key:
-ts_event_post_event_step <dt1>- first time step after the event
Level: advanced
-seealso: , TS, TSEvent, TSSetEventHandler(), TSSetPostEventSecondStep()
External Links
- PETSc Manual:
Ts/TSSetPostEventStep
PETSc.LibPETSc.TSSetPostStage — Method
TSSetPostStage(petsclib::PetscLibType,ts::TS, func::external)Sets the general called once at the end of each stage.
Logically Collective
Input Parameters:
ts- TheTScontext obtained fromTSCreate()func- The function
Calling sequence of func:
ts- theTScontextstagetime- the stage timestageindex- the stage indexY- Array of vectors (of size = total number of stages) with the stage solutions
Level: intermediate
-seealso: , TS, TSSetPreStage(), TSSetPreStep(), TSSetPostStep(), TSGetApplicationContext()
External Links
- PETSc Manual:
Ts/TSSetPostStage
PETSc.LibPETSc.TSSetPostStep — Method
TSSetPostStep(petsclib::PetscLibType,ts::TS, func::external)Sets the general called once at the end of each successful time step.
Logically Collective
Input Parameters:
ts- TheTScontext obtained fromTSCreate()func- The function
Calling sequence of func:
ts- theTScontext
Level: intermediate
-seealso: , TS, TSSetPreStep(), TSSetPreStage(), TSSetPostEvaluate(), TSGetTimeStep(), TSGetStepNumber(), TSGetTime(), TSRestartStep()
External Links
- PETSc Manual:
Ts/TSSetPostStep
PETSc.LibPETSc.TSSetPreStage — Method
TSSetPreStage(petsclib::PetscLibType,ts::TS, func::external)Sets the general called once at the beginning of each stage.
Logically Collective
Input Parameters:
ts- TheTScontext obtained fromTSCreate()func- The function
Calling sequence of func:
ts- theTScontextstagetime- the stage time
Level: intermediate
-seealso: , TS, TSSetPostStage(), TSSetPreStep(), TSSetPostStep(), TSGetApplicationContext()
External Links
- PETSc Manual:
Ts/TSSetPreStage
PETSc.LibPETSc.TSSetPreStep — Method
TSSetPreStep(petsclib::PetscLibType,ts::TS, func::external)Sets the general called once at the beginning of each time step.
Logically Collective
Input Parameters:
ts- TheTScontext obtained fromTSCreate()func- The function
Calling sequence of func:
ts- theTScontext
Level: intermediate
-seealso: , TS, TSSetPreStage(), TSSetPostStage(), TSSetPostStep(), TSStep(), TSRestartStep()
External Links
- PETSc Manual:
Ts/TSSetPreStep
PETSc.LibPETSc.TSSetProblemType — Method
TSSetProblemType(petsclib::PetscLibType,ts::TS, type::TSProblemType)Sets the type of problem to be solved.
Not collective
Input Parameters:
ts- TheTStype- One ofTS_LINEAR,TS_NONLINEARwhere these types refer to problems of the forms
-seealso: , TSSetUp(), TSProblemType, TS
External Links
- PETSc Manual:
Ts/TSSetProblemType
PETSc.LibPETSc.TSSetRHSFunction — Method
TSSetRHSFunction(petsclib::PetscLibType,ts::TS, r::PetscVec, f::TSRHSFunctionFn, ctx::Cvoid)Sets the routine for evaluating the function, where U_t = G(t,u).
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()r- vector to put the computed right-hand side (orNULLto have it created)f- routine for evaluating the right-hand-side functionctx- [optional] user-defined context for private data for the function evaluation routine (may beNULL)
Level: beginner
-seealso: , TS, TSRHSFunctionFn, TSSetRHSJacobian(), TSSetIJacobian(), TSSetIFunction()
External Links
- PETSc Manual:
Ts/TSSetRHSFunction
PETSc.LibPETSc.TSSetRHSHessianProduct — Method
TSSetRHSHessianProduct(petsclib::PetscLibType,ts::TS, rhshp1::Vector{PetscVec}, rhshessianproductfunc1::external, rhshp2::Vector{PetscVec}, rhshessianproductfunc2::external, rhshp3::Vector{PetscVec}, rhshessianproductfunc3::external, rhshp4::Vector{PetscVec}, rhshessianproductfunc4::external, ctx::Cvoid)Sets the function that computes the vector product. The Hessian is the second-order derivative of G (RHSFunction) w.r.t. the state variable.
Logically Collective
Input Parameters:
ts-TScontext obtained fromTSCreate()rhshp1- an array of vectors storing the result of vector-Hessian-vector product for G_UUhessianproductfunc1- vector-Hessian-vector product function for G_UUrhshp2- an array of vectors storing the result of vector-Hessian-vector product for G_UPhessianproductfunc2- vector-Hessian-vector product function for G_UPrhshp3- an array of vectors storing the result of vector-Hessian-vector product for G_PUhessianproductfunc3- vector-Hessian-vector product function for G_PUrhshp4- an array of vectors storing the result of vector-Hessian-vector product for G_PPhessianproductfunc4- vector-Hessian-vector product function for G_PPctx- [optional] user-defined function context
Calling sequence of rhshessianproductfunc1:
ts- theTScontextt- current timestepU- input vector (current ODE solution)Vl- an array of input vectors to be left-multiplied with the HessianVr- input vector to be right-multiplied with the HessianVHV- an array of output vectors for vector-Hessian-vector productctx- [optional] user-defined function context
Level: intermediate
-seealso: TS, TSAdjoint
External Links
- PETSc Manual:
Ts/TSSetRHSHessianProduct
PETSc.LibPETSc.TSSetRHSJacobian — Method
TSSetRHSJacobian(petsclib::PetscLibType,ts::TS, Amat::PetscMat, Pmat::PetscMat, f::TSRHSJacobianFn, ctx::Cvoid)Sets the function to compute the Jacobian of G, where U_t = G(U,t), as well as the location to store the matrix.
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()Amat- (approximate) location to store Jacobian matrix entries computed byfPmat- matrix from which preconditioner is to be constructed (usually the same asAmat)f- the Jacobian evaluation routinectx- [optional] user-defined context for private data for the Jacobian evaluation routine (may beNULL)
Level: beginner
-seealso: , TS, TSRHSJacobianFn, SNESComputeJacobianDefaultColor(), TSSetRHSFunction(), TSRHSJacobianSetReuse(), TSSetIJacobian(), TSRHSFunctionFn, TSIFunctionFn
External Links
- PETSc Manual:
Ts/TSSetRHSJacobian
PETSc.LibPETSc.TSSetRHSJacobianP — Method
TSSetRHSJacobianP(petsclib::PetscLibType,ts::TS, Amat::PetscMat, func::TSRHSJacobianPFn, ctx::Cvoid)Sets the function that computes the Jacobian of G w.r.t. the parameters p where U_t = G(U,p,t), as well as the location to store the matrix.
Logically Collective
Input Parameters:
ts-TScontext obtained fromTSCreate()Amat- JacobianP matrixfunc- functionctx- [optional] user-defined function context
Level: intermediate
-seealso: , TS, TSRHSJacobianPFn, TSGetRHSJacobianP()
External Links
- PETSc Manual:
Ts/TSSetRHSJacobianP
PETSc.LibPETSc.TSSetResize — Method
TSSetResize(petsclib::PetscLibType,ts::TS, rollback::PetscBool, setup::external, transfer::external, ctx::Cvoid)Sets the resize callbacks.
Logically Collective
Input Parameters:
ts- TheTScontext obtained fromTSCreate()rollback- Whether a resize will restart the stepsetup- The setup functiontransfer- The transfer functionctx- [optional] The user-defined context
Calling sequence of setup:
ts- theTScontextstep- the current steptime- the current timestate- the current vector of stateresize- (output parameter)PETSC_TRUEif need resizing,PETSC_FALSEotherwisectx- user defined context
Calling sequence of transfer:
ts- theTScontextnv- the number of vectors to be transferredvecsin- array of vectors to be transferredvecsout- array of transferred vectorsctx- user defined context
-seealso: , TS, TSSetDM(), TSSetIJacobian(), TSSetRHSJacobian()
External Links
- PETSc Manual:
Ts/TSSetResize
PETSc.LibPETSc.TSSetRunSteps — Method
TSSetRunSteps(petsclib::PetscLibType,ts::TS, runsteps::PetscInt)Sets the maximum number of steps to take in each call to TSSolve().
If the step count when TSSolve() is start_step, this will stop the simulation once current_step - start_step >= run_steps. Comparatively, TSSetMaxSteps() will stop if current_step >= max_steps. The simulation will stop when either condition is reached.
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()runsteps- maximum number of steps to take in each call toTSSolve();
Options Database Key:
-ts_run_steps <runsteps>- Sets runsteps
Level: intermediate
-seealso: , TS, TSGetRunSteps(), TSSetMaxTime(), TSSetExactFinalTime(), TSSetMaxSteps()
External Links
- PETSc Manual:
Ts/TSSetRunSteps
PETSc.LibPETSc.TSSetSNES — Method
TSSetSNES(petsclib::PetscLibType,ts::TS, snes::PetscSNES)Set the SNES (nonlinear solver) to be used by the TS timestepping context
Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()snes- the nonlinear solver context
Level: developer
-seealso: , TS, SNES, TSCreate(), TSSetUp(), TSSolve(), TSGetSNES()
External Links
- PETSc Manual:
Ts/TSSetSNES
PETSc.LibPETSc.TSSetSaveTrajectory — Method
TSSetSaveTrajectory(petsclib::PetscLibType,ts::TS)Causes the TS to save its solutions as it iterates forward in time in a TSTrajectory object
Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Options Database Keys:
-ts_save_trajectory- saves the trajectory to a file-ts_trajectory_type type- set trajectory type
Level: intermediate
-seealso: , TS, TSTrajectory, TSGetTrajectory(), TSAdjointSolve()
External Links
- PETSc Manual:
Ts/TSSetSaveTrajectory
PETSc.LibPETSc.TSSetSolution — Method
TSSetSolution(petsclib::PetscLibType,ts::TS, u::PetscVec)Sets the initial solution vector for use by the TS routines.
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()u- the solution vector
Level: beginner
-seealso: , TS, TSSetSolutionFunction(), TSGetSolution(), TSCreate()
External Links
- PETSc Manual:
Ts/TSSetSolution
PETSc.LibPETSc.TSSetSolutionFunction — Method
TSSetSolutionFunction(petsclib::PetscLibType,ts::TS, f::TSSolutionFn, ctx::Cvoid)Provide a function that computes the solution of the ODE or DAE
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()f- routine for evaluating the solutionctx- [optional] user-defined context for private data for the
function evaluation routine (may be NULL)
Options Database Keys:
-ts_monitor_lg_error- create a graphical monitor of error history, requires user to have providedTSSetSolutionFunction()-ts_monitor_draw_error- Monitor error graphically, requires user to have providedTSSetSolutionFunction()
Level: intermediate
-seealso: , TS, TSSolutionFn, TSSetRHSJacobian(), TSSetIJacobian(), TSComputeSolutionFunction(), TSSetForcingFunction(), TSSetSolution(), TSGetSolution(), TSMonitorLGError(), TSMonitorDrawError()
External Links
- PETSc Manual:
Ts/TSSetSolutionFunction
PETSc.LibPETSc.TSSetStepNumber — Method
TSSetStepNumber(petsclib::PetscLibType,ts::TS, steps::PetscInt)Sets the number of steps completed.
Logically Collective
Input Parameters:
ts- theTScontextsteps- number of steps completed so far
Level: developer
-seealso: , TS, TSGetStepNumber(), TSSetTime(), TSSetTimeStep(), TSSetSolution()
External Links
- PETSc Manual:
Ts/TSSetStepNumber
PETSc.LibPETSc.TSSetTime — Method
TSSetTime(petsclib::PetscLibType,ts::TS, t::PetscReal)Allows one to reset the time.
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()t- the time
Level: intermediate
-seealso: , TS, TSGetTime(), TSSetMaxSteps()
External Links
- PETSc Manual:
Ts/TSSetTime
PETSc.LibPETSc.TSSetTimeError — Method
TSSetTimeError(petsclib::PetscLibType,ts::TS, v::PetscVec)Sets the estimated error vector, if the chosen TSType has an error estimation functionality. This can be used to restart such a time integrator with a given error vector.
Not Collective, but v returned is parallel if ts is parallel
Input Parameters:
ts- theTScontext obtained fromTSCreate()(input parameter).v- the vector containing the error (same size as the solution).
Level: intermediate
-seealso: , TS, TSSetSolution(), TSGetTimeError()
External Links
- PETSc Manual:
Ts/TSSetTimeError
PETSc.LibPETSc.TSSetTimeSpan — Method
TSSetTimeSpan(petsclib::PetscLibType,ts::TS, n::PetscInt, span_times::Vector{PetscReal})sets the time span. The solution will be computed and stored for each time requested in the span
Collective
Input Parameters:
ts- the time-steppern- number of the time points (>=2)span_times- array of the time points, must be increasing. The first element and the last element are the initial time and the final time respectively.
Options Database Key:
-ts_time_span <t0,...tf>- Sets the time span
Level: intermediate
-seealso: , TS, TSSetEvaluationTimes(), TSGetEvaluationTimes(), TSGetEvaluationSolutions()
External Links
- PETSc Manual:
Ts/TSSetTimeSpan
PETSc.LibPETSc.TSSetTimeStep — Method
TSSetTimeStep(petsclib::PetscLibType,ts::TS, time_step::PetscReal)Allows one to reset the timestep at any time, useful for simple pseudo-timestepping codes.
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()time_step- the size of the timestep
Level: intermediate
-seealso: , TS, TSPSEUDO, TSGetTimeStep(), TSSetTime()
External Links
- PETSc Manual:
Ts/TSSetTimeStep
PETSc.LibPETSc.TSSetTolerances — Method
TSSetTolerances(petsclib::PetscLibType,ts::TS, atol::PetscReal, vatol::PetscVec, rtol::PetscReal, vrtol::PetscVec)Set tolerances for local truncation error when using an adaptive controller
Logically Collective
Input Parameters:
ts- time integration contextatol- scalar absolute tolerancesvatol- vector of absolute tolerances orNULL, used in preference toatolif presentrtol- scalar relative tolerancesvrtol- vector of relative tolerances orNULL, used in preference tortolif present
Options Database Keys:
-ts_rtol <rtol>- relative tolerance for local truncation error-ts_atol <atol>- Absolute tolerance for local truncation error
Level: beginner
-seealso: , TS, TSAdapt, TSErrorWeightedNorm(), TSGetTolerances()
External Links
- PETSc Manual:
Ts/TSSetTolerances
PETSc.LibPETSc.TSSetTransientVariable — Method
TSSetTransientVariable(petsclib::PetscLibType,ts::TS, tvar::TSTransientVariableFn, ctx::Cvoid)sets function to transform from state to transient variables
Logically Collective
Input Parameters:
ts- time stepping context on which to change the transient variabletvar- a function that transforms to transient variables, seeTSTransientVariableFnfor the calling sequencectx- a context for tvar
Level: advanced
-seealso: , TS, TSBDF, TSTransientVariableFn, DMTSSetTransientVariable(), DMTSGetTransientVariable(), TSSetIFunction(), TSSetIJacobian()
External Links
- PETSc Manual:
Ts/TSSetTransientVariable
PETSc.LibPETSc.TSSetType — Method
TSSetType(petsclib::PetscLibType,ts::TS, type::TSType)Sets the algorithm/method to be used for integrating the ODE with the given TS.
Collective
Input Parameters:
ts- TheTScontexttype- A known method
Options Database Key:
-ts_type <type>- Sets the method; use -help for a list of available methods (for instance, euler)
Level: intermediate
-seealso: , TS, TSSolve(), TSCreate(), TSSetFromOptions(), TSDestroy(), TSType
External Links
- PETSc Manual:
Ts/TSSetType
PETSc.LibPETSc.TSSetUp — Method
TSSetUp(petsclib::PetscLibType,ts::TS)Sets up the internal data structures for the later use of a timestepper.
Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Level: advanced
-seealso: , TSCreate(), TS, TSStep(), TSDestroy(), TSSolve()
External Links
- PETSc Manual:
Ts/TSSetUp
PETSc.LibPETSc.TSSetUseSplitRHSFunction — Method
TSSetUseSplitRHSFunction(petsclib::PetscLibType,ts::TS, use_splitrhsfnc::PetscBool)Use the split RHSFunction when a multirate method is used.
Logically Collective
Input Parameters:
ts- timestepping contextuse_splitrhsfunction-PETSC_TRUEindicates that the split RHSFunction will be used
Options Database Key:
-ts_use_splitrhsfunction- <true,false>
Level: intermediate
-seealso: , TS, TSGetUseSplitRHSFunction()
External Links
- PETSc Manual:
Ts/TSSetUseSplitRHSFunction
PETSc.LibPETSc.TSSolve — Method
TSSolve(petsclib::PetscLibType,ts::TS, u::PetscVec)Steps the requested number of timesteps.
Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()u- the solution vector (can be null ifTSSetSolution()was used andTSSetExactFinalTime(ts,TS_EXACTFINALTIME_MATCHSTEP) was not used,
otherwise it must contain the initial conditions and will contain the solution at the final requested time
Level: beginner
-seealso: , TS, TSCreate(), TSSetSolution(), TSStep(), TSGetTime(), TSGetSolveTime()
External Links
- PETSc Manual:
Ts/TSSolve
PETSc.LibPETSc.TSStep — Method
TSStep(petsclib::PetscLibType,ts::TS)Steps one time step
Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Level: developer
-seealso: , TS, TSCreate(), TSSetUp(), TSDestroy(), TSSolve(), TSSetPreStep(), TSSetPreStage(), TSSetPostStage(), TSInterpolate()
External Links
- PETSc Manual:
Ts/TSStep
PETSc.LibPETSc.TSSundialsGetIterations — Method
TSSundialsGetIterations(petsclib::PetscLibType,ts::TS, nonlin::Cint, lin::Cint)Gets the number of nonlinear and linear iterations used so far by TSSUNDIALS.
Not Collective
Input Parameter:
ts- the time-step context
Output Parameters:
nonlin- number of nonlinear iterationslin- number of linear iterations
Level: advanced
-seealso: , TSSundialsSetType(), TSSundialsSetMaxl(), TSSundialsSetLinearTolerance(), TSSundialsSetGramSchmidtType(), TSSundialsSetTolerance(), TSSundialsGetPC(), TSSetExactFinalTime()
External Links
- PETSc Manual:
Ts/TSSundialsGetIterations
PETSc.LibPETSc.TSSundialsGetPC — Method
TSSundialsGetPC(petsclib::PetscLibType,ts::TS, pc::PC)Extract the PC context from a time
Input Parameter:
ts- the time-step context
Output Parameter:
pc- the preconditioner context
Level: advanced
-seealso: , TSSundialsGetIterations(), TSSundialsSetType(), TSSundialsSetMaxl(), TSSundialsSetLinearTolerance(), TSSundialsSetGramSchmidtType(), TSSundialsSetTolerance()
External Links
- PETSc Manual:
Ts/TSSundialsGetPC
PETSc.LibPETSc.TSSundialsMonitorInternalSteps — Method
TSSundialsMonitorInternalSteps(petsclib::PetscLibType,ts::TS, ft::PetscBool)Monitor TSSUNDIALS internal steps (Defaults to false).
Input Parameters:
ts- the time-step contextft-PETSC_TRUEif monitor, elsePETSC_FALSE
Level: beginner
-seealso: , TSSundialsGetIterations(), TSSundialsSetType(), TSSundialsSetMaxl(), TSSundialsSetLinearTolerance(), TSSundialsSetGramSchmidtType(), TSSundialsSetTolerance(), TSSundialsGetPC()
External Links
- PETSc Manual:
Ts/TSSundialsMonitorInternalSteps
PETSc.LibPETSc.TSSundialsSetGramSchmidtType — Method
TSSundialsSetGramSchmidtType(petsclib::PetscLibType,ts::TS, type::TSSundialsGramSchmidtType)Sets type of orthogonalization used in GMRES method by TSSUNDIALS linear solver.
Logically Collective
Input Parameters:
ts- the time-step contexttype- eitherSUNDIALS_MODIFIED_GSorSUNDIALS_CLASSICAL_GS
Level: advanced
-seealso: , TSSundialsGetIterations(), TSSundialsSetType(), TSSundialsSetMaxl(), TSSundialsSetLinearTolerance(), TSSundialsSetTolerance(), TSSundialsGetPC(), TSSetExactFinalTime()
External Links
- PETSc Manual:
Ts/TSSundialsSetGramSchmidtType
PETSc.LibPETSc.TSSundialsSetLinearTolerance — Method
TSSundialsSetLinearTolerance(petsclib::PetscLibType,ts::TS, tol::PetscReal)Sets the tolerance used to solve the linear system by TSSUNDIALS.
Logically Collective
Input Parameters:
ts- the time-step contexttol- the factor by which the tolerance on the nonlinear solver is
multiplied to get the tolerance on the linear solver, .05 by default.
Level: advanced
-seealso: , TSSundialsGetIterations(), TSSundialsSetType(), TSSundialsSetMaxl(), TSSundialsSetGramSchmidtType(), TSSundialsSetTolerance(), TSSundialsGetPC(), TSSetExactFinalTime()
External Links
- PETSc Manual:
Ts/TSSundialsSetLinearTolerance
PETSc.LibPETSc.TSSundialsSetMaxTimeStep — Method
TSSundialsSetMaxTimeStep(petsclib::PetscLibType,ts::TS, maxdt::PetscReal)Largest time step to be chosen by the adaptive controller.
Input Parameters:
ts- the time-step contextmaxdt- lowest time step if positive, negative to deactivate
Level: beginner
-seealso: , TSSundialsSetType(), TSSundialsSetTolerance(),
External Links
- PETSc Manual:
Ts/TSSundialsSetMaxTimeStep
PETSc.LibPETSc.TSSundialsSetMaxl — Method
TSSundialsSetMaxl(petsclib::PetscLibType,ts::TS, maxl::PetscInt)Sets the dimension of the Krylov space used by GMRES in the linear solver in TSSUNDIALS. TSSUNDIALS DOES NOT use restarted GMRES so this is the maximum number of GMRES steps that will be used.
Logically Collective
Input Parameters:
ts- the time-step contextmaxl- number of direction vectors (the dimension of Krylov subspace).
Level: advanced
-seealso: , TSSundialsGetIterations(), TSSundialsSetType(), TSSundialsSetLinearTolerance(), TSSundialsSetGramSchmidtType(), TSSundialsSetTolerance(), TSSundialsGetPC(), TSSetExactFinalTime()
External Links
- PETSc Manual:
Ts/TSSundialsSetMaxl
PETSc.LibPETSc.TSSundialsSetMaxord — Method
TSSundialsSetMaxord(petsclib::PetscLibType,ts::TS, maxord::PetscInt)Sets the maximum order for BDF/Adams method used by TSSUNDIALS.
Logically Collective
Input Parameters:
ts- the time-step contextmaxord- maximum order of BDF / Adams method
Level: advanced
-seealso: , TSSundialsGetIterations(), TSSundialsSetType(), TSSundialsSetLinearTolerance(), TSSundialsSetGramSchmidtType(), TSSundialsSetTolerance(), TSSundialsGetPC(), TSSetExactFinalTime()
External Links
- PETSc Manual:
Ts/TSSundialsSetMaxord
PETSc.LibPETSc.TSSundialsSetMinTimeStep — Method
TSSundialsSetMinTimeStep(petsclib::PetscLibType,ts::TS, mindt::PetscReal)Smallest time step to be chosen by the adaptive controller.
Input Parameters:
ts- the time-step contextmindt- lowest time step if positive, negative to deactivate
-seealso: , TSSundialsSetType(), TSSundialsSetTolerance(),
External Links
- PETSc Manual:
Ts/TSSundialsSetMinTimeStep
PETSc.LibPETSc.TSSundialsSetTolerance — Method
TSSundialsSetTolerance(petsclib::PetscLibType,ts::TS, aabs::PetscReal, rel::PetscReal)Sets the absolute and relative tolerance used by TSSUNDIALS for error control.
Logically Collective
Input Parameters:
ts- the time-step contextaabs- the absolute tolerancerel- the relative tolerance
See the CVODE/SUNDIALS users manual for exact details on these parameters. Essentially these regulate the size of the error for a SINGLE timestep.
Level: intermediate
-seealso: , TSSundialsGetIterations(), TSSundialsSetType(), TSSundialsSetGMRESMaxl(), TSSundialsSetLinearTolerance(), TSSundialsSetGramSchmidtType(), TSSundialsGetPC(), TSSetExactFinalTime()
External Links
- PETSc Manual:
Ts/TSSundialsSetTolerance
PETSc.LibPETSc.TSSundialsSetType — Method
TSSundialsSetType(petsclib::PetscLibType,ts::TS, type::TSSundialsLmmType)Sets the method that TSSUNDIALS will use for integration.
Logically Collective
Input Parameters:
ts- the time-step contexttype- one ofSUNDIALS_ADAMSorSUNDIALS_BDF
Level: intermediate
-seealso: , TSSundialsGetIterations(), TSSundialsSetMaxl(), TSSundialsSetLinearTolerance(), TSSundialsSetGramSchmidtType(), TSSundialsSetTolerance(), TSSundialsGetPC(), TSSetExactFinalTime()
External Links
- PETSc Manual:
Ts/TSSundialsSetType
PETSc.LibPETSc.TSSundialsSetUseDense — Method
TSSundialsSetUseDense(petsclib::PetscLibType,ts::TS, use_dense::PetscBool)Set a flag to use a dense linear solver in TSSUNDIALS (serial only)
Logically Collective
Input Parameters:
ts- the time-step contextuse_dense-PETSC_TRUEto use the dense solver
Level: advanced
External Links
- PETSc Manual:
Ts/TSSundialsSetUseDense
PETSc.LibPETSc.TSThetaGetEndpoint — Method
endpoint::PetscBool = TSThetaGetEndpoint(petsclib::PetscLibType,ts::TS)Gets whether to use the endpoint variant of the method (e.g. trapezoid/Crank
Not Collective
Input Parameter:
ts- timestepping context
Output Parameter:
endpoint-PETSC_TRUEwhen using the endpoint variant
Level: advanced
-seealso: , TSThetaSetEndpoint(), TSTHETA, TSCN
External Links
- PETSc Manual:
Ts/TSThetaGetEndpoint
PETSc.LibPETSc.TSThetaGetTheta — Method
theta::PetscReal = TSThetaGetTheta(petsclib::PetscLibType,ts::TS)Get the abscissa of the stage in (0,1] for TSTHETA
Not Collective
Input Parameter:
ts- timestepping context
Output Parameter:
theta- stage abscissa
Level: advanced
-seealso: , TSThetaSetTheta(), TSTHETA
External Links
- PETSc Manual:
Ts/TSThetaGetTheta
PETSc.LibPETSc.TSThetaSetEndpoint — Method
TSThetaSetEndpoint(petsclib::PetscLibType,ts::TS, flg::PetscBool)Sets whether to use the endpoint variant of the method (e.g. trapezoid/Crank
Not Collective
Input Parameters:
ts- timestepping contextflg-PETSC_TRUEto use the endpoint variant
Options Database Key:
-ts_theta_endpoint <flg>- use the endpoint variant
Level: intermediate
External Links
- PETSc Manual:
Ts/TSThetaSetEndpoint
PETSc.LibPETSc.TSThetaSetTheta — Method
TSThetaSetTheta(petsclib::PetscLibType,ts::TS, theta::PetscReal)Set the abscissa of the stage in (0,1] for TSTHETA
Not Collective
Input Parameters:
ts- timestepping contexttheta- stage abscissa
Options Database Key:
-ts_theta_theta <theta>- set theta
Level: intermediate
-seealso: , TSThetaGetTheta(), TSTHETA, TSCN
External Links
- PETSc Manual:
Ts/TSThetaSetTheta
PETSc.LibPETSc.TSVISetVariableBounds — Method
TSVISetVariableBounds(petsclib::PetscLibType,ts::TS, xl::PetscVec, xu::PetscVec)Sets the lower and upper bounds for the solution vector. xl <= x <= xu
Input Parameters:
ts- theTScontext.xl- lower bound.xu- upper bound.
Level: advanced
External Links
- PETSc Manual:
Ts/TSVISetVariableBounds
PETSc.LibPETSc.TSView — Method
TSView(petsclib::PetscLibType,ts::TS, viewer::PetscViewer)Prints the TS data structure.
Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()viewer- visualization context
Options Database Key:
-ts_view- callsTSView()at end ofTSStep()
Level: beginner
-seealso: , TS, PetscViewer, PetscViewerASCIIOpen()
External Links
- PETSc Manual:
Ts/TSView
PETSc.LibPETSc.TSViewFromOptions — Method
TSViewFromOptions(petsclib::PetscLibType,ts::TS, obj::PetscObject, name::String)View a TS based on values in the options database
Collective
Input Parameters:
ts- theTScontextobj- Optional object that provides the prefix for the options database keysname- command line option string to be passed by user
Level: intermediate
-seealso: , TS, TSView, PetscObjectViewFromOptions(), TSCreate()
External Links
- PETSc Manual:
Ts/TSViewFromOptions
TS Add-ons
Additional TS utilities and helper functions:
PETSc.LibPETSc.TSAdaptCandidateAdd — Method
TSAdaptCandidateAdd(petsclib::PetscLibType,adapt::TSAdapt, name::String, order::PetscInt, stageorder::PetscInt, ccfl::PetscReal, cost::PetscReal, inuse::PetscBool)add a candidate scheme for the adaptive controller to select from
Logically Collective; No Fortran Support
Input Parameters:
adapt- time step adaptivity context, obtained withTSGetAdapt()orTSAdaptCreate()name- name of the candidate scheme to addorder- order of the candidate schemestageorder- stage order of the candidate schemeccfl- stability coefficient relative to explicit Euler, used for CFL constraintscost- relative measure of the amount of work required for the candidate schemeinuse- indicates that this scheme is the one currently in use, this flag can only be set for one scheme
Level: developer
-seealso: , TSAdapt, TSAdaptCandidatesClear(), TSAdaptChoose()
External Links
- PETSc Manual:
Ts/TSAdaptCandidateAdd
PETSc.LibPETSc.TSAdaptCandidatesClear — Method
TSAdaptCandidatesClear(petsclib::PetscLibType,adapt::TSAdapt)clear any previously set candidate schemes
Logically Collective
Input Parameter:
adapt- adaptive controller
Level: developer
-seealso: , TSAdapt, TSAdaptCreate(), TSAdaptCandidateAdd(), TSAdaptChoose()
External Links
- PETSc Manual:
Ts/TSAdaptCandidatesClear
PETSc.LibPETSc.TSAdaptCandidatesGet — Method
n::PetscInt,order::PetscInt,stageorder::PetscInt,ccfl::PetscReal,cost::PetscReal = TSAdaptCandidatesGet(petsclib::PetscLibType,adapt::TSAdapt)Get the list of candidate orders of accuracy and cost
Not Collective
Input Parameter:
adapt- time step adaptivity context
Output Parameters:
n- number of candidate schemes, always at least 1order- the order of each candidate schemestageorder- the stage order of each candidate schemeccfl- the CFL coefficient of each schemecost- the relative cost of each scheme
Level: developer
-seealso: , TSAdapt, TSAdaptCandidatesClear(), TSAdaptCandidateAdd(), TSAdaptChoose()
External Links
- PETSc Manual:
Ts/TSAdaptCandidatesGet
PETSc.LibPETSc.TSAdaptCheckStage — Method
accept::PetscBool = TSAdaptCheckStage(petsclib::PetscLibType,adapt::TSAdapt, ts::TS, t::PetscReal, Y::PetscVec)checks whether to accept a stage, (e.g. reject and change time step size if nonlinear solve fails or solution vector is infeasible)
Collective
Input Parameters:
adapt- adaptive controller contextts- time steppert- Current simulation timeY- Current solution vector
Output Parameter:
accept-PETSC_TRUEto accept the stage,PETSC_FALSEto reject
Level: developer
External Links
- PETSc Manual:
Ts/TSAdaptCheckStage
PETSc.LibPETSc.TSAdaptChoose — Method
next_sc::PetscInt,next_h::PetscReal,accept::PetscBool = TSAdaptChoose(petsclib::PetscLibType,adapt::TSAdapt, ts::TS, h::PetscReal)choose which method and step size to use for the next step
Collective
Input Parameters:
adapt- adaptive controllerts- time stepperh- current step size
Output Parameters:
next_sc- optional, scheme to use for the next stepnext_h- step size to use for the next stepaccept-PETSC_TRUEto accept the current step,PETSC_FALSEto repeat the current step with the new step size
Level: developer
-seealso: , TSAdapt, TSAdaptCandidatesClear(), TSAdaptCandidateAdd()
External Links
- PETSc Manual:
Ts/TSAdaptChoose
PETSc.LibPETSc.TSAdaptCreate — Method
inadapt::TSAdapt = TSAdaptCreate(petsclib::PetscLibType,comm::MPI_Comm)create an adaptive controller context for time stepping
Collective
Input Parameter:
comm- The communicator
Output Parameter:
inadapt- newTSAdaptobject
Level: developer
-seealso: , TSAdapt, TSGetAdapt(), TSAdaptSetType(), TSAdaptDestroy()
External Links
- PETSc Manual:
Ts/TSAdaptCreate
PETSc.LibPETSc.TSAdaptDSPSetFilter — Method
TSAdaptDSPSetFilter(petsclib::PetscLibType,adapt::TSAdapt, name::String)Sets internal parameters corresponding to the named filter {cite}soderlind2006adaptive {cite}soderlind2003digital
Collective
Input Parameters:
adapt- adaptive controller contextname- filter name
Options Database Key:
-ts_adapt_dsp_filter <name>- Sets predefined controller by name; use -help for a list of available controllers
Filter names:
basic- similar toTSADAPTBASICbut with different criteria for step rejections.PI30, PI42, PI33, PI34- PI controllers.PC11, PC47, PC36- predictive controllers.H0211, H211b, H211PI- digital filters with orders dynamics=2, adaptivity=1, filter=1.H0312, H312b, H312PID- digital filters with orders dynamics=3, adaptivity=1, filter=2.H0321, H321- digital filters with orders dynamics=3, adaptivity=2, filter=1.
Level: intermediate
-seealso: , TSADAPTDSP, TS, TSAdapt, TSGetAdapt(), TSAdaptDSPSetPID()
External Links
- PETSc Manual:
Ts/TSAdaptDSPSetFilter
PETSc.LibPETSc.TSAdaptDSPSetPID — Method
TSAdaptDSPSetPID(petsclib::PetscLibType,adapt::TSAdapt, kkI::PetscReal, kkP::PetscReal, kkD::PetscReal)Set the PID controller parameters {cite}soderlind2006adaptive {cite}soderlind2003digital
Input Parameters:
adapt- adaptive controller contextkkI- Integral parameterkkP- Proportional parameterkkD- Derivative parameter
Options Database Key:
-ts_adapt_dsp_pid <kkI,kkP,kkD>- Sets PID controller parameters
Level: intermediate
-seealso: , TS, TSAdapt, TSGetAdapt(), TSAdaptDSPSetFilter()
External Links
- PETSc Manual:
Ts/TSAdaptDSPSetPID
PETSc.LibPETSc.TSAdaptDestroy — Method
PETSc.LibPETSc.TSAdaptFinalizePackage — Method
TSAdaptFinalizePackage(petsclib::PetscLibType)This function destroys everything in the TS package. It is called from PetscFinalize().
Level: developer
External Links
- PETSc Manual:
Ts/TSAdaptFinalizePackage
PETSc.LibPETSc.TSAdaptGetClip — Method
low::PetscReal,high::PetscReal = TSAdaptGetClip(petsclib::PetscLibType,adapt::TSAdapt)Gets the admissible decrease/increase factor in step size in the time step adapter
Not Collective
Input Parameter:
adapt- adaptive controller context
Output Parameters:
low- optional, admissible decrease factorhigh- optional, admissible increase factor
Level: intermediate
-seealso: , TSAdapt, TSAdaptChoose(), TSAdaptSetClip(), TSAdaptSetScaleSolveFailed()
External Links
- PETSc Manual:
Ts/TSAdaptGetClip
PETSc.LibPETSc.TSAdaptGetMaxIgnore — Method
max_ignore::PetscReal = TSAdaptGetMaxIgnore(petsclib::PetscLibType,adapt::TSAdapt)Get error estimation threshold. Solution components below this threshold value will not be considered when computing error norms for time step adaptivity (in absolute value).
Not Collective
Input Parameter:
adapt- adaptive controller context
Output Parameter:
max_ignore- threshold for solution components that are ignored during error estimation
Level: intermediate
-seealso: , TSAdapt, TSAdaptSetMaxIgnore(), TSAdaptChoose()
External Links
- PETSc Manual:
Ts/TSAdaptGetMaxIgnore
PETSc.LibPETSc.TSAdaptGetSafety — Method
safety::PetscReal,reject_safety::PetscReal = TSAdaptGetSafety(petsclib::PetscLibType,adapt::TSAdapt)Get safety factors for time step adapter
Not Collective
Input Parameter:
adapt- adaptive controller context
Output Parameters:
safety- safety factor relative to target error/stability goalreject_safety- extra safety factor to apply if the last step was rejected
Level: intermediate
-seealso: , TSAdapt, TSAdaptSetSafety(), TSAdaptChoose()
External Links
- PETSc Manual:
Ts/TSAdaptGetSafety
PETSc.LibPETSc.TSAdaptGetScaleSolveFailed — Method
scale::PetscReal = TSAdaptGetScaleSolveFailed(petsclib::PetscLibType,adapt::TSAdapt)Gets the admissible decrease/increase factor in step size
Not Collective
Input Parameter:
adapt- adaptive controller context
Output Parameter:
scale- scale factor
Level: intermediate
-seealso: , TSAdapt, TSAdaptChoose(), TSAdaptSetScaleSolveFailed(), TSAdaptSetClip()
External Links
- PETSc Manual:
Ts/TSAdaptGetScaleSolveFailed
PETSc.LibPETSc.TSAdaptGetStepLimits — Method
hmin::PetscReal,hmax::PetscReal = TSAdaptGetStepLimits(petsclib::PetscLibType,adapt::TSAdapt)Get the minimum and maximum step sizes to be considered by the time step controller
Not Collective
Input Parameter:
adapt- time step adaptivity context, usually gotten withTSGetAdapt()
Output Parameters:
hmin- minimum time stephmax- maximum time step
Level: intermediate
-seealso: , TSAdapt, TSAdaptSetStepLimits(), TSAdaptChoose()
External Links
- PETSc Manual:
Ts/TSAdaptGetStepLimits
PETSc.LibPETSc.TSAdaptGetType — Method
type::TSAdaptType = TSAdaptGetType(petsclib::PetscLibType,adapt::TSAdapt)gets the TS adapter method type (as a string).
Not Collective
Input Parameter:
adapt- TheTSadapter, most likely obtained withTSGetAdapt()
Output Parameter:
type- The name ofTSadapter method
Level: intermediate
-seealso: TSAdapt, TSAdaptType, TSAdaptSetType()
External Links
- PETSc Manual:
Ts/TSAdaptGetType
PETSc.LibPETSc.TSAdaptHistoryGetStep — Method
t::PetscReal,dt::PetscReal = TSAdaptHistoryGetStep(petsclib::PetscLibType,adapt::TSAdapt, step::PetscInt)Gets time and time step for a given step number in the history
Logically Collective
Input Parameters:
adapt- the TSAdapt contextstep- the step number
Output Parameters:
t- the time corresponding to the requested step (can beNULL)dt- the time step to be taken at the requested step (can beNULL)
Level: advanced
-seealso: , TS, TSGetAdapt(), TSAdaptSetType(), TSAdaptHistorySetTrajectory(), TSADAPTHISTORY
External Links
- PETSc Manual:
Ts/TSAdaptHistoryGetStep
PETSc.LibPETSc.TSAdaptHistorySetHistory — Method
TSAdaptHistorySetHistory(petsclib::PetscLibType,adapt::TSAdapt, n::PetscInt, hist::Vector{PetscReal}, backward::PetscBool)Sets the time history in the adaptor
Logically Collective
Input Parameters:
adapt- theTSAdaptcontextn- size of the time historyhist- the time historybackward- if the time history has to be followed backward
Level: advanced
-seealso: , TSGetAdapt(), TSAdaptSetType(), TSAdaptHistorySetTrajectory(), TSADAPTHISTORY
External Links
- PETSc Manual:
Ts/TSAdaptHistorySetHistory
PETSc.LibPETSc.TSAdaptHistorySetTrajectory — Method
TSAdaptHistorySetTrajectory(petsclib::PetscLibType,adapt::TSAdapt, tj::TSTrajectory, backward::PetscBool)Sets a time history in the adaptor from a given TSTrajectory
Logically Collective
Input Parameters:
adapt- theTSAdaptcontexttj- theTSTrajectorycontextbackward- if the time history has to be followed backward
Level: advanced
-seealso: , TSGetAdapt(), TSAdaptSetType(), TSAdaptHistorySetHistory(), TSADAPTHISTORY, TSAdapt
External Links
- PETSc Manual:
Ts/TSAdaptHistorySetTrajectory
PETSc.LibPETSc.TSAdaptInitializePackage — Method
TSAdaptInitializePackage(petsclib::PetscLibType)This function initializes everything in the TSAdapt package. It is called from TSInitializePackage().
Level: developer
External Links
- PETSc Manual:
Ts/TSAdaptInitializePackage
PETSc.LibPETSc.TSAdaptLoad — Method
TSAdaptLoad(petsclib::PetscLibType,adapt::TSAdapt, viewer::PetscViewer)Loads a TSAdapt that has been stored in binary with TSAdaptView().
Collective
Input Parameters:
adapt- the newly loadedTSAdapt, this needs to have been created withTSAdaptCreate()or
some related function before a call to TSAdaptLoad().
viewer- binary file viewer, obtained fromPetscViewerBinaryOpen()or
HDF5 file viewer, obtained from PetscViewerHDF5Open()
Level: intermediate
-seealso: , PetscViewerBinaryOpen(), TSAdaptView(), MatLoad(), VecLoad(), TSAdapt
External Links
- PETSc Manual:
Ts/TSAdaptLoad
PETSc.LibPETSc.TSAdaptRegister — Method
TSAdaptRegister(petsclib::PetscLibType,sname::String, fnc::external)adds a TSAdapt implementation
Not Collective, No Fortran Support
Input Parameters:
sname- name of user-defined adaptivity schemefunction- routine to create method context
Level: advanced
-seealso: , TSAdaptRegisterAll()
External Links
- PETSc Manual:
Ts/TSAdaptRegister
PETSc.LibPETSc.TSAdaptReset — Method
TSAdaptReset(petsclib::PetscLibType,adapt::TSAdapt)Resets a TSAdapt context to its defaults
Collective
Input Parameter:
adapt- theTSAdaptcontext obtained fromTSGetAdapt()orTSAdaptCreate()
Level: developer
-seealso: , TSGetAdapt(), TSAdapt, TSAdaptCreate(), TSAdaptDestroy()
External Links
- PETSc Manual:
Ts/TSAdaptReset
PETSc.LibPETSc.TSAdaptSetAlwaysAccept — Method
TSAdaptSetAlwaysAccept(petsclib::PetscLibType,adapt::TSAdapt, flag::PetscBool)Set whether to always accept steps regardless of any error or stability condition not meeting the prescribed goal.
Logically Collective
Input Parameters:
adapt- time step adaptivity context, usually gotten withTSGetAdapt()flag- whether to always accept steps
Options Database Key:
-ts_adapt_always_accept- to always accept steps
Level: intermediate
-seealso: , TSAdapt, TSGetAdapt(), TSAdaptChoose()
External Links
- PETSc Manual:
Ts/TSAdaptSetAlwaysAccept
PETSc.LibPETSc.TSAdaptSetCheckStage — Method
TSAdaptSetCheckStage(petsclib::PetscLibType,adapt::TSAdapt, func::external)Set a callback to check convergence for a stage
Logically Collective
Input Parameters:
adapt- adaptive controller contextfunc- stage check function
Calling sequence:
adapt- adaptive controller contextts- time stepping contextt- current timeY- current solution vectoraccept- pending choice of whether to accept, can be modified by this routine
Level: advanced
-seealso: , TSAdapt, TSGetAdapt(), TSAdaptChoose()
External Links
- PETSc Manual:
Ts/TSAdaptSetCheckStage
PETSc.LibPETSc.TSAdaptSetClip — Method
TSAdaptSetClip(petsclib::PetscLibType,adapt::TSAdapt, low::PetscReal, high::PetscReal)Sets the admissible decrease/increase factor in step size in the time step adapter
Logically collective
Input Parameters:
adapt- adaptive controller contextlow- admissible decrease factorhigh- admissible increase factor
Options Database Key:
-ts_adapt_clip <low>,<high>- to set admissible time step decrease and increase factors
Level: intermediate
-seealso: , TSAdapt, TSAdaptChoose(), TSAdaptGetClip(), TSAdaptSetScaleSolveFailed()
External Links
- PETSc Manual:
Ts/TSAdaptSetClip
PETSc.LibPETSc.TSAdaptSetFromOptions — Method
TSAdaptSetFromOptions(petsclib::PetscLibType,adapt::TSAdapt, PetscOptionsObject::PetscOptionItems)Sets various TSAdapt parameters from user options.
Collective
Input Parameters:
adapt- theTSAdaptcontextPetscOptionsObject- object created byPetscOptionsBegin()
Options Database Keys:
-ts_adapt_type <type>- algorithm to use for adaptivity-ts_adapt_always_accept- always accept steps regardless of error/stability goals-ts_adapt_safety <safety>- safety factor relative to target error/stability goal-ts_adapt_reject_safety <safety>- extra safety factor to apply if the last step was rejected-ts_adapt_clip <low,high>- admissible time step decrease and increase factors-ts_adapt_dt_min <min>- minimum timestep to use-ts_adapt_dt_max <max>- maximum timestep to use-ts_adapt_scale_solve_failed <scale>- scale timestep by this factor if a solve fails-ts_adapt_wnormtype <2 or infinity>- type of norm for computing error estimates-ts_adapt_time_step_increase_delay- number of timesteps to delay increasing the time step after it has been decreased due to failed solver
Level: advanced
-seealso: , TSAdapt, TSGetAdapt(), TSAdaptSetType(), TSAdaptSetAlwaysAccept(), TSAdaptSetSafety(), TSAdaptSetClip(), TSAdaptSetScaleSolveFailed(), TSAdaptSetStepLimits(), TSAdaptSetMonitor()
External Links
- PETSc Manual:
Ts/TSAdaptSetFromOptions
PETSc.LibPETSc.TSAdaptSetMaxIgnore — Method
TSAdaptSetMaxIgnore(petsclib::PetscLibType,adapt::TSAdapt, max_ignore::PetscReal)Set error estimation threshold. Solution components below this threshold value will not be considered when computing error norms for time step adaptivity (in absolute value). A negative value (default) of the threshold leads to considering all solution components.
Logically Collective
Input Parameters:
adapt- adaptive controller contextmax_ignore- threshold for solution components that are ignored during error estimation
Options Database Key:
-ts_adapt_max_ignore <max_ignore>- to set the threshold
Level: intermediate
-seealso: , TSAdapt, TSAdaptGetMaxIgnore(), TSAdaptChoose()
External Links
- PETSc Manual:
Ts/TSAdaptSetMaxIgnore
PETSc.LibPETSc.TSAdaptSetMonitor — Method
TSAdaptSetMonitor(petsclib::PetscLibType,adapt::TSAdapt, flg::PetscBool)Monitor the choices made by the adaptive controller
Collective
Input Parameters:
adapt- adaptive controller contextflg-PETSC_TRUEto active a monitor,PETSC_FALSEto disable
Options Database Key:
-ts_adapt_monitor- to turn on monitoring
Level: intermediate
-seealso: , TSAdapt, TSGetAdapt(), TSAdaptChoose()
External Links
- PETSc Manual:
Ts/TSAdaptSetMonitor
PETSc.LibPETSc.TSAdaptSetOptionsPrefix — Method
TSAdaptSetOptionsPrefix(petsclib::PetscLibType,adapt::TSAdapt, prefix::String)External Links
- PETSc Manual:
Ts/TSAdaptSetOptionsPrefix
PETSc.LibPETSc.TSAdaptSetSafety — Method
TSAdaptSetSafety(petsclib::PetscLibType,adapt::TSAdapt, safety::PetscReal, reject_safety::PetscReal)Set safety factors for time step adaptor
Logically Collective
Input Parameters:
adapt- adaptive controller contextsafety- safety factor relative to target error/stability goalreject_safety- extra safety factor to apply if the last step was rejected
Options Database Keys:
-ts_adapt_safety <safety>- to set safety factor-ts_adapt_reject_safety <reject_safety>- to set reject safety factor
Level: intermediate
-seealso: , TSAdapt, TSAdaptGetSafety(), TSAdaptChoose()
External Links
- PETSc Manual:
Ts/TSAdaptSetSafety
PETSc.LibPETSc.TSAdaptSetScaleSolveFailed — Method
TSAdaptSetScaleSolveFailed(petsclib::PetscLibType,adapt::TSAdapt, scale::PetscReal)Scale step size by this factor if solve fails
Logically Collective
Input Parameters:
adapt- adaptive controller contextscale- scale
Options Database Key:
-ts_adapt_scale_solve_failed <scale>- to set scale step by this factor if solve fails
Level: intermediate
-seealso: , TSAdapt, TSAdaptChoose(), TSAdaptGetScaleSolveFailed(), TSAdaptGetClip()
External Links
- PETSc Manual:
Ts/TSAdaptSetScaleSolveFailed
PETSc.LibPETSc.TSAdaptSetStepLimits — Method
TSAdaptSetStepLimits(petsclib::PetscLibType,adapt::TSAdapt, hmin::PetscReal, hmax::PetscReal)Set the minimum and maximum step sizes to be considered by the time step controller
Logically Collective
Input Parameters:
adapt- time step adaptivity context, usually gotten withTSGetAdapt()hmin- minimum time stephmax- maximum time step
Options Database Keys:
-ts_adapt_dt_min <min>- to set minimum time step-ts_adapt_dt_max <max>- to set maximum time step
Level: intermediate
-seealso: , TSAdapt, TSAdaptGetStepLimits(), TSAdaptChoose()
External Links
- PETSc Manual:
Ts/TSAdaptSetStepLimits
PETSc.LibPETSc.TSAdaptSetTimeStepIncreaseDelay — Method
TSAdaptSetTimeStepIncreaseDelay(petsclib::PetscLibType,adapt::TSAdapt, cnt::PetscInt)The number of timesteps to wait after a decrease in the timestep due to failed solver before increasing the time step.
Logicially Collective
Input Parameters:
adapt- adaptive controller contextcnt- the number of timesteps
Options Database Key:
-ts_adapt_time_step_increase_delay cnt- number of steps to delay the increase
Level: advanced
External Links
- PETSc Manual:
Ts/TSAdaptSetTimeStepIncreaseDelay
PETSc.LibPETSc.TSAdaptSetType — Method
TSAdaptSetType(petsclib::PetscLibType,adapt::TSAdapt, type::TSAdaptType)sets the approach used for the error adapter
Logicially Collective
Input Parameters:
adapt- theTSadapter, most likely obtained withTSGetAdapt()type- one of theTSAdaptType
Options Database Key:
-ts_adapt_type <basic or dsp or none>- to set the adapter type
Level: intermediate
-seealso: , TSGetAdapt(), TSAdaptDestroy(), TSAdaptType, TSAdaptGetType()
External Links
- PETSc Manual:
Ts/TSAdaptSetType
PETSc.LibPETSc.TSAdaptView — Method
TSAdaptView(petsclib::PetscLibType,adapt::TSAdapt, viewer::PetscViewer)External Links
- PETSc Manual:
Ts/TSAdaptView
PETSc.LibPETSc.TSGLLEAdaptChoose — Method
next_sc::PetscInt,next_h::PetscReal,finish::PetscBool = TSGLLEAdaptChoose(petsclib::PetscLibType,adapt::TSGLLEAdapt, n::PetscInt, orders::Vector{PetscInt}, errors::Vector{PetscReal}, cost::Vector{PetscReal}, cur::PetscInt, h::PetscReal, tleft::PetscReal)External Links
- PETSc Manual:
Ts/TSGLLEAdaptChoose
PETSc.LibPETSc.TSGLLEAdaptCreate — Method
inadapt::TSGLLEAdapt = TSGLLEAdaptCreate(petsclib::PetscLibType,comm::MPI_Comm)External Links
- PETSc Manual:
Ts/TSGLLEAdaptCreate
PETSc.LibPETSc.TSGLLEAdaptDestroy — Method
TSGLLEAdaptDestroy(petsclib::PetscLibType,adapt::TSGLLEAdapt)External Links
- PETSc Manual:
Ts/TSGLLEAdaptDestroy
PETSc.LibPETSc.TSGLLEAdaptFinalizePackage — Method
TSGLLEAdaptFinalizePackage(petsclib::PetscLibType)This function destroys everything in the TSGLLE package. It is called from PetscFinalize().
Level: developer
-seealso: , PetscFinalize(), TSGLLEAdapt, TSGLLEAdaptInitializePackage()
External Links
- PETSc Manual:
Ts/TSGLLEAdaptFinalizePackage
PETSc.LibPETSc.TSGLLEAdaptInitializePackage — Method
TSGLLEAdaptInitializePackage(petsclib::PetscLibType)This function initializes everything in the TSGLLEAdapt package. It is called from TSInitializePackage().
Level: developer
-seealso: , PetscInitialize(), TSGLLEAdapt, TSGLLEAdaptFinalizePackage()
External Links
- PETSc Manual:
Ts/TSGLLEAdaptInitializePackage
PETSc.LibPETSc.TSGLLEAdaptRegister — Method
TSGLLEAdaptRegister(petsclib::PetscLibType,sname::String, fnc::external)adds a TSGLLEAdapt implementation
Not Collective, No Fortran Support
Input Parameters:
sname- name of user-defined adaptivity schemefunction- routine to create method context
Level: advanced
-seealso: , TSGLLE, TSGLLEAdapt, TSGLLEAdaptRegisterAll()
External Links
- PETSc Manual:
Ts/TSGLLEAdaptRegister
PETSc.LibPETSc.TSGLLEAdaptSetFromOptions — Method
TSGLLEAdaptSetFromOptions(petsclib::PetscLibType,adapt::TSGLLEAdapt, PetscOptionsObject::PetscOptionItems)External Links
- PETSc Manual:
Ts/TSGLLEAdaptSetFromOptions
PETSc.LibPETSc.TSGLLEAdaptSetOptionsPrefix — Method
TSGLLEAdaptSetOptionsPrefix(petsclib::PetscLibType,adapt::TSGLLEAdapt, prefix::String)External Links
- PETSc Manual:
Ts/TSGLLEAdaptSetOptionsPrefix
PETSc.LibPETSc.TSGLLEAdaptSetType — Method
TSGLLEAdaptSetType(petsclib::PetscLibType,adapt::TSGLLEAdapt, type::TSGLLEAdaptType)External Links
- PETSc Manual:
Ts/TSGLLEAdaptSetType
PETSc.LibPETSc.TSGLLEAdaptView — Method
TSGLLEAdaptView(petsclib::PetscLibType,adapt::TSGLLEAdapt, viewer::PetscViewer)External Links
- PETSc Manual:
Ts/TSGLLEAdaptView
PETSc.LibPETSc.TSMonitorDrawCtxCreate — Method
ctx::TSMonitorDrawCtx = TSMonitorDrawCtxCreate(petsclib::PetscLibType,comm::MPI_Comm, host::String, label::String, x::Cint, y::Cint, m::Cint, n::Cint, howoften::PetscInt)Creates the monitor context for TSMonitorDrawCtx
Collective
Input Parameters:
comm- the MPI communicator to usehost- the X display to open, orNULLfor the local machinelabel- the title to put in the title barx- the x screen coordinates of the upper left coordinate of the windowy- the y screen coordinates of the upper left coordinate of the windowm- the screen width in pixelsn- the screen height in pixelshowoften- if positive then determines the frequency of the plotting, if -1 then only at the final time
Output Parameter:
ctx- the monitor context
Options Database Keys:
-ts_monitor_draw_solution- draw the solution at each time-step-ts_monitor_draw_solution_initial- show initial solution as well as current solution
Level: intermediate
-seealso: , TS, TSMonitorDrawCtxDestroy(), TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorDrawCtx, PetscMonitorDrawSolution()
External Links
- PETSc Manual:
Ts/TSMonitorDrawCtxCreate
PETSc.LibPETSc.TSMonitorDrawCtxDestroy — Method
TSMonitorDrawCtxDestroy(petsclib::PetscLibType,ictx::TSMonitorDrawCtx)Destroys the monitor context for TSMonitorDrawSolution()
Collective
Input Parameter:
ictx- the monitor context
Level: intermediate
-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorDrawSolution(), TSMonitorDrawError(), TSMonitorDrawCtx
External Links
- PETSc Manual:
Ts/TSMonitorDrawCtxDestroy
PETSc.LibPETSc.TSMonitorEnvelopeCtxCreate — Method
ctx::TSMonitorEnvelopeCtx = TSMonitorEnvelopeCtxCreate(petsclib::PetscLibType,ts::TS)Creates a context for use with TSMonitorEnvelope()
Collective
Input Parameter:
ts- theTSsolver object
Output Parameter:
ctx- the context
Level: intermediate
-seealso: , TS, TSMonitorLGTimeStep(), TSMonitorSet(), TSMonitorLGSolution(), TSMonitorLGError()
External Links
- PETSc Manual:
Ts/TSMonitorEnvelopeCtxCreate
PETSc.LibPETSc.TSMonitorEnvelopeCtxDestroy — Method
TSMonitorEnvelopeCtxDestroy(petsclib::PetscLibType,ctx::TSMonitorEnvelopeCtx)Destroys a context that was created with TSMonitorEnvelopeCtxCreate().
Collective
Input Parameter:
ctx- the monitor context
Level: intermediate
-seealso: , TS, TSMonitorLGCtxCreate(), TSMonitorSet(), TSMonitorLGTimeStep()
External Links
- PETSc Manual:
Ts/TSMonitorEnvelopeCtxDestroy
PETSc.LibPETSc.TSMonitorHGCtxCreate — Method
ctx::TSMonitorHGCtx = TSMonitorHGCtxCreate(petsclib::PetscLibType,comm::MPI_Comm, host::String, label::String, x::Cint, y::Cint, m::Cint, n::Cint, howoften::PetscInt, Ns::PetscInt, Nb::PetscInt, velocity::PetscBool)External Links
- PETSc Manual:
Ts/TSMonitorHGCtxCreate
PETSc.LibPETSc.TSMonitorHGCtxDestroy — Method
TSMonitorHGCtxDestroy(petsclib::PetscLibType,ctx::TSMonitorHGCtx)External Links
- PETSc Manual:
Ts/TSMonitorHGCtxDestroy
PETSc.LibPETSc.TSMonitorLGCtxCreate — Method
ctx::TSMonitorLGCtx = TSMonitorLGCtxCreate(petsclib::PetscLibType,comm::MPI_Comm, host::String, label::String, x::Cint, y::Cint, m::Cint, n::Cint, howoften::PetscInt)Creates a TSMonitorLGCtx context for use with TS to monitor the solution process graphically in various ways
Collective
Input Parameters:
comm- the MPI communicator to usehost- the X display to open, orNULLfor the local machinelabel- the title to put in the title barx- the x screen coordinates of the upper left coordinate of the windowy- the y screen coordinates of the upper left coordinate of the windowm- the screen width in pixelsn- the screen height in pixelshowoften- if positive then determines the frequency of the plotting, if -1 then only at the final time
Output Parameter:
ctx- the context
Options Database Keys:
-ts_monitor_lg_timestep- automatically sets line graph monitor-ts_monitor_lg_timestep_log- automatically sets line graph monitor-ts_monitor_lg_solution- monitor the solution (or certain values of the solution by callingTSMonitorLGSetDisplayVariables()orTSMonitorLGCtxSetDisplayVariables())-ts_monitor_lg_error- monitor the error-ts_monitor_lg_ksp_iterations- monitor the number ofKSPiterations needed for each timestep-ts_monitor_lg_snes_iterations- monitor the number ofSNESiterations needed for each timestep-lg_use_markers <true,false>- mark the data points (at each time step) on the plot; default is true
Level: intermediate
-seealso: , TSMonitorLGTimeStep(), TSMonitorSet(), TSMonitorLGSolution(), TSMonitorLGError(), TSMonitorDefault(), VecView(), TSMonitorLGCtxSetVariableNames(), TSMonitorLGCtxGetVariableNames(), TSMonitorLGSetVariableNames(), TSMonitorLGGetVariableNames(), TSMonitorLGSetDisplayVariables(), TSMonitorLGCtxSetDisplayVariables(), TSMonitorLGCtxSetTransform(), TSMonitorLGSetTransform(), TSMonitorLGSNESIterations(), TSMonitorLGKSPIterations(), TSMonitorEnvelopeCtxCreate(), TSMonitorEnvelopeGetBounds(), TSMonitorEnvelopeCtxDestroy(), TSMonitorEnvelop()
External Links
- PETSc Manual:
Ts/TSMonitorLGCtxCreate
PETSc.LibPETSc.TSMonitorLGCtxDestroy — Method
TSMonitorLGCtxDestroy(petsclib::PetscLibType,ctx::TSMonitorLGCtx)Destroys a line graph context that was created with TSMonitorLGCtxCreate().
Collective
Input Parameter:
ctx- the monitor context
Level: intermediate
-seealso: , TS, TSMonitorLGCtxCreate(), TSMonitorSet(), TSMonitorLGTimeStep()
External Links
- PETSc Manual:
Ts/TSMonitorLGCtxDestroy
PETSc.LibPETSc.TSMonitorLGCtxNetworkCreate — Method
ctx::TSMonitorLGCtxNetwork = TSMonitorLGCtxNetworkCreate(petsclib::PetscLibType,ts::TS, host::String, label::String, x::Cint, y::Cint, m::Cint, n::Cint, howoften::PetscInt)External Links
- PETSc Manual:
Ts/TSMonitorLGCtxNetworkCreate
PETSc.LibPETSc.TSMonitorLGCtxNetworkDestroy — Method
TSMonitorLGCtxNetworkDestroy(petsclib::PetscLibType,ctx::TSMonitorLGCtxNetwork)Destroys line graph contexts that where created with TSMonitorLGCtxNetworkCreate().
Collective
Input Parameter:
ctx- the monitor context
Level: intermediate
-seealso: , TS, TSMonitorLGCtxNetworkSolution()
External Links
- PETSc Manual:
Ts/TSMonitorLGCtxNetworkDestroy
PETSc.LibPETSc.TSMonitorLGCtxNetworkSolution — Method
TSMonitorLGCtxNetworkSolution(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, dctx::Cvoid)Monitors progress of the TS solvers for a DMNETWORK solution with one window for each vertex and each edge
Collective
Input Parameters:
ts- theTScontextstep- current time-stepptime- current timeu- current solutiondctx- theTSMonitorLGCtxNetworkobject that contains all the options for the monitoring, this is created withTSMonitorLGCtxCreateNetwork()
Options Database Key:
-ts_monitor_lg_solution_variables- monitor solution variables
Level: intermediate
-seealso: , TS, TSMonitorLGCtxNetworkDestroy()
External Links
- PETSc Manual:
Ts/TSMonitorLGCtxNetworkSolution
PETSc.LibPETSc.TSMonitorLGCtxSetDisplayVariables — Method
TSMonitorLGCtxSetDisplayVariables(petsclib::PetscLibType,ctx::TSMonitorLGCtx, displaynames::Cchar)Sets the variables that are to be display in the monitor
Collective
Input Parameters:
ctx- theTSMonitorLGcontextdisplaynames- the names of the components, final string must beNULL
Level: intermediate
-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorLGSetVariableNames()
External Links
- PETSc Manual:
Ts/TSMonitorLGCtxSetDisplayVariables
PETSc.LibPETSc.TSMonitorLGCtxSetTransform — Method
TSMonitorLGCtxSetTransform(petsclib::PetscLibType,ctx::TSMonitorLGCtx, transform::external, destroy::PetscCtxDestroyFn, tctx::Cvoid)Solution vector will be transformed by provided function before being displayed
Collective
Input Parameters:
tctx- theTScontexttransform- the transform functiondestroy- function to destroy the optional context, seePetscCtxDestroyFnfor its calling sequencectx- optional context used by transform function
Level: intermediate
-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorLGSetVariableNames(), TSMonitorLGSetTransform(), PetscCtxDestroyFn
External Links
- PETSc Manual:
Ts/TSMonitorLGCtxSetTransform
PETSc.LibPETSc.TSMonitorLGCtxSetVariableNames — Method
TSMonitorLGCtxSetVariableNames(petsclib::PetscLibType,ctx::TSMonitorLGCtx, names::Cchar)Sets the name of each component in the solution vector so that it may be displayed in the plot
Collective
Input Parameters:
ctx- theTScontextnames- the names of the components, final string must beNULL
Level: intermediate
-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorLGSetDisplayVariables(), TSMonitorLGSetVariableNames()
External Links
- PETSc Manual:
Ts/TSMonitorLGCtxSetVariableNames
PETSc.LibPETSc.TSMonitorSPCtxCreate — Method
ctx::TSMonitorSPCtx = TSMonitorSPCtxCreate(petsclib::PetscLibType,comm::MPI_Comm, host::String, label::String, x::Cint, y::Cint, m::Cint, n::Cint, howoften::PetscInt, retain::PetscInt, phase::PetscBool, multispecies::PetscBool)External Links
- PETSc Manual:
Ts/TSMonitorSPCtxCreate
PETSc.LibPETSc.TSMonitorSPCtxDestroy — Method
TSMonitorSPCtxDestroy(petsclib::PetscLibType,ctx::TSMonitorSPCtx)External Links
- PETSc Manual:
Ts/TSMonitorSPCtxDestroy
PETSc.LibPETSc.TSMonitorSPEigCtxCreate — Method
ctx::TSMonitorSPEigCtx = TSMonitorSPEigCtxCreate(petsclib::PetscLibType,comm::MPI_Comm, host::String, label::String, x::Cint, y::Cint, m::Cint, n::Cint, howoften::PetscInt)Creates a context for use with TS to monitor the eigenvalues of the linearized operator
Collective
Input Parameters:
comm- the communicator to share the monitorhost- the X display to open, orNULLfor the local machinelabel- the title to put in the title barx- the horizontal screen coordinates of the upper left coordinate of the windowy- the vertical coordinates of the upper left coordinate of the windowm- the screen width in pixelsn- the screen height in pixelshowoften- if positive then determines the frequency of the plotting, if -1 then only at the final time
Output Parameter:
ctx- the context
Options Database Key:
-ts_monitor_sp_eig- plot egienvalues of linearized right-hand side
Level: intermediate
-seealso: , TSMonitorSPEigTimeStep(), TSMonitorSet(), TSMonitorLGSolution(), TSMonitorLGError()
External Links
- PETSc Manual:
Ts/TSMonitorSPEigCtxCreate
PETSc.LibPETSc.TSMonitorSPEigCtxDestroy — Method
TSMonitorSPEigCtxDestroy(petsclib::PetscLibType,ctx::TSMonitorSPEigCtx)Destroys a scatter plot context that was created with TSMonitorSPEigCtxCreate().
Collective
Input Parameter:
ctx- the monitor context
Level: intermediate
-seealso: , TSMonitorSPEigCtxCreate(), TSMonitorSet(), TSMonitorSPEig()
External Links
- PETSc Manual:
Ts/TSMonitorSPEigCtxDestroy
PETSc.LibPETSc.TSTrajectoryCreate — Method
tj::TSTrajectory = TSTrajectoryCreate(petsclib::PetscLibType,comm::MPI_Comm)This function creates an empty trajectory object used to store the time dependent solution of an ODE/DAE
Collective
Input Parameter:
comm- the communicator
Output Parameter:
tj- the trajectory object
Level: developer
-seealso: , TS, TSTrajectory, TSTrajectorySetUp(), TSTrajectoryDestroy(), TSTrajectorySetType(), TSTrajectorySetVariableNames(), TSGetTrajectory(), TSTrajectorySetKeepFiles()
External Links
- PETSc Manual:
Ts/TSTrajectoryCreate
PETSc.LibPETSc.TSTrajectoryDestroy — Method
TSTrajectoryDestroy(petsclib::PetscLibType,tj::TSTrajectory)Destroys a trajectory context
Collective
Input Parameter:
tj- theTSTrajectorycontext obtained fromTSTrajectoryCreate()
Level: developer
-seealso: , TSTrajectory, TSTrajectoryCreate(), TSTrajectorySetUp()
External Links
- PETSc Manual:
Ts/TSTrajectoryDestroy
PETSc.LibPETSc.TSTrajectoryGet — Method
time::PetscReal = TSTrajectoryGet(petsclib::PetscLibType,tj::TSTrajectory, ts::TS, stepnum::PetscInt)Updates the solution vector of a time stepper object by querying the TSTrajectory
Collective
Input Parameters:
tj- the trajectory objectts- the time stepper objectstepnum- the step number
Output Parameter:
time- the time associated with the step number
Level: developer
-seealso: , TS, TSSolve(), TSTrajectorySetUp(), TSTrajectoryDestroy(), TSTrajectorySetType(), TSTrajectorySetVariableNames(), TSGetTrajectory(), TSTrajectorySet(), TSTrajectoryGetVecs(), TSGetSolution()
External Links
- PETSc Manual:
Ts/TSTrajectoryGet
PETSc.LibPETSc.TSTrajectoryGetNumSteps — Method
steps::PetscInt = TSTrajectoryGetNumSteps(petsclib::PetscLibType,tj::TSTrajectory)Return the number of steps registered in the TSTrajectory via TSTrajectorySet().
Not Collective.
Input Parameter:
tj- the trajectory object
Output Parameter:
steps- the number of steps
Level: developer
-seealso: , TS, TSTrajectorySet()
External Links
- PETSc Manual:
Ts/TSTrajectoryGetNumSteps
PETSc.LibPETSc.TSTrajectoryGetSolutionOnly — Method
solution_only::PetscBool = TSTrajectoryGetSolutionOnly(petsclib::PetscLibType,tj::TSTrajectory)Gets the value set with TSTrajectorySetSolutionOnly().
Logically Collective
Input Parameter:
tj- theTSTrajectorycontext
Output Parameter:
solution_only- the boolean flag
Level: developer
-seealso: , TSTrajectory, TSSetSaveTrajectory(), TSTrajectoryCreate(), TSTrajectoryDestroy(), TSTrajectorySetSolutionOnly()
External Links
- PETSc Manual:
Ts/TSTrajectoryGetSolutionOnly
PETSc.LibPETSc.TSTrajectoryGetType — Method
type::TSTrajectoryType = TSTrajectoryGetType(petsclib::PetscLibType,tj::TSTrajectory, ts::TS)Gets the trajectory type
Collective
Input Parameters:
tj- theTSTrajectorycontextts- theTScontext
Output Parameter:
type- a known method
Level: developer
-seealso: , TS, TSTrajectory, TSTrajectoryCreate(), TSTrajectorySetFromOptions(), TSTrajectoryDestroy(), TSTrajectorySetType()
External Links
- PETSc Manual:
Ts/TSTrajectoryGetType
PETSc.LibPETSc.TSTrajectoryGetUpdatedHistoryVecs — Method
TSTrajectoryGetUpdatedHistoryVecs(petsclib::PetscLibType,tj::TSTrajectory, ts::TS, time::PetscReal, U::PetscVec, Udot::PetscVec)Get updated state and time
Collective
Input Parameters:
tj- theTSTrajectorycontextts- theTSsolver contexttime- the requested time
Output Parameters:
U- state vector at given time (can be interpolated)Udot- time-derivative vector at given time (can be interpolated)
Level: developer
-seealso: , TSTrajectory, TSSetSaveTrajectory(), TSTrajectoryCreate(), TSTrajectoryDestroy(), TSTrajectoryRestoreUpdatedHistoryVecs(), TSTrajectoryGetVecs()
External Links
- PETSc Manual:
Ts/TSTrajectoryGetUpdatedHistoryVecs
PETSc.LibPETSc.TSTrajectoryGetVecs — Method
time::PetscReal = TSTrajectoryGetVecs(petsclib::PetscLibType,tj::TSTrajectory, ts::TS, stepnum::PetscInt, U::PetscVec, Udot::PetscVec)Reconstructs the vector of state and its time derivative using information from the TSTrajectory and, possibly, from the TS
Collective
Input Parameters:
tj- the trajectory objectts- the time stepper object (optional)stepnum- the requested step number
Output Parameters:
time- On input time for the step if step number isPETSC_DECIDE, on output the time associated with the step numberU- state vector (can beNULL)Udot- time derivative of state vector (can beNULL)
Level: developer
-seealso: , TS, TSTrajectory, TSTrajectorySetUp(), TSTrajectoryDestroy(), TSTrajectorySetType(), TSTrajectorySetVariableNames(), TSGetTrajectory(), TSTrajectorySet(), TSTrajectoryGet()
External Links
- PETSc Manual:
Ts/TSTrajectoryGetVecs
PETSc.LibPETSc.TSTrajectoryMemorySetType — Method
TSTrajectoryMemorySetType(petsclib::PetscLibType,tj::TSTrajectory, tj_memory_type::TSTrajectoryMemoryType)sets the software that is used to generate the checkpointing schedule.
Logically Collective
Input Parameters:
tj- theTSTrajectorycontexttj_memory_type- Revolve or CAMS
Options Database Key:
-ts_trajectory_memory_type <tj_memory_type>- petsc, revolve, cams
Level: intermediate
-seealso: , TSTrajectory, TSTrajectorySetMaxUnitsRAM(), TSTrajectoryMemoryType
External Links
- PETSc Manual:
Ts/TSTrajectoryMemorySetType
PETSc.LibPETSc.TSTrajectoryRegister — Method
TSTrajectoryRegister(petsclib::PetscLibType,sname::String, fnc::external)Adds a way of storing trajectories to the TS package
Not Collective, No Fortran Support
Input Parameters:
sname- the name of a new user-defined creation routinefunction- the creation routine itself
Level: developer
-seealso: , TSTrajectoryRegisterAll()
External Links
- PETSc Manual:
Ts/TSTrajectoryRegister
PETSc.LibPETSc.TSTrajectoryRegisterAll — Method
TSTrajectoryRegisterAll(petsclib::PetscLibType)Registers all of the TSTrajectory storage schecmes in the TS package.
Not Collective
Level: developer
-seealso: , TSTrajectory, TSTrajectoryRegister()
External Links
- PETSc Manual:
Ts/TSTrajectoryRegisterAll
PETSc.LibPETSc.TSTrajectoryReset — Method
TSTrajectoryReset(petsclib::PetscLibType,tj::TSTrajectory)Resets a trajectory context
Collective
Input Parameter:
tj- theTSTrajectorycontext obtained fromTSGetTrajectory()
Level: developer
-seealso: , TS, TSTrajectory, TSTrajectoryCreate(), TSTrajectorySetUp()
External Links
- PETSc Manual:
Ts/TSTrajectoryReset
PETSc.LibPETSc.TSTrajectoryRestoreUpdatedHistoryVecs — Method
TSTrajectoryRestoreUpdatedHistoryVecs(petsclib::PetscLibType,tj::TSTrajectory, U::PetscVec, Udot::PetscVec)Restores updated state and time
Collective
Input Parameters:
tj- theTSTrajectorycontextU- state vector at given time (can be interpolated)Udot- time-derivative vector at given time (can be interpolated)
Level: developer
-seealso: , TSTrajectory, TSTrajectoryGetUpdatedHistoryVecs()
External Links
- PETSc Manual:
Ts/TSTrajectoryRestoreUpdatedHistoryVecs
PETSc.LibPETSc.TSTrajectorySet — Method
TSTrajectorySet(petsclib::PetscLibType,tj::TSTrajectory, ts::TS, stepnum::PetscInt, time::PetscReal, X::PetscVec)Sets a vector of state in the trajectory object
Collective
Input Parameters:
tj- the trajectory objectts- the time stepper object (optional)stepnum- the step numbertime- the current timeX- the current solution
Level: developer
-seealso: , TSTrajectorySetUp(), TSTrajectoryDestroy(), TSTrajectorySetType(), TSTrajectorySetVariableNames(), TSGetTrajectory(), TSTrajectoryGet(), TSTrajectoryGetVecs()
External Links
- PETSc Manual:
Ts/TSTrajectorySet
PETSc.LibPETSc.TSTrajectorySetDirname — Method
TSTrajectorySetDirname(petsclib::PetscLibType,tj::TSTrajectory, dirname::String)Specify the name of the directory where TSTrajectory disk checkpoints are stored.
Collective
Input Parameters:
tj- theTSTrajectorycontextdirname- the directory name
Options Database Key:
-ts_trajectory_dirname- set the directory name
Level: developer
-seealso: , TSTrajectory, TSTrajectorySetFiletemplate(), TSTrajectorySetUp()
External Links
- PETSc Manual:
Ts/TSTrajectorySetDirname
PETSc.LibPETSc.TSTrajectorySetFiletemplate — Method
TSTrajectorySetFiletemplate(petsclib::PetscLibType,tj::TSTrajectory, filetemplate::String)Specify the name template for the files storing TSTrajectory checkpoints.
Collective
Input Parameters:
tj- theTSTrajectorycontextfiletemplate- the template
Options Database Key:
-ts_trajectory_file_template- set the file name template
Level: developer
-seealso: , TSTrajectory, TSTrajectorySetDirname(), TSTrajectorySetUp()
External Links
- PETSc Manual:
Ts/TSTrajectorySetFiletemplate
PETSc.LibPETSc.TSTrajectorySetFromOptions — Method
TSTrajectorySetFromOptions(petsclib::PetscLibType,tj::TSTrajectory, ts::TS)Sets various TSTrajectory parameters from user options.
Collective
Input Parameters:
tj- theTSTrajectorycontext obtained fromTSGetTrajectory()ts- theTScontext
Options Database Keys:
-ts_trajectory_type <type>- basic, memory, singlefile, visualization-ts_trajectory_keep_files <true,false>- keep the files generated by the code after the program ends. This is true by default for singlefile and visualization-ts_trajectory_monitor- printTSTrajectoryinformation
Level: developer
-seealso: , TSTrajectory, TSSetSaveTrajectory(), TSTrajectorySetUp()
External Links
- PETSc Manual:
Ts/TSTrajectorySetFromOptions
PETSc.LibPETSc.TSTrajectorySetKeepFiles — Method
TSTrajectorySetKeepFiles(petsclib::PetscLibType,tj::TSTrajectory, flg::PetscBool)Keep the files generated by the TSTrajectory once the program is done
Collective
Input Parameters:
tj- theTSTrajectorycontextflg-PETSC_TRUEto save,PETSC_FALSEto disable
Options Database Key:
-ts_trajectory_keep_files- have it keep the files
Level: advanced
-seealso: , TSTrajectoryCreate(), TSTrajectoryDestroy(), TSTrajectorySetUp(), TSTrajectorySetMonitor()
External Links
- PETSc Manual:
Ts/TSTrajectorySetKeepFiles
PETSc.LibPETSc.TSTrajectorySetMaxCpsDisk — Method
max_cps_disk::PetscInt = TSTrajectorySetMaxCpsDisk(petsclib::PetscLibType,tj::TSTrajectory)Set maximum number of checkpoints on disk
Logically Collective
Input Parameter:
tj- tstrajectory context
Output Parameter:
max_cps_disk- maximum number of checkpoints on disk
Level: intermediate
-seealso: , TSTrajectory, TSTrajectorySetMaxUnitsDisk(), TSTrajectorySetMaxUnitsRAM()
External Links
- PETSc Manual:
Ts/TSTrajectorySetMaxCpsDisk
PETSc.LibPETSc.TSTrajectorySetMaxCpsRAM — Method
max_cps_ram::PetscInt = TSTrajectorySetMaxCpsRAM(petsclib::PetscLibType,tj::TSTrajectory)Set maximum number of checkpoints in RAM
Logically Collective
Input Parameter:
tj- tstrajectory context
Output Parameter:
max_cps_ram- maximum number of checkpoints in RAM
Level: intermediate
-seealso: , TSTrajectory, TSTrajectorySetMaxUnitsRAM()
External Links
- PETSc Manual:
Ts/TSTrajectorySetMaxCpsRAM
PETSc.LibPETSc.TSTrajectorySetMaxUnitsDisk — Method
max_units_disk::PetscInt = TSTrajectorySetMaxUnitsDisk(petsclib::PetscLibType,tj::TSTrajectory)Set maximum number of checkpointing units on disk
Logically Collective
Input Parameter:
tj- tstrajectory context
Output Parameter:
max_units_disk- maximum number of checkpointing units on disk
Level: intermediate
-seealso: , TSTrajectory, TSTrajectorySetMaxCpsDisk()
External Links
- PETSc Manual:
Ts/TSTrajectorySetMaxUnitsDisk
PETSc.LibPETSc.TSTrajectorySetMaxUnitsRAM — Method
max_units_ram::PetscInt = TSTrajectorySetMaxUnitsRAM(petsclib::PetscLibType,tj::TSTrajectory)Set maximum number of checkpointing units in RAM
Logically Collective
Input Parameter:
tj- tstrajectory context
Output Parameter:
max_units_ram- maximum number of checkpointing units in RAM
Level: intermediate
-seealso: , TSTrajectory, TSTrajectorySetMaxCpsRAM()
External Links
- PETSc Manual:
Ts/TSTrajectorySetMaxUnitsRAM
PETSc.LibPETSc.TSTrajectorySetMonitor — Method
TSTrajectorySetMonitor(petsclib::PetscLibType,tj::TSTrajectory, flg::PetscBool)Monitor the schedules generated by the TSTrajectory checkpointing controller
Collective
Input Parameters:
tj- theTSTrajectorycontextflg-PETSC_TRUEto active a monitor,PETSC_FALSEto disable
Options Database Key:
-ts_trajectory_monitor- printTSTrajectoryinformation
Level: developer
-seealso: , TSTrajectory, TSTrajectoryCreate(), TSTrajectoryDestroy(), TSTrajectorySetUp()
External Links
- PETSc Manual:
Ts/TSTrajectorySetMonitor
PETSc.LibPETSc.TSTrajectorySetSolutionOnly — Method
TSTrajectorySetSolutionOnly(petsclib::PetscLibType,tj::TSTrajectory, solution_only::PetscBool)Tells the trajectory to store just the solution, and not any intermediate stage information
Collective
Input Parameters:
tj- theTSTrajectorycontext obtained withTSGetTrajectory()solution_only- the boolean flag
Level: developer
-seealso: , TSTrajectory, TSSetSaveTrajectory(), TSTrajectoryCreate(), TSTrajectoryDestroy(), TSTrajectoryGetSolutionOnly()
External Links
- PETSc Manual:
Ts/TSTrajectorySetSolutionOnly
PETSc.LibPETSc.TSTrajectorySetTransform — Method
TSTrajectorySetTransform(petsclib::PetscLibType,tj::TSTrajectory, transform::external, destroy::external, tctx::Cvoid)Solution vector will be transformed by provided function before being saved to disk
Collective
Input Parameters:
tj- theTSTrajectorycontexttransform- the transform functiondestroy- function to destroy the optional contexttctx- optional context used by transform function
Level: intermediate
-seealso: , TSTrajectorySetVariableNames(), TSTrajectory, TSMonitorLGSetTransform()
External Links
- PETSc Manual:
Ts/TSTrajectorySetTransform
PETSc.LibPETSc.TSTrajectorySetType — Method
TSTrajectorySetType(petsclib::PetscLibType,tj::TSTrajectory, ts::TS, type::TSTrajectoryType)Sets the storage method to be used as in a trajectory
Collective
Input Parameters:
tj- theTSTrajectorycontextts- theTScontexttype- a known method
Options Database Key:
-ts_trajectory_type <type>- Sets the method; use -help for a list of available methods (for instance, basic)
Level: developer
-seealso: , TSTrajectory, TS, TSTrajectoryCreate(), TSTrajectorySetFromOptions(), TSTrajectoryDestroy(), TSTrajectoryGetType()
External Links
- PETSc Manual:
Ts/TSTrajectorySetType
PETSc.LibPETSc.TSTrajectorySetUp — Method
TSTrajectorySetUp(petsclib::PetscLibType,tj::TSTrajectory, ts::TS)Sets up the internal data structures, e.g. stacks, for the later use of a TS TSTrajectory.
Collective
Input Parameters:
tj- theTSTrajectorycontextts- the TS context obtained fromTSCreate()
Level: developer
-seealso: , TSTrajectory, TSSetSaveTrajectory(), TSTrajectoryCreate(), TSTrajectoryDestroy()
External Links
- PETSc Manual:
Ts/TSTrajectorySetUp
PETSc.LibPETSc.TSTrajectorySetUseHistory — Method
TSTrajectorySetUseHistory(petsclib::PetscLibType,tj::TSTrajectory, flg::PetscBool)Use TSHistory in TSTrajectory
Collective
Input Parameters:
tj- theTSTrajectorycontextflg-PETSC_TRUEto save,PETSC_FALSEto disable
Options Database Key:
-ts_trajectory_use_history- have it useTSHistory
Level: advanced
-seealso: , TSTrajectory, TSTrajectoryCreate(), TSTrajectoryDestroy(), TSTrajectorySetUp()
External Links
- PETSc Manual:
Ts/TSTrajectorySetUseHistory
PETSc.LibPETSc.TSTrajectorySetVariableNames — Method
TSTrajectorySetVariableNames(petsclib::PetscLibType,ctx::TSTrajectory, names::Cchar)Sets the name of each component in the solution vector so that it may be saved with the trajectory
Collective
Input Parameters:
ctx- the trajectory contextnames- the names of the components, final string must beNULL
Level: intermediate
-seealso: , TSTrajectory, TSGetTrajectory()
External Links
- PETSc Manual:
Ts/TSTrajectorySetVariableNames
PETSc.LibPETSc.TSTrajectoryView — Method
TSTrajectoryView(petsclib::PetscLibType,tj::TSTrajectory, viewer::PetscViewer)Prints information about the trajectory object
Collective
Input Parameters:
tj- theTSTrajectorycontext obtained fromTSTrajectoryCreate()viewer- visualization context
Options Database Key:
-ts_trajectory_view- callsTSTrajectoryView()at end ofTSAdjointStep()
Level: developer
-seealso: , TS, TSTrajectory, PetscViewer, PetscViewerASCIIOpen()
External Links
- PETSc Manual:
Ts/TSTrajectoryView
PETSc.LibPETSc.TSTrajectoryViewFromOptions — Method
TSTrajectoryViewFromOptions(petsclib::PetscLibType,A::TSTrajectory, obj::PetscObject, name::String)View a TSTrajectory based on values in the options database
Collective
Input Parameters:
A- theTSTrajectorycontextobj- Optional object that provides prefix used for option namename- command line option
Level: intermediate
-seealso: , TSTrajectory, TSTrajectoryView, PetscObjectViewFromOptions(), TSTrajectoryCreate()
External Links
- PETSc Manual:
Ts/TSTrajectoryViewFromOptions