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")
# 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
u::PetscVec,v::PetscVec = TS2GetSolution(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TS2SetSolution(), TSGetTimeStep(), TSGetTime()
External Links
- PETSc Manual:
TS/TS2GetSolution
PETSc.LibPETSc.TS2SetSolution — Method
TS2SetSolution(petsclib::PetscLibType, ts::AbstractTS, u::AbstractPetscVec, v::AbstractPetscVec)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
See also: TS
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
See also: PetscFinalize(), TSARKIMEXInitializePackage()
External Links
- PETSc Manual:
TS/TSARKIMEXFinalizePackage
PETSc.LibPETSc.TSARKIMEXGetFastSlowSplit — Method
fastslow::PetscBool = TSARKIMEXGetFastSlowSplit(petsclib::PetscLibType, ts::AbstractTS)Gets whether to use TSARKIMEX for a fast-slow system
Not Collective
Input Parameter:
ts- timestepping context
Output Parameter:
fastslow-PETSC_TRUEifTSARKIMEXwill be used for solving a fast-slow system,PETSC_FALSEotherwise
Level: intermediate
See also: TSARKIMEX, TSARKIMEXSetFastSlowSplit()
External Links
- PETSc Manual:
TS/TSARKIMEXGetFastSlowSplit
PETSc.LibPETSc.TSARKIMEXGetFullyImplicit — Method
flg::PetscBool = TSARKIMEXGetFullyImplicit(petsclib::PetscLibType, ts::AbstractTS)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
See also: TSARKIMEXGetType(), TSARKIMEXSetFullyImplicit()
External Links
- PETSc Manual:
TS/TSARKIMEXGetFullyImplicit
PETSc.LibPETSc.TSARKIMEXGetType — Method
arktype::String = TSARKIMEXGetType(petsclib::PetscLibType, ts::AbstractTS)Get the type of TSARKIMEX scheme
Logically Collective
Input Parameter:
ts- timestepping context
Output Parameter:
arktype- type ofTSARKIMEXscheme
Level: intermediate
See also: TSARKIMEX
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
See also: PetscInitialize(), TSARKIMEXFinalizePackage()
External Links
- PETSc Manual:
TS/TSARKIMEXInitializePackage
PETSc.LibPETSc.TSARKIMEXRegister — Method
TSARKIMEXRegister(petsclib::PetscLibType, name::String, 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
See also: 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
See also: TSARKIMEX, TSARKIMEXRegister(), TSARKIMEXRegisterAll()
External Links
- PETSc Manual:
TS/TSARKIMEXRegisterDestroy
PETSc.LibPETSc.TSARKIMEXSetFastSlowSplit — Method
TSARKIMEXSetFastSlowSplit(petsclib::PetscLibType, ts::AbstractTS, fastslow::PetscBool)Use TSARKIMEX for solving a fast-slow system
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)- enables theTSARKIMEXsolver for a fast-slow system where the RHS is split component-wise
Level: intermediate
See also: TSARKIMEX, TSARKIMEXGetFastSlowSplit(), TSRHSSplitSetIS()
External Links
- PETSc Manual:
TS/TSARKIMEXSetFastSlowSplit
PETSc.LibPETSc.TSARKIMEXSetFullyImplicit — Method
TSARKIMEXSetFullyImplicit(petsclib::PetscLibType, ts::AbstractTS, 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
Options Database Key:
-ts_arkimex_fully_implicit (true|false)- Solve both parts of the equation implicitly
Level: intermediate
See also: TSARKIMEX, TSARKIMEXGetType(), TSARKIMEXGetFullyImplicit()
External Links
- PETSc Manual:
TS/TSARKIMEXSetFullyImplicit
PETSc.LibPETSc.TSARKIMEXSetType — Method
TSARKIMEXSetType(petsclib::PetscLibType, ts::AbstractTS, arktype::String)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, seeTSARKIMEXType
Level: intermediate
See also: 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::AbstractTS)Evaluate the cost integral in the adjoint run.
Collective
Input Parameter:
ts- time stepping context
Level: advanced
See also: TSAdjointSolve(), TSAdjointStep()
External Links
- PETSc Manual:
Sensitivity/TSAdjointCostIntegral
PETSc.LibPETSc.TSAdjointMonitor — Method
TSAdjointMonitor(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, numcost::PetscInt, lambda::Vector{<:AbstractPetscVec}, mu::Vector{<:AbstractPetscVec})Runs all user-provided adjoint monitor routines set using TSAdjointMonitorSet()
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
See also: TSAdjointMonitorSet(), TSAdjointSolve()
External Links
- PETSc Manual:
Sensitivity/TSAdjointMonitor
PETSc.LibPETSc.TSAdjointMonitorCancel — Method
TSAdjointMonitorCancel(petsclib::PetscLibType, ts::AbstractTS)Clears all the adjoint monitors that have been set on a time-step object.
Logically Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
See also: TS, TSAdjointSolve(), TSAdjointMonitorSet()
External Links
- PETSc Manual:
Sensitivity/TSAdjointMonitorCancel
PETSc.LibPETSc.TSAdjointMonitorDefault — Method
TSAdjointMonitorDefault(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, time::PetscReal, v::AbstractPetscVec, numcost::PetscInt, lambda::Vector{<:AbstractPetscVec}, mu::Vector{<:AbstractPetscVec}, vf::Vector{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 functionslambda- sensitivities to initial conditionsmu- sensitivities to parametersvf- the viewer and format
Level: intermediate
See also: TS, TSAdjointSolve(), TSAdjointMonitorSet()
External Links
- PETSc Manual:
Sensitivity/TSAdjointMonitorDefault
PETSc.LibPETSc.TSAdjointMonitorDrawSensi — Method
TSAdjointMonitorDrawSensi(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, numcost::PetscInt, lambda::Vector{<:AbstractPetscVec}, mu::Vector{<:AbstractPetscVec}, dummy::Ptr{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
See also: TSAdjointSolve(), TSAdjointMonitorSet(), TSAdjointMonitorDefault(), VecView()
External Links
- PETSc Manual:
Sensitivity/TSAdjointMonitorDrawSensi
PETSc.LibPETSc.TSAdjointMonitorSet — Method
TSAdjointMonitorSet(petsclib::PetscLibType, ts::AbstractTS, adjointmonitor::external, adjointmctx::Ptr{Cvoid}, adjointmdestroy::Ptr{Cvoid})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] context for private data for the monitor routine (useNULLif 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 functionslambda- sensitivities to initial conditionsmu- sensitivities to parametersadjointmctx- [optional] adjoint monitoring context
Level: intermediate
See also: TS, TSAdjointSolve(), TSAdjointMonitorCancel(), PetscCtxDestroyFn
External Links
- PETSc Manual:
Sensitivity/TSAdjointMonitorSet
PETSc.LibPETSc.TSAdjointMonitorSetFromOptions — Method
TSAdjointMonitorSetFromOptions(petsclib::PetscLibType, ts::AbstractTS, 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
Calling sequence of monitor:
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 timeu- current iteratenumcost- number of cost functionslambda- sensitivities to initial conditionsmu- sensitivities to parametersvf- thePetscViewerand format the monitor is using
Calling sequence of monitorsetup:
ts- theTSobject being monitoredvf- thePetscViewerand format the monitor is using
Level: developer
See also: 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:
Sensitivity/TSAdjointMonitorSetFromOptions
PETSc.LibPETSc.TSAdjointReset — Method
TSAdjointReset(petsclib::PetscLibType, ts::AbstractTS)Resets a TS adjoint context and removes any allocated Vecs and Mats.
Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Level: beginner
See also: TSCreate(), TSAdjointSetUp(), TSDestroy()
External Links
- PETSc Manual:
Sensitivity/TSAdjointReset
PETSc.LibPETSc.TSAdjointResetForward — Method
TSAdjointResetForward(petsclib::PetscLibType, ts::AbstractTS)Reset the tangent linear solver and destroy the tangent linear context
Logically Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Level: intermediate
See also: TSAdjointSetForward()
External Links
- PETSc Manual:
Sensitivity/TSAdjointResetForward
PETSc.LibPETSc.TSAdjointSetForward — Method
TSAdjointSetForward(petsclib::PetscLibType, ts::AbstractTS, didp::AbstractPetscMat)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
See also: TSAdjointSolve(), TSSetCostHessianProducts(), TSAdjointResetForward()
External Links
- PETSc Manual:
Sensitivity/TSAdjointSetForward
PETSc.LibPETSc.TSAdjointSetFromOptions — Method
TSAdjointSetFromOptions(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TSSetSaveTrajectory(), TSTrajectorySetUp()
External Links
- PETSc Manual:
Sensitivity/TSAdjointSetFromOptions
PETSc.LibPETSc.TSAdjointSetSteps — Method
TSAdjointSetSteps(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TSAdjointSolve(), TS, TSSetExactFinalTime()
External Links
- PETSc Manual:
Sensitivity/TSAdjointSetSteps
PETSc.LibPETSc.TSAdjointSetUp — Method
TSAdjointSetUp(petsclib::PetscLibType, ts::AbstractTS)Sets up the internal data structures for the later use of an adjoint solver
Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Level: advanced
See also: TSCreate(), TSAdjointStep(), TSSetCostGradients()
External Links
- PETSc Manual:
Sensitivity/TSAdjointSetUp
PETSc.LibPETSc.TSAdjointSolve — Method
TSAdjointSolve(petsclib::PetscLibType, ts::AbstractTS)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
See also: TSCreate(), TSSetCostGradients(), TSSetSolution(), TSAdjointStep()
External Links
- PETSc Manual:
Sensitivity/TSAdjointSolve
PETSc.LibPETSc.TSAdjointStep — Method
TSAdjointStep(petsclib::PetscLibType, ts::AbstractTS)Steps one time step backward in the adjoint run
Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Level: intermediate
See also: TSAdjointSetUp(), TSAdjointSolve()
External Links
- PETSc Manual:
Sensitivity/TSAdjointStep
PETSc.LibPETSc.TSAlpha2GetParams — Method
alpha_m::PetscReal,alpha_f::PetscReal,gamma::PetscReal,beta::PetscReal = TSAlpha2GetParams(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSALPHA2, TSAlpha2SetRadius(), TSAlpha2SetParams()
External Links
- PETSc Manual:
TS/TSAlpha2GetParams
PETSc.LibPETSc.TSAlpha2SetParams — Method
TSAlpha2SetParams(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TS, TSALPHA2, TSAlpha2SetRadius(), TSAlpha2GetParams()
External Links
- PETSc Manual:
TS/TSAlpha2SetParams
PETSc.LibPETSc.TSAlpha2SetPredictor — Method
TSAlpha2SetPredictor(petsclib::PetscLibType, ts::AbstractTS, predictor::Ptr{Cvoid}, ctx::Ptr{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
See also: TS, TSALPHA2, TSAlpha2PredictorFn
External Links
- PETSc Manual:
TS/TSAlpha2SetPredictor
PETSc.LibPETSc.TSAlpha2SetRadius — Method
TSAlpha2SetRadius(petsclib::PetscLibType, ts::AbstractTS, 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
See also: 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::AbstractTS)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
See also: TS, TSALPHA, TSAlphaSetRadius(), TSAlphaSetParams()
External Links
- PETSc Manual:
TS/TSAlphaGetParams
PETSc.LibPETSc.TSAlphaSetParams — Method
TSAlphaSetParams(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TS, TSALPHA, TSAlphaSetRadius(), TSAlphaGetParams()
External Links
- PETSc Manual:
TS/TSAlphaSetParams
PETSc.LibPETSc.TSAlphaSetRadius — Method
TSAlphaSetRadius(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TS, TSALPHA, TSAlphaSetParams(), TSAlphaGetParams()
External Links
- PETSc Manual:
TS/TSAlphaSetRadius
PETSc.LibPETSc.TSAppendOptionsPrefix — Method
TSAppendOptionsPrefix(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TS, TSGetOptionsPrefix(), TSSetOptionsPrefix(), TSSetFromOptions()
External Links
- PETSc Manual:
TS/TSAppendOptionsPrefix
PETSc.LibPETSc.TSBDFGetOrder — Method
order::PetscInt = TSBDFGetOrder(petsclib::PetscLibType, ts::AbstractTS)Get the order of the TSBDF method
Not Collective
Input Parameter:
ts- timestepping context
Output Parameter:
order- order of the method
Level: intermediate
See also: TSBDFSetOrder(), TS, TSBDF
External Links
- PETSc Manual:
TS/TSBDFGetOrder
PETSc.LibPETSc.TSBDFSetOrder — Method
TSBDFSetOrder(petsclib::PetscLibType, ts::AbstractTS, 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
See also: 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
See also: PetscFinalize(), TSBASICSYMPLECTIC
External Links
- PETSc Manual:
TS/TSBasicSymplecticFinalizePackage
PETSc.LibPETSc.TSBasicSymplecticGetType — Method
TSBasicSymplecticGetType(petsclib::PetscLibType, ts::AbstractTS, 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
See also: 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
See also: PetscInitialize(), TSBASICSYMPLECTIC
External Links
- PETSc Manual:
TS/TSBasicSymplecticInitializePackage
PETSc.LibPETSc.TSBasicSymplecticRegister — Method
TSBasicSymplecticRegister(petsclib::PetscLibType, name::String, 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
See also: TSBASICSYMPLECTIC
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
See also: 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
See also: TSBasicSymplecticRegister(), TSBasicSymplecticRegisterAll(), TSBASICSYMPLECTIC
External Links
- PETSc Manual:
TS/TSBasicSymplecticRegisterDestroy
PETSc.LibPETSc.TSBasicSymplecticSetType — Method
TSBasicSymplecticSetType(petsclib::PetscLibType, ts::AbstractTS, bsymptype::String)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
See also: TSBASICSYMPLECTIC, TSBasicSymplecticType
External Links
- PETSc Manual:
TS/TSBasicSymplecticSetType
PETSc.LibPETSc.TSClone — Method
tsout::TS = TSClone(petsclib::PetscLibType, tsin::AbstractTS)This function clones a time step TS object.
Collective
Input Parameter:
tsin- The inputTS
Output Parameter:
tsout- The outputTS(cloned)
Level: developer
See also: TS, SNES, TSCreate(), TSSetType(), TSSetUp(), TSDestroy(), TSSetProblemType()
External Links
- PETSc Manual:
TS/TSClone
PETSc.LibPETSc.TSComputeCostIntegrand — Method
TSComputeCostIntegrand(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Q::AbstractPetscVec)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
See also: TS, TSAdjointSolve(), TSSetCostIntegrand()
External Links
- PETSc Manual:
Sensitivity/TSComputeCostIntegrand
PETSc.LibPETSc.TSComputeExactError — Method
TSComputeExactError(petsclib::PetscLibType, ts::AbstractTS, u::AbstractPetscVec, e::AbstractPetscVec)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
See also: TS, TSGetComputeInitialCondition(), TSSetComputeInitialCondition(), TSSolve()
External Links
- PETSc Manual:
TS/TSComputeExactError
PETSc.LibPETSc.TSComputeForcingFunction — Method
TSComputeForcingFunction(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec)Evaluates the forcing function.
Collective
Input Parameters:
ts- theTScontextt- current time
Output Parameter:
U- the function value
Level: developer
See also: TS, TSSetSolutionFunction(), TSSetRHSFunction(), TSComputeIFunction()
External Links
- PETSc Manual:
TS/TSComputeForcingFunction
PETSc.LibPETSc.TSComputeI2Function — Method
TSComputeI2Function(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, V::AbstractPetscVec, A::AbstractPetscVec, F::AbstractPetscVec)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
See also: TS, TSSetI2Function(), TSGetI2Function()
External Links
- PETSc Manual:
TS/TSComputeI2Function
PETSc.LibPETSc.TSComputeI2Jacobian — Method
TSComputeI2Jacobian(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, V::AbstractPetscVec, A::AbstractPetscVec, shiftV::PetscReal, shiftA::PetscReal, J::AbstractPetscMat, P::AbstractPetscMat)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
See also: TS, TSSetI2Jacobian()
External Links
- PETSc Manual:
TS/TSComputeI2Jacobian
PETSc.LibPETSc.TSComputeIFunction — Method
TSComputeIFunction(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Udot::AbstractPetscVec, Y::AbstractPetscVec, 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
See also: TS, TSSetIFunction(), TSComputeRHSFunction()
External Links
- PETSc Manual:
TS/TSComputeIFunction
PETSc.LibPETSc.TSComputeIFunctionLinear — Method
TSComputeIFunctionLinear(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Udot::AbstractPetscVec, F::AbstractPetscVec, ctx::Ptr{Cvoid})Evaluate the left hand side via the user-provided Jacobian, for linear problems only
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
See also: TS, TSSetIFunction(), TSSetIJacobian(), TSComputeIJacobianConstant(), TSComputeRHSFunctionLinear()
External Links
- PETSc Manual:
TS/TSComputeIFunctionLinear
PETSc.LibPETSc.TSComputeIHessianProductFunctionPP — Method
TSComputeIHessianProductFunctionPP(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Vl::Vector{<:AbstractPetscVec}, Vr::AbstractPetscVec, VHV::Vector{<:AbstractPetscVec})Runs the user-defined vector-Hessian-vector product function for Fpp.
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
See also: TSSetIHessianProduct()
External Links
- PETSc Manual:
Sensitivity/TSComputeIHessianProductFunctionPP
PETSc.LibPETSc.TSComputeIHessianProductFunctionPU — Method
TSComputeIHessianProductFunctionPU(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Vl::Vector{<:AbstractPetscVec}, Vr::AbstractPetscVec, VHV::Vector{<:AbstractPetscVec})Runs the user-defined vector-Hessian-vector product function for Fpu.
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
See also: TSSetIHessianProduct()
External Links
- PETSc Manual:
Sensitivity/TSComputeIHessianProductFunctionPU
PETSc.LibPETSc.TSComputeIHessianProductFunctionUP — Method
TSComputeIHessianProductFunctionUP(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Vl::Vector{<:AbstractPetscVec}, Vr::AbstractPetscVec, VHV::Vector{<:AbstractPetscVec})Runs the user-defined vector-Hessian-vector product function for Fup.
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
See also: TSSetIHessianProduct()
External Links
- PETSc Manual:
Sensitivity/TSComputeIHessianProductFunctionUP
PETSc.LibPETSc.TSComputeIHessianProductFunctionUU — Method
TSComputeIHessianProductFunctionUU(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Vl::Vector{<:AbstractPetscVec}, Vr::AbstractPetscVec, VHV::Vector{<:AbstractPetscVec})Runs the user-defined vector-Hessian-vector product function for Fuu.
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
See also: TSSetIHessianProduct()
External Links
- PETSc Manual:
Sensitivity/TSComputeIHessianProductFunctionUU
PETSc.LibPETSc.TSComputeIJacobian — Method
TSComputeIJacobian(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Udot::AbstractPetscVec, shift::PetscReal, A::AbstractPetscMat, B::AbstractPetscMat, 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
See also: TS, TSSetIJacobian()
External Links
- PETSc Manual:
TS/TSComputeIJacobian
PETSc.LibPETSc.TSComputeIJacobianConstant — Method
TSComputeIJacobianConstant(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Udot::AbstractPetscVec, shift::PetscReal, A::AbstractPetscMat, B::AbstractPetscMat, ctx::Ptr{Cvoid})Reuses the matrix previously computed with the provided TSIJacobianFn for a semi-implicit DAE or ODE
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
See also: TS, TSROSW, TSARKIMEX, TSSetIFunction(), TSSetIJacobian(), TSComputeIFunctionLinear()
External Links
- PETSc Manual:
TS/TSComputeIJacobianConstant
PETSc.LibPETSc.TSComputeIJacobianDefaultColor — Method
TSComputeIJacobianDefaultColor(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Udot::AbstractPetscVec, shift::PetscReal, J::AbstractPetscMat, B::AbstractPetscMat, ctx::Ptr{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 application 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
See also: TS, TSSetIJacobian(), MatFDColoringCreate(), MatFDColoringSetFunction()
External Links
- PETSc Manual:
TS/TSComputeIJacobianDefaultColor
PETSc.LibPETSc.TSComputeIJacobianP — Method
TSComputeIJacobianP(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Udot::AbstractPetscVec, shift::PetscReal, Amat::AbstractPetscMat, imex::PetscBool)Runs the user-defined IJacobianP function.
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
See also: TS, TSSetIJacobianP()
External Links
- PETSc Manual:
Sensitivity/TSComputeIJacobianP
PETSc.LibPETSc.TSComputeInitialCondition — Method
TSComputeInitialCondition(petsclib::PetscLibType, ts::AbstractTS, u::AbstractPetscVec)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
See also: TS, TSGetComputeInitialCondition(), TSSetComputeInitialCondition(), TSSolve()
External Links
- PETSc Manual:
TS/TSComputeInitialCondition
PETSc.LibPETSc.TSComputeLinearStability — Method
yr::PetscReal,yi::PetscReal = TSComputeLinearStability(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TS, TSSetRHSFunction(), TSComputeIFunction()
External Links
- PETSc Manual:
TS/TSComputeLinearStability
PETSc.LibPETSc.TSComputeRHSFunction — Method
TSComputeRHSFunction(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, y::AbstractPetscVec)Evaluates the right-hand-side function for a TS
Collective
Input Parameters:
ts- theTScontextt- current timeU- state vector
Output Parameter:
y- right-hand side
Level: developer
See also: TS, TSSetRHSFunction(), TSComputeIFunction()
External Links
- PETSc Manual:
TS/TSComputeRHSFunction
PETSc.LibPETSc.TSComputeRHSFunctionLinear — Method
TSComputeRHSFunctionLinear(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, F::AbstractPetscVec, ctx::Ptr{Cvoid})Evaluate the right-hand side via the user-provided Jacobian, for linear problems Udot = A U only
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
See also: TS, TSSetRHSFunction(), TSSetRHSJacobian(), TSComputeRHSJacobianConstant()
External Links
- PETSc Manual:
TS/TSComputeRHSFunctionLinear
PETSc.LibPETSc.TSComputeRHSHessianProductFunctionPP — Method
TSComputeRHSHessianProductFunctionPP(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Vl::Vector{<:AbstractPetscVec}, Vr::AbstractPetscVec, VHV::Vector{<:AbstractPetscVec})Runs the user-defined vector-Hessian-vector product function for G_{pp}.
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
See also: TSSetRHSHessianProduct()
External Links
- PETSc Manual:
Sensitivity/TSComputeRHSHessianProductFunctionPP
PETSc.LibPETSc.TSComputeRHSHessianProductFunctionPU — Method
TSComputeRHSHessianProductFunctionPU(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Vl::Vector{<:AbstractPetscVec}, Vr::AbstractPetscVec, VHV::Vector{<:AbstractPetscVec})Runs the user-defined vector-Hessian-vector product function for G_{pu}.
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
See also: TSSetRHSHessianProduct()
External Links
- PETSc Manual:
Sensitivity/TSComputeRHSHessianProductFunctionPU
PETSc.LibPETSc.TSComputeRHSHessianProductFunctionUP — Method
TSComputeRHSHessianProductFunctionUP(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Vl::Vector{<:AbstractPetscVec}, Vr::AbstractPetscVec, VHV::Vector{<:AbstractPetscVec})Runs the user-defined vector-Hessian-vector product function for G_{up}.
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
See also: TS, TSSetRHSHessianProduct()
External Links
- PETSc Manual:
Sensitivity/TSComputeRHSHessianProductFunctionUP
PETSc.LibPETSc.TSComputeRHSHessianProductFunctionUU — Method
TSComputeRHSHessianProductFunctionUU(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Vl::Vector{<:AbstractPetscVec}, Vr::AbstractPetscVec, VHV::Vector{<:AbstractPetscVec})Runs the user-defined vector-Hessian-vector product function for G_{uu}.
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
See also: TS, TSSetRHSHessianProduct()
External Links
- PETSc Manual:
Sensitivity/TSComputeRHSHessianProductFunctionUU
PETSc.LibPETSc.TSComputeRHSJacobian — Method
TSComputeRHSJacobian(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, A::AbstractPetscMat, B::AbstractPetscMat)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
See also: TS, TSSetRHSJacobian(), KSPSetOperators()
External Links
- PETSc Manual:
TS/TSComputeRHSJacobian
PETSc.LibPETSc.TSComputeRHSJacobianConstant — Method
TSComputeRHSJacobianConstant(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, A::AbstractPetscMat, B::AbstractPetscMat, ctx::Ptr{Cvoid})Reuses a Jacobian that is time-independent.
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
See also: TS, TSSetRHSFunction(), TSSetRHSJacobian(), TSComputeRHSFunctionLinear()
External Links
- PETSc Manual:
TS/TSComputeRHSJacobianConstant
PETSc.LibPETSc.TSComputeRHSJacobianP — Method
TSComputeRHSJacobianP(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Amat::AbstractPetscMat)Runs the user-defined JacobianP function.
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
See also: TSSetRHSJacobianP(), TS
External Links
- PETSc Manual:
Sensitivity/TSComputeRHSJacobianP
PETSc.LibPETSc.TSComputeSNESJacobian — Method
TSComputeSNESJacobian(petsclib::PetscLibType, ts::AbstractTS, x::AbstractPetscVec, J::AbstractPetscMat, Jpre::AbstractPetscMat)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
See also: SNES, TS, SNESSetJacobian(), TSSetRHSJacobian(), TSSetIJacobian()
External Links
- PETSc Manual:
Sensitivity/TSComputeSNESJacobian
PETSc.LibPETSc.TSComputeSolutionFunction — Method
TSComputeSolutionFunction(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec)Evaluates the solution function.
Collective
Input Parameters:
ts- theTScontextt- current time
Output Parameter:
U- the solution
Level: developer
See also: TS, TSSetSolutionFunction(), TSSetRHSFunction(), TSComputeIFunction()
External Links
- PETSc Manual:
TS/TSComputeSolutionFunction
PETSc.LibPETSc.TSComputeTransientVariable — Method
TSComputeTransientVariable(petsclib::PetscLibType, ts::AbstractTS, U::AbstractPetscVec, C::AbstractPetscVec)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
See also: 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
See also: TS, SNES, TSSetType(), TSSetUp(), TSDestroy(), TSSetProblemType(), TSSetTimeStep()
External Links
- PETSc Manual:
TS/TSCreate
PETSc.LibPETSc.TSCreateQuadratureTS — Method
quadts::TS = TSCreateQuadratureTS(petsclib::PetscLibType, ts::AbstractTS, fwd::PetscBool)Create a sub-TS that evaluates integrals over time
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
See also: TSGetQuadratureTS()
External Links
- PETSc Manual:
Sensitivity/TSCreateQuadratureTS
PETSc.LibPETSc.TSDIRKGetType — Method
dirktype::String = TSDIRKGetType(petsclib::PetscLibType, ts::AbstractTS)Get the type of TSDIRK scheme
Logically Collective
Input Parameter:
ts- timestepping context
Output Parameter:
dirktype- type ofTSDIRKscheme
Level: intermediate
See also: TSDIRKSetType()
External Links
- PETSc Manual:
TS/TSDIRKGetType
PETSc.LibPETSc.TSDIRKRegister — Method
TSDIRKRegister(petsclib::PetscLibType, name::String, 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
See also: TSDIRK, TSType, TS
External Links
- PETSc Manual:
TS/TSDIRKRegister
PETSc.LibPETSc.TSDIRKSetType — Method
TSDIRKSetType(petsclib::PetscLibType, ts::AbstractTS, dirktype::String)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
See also: TSDIRKGetType(), TSDIRK, TSDIRKType
External Links
- PETSc Manual:
TS/TSDIRKSetType
PETSc.LibPETSc.TSDMSwarmMonitorMoments — Method
TSDMSwarmMonitorMoments(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, t::PetscReal, U::AbstractPetscVec, vf::Vector{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
See also: TS, TSMonitorSet(), TSMonitorDefault(), DMSWARM
External Links
- PETSc Manual:
TS/TSDMSwarmMonitorMoments
PETSc.LibPETSc.TSDestroy — Method
TSDestroy(petsclib::PetscLibType, ts::AbstractTS)Destroys the timestepper context that was created with TSCreate().
Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Level: beginner
See also: TS, TSCreate(), TSSetUp(), TSSolve()
External Links
- PETSc Manual:
TS/TSDestroy
PETSc.LibPETSc.TSDiscGradGetFormulation — Method
TSDiscGradGetFormulation(petsclib::PetscLibType, ts::AbstractTS, noname::Ptr{Cvoid})Get the construction method for S, F, and grad F from the formulation u_t = S \nabla F for TSDISCGRAD
Not Collective
Input Parameter:
ts- timestepping context
Output Parameters:
Sfunc- constructor for the S matrix from the formulationFfunc- functional F from the formulationGfunc- constructor for the gradient of F from the formulationctx- the application context
Calling sequence of Sfunc:
ts- the integratortime- the current timeu- the solutionS- the S-matrix from the formulationctx- the application context
Calling sequence of Ffunc:
ts- the integratortime- the current timeu- the solutionF- the computed function from the formulationctx- the application context
Calling sequence of Gfunc:
ts- the integratortime- the current timeu- the solutionG- the gradient of the computed function from the formulationctx- the application context
Level: intermediate
See also: TS, TSDISCGRAD, TSDiscGradSetFormulation()
External Links
- PETSc Manual:
TS/TSDiscGradGetFormulation
PETSc.LibPETSc.TSDiscGradGetType — Method
dgtype::TSDGType = TSDiscGradGetType(petsclib::PetscLibType, ts::AbstractTS)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
See also: TSDISCGRAD, TSDiscGradSetType()
External Links
- PETSc Manual:
TS/TSDiscGradGetType
PETSc.LibPETSc.TSDiscGradSetFormulation — Method
TSDiscGradSetFormulation(petsclib::PetscLibType, ts::AbstractTS, Sfunc::external, Ffunc::external, Gfunc::external, ctx::Ptr{Cvoid})Set the construction method for S, F, and grad F from the formulation u_t = S(u) \nabla 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 application context
Calling sequence of Ffunc:
ts- the integratortime- the current timeu- the solutionF- the computed function from the formulationctx- the application context
Calling sequence of Gfunc:
ts- the integratortime- the current timeu- the solutionG- the gradient of the computed function from the formulationctx- the application context
Level: intermediate
See also: TSDISCGRAD, TSDiscGradGetFormulation()
External Links
- PETSc Manual:
TS/TSDiscGradSetFormulation
PETSc.LibPETSc.TSDiscGradSetType — Method
TSDiscGradSetType(petsclib::PetscLibType, ts::AbstractTS, 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 (gonzalez|average|none)- flag to choose discrete gradient type
Level: intermediate
See also: TSDISCGRAD, TSDGType
External Links
- PETSc Manual:
TS/TSDiscGradSetType
PETSc.LibPETSc.TSEIMEXSetMaxRows — Method
TSEIMEXSetMaxRows(petsclib::PetscLibType, ts::AbstractTS, nrows::PetscInt)Set the maximum number of rows for TSEIMEX schemes
Logically Collective
Input Parameters:
ts- timestepping contextnrows- maximum number of rows
Level: intermediate
See also: TSEIMEXSetRowCol(), TSEIMEXSetOrdAdapt(), TSEIMEX
External Links
- PETSc Manual:
TS/TSEIMEXSetMaxRows
PETSc.LibPETSc.TSEIMEXSetOrdAdapt — Method
TSEIMEXSetOrdAdapt(petsclib::PetscLibType, ts::AbstractTS, flg::PetscBool)Set the order adaptativity for the TSEIMEX schemes
Logically Collective
Input Parameters:
ts- timestepping contextflg- index in the T table
Level: intermediate
See also: TSEIMEXSetRowCol(), TSEIMEX
External Links
- PETSc Manual:
TS/TSEIMEXSetOrdAdapt
PETSc.LibPETSc.TSEIMEXSetRowCol — Method
TSEIMEXSetRowCol(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TSEIMEXSetMaxRows(), TSEIMEXSetOrdAdapt(), TSEIMEX
External Links
- PETSc Manual:
TS/TSEIMEXSetRowCol
PETSc.LibPETSc.TSErrorWeightedENorm — Method
norm::PetscReal,norma::PetscReal,normr::PetscReal = TSErrorWeightedENorm(petsclib::PetscLibType, ts::AbstractTS, E::AbstractPetscVec, U::AbstractPetscVec, Y::AbstractPetscVec, 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
See also: TS, VecErrorWeightedNorms(), TSErrorWeightedNorm()
External Links
- PETSc Manual:
TS/TSErrorWeightedENorm
PETSc.LibPETSc.TSErrorWeightedNorm — Method
norm::PetscReal,norma::PetscReal,normr::PetscReal = TSErrorWeightedNorm(petsclib::PetscLibType, ts::AbstractTS, U::AbstractPetscVec, Y::AbstractPetscVec, 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
See also: TS, VecErrorWeightedNorms(), TSErrorWeightedENorm()
External Links
- PETSc Manual:
TS/TSErrorWeightedNorm
PETSc.LibPETSc.TSEvaluateStep — Method
done::PetscBool = TSEvaluateStep(petsclib::PetscLibType, ts::AbstractTS, order::PetscInt, U::AbstractPetscVec)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
See also: TS, TSStep(), TSAdapt
External Links
- PETSc Manual:
TS/TSEvaluateStep
PETSc.LibPETSc.TSEvaluateWLTE — Method
order::PetscInt,wlte::PetscReal = TSEvaluateWLTE(petsclib::PetscLibType, ts::AbstractTS, 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
See also: 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
See also: TS, PetscFinalize(), TSInitializePackage()
External Links
- PETSc Manual:
TS/TSFinalizePackage
PETSc.LibPETSc.TSForwardCostIntegral — Method
TSForwardCostIntegral(petsclib::PetscLibType, ts::AbstractTS)Evaluate the cost integral in the forward run.
Collective
Input Parameter:
ts- time stepping context
Level: advanced
See also: TS, TSSolve(), TSAdjointCostIntegral()
External Links
- PETSc Manual:
Sensitivity/TSForwardCostIntegral
PETSc.LibPETSc.TSForwardGetSensitivities — Method
nump::PetscInt,Smat::PetscMat = TSForwardGetSensitivities(petsclib::PetscLibType, ts::AbstractTS)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
See also: TSForwardSetSensitivities(), TSForwardSetIntegralGradients(), TSForwardGetIntegralGradients(), TSForwardStep()
External Links
- PETSc Manual:
Sensitivity/TSForwardGetSensitivities
PETSc.LibPETSc.TSForwardGetStages — Method
ns::PetscInt,S::PetscMat = TSForwardGetStages(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS
External Links
- PETSc Manual:
Sensitivity/TSForwardGetStages
PETSc.LibPETSc.TSForwardReset — Method
TSForwardReset(petsclib::PetscLibType, ts::AbstractTS)Reset the internal data structures used by forward sensitivity analysis
Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Level: advanced
See also: TSCreate(), TSDestroy(), TSForwardSetUp()
External Links
- PETSc Manual:
Sensitivity/TSForwardReset
PETSc.LibPETSc.TSForwardSetInitialSensitivities — Method
TSForwardSetInitialSensitivities(petsclib::PetscLibType, ts::AbstractTS, didp::AbstractPetscMat)Set initial values for tangent linear sensitivities
Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()didp- parametric sensitivities of the initial condition
Level: intermediate
See also: TS, TSForwardSetSensitivities()
External Links
- PETSc Manual:
Sensitivity/TSForwardSetInitialSensitivities
PETSc.LibPETSc.TSForwardSetSensitivities — Method
TSForwardSetSensitivities(petsclib::PetscLibType, ts::AbstractTS, nump::PetscInt, Smat::AbstractPetscMat)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
See also: TSForwardGetSensitivities(), TSForwardSetIntegralGradients(), TSForwardGetIntegralGradients(), TSForwardStep()
External Links
- PETSc Manual:
Sensitivity/TSForwardSetSensitivities
PETSc.LibPETSc.TSForwardSetUp — Method
TSForwardSetUp(petsclib::PetscLibType, ts::AbstractTS)Sets up the internal data structures for the later use of forward sensitivity analysis
Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Level: advanced
See also: TS, TSCreate(), TSDestroy(), TSSetUp()
External Links
- PETSc Manual:
Sensitivity/TSForwardSetUp
PETSc.LibPETSc.TSForwardStep — Method
TSForwardStep(petsclib::PetscLibType, ts::AbstractTS)Compute the forward sensitivity for one time step.
Collective
Input Parameter:
ts- time stepping context
Level: advanced
See also: TSForwardSetSensitivities(), TSForwardGetSensitivities(), TSForwardSetIntegralGradients(), TSForwardGetIntegralGradients(), TSForwardSetUp()
External Links
- PETSc Manual:
Sensitivity/TSForwardStep
PETSc.LibPETSc.TSFunctionDomainError — Method
accept::PetscBool = TSFunctionDomainError(petsclib::PetscLibType, ts::AbstractTS, stagetime::PetscReal, Y::AbstractPetscVec)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
See also: 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
See also: PetscFinalize()
External Links
- PETSc Manual:
TS/TSGLEEFinalizePackage
PETSc.LibPETSc.TSGLEEGetType — Method
gleetype::String = TSGLEEGetType(petsclib::PetscLibType, ts::AbstractTS)Get the type of TSGLEE scheme
Logically Collective
Input Parameter:
ts- timestepping context
Output Parameter:
gleetype- type ofTSGLEEscheme
Level: intermediate
See also: 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
See also: PetscInitialize()
External Links
- PETSc Manual:
TS/TSGLEEInitializePackage
PETSc.LibPETSc.TSGLEERegister — Method
TSGLEERegister(petsclib::PetscLibType, name::String, order::PetscInt, s::PetscInt, r::PetscInt, gamma::PetscReal, A::Vector{PetscReal}, B::Vector{PetscReal}, U::Vector{PetscReal}, V::Vector{PetscReal}, M_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
See also: TSGLEE
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
See also: 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
See also: TSGLEERegister(), TSGLEERegisterAll()
External Links
- PETSc Manual:
TS/TSGLEERegisterDestroy
PETSc.LibPETSc.TSGLEESetType — Method
TSGLEESetType(petsclib::PetscLibType, ts::AbstractTS, gleetype::String)Set the type of TSGLEE scheme
Logically Collective
Input Parameters:
ts- timestepping contextgleetype- type ofTSGLEEscheme
Level: intermediate
See also: TSGLEEGetType(), TSGLEE
External Links
- PETSc Manual:
TS/TSGLEESetType
PETSc.LibPETSc.TSGLLEAcceptRegister — Method
TSGLLEAcceptRegister(petsclib::PetscLibType, sname::String, fnc::Ptr{Cvoid})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
See also: 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
See also: PetscFinalize(), TSGLLEInitializePackage(), TSInitializePackage()
External Links
- PETSc Manual:
TS/TSGLLEFinalizePackage
PETSc.LibPETSc.TSGLLEGetAdapt — Method
adapt::TSGLLEAdapt = TSGLLEGetAdapt(petsclib::PetscLibType, ts::AbstractTS)gets the TSGLLEAdapt object from the TS
Not Collective
Input Parameter:
ts- theTScontext
Output Parameter:
adapt- theTSGLLEAdaptcontext
Level: advanced
See also: 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
See also: 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
See also: TSGLLE, TSGLLEType, TSGLLERegisterAll(), TSGLLESetType()
External Links
- PETSc Manual:
TS/TSGLLERegister
PETSc.LibPETSc.TSGLLESetAcceptType — Method
TSGLLESetAcceptType(petsclib::PetscLibType, ts::AbstractTS, type::String)sets the acceptance test for TSGLLE
Logically Collective
Input Parameters:
ts- theTScontexttype- the type
Options Database Key:
-ts_gl_accept_type (always)- sets the method used to determine whether to accept or reject a step
Level: intermediate
See also: TS, TSGLLE, TSGLLEAcceptRegister(), TSGLLEAdapt
External Links
- PETSc Manual:
TS/TSGLLESetAcceptType
PETSc.LibPETSc.TSGLLESetType — Method
TSGLLESetType(petsclib::PetscLibType, ts::AbstractTS, type::String)sets the class of general linear method, TSGLLE to use for time-stepping
Collective
Input Parameters:
ts- theTScontexttype- a method, currently onlyTSGLLE_IRKSis available
Options Database Key:
-ts_gl_type (irks)- sets the method
Level: intermediate
See also: TS, TSGLLEType, TSGLLE, TSGLLERegister(), TSGLLE_IRKS, TSGLLEGetAcceptType(), TSGLLESetAcceptType(), TSGLLEAcceptType()
External Links
- PETSc Manual:
TS/TSGLLESetType
PETSc.LibPETSc.TSGetAdapt — Method
adapt::TSAdapt = TSGetAdapt(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSAdapt, TSAdaptSetType(), TSAdaptChoose()
External Links
- PETSc Manual:
TS/TSGetAdapt
PETSc.LibPETSc.TSGetApplicationContext — Method
ctx::Ptr{Cvoid} = TSGetApplicationContext(petsclib::PetscLibType, ts::AbstractTS)Gets the user-defined context for the timestepper that was set with TSSetApplicationContext()
Not Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Output Parameter:
ctx- a pointer to the application context
Level: intermediate
See also: TS, TSSetApplicationContext()
External Links
- PETSc Manual:
TS/TSGetApplicationContext
PETSc.LibPETSc.TSGetAuxSolution — Method
TSGetAuxSolution(petsclib::PetscLibType, ts::AbstractTS, v::AbstractPetscVec)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
See also: TS, TSGetSolution()
External Links
- PETSc Manual:
TS/TSGetAuxSolution
PETSc.LibPETSc.TSGetCFLTime — Method
cfltime::PetscReal = TSGetCFLTime(petsclib::PetscLibType, ts::AbstractTS)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
See also: TSSetCFLTimeLocal()
External Links
- PETSc Manual:
TS/TSGetCFLTime
PETSc.LibPETSc.TSGetComputeExactError — Method
TSGetComputeExactError(petsclib::PetscLibType, ts::AbstractTS, noname::Ptr{Cvoid})Get the function used to automatically compute the exact error for the timestepping.
Not collective
Input Parameter:
ts- time stepping context
Output Parameter:
exactError- 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
See also: TS, TSComputeExactError()
External Links
- PETSc Manual:
TS/TSGetComputeExactError
PETSc.LibPETSc.TSGetComputeInitialCondition — Method
TSGetComputeInitialCondition(petsclib::PetscLibType, ts::AbstractTS, noname::Ptr{Cvoid})Get the function used to automatically compute an initial condition for the timestepping.
Not collective
Input Parameter:
ts- time stepping context
Output Parameter:
initCondition- The function which computes an initial condition
Calling sequence of initCondition:
ts- The timestepping contextu- The input vector in which the initial condition is stored
Level: advanced
See also: TS, TSSetComputeInitialCondition(), TSComputeInitialCondition()
External Links
- PETSc Manual:
TS/TSGetComputeInitialCondition
PETSc.LibPETSc.TSGetConvergedReason — Method
reason::TSConvergedReason = TSGetConvergedReason(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSSolve(), TSConvergedReason
External Links
- PETSc Manual:
TS/TSGetConvergedReason
PETSc.LibPETSc.TSGetCostGradients — Method
numcost::PetscInt,lambda::Vector{PetscVec},mu::Vector{PetscVec} = TSGetCostGradients(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSAdjointSolve(), TSSetCostGradients()
External Links
- PETSc Manual:
Sensitivity/TSGetCostGradients
PETSc.LibPETSc.TSGetCostHessianProducts — Method
numcost::PetscInt,lambda2::Vector{PetscVec},mu2::Vector{PetscVec},dir::PetscVec = TSGetCostHessianProducts(petsclib::PetscLibType, ts::AbstractTS)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
See also: TSAdjointSolve(), TSSetCostHessianProducts()
External Links
- PETSc Manual:
Sensitivity/TSGetCostHessianProducts
PETSc.LibPETSc.TSGetCostIntegral — Method
v::PetscVec = TSGetCostIntegral(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSAdjointSolve(), TSSetCostIntegrand()
External Links
- PETSc Manual:
Sensitivity/TSGetCostIntegral
PETSc.LibPETSc.TSGetDM — Method
dm::PetscDM = TSGetDM(petsclib::PetscLibType, ts::AbstractTS)Gets the DM that may be used by some preconditioners
Not Collective
Input Parameter:
ts- theTS
Output Parameter:
dm- theDM
Level: intermediate
See also: TS, DM, TSSetDM(), SNESSetDM(), SNESGetDM()
External Links
- PETSc Manual:
TS/TSGetDM
PETSc.LibPETSc.TSGetEquationType — Method
equation_type::TSEquationType = TSGetEquationType(petsclib::PetscLibType, ts::AbstractTS)Gets the type of the equation that TS is solving.
Not Collective
Input Parameter:
ts- theTScontext
Output Parameter:
equation_type- seeTSEquationType
Level: beginner
See also: TS, TSSetEquationType(), TSEquationType
External Links
- PETSc Manual:
TS/TSGetEquationType
PETSc.LibPETSc.TSGetEvaluationSolutions — Method
nsol::PetscInt,sol_times::Vector{PetscReal},Sols::Vector{PetscVec} = TSGetEvaluationSolutions(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSSetEvaluationTimes(), TSGetEvaluationTimes()
External Links
- PETSc Manual:
TS/TSGetEvaluationSolutions
PETSc.LibPETSc.TSGetEvaluationTimes — Method
n::PetscInt,time_points::Vector{PetscReal} = TSGetEvaluationTimes(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSSetEvaluationTimes(), TSGetEvaluationSolutions()
External Links
- PETSc Manual:
TS/TSGetEvaluationTimes
PETSc.LibPETSc.TSGetExactFinalTime — Method
eftopt::TSExactFinalTimeOption = TSGetExactFinalTime(petsclib::PetscLibType, ts::AbstractTS)Gets the exact final time option set with TSSetExactFinalTime()
Not Collective
Input Parameter:
ts- theTScontext
Output Parameter:
eftopt- exact final time option
Level: beginner
See also: TS, TSExactFinalTimeOption, TSSetExactFinalTime()
External Links
- PETSc Manual:
TS/TSGetExactFinalTime
PETSc.LibPETSc.TSGetI2Function — Method
r::PetscVec,fun::Ptr{Cvoid},ctx::Ptr{Cvoid} = TSGetI2Function(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSSetIFunction(), SNESGetFunction(), TSCreate()
External Links
- PETSc Manual:
TS/TSGetI2Function
PETSc.LibPETSc.TSGetI2Jacobian — Method
J::PetscMat,P::PetscMat,jac::Ptr{Cvoid},ctx::Ptr{Cvoid} = TSGetI2Jacobian(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSGetTimeStep(), TSGetMatrices(), TSGetTime(), TSGetStepNumber(), TSSetI2Jacobian(), TSGetI2Function(), TSCreate()
External Links
- PETSc Manual:
TS/TSGetI2Jacobian
PETSc.LibPETSc.TSGetIFunction — Method
r::PetscVec,func::Ptr{Cvoid},ctx::Ptr{Cvoid} = TSGetIFunction(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSSetIFunction(), SNESGetFunction()
External Links
- PETSc Manual:
TS/TSGetIFunction
PETSc.LibPETSc.TSGetIJacobian — Method
Amat::PetscMat,Pmat::PetscMat,f::Ptr{Cvoid},ctx::Ptr{Cvoid} = TSGetIJacobian(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSGetTimeStep(), TSGetRHSJacobian(), TSGetMatrices(), TSGetTime(), TSGetStepNumber()
External Links
- PETSc Manual:
TS/TSGetIJacobian
PETSc.LibPETSc.TSGetIJacobianP — Method
Amat::PetscMat = TSGetIJacobianP(petsclib::PetscLibType, ts::AbstractTS, noname::Ptr{Cvoid})Gets 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 Parameter:
ts-TScontext obtained fromTSCreate()
Output Parameters:
Amat- JacobianP matrixfunc- the function that computes the JacobianPctx- [optional] 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] function context
Level: intermediate
See also: TSSetRHSJacobianP(), TS, TSSetIJacobianP(), TSGetRHSJacobianP()
External Links
- PETSc Manual:
Sensitivity/TSGetIJacobianP
PETSc.LibPETSc.TSGetKSP — Method
ksp::KSP = TSGetKSP(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, SNES, KSP, TSCreate(), TSSetUp(), TSSolve(), TSGetSNES()
External Links
- PETSc Manual:
TS/TSGetKSP
PETSc.LibPETSc.TSGetKSPIterations — Method
lits::PetscInt = TSGetKSPIterations(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSSolve(), TSGetSNESIterations()
External Links
- PETSc Manual:
TS/TSGetKSPIterations
PETSc.LibPETSc.TSGetMaxSteps — Method
maxsteps::PetscInt = TSGetMaxSteps(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSSetMaxSteps(), TSGetMaxTime(), TSSetMaxTime()
External Links
- PETSc Manual:
TS/TSGetMaxSteps
PETSc.LibPETSc.TSGetMaxTime — Method
maxtime::PetscReal = TSGetMaxTime(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSSetMaxTime(), TSGetMaxSteps(), TSSetMaxSteps()
External Links
- PETSc Manual:
TS/TSGetMaxTime
PETSc.LibPETSc.TSGetNumEvents — Method
nevents::PetscInt = TSGetNumEvents(petsclib::PetscLibType, ts::AbstractTS)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
See also: TSEvent, TSSetEventHandler()
External Links
- PETSc Manual:
TS/TSGetNumEvents
PETSc.LibPETSc.TSGetOptionsPrefix — Method
prefix::String = TSGetOptionsPrefix(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSAppendOptionsPrefix(), TSSetFromOptions()
External Links
- PETSc Manual:
TS/TSGetOptionsPrefix
PETSc.LibPETSc.TSGetPrevTime — Method
t::PetscReal = TSGetPrevTime(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSGetTime(), TSGetSolveTime(), TSGetTimeStep()
External Links
- PETSc Manual:
TS/TSGetPrevTime
PETSc.LibPETSc.TSGetProblemType — Method
type::TSProblemType = TSGetProblemType(petsclib::PetscLibType, ts::AbstractTS)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
$M U_t = A U M(t) U_t = A(t) U F(t,U,U_t)$
Level: beginner
See also: TSSetUp(), TSProblemType, TS
External Links
- PETSc Manual:
TS/TSGetProblemType
PETSc.LibPETSc.TSGetQuadratureTS — Method
fwd::PetscBool,quadts::TS = TSGetQuadratureTS(petsclib::PetscLibType, ts::AbstractTS)Return the sub-TS that evaluates integrals over time
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
See also: TSCreateQuadratureTS()
External Links
- PETSc Manual:
Sensitivity/TSGetQuadratureTS
PETSc.LibPETSc.TSGetRHSFunction — Method
r::PetscVec,func::Ptr{Cvoid},ctx::Ptr{Cvoid} = TSGetRHSFunction(petsclib::PetscLibType, ts::AbstractTS)Returns the vector where the right-hand side is stored and the function/context to compute it.
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
See also: TS, TSSetRHSFunction(), SNESGetFunction()
External Links
- PETSc Manual:
TS/TSGetRHSFunction
PETSc.LibPETSc.TSGetRHSJacobian — Method
Amat::PetscMat,Pmat::PetscMat,func::Ptr{Cvoid},ctx::Ptr{Cvoid} = TSGetRHSJacobian(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSGetTimeStep(), TSGetMatrices(), TSGetTime(), TSGetStepNumber()
External Links
- PETSc Manual:
TS/TSGetRHSJacobian
PETSc.LibPETSc.TSGetRHSJacobianP — Method
Amat::PetscMat,func::Ptr{Cvoid},ctx::Ptr{Cvoid} = TSGetRHSJacobianP(petsclib::PetscLibType, ts::AbstractTS)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] function context
Level: intermediate
See also: TSSetRHSJacobianP(), TS, TSRHSJacobianPFn
External Links
- PETSc Manual:
Sensitivity/TSGetRHSJacobianP
PETSc.LibPETSc.TSGetRunSteps — Method
runsteps::PetscInt = TSGetRunSteps(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSSetRunSteps(), TSGetMaxTime(), TSSetMaxTime(), TSGetMaxSteps()
External Links
- PETSc Manual:
TS/TSGetRunSteps
PETSc.LibPETSc.TSGetSNES — Method
snes::SNES = TSGetSNES(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, SNES, TSCreate(), TSSetUp(), TSSolve()
External Links
- PETSc Manual:
TS/TSGetSNES
PETSc.LibPETSc.TSGetSNESFailures — Method
fails::PetscInt = TSGetSNESFailures(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSSolve(), TSGetSNESIterations(), TSGetKSPIterations(), TSSetMaxStepRejections(), TSGetStepRejections(), TSSetMaxSNESFailures()
External Links
- PETSc Manual:
TS/TSGetSNESFailures
PETSc.LibPETSc.TSGetSNESIterations — Method
nits::PetscInt = TSGetSNESIterations(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSSolve(), TSGetKSPIterations()
External Links
- PETSc Manual:
TS/TSGetSNESIterations
PETSc.LibPETSc.TSGetSolution — Method
v::PetscVec = TSGetSolution(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSGetTimeStep(), TSGetTime(), TSGetSolveTime(), TSGetSolutionComponents(), TSSetSolutionFunction()
External Links
- PETSc Manual:
TS/TSGetSolution
PETSc.LibPETSc.TSGetSolutionComponents — Method
n::PetscInt = TSGetSolutionComponents(petsclib::PetscLibType, ts::AbstractTS, v::AbstractPetscVec)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
See also: TS, TSGetSolution()
External Links
- PETSc Manual:
TS/TSGetSolutionComponents
PETSc.LibPETSc.TSGetSolveTime — Method
ftime::PetscReal = TSGetSolveTime(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSSolve(), TSConvergedReason
External Links
- PETSc Manual:
TS/TSGetSolveTime
PETSc.LibPETSc.TSGetStages — Method
ns::PetscInt,Y::PetscVec = TSGetStages(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSCreate()
External Links
- PETSc Manual:
TS/TSGetStages
PETSc.LibPETSc.TSGetStepNumber — Method
steps::PetscInt = TSGetStepNumber(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSGetTime(), TSGetTimeStep(), TSSetPreStep(), TSSetPreStage(), TSSetPostStage(), TSSetPostStep()
External Links
- PETSc Manual:
TS/TSGetStepNumber
PETSc.LibPETSc.TSGetStepRejections — Method
rejects::PetscInt = TSGetStepRejections(petsclib::PetscLibType, ts::AbstractTS)Gets the total number of rejected steps.
Not Collective
Input Parameter:
ts-TScontext
Output Parameter:
rejects- number of steps rejected
Level: intermediate
See also: TS, TSSolve(), TSGetSNESIterations(), TSGetKSPIterations(), TSSetMaxStepRejections(), TSGetSNESFailures(), TSSetMaxSNESFailures(), TSSetErrorIfStepFails()
External Links
- PETSc Manual:
TS/TSGetStepRejections
PETSc.LibPETSc.TSGetStepResize — Method
flg::PetscBool = TSGetStepResize(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSCreate(), TSSetResize()
External Links
- PETSc Manual:
TS/TSGetStepResize
PETSc.LibPETSc.TSGetStepRollBack — Method
flg::PetscBool = TSGetStepRollBack(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSCreate(), TSRollBack()
External Links
- PETSc Manual:
TS/TSGetStepRollBack
PETSc.LibPETSc.TSGetTime — Method
t::PetscReal = TSGetTime(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSGetSolveTime(), TSSetTime(), TSGetTimeStep(), TSGetStepNumber()
External Links
- PETSc Manual:
TS/TSGetTime
PETSc.LibPETSc.TSGetTimeError — Method
TSGetTimeError(petsclib::PetscLibType, ts::AbstractTS, n::PetscInt, v::AbstractPetscVec)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
See also: TSGetSolution(), TSSetTimeError()
External Links
- PETSc Manual:
TS/TSGetTimeError
PETSc.LibPETSc.TSGetTimeStep — Method
dt::PetscReal = TSGetTimeStep(petsclib::PetscLibType, ts::AbstractTS)Gets the current timestep size.
Not Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Output Parameter:
dt- the current timestep size
Level: intermediate
See also: TS, TSSetTimeStep(), TSGetTime()
External Links
- PETSc Manual:
TS/TSGetTimeStep
PETSc.LibPETSc.TSGetTolerances — Method
atol::PetscReal,vatol::PetscVec,rtol::PetscReal,vrtol::PetscVec = TSGetTolerances(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSAdapt, TSErrorWeightedNorm(), TSSetTolerances()
External Links
- PETSc Manual:
Ts/TSGetTolerances
PETSc.LibPETSc.TSGetTrajectory — Method
tr::TSTrajectory = TSGetTrajectory(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSTrajectory, TSAdjointSolve(), TSTrajectoryCreate()
External Links
- PETSc Manual:
TS/TSGetTrajectory
PETSc.LibPETSc.TSGetType — Method
type::String = TSGetType(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSType, TSSetType(), PetscObjectTypeCompare(), PetscObjectTypeCompareAny()
External Links
- PETSc Manual:
TS/TSGetType
PETSc.LibPETSc.TSGetUseSplitRHSFunction — Method
use_splitrhsfunction::PetscBool = TSGetUseSplitRHSFunction(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSSetUseSplitRHSFunction()
External Links
- PETSc Manual:
TS/TSGetUseSplitRHSFunction
PETSc.LibPETSc.TSHasTransientVariable — Method
has::PetscBool = TSHasTransientVariable(petsclib::PetscLibType, ts::AbstractTS)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
See also: 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
See also: TSIRK, PetscFinalize(), TSInitializePackage()
External Links
- PETSc Manual:
TS/TSIRKFinalizePackage
PETSc.LibPETSc.TSIRKGetNumStages — Method
nstages::PetscInt = TSIRKGetNumStages(petsclib::PetscLibType, ts::AbstractTS)Get the number of stages of TSIRK scheme
Logically Collective
Input Parameters:
ts- timestepping contextnstages- number of stages ofTSIRKscheme
Level: intermediate
See also: TSIRKSetNumStages(), TSIRK
External Links
- PETSc Manual:
TS/TSIRKGetNumStages
PETSc.LibPETSc.TSIRKGetType — Method
irktype::String = TSIRKGetType(petsclib::PetscLibType, ts::AbstractTS)Get the type of TSIRK IMEX scheme being used
Logically Collective
Input Parameter:
ts- timestepping context
Output Parameter:
irktype- type ofTSIRKIMEX scheme
Level: intermediate
See also: 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
See also: 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
See also: 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
See also: TSIRK, TSIRKRegister(), TSIRKRegisterAll()
External Links
- PETSc Manual:
TS/TSIRKRegisterDestroy
PETSc.LibPETSc.TSIRKSetNumStages — Method
TSIRKSetNumStages(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TSIRKGetNumStages(), TSIRK
External Links
- PETSc Manual:
TS/TSIRKSetNumStages
PETSc.LibPETSc.TSIRKSetType — Method
TSIRKSetType(petsclib::PetscLibType, ts::AbstractTS, irktype::String)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
See also: TSIRKGetType(), TSIRK, TSIRKType, TSIRKGAUSS
External Links
- PETSc Manual:
TS/TSIRKSetType
PETSc.LibPETSc.TSIRKTableauCreate — Method
TSIRKTableauCreate(petsclib::PetscLibType, ts::AbstractTS, nstages::PetscInt, A::Vector{PetscReal}, b::Vector{PetscReal}, c::Vector{PetscReal}, binterp::Vector{PetscReal}, A_inv::Vector{PetscScalar}, A_inv_rowsum::Vector{PetscScalar}, I_s::Vector{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 (dimensionnstages*nstages, row-major)b- step completion table (dimensionnstages)c- abscissa (dimensionnstages)binterp- coefficients of the interpolation formula (dimensionnstages), optional (useNULLto skip)A_inv- inverse ofA(dimensionnstages*nstages, row-major), optional (useNULLto skip)A_inv_rowsum- row sum of the inverse ofA(dimensionnstages), optional (useNULLto skip)I_s- identity matrix (dimensionnstages*nstages), optional (useNULLto skip)
Level: advanced
See also: 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
See also: TS, PetscInitialize(), TSFinalizePackage()
External Links
- PETSc Manual:
Sys/TSInitializePackage
PETSc.LibPETSc.TSInterpolate — Method
TSInterpolate(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec)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
See also: TS, TSSetExactFinalTime(), TSSolve()
External Links
- PETSc Manual:
TS/TSInterpolate
PETSc.LibPETSc.TSLoad — Method
TSLoad(petsclib::PetscLibType, ts::AbstractTS, 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
See also: 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
See also: TSMPRK, PetscFinalize()
External Links
- PETSc Manual:
TS/TSMPRKFinalizePackage
PETSc.LibPETSc.TSMPRKGetType — Method
mprktype::String = TSMPRKGetType(petsclib::PetscLibType, ts::AbstractTS)Get the type of TSMPRK scheme
Not Collective
Input Parameter:
ts- timestepping context
Output Parameter:
mprktype- type ofTSMPRKscheme
Level: intermediate
See also: TSMPRK
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
See also: TSMPRK, PetscInitialize()
External Links
- PETSc Manual:
TS/TSMPRKInitializePackage
PETSc.LibPETSc.TSMPRKRegister — Method
TSMPRKRegister(petsclib::PetscLibType, name::String, 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
See also: TSMPRK
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
See also: TSMPRK, TSMPRKRegister(), TSMPRKRegisterAll()
External Links
- PETSc Manual:
TS/TSMPRKRegisterDestroy
PETSc.LibPETSc.TSMPRKSetType — Method
TSMPRKSetType(petsclib::PetscLibType, ts::AbstractTS, mprktype::String)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
See also: TSMPRKGetType(), TSMPRK, TSMPRKType
External Links
- PETSc Manual:
TS/TSMPRKSetType
PETSc.LibPETSc.TSMonitor — Method
TSMonitor(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec)Runs all user-provided monitor routines set using TSMonitorSet()
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
See also: TS, TSMonitorSet(), TSMonitorSetFromOptions()
External Links
- PETSc Manual:
TS/TSMonitor
PETSc.LibPETSc.TSMonitorCancel — Method
TSMonitorCancel(petsclib::PetscLibType, ts::AbstractTS)Clears all the monitors that have been set on a time-step object.
Logically Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Level: intermediate
See also: TS, TSMonitorDefault(), TSMonitorSet()
External Links
- PETSc Manual:
TS/TSMonitorCancel
PETSc.LibPETSc.TSMonitorDMDARay — Method
TSMonitorDMDARay(petsclib::PetscLibType, ts::AbstractTS, steps::PetscInt, time::PetscReal, u::AbstractPetscVec, mctx::Ptr{Cvoid})Monitors the solution of a DMDA-based TS by scattering values along a ray to a viewer
Collective
Input Parameters:
ts- theTScontextsteps- the current time-step numbertime- the current timeu- the current solution (unused; the currentTSsolution is fetched)mctx- theTSMonitorDMDARayCtxcontext
Level: developer
See also: TS, DMDA, TSMonitorSet(), TSMonitorLGDMDARay(), TSMonitorDMDARayDestroy()
External Links
- PETSc Manual:
TS/TSMonitorDMDARay
PETSc.LibPETSc.TSMonitorDMDARayDestroy — Method
TSMonitorDMDARayDestroy(petsclib::PetscLibType, mctx::Ptr{Cvoid})Destroys the context created for the -ts_monitor_dmda_ray and -ts_monitor_lg_dmda_ray monitors
Collective
Input Parameter:
mctx- pointer to theTSMonitorDMDARayCtxcontext
Level: developer
See also: TS, TSMonitorSet(), TSMonitorDMDARay(), TSMonitorLGDMDARay()
External Links
- PETSc Manual:
TS/TSMonitorDMDARayDestroy
PETSc.LibPETSc.TSMonitorDefault — Method
TSMonitorDefault(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, v::AbstractPetscVec, vf::Vector{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
See also: 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::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, Ctx::Ptr{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 timeCtx- either a viewer orNULL
Options Database Key:
-ts_monitor_draw_error- Monitor error graphically, requires user to have providedTSSetSolutionFunction()
Level: intermediate
See also: TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSSetSolutionFunction()
External Links
- PETSc Manual:
TS/TSMonitorDrawError
PETSc.LibPETSc.TSMonitorDrawSolution — Method
TSMonitorDrawSolution(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, ctx::Ptr{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 timectx- 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
See also: TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorDrawCtxCreate(), TSMonitorDrawCtxDestroy()
External Links
- PETSc Manual:
TS/TSMonitorDrawSolution
PETSc.LibPETSc.TSMonitorDrawSolutionFunction — Method
TSMonitorDrawSolutionFunction(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, Ctx::Ptr{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 timeCtx- either a viewer orNULL
Options Database Key:
-ts_monitor_draw_solution_function- Monitor error graphically, requires user to have providedTSSetSolutionFunction()
Level: intermediate
See also: TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSSetSolutionFunction()
External Links
- PETSc Manual:
TS/TSMonitorDrawSolutionFunction
PETSc.LibPETSc.TSMonitorDrawSolutionPhase — Method
TSMonitorDrawSolutionPhase(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, ctx::Ptr{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 timectx- either a viewer orNULL
Level: intermediate
See also: TS, TSMonitorSet(), TSMonitorDefault(), VecView()
External Links
- PETSc Manual:
TS/TSMonitorDrawSolutionPhase
PETSc.LibPETSc.TSMonitorEnvelope — Method
TSMonitorEnvelope(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, dctx::Ptr{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
See also: TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorEnvelopeGetBounds(), TSMonitorEnvelopeCtxCreate()
External Links
- PETSc Manual:
TS/TSMonitorEnvelope
PETSc.LibPETSc.TSMonitorEnvelopeGetBounds — Method
max::PetscVec,min::PetscVec = TSMonitorEnvelopeGetBounds(petsclib::PetscLibType, ts::AbstractTS)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
See also: TSMonitorEnvelopeCtx, TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorLGSetDisplayVariables()
External Links
- PETSc Manual:
TS/TSMonitorEnvelopeGetBounds
PETSc.LibPETSc.TSMonitorError — Method
TSMonitorError(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, vf::Vector{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
See also: TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSSetSolutionFunction()
External Links
- PETSc Manual:
TS/TSMonitorError
PETSc.LibPETSc.TSMonitorExtreme — Method
TSMonitorExtreme(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, v::AbstractPetscVec, vf::Vector{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
See also: TS, TSMonitorSet()
External Links
- PETSc Manual:
TS/TSMonitorExtreme
PETSc.LibPETSc.TSMonitorHGSwarmSolution — Method
TSMonitorHGSwarmSolution(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, dctx::Ptr{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 (true|false)- Plot in velocity space, as opposed to coordinate space
Level: intermediate
See also: TSMonitorSet()
External Links
- PETSc Manual:
TS/TSMonitorHGSwarmSolution
PETSc.LibPETSc.TSMonitorLGDMDARay — Method
TSMonitorLGDMDARay(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, ctx::Ptr{Cvoid})Monitors the solution of a DMDA-based TS by plotting values along a ray in a line graph
Collective
Input Parameters:
ts- theTScontextstep- the current time-step numberptime- the current timeu- the current solutionctx- theTSMonitorDMDARayCtxcontext, which contains the ray scatter and an embeddedTSMonitorLGCtx
Level: developer
See also: TS, DMDA, TSMonitorSet(), TSMonitorDMDARay(), TSMonitorDMDARayDestroy()
External Links
- PETSc Manual:
TS/TSMonitorLGDMDARay
PETSc.LibPETSc.TSMonitorLGError — Method
TSMonitorLGError(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, Ctx::Ptr{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 solutionCtx-TSMonitorLGCtxobject created withTSMonitorLGCtxCreate()
Options Database Key:
-ts_monitor_lg_error- create a graphical monitor of error history
Level: intermediate
See also: TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSSetSolutionFunction()
External Links
- PETSc Manual:
TS/TSMonitorLGError
PETSc.LibPETSc.TSMonitorLGGetVariableNames — Method
names::String = TSMonitorLGGetVariableNames(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorLGSetDisplayVariables()
External Links
- PETSc Manual:
TS/TSMonitorLGGetVariableNames
PETSc.LibPETSc.TSMonitorLGKSPIterations — Method
TSMonitorLGKSPIterations(petsclib::PetscLibType, ts::AbstractTS, n::PetscInt, ptime::PetscReal, v::AbstractPetscVec, monctx::Ptr{Cvoid})Monitors the number of linear (KSP) iterations used per time step in a line-graph plot
Collective
Input Parameters:
ts- theTScontextn- iteration number (a negative value indicates an interpolated solution and is ignored)ptime- current timev- current solutionmonctx- theTSMonitorLGCtxobject that contains all the options for the monitoring, created withTSMonitorLGCtxCreate()
Level: intermediate
See also: TS, TSMonitorSet(), TSMonitorLGCtxCreate(), TSMonitorLGSNESIterations()
External Links
- PETSc Manual:
TS/TSMonitorLGKSPIterations
PETSc.LibPETSc.TSMonitorLGSNESIterations — Method
TSMonitorLGSNESIterations(petsclib::PetscLibType, ts::AbstractTS, n::PetscInt, ptime::PetscReal, v::AbstractPetscVec, monctx::Ptr{Cvoid})Monitors the number of nonlinear (SNES) iterations used per time step in a line-graph plot
Collective
Input Parameters:
ts- theTScontextn- iteration number (a negative value indicates an interpolated solution and is ignored)ptime- current timev- current solutionmonctx- theTSMonitorLGCtxobject that contains all the options for the monitoring, created withTSMonitorLGCtxCreate()
Level: intermediate
See also: TS, TSMonitorSet(), TSMonitorLGCtxCreate(), TSMonitorLGKSPIterations()
External Links
- PETSc Manual:
TS/TSMonitorLGSNESIterations
PETSc.LibPETSc.TSMonitorLGSetDisplayVariables — Method
TSMonitorLGSetDisplayVariables(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorLGSetVariableNames()
External Links
- PETSc Manual:
TS/TSMonitorLGSetDisplayVariables
PETSc.LibPETSc.TSMonitorLGSetTransform — Method
TSMonitorLGSetTransform(petsclib::PetscLibType, ts::AbstractTS, transform::external, destroy::Ptr{Cvoid}, tctx::Ptr{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
Calling sequence of transform:
tctx- context used by the transform functionu- the input solution vectorw- the output transformed vector
Level: intermediate
See also: TSMonitorSet(), TSMonitorLGCtxSetTransform(), TSMonitorDefault(), VecView(), TSMonitorLGSetVariableNames(), PetscCtxDestroyFn
External Links
- PETSc Manual:
TS/TSMonitorLGSetTransform
PETSc.LibPETSc.TSMonitorLGSetVariableNames — Method
TSMonitorLGSetVariableNames(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorLGSetDisplayVariables(), TSMonitorLGCtxSetVariableNames()
External Links
- PETSc Manual:
TS/TSMonitorLGSetVariableNames
PETSc.LibPETSc.TSMonitorLGSolution — Method
TSMonitorLGSolution(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, dctx::Ptr{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
See also: 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::AbstractTS, step::PetscInt, ptime::PetscReal, v::AbstractPetscVec, monctx::Ptr{Cvoid})Monitors a TS by printing the time-steps
Collective
Input Parameters:
ts- the time integratorstep- the current time stepptime- the current timev- the current statemonctx- the monitor context obtained withTSMonitorLGCtxCreate()
Level: advanced
See also: TS, TSMonitorLGCtxCreate(), TSMonitorSet(), TSMonitorLGCtxDestroy()
External Links
- PETSc Manual:
TS/TSMonitorLGTimeStep
PETSc.LibPETSc.TSMonitorSPEig — Method
TSMonitorSPEig(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, v::AbstractPetscVec, monctx::Ptr{Cvoid})Monitors the eigenvalues of the linearized right-hand-side operator on a scatter plot at each time step
Collective
Input Parameters:
ts- theTScontextstep- the current time-step number (a negative value indicates an interpolated solution and is ignored)ptime- the current timev- the current solutionmonctx- theTSMonitorSPEigCtxcontext, created withTSMonitorSPEigCtxCreate()
Options Database Key:
-ts_monitor_sp_eig- plot eigenvalues of linearized right-hand side
Level: intermediate
See also: TS, TSMonitorSet(), TSMonitorSPEigCtxCreate(), TSMonitorSPEigCtxDestroy()
External Links
- PETSc Manual:
TS/TSMonitorSPEig
PETSc.LibPETSc.TSMonitorSPSwarmSolution — Method
TSMonitorSPSwarmSolution(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, dctx::Ptr{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 (true|false)- Color each species differently-ts_monitor_sp_swarm_phase (true|false)- Plot in phase space, as opposed to coordinate space
Level: intermediate
See also: TS, TSMonitorSet(), DMSWARM, TSMonitorSPCtxCreate()
External Links
- PETSc Manual:
TS/TSMonitorSPSwarmSolution
PETSc.LibPETSc.TSMonitorSet — Method
TSMonitorSet(petsclib::PetscLibType, ts::AbstractTS, monitor::external, mctx::Ptr{Cvoid}, mdestroy::Ptr{Cvoid})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
See also: 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::AbstractTS, 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
Calling sequence of monitor:
ts- theTSto monitorstep- the current time-steptime- the current timeu- the current solutionvf- thePetscViewerand format to monitor with
Calling sequence of monitorsetup:
ts- theTSto monitorvf- thePetscViewerand format to monitor with
Level: developer
See also: 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::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, vf::Vector{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
See also: TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorSolutionSetup()
External Links
- PETSc Manual:
TS/TSMonitorSolution
PETSc.LibPETSc.TSMonitorSolutionSetup — Method
TSMonitorSolutionSetup(petsclib::PetscLibType, ts::AbstractTS, vf::Vector{PetscViewerAndFormat})Setups the context for TSMonitorSolution()
Collective
Input Parameters:
ts- theTScontextvf- viewer and its format
Level: intermediate
See also: TS, TSMonitorSolution(), TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorSetFromOptions()
External Links
- PETSc Manual:
TS/TSMonitorSolutionSetup
PETSc.LibPETSc.TSMonitorSolutionVTK — Method
TSMonitorSolutionVTK(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, 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
See also: 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
See also: TSMonitorSet(), TSMonitorSolutionVTK(), TSMonitorSolutionVTKDestroy()
External Links
- PETSc Manual:
TS/TSMonitorSolutionVTKCtxCreate
PETSc.LibPETSc.TSMonitorSolutionVTKDestroy — Method
TSMonitorSolutionVTKDestroy(petsclib::PetscLibType, ctx::Union{TSMonitorVTKCtx, Ref{TSMonitorVTKCtx}})Destroy the monitor context created with TSMonitorSolutionVTKCtxCreate()
Not Collective
Input Parameter:
ctx- the monitor context
Level: developer
See also: TSMonitorSet(), TSMonitorSolutionVTK()
External Links
- PETSc Manual:
TS/TSMonitorSolutionVTKDestroy
PETSc.LibPETSc.TSMonitorWallClockTime — Method
TSMonitorWallClockTime(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, v::AbstractPetscVec, vf::Vector{PetscViewerAndFormat})Monitor wall-clock time, KSP iterations, and SNES iterations per 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 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
See also: 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::AbstractTS, vf::Vector{PetscViewerAndFormat})Setup routine passed to TSMonitorSetFromOptions() when using -ts_monitor_wall_clock_time
Input Parameters:
ts- theTScontextvf- the viewer and format
Level: intermediate
See also: TSMonitorSet()
External Links
- PETSc Manual:
TS/TSMonitorWallClockTimeSetUp
PETSc.LibPETSc.TSPostEvaluate — Method
TSPostEvaluate(petsclib::PetscLibType, ts::AbstractTS)Runs the user-defined post-evaluate function set using TSSetPostEvaluate()
Collective
Input Parameter:
ts- TheTScontext obtained fromTSCreate()
Level: developer
See also: TS, TSSetPostEvaluate(), TSSetPreStep(), TSPreStep(), TSPostStep()
External Links
- PETSc Manual:
TS/TSPostEvaluate
PETSc.LibPETSc.TSPostStage — Method
TSPostStage(petsclib::PetscLibType, ts::AbstractTS, stagetime::PetscReal, stageindex::PetscInt, Y::Vector{<:AbstractPetscVec})Runs the user-defined post-stage function set using TSSetPostStage()
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
See also: TS, TSPreStage(), TSSetPreStep(), TSPreStep(), TSPostStep()
External Links
- PETSc Manual:
TS/TSPostStage
PETSc.LibPETSc.TSPostStep — Method
TSPostStep(petsclib::PetscLibType, ts::AbstractTS)Runs the user-defined post-step function that was set with TSSetPostStep()
Collective
Input Parameter:
ts- TheTScontext obtained fromTSCreate()
See also: TS, TSSetPreStep(), TSSetPreStage(), TSSetPostEvaluate(), TSGetTimeStep(), TSGetStepNumber(), TSGetTime(), TSSetPostStep()
External Links
- PETSc Manual:
TS/TSPostStep
PETSc.LibPETSc.TSPreStage — Method
TSPreStage(petsclib::PetscLibType, ts::AbstractTS, stagetime::PetscReal)Runs the user-defined pre-stage function set using TSSetPreStage()
Collective
Input Parameters:
ts- TheTScontext obtained fromTSCreate()stagetime- The absolute time of the current stage
Level: developer
See also: TS, TSPostStage(), TSSetPreStep(), TSPreStep(), TSPostStep()
External Links
- PETSc Manual:
TS/TSPreStage
PETSc.LibPETSc.TSPreStep — Method
TSPreStep(petsclib::PetscLibType, ts::AbstractTS)Runs the user-defined pre-step function provided with TSSetPreStep()
Collective
Input Parameter:
ts- TheTScontext obtained fromTSCreate()
Level: developer
See also: TS, TSSetPreStep(), TSPreStage(), TSPostStage(), TSPostStep()
External Links
- PETSc Manual:
TS/TSPreStep
PETSc.LibPETSc.TSPruneIJacobianColor — Method
TSPruneIJacobianColor(petsclib::PetscLibType, ts::AbstractTS, J::AbstractPetscMat, B::AbstractPetscMat)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
See also: TS, MatFDColoring, TSComputeIJacobianDefaultColor(), MatEliminateZeros(), MatFDColoringCreate(), MatFDColoringSetFunction()
External Links
- PETSc Manual:
TS/TSPruneIJacobianColor
PETSc.LibPETSc.TSPseudoComputeFunction — Method
residual::PetscVec,fnorm::PetscReal = TSPseudoComputeFunction(petsclib::PetscLibType, ts::AbstractTS, solution::AbstractPetscVec)Compute nonlinear residual for pseudo-timestepping
This computes the residual for \dot U = 0, i.e. F(U, 0) for the IFunction.
Collective
Input Parameters:
ts- the timestep contextsolution- the solution vector
Output Parameter:
residual- the nonlinear residualfnorm- the norm of the nonlinear residual
Level: advanced
See also: TSPSEUDO
External Links
- PETSc Manual:
TS/TSPseudoComputeFunction
PETSc.LibPETSc.TSPseudoIncrementDtFromInitialDt — Method
TSPseudoIncrementDtFromInitialDt(petsclib::PetscLibType, ts::AbstractTS)Indicates that a new timestep is computed via the formula dt = initial_dtinitial_fnorm/current_fnorm rather than the default update, dt = current_dtprevious_fnorm/current_fnorm.
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
See also: TSPSEUDO, TSPseudoSetTimeStep(), TSPseudoTimeStepDefault()
External Links
- PETSc Manual:
TS/TSPseudoIncrementDtFromInitialDt
PETSc.LibPETSc.TSPseudoSetMaxTimeStep — Method
TSPseudoSetMaxTimeStep(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TSPSEUDO, TSPseudoSetTimeStep(), TSPseudoTimeStepDefault()
External Links
- PETSc Manual:
TS/TSPseudoSetMaxTimeStep
PETSc.LibPETSc.TSPseudoSetTimeStep — Method
TSPseudoSetTimeStep(petsclib::PetscLibType, ts::AbstractTS, dt::external, ctx::Ptr{Cvoid})Sets the user-defined routine to be 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
See also: TSPSEUDO, TSPseudoTimeStepDefault(), TSPseudoComputeTimeStep()
External Links
- PETSc Manual:
TS/TSPseudoSetTimeStep
PETSc.LibPETSc.TSPseudoSetTimeStepIncrement — Method
TSPseudoSetTimeStepIncrement(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TSPSEUDO, TSPseudoSetTimeStep(), TSPseudoTimeStepDefault()
External Links
- PETSc Manual:
TS/TSPseudoSetTimeStepIncrement
PETSc.LibPETSc.TSPseudoSetVerifyTimeStep — Method
TSPseudoSetVerifyTimeStep(petsclib::PetscLibType, ts::AbstractTS, dt::external, ctx::Ptr{Cvoid})Sets a user-defined routine to verify the quality of the 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
See also: TSPSEUDO, TSPseudoVerifyTimeStepDefault(), TSPseudoVerifyTimeStep()
External Links
- PETSc Manual:
TS/TSPseudoSetVerifyTimeStep
PETSc.LibPETSc.TSPseudoTimeStepDefault — Method
newdt::PetscReal = TSPseudoTimeStepDefault(petsclib::PetscLibType, ts::AbstractTS, dtctx::Ptr{Cvoid})Default code to compute pseudo-timestepping. Use with TSPseudoSetTimeStep().
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
See also: TSPseudoSetTimeStep(), TSPseudoComputeTimeStep(), TSPSEUDO
External Links
- PETSc Manual:
TS/TSPseudoTimeStepDefault
PETSc.LibPETSc.TSPythonGetType — Method
pyname::String = TSPythonGetType(petsclib::PetscLibType, ts::AbstractTS)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
See also: TSCreate(), TSSetType(), TSPYTHON, PetscPythonInitialize(), TSPythonSetType()
External Links
- PETSc Manual:
TS/TSPythonGetType
PETSc.LibPETSc.TSPythonSetType — Method
TSPythonSetType(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TSCreate(), TSSetType(), TSPYTHON, PetscPythonInitialize()
External Links
- PETSc Manual:
TS/TSPythonSetType
PETSc.LibPETSc.TSRHSJacobianSetReuse — Method
TSRHSJacobianSetReuse(petsclib::PetscLibType, ts::AbstractTS, reuse::PetscBool)restore the RHS Jacobian before calling the user-provided TSRHSJacobianFn function again
Logically Collective
Input Parameters:
ts-TScontext obtained fromTSCreate()reuse-PETSC_TRUEif the RHS Jacobian
Level: intermediate
See also: TS, TSSetRHSJacobian(), TSComputeRHSJacobianConstant()
External Links
- PETSc Manual:
TS/TSRHSJacobianSetReuse
PETSc.LibPETSc.TSRHSJacobianTest — Method
flg::PetscBool = TSRHSJacobianTest(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, Mat, MATSHELL, MatCreateShell(), MatShellGetContext(), MatShellGetOperation(), MatShellTestMultTranspose(), TSRHSJacobianTestTranspose()
External Links
- PETSc Manual:
TS/TSRHSJacobianTest
PETSc.LibPETSc.TSRHSJacobianTestTranspose — Method
flg::PetscBool = TSRHSJacobianTestTranspose(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, Mat, MatCreateShell(), MatShellGetContext(), MatShellGetOperation(), MatShellTestMultTranspose(), TSRHSJacobianTest()
External Links
- PETSc Manual:
TS/TSRHSJacobianTestTranspose
PETSc.LibPETSc.TSRHSSplitGetIS — Method
is::IS = TSRHSSplitGetIS(petsclib::PetscLibType, ts::AbstractTS, splitname::String)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
See also: TS, IS, TSRHSSplitSetIS()
External Links
- PETSc Manual:
TS/TSRHSSplitGetIS
PETSc.LibPETSc.TSRHSSplitGetSNES — Method
snes::SNES = TSRHSSplitGetSNES(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, SNES, TSCreate(), TSRHSSplitSetSNES()
External Links
- PETSc Manual:
TS/TSRHSSplitGetSNES
PETSc.LibPETSc.TSRHSSplitGetSubTS — Method
subts::TS = TSRHSSplitGetSubTS(petsclib::PetscLibType, ts::AbstractTS, splitname::String)Get the sub-TS by split name.
Logically Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Output Parameters:
splitname- the number of the splitsubts- the sub-TS
Level: advanced
See also: TS, IS, TSGetRHSSplitFunction()
External Links
- PETSc Manual:
TS/TSRHSSplitGetSubTS
PETSc.LibPETSc.TSRHSSplitGetSubTSs — Method
n::PetscInt,subts::Vector{TS} = TSRHSSplitGetSubTSs(petsclib::PetscLibType, ts::AbstractTS)Get an array of all sub-TS contexts.
Logically Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Output Parameters:
n- the number of splitssubts- the array ofTScontexts
Level: advanced
See also: TS, IS, TSGetRHSSplitFunction()
External Links
- PETSc Manual:
TS/TSRHSSplitGetSubTSs
PETSc.LibPETSc.TSRHSSplitSetIFunction — Method
TSRHSSplitSetIFunction(petsclib::PetscLibType, ts::AbstractTS, splitname::String, r::AbstractPetscVec, ifunc::Ptr{Cvoid}, ctx::Ptr{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
See also: TS, TSIFunctionFn, IS, TSRHSSplitSetIS(), TSARKIMEX, TSARKIMEXSetFastSlowSplit()
External Links
- PETSc Manual:
TS/TSRHSSplitSetIFunction
PETSc.LibPETSc.TSRHSSplitSetIJacobian — Method
TSRHSSplitSetIJacobian(petsclib::PetscLibType, ts::AbstractTS, splitname::String, Amat::AbstractPetscMat, Pmat::AbstractPetscMat, ijac::Ptr{Cvoid}, ctx::Ptr{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
See also: TS, TSRHSSplitSetIFunction, TSIJacobianFn, IS, TSRHSSplitSetIS(), TSARKIMEXSetFastSlowSplit()
External Links
- PETSc Manual:
TS/TSRHSSplitSetIJacobian
PETSc.LibPETSc.TSRHSSplitSetIS — Method
TSRHSSplitSetIS(petsclib::PetscLibType, ts::AbstractTS, splitname::String, is::AbstractIS)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
See also: TS, IS, TSRHSSplitGetIS(), TSARKIMEXSetFastSlowSplit()
External Links
- PETSc Manual:
TS/TSRHSSplitSetIS
PETSc.LibPETSc.TSRHSSplitSetRHSFunction — Method
TSRHSSplitSetRHSFunction(petsclib::PetscLibType, ts::AbstractTS, splitname::String, r::AbstractPetscVec, rhsfunc::Ptr{Cvoid}, ctx::Ptr{Cvoid})Set the split right-hand-side functions.
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
See also: TS, TSRHSFunctionFn, IS, TSRHSSplitSetIS()
External Links
- PETSc Manual:
TS/TSRHSSplitSetRHSFunction
PETSc.LibPETSc.TSRHSSplitSetSNES — Method
TSRHSSplitSetSNES(petsclib::PetscLibType, ts::AbstractTS, snes::AbstractSNES)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
See also: 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
See also: PetscFinalize(), TSRKInitializePackage()
External Links
- PETSc Manual:
TS/TSRKFinalizePackage
PETSc.LibPETSc.TSRKGetMultirate — Method
use_multirate::PetscBool = TSRKGetMultirate(petsclib::PetscLibType, ts::AbstractTS)Gets whether to use the interpolation-based multirate TSRK method
Not Collective
Input Parameter:
ts- timestepping context
Output Parameter:
use_multirate-PETSC_TRUEif the multirate RK method is enabled,PETSC_FALSEotherwise
Level: intermediate
See also: TSRK, TSRKSetMultirate()
External Links
- PETSc Manual:
TS/TSRKGetMultirate
PETSc.LibPETSc.TSRKGetOrder — Method
order::PetscInt = TSRKGetOrder(petsclib::PetscLibType, ts::AbstractTS)Get the order of the TSRK scheme
Not Collective
Input Parameter:
ts- timestepping context
Output Parameter:
order- order ofTSRKscheme
Level: intermediate
See also: TSRK, TSRKGetType()
External Links
- PETSc Manual:
TS/TSRKGetOrder
PETSc.LibPETSc.TSRKGetTableau — Method
s::PetscInt,A::Vector{PetscReal},b::Vector{PetscReal},c::Vector{PetscReal},bembed::Vector{PetscReal},p::PetscInt,binterp::Vector{PetscReal},FSAL::PetscBool = TSRKGetTableau(petsclib::PetscLibType, ts::AbstractTS)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 (dimensions*s, row-major)b- step completion table (dimensions)c- abscissa (dimensions)bembed- completion table for embedded method (dimensions;NULLif not available)p- Order of the interpolation scheme, equal to the number of columns ofbinterpbinterp- Coefficients of the interpolation formula (dimensions*p)FSAL- whether or not the scheme has the First Same As Last property
Level: developer
See also: TSRK, TSRKRegister(), TSRKSetType()
External Links
- PETSc Manual:
TS/TSRKGetTableau
PETSc.LibPETSc.TSRKGetType — Method
rktype::String = TSRKGetType(petsclib::PetscLibType, ts::AbstractTS)Get the type of TSRK scheme
Not Collective
Input Parameter:
ts- timestepping context
Output Parameter:
rktype- type ofTSRK-scheme
Level: intermediate
See also: TSRKSetType()
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
See also: TSInitializePackage(), PetscInitialize(), TSRKFinalizePackage()
External Links
- PETSc Manual:
TS/TSRKInitializePackage
PETSc.LibPETSc.TSRKRegister — Method
TSRKRegister(petsclib::PetscLibType, name::String, 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 (dimensions*s, row-major)b- step completion table (dimensions;NULLto use last row ofA)c- abscissa (dimensions;NULLto use row sums ofA)bembed- completion table for embedded method (dimensions;NULLif not available)p- order of the interpolation scheme, equal to the number of columns ofbinterpbinterp- coefficients of the interpolation formula (dimensions*p;NULLto reusebwith p=1)
Level: advanced
See also: TSRK
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
See also: TSRK, TSRKRegister(), TSRKRegisterAll()
External Links
- PETSc Manual:
TS/TSRKRegisterDestroy
PETSc.LibPETSc.TSRKSetMultirate — Method
TSRKSetMultirate(petsclib::PetscLibType, ts::AbstractTS, use_multirate::PetscBool)Use the interpolation-based multirate TSRK method
Logically Collective
Input Parameters:
ts- timestepping contextuse_multirate-PETSC_TRUEenables the multirateTSRKmethod, sets the basic method to beTSRK2Aand sets the ratio between slow stepsize and fast stepsize to be 2
Options Database Key:
-ts_rk_multirate (true|false)- enable the multirate RK method
Level: intermediate
See also: TSRK, TSRKGetMultirate()
External Links
- PETSc Manual:
TS/TSRKSetMultirate
PETSc.LibPETSc.TSRKSetType — Method
TSRKSetType(petsclib::PetscLibType, ts::AbstractTS, rktype::String)Set the type of the TSRK scheme
Logically Collective
Input Parameters:
ts- timestepping contextrktype- type ofTSRKscheme
Options Database Key:
-ts_rk_type (1fe|2a|2b|3|3bs|4|5f|5dp|5bs|6vr|7vr|8vr)- the type
Level: intermediate
See also: 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
Calling sequence of function:
ts- theTSbeing setup for the newTSTypebeing registered
Level: advanced
See also: TSSetType(), TSType, TSRegisterAll(), TSRegisterDestroy()
External Links
- PETSc Manual:
TS/TSRegister
PETSc.LibPETSc.TSRemoveTrajectory — Method
TSRemoveTrajectory(petsclib::PetscLibType, ts::AbstractTS)Destroys and removes the internal TSTrajectory object from a TS
Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Level: intermediate
See also: TSTrajectory, TSResetTrajectory(), TSAdjointSolve()
External Links
- PETSc Manual:
TS/TSRemoveTrajectory
PETSc.LibPETSc.TSReset — Method
TSReset(petsclib::PetscLibType, ts::AbstractTS)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
See also: TS, TSCreate(), TSSetUp(), TSDestroy(), TSSetResize()
External Links
- PETSc Manual:
TS/TSReset
PETSc.LibPETSc.TSResetTrajectory — Method
TSResetTrajectory(petsclib::PetscLibType, ts::AbstractTS)Destroys and recreates the internal TSTrajectory object
Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Level: intermediate
See also: TSTrajectory, TSGetTrajectory(), TSAdjointSolve(), TSRemoveTrajectory()
External Links
- PETSc Manual:
TS/TSResetTrajectory
PETSc.LibPETSc.TSResize — Method
TSResize(petsclib::PetscLibType, ts::AbstractTS)Runs the user-defined transfer functions provided with TSSetResize()
Collective
Input Parameter:
ts- TheTScontext obtained fromTSCreate()
Level: developer
See also: TS, TSSetResize()
External Links
- PETSc Manual:
TS/TSResize
PETSc.LibPETSc.TSResizeRegisterVec — Method
TSResizeRegisterVec(petsclib::PetscLibType, ts::AbstractTS, name::String, vec::AbstractPetscVec)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
See also: TS, TSSetResize(), TSResize(), TSResizeRetrieveVec()
External Links
- PETSc Manual:
TS/TSResizeRegisterVec
PETSc.LibPETSc.TSResizeRetrieveVec — Method
TSResizeRetrieveVec(petsclib::PetscLibType, ts::AbstractTS, name::String, vec::AbstractPetscVec)Retrieve a vector registered with TSResizeRegisterVec().
Collective
Input Parameters:
ts- TheTScontext obtained fromTSCreate()name- A string identifying the vectorvec- The vector
Level: developer
See also: TS, TSSetResize(), TSResize(), TSResizeRegisterVec()
External Links
- PETSc Manual:
TS/TSResizeRetrieveVec
PETSc.LibPETSc.TSRestartStep — Method
TSRestartStep(petsclib::PetscLibType, ts::AbstractTS)Flags the solver to restart the next step
Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Level: advanced
See also: TS, TSBDF, TSSolve(), TSSetPreStep(), TSSetPostStep()
External Links
- PETSc Manual:
TS/TSRestartStep
PETSc.LibPETSc.TSRollBack — Method
TSRollBack(petsclib::PetscLibType, ts::AbstractTS)Rolls back one time step
Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Level: advanced
See also: 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
See also: TSROSW, PetscFinalize(), TSRosWInitializePackage()
External Links
- PETSc Manual:
TS/TSRosWFinalizePackage
PETSc.LibPETSc.TSRosWGetType — Method
rostype::String = TSRosWGetType(petsclib::PetscLibType, ts::AbstractTS)Get the type of Rosenbrock-W scheme
Logically Collective
Input Parameter:
ts- timestepping context
Output Parameter:
rostype- type of Rosenbrock-W scheme
Level: intermediate
See also: 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
See also: TSROSW, PetscInitialize(), TSRosWFinalizePackage()
External Links
- PETSc Manual:
TS/TSRosWInitializePackage
PETSc.LibPETSc.TSRosWRegister — Method
TSRosWRegister(petsclib::PetscLibType, name::String, 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
See also: TSROSW
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
See also: TSRosWRegister(), TSRosWRegisterAll()
External Links
- PETSc Manual:
TS/TSRosWRegisterDestroy
PETSc.LibPETSc.TSRosWRegisterRos4 — Method
TSRosWRegisterRos4(petsclib::PetscLibType, name::String, 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
See also: TSROSW, TSRosWRegister()
External Links
- PETSc Manual:
TS/TSRosWRegisterRos4
PETSc.LibPETSc.TSRosWSetRecomputeJacobian — Method
TSRosWSetRecomputeJacobian(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TSRosWType, TSRosWGetType()
External Links
- PETSc Manual:
TS/TSRosWSetRecomputeJacobian
PETSc.LibPETSc.TSRosWSetType — Method
TSRosWSetType(petsclib::PetscLibType, ts::AbstractTS, roswtype::String)Set the type of Rosenbrock-W, TSROSW, scheme
Logically Collective
Input Parameters:
ts- timestepping contextroswtype- type of Rosenbrock-W scheme
Level: beginner
See also: 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
See also: PetscFinalize(), TSSSPInitiallizePackage(), TSInitializePackage()
External Links
- PETSc Manual:
TS/TSSSPFinalizePackage
PETSc.LibPETSc.TSSSPGetNumStages — Method
nstages::PetscInt = TSSSPGetNumStages(petsclib::PetscLibType, ts::AbstractTS)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
See also: TSSSP, TSSSPGetType(), TSSSPSetNumStages(), TSSSPRKS2, TSSSPRKS3, TSSSPRK104
External Links
- PETSc Manual:
TS/TSSSPGetNumStages
PETSc.LibPETSc.TSSSPGetType — Method
type::String = TSSSPGetType(petsclib::PetscLibType, ts::AbstractTS)get the TSSSP time integration scheme
Logically Collective
Input Parameter:
ts- time stepping object
Output Parameter:
type- type of scheme being used
Level: beginner
See also: 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
See also: PetscInitialize(), TSSSPFinalizePackage(), TSInitializePackage()
External Links
- PETSc Manual:
TS/TSSSPInitializePackage
PETSc.LibPETSc.TSSSPSetNumStages — Method
TSSSPSetNumStages(petsclib::PetscLibType, ts::AbstractTS, 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|rks3|rk104)- Type ofTSSSPmethod, seeTSSSPType-ts_ssp_num_stages nstages- number of stages
Level: beginner
See also: TSSSP, TSSSPGetNumStages(), TSSSPRKS2, TSSSPRKS3, TSSSPRK104
External Links
- PETSc Manual:
TS/TSSSPSetNumStages
PETSc.LibPETSc.TSSSPSetType — Method
TSSSPSetType(petsclib::PetscLibType, ts::AbstractTS, ssptype::String)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|rks3|rk104)- Type ofTSSSPmethod, seeTSSSPType-ts_ssp_num_stages nstages- Number of stages
Level: beginner
See also: TSSSP, TSSSPGetType(), TSSSPSetNumStages(), TSSSPRKS2, TSSSPRKS3, TSSSPRK104
External Links
- PETSc Manual:
TS/TSSSPSetType
PETSc.LibPETSc.TSSetApplicationContext — Method
TSSetApplicationContext(petsclib::PetscLibType, ts::AbstractTS, ctx::Ptr{Cvoid})Sets an optional user-defined context for the timesteppers that may be accessed, for example inside the user provided TS callbacks with TSGetApplicationContext()
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()ctx- application context
Level: intermediate
See also: TS, TSGetApplicationContext()
External Links
- PETSc Manual:
TS/TSSetApplicationContext
PETSc.LibPETSc.TSSetCFLTimeLocal — Method
TSSetCFLTimeLocal(petsclib::PetscLibType, ts::AbstractTS, 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)
See also: TSGetCFLTime(), TSADAPTCFL
External Links
- PETSc Manual:
TS/TSSetCFLTimeLocal
PETSc.LibPETSc.TSSetComputeExactError — Method
TSSetComputeExactError(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TS, TSGetComputeExactError(), TSComputeExactError()
External Links
- PETSc Manual:
TS/TSSetComputeExactError
PETSc.LibPETSc.TSSetComputeInitialCondition — Method
TSSetComputeInitialCondition(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TS, TSGetComputeInitialCondition(), TSComputeInitialCondition()
External Links
- PETSc Manual:
TS/TSSetComputeInitialCondition
PETSc.LibPETSc.TSSetConvergedReason — Method
TSSetConvergedReason(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TS, TSSolve(), TSConvergedReason
External Links
- PETSc Manual:
TS/TSSetConvergedReason
PETSc.LibPETSc.TSSetCostGradients — Method
TSSetCostGradients(petsclib::PetscLibType, ts::AbstractTS, numcost::PetscInt, lambda::Vector{<:AbstractPetscVec}, mu::Vector{<:AbstractPetscVec})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
See also: TS, TSAdjointSolve(), TSGetCostGradients()
External Links
- PETSc Manual:
Sensitivity/TSSetCostGradients
PETSc.LibPETSc.TSSetCostHessianProducts — Method
TSSetCostHessianProducts(petsclib::PetscLibType, ts::AbstractTS, numcost::PetscInt, lambda2::Vector{<:AbstractPetscVec}, mu2::Vector{<:AbstractPetscVec}, dir::AbstractPetscVec)Sets the initial value of the Hessian-vector products 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 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
See also: TS, TSAdjointSolve(), TSAdjointSetForward()
External Links
- PETSc Manual:
Sensitivity/TSSetCostHessianProducts
PETSc.LibPETSc.TSSetDM — Method
TSSetDM(petsclib::PetscLibType, ts::AbstractTS, dm::AbstractPetscDM)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
See also: TS, DM, TSGetDM(), SNESSetDM(), SNESGetDM()
External Links
- PETSc Manual:
TS/TSSetDM
PETSc.LibPETSc.TSSetEquationType — Method
TSSetEquationType(petsclib::PetscLibType, ts::AbstractTS, equation_type::TSEquationType)Sets the type of the equation that TS is solving.
Not Collective
Input Parameters:
ts- theTScontextequation_type- seeTSEquationType
Level: advanced
See also: TS, TSGetEquationType(), TSEquationType
External Links
- PETSc Manual:
TS/TSSetEquationType
PETSc.LibPETSc.TSSetErrorIfStepFails — Method
TSSetErrorIfStepFails(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TS, TSGetSNESIterations(), TSGetKSPIterations(), TSSetMaxStepRejections(), TSGetStepRejections(), TSGetSNESFailures(), TSGetConvergedReason()
External Links
- PETSc Manual:
TS/TSSetErrorIfStepFails
PETSc.LibPETSc.TSSetEvaluationTimes — Method
TSSetEvaluationTimes(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TS, TSGetEvaluationTimes(), TSGetEvaluationSolutions(), TSSetTimeSpan()
External Links
- PETSc Manual:
TS/TSSetEvaluationTimes
PETSc.LibPETSc.TSSetEventHandler — Method
TSSetEventHandler(petsclib::PetscLibType, ts::AbstractTS, nevents::PetscInt, direction::Vector{PetscInt}, terminate::Vector{PetscBool}, indicator::external, postevent::external, ctx::Ptr{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
See also: TSEvent, TSCreate(), TSSetTimeStep(), TSSetConvergedReason()
External Links
- PETSc Manual:
TS/TSSetEventHandler
PETSc.LibPETSc.TSSetEventTolerances — Method
TSSetEventTolerances(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TS, TSEvent, TSSetEventHandler()
External Links
- PETSc Manual:
TS/TSSetEventTolerances
PETSc.LibPETSc.TSSetExactFinalTime — Method
TSSetExactFinalTime(petsclib::PetscLibType, ts::AbstractTS, 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
$TS_EXACTFINALTIME_STEPOVER - Don't do anything if final time is exceeded, just use it TS_EXACTFINALTIME_INTERPOLATE - Interpolate back to final time if the final time is exceeded TS_EXACTFINALTIME_MATCHSTEP - Adapt final time step to ensure the computed final time exactly equals the requested final time$
Options Database Key:
-ts_exact_final_time stepover,interpolate,matchstep- select the final step approach at runtime
Level: beginner
See also: TS, TSExactFinalTimeOption, TSGetExactFinalTime()
External Links
- PETSc Manual:
TS/TSSetExactFinalTime
PETSc.LibPETSc.TSSetForcingFunction — Method
TSSetForcingFunction(petsclib::PetscLibType, ts::AbstractTS, func::Ptr{Cvoid}, ctx::Ptr{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
See also: TS, TSForcingFn, TSSetRHSJacobian(), TSSetIJacobian(), TSComputeSolutionFunction(), TSSetSolutionFunction()
External Links
- PETSc Manual:
TS/TSSetForcingFunction
PETSc.LibPETSc.TSSetFromOptions — Method
TSSetFromOptions(petsclib::PetscLibType, ts::AbstractTS)Sets various TS parameters from the options database
Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Options Database Keys:
-ts_type type- 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 forTSSolve()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_time_step dt- initial time step (only a suggestion, the actual initial time step used differ)-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_step_rejections 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 (true|false)- 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,KSPiterations, andSNESiterations 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
See also: TS, TSGetType()
External Links
- PETSc Manual:
TS/TSSetFromOptions
PETSc.LibPETSc.TSSetFunctionDomainError — Method
TSSetFunctionDomainError(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TSAdaptCheckStage(), TSFunctionDomainError(), SNESSetFunctionDomainError(), TSGetSNES()
External Links
- PETSc Manual:
TS/TSSetFunctionDomainError
PETSc.LibPETSc.TSSetI2Function — Method
TSSetI2Function(petsclib::PetscLibType, ts::AbstractTS, F::AbstractPetscVec, fun::Ptr{Cvoid}, ctx::Ptr{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
See also: TS, TSI2FunctionFn, TSSetI2Jacobian(), TSSetIFunction(), TSCreate(), TSSetRHSFunction()
External Links
- PETSc Manual:
TS/TSSetI2Function
PETSc.LibPETSc.TSSetI2Jacobian — Method
TSSetI2Jacobian(petsclib::PetscLibType, ts::AbstractTS, J::AbstractPetscMat, P::AbstractPetscMat, jac::Ptr{Cvoid}, ctx::Ptr{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
See also: TS, TSI2JacobianFn, TSSetI2Function(), TSGetI2Jacobian()
External Links
- PETSc Manual:
TS/TSSetI2Jacobian
PETSc.LibPETSc.TSSetIFunction — Method
TSSetIFunction(petsclib::PetscLibType, ts::AbstractTS, r::AbstractPetscVec, f::Ptr{Cvoid}, ctx::Ptr{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
See also: TS, TSIFunctionFn, TSSetRHSJacobian(), TSSetRHSFunction(), TSSetIJacobian()
External Links
- PETSc Manual:
TS/TSSetIFunction
PETSc.LibPETSc.TSSetIHessianProduct — Method
TSSetIHessianProduct(petsclib::PetscLibType, ts::AbstractTS, ihp1::Vector{<:AbstractPetscVec}, ihessianproductfunc1::external, ihp2::Vector{<:AbstractPetscVec}, ihessianproductfunc2::external, ihp3::Vector{<:AbstractPetscVec}, ihessianproductfunc3::external, ihp4::Vector{<:AbstractPetscVec}, ihessianproductfunc4::external, ctx::Ptr{Cvoid})Sets the function that computes the vector-Hessian-vector product. The Hessian is the second-order derivative of F (IFunction) w.r.t. the state variable.
Logically Collective
Input Parameters:
ts-TScontext obtained fromTSCreate()ihp1- an array of vectors storing the result of vector-Hessian-vector product for F_{UU}ihessianproductfunc1- vector-Hessian-vector product function for F_{UU}ihp2- an array of vectors storing the result of vector-Hessian-vector product for F_{UP}ihessianproductfunc2- vector-Hessian-vector product function for F_{UP}ihp3- an array of vectors storing the result of vector-Hessian-vector product for F_{PU}ihessianproductfunc3- vector-Hessian-vector product function for F_{PU}ihp4- an array of vectors storing the result of vector-Hessian-vector product for F_{PP}ihessianproductfunc4- vector-Hessian-vector product function for F_{PP}ctx- [optional] function context
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] function context
Level: intermediate
See also: TS
External Links
- PETSc Manual:
Sensitivity/TSSetIHessianProduct
PETSc.LibPETSc.TSSetIJacobian — Method
TSSetIJacobian(petsclib::PetscLibType, ts::AbstractTS, Amat::AbstractPetscMat, Pmat::AbstractPetscMat, f::Ptr{Cvoid}, ctx::Ptr{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
See also: TS, TSIJacobianFn, TSSetIFunction(), TSSetRHSJacobian(), SNESComputeJacobianDefaultColor(), SNESComputeJacobianDefault(), TSSetRHSFunction()
External Links
- PETSc Manual:
TS/TSSetIJacobian
PETSc.LibPETSc.TSSetIJacobianP — Method
TSSetIJacobianP(petsclib::PetscLibType, ts::AbstractTS, Amat::AbstractPetscMat, func::external, ctx::Ptr{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] 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] function context
Level: intermediate
See also: TSSetRHSJacobianP(), TS
External Links
- PETSc Manual:
Sensitivity/TSSetIJacobianP
PETSc.LibPETSc.TSSetMatStructure — Method
TSSetMatStructure(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TS, MatAXPY(), MatStructure
External Links
- PETSc Manual:
TS/TSSetMatStructure
PETSc.LibPETSc.TSSetMaxSNESFailures — Method
TSSetMaxSNESFailures(petsclib::PetscLibType, ts::AbstractTS, fails::PetscInt)Sets the maximum number of failed SNES solves allowed before TSSolve() is ended with a TSConvergedReason of TS_DIVERGED_NONLINEAR_SOLVE
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
See also: TS, SNES, TSGetSNESIterations(), TSGetKSPIterations(), TSSetMaxStepRejections(), TSGetStepRejections(), TSGetSNESFailures(), SNESGetConvergedReason(), TSGetConvergedReason(), TS_DIVERGED_NONLINEAR_SOLVE, TSConvergedReason
External Links
- PETSc Manual:
TS/TSSetMaxSNESFailures
PETSc.LibPETSc.TSSetMaxStepRejections — Method
TSSetMaxStepRejections(petsclib::PetscLibType, ts::AbstractTS, rejects::PetscInt)Sets the maximum number of step rejections allowed in a single time-step attempt before a time step fails in TSSolve() with TS_DIVERGED_STEP_REJECTED
Not Collective
Input Parameters:
ts-TScontextrejects- maximum number of rejected steps, passPETSC_UNLIMITEDfor unlimited
Options Database Key:
-ts_max_step_rejections- Maximum number of step rejections before a step fails
Level: intermediate
See also: TS, SNES, TSGetSNESIterations(), TSGetKSPIterations(), TSSetMaxSNESFailures(), TSGetStepRejections(), TSGetSNESFailures(), TSSetErrorIfStepFails(), TSGetConvergedReason(), TSSolve(), TS_DIVERGED_STEP_REJECTED
External Links
- PETSc Manual:
TS/TSSetMaxStepRejections
PETSc.LibPETSc.TSSetMaxSteps — Method
TSSetMaxSteps(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TS, TSGetMaxSteps(), TSSetMaxTime(), TSSetExactFinalTime()
External Links
- PETSc Manual:
TS/TSSetMaxSteps
PETSc.LibPETSc.TSSetMaxTime — Method
TSSetMaxTime(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TS, TSGetMaxTime(), TSSetMaxSteps(), TSSetExactFinalTime()
External Links
- PETSc Manual:
TS/TSSetMaxTime
PETSc.LibPETSc.TSSetOptionsPrefix — Method
TSSetOptionsPrefix(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TS, TSSetFromOptions(), TSAppendOptionsPrefix()
External Links
- PETSc Manual:
TS/TSSetOptionsPrefix
PETSc.LibPETSc.TSSetPostEvaluate — Method
TSSetPostEvaluate(petsclib::PetscLibType, ts::AbstractTS, func::external)Sets the general-purpose function 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
See also: TS, TSSetPreStage(), TSSetPreStep(), TSSetPostStep(), TSGetApplicationContext()
External Links
- PETSc Manual:
TS/TSSetPostEvaluate
PETSc.LibPETSc.TSSetPostEventSecondStep — Method
TSSetPostEventSecondStep(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TS, TSEvent, TSSetEventHandler(), TSSetPostEventStep()
External Links
- PETSc Manual:
TS/TSSetPostEventSecondStep
PETSc.LibPETSc.TSSetPostEventStep — Method
TSSetPostEventStep(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TS, TSEvent, TSSetEventHandler(), TSSetPostEventSecondStep()
External Links
- PETSc Manual:
TS/TSSetPostEventStep
PETSc.LibPETSc.TSSetPostStage — Method
TSSetPostStage(petsclib::PetscLibType, ts::AbstractTS, func::external)Sets the general-purpose function 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
See also: TS, TSSetPreStage(), TSSetPreStep(), TSSetPostStep(), TSGetApplicationContext()
External Links
- PETSc Manual:
TS/TSSetPostStage
PETSc.LibPETSc.TSSetPostStep — Method
TSSetPostStep(petsclib::PetscLibType, ts::AbstractTS, func::external)Sets the general-purpose function 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
See also: TS, TSSetPreStep(), TSSetPreStage(), TSSetPostEvaluate(), TSGetTimeStep(), TSGetStepNumber(), TSGetTime(), TSRestartStep()
External Links
- PETSc Manual:
TS/TSSetPostStep
PETSc.LibPETSc.TSSetPreStage — Method
TSSetPreStage(petsclib::PetscLibType, ts::AbstractTS, func::external)Sets the general-purpose function 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
See also: TS, TSSetPostStage(), TSSetPreStep(), TSSetPostStep(), TSGetApplicationContext()
External Links
- PETSc Manual:
TS/TSSetPreStage
PETSc.LibPETSc.TSSetPreStep — Method
TSSetPreStep(petsclib::PetscLibType, ts::AbstractTS, func::external)Sets the general-purpose function 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
See also: TS, TSSetPreStage(), TSSetPostStage(), TSSetPostStep(), TSStep(), TSRestartStep()
External Links
- PETSc Manual:
TS/TSSetPreStep
PETSc.LibPETSc.TSSetProblemType — Method
TSSetProblemType(petsclib::PetscLibType, ts::AbstractTS, 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
$U_t - A U = 0 (linear) U_t - A(t) U = 0 (linear) F(t,U,U_t) = 0 (nonlinear)$
Level: beginner
See also: TSSetUp(), TSProblemType, TS
External Links
- PETSc Manual:
TS/TSSetProblemType
PETSc.LibPETSc.TSSetRHSFunction — Method
TSSetRHSFunction(petsclib::PetscLibType, ts::AbstractTS, r::AbstractPetscVec, f::Ptr{Cvoid}, ctx::Ptr{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
See also: TS, TSRHSFunctionFn, TSSetRHSJacobian(), TSSetIJacobian(), TSSetIFunction()
External Links
- PETSc Manual:
TS/TSSetRHSFunction
PETSc.LibPETSc.TSSetRHSHessianProduct — Method
TSSetRHSHessianProduct(petsclib::PetscLibType, ts::AbstractTS, rhshp1::Vector{<:AbstractPetscVec}, rhshessianproductfunc1::external, rhshp2::Vector{<:AbstractPetscVec}, rhshessianproductfunc2::external, rhshp3::Vector{<:AbstractPetscVec}, rhshessianproductfunc3::external, rhshp4::Vector{<:AbstractPetscVec}, rhshessianproductfunc4::external, ctx::Ptr{Cvoid})Sets the function that computes the vector-Hessian-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_{UU}rhshessianproductfunc1- vector-Hessian-vector product function for G_{UU}rhshp2- an array of vectors storing the result of vector-Hessian-vector product for G_{UP}rhshessianproductfunc2- vector-Hessian-vector product function for G_{UP}rhshp3- an array of vectors storing the result of vector-Hessian-vector product for G_{PU}rhshessianproductfunc3- vector-Hessian-vector product function for G_{PU}rhshp4- an array of vectors storing the result of vector-Hessian-vector product for G_{PP}rhshessianproductfunc4- vector-Hessian-vector product function for G_{PP}ctx- [optional] 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] function context
Level: intermediate
See also: TS, TSAdjoint
External Links
- PETSc Manual:
Sensitivity/TSSetRHSHessianProduct
PETSc.LibPETSc.TSSetRHSJacobian — Method
TSSetRHSJacobian(petsclib::PetscLibType, ts::AbstractTS, Amat::AbstractPetscMat, Pmat::AbstractPetscMat, f::Ptr{Cvoid}, ctx::Ptr{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
See also: TS, TSRHSJacobianFn, SNESComputeJacobianDefaultColor(), TSSetRHSFunction(), TSRHSJacobianSetReuse(), TSSetIJacobian(), TSRHSFunctionFn, TSIFunctionFn
External Links
- PETSc Manual:
TS/TSSetRHSJacobian
PETSc.LibPETSc.TSSetRHSJacobianP — Method
TSSetRHSJacobianP(petsclib::PetscLibType, ts::AbstractTS, Amat::AbstractPetscMat, func::Ptr{Cvoid}, ctx::Ptr{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] function context
Level: intermediate
See also: TS, TSRHSJacobianPFn, TSGetRHSJacobianP()
External Links
- PETSc Manual:
Sensitivity/TSSetRHSJacobianP
PETSc.LibPETSc.TSSetResize — Method
TSSetResize(petsclib::PetscLibType, ts::AbstractTS, rollback::PetscBool, setup::external, transfer::external, ctx::Ptr{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
See also: TS, TSSetDM(), TSSetIJacobian(), TSSetRHSJacobian()
External Links
- PETSc Manual:
TS/TSSetResize
PETSc.LibPETSc.TSSetRunSteps — Method
TSSetRunSteps(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TS, TSGetRunSteps(), TSSetMaxTime(), TSSetExactFinalTime(), TSSetMaxSteps()
External Links
- PETSc Manual:
TS/TSSetRunSteps
PETSc.LibPETSc.TSSetSNES — Method
TSSetSNES(petsclib::PetscLibType, ts::AbstractTS, snes::AbstractSNES)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
See also: TS, SNES, TSCreate(), TSSetUp(), TSSolve(), TSGetSNES()
External Links
- PETSc Manual:
TS/TSSetSNES
PETSc.LibPETSc.TSSetSaveTrajectory — Method
TSSetSaveTrajectory(petsclib::PetscLibType, ts::AbstractTS)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 (basic|singlefile|memory|visualization)- set trajectory type
Level: intermediate
See also: TS, TSTrajectoryType, TSTrajectory, TSGetTrajectory(), TSAdjointSolve()
External Links
- PETSc Manual:
TS/TSSetSaveTrajectory
PETSc.LibPETSc.TSSetSolution — Method
TSSetSolution(petsclib::PetscLibType, ts::AbstractTS, u::AbstractPetscVec)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
See also: TS, TSSetSolutionFunction(), TSGetSolution(), TSCreate()
External Links
- PETSc Manual:
TS/TSSetSolution
PETSc.LibPETSc.TSSetSolutionFunction — Method
TSSetSolutionFunction(petsclib::PetscLibType, ts::AbstractTS, f::Ptr{Cvoid}, ctx::Ptr{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
See also: TS, TSSolutionFn, TSSetRHSJacobian(), TSSetIJacobian(), TSComputeSolutionFunction(), TSSetForcingFunction(), TSSetSolution(), TSGetSolution(), TSMonitorLGError(), TSMonitorDrawError()
External Links
- PETSc Manual:
TS/TSSetSolutionFunction
PETSc.LibPETSc.TSSetStepNumber — Method
TSSetStepNumber(petsclib::PetscLibType, ts::AbstractTS, steps::PetscInt)Sets the number of steps completed.
Logically Collective
Input Parameters:
ts- theTScontextsteps- number of steps completed so far
Level: developer
See also: TS, TSGetStepNumber(), TSSetTime(), TSSetTimeStep(), TSSetSolution()
External Links
- PETSc Manual:
TS/TSSetStepNumber
PETSc.LibPETSc.TSSetTime — Method
TSSetTime(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal)Allows one to reset the time.
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()t- the time
Level: intermediate
See also: TS, TSGetTime(), TSSetMaxSteps()
External Links
- PETSc Manual:
TS/TSSetTime
PETSc.LibPETSc.TSSetTimeError — Method
TSSetTimeError(petsclib::PetscLibType, ts::AbstractTS, v::AbstractPetscVec)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
See also: TS, TSSetSolution(), TSGetTimeError()
External Links
- PETSc Manual:
TS/TSSetTimeError
PETSc.LibPETSc.TSSetTimeSpan — Method
TSSetTimeSpan(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TS, TSSetEvaluationTimes(), TSGetEvaluationTimes(), TSGetEvaluationSolutions()
External Links
- PETSc Manual:
TS/TSSetTimeSpan
PETSc.LibPETSc.TSSetTimeStep — Method
TSSetTimeStep(petsclib::PetscLibType, ts::AbstractTS, time_step::PetscReal)Allows one to reset the timestep at any time.
Logically Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()time_step- the size of the timestep
Options Database Key:
-ts_time_step dt- provide the initial time step
Level: intermediate
See also: TS, TSPSEUDO, TSGetTimeStep(), TSSetTime()
External Links
- PETSc Manual:
TS/TSSetTimeStep
PETSc.LibPETSc.TSSetTolerances — Method
TSSetTolerances(petsclib::PetscLibType, ts::AbstractTS, atol::PetscReal, vatol::AbstractPetscVec, rtol::PetscReal, vrtol::AbstractPetscVec)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
See also: TS, TSAdapt, TSErrorWeightedNorm(), TSGetTolerances()
External Links
- PETSc Manual:
TS/TSSetTolerances
PETSc.LibPETSc.TSSetTransientVariable — Method
TSSetTransientVariable(petsclib::PetscLibType, ts::AbstractTS, tvar::Ptr{Cvoid}, ctx::Ptr{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
See also: TS, TSBDF, TSTransientVariableFn, DMTSSetTransientVariable(), DMTSGetTransientVariable(), TSSetIFunction(), TSSetIJacobian()
External Links
- PETSc Manual:
TS/TSSetTransientVariable
PETSc.LibPETSc.TSSetType — Method
TSSetType(petsclib::PetscLibType, ts::AbstractTS, type::String)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; seeTSType
Level: intermediate
See also: TS, TSSolve(), TSCreate(), TSSetFromOptions(), TSDestroy(), TSType
External Links
- PETSc Manual:
TS/TSSetType
PETSc.LibPETSc.TSSetUp — Method
TSSetUp(petsclib::PetscLibType, ts::AbstractTS)Sets up the internal data structures for the later use of a timestepper.
Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Level: advanced
See also: TSCreate(), TS, TSStep(), TSDestroy(), TSSolve()
External Links
- PETSc Manual:
TS/TSSetUp
PETSc.LibPETSc.TSSetUseSplitRHSFunction — Method
TSSetUseSplitRHSFunction(petsclib::PetscLibType, ts::AbstractTS, use_splitrhsfunction::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)- use the split RHS function for multirate solvers
Level: intermediate
See also: TS, TSGetUseSplitRHSFunction()
External Links
- PETSc Manual:
TS/TSSetUseSplitRHSFunction
PETSc.LibPETSc.TSSolve — Method
TSSolve(petsclib::PetscLibType, ts::AbstractTS, u::AbstractPetscVec)Steps the requested number of timesteps.
Collective
Input Parameters:
ts- theTScontext obtained fromTSCreate()u- the solution vector (can beNULLifTSSetSolution()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
See also: TS, TSCreate(), TSSetSolution(), TSStep(), TSGetTime(), TSGetSolveTime()
External Links
- PETSc Manual:
TS/TSSolve
PETSc.LibPETSc.TSStep — Method
TSStep(petsclib::PetscLibType, ts::AbstractTS)Steps one time step
Collective
Input Parameter:
ts- theTScontext obtained fromTSCreate()
Level: developer
See also: TS, TSCreate(), TSSetUp(), TSDestroy(), TSSolve(), TSSetPreStep(), TSSetPreStage(), TSSetPostStage(), TSInterpolate()
External Links
- PETSc Manual:
TS/TSStep
PETSc.LibPETSc.TSSundialsGetIterations — Method
nonlin::Cint,lin::Cint = TSSundialsGetIterations(petsclib::PetscLibType, ts::AbstractTS)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
See also: TSSundialsSetType(), TSSundialsSetMaxl(), TSSundialsSetLinearTolerance(), TSSundialsSetGramSchmidtType(), TSSundialsSetTolerance(), TSSundialsGetPC(), TSSetExactFinalTime()
External Links
- PETSc Manual:
TS/TSSundialsGetIterations
PETSc.LibPETSc.TSSundialsGetPC — Method
pc::PC = TSSundialsGetPC(petsclib::PetscLibType, ts::AbstractTS)Extract the PC context from a time-step context for TSSUNDIALS.
Input Parameter:
ts- the time-step context
Output Parameter:
pc- the preconditioner context
Level: advanced
See also: TSSundialsGetIterations(), TSSundialsSetType(), TSSundialsSetMaxl(), TSSundialsSetLinearTolerance(), TSSundialsSetGramSchmidtType(), TSSundialsSetTolerance()
External Links
- PETSc Manual:
TS/TSSundialsGetPC
PETSc.LibPETSc.TSSundialsMonitorInternalSteps — Method
TSSundialsMonitorInternalSteps(petsclib::PetscLibType, ts::AbstractTS, ft::PetscBool)Monitor TSSUNDIALS internal steps (Defaults to false).
Input Parameters:
ts- the time-step contextft-PETSC_TRUEif monitor, elsePETSC_FALSE
Level: beginner
See also: TSSundialsGetIterations(), TSSundialsSetType(), TSSundialsSetMaxl(), TSSundialsSetLinearTolerance(), TSSundialsSetGramSchmidtType(), TSSundialsSetTolerance(), TSSundialsGetPC()
External Links
- PETSc Manual:
TS/TSSundialsMonitorInternalSteps
PETSc.LibPETSc.TSSundialsSetGramSchmidtType — Method
TSSundialsSetGramSchmidtType(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TSSundialsGetIterations(), TSSundialsSetType(), TSSundialsSetMaxl(), TSSundialsSetLinearTolerance(), TSSundialsSetTolerance(), TSSundialsGetPC(), TSSetExactFinalTime()
External Links
- PETSc Manual:
TS/TSSundialsSetGramSchmidtType
PETSc.LibPETSc.TSSundialsSetLinearTolerance — Method
TSSundialsSetLinearTolerance(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TSSundialsGetIterations(), TSSundialsSetType(), TSSundialsSetMaxl(), TSSundialsSetGramSchmidtType(), TSSundialsSetTolerance(), TSSundialsGetPC(), TSSetExactFinalTime()
External Links
- PETSc Manual:
TS/TSSundialsSetLinearTolerance
PETSc.LibPETSc.TSSundialsSetMaxTimeStep — Method
TSSundialsSetMaxTimeStep(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TSSundialsSetType(), TSSundialsSetTolerance()
External Links
- PETSc Manual:
TS/TSSundialsSetMaxTimeStep
PETSc.LibPETSc.TSSundialsSetMaxl — Method
TSSundialsSetMaxl(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TSSundialsGetIterations(), TSSundialsSetType(), TSSundialsSetLinearTolerance(), TSSundialsSetGramSchmidtType(), TSSundialsSetTolerance(), TSSundialsGetPC(), TSSetExactFinalTime()
External Links
- PETSc Manual:
TS/TSSundialsSetMaxl
PETSc.LibPETSc.TSSundialsSetMaxord — Method
TSSundialsSetMaxord(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TSSundialsGetIterations(), TSSundialsSetType(), TSSundialsSetLinearTolerance(), TSSundialsSetGramSchmidtType(), TSSundialsSetTolerance(), TSSundialsGetPC(), TSSetExactFinalTime()
External Links
- PETSc Manual:
TS/TSSundialsSetMaxord
PETSc.LibPETSc.TSSundialsSetMinTimeStep — Method
TSSundialsSetMinTimeStep(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TSSundialsSetType(), TSSundialsSetTolerance()
External Links
- PETSc Manual:
TS/TSSundialsSetMinTimeStep
PETSc.LibPETSc.TSSundialsSetTolerance — Method
TSSundialsSetTolerance(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TSSundialsGetIterations(), TSSundialsSetType(), TSSundialsSetGMRESMaxl(), TSSundialsSetLinearTolerance(), TSSundialsSetGramSchmidtType(), TSSundialsGetPC(), TSSetExactFinalTime()
External Links
- PETSc Manual:
TS/TSSundialsSetTolerance
PETSc.LibPETSc.TSSundialsSetType — Method
TSSundialsSetType(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TSSundialsGetIterations(), TSSundialsSetMaxl(), TSSundialsSetLinearTolerance(), TSSundialsSetGramSchmidtType(), TSSundialsSetTolerance(), TSSundialsGetPC(), TSSetExactFinalTime()
External Links
- PETSc Manual:
TS/TSSundialsSetType
PETSc.LibPETSc.TSSundialsSetUseDense — Method
TSSundialsSetUseDense(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TSSUNDIALS
External Links
- PETSc Manual:
TS/TSSundialsSetUseDense
PETSc.LibPETSc.TSThetaGetEndpoint — Method
endpoint::PetscBool = TSThetaGetEndpoint(petsclib::PetscLibType, ts::AbstractTS)Gets whether to use the endpoint variant of the method (e.g. trapezoid/Crank-Nicolson instead of midpoint rule) for TSTHETA
Not Collective
Input Parameter:
ts- timestepping context
Output Parameter:
endpoint-PETSC_TRUEwhen using the endpoint variant
Level: advanced
See also: TSThetaSetEndpoint(), TSTHETA, TSCN
External Links
- PETSc Manual:
TS/TSThetaGetEndpoint
PETSc.LibPETSc.TSThetaGetTheta — Method
theta::PetscReal = TSThetaGetTheta(petsclib::PetscLibType, ts::AbstractTS)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
See also: TSThetaSetTheta(), TSTHETA
External Links
- PETSc Manual:
TS/TSThetaGetTheta
PETSc.LibPETSc.TSThetaSetEndpoint — Method
TSThetaSetEndpoint(petsclib::PetscLibType, ts::AbstractTS, flg::PetscBool)Sets whether to use the endpoint variant of the method (e.g. trapezoid/Crank-Nicolson instead of midpoint rule) for TSTHETA
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
See also: TSTHETA, TSCN
External Links
- PETSc Manual:
TS/TSThetaSetEndpoint
PETSc.LibPETSc.TSThetaSetTheta — Method
TSThetaSetTheta(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TSThetaGetTheta(), TSTHETA, TSCN
External Links
- PETSc Manual:
TS/TSThetaSetTheta
PETSc.LibPETSc.TSVISetVariableBounds — Method
TSVISetVariableBounds(petsclib::PetscLibType, ts::AbstractTS, xl::AbstractPetscVec, xu::AbstractPetscVec)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
See also: TS
External Links
- PETSc Manual:
TS/TSVISetVariableBounds
PETSc.LibPETSc.TSView — Method
TSView(petsclib::PetscLibType, ts::AbstractTS, 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
See also: TS, PetscViewer, PetscViewerASCIIOpen()
External Links
- PETSc Manual:
TS/TSView
PETSc.LibPETSc.TSViewFromOptions — Method
TSViewFromOptions(petsclib::PetscLibType, ts::AbstractTS, obj, 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
Options Database Key:
-name [viewertype][:...]- option name and values. SeePetscObjectViewFromOptions()for the possible arguments
Level: intermediate
See also: 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
See also: 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
See also: TSAdapt, TSAdaptCreate(), TSAdaptCandidateAdd(), TSAdaptChoose()
External Links
- PETSc Manual:
TS/TSAdaptCandidatesClear
PETSc.LibPETSc.TSAdaptCandidatesGet — Method
n::PetscInt,order::Ptr{PetscInt},stageorder::Ptr{PetscInt},ccfl::Ptr{PetscReal},cost::Ptr{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
See also: TSAdapt, TSAdaptCandidatesClear(), TSAdaptCandidateAdd(), TSAdaptChoose()
External Links
- PETSc Manual:
TS/TSAdaptCandidatesGet
PETSc.LibPETSc.TSAdaptCheckStage — Method
accept::PetscBool = TSAdaptCheckStage(petsclib::PetscLibType, adapt::TSAdapt, ts::AbstractTS, t::PetscReal, Y::AbstractPetscVec)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
See also: TSAdapt
External Links
- PETSc Manual:
TS/TSAdaptCheckStage
PETSc.LibPETSc.TSAdaptChoose — Method
next_sc::PetscInt,next_h::PetscReal,accept::PetscBool = TSAdaptChoose(petsclib::PetscLibType, adapt::TSAdapt, ts::AbstractTS, 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
See also: 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
See also: 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
See also: 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
See also: TS, TSAdapt, TSGetAdapt(), TSAdaptDSPSetFilter()
External Links
- PETSc Manual:
TS/TSAdaptDSPSetPID
PETSc.LibPETSc.TSAdaptDestroy — Method
TSAdaptDestroy(petsclib::PetscLibType, adapt::Union{TSAdapt, Ref{TSAdapt}})Destroys a TSAdapt context
Collective
Input Parameter:
adapt- theTSAdaptcontext obtained fromTSGetAdapt()orTSAdaptCreate()
Level: intermediate
See also: TSAdapt, TSAdaptCreate(), TSGetAdapt()
External Links
- PETSc Manual:
TS/TSAdaptDestroy
PETSc.LibPETSc.TSAdaptFinalizePackage — Method
TSAdaptFinalizePackage(petsclib::PetscLibType)This function destroys everything in the TS package. It is called from PetscFinalize().
Level: developer
See also: PetscFinalize()
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
See also: 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
See also: 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
See also: 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
See also: 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
See also: TSAdapt, TSAdaptSetStepLimits(), TSAdaptChoose()
External Links
- PETSc Manual:
TS/TSAdaptGetStepLimits
PETSc.LibPETSc.TSAdaptGetType — Method
type::String = 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
See also: 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
See also: 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
See also: 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
See also: 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
See also: PetscInitialize()
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
See also: 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
See also: 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
See also: 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
See also: 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
See also: 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
See also: 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 (basic|dsp|none|cfl|glee|history)- algorithm to use for adaptivity-ts_adapt_always_accept (true|false)- 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|infinity)- type of norm for computing error estimates-ts_adapt_time_step_increase_delay steps- number of timesteps to delay increasing the time step after it has been decreased due to failed solver
Level: advanced
See also: 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
See also: 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
See also: TSAdapt, TSGetAdapt(), TSAdaptChoose()
External Links
- PETSc Manual:
TS/TSAdaptSetMonitor
PETSc.LibPETSc.TSAdaptSetOptionsPrefix — Method
TSAdaptSetOptionsPrefix(petsclib::PetscLibType, adapt::TSAdapt, prefix::String)Sets the prefix used for searching for TSAdapt options in the options database
Logically Collective
Input Parameters:
adapt- theTSAdaptcontext, most likely obtained withTSGetAdapt()prefix- the prefix to prepend to all option names
Level: advanced
See also: TSAdapt, TSGetAdapt(), TSSetOptionsPrefix()
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
See also: 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
See also: 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
See also: 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
See also: TSAdapt
External Links
- PETSc Manual:
TS/TSAdaptSetTimeStepIncreaseDelay
PETSc.LibPETSc.TSAdaptSetType — Method
TSAdaptSetType(petsclib::PetscLibType, adapt::TSAdapt, type::String)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|dsp|none|cfl|glee|history)- to set the adapter type
Level: intermediate
See also: TSGetAdapt(), TSAdaptDestroy(), TSAdaptType, TSAdaptGetType()
External Links
- PETSc Manual:
TS/TSAdaptSetType
PETSc.LibPETSc.TSAdaptView — Method
TSAdaptView(petsclib::PetscLibType, adapt::TSAdapt, viewer::PetscViewer)Prints the TSAdapt data structure.
Collective
Input Parameters:
adapt- theTSAdaptcontext obtained fromTSGetAdapt()viewer- visualization context
Options Database Key:
-ts_view- callsTSView()at end ofTSStep()
Level: advanced
See also: TSAdapt, TSView(), PetscViewer, PetscViewerASCIIOpen()
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)Choose the next scheme and step size using a TSGLLEAdapt step-size and order controller
Logically Collective
Input Parameters:
adapt- theTSGLLEAdaptcontextn- the number of candidate schemesorders- the orders of accuracy of the candidate schemeserrors- the error estimates for each candidate schemecost- the relative cost of each candidate schemecur- the index of the currently active schemeh- the last step size that was takentleft- the amount of remaining integration time
Output Parameters:
next_sc- the index of the scheme to use nextnext_h- the step size to take nextfinish-PETSC_TRUEifnext_hwas truncated totleftbecause the end of the interval has been reached
Level: developer
See also: TSGLLE, TSGLLEAdapt, TSGLLEAdaptCreate(), TSGLLEAdaptSetType()
External Links
- PETSc Manual:
TS/TSGLLEAdaptChoose
PETSc.LibPETSc.TSGLLEAdaptCreate — Method
inadapt::TSGLLEAdapt = TSGLLEAdaptCreate(petsclib::PetscLibType, comm::MPI_Comm)Create a TSGLLEAdapt step-size and order adaptivity object
Collective
Input Parameter:
comm- the MPI communicator
Output Parameter:
inadapt- the newly createdTSGLLEAdaptcontext
Level: intermediate
See also: TSGLLE, TSGLLEAdapt, TSGLLEAdaptSetType(), TSGLLEAdaptDestroy()
External Links
- PETSc Manual:
TS/TSGLLEAdaptCreate
PETSc.LibPETSc.TSGLLEAdaptDestroy — Method
TSGLLEAdaptDestroy(petsclib::PetscLibType, adapt::Union{TSGLLEAdapt, Ref{TSGLLEAdapt}})Destroys a TSGLLEAdapt context
Collective
Input Parameter:
adapt- theTSGLLEAdaptcontext
Level: intermediate
See also: TSGLLE, TSGLLEAdapt, TSGLLEAdaptCreate()
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
See also: 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
See also: 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
See also: TSGLLE, TSGLLEAdapt, TSGLLEAdaptRegisterAll()
External Links
- PETSc Manual:
TS/TSGLLEAdaptRegister
PETSc.LibPETSc.TSGLLEAdaptSetFromOptions — Method
TSGLLEAdaptSetFromOptions(petsclib::PetscLibType, adapt::TSGLLEAdapt, PetscOptionsObject::PetscOptionItems)Sets options from the options database for a TSGLLEAdapt context
Collective
Input Parameters:
adapt- theTSGLLEAdaptcontextPetscOptionsObject- thePetscOptionItemsused to process options
Options Database Key:
-ts_adapt_type (none|size|both)- algorithm to use for adaptivity
Level: advanced
See also: TSGLLE, TSGLLEAdapt, TSGLLEAdaptSetType()
External Links
- PETSc Manual:
TS/TSGLLEAdaptSetFromOptions
PETSc.LibPETSc.TSGLLEAdaptSetOptionsPrefix — Method
TSGLLEAdaptSetOptionsPrefix(petsclib::PetscLibType, adapt::TSGLLEAdapt, prefix::String)Sets the prefix used for searching for TSGLLEAdapt options in the options database
Logically Collective
Input Parameters:
adapt- theTSGLLEAdaptcontextprefix- the prefix to prepend to all option names
Level: advanced
See also: TSGLLE, TSGLLEAdapt, TSGLLEAdaptSetFromOptions()
External Links
- PETSc Manual:
TS/TSGLLEAdaptSetOptionsPrefix
PETSc.LibPETSc.TSGLLEAdaptSetType — Method
TSGLLEAdaptSetType(petsclib::PetscLibType, adapt::TSGLLEAdapt, type::String)Sets the type of a TSGLLEAdapt step-size and order adaptivity object
Logically Collective
Input Parameters:
adapt- theTSGLLEAdaptcontexttype- the name of the adaptivity scheme, e.g.TSGLLEADAPT_NONE,TSGLLEADAPT_SIZE,TSGLLEADAPT_BOTH
Level: intermediate
See also: TSGLLE, TSGLLEAdapt, TSGLLEAdaptCreate(), TSGLLEAdaptType, TSGLLEAdaptRegister()
External Links
- PETSc Manual:
TS/TSGLLEAdaptSetType
PETSc.LibPETSc.TSGLLEAdaptView — Method
TSGLLEAdaptView(petsclib::PetscLibType, adapt::TSGLLEAdapt, viewer::PetscViewer)Views a TSGLLEAdapt step-size and order adaptivity object
Collective
Input Parameters:
adapt- theTSGLLEAdaptcontextviewer- thePetscViewerused to view the object
Level: intermediate
See also: TSGLLE, TSGLLEAdapt, TSGLLEAdaptCreate(), 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
See also: TS, TSMonitorDrawCtxDestroy(), TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorDrawCtx, PetscMonitorDrawSolution()
External Links
- PETSc Manual:
TS/TSMonitorDrawCtxCreate
PETSc.LibPETSc.TSMonitorDrawCtxDestroy — Method
TSMonitorDrawCtxDestroy(petsclib::PetscLibType, ictx::Union{TSMonitorDrawCtx, Ref{TSMonitorDrawCtx}})Destroys the monitor context for TSMonitorDrawSolution()
Collective
Input Parameter:
ictx- the monitor context
Level: intermediate
See also: TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorDrawSolution(), TSMonitorDrawError(), TSMonitorDrawCtx
External Links
- PETSc Manual:
TS/TSMonitorDrawCtxDestroy
PETSc.LibPETSc.TSMonitorEnvelopeCtxCreate — Method
ctx::TSMonitorEnvelopeCtx = TSMonitorEnvelopeCtxCreate(petsclib::PetscLibType, ts::AbstractTS)Creates a context for use with TSMonitorEnvelope()
Collective
Input Parameter:
ts- theTSsolver object
Output Parameter:
ctx- the context
Level: intermediate
See also: TS, TSMonitorLGTimeStep(), TSMonitorSet(), TSMonitorLGSolution(), TSMonitorLGError()
External Links
- PETSc Manual:
TS/TSMonitorEnvelopeCtxCreate
PETSc.LibPETSc.TSMonitorEnvelopeCtxDestroy — Method
TSMonitorEnvelopeCtxDestroy(petsclib::PetscLibType, ctx::Union{TSMonitorEnvelopeCtx, Ref{TSMonitorEnvelopeCtx}})Destroys a context that was created with TSMonitorEnvelopeCtxCreate().
Collective
Input Parameter:
ctx- the monitor context
Level: intermediate
See also: 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)Creates a TSMonitorHGCtx histogram monitor context for use with DMSWARM particle visualizations
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 timeNs- the number of species to histogramNb- the number of histogram binsvelocity-PETSC_TRUEto plot histograms in velocity space,PETSC_FALSEfor coordinate space
Output Parameter:
ctx- the newly created histogram monitor context
Level: intermediate
See also: TS, DMSWARM, TSMonitorSet(), TSMonitorHGSwarmSolution(), TSMonitorHGCtxDestroy()
External Links
- PETSc Manual:
TS/TSMonitorHGCtxCreate
PETSc.LibPETSc.TSMonitorHGCtxDestroy — Method
TSMonitorHGCtxDestroy(petsclib::PetscLibType, ctx::Union{TSMonitorHGCtx, Ref{TSMonitorHGCtx}})Destroys a TSMonitorHGCtx that was created with TSMonitorHGCtxCreate()
Not Collective
Input Parameter:
ctx- the histogram monitor context
Level: intermediate
See also: TS, TSMonitorSet(), TSMonitorHGCtxCreate(), TSMonitorHGSwarmSolution()
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
See also: 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::Union{TSMonitorLGCtx, Ref{TSMonitorLGCtx}})Destroys a line graph context that was created with TSMonitorLGCtxCreate().
Collective
Input Parameter:
ctx- the monitor context
Level: intermediate
See also: TS, TSMonitorLGCtxCreate(), TSMonitorSet(), TSMonitorLGTimeStep()
External Links
- PETSc Manual:
TS/TSMonitorLGCtxDestroy
PETSc.LibPETSc.TSMonitorLGCtxNetworkCreate — Method
ctx::TSMonitorLGCtxNetwork = TSMonitorLGCtxNetworkCreate(petsclib::PetscLibType, ts::AbstractTS, host::String, label::String, x::Cint, y::Cint, m::Cint, n::Cint, howoften::PetscInt)Creates a TSMonitorLGCtxNetwork context with one line-graph window for each edge and each vertex of a DMNETWORK
Collective
Input Parameters:
ts- theTScontext whoseDMis aDMNETWORKhost- 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 newly created network line-graph monitor context
Level: intermediate
See also: TS, DMNETWORK, TSMonitorSet(), TSMonitorLGCtxNetworkSolution(), TSMonitorLGCtxNetworkDestroy()
External Links
- PETSc Manual:
TS/TSMonitorLGCtxNetworkCreate
PETSc.LibPETSc.TSMonitorLGCtxNetworkDestroy — Method
TSMonitorLGCtxNetworkDestroy(petsclib::PetscLibType, ctx::Union{TSMonitorLGCtxNetwork, Ref{TSMonitorLGCtxNetwork}})Destroys line graph contexts that where created with TSMonitorLGCtxNetworkCreate().
Collective
Input Parameter:
ctx- the monitor context
Level: intermediate
See also: TS, TSMonitorLGCtxNetworkSolution()
External Links
- PETSc Manual:
TS/TSMonitorLGCtxNetworkDestroy
PETSc.LibPETSc.TSMonitorLGCtxNetworkSolution — Method
TSMonitorLGCtxNetworkSolution(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, dctx::Ptr{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
See also: 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
See also: TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorLGSetVariableNames()
External Links
- PETSc Manual:
TS/TSMonitorLGCtxSetDisplayVariables
PETSc.LibPETSc.TSMonitorLGCtxSetTransform — Method
TSMonitorLGCtxSetTransform(petsclib::PetscLibType, ctx::TSMonitorLGCtx, transform::external, destroy::Ptr{Cvoid}, tctx::Ptr{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
Calling sequence of transform:
tctx- context used by the transform functionu- the input solution vectorw- the output transformed vector
Level: intermediate
See also: 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
See also: 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)Creates a TSMonitorSPCtx scatter-plot monitor context for use with DMSWARM particle visualizations
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 timeretain- the number of old points to retain in the plot, or 0 to clear, or -1 to retain allphase-PETSC_TRUEto plot in phase space rather than coordinate spacemultispecies-PETSC_TRUEto color particles by species
Output Parameter:
ctx- the newly created scatter plot monitor context
Level: intermediate
See also: TS, DMSWARM, TSMonitorSet(), TSMonitorSPSwarmSolution(), TSMonitorSPCtxDestroy()
External Links
- PETSc Manual:
TS/TSMonitorSPCtxCreate
PETSc.LibPETSc.TSMonitorSPCtxDestroy — Method
TSMonitorSPCtxDestroy(petsclib::PetscLibType, ctx::Union{TSMonitorSPCtx, Ref{TSMonitorSPCtx}})Destroys a TSMonitorSPCtx that was created with TSMonitorSPCtxCreate()
Not Collective
Input Parameter:
ctx- the scatter plot monitor context
Level: intermediate
See also: TS, TSMonitorSet(), TSMonitorSPCtxCreate(), TSMonitorSPSwarmSolution()
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
See also: TSMonitorSPEigTimeStep(), TSMonitorSet(), TSMonitorLGSolution(), TSMonitorLGError()
External Links
- PETSc Manual:
TS/TSMonitorSPEigCtxCreate
PETSc.LibPETSc.TSMonitorSPEigCtxDestroy — Method
TSMonitorSPEigCtxDestroy(petsclib::PetscLibType, ctx::Union{TSMonitorSPEigCtx, Ref{TSMonitorSPEigCtx}})Destroys a scatter plot context that was created with TSMonitorSPEigCtxCreate().
Collective
Input Parameter:
ctx- the monitor context
Level: intermediate
See also: 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
See also: TS, TSTrajectory, TSTrajectorySetUp(), TSTrajectoryDestroy(), TSTrajectorySetType(), TSTrajectorySetVariableNames(), TSGetTrajectory(), TSTrajectorySetKeepFiles()
External Links
- PETSc Manual:
TS/TSTrajectoryCreate
PETSc.LibPETSc.TSTrajectoryDestroy — Method
TSTrajectoryDestroy(petsclib::PetscLibType, tj::Union{TSTrajectory, Ref{TSTrajectory}})Destroys a trajectory context
Collective
Input Parameter:
tj- theTSTrajectorycontext obtained fromTSTrajectoryCreate()
Level: developer
See also: TSTrajectory, TSTrajectoryCreate(), TSTrajectorySetUp()
External Links
- PETSc Manual:
TS/TSTrajectoryDestroy
PETSc.LibPETSc.TSTrajectoryGet — Method
time::PetscReal = TSTrajectoryGet(petsclib::PetscLibType, tj::TSTrajectory, ts::AbstractTS, 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
See also: 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
See also: 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
See also: TSTrajectory, TSSetSaveTrajectory(), TSTrajectoryCreate(), TSTrajectoryDestroy(), TSTrajectorySetSolutionOnly()
External Links
- PETSc Manual:
TS/TSTrajectoryGetSolutionOnly
PETSc.LibPETSc.TSTrajectoryGetType — Method
type::String = TSTrajectoryGetType(petsclib::PetscLibType, tj::TSTrajectory, ts::AbstractTS)Gets the trajectory type
Collective
Input Parameters:
tj- theTSTrajectorycontextts- theTScontext
Output Parameter:
type- a known method
Level: developer
See also: TS, TSTrajectory, TSTrajectoryCreate(), TSTrajectorySetFromOptions(), TSTrajectoryDestroy(), TSTrajectorySetType()
External Links
- PETSc Manual:
TS/TSTrajectoryGetType
PETSc.LibPETSc.TSTrajectoryGetUpdatedHistoryVecs — Method
U::PetscVec,Udot::PetscVec = TSTrajectoryGetUpdatedHistoryVecs(petsclib::PetscLibType, tj::TSTrajectory, ts::AbstractTS, time::PetscReal)Get updated state and time-derivative history vectors.
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
See also: TSTrajectory, TSSetSaveTrajectory(), TSTrajectoryCreate(), TSTrajectoryDestroy(), TSTrajectoryRestoreUpdatedHistoryVecs(), TSTrajectoryGetVecs()
External Links
- PETSc Manual:
TS/TSTrajectoryGetUpdatedHistoryVecs
PETSc.LibPETSc.TSTrajectoryGetVecs — Method
time::PetscReal = TSTrajectoryGetVecs(petsclib::PetscLibType, tj::TSTrajectory, ts::AbstractTS, stepnum::PetscInt, U::AbstractPetscVec, Udot::AbstractPetscVec)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
See also: 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
See also: 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
See also: 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
See also: 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
See also: TS, TSTrajectory, TSTrajectoryCreate(), TSTrajectorySetUp()
External Links
- PETSc Manual:
TS/TSTrajectoryReset
PETSc.LibPETSc.TSTrajectoryRestoreUpdatedHistoryVecs — Method
TSTrajectoryRestoreUpdatedHistoryVecs(petsclib::PetscLibType, tj::TSTrajectory, U::AbstractPetscVec, Udot::AbstractPetscVec)Restores updated state and time-derivative history vectors obtained with TSTrajectoryGetUpdatedHistoryVecs().
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
See also: TSTrajectory, TSTrajectoryGetUpdatedHistoryVecs()
External Links
- PETSc Manual:
TS/TSTrajectoryRestoreUpdatedHistoryVecs
PETSc.LibPETSc.TSTrajectorySet — Method
TSTrajectorySet(petsclib::PetscLibType, tj::TSTrajectory, ts::AbstractTS, stepnum::PetscInt, time::PetscReal, X::AbstractPetscVec)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
See also: 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
See also: 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
See also: TSTrajectory, TSTrajectorySetDirname(), TSTrajectorySetUp()
External Links
- PETSc Manual:
TS/TSTrajectorySetFiletemplate
PETSc.LibPETSc.TSTrajectorySetFromOptions — Method
TSTrajectorySetFromOptions(petsclib::PetscLibType, tj::TSTrajectory, ts::AbstractTS)Sets various TSTrajectory parameters from user options.
Collective
Input Parameters:
tj- theTSTrajectorycontext obtained fromTSGetTrajectory()ts- theTScontext
Options Database Keys:
-ts_trajectory_type (basic|singlefile|memory|visualization)- how to manage the trajectory-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
See also: 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
See also: TSTrajectoryCreate(), TSTrajectoryDestroy(), TSTrajectorySetUp(), TSTrajectorySetMonitor()
External Links
- PETSc Manual:
TS/TSTrajectorySetKeepFiles
PETSc.LibPETSc.TSTrajectorySetMaxCpsDisk — Method
TSTrajectorySetMaxCpsDisk(petsclib::PetscLibType, tj::TSTrajectory, max_cps_disk::PetscInt)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
See also: TSTrajectory, TSTrajectorySetMaxUnitsDisk(), TSTrajectorySetMaxUnitsRAM()
External Links
- PETSc Manual:
TS/TSTrajectorySetMaxCpsDisk
PETSc.LibPETSc.TSTrajectorySetMaxCpsRAM — Method
TSTrajectorySetMaxCpsRAM(petsclib::PetscLibType, tj::TSTrajectory, max_cps_ram::PetscInt)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
See also: TSTrajectory, TSTrajectorySetMaxUnitsRAM()
External Links
- PETSc Manual:
TS/TSTrajectorySetMaxCpsRAM
PETSc.LibPETSc.TSTrajectorySetMaxUnitsDisk — Method
TSTrajectorySetMaxUnitsDisk(petsclib::PetscLibType, tj::TSTrajectory, max_units_disk::PetscInt)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
See also: TSTrajectory, TSTrajectorySetMaxCpsDisk()
External Links
- PETSc Manual:
TS/TSTrajectorySetMaxUnitsDisk
PETSc.LibPETSc.TSTrajectorySetMaxUnitsRAM — Method
TSTrajectorySetMaxUnitsRAM(petsclib::PetscLibType, tj::TSTrajectory, max_units_ram::PetscInt)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
See also: 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
See also: 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
See also: TSTrajectory, TSSetSaveTrajectory(), TSTrajectoryCreate(), TSTrajectoryDestroy(), TSTrajectoryGetSolutionOnly()
External Links
- PETSc Manual:
TS/TSTrajectorySetSolutionOnly
PETSc.LibPETSc.TSTrajectorySetTransform — Method
TSTrajectorySetTransform(petsclib::PetscLibType, tj::TSTrajectory, transform::external, destroy::Ptr{Cvoid}, tctx::Ptr{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
See also: TSTrajectorySetVariableNames(), TSTrajectory, TSMonitorLGSetTransform()
External Links
- PETSc Manual:
TS/TSTrajectorySetTransform
PETSc.LibPETSc.TSTrajectorySetType — Method
TSTrajectorySetType(petsclib::PetscLibType, tj::TSTrajectory, ts::AbstractTS, type::String)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 (basic|singlefile|memory|visualization)- Sets the trajectory type
Level: developer
See also: TSTrajectory, TSTrajectoryType, TS, TSTrajectoryCreate(), TSTrajectorySetFromOptions(), TSTrajectoryDestroy(), TSTrajectoryGetType()
External Links
- PETSc Manual:
TS/TSTrajectorySetType
PETSc.LibPETSc.TSTrajectorySetUp — Method
TSTrajectorySetUp(petsclib::PetscLibType, tj::TSTrajectory, ts::AbstractTS)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
See also: 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
See also: 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
See also: 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
See also: TS, TSTrajectory, PetscViewer, PetscViewerASCIIOpen()
External Links
- PETSc Manual:
TS/TSTrajectoryView
PETSc.LibPETSc.TSTrajectoryViewFromOptions — Method
TSTrajectoryViewFromOptions(petsclib::PetscLibType, A::TSTrajectory, obj, 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
Options Database Key:
-name [viewertype][:...]- option name and values. SeePetscObjectViewFromOptions()for the possible arguments
Level: intermediate
See also: TSTrajectory, TSTrajectoryView, PetscObjectViewFromOptions(), TSTrajectoryCreate()
External Links
- PETSc Manual:
TS/TSTrajectoryViewFromOptions
Hand-written overloads
Some LibPETSc.TS* methods are written by hand in src/ts.jl rather than generated. They take a raw @cfunction pointer where the generated binding expects PETSc's own function-wrapper type, or they return a value the generated binding takes as an argument and overwrites (e.g., TSGetSolution, TSGetSNES and TSGetKSP).
Their docstrings are written inside the PETSc module, so they are listed with the rest of src/ts.jl on the high-level TS page.