TS (Time Stepping) - Low-level Interface

<a id="ch_ts"></a>

The TS (Time Stepping) component provides methods for solving time-dependent differential equations, including ordinary differential equations (ODEs), differential-algebraic equations (DAEs), and time-dependent partial differential equations (PDEs).

Overview

TS supports various time integration methods including:

  • Explicit methods: Forward Euler, Runge-Kutta methods (RK2, RK3, RK4, etc.)
  • Implicit methods: Backward Euler, Crank-Nicolson, BDF methods
  • IMEX methods: Implicit-Explicit combinations for stiff-nonstiff problems
  • Adaptive methods: Adaptive time stepping with error control
  • Specialized methods: Theta methods, Rosenbrock methods, SSP methods

The TS object manages the time integration loop, adaptive time stepping, event detection, and provides interfaces to various time stepping schemes.

Basic Usage

using PETSc, MPI

# Initialize MPI and PETSc
MPI.Init()
petsclib = PETSc.getlib()
PETSc.initialize(petsclib)

# Create a TS object
ts = LibPETSc.TSCreate(petsclib, LibPETSc.PETSC_COMM_SELF)

# Set the problem type (ODE or DAE)
LibPETSc.TSSetProblemType(petsclib, ts, LibPETSc.TS_NONLINEAR)

# Set the time stepping method (e.g., BDF, RK, Theta)
LibPETSc.TSSetType(petsclib, ts, "bdf")  # String convenience wrapper

# Set time span
LibPETSc.TSSetTime(petsclib, ts, 0.0)  # Initial time
LibPETSc.TSSetMaxTime(petsclib, ts, 1.0)  # Final time
LibPETSc.TSSetExactFinalTime(petsclib, ts, LibPETSc.TS_EXACTFINALTIME_STEPOVER)

# Set initial time step
LibPETSc.TSSetTimeStep(petsclib, ts, 0.01)

# Set the right-hand side function (for ODE: du/dt = f(t,u))
# LibPETSc.TSSetRHSFunction(petsclib, ts, C_NULL, rhs_function_ptr, C_NULL)

# Set options from command line/options database
LibPETSc.TSSetFromOptions(petsclib, ts)

# Set initial condition
# LibPETSc.TSSetSolution(petsclib, ts, initial_vec)

# Solve
# LibPETSc.TSSolve(petsclib, ts, solution_vec)

# Get solution time (returns value directly)
final_time = LibPETSc.TSGetSolveTime(petsclib, ts)

# Cleanup
LibPETSc.TSDestroy(petsclib, ts)

# Finalize PETSc and MPI
PETSc.finalize(petsclib)
MPI.Finalize()

Common Workflow

  1. Create and configure TS: Use TSCreate, TSSetType, TSSetProblemType
  2. Set time parameters: TSSetTime, TSSetMaxTime, TSSetTimeStep, TSSetMaxSteps
  3. Define equations: TSSetRHSFunction, TSSetIFunction, TSSetIJacobian
  4. Configure adaptivity: TSAdaptSetType, TSSetTolerances
  5. Set initial condition: TSSetSolution
  6. Solve: TSSolve
  7. Retrieve solution: TSGetSolution, TSGetTime, TSGetStepNumber

Time Integration Schemes

Available through TSSetType:

  • TSEULER: Forward/Backward Euler
  • TSRK: Runge-Kutta methods (various orders)
  • TSBDF: Backward Differentiation Formulas
  • TSTHETA: Theta method (generalizes Euler, Crank-Nicolson)
  • TSROSW: Rosenbrock-W methods for stiff problems
  • TSARKIMEX: Additive Runge-Kutta IMEX methods
  • TSGLEE: Generalized Linear Evolution Equations
  • TSALPHA: Alpha methods for second-order systems
  • TSSSP: 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: TSSetTolerances for absolute/relative error

Function Reference

PETSc.LibPETSc.TS2GetSolutionMethod
TS2GetSolution(petsclib::PetscLibType,ts::TS, u::PetscVec, v::PetscVec)

Returns the solution and time derivative at the present timestep for second order equations.

Not Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameters:

  • u - the vector containing the solution
  • v - the vector containing the time derivative

Level: intermediate

-seealso: , TS, TS2SetSolution(), TSGetTimeStep(), TSGetTime()

External Links

source
PETSc.LibPETSc.TS2SetSolutionMethod
TS2SetSolution(petsclib::PetscLibType,ts::TS, u::PetscVec, v::PetscVec)

Sets the initial solution and time derivative vectors for use by the TS routines handling second order equations.

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • u - the solution vector
  • v - the time derivative vector

Level: beginner

-seealso: , TS

External Links

source
PETSc.LibPETSc.TSARKIMEXGetFastSlowSplitMethod
fastslow::PetscBool = TSARKIMEXGetFastSlowSplit(petsclib::PetscLibType,ts::TS)

Gets whether to use TSARKIMEX for a fast

Not Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

  • fastslow - PETSC_TRUE if TSARKIMEX will be used for solving a fast-slow system, PETSC_FALSE otherwise

Level: intermediate

-seealso: , TSARKIMEX, TSARKIMEXSetFastSlowSplit()

External Links

source
PETSc.LibPETSc.TSARKIMEXGetFullyImplicitMethod
flg::PetscBool = TSARKIMEXGetFullyImplicit(petsclib::PetscLibType,ts::TS)

Inquires if both parts of the equation are solved implicitly

Logically Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

  • flg - PETSC_TRUE for fully implicit

Level: intermediate

-seealso: , TSARKIMEXGetType(), TSARKIMEXSetFullyImplicit()

External Links

source
PETSc.LibPETSc.TSARKIMEXGetTypeMethod
arktype::TSARKIMEXType = TSARKIMEXGetType(petsclib::PetscLibType,ts::TS)

Get the type of TSARKIMEX scheme

Logically Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

  • arktype - type of TSARKIMEX scheme

Level: intermediate

-seealso: , TSARKIMEX

External Links

source
PETSc.LibPETSc.TSARKIMEXRegisterMethod
TSARKIMEXRegister(petsclib::PetscLibType,name::TSARKIMEXType, order::PetscInt, s::PetscInt, At::Vector{PetscReal}, bt::Vector{PetscReal}, ct::Vector{PetscReal}, A::Vector{PetscReal}, b::Vector{PetscReal}, c::Vector{PetscReal}, bembedt::Vector{PetscReal}, bembed::Vector{PetscReal}, pinterp::PetscInt, binterpt::Vector{PetscReal}, binterp::Vector{PetscReal})

register a TSARKIMEX scheme by providing the entries in the Butcher tableau and optionally embedded approximations and interpolation

Logically Collective

Input Parameters:

  • name - identifier for method
  • order - approximation order of method
  • s - number of stages, this is the dimension of the matrices below
  • At - 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 binterp
  • binterpt - Coefficients of the interpolation formula for the stiff part (dimension s*pinterp)
  • binterp - Coefficients of the interpolation formula for the non-stiff part (dimension s*pinterp; NULL to reuse binterpt)

Level: advanced

-seealso: , TSARKIMEX, TSType, TS

External Links

source
PETSc.LibPETSc.TSARKIMEXSetFastSlowSplitMethod
TSARKIMEXSetFastSlowSplit(petsclib::PetscLibType,ts::TS, fastslow::PetscBool)

Use TSARKIMEX for solving a fast

Logically Collective

Input Parameters:

  • ts - timestepping context
  • fastslow - PETSC_TRUE enables the TSARKIMEX solver for a fast-slow system where the RHS is split component-wise.

Options Database Key:

  • -ts_arkimex_fastslowsplit - <true,false>

Level: intermediate

-seealso: , TSARKIMEX, TSARKIMEXGetFastSlowSplit()

External Links

source
PETSc.LibPETSc.TSARKIMEXSetFullyImplicitMethod
TSARKIMEXSetFullyImplicit(petsclib::PetscLibType,ts::TS, flg::PetscBool)

Solve both parts of the equation implicitly, including the part that is normally solved explicitly

Logically Collective

Input Parameters:

  • ts - timestepping context
  • flg - PETSC_TRUE for fully implicit

Level: intermediate

-seealso: , TSARKIMEX, TSARKIMEXGetType(), TSARKIMEXGetFullyImplicit()

External Links

source
PETSc.LibPETSc.TSARKIMEXSetTypeMethod
TSARKIMEXSetType(petsclib::PetscLibType,ts::TS, arktype::TSARKIMEXType)

Set the type of TSARKIMEX scheme

Logically Collective

Input Parameters:

  • ts - timestepping context
  • arktype - type of TSARKIMEX scheme

Options Database Key:

  • -ts_arkimex_type <1bee,a2,l2,ars122,2c,2d,2e,prssp2,3,bpr3,ars443,4,5> - set TSARKIMEX scheme type

Level: intermediate

-seealso: , TSARKIMEXGetType(), TSARKIMEX, TSARKIMEXType, TSARKIMEX1BEE, TSARKIMEXA2, TSARKIMEXL2, TSARKIMEXARS122, TSARKIMEX2C, TSARKIMEX2D, TSARKIMEX2E, TSARKIMEXPRSSP2, TSARKIMEX3, TSARKIMEXBPR3, TSARKIMEXARS443, TSARKIMEX4, TSARKIMEX5

External Links

source
PETSc.LibPETSc.TSAdjointMonitorMethod
TSAdjointMonitor(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, numcost::PetscInt, lambda::Vector{PetscVec}, mu::Vector{PetscVec})

Runs all user

Collective

Input Parameters:

  • ts - time stepping context obtained from TSCreate()
  • step - step number that has just completed
  • ptime - model time of the state
  • u - state at the current model time
  • numcost - 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 variables
  • mu - vectors containing the gradients of the cost functions with respect to the problem parameters

Level: developer

-seealso: TSAdjointMonitorSet(), TSAdjointSolve()

External Links

source
PETSc.LibPETSc.TSAdjointMonitorCancelMethod
TSAdjointMonitorCancel(petsclib::PetscLibType,ts::TS)

Clears all the adjoint monitors that have been set on a time

Logically Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

-seealso: , TS, TSAdjointSolve(), TSAdjointMonitorSet()

External Links

source
PETSc.LibPETSc.TSAdjointMonitorDefaultMethod
TSAdjointMonitorDefault(petsclib::PetscLibType,ts::TS, step::PetscInt, time::PetscReal, v::PetscVec, numcost::PetscInt, lambda::Vector{PetscVec}, mu::Vector{PetscVec}, vf::PetscViewerAndFormat)

the default monitor of adjoint computations

Input Parameters:

  • ts - the TS context
  • step - 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 time
  • v - current iterate
  • numcost - number of cost functionos
  • lambda - sensitivities to initial conditions
  • mu - sensitivities to parameters
  • vf - the viewer and format

Level: intermediate

-seealso: , TS, TSAdjointSolve(), TSAdjointMonitorSet()

External Links

source
PETSc.LibPETSc.TSAdjointMonitorDrawSensiMethod
TSAdjointMonitorDrawSensi(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, numcost::PetscInt, lambda::Vector{PetscVec}, mu::Vector{PetscVec}, dummy::Cvoid)

Monitors progress of the adjoint TS solvers by calling VecView() for the sensitivities to initial states at each timestep

Collective

Input Parameters:

  • ts - the TS context
  • step - current time-step
  • ptime - current time
  • u - current state
  • numcost - number of cost functions
  • lambda - sensitivities to initial conditions
  • mu - sensitivities to parameters
  • dummy - either a viewer or NULL

Level: intermediate

-seealso: , TSAdjointSolve(), TSAdjointMonitorSet(), TSAdjointMonitorDefault(), VecView()

External Links

source
PETSc.LibPETSc.TSAdjointMonitorSetMethod
TSAdjointMonitorSet(petsclib::PetscLibType,ts::TS, adjointmonitor::external, adjointmctx::Cvoid, adjointmdestroy::PetscCtxDestroyFn)

Sets an ADDITIONAL function that is to be used at every timestep to display the iteration's progress.

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • adjointmonitor - monitoring routine
  • adjointmctx - [optional] user-defined context for private data for the monitor routine

(use NULL if no context is desired)

  • adjointmdestroy - [optional] routine that frees monitor context (may be NULL), see PetscCtxDestroyFn for its calling sequence

Calling sequence of adjointmonitor:

  • ts - the TS context
  • steps - 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 time
  • u - current iterate
  • numcost - number of cost functionos
  • lambda - sensitivities to initial conditions
  • mu - sensitivities to parameters
  • adjointmctx - [optional] adjoint monitoring context

Level: intermediate

-seealso: , TS, TSAdjointSolve(), TSAdjointMonitorCancel(), PetscCtxDestroyFn

External Links

source
PETSc.LibPETSc.TSAdjointMonitorSetFromOptionsMethod
TSAdjointMonitorSetFromOptions(petsclib::PetscLibType,ts::TS, name::String, help::String, manual::String, monitor::external, monitorsetup::external)

Sets a monitor function and viewer appropriate for the type indicated by the user

Collective

Input Parameters:

  • ts - TS object you wish to monitor
  • name - the monitor type one is seeking
  • help - message indicating what monitoring is done
  • manual - manual page for the monitor
  • monitor - the monitor function, its context must be a PetscViewerAndFormat
  • monitorsetup - a function that is called once ONLY if the user selected this monitor that may set additional features of the TS or PetscViewer objects

Level: developer

-seealso: , PetscOptionsCreateViewer(), PetscOptionsGetReal(), PetscOptionsHasName(), PetscOptionsGetString(), PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsBool() PetscOptionsInt(), PetscOptionsString(), PetscOptionsReal(), PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHeadBegin(), PetscOptionsStringArray(), PetscOptionsRealArray(), PetscOptionsScalar(), PetscOptionsBoolGroupBegin(), PetscOptionsBoolGroup(), PetscOptionsBoolGroupEnd(), PetscOptionsFList(), PetscOptionsEList(), PetscViewerAndFormat

External Links

source
PETSc.LibPETSc.TSAdjointResetMethod
TSAdjointReset(petsclib::PetscLibType,ts::TS)

Resets a TS adjoint context and removes any allocated Vecs and Mats.

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Level: beginner

-seealso: , TSCreate(), TSAdjointSetUp(), TSDestroy()

External Links

source
PETSc.LibPETSc.TSAdjointResetForwardMethod
TSAdjointResetForward(petsclib::PetscLibType,ts::TS)

Reset the tangent linear solver and destroy the tangent linear context

Logically Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Level: intermediate

-seealso: , TSAdjointSetForward()

External Links

source
PETSc.LibPETSc.TSAdjointSetForwardMethod
TSAdjointSetForward(petsclib::PetscLibType,ts::TS, didp::PetscMat)

Trigger the tangent linear solver and initialize the forward sensitivities

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • didp - the derivative of initial values w.r.t. parameters

Level: intermediate

-seealso: , TSAdjointSolve(), TSSetCostHessianProducts(), TSAdjointResetForward()

External Links

source
PETSc.LibPETSc.TSAdjointSetFromOptionsMethod
TSAdjointSetFromOptions(petsclib::PetscLibType,ts::TS, PetscOptionsObject::PetscOptionItems)

Sets various TS adjoint parameters from options database.

Collective

Input Parameters:

  • ts - the TS context
  • PetscOptionsObject - the options context

Options Database Keys:

  • -ts_adjoint_solve <yes,no> - After solving the ODE/DAE solve the adjoint problem (requires -ts_save_trajectory)
  • -ts_adjoint_monitor - print information at each adjoint time step
  • -ts_adjoint_monitor_draw_sensi - monitor the sensitivity of the first cost function wrt initial conditions (lambda[0]) graphically

Level: developer

-seealso: , TSSetSaveTrajectory(), TSTrajectorySetUp()

External Links

source
PETSc.LibPETSc.TSAdjointSetStepsMethod
TSAdjointSetSteps(petsclib::PetscLibType,ts::TS, steps::PetscInt)

Sets the number of steps the adjoint solver should take backward in time

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • steps - number of steps to use

Level: intermediate

-seealso: , TSAdjointSolve(), TS, TSSetExactFinalTime()

External Links

source
PETSc.LibPETSc.TSAdjointSetUpMethod
TSAdjointSetUp(petsclib::PetscLibType,ts::TS)

Sets up the internal data structures for the later use of an adjoint solver

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Level: advanced

-seealso: , TSCreate(), TSAdjointStep(), TSSetCostGradients()

External Links

source
PETSc.LibPETSc.TSAdjointSolveMethod
TSAdjointSolve(petsclib::PetscLibType,ts::TS)

Solves the discrete ajoint problem for an ODE/DAE

Collective `

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Options Database Key:

  • -ts_adjoint_view_solution <viewerinfo> - views the first gradient with respect to the initial values

Level: intermediate

-seealso: , TSCreate(), TSSetCostGradients(), TSSetSolution(), TSAdjointStep()

External Links

source
PETSc.LibPETSc.TSAdjointStepMethod
TSAdjointStep(petsclib::PetscLibType,ts::TS)

Steps one time step backward in the adjoint run

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Level: intermediate

-seealso: , TSAdjointSetUp(), TSAdjointSolve()

External Links

source
PETSc.LibPETSc.TSAlpha2GetParamsMethod
alpha_m::PetscReal,alpha_f::PetscReal,gamma::PetscReal,beta::PetscReal = TSAlpha2GetParams(petsclib::PetscLibType,ts::TS)

gets the algorithmic parameters for TSALPHA2

Not Collective

Input Parameter:

  • ts - timestepping context

Output Parameters:

  • alpha_m - algorithmic parameter
  • alpha_f - algorithmic parameter
  • gamma - algorithmic parameter
  • beta - algorithmic parameter

Level: advanced

-seealso: , TS, TSALPHA2, TSAlpha2SetRadius(), TSAlpha2SetParams()

External Links

source
PETSc.LibPETSc.TSAlpha2SetParamsMethod
TSAlpha2SetParams(petsclib::PetscLibType,ts::TS, alpha_m::PetscReal, alpha_f::PetscReal, gamma::PetscReal, beta::PetscReal)

sets the algorithmic parameters for TSALPHA2

Logically Collective

Input Parameters:

  • ts - timestepping context
  • alpha_m - algorithmic parameter
  • alpha_f - algorithmic parameter
  • gamma - algorithmic parameter
  • beta - algorithmic parameter

Options Database Keys:

  • -ts_alpha_alpha_m <alpha_m> - set alpha_m
  • -ts_alpha_alpha_f <alpha_f> - set alpha_f
  • -ts_alpha_gamma <gamma> - set gamma
  • -ts_alpha_beta <beta> - set beta

Level: advanced

-seealso: , TS, TSALPHA2, TSAlpha2SetRadius(), TSAlpha2GetParams()

External Links

source
PETSc.LibPETSc.TSAlpha2SetPredictorMethod
TSAlpha2SetPredictor(petsclib::PetscLibType,ts::TS, predictor::TSAlpha2PredictorFn, ctx::Cvoid)

sets the callback for computing a predictor (i.e., initial guess for the nonlinear solver).

Input Parameters:

  • ts - timestepping context
  • predictor - callback to set the predictor in each step
  • ctx - the application context, which may be set to NULL if not used

Level: intermediate

-seealso: , TS, TSALPHA2, TSAlpha2PredictorFn

External Links

source
PETSc.LibPETSc.TSAlpha2SetRadiusMethod
TSAlpha2SetRadius(petsclib::PetscLibType,ts::TS, radius::PetscReal)

sets the desired spectral radius of the method for TSALPHA2 (i.e. high-frequency numerical damping)

Logically Collective

Input Parameters:

  • ts - timestepping context
  • radius - the desired spectral radius

Options Database Key:

  • -ts_alpha_radius <radius> - set the desired spectral radius

Level: intermediate

-seealso: , TS, TSALPHA2, TSAlpha2SetParams(), TSAlpha2GetParams()

External Links

source
PETSc.LibPETSc.TSAlphaGetParamsMethod
alpha_m::PetscReal,alpha_f::PetscReal,gamma::PetscReal = TSAlphaGetParams(petsclib::PetscLibType,ts::TS)

gets the algorithmic parameters for TSALPHA

Not Collective

Input Parameter:

  • ts - timestepping context

Output Parameters:

  • alpha_m - algorithmic parameter
  • alpha_f - algorithmic parameter
  • gamma - algorithmic parameter

Level: advanced

-seealso: , TS, TSALPHA, TSAlphaSetRadius(), TSAlphaSetParams()

External Links

source
PETSc.LibPETSc.TSAlphaSetParamsMethod
TSAlphaSetParams(petsclib::PetscLibType,ts::TS, alpha_m::PetscReal, alpha_f::PetscReal, gamma::PetscReal)

sets the algorithmic parameters for TSALPHA

Logically Collective

Input Parameters:

  • ts - timestepping context
  • alpha_m - algorithmic parameter
  • alpha_f - algorithmic parameter
  • gamma - algorithmic parameter

Options Database Keys:

  • -ts_alpha_alpha_m <alpha_m> - set alpha_m
  • -ts_alpha_alpha_f <alpha_f> - set alpha_f
  • -ts_alpha_gamma <gamma> - set gamma

Level: advanced

-seealso: , TS, TSALPHA, TSAlphaSetRadius(), TSAlphaGetParams()

External Links

source
PETSc.LibPETSc.TSAlphaSetRadiusMethod
TSAlphaSetRadius(petsclib::PetscLibType,ts::TS, radius::PetscReal)

sets the desired spectral radius of the method for TSALPHA (i.e. high-frequency numerical damping)

Logically Collective

Input Parameters:

  • ts - timestepping context
  • radius - the desired spectral radius

Options Database Key:

  • -ts_alpha_radius <radius> - set alpha radius

Level: intermediate

-seealso: , TS, TSALPHA, TSAlphaSetParams(), TSAlphaGetParams()

External Links

source
PETSc.LibPETSc.TSAppendOptionsPrefixMethod
TSAppendOptionsPrefix(petsclib::PetscLibType,ts::TS, prefix::String)

Appends to the prefix used for searching for all TS options in the database.

Logically Collective

Input Parameters:

  • ts - The TS context
  • prefix - The prefix to prepend to all option names

Level: advanced

-seealso: , TS, TSGetOptionsPrefix(), TSSetOptionsPrefix(), TSSetFromOptions()

External Links

source
PETSc.LibPETSc.TSBDFGetOrderMethod
order::PetscInt = TSBDFGetOrder(petsclib::PetscLibType,ts::TS)

Get the order of the TSBDF method

Not Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

  • order - order of the method

Level: intermediate

-seealso: TSBDFSetOrder(), TS, TSBDF

External Links

source
PETSc.LibPETSc.TSBDFSetOrderMethod
TSBDFSetOrder(petsclib::PetscLibType,ts::TS, order::PetscInt)

Set the order of the TSBDF method

Logically Collective

Input Parameters:

  • ts - timestepping context
  • order - order of the method

Options Database Key:

  • -ts_bdf_order <order> - select the order

Level: intermediate

-seealso: TSBDFGetOrder(), TS, TSBDF

External Links

source
PETSc.LibPETSc.TSBasicSymplecticGetTypeMethod
TSBasicSymplecticGetType(petsclib::PetscLibType,ts::TS, bsymptype::TSBasicSymplecticType)

Get the type of the basic symplectic method

Logically Collective

Input Parameters:

  • ts - timestepping context
  • bsymptype - type of the basic symplectic scheme

Level: intermediate

-seealso: , TSBASICSYMPLECTIC, TSBasicSymplecticType, TSBasicSymplecticSetType()

External Links

source
PETSc.LibPETSc.TSBasicSymplecticRegisterMethod
TSBasicSymplecticRegister(petsclib::PetscLibType,name::TSRosWType, order::PetscInt, s::PetscInt, c::Vector{PetscReal}, d::Vector{PetscReal})

register a basic symplectic integration scheme by providing the coefficients.

Not Collective, but the same schemes should be registered on all processes on which they will be used

Input Parameters:

  • name - identifier for method
  • order - approximation order of method
  • s - number of stages, this is the dimension of the matrices below
  • c - coefficients for updating generalized position (dimension s)
  • d - coefficients for updating generalized momentum (dimension s)

Level: advanced

-seealso: , TSBASICSYMPLECTIC

External Links

source
PETSc.LibPETSc.TSBasicSymplecticRegisterAllMethod
TSBasicSymplecticRegisterAll(petsclib::PetscLibType)

Registers all of the basic symplectic integration methods in TSBASICSYMPLECTIC

Not Collective, but should be called by all processes which will need the schemes to be registered

Level: advanced

-seealso: , TSBASICSYMPLECTIC, TSBasicSymplecticRegisterDestroy()

External Links

source
PETSc.LibPETSc.TSBasicSymplecticSetTypeMethod
TSBasicSymplecticSetType(petsclib::PetscLibType,ts::TS, bsymptype::TSBasicSymplecticType)

Set the type of the basic symplectic method

Logically Collective

Input Parameters:

  • ts - timestepping context
  • bsymptype - type of the symplectic scheme

Options Database Key:

  • -ts_basicsymplectic_type <scheme> - select the scheme

Level: intermediate

-seealso: , TSBASICSYMPLECTIC, TSBasicSymplecticType

External Links

source
PETSc.LibPETSc.TSCloneMethod
TSClone(petsclib::PetscLibType,tsin::TS, tsout::TS)

This function clones a time step TS object.

Collective

Input Parameter:

  • tsin - The input TS

Output Parameter:

  • tsout - The output TS (cloned)

Level: developer

-seealso: , TS, SNES, TSCreate(), TSSetType(), TSSetUp(), TSDestroy(), TSSetProblemType()

External Links

source
PETSc.LibPETSc.TSComputeCostIntegrandMethod
TSComputeCostIntegrand(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Q::PetscVec)

Evaluates the integral function in the cost functions.

Input Parameters:

  • ts - the TS context
  • t - current time
  • U - state vector, i.e. current solution

Output Parameter:

  • Q - vector of size numcost to hold the outputs

Level: deprecated

-seealso: , TS, TSAdjointSolve(), TSSetCostIntegrand()

External Links

source
PETSc.LibPETSc.TSComputeExactErrorMethod
TSComputeExactError(petsclib::PetscLibType,ts::TS, u::PetscVec, e::PetscVec)

Compute the solution error for the timestepping using the function previously set with TSSetComputeExactError()

Collective

Input Parameters:

  • ts - time stepping context
  • u - The approximate solution
  • e - The Vec used to store the error

Level: advanced

-seealso: , TS, TSGetComputeInitialCondition(), TSSetComputeInitialCondition(), TSSolve()

External Links

source
PETSc.LibPETSc.TSComputeForcingFunctionMethod
TSComputeForcingFunction(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec)

Evaluates the forcing function.

Collective

Input Parameters:

  • ts - the TS context
  • t - current time

Output Parameter:

  • U - the function value

Level: developer

-seealso: , TS, TSSetSolutionFunction(), TSSetRHSFunction(), TSComputeIFunction()

External Links

source
PETSc.LibPETSc.TSComputeI2FunctionMethod
TSComputeI2Function(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, V::PetscVec, A::PetscVec, F::PetscVec)

Evaluates the DAE residual written in implicit form F(t,U,Ut,Utt) = 0

Collective

Input Parameters:

  • ts - the TS context
  • t - current time
  • U - state vector
  • V - time derivative of state vector (U_t)
  • A - second time derivative of state vector (U_tt)

Output Parameter:

  • F - the residual vector

Level: developer

-seealso: , TS, TSSetI2Function(), TSGetI2Function()

External Links

source
PETSc.LibPETSc.TSComputeI2JacobianMethod
TSComputeI2Jacobian(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, V::PetscVec, A::PetscVec, shiftV::PetscReal, shiftA::PetscReal, J::PetscMat, P::PetscMat)

Evaluates the Jacobian of the DAE

Collective

Input Parameters:

  • ts - the TS context
  • t - current timestep
  • U - state vector
  • V - time derivative of state vector
  • A - second time derivative of state vector
  • shiftV - shift to apply, see note below
  • shiftA - shift to apply, see note below

Output Parameters:

  • J - Jacobian matrix
  • P - optional matrix used to construct the preconditioner

Level: developer

-seealso: , TS, TSSetI2Jacobian()

External Links

source
PETSc.LibPETSc.TSComputeIFunctionMethod
TSComputeIFunction(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Udot::PetscVec, Y::PetscVec, imex::PetscBool)

Evaluates the DAE residual written in the implicit form F(t,U,Udot)=0

Collective

Input Parameters:

  • ts - the TS context
  • t - current time
  • U - state vector
  • Udot - time derivative of state vector
  • imex - flag indicates if the method is TSARKIMEX so that the RHSFunction should be kept separate

Output Parameter:

  • Y - right-hand side

Level: developer

-seealso: , TS, TSSetIFunction(), TSComputeRHSFunction()

External Links

source
PETSc.LibPETSc.TSComputeIFunctionLinearMethod
TSComputeIFunctionLinear(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Udot::PetscVec, F::PetscVec, ctx::Cvoid)

Evaluate the left hand side via the user

Collective

Input Parameters:

  • ts - time stepping context
  • t - time at which to evaluate
  • U - state at which to evaluate
  • Udot - time derivative of state vector
  • ctx - context

Output Parameter:

  • F - left hand side

Level: intermediate

-seealso: , TS, TSSetIFunction(), TSSetIJacobian(), TSComputeIJacobianConstant(), TSComputeRHSFunctionLinear()

External Links

source
PETSc.LibPETSc.TSComputeIHessianProductFunctionPPMethod
TSComputeIHessianProductFunctionPP(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Vl::Vector{PetscVec}, Vr::PetscVec, VHV::Vector{PetscVec})

Runs the user

Collective

Input Parameters:

  • ts - The TS context obtained from TSCreate()
  • t - the time
  • U - the solution at which to compute the Hessian product
  • Vl - the array of input vectors to be multiplied with the Hessian from the left
  • Vr - the input vector to be multiplied with the Hessian from the right

Output Parameter:

  • VHV - the array of output vectors that store the Hessian product

Level: developer

-seealso: , TSSetIHessianProduct()

External Links

source
PETSc.LibPETSc.TSComputeIHessianProductFunctionPUMethod
TSComputeIHessianProductFunctionPU(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Vl::Vector{PetscVec}, Vr::PetscVec, VHV::Vector{PetscVec})

Runs the user

Collective

Input Parameters:

  • ts - The TS context obtained from TSCreate()
  • t - the time
  • U - the solution at which to compute the Hessian product
  • Vl - the array of input vectors to be multiplied with the Hessian from the left
  • Vr - the input vector to be multiplied with the Hessian from the right

Output Parameter:

  • VHV - the array of output vectors that store the Hessian product

Level: developer

-seealso: , TSSetIHessianProduct()

External Links

source
PETSc.LibPETSc.TSComputeIHessianProductFunctionUPMethod
TSComputeIHessianProductFunctionUP(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Vl::Vector{PetscVec}, Vr::PetscVec, VHV::Vector{PetscVec})

Runs the user

Collective

Input Parameters:

  • ts - The TS context obtained from TSCreate()
  • t - the time
  • U - the solution at which to compute the Hessian product
  • Vl - the array of input vectors to be multiplied with the Hessian from the left
  • Vr - the input vector to be multiplied with the Hessian from the right

Output Parameter:

  • VHV - the array of output vectors that store the Hessian product

Level: developer

-seealso: , TSSetIHessianProduct()

External Links

source
PETSc.LibPETSc.TSComputeIHessianProductFunctionUUMethod
TSComputeIHessianProductFunctionUU(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Vl::Vector{PetscVec}, Vr::PetscVec, VHV::Vector{PetscVec})

Runs the user

Collective

Input Parameters:

  • ts - The TS context obtained from TSCreate()
  • t - the time
  • U - the solution at which to compute the Hessian product
  • Vl - the array of input vectors to be multiplied with the Hessian from the left
  • Vr - the input vector to be multiplied with the Hessian from the right

Output Parameter:

  • VHV - the array of output vectors that store the Hessian product

Level: developer

-seealso: , TSSetIHessianProduct()

External Links

source
PETSc.LibPETSc.TSComputeIJacobianMethod
TSComputeIJacobian(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Udot::PetscVec, shift::PetscReal, A::PetscMat, B::PetscMat, imex::PetscBool)

Evaluates the Jacobian of the DAE

Collective

Input Parameters:

  • ts - the TS context
  • t - current timestep
  • U - state vector
  • Udot - time derivative of state vector
  • shift - shift to apply, see note below
  • imex - flag indicates if the method is TSARKIMEX so that the RHSJacobian should be kept separate

Output Parameters:

  • A - Jacobian matrix
  • B - matrix from which the preconditioner is constructed; often the same as A

Level: developer

-seealso: , TS, TSSetIJacobian()

External Links

source
PETSc.LibPETSc.TSComputeIJacobianConstantMethod
TSComputeIJacobianConstant(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Udot::PetscVec, shift::PetscReal, A::PetscMat, B::PetscMat, ctx::Cvoid)

Reuses the matrix previously computed with the provided TSIJacobianFn for a semi

Collective

Input Parameters:

  • ts - time stepping context
  • t - time at which to evaluate
  • U - state at which to evaluate
  • Udot - time derivative of state vector
  • shift - shift to apply
  • ctx - context

Output Parameters:

  • A - pointer to operator
  • B - pointer to matrix from which the preconditioner is built (often A)

Level: advanced

-seealso: , TS, TSROSW, TSARKIMEX, TSSetIFunction(), TSSetIJacobian(), TSComputeIFunctionLinear()

External Links

source
PETSc.LibPETSc.TSComputeIJacobianDefaultColorMethod
TSComputeIJacobianDefaultColor(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Udot::PetscVec, shift::PetscReal, J::PetscMat, B::PetscMat, ctx::Cvoid)

Computes the Jacobian using finite differences and coloring to exploit matrix sparsity.

Collective

Input Parameters:

  • ts - the TS context
  • t - current timestep
  • U - state vector
  • Udot - time derivative of state vector
  • shift - shift to apply, see note below
  • ctx - an optional user context

Output Parameters:

  • J - Jacobian matrix (not altered in this routine)
  • B - newly computed Jacobian matrix to use with preconditioner (generally the same as J)

Level: intermediate

-seealso: , TS, TSSetIJacobian(), MatFDColoringCreate(), MatFDColoringSetFunction()

External Links

source
PETSc.LibPETSc.TSComputeIJacobianPMethod
TSComputeIJacobianP(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Udot::PetscVec, shift::PetscReal, Amat::PetscMat, imex::PetscBool)

Runs the user

Collective

Input Parameters:

  • ts - the TS context
  • t - current timestep
  • U - state vector
  • Udot - time derivative of state vector
  • shift - shift to apply, see note below
  • imex - flag indicates if the method is IMEX so that the RHSJacobianP should be kept separate

Output Parameter:

  • Amat - Jacobian matrix

Level: developer

-seealso: , TS, TSSetIJacobianP()

External Links

source
PETSc.LibPETSc.TSComputeInitialConditionMethod
TSComputeInitialCondition(petsclib::PetscLibType,ts::TS, u::PetscVec)

Compute an initial condition for the timestepping using the function previously set with TSSetComputeInitialCondition()

Collective

Input Parameters:

  • ts - time stepping context
  • u - The Vec to store the condition in which will be used in TSSolve()

Level: advanced

-seealso: , TS, TSGetComputeInitialCondition(), TSSetComputeInitialCondition(), TSSolve()

External Links

source
PETSc.LibPETSc.TSComputeLinearStabilityMethod
yr::PetscReal,yi::PetscReal = TSComputeLinearStability(petsclib::PetscLibType,ts::TS, xr::PetscReal, xi::PetscReal)

computes the linear stability function at a point

Collective

Input Parameters:

  • ts - the TS context
  • xr - real part of input argument
  • xi - imaginary part of input argument

Output Parameters:

  • yr - real part of function value
  • yi - imaginary part of function value

Level: developer

-seealso: , TS, TSSetRHSFunction(), TSComputeIFunction()

External Links

source
PETSc.LibPETSc.TSComputeRHSFunctionMethod
TSComputeRHSFunction(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, y::PetscVec)

Evaluates the right

Collective

Input Parameters:

  • ts - the TS context
  • t - current time
  • U - state vector

Output Parameter:

  • y - right-hand side

Level: developer

-seealso: , TS, TSSetRHSFunction(), TSComputeIFunction()

External Links

source
PETSc.LibPETSc.TSComputeRHSFunctionLinearMethod
TSComputeRHSFunctionLinear(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, F::PetscVec, ctx::Cvoid)

Evaluate the right

Collective

Input Parameters:

  • ts - time stepping context
  • t - time at which to evaluate
  • U - state at which to evaluate
  • ctx - context

Output Parameter:

  • F - right-hand side

Level: intermediate

-seealso: , TS, TSSetRHSFunction(), TSSetRHSJacobian(), TSComputeRHSJacobianConstant()

External Links

source
PETSc.LibPETSc.TSComputeRHSHessianProductFunctionPPMethod
TSComputeRHSHessianProductFunctionPP(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Vl::Vector{PetscVec}, Vr::PetscVec, VHV::Vector{PetscVec})

Runs the user

Collective

Input Parameters:

  • ts - The TS context obtained from TSCreate()
  • t - the time
  • U - the solution at which to compute the Hessian product
  • Vl - the array of input vectors to be multiplied with the Hessian from the left
  • Vr - the input vector to be multiplied with the Hessian from the right

Output Parameter:

  • VHV - the array of output vectors that store the Hessian product

Level: developer

-seealso: , TSSetRHSHessianProduct()

External Links

source
PETSc.LibPETSc.TSComputeRHSHessianProductFunctionPUMethod
TSComputeRHSHessianProductFunctionPU(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Vl::Vector{PetscVec}, Vr::PetscVec, VHV::Vector{PetscVec})

Runs the user

Collective

Input Parameters:

  • ts - The TS context obtained from TSCreate()
  • t - the time
  • U - the solution at which to compute the Hessian product
  • Vl - the array of input vectors to be multiplied with the Hessian from the left
  • Vr - the input vector to be multiplied with the Hessian from the right

Output Parameter:

  • VHV - the array of output vectors that store the Hessian product

Level: developer

-seealso: , TSSetRHSHessianProduct()

External Links

source
PETSc.LibPETSc.TSComputeRHSHessianProductFunctionUPMethod
TSComputeRHSHessianProductFunctionUP(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Vl::Vector{PetscVec}, Vr::PetscVec, VHV::Vector{PetscVec})

Runs the user

Collective

Input Parameters:

  • ts - The TS context obtained from TSCreate()
  • t - the time
  • U - the solution at which to compute the Hessian product
  • Vl - the array of input vectors to be multiplied with the Hessian from the left
  • Vr - the input vector to be multiplied with the Hessian from the right

Output Parameter:

  • VHV - the array of output vectors that store the Hessian product

Level: developer

-seealso: , TS, TSSetRHSHessianProduct()

External Links

source
PETSc.LibPETSc.TSComputeRHSHessianProductFunctionUUMethod
TSComputeRHSHessianProductFunctionUU(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Vl::Vector{PetscVec}, Vr::PetscVec, VHV::Vector{PetscVec})

Runs the user

Collective

Input Parameters:

  • ts - The TS context obtained from TSCreate()
  • t - the time
  • U - the solution at which to compute the Hessian product
  • Vl - the array of input vectors to be multiplied with the Hessian from the left
  • Vr - the input vector to be multiplied with the Hessian from the right

Output Parameter:

  • VHV - the array of output vectors that store the Hessian product

Level: developer

-seealso: , TS, TSSetRHSHessianProduct()

External Links

source
PETSc.LibPETSc.TSComputeRHSJacobianMethod
TSComputeRHSJacobian(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, A::PetscMat, B::PetscMat)

Computes the Jacobian matrix that has been set with TSSetRHSJacobian().

Collective

Input Parameters:

  • ts - the TS context
  • t - current timestep
  • U - input vector

Output Parameters:

  • A - Jacobian matrix
  • B - optional matrix used to compute the preconditioner, often the same as A

Level: developer

-seealso: , TS, TSSetRHSJacobian(), KSPSetOperators()

External Links

source
PETSc.LibPETSc.TSComputeRHSJacobianConstantMethod
TSComputeRHSJacobianConstant(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, A::PetscMat, B::PetscMat, ctx::Cvoid)

Reuses a Jacobian that is time

Collective

Input Parameters:

  • ts - time stepping context
  • t - time at which to evaluate
  • U - state at which to evaluate
  • ctx - context

Output Parameters:

  • A - Jacobian
  • B - matrix used to construct the preconditioner, often the same as A

Level: intermediate

-seealso: , TS, TSSetRHSFunction(), TSSetRHSJacobian(), TSComputeRHSFunctionLinear()

External Links

source
PETSc.LibPETSc.TSComputeRHSJacobianPMethod
TSComputeRHSJacobianP(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec, Amat::PetscMat)

Runs the user

Collective

Input Parameters:

  • ts - The TS context obtained from TSCreate()
  • t - the time
  • U - the solution at which to compute the Jacobian

Output Parameter:

  • Amat - the computed Jacobian

Level: developer

-seealso: , TSSetRHSJacobianP(), TS

External Links

source
PETSc.LibPETSc.TSComputeSNESJacobianMethod
TSComputeSNESJacobian(petsclib::PetscLibType,ts::TS, x::PetscVec, J::PetscMat, Jpre::PetscMat)

Compute the Jacobian needed for the SNESSolve() in TS

Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • x - state vector

Output Parameters:

  • J - Jacobian matrix
  • Jpre - matrix used to compute the preconditioner for J (may be same as J)

Level: developer

-seealso: SNES, TS, SNESSetJacobian(), TSSetRHSJacobian(), TSSetIJacobian()

External Links

source
PETSc.LibPETSc.TSComputeSolutionFunctionMethod
TSComputeSolutionFunction(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec)

Evaluates the solution function.

Collective

Input Parameters:

  • ts - the TS context
  • t - current time

Output Parameter:

  • U - the solution

Level: developer

-seealso: , TS, TSSetSolutionFunction(), TSSetRHSFunction(), TSComputeIFunction()

External Links

source
PETSc.LibPETSc.TSComputeTransientVariableMethod
TSComputeTransientVariable(petsclib::PetscLibType,ts::TS, U::PetscVec, C::PetscVec)

transforms state (primitive) variables to transient (conservative) variables

Logically Collective

Input Parameters:

  • ts - TS on which to compute
  • U - state vector to be transformed to transient variables

Output Parameter:

  • C - transient (conservative) variable

Level: developer

-seealso: , TS, TSBDF, DMTSSetTransientVariable(), TSComputeIFunction(), TSComputeIJacobian()

External Links

source
PETSc.LibPETSc.TSCreateMethod
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 - The TS

Level: beginner

-seealso: , TS, SNES, TSSetType(), TSSetUp(), TSDestroy(), TSSetProblemType()

External Links

source
PETSc.LibPETSc.TSCreateQuadratureTSMethod
quadts::TS = TSCreateQuadratureTS(petsclib::PetscLibType,ts::TS, fwd::PetscBool)

Create a sub

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • fwd - flag indicating whether to evaluate cost integral in the forward run or the adjoint run

Output Parameter:

  • quadts - the child TS context

Level: intermediate

-seealso: , TSGetQuadratureTS()

External Links

source
PETSc.LibPETSc.TSDIRKGetTypeMethod
dirktype::TSDIRKType = TSDIRKGetType(petsclib::PetscLibType,ts::TS)

Get the type of TSDIRK scheme

Logically Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

  • dirktype - type of TSDIRK scheme

Level: intermediate

-seealso: , TSDIRKSetType()

External Links

source
PETSc.LibPETSc.TSDIRKRegisterMethod
TSDIRKRegister(petsclib::PetscLibType,name::TSDIRKType, order::PetscInt, s::PetscInt, At::Vector{PetscReal}, bt::Vector{PetscReal}, ct::Vector{PetscReal}, bembedt::Vector{PetscReal}, pinterp::PetscInt, binterpt::Vector{PetscReal})

register a TSDIRK scheme by providing the entries in its Butcher tableau and, optionally, embedded approximations and interpolation

Logically Collective.

Input Parameters:

  • name - identifier for method
  • order - approximation order of method
  • s - number of stages, this is the dimension of the matrices below
  • At - Butcher table of stage coefficients (dimension s*s, row-major order)
  • bt - Butcher table for completing the step (dimension s; pass NULL to use the last row of At)
  • 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; NULL if not available)
  • pinterp - Order of the interpolation scheme, equal to the number of columns of binterpt and binterp
  • binterpt - Coefficients of the interpolation formula (dimension s*pinterp)

Level: advanced

-seealso: , TSDIRK, TSType, TS

External Links

source
PETSc.LibPETSc.TSDIRKSetTypeMethod
TSDIRKSetType(petsclib::PetscLibType,ts::TS, dirktype::TSDIRKType)

Set the type of TSDIRK scheme

Logically Collective

Input Parameters:

  • ts - timestepping context
  • dirktype - type of TSDIRK scheme

Options Database Key:

  • -ts_dirkimex_type - set TSDIRK scheme type

Level: intermediate

-seealso: , TSDIRKGetType(), TSDIRK, TSDIRKType

External Links

source
PETSc.LibPETSc.TSDMSwarmMonitorMomentsMethod
TSDMSwarmMonitorMoments(petsclib::PetscLibType,ts::TS, step::PetscInt, t::PetscReal, U::PetscVec, vf::PetscViewerAndFormat)

Monitors the first three moments of a DMSWARM being evolved by the TS

Not Collective

Input Parameters:

  • ts - the TS context
  • step - current timestep
  • t - current time
  • U - current solution
  • vf - not used

Options Database Key:

  • -ts_dmswarm_monitor_moments - Monitor moments of particle distribution
  • -ts_dmswarm_monitor_moments_interval - Interval of timesteps between monitor outputs

Level: intermediate

-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), DMSWARM

External Links

source
PETSc.LibPETSc.TSDestroyMethod
TSDestroy(petsclib::PetscLibType,ts::TS)

Destroys the timestepper context that was created with TSCreate().

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Level: beginner

-seealso: , TS, TSCreate(), TSSetUp(), TSSolve()

External Links

source
PETSc.LibPETSc.TSDiscGradGetTypeMethod
dgtype::TSDGType = TSDiscGradGetType(petsclib::PetscLibType,ts::TS)

Checks for which discrete gradient to use in formulation for TSDISCGRAD

Not Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

  • dgtype - Discrete gradient type <none, gonzalez, average>

Level: advanced

-seealso: , TSDISCGRAD, TSDiscGradSetType()

External Links

source
PETSc.LibPETSc.TSDiscGradSetFormulationMethod
TSDiscGradSetFormulation(petsclib::PetscLibType,ts::TS, Sfunc::external, Ffunc::external, Gfunc::external, ctx::Cvoid)

Set the construction method for S, F, and grad F from the formulation u_t = S(u) abla F(u) for TSDISCGRAD

Not Collective

Input Parameters:

  • ts - timestepping context
  • Sfunc - constructor for the S matrix from the formulation
  • Ffunc - functional F from the formulation
  • Gfunc - constructor for the gradient of F from the formulation
  • ctx - optional context for the functions

Calling sequence of Sfunc:

  • ts - the integrator
  • time - the current time
  • u - the solution
  • S - the S-matrix from the formulation
  • ctx - the user context

Calling sequence of Ffunc:

  • ts - the integrator
  • time - the current time
  • u - the solution
  • F - the computed function from the formulation
  • ctx - the user context

Calling sequence of Gfunc:

  • ts - the integrator
  • time - the current time
  • u - the solution
  • G - the gradient of the computed function from the formulation
  • ctx - the user context

Level: intermediate

-seealso: , TSDISCGRAD, TSDiscGradGetFormulation()

External Links

source
PETSc.LibPETSc.TSDiscGradSetTypeMethod
TSDiscGradSetType(petsclib::PetscLibType,ts::TS, dgtype::TSDGType)

Sets discrete gradient formulation.

Not Collective

Input Parameters:

  • ts - timestepping context
  • dgtype - Discrete gradient type <none, gonzalez, average>

Options Database Key:

  • -ts_discgrad_type <type> - flag to choose discrete gradient type

Level: intermediate

-seealso: , TSDISCGRAD

External Links

source
PETSc.LibPETSc.TSEIMEXSetMaxRowsMethod
TSEIMEXSetMaxRows(petsclib::PetscLibType,ts::TS, nrows::PetscInt)

Set the maximum number of rows for TSEIMEX schemes

Logically Collective

Input Parameters:

  • ts - timestepping context
  • nrows - maximum number of rows

Level: intermediate

-seealso: , TSEIMEXSetRowCol(), TSEIMEXSetOrdAdapt(), TSEIMEX

External Links

source
PETSc.LibPETSc.TSEIMEXSetOrdAdaptMethod
TSEIMEXSetOrdAdapt(petsclib::PetscLibType,ts::TS, flg::PetscBool)

Set the order adaptativity for the TSEIMEX schemes

Logically Collective

Input Parameters:

  • ts - timestepping context
  • flg - index in the T table

Level: intermediate

-seealso: , TSEIMEXSetRowCol(), TSEIMEX

External Links

source
PETSc.LibPETSc.TSEIMEXSetRowColMethod
TSEIMEXSetRowCol(petsclib::PetscLibType,ts::TS, row::PetscInt, col::PetscInt)

Set the number of rows and the number of columns for the tableau that represents the T solution in the TSEIMEX scheme

Logically Collective

Input Parameters:

  • ts - timestepping context
  • row - the row
  • col - the column

Level: intermediate

-seealso: , TSEIMEXSetMaxRows(), TSEIMEXSetOrdAdapt(), TSEIMEX

External Links

source
PETSc.LibPETSc.TSErrorWeightedENormMethod
norm::PetscReal,norma::PetscReal,normr::PetscReal = TSErrorWeightedENorm(petsclib::PetscLibType,ts::TS, E::PetscVec, U::PetscVec, Y::PetscVec, wnormtype::NormType)

compute a weighted error norm based on supplied absolute and relative tolerances

Collective

Input Parameters:

  • ts - time stepping context
  • E - error vector
  • U - state vector, usually ts->vec_sol
  • Y - state vector, previous time step
  • wnormtype - norm type, either NORM_2 or NORM_INFINITY

Output Parameters:

  • norm - weighted norm, a value of 1.0 achieves a balance between absolute and relative tolerances
  • norma - weighted norm, a value of 1.0 means that the error meets the absolute tolerance set by the user
  • normr - weighted norm, a value of 1.0 means that the error meets the relative tolerance set by the user

Options Database Key:

  • -ts_adapt_wnormtype <wnormtype> - 2, INFINITY

Level: developer

-seealso: , TS, VecErrorWeightedNorms(), TSErrorWeightedNorm()

External Links

source
PETSc.LibPETSc.TSErrorWeightedNormMethod
norm::PetscReal,norma::PetscReal,normr::PetscReal = TSErrorWeightedNorm(petsclib::PetscLibType,ts::TS, U::PetscVec, Y::PetscVec, wnormtype::NormType)

compute a weighted norm of the difference between two state vectors based on supplied absolute and relative tolerances

Collective

Input Parameters:

  • ts - time stepping context
  • U - state vector, usually ts->vec_sol
  • Y - state vector to be compared to U
  • wnormtype - norm type, either NORM_2 or NORM_INFINITY

Output Parameters:

  • norm - weighted norm, a value of 1.0 achieves a balance between absolute and relative tolerances
  • norma - weighted norm, a value of 1.0 means that the error meets the absolute tolerance set by the user
  • normr - weighted norm, a value of 1.0 means that the error meets the relative tolerance set by the user

Options Database Key:

  • -ts_adapt_wnormtype <wnormtype> - 2, INFINITY

Level: developer

-seealso: , TS, VecErrorWeightedNorms(), TSErrorWeightedENorm()

External Links

source
PETSc.LibPETSc.TSEvaluateStepMethod
TSEvaluateStep(petsclib::PetscLibType,ts::TS, order::PetscInt, U::PetscVec, done::PetscBool)

Evaluate the solution at the end of a time step with a given order of accuracy.

Collective

Input Parameters:

  • ts - time stepping context
  • order - desired order of accuracy
  • done - whether the step was evaluated at this order (pass NULL to generate an error if not available)

Output Parameter:

  • U - state at the end of the current step

Level: advanced

-seealso: , TS, TSStep(), TSAdapt

External Links

source
PETSc.LibPETSc.TSEvaluateWLTEMethod
order::PetscInt,wlte::PetscReal = TSEvaluateWLTE(petsclib::PetscLibType,ts::TS, wnormtype::NormType)

Evaluate the weighted local truncation error norm at the end of a time step with a given order of accuracy.

Collective

Input Parameters:

  • ts - time stepping context
  • wnormtype - norm type, either NORM_2 or NORM_INFINITY

Input/Output Parameter:

  • order - optional, desired order for the error evaluation or PETSC_DECIDE;

on output, the actual order of the error evaluation

Output Parameter:

  • wlte - the weighted local truncation error norm

Level: advanced

-seealso: , TS, TSStep(), TSAdapt, TSErrorWeightedNorm()

External Links

source
PETSc.LibPETSc.TSFinalizePackageMethod
TSFinalizePackage(petsclib::PetscLibType)

This function destroys everything in the PETSc interface to TS. It is called from PetscFinalize().

Level: developer

-seealso: , TS, PetscFinalize(), TSInitializePackage()

External Links

source
PETSc.LibPETSc.TSForwardGetSensitivitiesMethod
nump::PetscInt = TSForwardGetSensitivities(petsclib::PetscLibType,ts::TS, Smat::PetscMat)

Returns the trajectory sensitivities

Not Collective, but Smat returned is parallel if ts is parallel

Output Parameters:

  • ts - the TS context obtained from TSCreate()
  • nump - number of parameters
  • Smat - sensitivities with respect to the parameters, the number of entries in these vectors is the same as the number of parameters

Level: intermediate

-seealso: , TSForwardSetSensitivities(), TSForwardSetIntegralGradients(), TSForwardGetIntegralGradients(), TSForwardStep()

External Links

source
PETSc.LibPETSc.TSForwardGetStagesMethod
ns::PetscInt = TSForwardGetStages(petsclib::PetscLibType,ts::TS, S::PetscMat)

Get the number of stages and the tangent linear sensitivities at the intermediate stages

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameters:

  • ns - number of stages
  • S - tangent linear sensitivities at the intermediate stages

Level: advanced

-seealso: TS

External Links

source
PETSc.LibPETSc.TSForwardResetMethod
TSForwardReset(petsclib::PetscLibType,ts::TS)

Reset the internal data structures used by forward sensitivity analysis

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Level: advanced

-seealso: , TSCreate(), TSDestroy(), TSForwardSetUp()

External Links

source
PETSc.LibPETSc.TSForwardSetInitialSensitivitiesMethod
TSForwardSetInitialSensitivities(petsclib::PetscLibType,ts::TS, didp::PetscMat)

Set initial values for tangent linear sensitivities

Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • didp - parametric sensitivities of the initial condition

Level: intermediate

-seealso: , TS, TSForwardSetSensitivities()

External Links

source
PETSc.LibPETSc.TSForwardSetSensitivitiesMethod
TSForwardSetSensitivities(petsclib::PetscLibType,ts::TS, nump::PetscInt, Smat::PetscMat)

Sets the initial value of the trajectory sensitivities of solution w.r.t. the problem parameters and initial values.

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • nump - number of parameters
  • Smat - sensitivities with respect to the parameters, the number of entries in these vectors is the same as the number of parameters

Level: beginner

-seealso: , TSForwardGetSensitivities(), TSForwardSetIntegralGradients(), TSForwardGetIntegralGradients(), TSForwardStep()

External Links

source
PETSc.LibPETSc.TSForwardSetUpMethod
TSForwardSetUp(petsclib::PetscLibType,ts::TS)

Sets up the internal data structures for the later use of forward sensitivity analysis

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Level: advanced

-seealso: , TS, TSCreate(), TSDestroy(), TSSetUp()

External Links

source
PETSc.LibPETSc.TSForwardStepMethod
TSForwardStep(petsclib::PetscLibType,ts::TS)

Compute the forward sensitivity for one time step.

Collective

Input Parameter:

  • ts - time stepping context

Level: advanced

-seealso: , TSForwardSetSensitivities(), TSForwardGetSensitivities(), TSForwardSetIntegralGradients(), TSForwardGetIntegralGradients(), TSForwardSetUp()

External Links

source
PETSc.LibPETSc.TSFunctionDomainErrorMethod
accept::PetscBool = TSFunctionDomainError(petsclib::PetscLibType,ts::TS, stagetime::PetscReal, Y::PetscVec)

Checks if the current state is valid

Collective

Input Parameters:

  • ts - the TS context
  • stagetime - time of the simulation
  • Y - state vector to check.

Output Parameter:

  • accept - Set to PETSC_FALSE if the current state vector is valid.

Level: developer

-seealso: , TS, TSSetFunctionDomainError()

External Links

source
PETSc.LibPETSc.TSGLEEGetTypeMethod
gleetype::TSGLEEType = TSGLEEGetType(petsclib::PetscLibType,ts::TS)

Get the type of TSGLEE scheme

Logically Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

  • gleetype - type of TSGLEE scheme

Level: intermediate

-seealso: , TSGLEE, TSGLEESetType()

External Links

source
PETSc.LibPETSc.TSGLEERegisterMethod
TSGLEERegister(petsclib::PetscLibType,name::TSGLEEType, order::PetscInt, s::PetscInt, r::PetscInt, gamma::PetscReal, A::Vector{PetscReal}, B::Vector{PetscReal}, U::Vector{PetscReal}, V::Vector{PetscReal}, S::Vector{PetscReal}, F::Vector{PetscReal}, c::Vector{PetscReal}, Fembed::Vector{PetscReal}, Ferror::Vector{PetscReal}, Serror::Vector{PetscReal}, pinterp::PetscInt, binterp::Vector{PetscReal})

register a new TSGLEE scheme by providing the entries in the Butcher tableau

Not Collective, but the same schemes should be registered on all processes on which they will be used, No Fortran Support

Input Parameters:

  • name - identifier for method
  • order - order of method
  • s - number of stages
  • r - number of steps
  • gamma - LTE ratio
  • A - 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 coefficients
  • F - finishing coefficients
  • c - abscissa (dimension s; NULL to use row sums of A)
  • Fembed - step completion coefficients for embedded method
  • Ferror - error computation coefficients
  • Serror - error initialization coefficients
  • pinterp - order of interpolation (0 if unavailable)
  • binterp - array of interpolation coefficients (NULL if unavailable)

Level: advanced

-seealso: , TSGLEE

External Links

source
PETSc.LibPETSc.TSGLEERegisterAllMethod
TSGLEERegisterAll(petsclib::PetscLibType)

Registers all of the General Linear with Error Estimation methods in TSGLEE

Not Collective, but should be called by all processes which will need the schemes to be registered

Level: advanced

-seealso: , TSGLEERegisterDestroy()

External Links

source
PETSc.LibPETSc.TSGLEESetTypeMethod
TSGLEESetType(petsclib::PetscLibType,ts::TS, gleetype::TSGLEEType)

Set the type of TSGLEE scheme

Logically Collective

Input Parameters:

  • ts - timestepping context
  • gleetype - type of TSGLEE scheme

Level: intermediate

-seealso: , TSGLEEGetType(), TSGLEE

External Links

source
PETSc.LibPETSc.TSGLLEAcceptRegisterMethod
TSGLLEAcceptRegister(petsclib::PetscLibType,sname::String, fnc::TSGLLEAcceptFn)

adds a TSGLLE acceptance scheme

Not Collective

Input Parameters:

  • sname - name of user-defined acceptance scheme
  • function - routine to create method context, see TSGLLEAcceptFn for the calling sequence

Level: advanced

-seealso: , TSGLLE, TSGLLEType, TSGLLERegisterAll(), TSGLLEAcceptFn

External Links

source
PETSc.LibPETSc.TSGLLEFinalizePackageMethod
TSGLLEFinalizePackage(petsclib::PetscLibType)

This function destroys everything in the TSGLLE package. It is called from PetscFinalize().

Level: developer

-seealso: , PetscFinalize(), TSGLLEInitializePackage(), TSInitializePackage()

External Links

source
PETSc.LibPETSc.TSGLLEGetAdaptMethod
TSGLLEGetAdapt(petsclib::PetscLibType,ts::TS, adapt::TSGLLEAdapt)

gets the TSGLLEAdapt object from the TS

Not Collective

Input Parameter:

  • ts - the TS context

Output Parameter:

  • adapt - the TSGLLEAdapt context

Level: advanced

-seealso: , TS, TSGLLE, TSGLLEAdapt, TSGLLEAdaptRegister()

External Links

source
PETSc.LibPETSc.TSGLLERegisterMethod
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 scheme
  • function - routine to create method context

Level: advanced

-seealso: , TSGLLE, TSGLLEType, TSGLLERegisterAll()

External Links

source
PETSc.LibPETSc.TSGLLESetAcceptTypeMethod
TSGLLESetAcceptType(petsclib::PetscLibType,ts::TS, type::TSGLLEAcceptType)

sets the acceptance test for TSGLLE

Logically Collective

Input Parameters:

  • ts - the TS context
  • type - the type

Options Database Key:

  • -ts_gl_accept_type <type> - sets the method used to determine whether to accept or reject a step

Level: intermediate

-seealso: , TS, TSGLLE, TSGLLEAcceptRegister(), TSGLLEAdapt

External Links

source
PETSc.LibPETSc.TSGLLESetTypeMethod
TSGLLESetType(petsclib::PetscLibType,ts::TS, type::TSGLLEType)

sets the class of general linear method, TSGLLE to use for time

Collective

Input Parameters:

  • ts - the TS context
  • type - a method

Options Database Key:

  • -ts_gl_type <type> - sets the method, use -help for a list of available method (e.g. irks)

Level: intermediate

-seealso: , TS, TSGLLEType, TSGLLE

External Links

source
PETSc.LibPETSc.TSGetAdaptMethod
TSGetAdapt(petsclib::PetscLibType,ts::TS, adapt::TSAdapt)

Get the adaptive controller context for the current method

Collective if controller has not yet been created

Input Parameter:

  • ts - time stepping context

Output Parameter:

  • adapt - adaptive controller

Level: intermediate

-seealso: , TS, TSAdapt, TSAdaptSetType(), TSAdaptChoose()

External Links

source
PETSc.LibPETSc.TSGetApplicationContextMethod
TSGetApplicationContext(petsclib::PetscLibType,ts::TS, ctx::Cvoid)

Gets the user timestepper that was set with TSSetApplicationContext()

Not Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameter:

  • ctx - a pointer to the user context

Level: intermediate

-seealso: , TS, TSSetApplicationContext()

External Links

source
PETSc.LibPETSc.TSGetAuxSolutionMethod
TSGetAuxSolution(petsclib::PetscLibType,ts::TS, v::PetscVec)

Returns an auxiliary solution at the present timestep, if available for the time integration method being used.

Not Collective, but v returned is parallel if ts is parallel

Input Parameters:

  • ts - the TS context obtained from TSCreate() (input parameter).
  • v - the vector containing the auxiliary solution

Level: intermediate

-seealso: , TS, TSGetSolution()

External Links

source
PETSc.LibPETSc.TSGetCFLTimeMethod
cfltime::PetscReal = TSGetCFLTime(petsclib::PetscLibType,ts::TS)

Get the maximum stable time step according to CFL criteria applied to forward Euler

Collective

Input Parameter:

  • ts - time stepping context

Output Parameter:

  • cfltime - maximum stable time step for forward Euler

Level: advanced

-seealso: , TSSetCFLTimeLocal()

External Links

source
PETSc.LibPETSc.TSGetConvergedReasonMethod
TSGetConvergedReason(petsclib::PetscLibType,ts::TS, reason::TSConvergedReason)

Gets the reason the TS iteration was stopped.

Not Collective

Input Parameter:

  • ts - the TS context

Output Parameter:

  • reason - negative value indicates diverged, positive value converged, see TSConvergedReason or the

manual pages for the individual convergence tests for complete lists

Level: beginner

-seealso: , TS, TSSolve(), TSConvergedReason

External Links

source
PETSc.LibPETSc.TSGetCostGradientsMethod
numcost::PetscInt = TSGetCostGradients(petsclib::PetscLibType,ts::TS, lambda::Vector{PetscVec}, mu::Vector{PetscVec})

Returns the gradients from the TSAdjointSolve()

Not Collective, but the vectors returned are parallel if TS is parallel

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameters:

  • numcost - size of returned arrays
  • lambda - vectors containing the gradients of the cost functions with respect to the ODE/DAE solution variables
  • mu - vectors containing the gradients of the cost functions with respect to the problem parameters

Level: intermediate

-seealso: , TS, TSAdjointSolve(), TSSetCostGradients()

External Links

source
PETSc.LibPETSc.TSGetCostHessianProductsMethod
numcost::PetscInt = TSGetCostHessianProducts(petsclib::PetscLibType,ts::TS, lambda2::Vector{PetscVec}, mu2::Vector{PetscVec}, dir::PetscVec)

Returns the gradients from the TSAdjointSolve()

Not Collective, but vectors returned are parallel if TS is parallel

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameters:

  • numcost - number of cost functions
  • lambda2 - 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 vector
  • mu2 - Hessian-vector product with respect to the parameters, the number of entries in these vectors is the same as the number of parameters
  • dir - the direction vector that are multiplied with the Hessian of the cost functions

Level: intermediate

-seealso: , TSAdjointSolve(), TSSetCostHessianProducts()

External Links

source
PETSc.LibPETSc.TSGetCostIntegralMethod
TSGetCostIntegral(petsclib::PetscLibType,ts::TS, v::PetscVec)

Returns the values of the integral term in the cost functions. It is valid to call the routine after a backward run.

Not Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameter:

  • v - the vector containing the integrals for each cost function

Level: intermediate

-seealso: , TS, TSAdjointSolve(), TSSetCostIntegrand()

External Links

source
PETSc.LibPETSc.TSGetDMMethod
dm::PetscDM = TSGetDM(petsclib::PetscLibType,ts::TS, dm::PetscDM)

Gets the DM that may be used by some preconditioners

Not Collective

Input Parameter:

  • ts - the TS

Output Parameter:

  • dm - the DM

Level: intermediate

-seealso: , TS, DM, TSSetDM(), SNESSetDM(), SNESGetDM()

External Links

source
PETSc.LibPETSc.TSGetEquationTypeMethod
equation_type::TSEquationType = TSGetEquationType(petsclib::PetscLibType,ts::TS)

Gets the type of the equation that TS is solving.

Not Collective

Input Parameter:

  • ts - the TS context

Output Parameter:

  • equation_type - see TSEquationType

Level: beginner

-seealso: , TS, TSSetEquationType(), TSEquationType

External Links

source
PETSc.LibPETSc.TSGetEvaluationSolutionsMethod
nsol::PetscInt,sol_times::Vector{PetscReal} = TSGetEvaluationSolutions(petsclib::PetscLibType,ts::TS, Sols::Vector{PetscVec})

Get the number of solutions and the solutions at the evaluation time points specified

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameters:

  • nsol - the number of solutions
  • sol_times - array of solution times corresponding to the solution vectors. See note below
  • Sols - the solution vectors

Level: intermediate

-seealso: , TS, TSSetEvaluationTimes(), TSGetEvaluationTimes()

External Links

source
PETSc.LibPETSc.TSGetEvaluationTimesMethod
n::PetscInt,time_points::Vector{PetscReal} = TSGetEvaluationTimes(petsclib::PetscLibType,ts::TS)

gets the evaluation times set with TSSetEvaluationTimes()

Not Collective

Input Parameter:

  • ts - the time-stepper

Output Parameters:

  • n - number of the time points
  • time_points - array of the time points

Level: beginner

-seealso: , TS, TSSetEvaluationTimes(), TSGetEvaluationSolutions()

External Links

source
PETSc.LibPETSc.TSGetExactFinalTimeMethod
TSGetExactFinalTime(petsclib::PetscLibType,ts::TS, eftopt::TSExactFinalTimeOption)

Gets the exact final time option set with TSSetExactFinalTime()

Not Collective

Input Parameter:

  • ts - the TS context

Output Parameter:

  • eftopt - exact final time option

Level: beginner

-seealso: , TS, TSExactFinalTimeOption, TSSetExactFinalTime()

External Links

source
PETSc.LibPETSc.TSGetI2FunctionMethod
TSGetI2Function(petsclib::PetscLibType,ts::TS, r::PetscVec, fun::TSI2FunctionFn, ctx::Cvoid)

Returns the vector where the implicit residual is stored and the function/context to compute it.

Not Collective

Input Parameter:

  • ts - the TS context

Output Parameters:

  • r - vector to hold residual (or NULL)
  • fun - the function to compute residual (or NULL)
  • ctx - the function context (or NULL)

Level: advanced

-seealso: , TS, TSSetIFunction(), SNESGetFunction(), TSCreate()

External Links

source
PETSc.LibPETSc.TSGetI2JacobianMethod
TSGetI2Jacobian(petsclib::PetscLibType,ts::TS, J::PetscMat, P::PetscMat, jac::TSI2JacobianFn, ctx::Cvoid)

Returns the implicit Jacobian at the present timestep.

Not Collective, but parallel objects are returned if TS is parallel

Input Parameter:

  • ts - The TS context obtained from TSCreate()

Output Parameters:

  • J - The (approximate) Jacobian of F(t,U,Ut,Utt)
  • P - The matrix from which the preconditioner is constructed, often the same as J
  • jac - The function to compute the Jacobian matrices
  • ctx - User-defined context for Jacobian evaluation routine

Level: advanced

-seealso: , TS, TSGetTimeStep(), TSGetMatrices(), TSGetTime(), TSGetStepNumber(), TSSetI2Jacobian(), TSGetI2Function(), TSCreate()

External Links

source
PETSc.LibPETSc.TSGetIFunctionMethod
TSGetIFunction(petsclib::PetscLibType,ts::TS, r::PetscVec, func::TSIFunctionFn, ctx::Cvoid)

Returns the vector where the implicit residual is stored and the function/context to compute it.

Not Collective

Input Parameter:

  • ts - the TS context

Output Parameters:

  • r - vector to hold residual (or NULL)
  • func - the function to compute residual (or NULL)
  • ctx - the function context (or NULL)

Level: advanced

-seealso: , TS, TSSetIFunction(), SNESGetFunction()

External Links

source
PETSc.LibPETSc.TSGetIJacobianMethod
TSGetIJacobian(petsclib::PetscLibType,ts::TS, Amat::PetscMat, Pmat::PetscMat, f::TSIJacobianFn, ctx::Cvoid)

Returns the implicit Jacobian at the present timestep.

Not Collective, but parallel objects are returned if ts is parallel

Input Parameter:

  • ts - The TS context obtained from TSCreate()

Output Parameters:

  • Amat - The (approximate) Jacobian of F(t,U,U_t)
  • Pmat - The matrix from which the preconditioner is constructed, often the same as Amat
  • f - The function to compute the matrices
  • ctx - User-defined context for Jacobian evaluation routine

Level: advanced

-seealso: , TS, TSGetTimeStep(), TSGetRHSJacobian(), TSGetMatrices(), TSGetTime(), TSGetStepNumber()

External Links

source
PETSc.LibPETSc.TSGetKSPMethod
TSGetKSP(petsclib::PetscLibType,ts::TS, ksp::PetscKSP)

Returns the KSP (linear solver) associated with a TS (timestepper) context.

Not Collective, but ksp is parallel if ts is parallel

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameter:

  • ksp - the nonlinear solver context

Level: beginner

-seealso: , TS, SNES, KSP, TSCreate(), TSSetUp(), TSSolve(), TSGetSNES()

External Links

source
PETSc.LibPETSc.TSGetKSPIterationsMethod
lits::PetscInt = TSGetKSPIterations(petsclib::PetscLibType,ts::TS)

Gets the total number of linear iterations used by the time integrator.

Not Collective

Input Parameter:

  • ts - TS context

Output Parameter:

  • lits - number of linear iterations

Level: intermediate

-seealso: , TS, TSSolve(), TSGetSNESIterations()

External Links

source
PETSc.LibPETSc.TSGetMaxStepsMethod
maxsteps::PetscInt = TSGetMaxSteps(petsclib::PetscLibType,ts::TS)

Gets the maximum number of steps to use.

Not Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameter:

  • maxsteps - maximum number of steps to use

Level: advanced

-seealso: , TS, TSSetMaxSteps(), TSGetMaxTime(), TSSetMaxTime()

External Links

source
PETSc.LibPETSc.TSGetMaxTimeMethod
maxtime::PetscReal = TSGetMaxTime(petsclib::PetscLibType,ts::TS)

Gets the maximum (or final) time for timestepping.

Not Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameter:

  • maxtime - final time to step to

Level: advanced

-seealso: , TS, TSSetMaxTime(), TSGetMaxSteps(), TSSetMaxSteps()

External Links

source
PETSc.LibPETSc.TSGetNumEventsMethod
nevents::PetscInt = TSGetNumEvents(petsclib::PetscLibType,ts::TS)

Get the number of events defined on the given MPI process

Logically Collective

Input Parameter:

  • ts - the TS context

Output Parameter:

  • nevents - the number of local events on each MPI process

Level: intermediate

-seealso: , TSEvent, TSSetEventHandler()

External Links

source
PETSc.LibPETSc.TSGetOptionsPrefixMethod
TSGetOptionsPrefix(petsclib::PetscLibType,ts::TS, prefix::String)

Sets the prefix used for searching for all TS options in the database.

Not Collective

Input Parameter:

  • ts - The TS context

Output Parameter:

  • prefix - A pointer to the prefix string used

Level: intermediate

-seealso: , TS, TSAppendOptionsPrefix(), TSSetFromOptions()

External Links

source
PETSc.LibPETSc.TSGetPrevTimeMethod
t::PetscReal = TSGetPrevTime(petsclib::PetscLibType,ts::TS)

Gets the starting time of the previously completed step.

Not Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameter:

  • t - the previous time

Level: beginner

-seealso: , TS, TSGetTime(), TSGetSolveTime(), TSGetTimeStep()

External Links

source
PETSc.LibPETSc.TSGetProblemTypeMethod
type::TSProblemType = TSGetProblemType(petsclib::PetscLibType,ts::TS)

Gets the type of problem to be solved.

Not collective

Input Parameter:

  • ts - The TS

Output Parameter:

  • type - One of TS_LINEAR, TS_NONLINEAR where these types refer to problems of the forms

-seealso: , TSSetUp(), TSProblemType, TS

External Links

source
PETSc.LibPETSc.TSGetQuadratureTSMethod
fwd::PetscBool = TSGetQuadratureTS(petsclib::PetscLibType,ts::TS, quadts::TS)

Return the sub

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameters:

  • fwd - flag indicating whether to evaluate cost integral in the forward run or the adjoint run
  • quadts - the child TS context

Level: intermediate

-seealso: , TSCreateQuadratureTS()

External Links

source
PETSc.LibPETSc.TSGetRHSFunctionMethod
TSGetRHSFunction(petsclib::PetscLibType,ts::TS, r::PetscVec, func::TSRHSFunctionFn, ctx::Cvoid)

Returns the vector where the right

Not Collective

Input Parameter:

  • ts - the TS context

Output Parameters:

  • r - vector to hold computed right-hand side (or NULL)
  • func - the function to compute right-hand side (or NULL)
  • ctx - the function context (or NULL)

Level: advanced

-seealso: , TS, TSSetRHSFunction(), SNESGetFunction()

External Links

source
PETSc.LibPETSc.TSGetRHSJacobianMethod
TSGetRHSJacobian(petsclib::PetscLibType,ts::TS, Amat::PetscMat, Pmat::PetscMat, func::TSRHSJacobianFn, ctx::Cvoid)

Returns the Jacobian J at the present timestep.

Not Collective, but parallel objects are returned if ts is parallel

Input Parameter:

  • ts - The TS context obtained from TSCreate()

Output Parameters:

  • Amat - The (approximate) Jacobian J of G, where U_t = G(U,t) (or NULL)
  • Pmat - The matrix from which the preconditioner is constructed, usually the same as Amat (or NULL)
  • func - Function to compute the Jacobian of the RHS (or NULL)
  • ctx - User-defined context for Jacobian evaluation routine (or NULL)

Level: intermediate

-seealso: , TS, TSGetTimeStep(), TSGetMatrices(), TSGetTime(), TSGetStepNumber()

External Links

source
PETSc.LibPETSc.TSGetRHSJacobianPMethod
TSGetRHSJacobianP(petsclib::PetscLibType,ts::TS, Amat::PetscMat, func::TSRHSJacobianPFn, ctx::Cvoid)

Gets the function that computes the Jacobian of G w.r.t. the parameters p where U_t = G(U,p,t), as well as the location to store the matrix.

Logically Collective

Input Parameter:

  • ts - TS context obtained from TSCreate()

Output Parameters:

  • Amat - JacobianP matrix
  • func - function
  • ctx - [optional] user-defined function context

Level: intermediate

-seealso: , TSSetRHSJacobianP(), TS, TSRHSJacobianPFn

External Links

source
PETSc.LibPETSc.TSGetRunStepsMethod
runsteps::PetscInt = TSGetRunSteps(petsclib::PetscLibType,ts::TS)

Gets the maximum number of steps to take in each call to TSSolve().

Not Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameter:

  • runsteps - maximum number of steps to take in each call to TSSolve.

Level: advanced

-seealso: , TS, TSSetRunSteps(), TSGetMaxTime(), TSSetMaxTime(), TSGetMaxSteps()

External Links

source
PETSc.LibPETSc.TSGetSNESMethod
TSGetSNES(petsclib::PetscLibType,ts::TS, snes::PetscSNES)

Returns the SNES (nonlinear solver) associated with a TS (timestepper) context. Valid only for nonlinear problems.

Not Collective, but snes is parallel if ts is parallel

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameter:

  • snes - the nonlinear solver context

Level: beginner

-seealso: , TS, SNES, TSCreate(), TSSetUp(), TSSolve()

External Links

source
PETSc.LibPETSc.TSGetSNESFailuresMethod
fails::PetscInt = TSGetSNESFailures(petsclib::PetscLibType,ts::TS)

Gets the total number of failed SNES solves in a TS

Not Collective

Input Parameter:

  • ts - TS context

Output Parameter:

  • fails - number of failed nonlinear solves

Level: intermediate

-seealso: , TS, TSSolve(), TSGetSNESIterations(), TSGetKSPIterations(), TSSetMaxStepRejections(), TSGetStepRejections(), TSSetMaxSNESFailures()

External Links

source
PETSc.LibPETSc.TSGetSNESIterationsMethod
nits::PetscInt = TSGetSNESIterations(petsclib::PetscLibType,ts::TS)

Gets the total number of nonlinear iterations used by the time integrator.

Not Collective

Input Parameter:

  • ts - TS context

Output Parameter:

  • nits - number of nonlinear iterations

Level: intermediate

-seealso: , TS, TSSolve(), TSGetKSPIterations()

External Links

source
PETSc.LibPETSc.TSGetSolutionMethod
TSGetSolution(petsclib::PetscLibType,ts::TS, v::PetscVec)

Returns the solution at the present timestep. It is valid to call this routine inside the function that you are evaluating in order to move to the new timestep. This vector not changed until the solution at the next timestep has been calculated.

Not Collective, but v returned is parallel if ts is parallel

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameter:

  • v - the vector containing the solution

Level: intermediate

-seealso: , TS, TSGetTimeStep(), TSGetTime(), TSGetSolveTime(), TSGetSolutionComponents(), TSSetSolutionFunction()

External Links

source
PETSc.LibPETSc.TSGetSolutionComponentsMethod
TSGetSolutionComponents(petsclib::PetscLibType,ts::TS, n::PetscInt, v::PetscVec)

Returns any solution components at the present timestep, if available for the time integration method being used. Solution components are quantities that share the same size and structure as the solution vector.

Not Collective, but v returned is parallel if ts is parallel

Input Parameters:

  • ts - the TS context obtained from TSCreate() (input parameter).
  • n - If v is NULL, then the number of solution components is

returned through n, else the n-th solution component is returned in v.

  • v - the vector containing the n-th solution component

(may be NULL to use this function to find out the number of solutions components).

Level: advanced

-seealso: , TS, TSGetSolution()

External Links

source
PETSc.LibPETSc.TSGetSolveTimeMethod
ftime::PetscReal = TSGetSolveTime(petsclib::PetscLibType,ts::TS)

Gets the time after a call to TSSolve()

Not Collective

Input Parameter:

  • ts - the TS context

Output Parameter:

  • ftime - the final time. This time corresponds to the final time set with TSSetMaxTime()

Level: beginner

-seealso: , TS, TSSolve(), TSConvergedReason

External Links

source
PETSc.LibPETSc.TSGetStagesMethod
ns::PetscInt = TSGetStages(petsclib::PetscLibType,ts::TS, Y::PetscVec)

Get the number of stages and stage values

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameters:

  • ns - the number of stages
  • Y - the current stage vectors

Level: advanced

-seealso: , TS, TSCreate()

External Links

source
PETSc.LibPETSc.TSGetStepNumberMethod
steps::PetscInt = TSGetStepNumber(petsclib::PetscLibType,ts::TS)

Gets the number of time steps completed.

Not Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameter:

  • steps - number of steps completed so far

Level: intermediate

-seealso: , TS, TSGetTime(), TSGetTimeStep(), TSSetPreStep(), TSSetPreStage(), TSSetPostStage(), TSSetPostStep()

External Links

source
PETSc.LibPETSc.TSGetStepRejectionsMethod
rejects::PetscInt = TSGetStepRejections(petsclib::PetscLibType,ts::TS)

Gets the total number of rejected steps.

Not Collective

Input Parameter:

  • ts - TS context

Output Parameter:

  • rejects - number of steps rejected

Level: intermediate

-seealso: , TS, TSSolve(), TSGetSNESIterations(), TSGetKSPIterations(), TSSetMaxStepRejections(), TSGetSNESFailures(), TSSetMaxSNESFailures(), TSSetErrorIfStepFails()

External Links

source
PETSc.LibPETSc.TSGetStepResizeMethod
flg::PetscBool = TSGetStepResize(petsclib::PetscLibType,ts::TS)

Get the internal flag indicating if the current step is after a resize.

Not collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameter:

  • flg - the resize flag

Level: advanced

-seealso: , TS, TSCreate(), TSSetResize()

External Links

source
PETSc.LibPETSc.TSGetStepRollBackMethod
flg::PetscBool = TSGetStepRollBack(petsclib::PetscLibType,ts::TS)

Get the internal flag indicating if you are rolling back a step

Not collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameter:

  • flg - the rollback flag

Level: advanced

-seealso: , TS, TSCreate(), TSRollBack()

External Links

source
PETSc.LibPETSc.TSGetTimeMethod
t::PetscReal = TSGetTime(petsclib::PetscLibType,ts::TS)

Gets the time of the most recently completed step.

Not Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameter:

  • t - the current time. This time may not corresponds to the final time set with TSSetMaxTime(), use TSGetSolveTime().

Level: beginner

-seealso: , TS, TSGetSolveTime(), TSSetTime(), TSGetTimeStep(), TSGetStepNumber()

External Links

source
PETSc.LibPETSc.TSGetTimeErrorMethod
TSGetTimeError(petsclib::PetscLibType,ts::TS, n::PetscInt, v::PetscVec)

Returns the estimated error vector, if the chosen TSType has an error estimation functionality and TSSetTimeError() was called

Not Collective, but v returned is parallel if ts is parallel

Input Parameters:

  • ts - the TS context obtained from TSCreate() (input parameter).
  • n - current estimate (n=0) or previous one (n=-1)
  • v - the vector containing the error (same size as the solution).

Level: intermediate

-seealso: , TSGetSolution(), TSSetTimeError()

External Links

source
PETSc.LibPETSc.TSGetTimeStepMethod
dt::PetscReal = TSGetTimeStep(petsclib::PetscLibType,ts::TS)

Gets the current timestep size.

Not Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameter:

  • dt - the current timestep size

Level: intermediate

-seealso: , TS, TSSetTimeStep(), TSGetTime()

External Links

source
PETSc.LibPETSc.TSGetTolerancesMethod
atol::PetscReal,rtol::PetscReal = TSGetTolerances(petsclib::PetscLibType,ts::TS, vatol::PetscVec, vrtol::PetscVec)

Get tolerances for local truncation error when using adaptive controller

Logically Collective

Input Parameter:

  • ts - time integration context

Output Parameters:

  • atol - scalar absolute tolerances, NULL to ignore
  • vatol - vector of absolute tolerances, NULL to ignore
  • rtol - scalar relative tolerances, NULL to ignore
  • vrtol - vector of relative tolerances, NULL to ignore

Level: beginner

-seealso: , TS, TSAdapt, TSErrorWeightedNorm(), TSSetTolerances()

External Links

source
PETSc.LibPETSc.TSGetTrajectoryMethod
TSGetTrajectory(petsclib::PetscLibType,ts::TS, tr::TSTrajectory)

Gets the trajectory from a TS if it exists

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameter:

  • tr - the TSTrajectory object, if it exists

Level: advanced

-seealso: , TS, TSTrajectory, TSAdjointSolve(), TSTrajectoryCreate()

External Links

source
PETSc.LibPETSc.TSGetTypeMethod
type::TSType = TSGetType(petsclib::PetscLibType,ts::TS)

Gets the TS method type (as a string) that is being used to solve the ODE with the given TS

Not Collective

Input Parameter:

  • ts - The TS

Output Parameter:

  • type - The TSType

Level: intermediate

-seealso: , TS, TSType, TSSetType()

External Links

source
PETSc.LibPETSc.TSGetUseSplitRHSFunctionMethod
use_splitrhsfnc::PetscBool = TSGetUseSplitRHSFunction(petsclib::PetscLibType,ts::TS)

Gets whether to use the split RHSFunction when a multirate method is used.

Not Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

  • use_splitrhsfunction - PETSC_TRUE indicates that the split RHSFunction will be used

Level: intermediate

-seealso: , TS, TSSetUseSplitRHSFunction()

External Links

source
PETSc.LibPETSc.TSHasTransientVariableMethod
has::PetscBool = TSHasTransientVariable(petsclib::PetscLibType,ts::TS)

determine whether transient variables have been set

Logically Collective

Input Parameter:

  • ts - TS on which to compute

Output Parameter:

  • has - PETSC_TRUE if transient variables have been set

Level: developer

-seealso: , TS, TSBDF, DMTSSetTransientVariable(), TSComputeTransientVariable()

External Links

source
PETSc.LibPETSc.TSIRKGetNumStagesMethod
TSIRKGetNumStages(petsclib::PetscLibType,ts::TS, nstages::PetscInt)

Get the number of stages of TSIRK scheme

Logically Collective

Input Parameters:

  • ts - timestepping context
  • nstages - number of stages of TSIRK scheme

Level: intermediate

-seealso: , TSIRKSetNumStages(), TSIRK

External Links

source
PETSc.LibPETSc.TSIRKGetTypeMethod
irktype::TSIRKType = TSIRKGetType(petsclib::PetscLibType,ts::TS)

Get the type of TSIRK IMEX scheme being used

Logically Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

  • irktype - type of TSIRK IMEX scheme

Level: intermediate

-seealso: , TSIRK, TSIRKType, TSIRKGAUSS

External Links

source
PETSc.LibPETSc.TSIRKInitializePackageMethod
TSIRKInitializePackage(petsclib::PetscLibType)

This function initializes everything in the TSIRK package. It is called from TSInitializePackage().

Level: developer

-seealso: , TSIRK, PetscInitialize(), TSIRKFinalizePackage(), TSInitializePackage()

External Links

source
PETSc.LibPETSc.TSIRKRegisterMethod
TSIRKRegister(petsclib::PetscLibType,sname::String, fnc::external)

adds a TSIRK implementation

Not Collective, No Fortran Support

Input Parameters:

  • sname - name of user-defined IRK scheme
  • function - function to create method context

Level: advanced

-seealso: , TSIRK, TSIRKRegisterAll()

External Links

source
PETSc.LibPETSc.TSIRKSetNumStagesMethod
TSIRKSetNumStages(petsclib::PetscLibType,ts::TS, nstages::PetscInt)

Set the number of stages of TSIRK scheme to use

Logically Collective

Input Parameters:

  • ts - timestepping context
  • nstages - number of stages of TSIRK scheme

Options Database Key:

  • -ts_irk_nstages <int> - set number of stages

Level: intermediate

-seealso: , TSIRKGetNumStages(), TSIRK

External Links

source
PETSc.LibPETSc.TSIRKSetTypeMethod
TSIRKSetType(petsclib::PetscLibType,ts::TS, irktype::TSIRKType)

Set the type of TSIRK scheme to use

Logically Collective

Input Parameters:

  • ts - timestepping context
  • irktype - type of TSIRK scheme

Options Database Key:

  • -ts_irk_type <gauss> - set irk type

Level: intermediate

-seealso: , TSIRKGetType(), TSIRK, TSIRKType, TSIRKGAUSS

External Links

source
PETSc.LibPETSc.TSIRKTableauCreateMethod
TSIRKTableauCreate(petsclib::PetscLibType,ts::TS, nstages::PetscInt, A::PetscReal, b::PetscReal, c::PetscReal, binterp::PetscReal, A_inv::PetscScalar, A_inv_rowsum::PetscScalar, I_s::PetscScalar)

create the tableau for TSIRK and provide the entries

Not Collective

Input Parameters:

  • ts - timestepping context
  • nstages - number of stages, this is the dimension of the matrices below
  • A - stage coefficients (dimension nstages*nstages, row-major)
  • b - step completion table (dimension nstages)
  • c - abscissa (dimension nstages)
  • binterp - coefficients of the interpolation formula (dimension nstages)
  • A_inv - inverse of A (dimension nstages*nstages, row-major)
  • A_inv_rowsum - row sum of the inverse of A (dimension nstages)
  • I_s - identity matrix (dimension nstages*nstages)

Level: advanced

-seealso: , TSIRK, TSIRKRegister()

External Links

source
PETSc.LibPETSc.TSInitializePackageMethod
TSInitializePackage(petsclib::PetscLibType)

This function initializes everything in the TS package. It is called from PetscDLLibraryRegister_petscts() when using dynamic libraries, and on the first call to TSCreate() when using shared or static libraries.

Level: developer

-seealso: , TS, PetscInitialize(), TSFinalizePackage()

External Links

source
PETSc.LibPETSc.TSInterpolateMethod
TSInterpolate(petsclib::PetscLibType,ts::TS, t::PetscReal, U::PetscVec)

Interpolate the solution computed during the previous step to an arbitrary location in the interval

Collective

Input Parameters:

  • ts - time stepping context
  • t - time to interpolate to

Output Parameter:

  • U - state at given time

Level: intermediate

-seealso: , TS, TSSetExactFinalTime(), TSSolve()

External Links

source
PETSc.LibPETSc.TSLoadMethod
TSLoad(petsclib::PetscLibType,ts::TS, viewer::PetscViewer)

Loads a TS that has been stored in binary with TSView().

Collective

Input Parameters:

  • ts - the newly loaded TS, this needs to have been created with TSCreate() or

some related function before a call to TSLoad().

  • viewer - binary file viewer, obtained from PetscViewerBinaryOpen()

Level: intermediate

-seealso: , TS, PetscViewer, PetscViewerBinaryOpen(), TSView(), MatLoad(), VecLoad()

External Links

source
PETSc.LibPETSc.TSMPRKGetTypeMethod
mprktype::TSMPRKType = TSMPRKGetType(petsclib::PetscLibType,ts::TS)

Get the type of TSMPRK scheme

Not Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

  • mprktype - type of TSMPRK scheme

Level: intermediate

-seealso: , TSMPRK

External Links

source
PETSc.LibPETSc.TSMPRKInitializePackageMethod
TSMPRKInitializePackage(petsclib::PetscLibType)

This function initializes everything in the TSMPRK package. It is called from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to TSCreate_MPRK() when using static libraries.

Level: developer

-seealso: , TSMPRK, PetscInitialize()

External Links

source
PETSc.LibPETSc.TSMPRKRegisterMethod
TSMPRKRegister(petsclib::PetscLibType,name::TSMPRKType, order::PetscInt, sbase::PetscInt, ratio1::PetscInt, ratio2::PetscInt, Asb::Vector{PetscReal}, bsb::Vector{PetscReal}, csb::Vector{PetscReal}, rsb::Vector{PetscInt}, Amb::Vector{PetscReal}, bmb::Vector{PetscReal}, cmb::Vector{PetscReal}, rmb::Vector{PetscInt}, Af::Vector{PetscReal}, bf::Vector{PetscReal}, cf::Vector{PetscReal})

register a TSMPRK scheme by providing the entries in the Butcher tableau

Not Collective, but the same schemes should be registered on all processes on which they will be used, No Fortran Support

Input Parameters:

  • name - identifier for method
  • order - approximation order of method
  • sbase - number of stages in the base methods
  • ratio1 - 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

-seealso: , TSMPRK

External Links

source
PETSc.LibPETSc.TSMPRKSetTypeMethod
TSMPRKSetType(petsclib::PetscLibType,ts::TS, mprktype::TSMPRKType)

Set the type of TSMPRK scheme

Not Collective

Input Parameters:

  • ts - timestepping context
  • mprktype - type of TSMPRK scheme

Options Database Key:

  • -ts_mprk_type - <pm2,p2,p3> - select the specific scheme

Level: intermediate

-seealso: , TSMPRKGetType(), TSMPRK, TSMPRKType

External Links

source
PETSc.LibPETSc.TSMonitorMethod
TSMonitor(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec)

Runs all user

Collective

Input Parameters:

  • ts - time stepping context obtained from TSCreate()
  • step - step number that has just completed
  • ptime - model time of the state
  • u - state at the current model time

Level: developer

-seealso: TS, TSMonitorSet(), TSMonitorSetFromOptions()

External Links

source
PETSc.LibPETSc.TSMonitorCancelMethod
TSMonitorCancel(petsclib::PetscLibType,ts::TS)

Clears all the monitors that have been set on a time

Logically Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Level: intermediate

-seealso: , TS, TSMonitorDefault(), TSMonitorSet()

External Links

source
PETSc.LibPETSc.TSMonitorDefaultMethod
TSMonitorDefault(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, v::PetscVec, vf::PetscViewerAndFormat)

The default monitor, prints the timestep and time for each step

Input Parameters:

  • ts - the TS context
  • step - 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 time
  • v - current iterate
  • vf - the viewer and format

Options Database Key:

  • -ts_monitor - monitors the time integration

Level: intermediate

-seealso: , TSMonitorSet(), TSDMSwarmMonitorMoments(), TSMonitorWallClockTime(), TSMonitorExtreme(), TSMonitorDrawSolution(), TSMonitorDrawSolutionPhase(), TSMonitorDrawSolutionFunction(), TSMonitorDrawError(), TSMonitorSolution(), TSMonitorSolutionVTK(), TSMonitorLGSolution(), TSMonitorLGError(), TSMonitorSPSwarmSolution(), TSMonitorError(), TSMonitorEnvelope()

External Links

source
PETSc.LibPETSc.TSMonitorDrawErrorMethod
TSMonitorDrawError(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, dummy::Cvoid)

Monitors progress of the TS solvers by calling VecView() for the error at each timestep

Collective

Input Parameters:

  • ts - the TS context
  • step - current time-step
  • ptime - current time
  • u - solution at current time
  • dummy - either a viewer or NULL

Options Database Key:

  • -ts_monitor_draw_error - Monitor error graphically, requires user to have provided TSSetSolutionFunction()

Level: intermediate

-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSSetSolutionFunction()

External Links

source
PETSc.LibPETSc.TSMonitorDrawSolutionMethod
TSMonitorDrawSolution(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, dummy::Cvoid)

Monitors progress of the TS solvers by calling VecView() for the solution at each timestep

Collective

Input Parameters:

  • ts - the TS context
  • step - current time-step
  • ptime - current time
  • u - the solution at the current time
  • dummy - either a viewer or NULL

Options Database Keys:

  • -ts_monitor_draw_solution - draw the solution at each time-step
  • -ts_monitor_draw_solution_initial - show initial solution as well as current solution

Level: intermediate

-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorDrawCtxCreate(), TSMonitorDrawCtxDestroy()

External Links

source
PETSc.LibPETSc.TSMonitorDrawSolutionFunctionMethod
TSMonitorDrawSolutionFunction(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, dummy::Cvoid)

Monitors progress of the TS solvers by calling VecView() for the solution provided by TSSetSolutionFunction() at each timestep

Collective

Input Parameters:

  • ts - the TS context
  • step - current time-step
  • ptime - current time
  • u - solution at current time
  • dummy - either a viewer or NULL

Options Database Key:

  • -ts_monitor_draw_solution_function - Monitor error graphically, requires user to have provided TSSetSolutionFunction()

Level: intermediate

-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSSetSolutionFunction()

External Links

source
PETSc.LibPETSc.TSMonitorDrawSolutionPhaseMethod
TSMonitorDrawSolutionPhase(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, dummy::Cvoid)

Monitors progress of the TS solvers by plotting the solution as a phase diagram

Collective

Input Parameters:

  • ts - the TS context
  • step - current time-step
  • ptime - current time
  • u - the solution at the current time
  • dummy - either a viewer or NULL

Level: intermediate

-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), VecView()

External Links

source
PETSc.LibPETSc.TSMonitorEnvelopeMethod
TSMonitorEnvelope(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, dctx::Cvoid)

Monitors the maximum and minimum value of each component of the solution

Collective

Input Parameters:

  • ts - the TS context
  • step - current time-step
  • ptime - current time
  • u - current solution
  • dctx - the envelope context

Options Database Key:

  • -ts_monitor_envelope - determine maximum and minimum value of each component of the solution over the solution time

Level: intermediate

-seealso: , TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorEnvelopeGetBounds(), TSMonitorEnvelopeCtxCreate()

External Links

source
PETSc.LibPETSc.TSMonitorEnvelopeGetBoundsMethod
TSMonitorEnvelopeGetBounds(petsclib::PetscLibType,ts::TS, max::PetscVec, min::PetscVec)

Gets the bounds for the components of the solution

Collective

Input Parameter:

  • ts - the TS context

Output Parameters:

  • max - the maximum values
  • min - the minimum values

Level: intermediate

-seealso: , TSMonitorEnvelopeCtx, TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorLGSetDisplayVariables()

External Links

source
PETSc.LibPETSc.TSMonitorErrorMethod
TSMonitorError(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, vf::PetscViewerAndFormat)

Monitors progress of the TS solvers by printing the 2 norm of the error at each timestep

Collective

Input Parameters:

  • ts - the TS context
  • step - current time-step
  • ptime - current time
  • u - current solution
  • vf - unused context

Options Database Key:

  • -ts_monitor_error - create a graphical monitor of error history

Level: intermediate

-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSSetSolutionFunction()

External Links

source
PETSc.LibPETSc.TSMonitorExtremeMethod
TSMonitorExtreme(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, v::PetscVec, vf::PetscViewerAndFormat)

Prints the extreme values of the solution at each timestep

Input Parameters:

  • ts - the TS context
  • step - 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 time
  • v - current iterate
  • vf - the viewer and format

Level: intermediate

-seealso: , TS, TSMonitorSet()

External Links

source
PETSc.LibPETSc.TSMonitorHGSwarmSolutionMethod
TSMonitorHGSwarmSolution(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, dctx::Cvoid)

Graphically displays histograms of DMSWARM particles

Input Parameters:

  • ts - the TS context
  • step - current time-step
  • ptime - current time
  • u - current solution
  • dctx - the TSMonitorSPCtx object that contains all the options for the monitoring, this is created with TSMonitorHGCtxCreate()

Options Database Keys:

  • -ts_monitor_hg_swarm <n> - Monitor the solution every n steps, or -1 for plotting only the final solution
  • -ts_monitor_hg_swarm_species <num> - Number of species to histogram
  • -ts_monitor_hg_swarm_bins <num> - Number of histogram bins
  • -ts_monitor_hg_swarm_velocity <bool> - Plot in velocity space, as opposed to coordinate space

Level: intermediate

-seealso: TSMonitorSet()

External Links

source
PETSc.LibPETSc.TSMonitorLGErrorMethod
TSMonitorLGError(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, dummy::Cvoid)

Monitors progress of the TS solvers by plotting each component of the error in a time based line graph

Collective

Input Parameters:

  • ts - the TS context
  • step - current time-step
  • ptime - current time
  • u - current solution
  • dummy - TSMonitorLGCtx object created with TSMonitorLGCtxCreate()

Options Database Key:

  • -ts_monitor_lg_error - create a graphical monitor of error history

Level: intermediate

-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSSetSolutionFunction()

External Links

source
PETSc.LibPETSc.TSMonitorLGGetVariableNamesMethod
TSMonitorLGGetVariableNames(petsclib::PetscLibType,ts::TS, names::Cchar)

Gets the name of each component in the solution vector so that it may be displayed in the plot

Collective

Input Parameter:

  • ts - the TS context

Output Parameter:

  • names - the names of the components, final string must be NULL

Level: intermediate

-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorLGSetDisplayVariables()

External Links

source
PETSc.LibPETSc.TSMonitorLGSetDisplayVariablesMethod
TSMonitorLGSetDisplayVariables(petsclib::PetscLibType,ts::TS, displaynames::Cchar)

Sets the variables that are to be display in the monitor

Collective

Input Parameters:

  • ts - the TS context
  • displaynames - the names of the components, final string must be NULL

Level: intermediate

-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorLGSetVariableNames()

External Links

source
PETSc.LibPETSc.TSMonitorLGSetTransformMethod
TSMonitorLGSetTransform(petsclib::PetscLibType,ts::TS, transform::external, destroy::PetscCtxDestroyFn, tctx::Cvoid)

Solution vector will be transformed by provided function before being displayed

Collective

Input Parameters:

  • ts - the TS context
  • transform - the transform function
  • destroy - function to destroy the optional context, see PetscCtxDestroyFn for its calling sequence
  • tctx - optional context used by transform function

Level: intermediate

-seealso: , TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorLGSetVariableNames(), TSMonitorLGCtxSetTransform(), PetscCtxDestroyFn

External Links

source
PETSc.LibPETSc.TSMonitorLGSetVariableNamesMethod
TSMonitorLGSetVariableNames(petsclib::PetscLibType,ts::TS, names::Cchar)

Sets the name of each component in the solution vector so that it may be displayed in the plot

Collective

Input Parameters:

  • ts - the TS context
  • names - the names of the components, final string must be NULL

Level: intermediate

-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorLGSetDisplayVariables(), TSMonitorLGCtxSetVariableNames()

External Links

source
PETSc.LibPETSc.TSMonitorLGSolutionMethod
TSMonitorLGSolution(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, dctx::Cvoid)

Monitors progress of the TS solvers by plotting each component of the solution vector in a time based line graph

Collective

Input Parameters:

  • ts - the TS context
  • step - current time-step
  • ptime - current time
  • u - current solution
  • dctx - the TSMonitorLGCtx object that contains all the options for the monitoring, this is created with TSMonitorLGCtxCreate()

Options Database Key:

  • -ts_monitor_lg_solution_variables - enable monitor of lg solution variables

Level: intermediate

-seealso: , TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorLGCtxCreate(), TSMonitorLGCtxSetVariableNames(), TSMonitorLGCtxGetVariableNames(), TSMonitorLGSetVariableNames(), TSMonitorLGGetVariableNames(), TSMonitorLGSetDisplayVariables(), TSMonitorLGCtxSetDisplayVariables(), TSMonitorLGCtxSetTransform(), TSMonitorLGSetTransform(), TSMonitorLGError(), TSMonitorLGSNESIterations(), TSMonitorLGKSPIterations(), TSMonitorEnvelopeCtxCreate(), TSMonitorEnvelopeGetBounds(), TSMonitorEnvelopeCtxDestroy(), TSMonitorEnvelop()

External Links

source
PETSc.LibPETSc.TSMonitorLGTimeStepMethod
TSMonitorLGTimeStep(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, v::PetscVec, monctx::Cvoid)

Monitors a TS by printing the time

Collective

Input Parameters:

  • ts - the time integrator
  • step - the current time step
  • ptime - the current time
  • v - the current state
  • monctx - the monitor context obtained with TSMonitorLGCtxCreate()

Level: advanced

-seealso: , TS, TSMonitorLGCtxCreate(), TSMonitorSet(), TSMonitorLGCtxDestroy()

External Links

source
PETSc.LibPETSc.TSMonitorSPSwarmSolutionMethod
TSMonitorSPSwarmSolution(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, dctx::Cvoid)

Graphically displays phase plots of DMSWARM particles on a scatter plot

Input Parameters:

  • ts - the TS context
  • step - current time-step
  • ptime - current time
  • u - current solution
  • dctx - the TSMonitorSPCtx object that contains all the options for the monitoring, this is created with TSMonitorSPCtxCreate()

Options Database Keys:

  • -ts_monitor_sp_swarm <n> - Monitor the solution every n steps, or -1 for plotting only the final solution
  • -ts_monitor_sp_swarm_retain <n> - Retain n old points so we can see the history, or -1 for all points
  • -ts_monitor_sp_swarm_multi_species <bool> - Color each species differently
  • -ts_monitor_sp_swarm_phase <bool> - Plot in phase space, as opposed to coordinate space

Level: intermediate

-seealso: , TS, TSMonitorSet(), DMSWARM, TSMonitorSPCtxCreate()

External Links

source
PETSc.LibPETSc.TSMonitorSetMethod
TSMonitorSet(petsclib::PetscLibType,ts::TS, monitor::external, mctx::Cvoid, mdestroy::PetscCtxDestroyFn)

Sets an ADDITIONAL function that is to be used at every timestep to display the iteration's progress.

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • monitor - monitoring routine
  • mctx - [optional] user-defined context for private data for the monitor routine (use NULL if no context is desired)
  • mdestroy - [optional] routine that frees monitor context (may be NULL), see PetscCtxDestroyFn for the calling sequence

Calling sequence of monitor:

  • ts - the TS context
  • steps - 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 time
  • u - current iterate
  • ctx - [optional] monitoring context

Level: intermediate

-seealso: , TSMonitorDefault(), TSMonitorCancel(), TSDMSwarmMonitorMoments(), TSMonitorExtreme(), TSMonitorDrawSolution(), TSMonitorDrawSolutionPhase(), TSMonitorDrawSolutionFunction(), TSMonitorDrawError(), TSMonitorSolution(), TSMonitorSolutionVTK(), TSMonitorLGSolution(), TSMonitorLGError(), TSMonitorSPSwarmSolution(), TSMonitorError(), TSMonitorEnvelope(), PetscCtxDestroyFn

External Links

source
PETSc.LibPETSc.TSMonitorSetFromOptionsMethod
TSMonitorSetFromOptions(petsclib::PetscLibType,ts::TS, name::String, help::String, manual::String, monitor::external, monitorsetup::external)

Sets a monitor function and viewer appropriate for the type indicated by the user

Collective

Input Parameters:

  • ts - TS object you wish to monitor
  • name - the monitor type one is seeking
  • help - message indicating what monitoring is done
  • manual - manual page for the monitor
  • monitor - the monitor function, this must use a PetscViewerFormat as its context
  • monitorsetup - a function that is called once ONLY if the user selected this monitor that may set additional features of the TS or PetscViewer objects

Level: developer

-seealso: , TS, TSMonitorSet(), PetscOptionsCreateViewer(), PetscOptionsGetReal(), PetscOptionsHasName(), PetscOptionsGetString(), PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsBool() PetscOptionsInt(), PetscOptionsString(), PetscOptionsReal(), PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHeadBegin(), PetscOptionsStringArray(), PetscOptionsRealArray(), PetscOptionsScalar(), PetscOptionsBoolGroupBegin(), PetscOptionsBoolGroup(), PetscOptionsBoolGroupEnd(), PetscOptionsFList(), PetscOptionsEList()

External Links

source
PETSc.LibPETSc.TSMonitorSolutionMethod
TSMonitorSolution(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, vf::PetscViewerAndFormat)

Monitors progress of the TS solvers by VecView() for the solution at each timestep. Normally the viewer is a binary file or a PetscDraw object

Collective

Input Parameters:

  • ts - the TS context
  • step - current time-step
  • ptime - current time
  • u - current state
  • vf - viewer and its format

Level: intermediate

-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorSolutionSetup(),

External Links

source
PETSc.LibPETSc.TSMonitorSolutionSetupMethod
TSMonitorSolutionSetup(petsclib::PetscLibType,ts::TS, vf::PetscViewerAndFormat)

Setups the context for TSMonitorSolution()

Collective

Input Parameters:

  • ts - the TS context
  • vf - viewer and its format

Level: intermediate

-seealso: , TS, TSMonitorSolution(), TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorSetFromOptions()

External Links

source
PETSc.LibPETSc.TSMonitorSolutionVTKMethod
TSMonitorSolutionVTK(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, ctx::TSMonitorVTKCtx)

Monitors progress of the TS solvers by VecView() for the solution at selected timesteps.

Collective

Input Parameters:

  • ts - the TS context
  • step - current time-step
  • ptime - current time
  • u - current state
  • ctx - monitor context obtained with TSMonitorSolutionVTKCtxCreate()

Level: developer

-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), VecView()

External Links

source
PETSc.LibPETSc.TSMonitorSolutionVTKCtxCreateMethod
ctx::TSMonitorVTKCtx = TSMonitorSolutionVTKCtxCreate(petsclib::PetscLibType,filenametemplate::String)

Create the monitor context to be used in TSMonitorSolutionVTK()

Not collective

Input Parameter:

  • filenametemplate - the template file name, e.g. foo-%03d.vts

Output Parameter:

  • ctx - the monitor context

Level: developer

-seealso: , TSMonitorSet(), TSMonitorSolutionVTK(), TSMonitorSolutionVTKDestroy()

External Links

source
PETSc.LibPETSc.TSMonitorWallClockTimeMethod
TSMonitorWallClockTime(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, v::PetscVec, vf::PetscViewerAndFormat)

Monitor wall

Input Parameters:

  • ts - the TS context
  • step - 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 time
  • v - current solution
  • vf - the viewer and format

Options Database Key:

  • -ts_monitor_wall_clock_time - Monitor wall-clock time, KSP iterations, and SNES iterations per step.

Level: intermediate

-seealso: , TSMonitorSet(), TSMonitorDefault(), TSMonitorExtreme(), TSMonitorDrawSolution(), TSMonitorDrawSolutionPhase(), TSMonitorDrawSolutionFunction(), TSMonitorDrawError(), TSMonitorSolution(), TSMonitorSolutionVTK(), TSMonitorLGSolution(), TSMonitorLGError(), TSMonitorSPSwarmSolution(), TSMonitorError(), TSMonitorEnvelope(), TSDMSwarmMonitorMoments()

External Links

source
PETSc.LibPETSc.TSPostEvaluateMethod
TSPostEvaluate(petsclib::PetscLibType,ts::TS)

Runs the user

Collective

Input Parameter:

  • ts - The TS context obtained from TSCreate()

Level: developer

-seealso: , TS, TSSetPostEvaluate(), TSSetPreStep(), TSPreStep(), TSPostStep()

External Links

source
PETSc.LibPETSc.TSPostStageMethod
TSPostStage(petsclib::PetscLibType,ts::TS, stagetime::PetscReal, stageindex::PetscInt, Y::Vector{PetscVec})

Runs the user

Collective

Input Parameters:

  • ts - The TS context obtained from TSCreate()
  • stagetime - The absolute time of the current stage
  • stageindex - Stage number
  • Y - Array of vectors (of size = total number of stages) with the stage solutions

Level: developer

-seealso: , TS, TSPreStage(), TSSetPreStep(), TSPreStep(), TSPostStep()

External Links

source
PETSc.LibPETSc.TSPostStepMethod
TSPostStep(petsclib::PetscLibType,ts::TS)

Runs the user

Collective

Input Parameter:

  • ts - The TS context obtained from TSCreate()

-seealso: , TS, TSSetPreStep(), TSSetPreStage(), TSSetPostEvaluate(), TSGetTimeStep(), TSGetStepNumber(), TSGetTime(), TSSetPostStep()

External Links

source
PETSc.LibPETSc.TSPreStageMethod
TSPreStage(petsclib::PetscLibType,ts::TS, stagetime::PetscReal)

Runs the user

Collective

Input Parameters:

  • ts - The TS context obtained from TSCreate()
  • stagetime - The absolute time of the current stage

Level: developer

-seealso: , TS, TSPostStage(), TSSetPreStep(), TSPreStep(), TSPostStep()

External Links

source
PETSc.LibPETSc.TSPreStepMethod
TSPreStep(petsclib::PetscLibType,ts::TS)

Runs the user

Collective

Input Parameter:

  • ts - The TS context obtained from TSCreate()

Level: developer

-seealso: , TS, TSSetPreStep(), TSPreStage(), TSPostStage(), TSPostStep()

External Links

source
PETSc.LibPETSc.TSPruneIJacobianColorMethod
TSPruneIJacobianColor(petsclib::PetscLibType,ts::TS, J::PetscMat, B::PetscMat)

Remove nondiagonal zeros in the Jacobian matrix and update the MatMFFD coloring information.

Collective

Input Parameters:

  • ts - the TS context
  • J - Jacobian matrix (not altered in this routine)
  • B - newly computed Jacobian matrix to use with preconditioner

Level: intermediate

-seealso: , TS, MatFDColoring, TSComputeIJacobianDefaultColor(), MatEliminateZeros(), MatFDColoringCreate(), MatFDColoringSetFunction()

External Links

source
PETSc.LibPETSc.TSPseudoComputeTimeStepMethod
dt::PetscReal = TSPseudoComputeTimeStep(petsclib::PetscLibType,ts::TS)

Computes the next timestep for a currently running pseudo-timestepping process.

Collective

Input Parameter:

  • ts - timestep context

Output Parameter:

  • dt - newly computed timestep

Level: developer

-seealso: , TSPSEUDO, TSPseudoTimeStepDefault(), TSPseudoSetTimeStep()

External Links

source
PETSc.LibPETSc.TSPseudoIncrementDtFromInitialDtMethod
TSPseudoIncrementDtFromInitialDt(petsclib::PetscLibType,ts::TS)

Indicates that a new timestep is computed via the formula dt = initialdt*initialfnorm/currentfnorm rather than the default update, dt = currentdt*previousfnorm/currentfnorm.

Logically Collective

Input Parameter:

  • ts - the timestep context

Options Database Key:

  • -ts_pseudo_increment_dt_from_initial_dt <true,false> - use the initial dt to determine increment

Level: advanced

-seealso: , TSPSEUDO, TSPseudoSetTimeStep(), TSPseudoTimeStepDefault()

External Links

source
PETSc.LibPETSc.TSPseudoSetMaxTimeStepMethod
TSPseudoSetMaxTimeStep(petsclib::PetscLibType,ts::TS, maxdt::PetscReal)

Sets the maximum time step when using the TSPseudoTimeStepDefault() routine.

Logically Collective

Input Parameters:

  • ts - the timestep context
  • maxdt - the maximum time step, use a non-positive value to deactivate

Options Database Key:

  • -ts_pseudo_max_dt <increment> - set pseudo max dt

Level: advanced

-seealso: , TSPSEUDO, TSPseudoSetTimeStep(), TSPseudoTimeStepDefault()

External Links

source
PETSc.LibPETSc.TSPseudoSetTimeStepMethod
TSPseudoSetTimeStep(petsclib::PetscLibType,ts::TS, dt::external, ctx::Cvoid)

Sets the user called at each pseudo-timestep to update the timestep.

Logically Collective

Input Parameters:

  • ts - timestep context
  • dt - function to compute timestep
  • ctx - [optional] user-defined context for private data required by the function (may be NULL)

Calling sequence of dt:

  • ts - the TS context
  • newdt - the newly computed timestep
  • ctx - [optional] user-defined context

Level: intermediate

-seealso: , TSPSEUDO, TSPseudoTimeStepDefault(), TSPseudoComputeTimeStep()

External Links

source
PETSc.LibPETSc.TSPseudoSetTimeStepIncrementMethod
TSPseudoSetTimeStepIncrement(petsclib::PetscLibType,ts::TS, inc::PetscReal)

Sets the scaling increment applied to dt when using the TSPseudoTimeStepDefault() routine.

Logically Collective

Input Parameters:

  • ts - the timestep context
  • inc - the scaling factor >= 1.0

Options Database Key:

  • -ts_pseudo_increment <increment> - set pseudo increment

Level: advanced

-seealso: , TSPSEUDO, TSPseudoSetTimeStep(), TSPseudoTimeStepDefault()

External Links

source
PETSc.LibPETSc.TSPseudoSetVerifyTimeStepMethod
TSPseudoSetVerifyTimeStep(petsclib::PetscLibType,ts::TS, dt::external, ctx::Cvoid)

Sets a user last timestep.

Logically Collective

Input Parameters:

  • ts - timestep context
  • dt - user-defined function to verify timestep
  • ctx - [optional] user-defined context for private data for the timestep verification routine (may be NULL)

Calling sequence of func:

  • ts - the time-step context
  • update - latest solution vector
  • ctx - [optional] user-defined timestep context
  • newdt - the timestep to use for the next step
  • flag - flag indicating whether the last time step was acceptable

Level: advanced

-seealso: , TSPSEUDO, TSPseudoVerifyTimeStepDefault(), TSPseudoVerifyTimeStep()

External Links

source
PETSc.LibPETSc.TSPseudoTimeStepDefaultMethod
newdt::PetscReal = TSPseudoTimeStepDefault(petsclib::PetscLibType,ts::TS, dtctx::Cvoid)

Default code to compute pseudo

Collective, No Fortran Support

Input Parameters:

  • ts - the timestep context
  • dtctx - unused timestep context

Output Parameter:

  • newdt - the timestep to use for the next step

Level: advanced

-seealso: , TSPseudoSetTimeStep(), TSPseudoComputeTimeStep(), TSPSEUDO

External Links

source
PETSc.LibPETSc.TSPseudoVerifyTimeStepMethod
dt::PetscReal,flag::PetscBool = TSPseudoVerifyTimeStep(petsclib::PetscLibType,ts::TS, update::PetscVec)

Verifies whether the last timestep was acceptable.

Collective

Input Parameters:

  • ts - timestep context
  • update - latest solution vector

Output Parameters:

  • dt - newly computed timestep (if it had to shrink)
  • flag - indicates if current timestep was ok

Level: advanced

-seealso: , TSPSEUDO, TSPseudoSetVerifyTimeStep(), TSPseudoVerifyTimeStepDefault()

External Links

source
PETSc.LibPETSc.TSPseudoVerifyTimeStepDefaultMethod
newdt::PetscReal,flag::PetscBool = TSPseudoVerifyTimeStepDefault(petsclib::PetscLibType,ts::TS, update::PetscVec, dtctx::Cvoid)

Default code to verify the quality of the last timestep.

Collective, No Fortran Support

Input Parameters:

  • ts - the timestep context
  • dtctx - unused timestep context
  • update - latest solution vector

Output Parameters:

  • newdt - the timestep to use for the next step
  • flag - flag indicating whether the last time step was acceptable

Level: advanced

-seealso: , TSPSEUDO, TSPseudoSetVerifyTimeStep(), TSPseudoVerifyTimeStep()

External Links

source
PETSc.LibPETSc.TSPythonGetTypeMethod
pyname::String = TSPythonGetType(petsclib::PetscLibType,ts::TS)

Get the type of a TS object implemented in Python.

Not Collective

Input Parameter:

  • ts - the TS context

Output Parameter:

  • pyname - full dotted Python name [package].module[.{class|function}]

Level: intermediate

-seealso: , TSCreate(), TSSetType(), TSPYTHON, PetscPythonInitialize(), TSPythonSetType()

External Links

source
PETSc.LibPETSc.TSPythonSetTypeMethod
TSPythonSetType(petsclib::PetscLibType,ts::TS, pyname::String)

Initialize a TS object implemented in Python.

Collective

Input Parameters:

  • ts - the TS context
  • pyname - full dotted Python name [package].module[.{class|function}]

Options Database Key:

  • -ts_python_type <pyname> - python class

Level: intermediate

-seealso: , TSCreate(), TSSetType(), TSPYTHON, PetscPythonInitialize()

External Links

source
PETSc.LibPETSc.TSRHSJacobianSetReuseMethod
TSRHSJacobianSetReuse(petsclib::PetscLibType,ts::TS, reuse::PetscBool)

restore the RHS Jacobian before calling the user

Logically Collective

Input Parameters:

  • ts - TS context obtained from TSCreate()
  • reuse - PETSC_TRUE if the RHS Jacobian

Level: intermediate

-seealso: , TS, TSSetRHSJacobian(), TSComputeRHSJacobianConstant()

External Links

source
PETSc.LibPETSc.TSRHSJacobianTestMethod
flg::PetscBool = TSRHSJacobianTest(petsclib::PetscLibType,ts::TS)

Compares the multiply routine provided to the MATSHELL with differencing on the TS given RHS function.

Logically Collective

Input Parameter:

  • ts - the time stepping routine

Output Parameter:

  • flg - PETSC_TRUE if the multiply is likely correct

Options Database Key:

  • -ts_rhs_jacobian_test_mult -mat_shell_test_mult_view - run the test at each timestep of the integrator

Level: advanced

-seealso: , TS, Mat, MATSHELL, MatCreateShell(), MatShellGetContext(), MatShellGetOperation(), MatShellTestMultTranspose(), TSRHSJacobianTestTranspose()

External Links

source
PETSc.LibPETSc.TSRHSJacobianTestTransposeMethod
flg::PetscBool = TSRHSJacobianTestTranspose(petsclib::PetscLibType,ts::TS)

Compares the multiply transpose routine provided to the MATSHELL with differencing on the TS given RHS function.

Logically Collective

Input Parameter:

  • ts - the time stepping routine

Output Parameter:

  • flg - PETSC_TRUE if the multiply is likely correct

Options Database Key:

  • -ts_rhs_jacobian_test_mult_transpose -mat_shell_test_mult_transpose_view - run the test at each timestep of the integrator

Level: advanced

-seealso: , TS, Mat, MatCreateShell(), MatShellGetContext(), MatShellGetOperation(), MatShellTestMultTranspose(), TSRHSJacobianTest()

External Links

source
PETSc.LibPETSc.TSRHSSplitGetISMethod
TSRHSSplitGetIS(petsclib::PetscLibType,ts::TS, splitname::String, is::IS)

Retrieves the elements for a split as an IS

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • splitname - name of this split

Output Parameter:

  • is - the index set for part of the solution vector

Level: intermediate

-seealso: , TS, IS, TSRHSSplitSetIS()

External Links

source
PETSc.LibPETSc.TSRHSSplitGetSNESMethod
TSRHSSplitGetSNES(petsclib::PetscLibType,ts::TS, snes::PetscSNES)

Returns the SNES (nonlinear solver) associated with a TS (timestepper) context when RHS splits are used.

Not Collective, but snes is parallel if ts is parallel

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameter:

  • snes - the nonlinear solver context

Level: intermediate

-seealso: , TS, SNES, TSCreate(), TSRHSSplitSetSNES()

External Links

source
PETSc.LibPETSc.TSRHSSplitGetSubTSMethod
TSRHSSplitGetSubTS(petsclib::PetscLibType,ts::TS, splitname::String, subts::TS)

Get the sub

Logically Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameters:

  • splitname - the number of the split
  • subts - the sub-TS

Level: advanced

-seealso: , TS, IS, TSGetRHSSplitFunction()

External Links

source
PETSc.LibPETSc.TSRHSSplitGetSubTSsMethod
n::PetscInt = TSRHSSplitGetSubTSs(petsclib::PetscLibType,ts::TS, subts::Vector{TS})

Get an array of all sub

Logically Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameters:

  • n - the number of splits
  • subts - the array of TS contexts

Level: advanced

-seealso: , TS, IS, TSGetRHSSplitFunction()

External Links

source
PETSc.LibPETSc.TSRHSSplitSetIFunctionMethod
TSRHSSplitSetIFunction(petsclib::PetscLibType,ts::TS, splitname::String, r::PetscVec, ifunc::TSIFunctionFn, ctx::Cvoid)

Set the split implicit function for TSARKIMEX

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • splitname - name of this split
  • r - vector to hold the residual (or NULL to have it created internally)
  • ifunc - the implicit function evaluation routine
  • ctx - user-defined context for private data for the split function evaluation routine (may be NULL)

Level: intermediate

-seealso: , TS, TSIFunctionFn, IS, TSRHSSplitSetIS(), TSARKIMEX

External Links

source
PETSc.LibPETSc.TSRHSSplitSetIJacobianMethod
TSRHSSplitSetIJacobian(petsclib::PetscLibType,ts::TS, splitname::String, Amat::PetscMat, Pmat::PetscMat, ijac::TSIJacobianFn, ctx::Cvoid)

Set the Jacobian for the split implicit function with TSARKIMEX

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • splitname - name of this split
  • Amat - (approximate) matrix to store Jacobian entries computed by f
  • Pmat - matrix used to compute preconditioner (usually the same as Amat)
  • ijac - the Jacobian evaluation routine
  • ctx - user-defined context for private data for the split function evaluation routine (may be NULL)

Level: intermediate

-seealso: , TS, TSRHSSplitSetIFunction, TSIJacobianFn, IS, TSRHSSplitSetIS()

External Links

source
PETSc.LibPETSc.TSRHSSplitSetISMethod
TSRHSSplitSetIS(petsclib::PetscLibType,ts::TS, splitname::String, is::IS)

Set the index set for the specified split

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • splitname - name of this split, if NULL the number of the split is used
  • is - the index set for part of the solution vector

Level: intermediate

-seealso: , TS, IS, TSRHSSplitGetIS()

External Links

source
PETSc.LibPETSc.TSRHSSplitSetRHSFunctionMethod
TSRHSSplitSetRHSFunction(petsclib::PetscLibType,ts::TS, splitname::String, r::PetscVec, rhsfunc::TSRHSFunctionFn, ctx::Cvoid)

Set the split right

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • splitname - name of this split
  • r - vector to hold the residual (or NULL to have it created internally)
  • rhsfunc - the RHS function evaluation routine
  • ctx - user-defined context for private data for the split function evaluation routine (may be NULL)

Level: intermediate

-seealso: , TS, TSRHSFunctionFn, IS, TSRHSSplitSetIS()

External Links

source
PETSc.LibPETSc.TSRHSSplitSetSNESMethod
TSRHSSplitSetSNES(petsclib::PetscLibType,ts::TS, snes::PetscSNES)

Set the SNES (nonlinear solver) to be used by the timestepping context when RHS splits are used.

Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • snes - the nonlinear solver context

Level: intermediate

-seealso: , TS, SNES, TSCreate(), TSRHSSplitGetSNES()

External Links

source
PETSc.LibPETSc.TSRKGetMultirateMethod
use_multirate::PetscBool = TSRKGetMultirate(petsclib::PetscLibType,ts::TS)

Gets whether to use the interpolation

Not Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

  • use_multirate - PETSC_TRUE if the multirate RK method is enabled, PETSC_FALSE otherwise

Level: intermediate

-seealso: , TSRK, TSRKSetMultirate()

External Links

source
PETSc.LibPETSc.TSRKGetOrderMethod
order::PetscInt = TSRKGetOrder(petsclib::PetscLibType,ts::TS)

Get the order of the TSRK scheme

Not Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

  • order - order of TSRK scheme

Level: intermediate

-seealso: , TSRK, TSRKGetType()

External Links

source
PETSc.LibPETSc.TSRKGetTableauMethod
s::PetscInt,A::PetscReal,b::PetscReal,c::PetscReal,bembed::PetscReal,p::PetscInt,binterp::PetscReal,FSAL::PetscBool = TSRKGetTableau(petsclib::PetscLibType,ts::TS)

Get info on the TSRK tableau

Not Collective

Input Parameter:

  • ts - timestepping context

Output Parameters:

  • s - number of stages, this is the dimension of the matrices below
  • A - stage coefficients (dimension s*s, row-major)
  • b - step completion table (dimension s)
  • c - abscissa (dimension s)
  • bembed - completion table for embedded method (dimension s; NULL if not available)
  • p - Order of the interpolation scheme, equal to the number of columns of binterp
  • binterp - Coefficients of the interpolation formula (dimension s*p)
  • FSAL - whether or not the scheme has the First Same As Last property

Level: developer

-seealso: , TSRK, TSRKRegister(), TSRKSetType()

External Links

source
PETSc.LibPETSc.TSRKGetTypeMethod
rktype::TSRKType = TSRKGetType(petsclib::PetscLibType,ts::TS)

Get the type of TSRK scheme

Not Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

  • rktype - type of TSRK-scheme

Level: intermediate

-seealso: , TSRKSetType()

External Links

source
PETSc.LibPETSc.TSRKInitializePackageMethod
TSRKInitializePackage(petsclib::PetscLibType)

This function initializes everything in the TSRK package. It is called from TSInitializePackage().

Level: developer

-seealso: , TSInitializePackage(), PetscInitialize(), TSRKFinalizePackage()

External Links

source
PETSc.LibPETSc.TSRKRegisterMethod
TSRKRegister(petsclib::PetscLibType,name::TSRKType, order::PetscInt, s::PetscInt, A::Vector{PetscReal}, b::Vector{PetscReal}, c::Vector{PetscReal}, bembed::Vector{PetscReal}, p::PetscInt, binterp::Vector{PetscReal})

register an TSRK scheme by providing the entries in the Butcher tableau and optionally embedded approximations and interpolation

Not Collective, but the same schemes should be registered on all processes on which they will be used, No Fortran Support

Input Parameters:

  • name - identifier for method
  • order - approximation order of method
  • s - number of stages, this is the dimension of the matrices below
  • A - stage coefficients (dimension s*s, row-major)
  • b - step completion table (dimension s; NULL to use last row of A)
  • c - abscissa (dimension s; NULL to use row sums of A)
  • bembed - completion table for embedded method (dimension s; NULL if not available)
  • p - Order of the interpolation scheme, equal to the number of columns of binterp
  • binterp - Coefficients of the interpolation formula (dimension s*p; NULL to reuse b with p=1)

Level: advanced

-seealso: , TSRK

External Links

source
PETSc.LibPETSc.TSRKSetMultirateMethod
TSRKSetMultirate(petsclib::PetscLibType,ts::TS, use_multirate::PetscBool)

Use the interpolation

Logically Collective

Input Parameters:

  • ts - timestepping context
  • use_multirate - PETSC_TRUE enables the multirate TSRK method, sets the basic method to be RK2A and sets the ratio between slow stepsize and fast stepsize to be 2

Options Database Key:

  • -ts_rk_multirate - <true,false>

Level: intermediate

-seealso: , TSRK, TSRKGetMultirate()

External Links

source
PETSc.LibPETSc.TSRKSetTypeMethod
TSRKSetType(petsclib::PetscLibType,ts::TS, rktype::TSRKType)

Set the type of the TSRK scheme

Logically Collective

Input Parameters:

  • ts - timestepping context
  • rktype - type of TSRK scheme

Options Database Key:

  • -ts_rk_type - <1fe,2a,3,3bs,4,5f,5dp,5bs>

Level: intermediate

-seealso: , TSRKGetType(), TSRK, TSRKType, TSRK1FE, TSRK2A, TSRK2B, TSRK3, TSRK3BS, TSRK4, TSRK5F, TSRK5DP, TSRK5BS, TSRK6VR, TSRK7VR, TSRK8VR

External Links

source
PETSc.LibPETSc.TSRegisterMethod
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 routine
  • function - The creation routine itself

Level: advanced

-seealso: , TSSetType(), TSType, TSRegisterAll(), TSRegisterDestroy()

External Links

source
PETSc.LibPETSc.TSRemoveTrajectoryMethod
TSRemoveTrajectory(petsclib::PetscLibType,ts::TS)

Destroys and removes the internal TSTrajectory object from a TS

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Level: intermediate

-seealso: , TSTrajectory, TSResetTrajectory(), TSAdjointSolve()

External Links

source
PETSc.LibPETSc.TSResetMethod
TSReset(petsclib::PetscLibType,ts::TS)

Resets a TS context to the state it was in before TSSetUp() was called and removes any allocated Vec and Mat from its data structures

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Level: developer

-seealso: , TS, TSCreate(), TSSetUp(), TSDestroy(), TSSetResize()

External Links

source
PETSc.LibPETSc.TSResetTrajectoryMethod
TSResetTrajectory(petsclib::PetscLibType,ts::TS)

Destroys and recreates the internal TSTrajectory object

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Level: intermediate

-seealso: , TSTrajectory, TSGetTrajectory(), TSAdjointSolve(), TSRemoveTrajectory()

External Links

source
PETSc.LibPETSc.TSResizeMethod
TSResize(petsclib::PetscLibType,ts::TS)

Runs the user

Collective

Input Parameter:

  • ts - The TS context obtained from TSCreate()

Level: developer

-seealso: , TS, TSSetResize()

External Links

source
PETSc.LibPETSc.TSResizeRegisterVecMethod
TSResizeRegisterVec(petsclib::PetscLibType,ts::TS, name::String, vec::PetscVec)

Register a vector to be transferred with TSResize().

Collective

Input Parameters:

  • ts - The TS context obtained from TSCreate()
  • name - A string identifying the vector
  • vec - The vector

Level: developer

-seealso: , TS, TSSetResize(), TSResize(), TSResizeRetrieveVec()

External Links

source
PETSc.LibPETSc.TSResizeRetrieveVecMethod
TSResizeRetrieveVec(petsclib::PetscLibType,ts::TS, name::String, vec::PetscVec)

Retrieve a vector registered with TSResizeRegisterVec().

Collective

Input Parameters:

  • ts - The TS context obtained from TSCreate()
  • name - A string identifying the vector
  • vec - The vector

Level: developer

-seealso: , TS, TSSetResize(), TSResize(), TSResizeRegisterVec()

External Links

source
PETSc.LibPETSc.TSRestartStepMethod
TSRestartStep(petsclib::PetscLibType,ts::TS)

Flags the solver to restart the next step

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Level: advanced

-seealso: , TS, TSBDF, TSSolve(), TSSetPreStep(), TSSetPostStep()

External Links

source
PETSc.LibPETSc.TSRollBackMethod
TSRollBack(petsclib::PetscLibType,ts::TS)

Rolls back one time step

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Level: advanced

-seealso: , TS, TSGetStepRollBack(), TSCreate(), TSSetUp(), TSDestroy(), TSSolve(), TSSetPreStep(), TSSetPreStage(), TSInterpolate()

External Links

source
PETSc.LibPETSc.TSRosWGetTypeMethod
rostype::TSRosWType = TSRosWGetType(petsclib::PetscLibType,ts::TS)

Get the type of Rosenbrock

Logically Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

  • rostype - type of Rosenbrock-W scheme

Level: intermediate

-seealso: , TSRosWType, TSRosWSetType()

External Links

source
PETSc.LibPETSc.TSRosWRegisterMethod
TSRosWRegister(petsclib::PetscLibType,name::TSRosWType, order::PetscInt, s::PetscInt, A::Vector{PetscReal}, Gamma::Vector{PetscReal}, b::Vector{PetscReal}, bembed::Vector{PetscReal}, pinterp::PetscInt, binterpt::Vector{PetscReal})

register a TSROSW, Rosenbrock W scheme by providing the entries in the Butcher tableau and optionally embedded approximations and interpolation

Not Collective, but the same schemes should be registered on all processes on which they will be used

Input Parameters:

  • name - identifier for method
  • order - approximation order of method
  • s - number of stages, this is the dimension of the matrices below
  • A - Table of propagated stage coefficients (dimension s*s, row-major), strictly lower triangular
  • Gamma - Table of coefficients in implicit stage equations (dimension s*s, row-major), lower triangular with nonzero diagonal
  • b - 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 binterpt
  • binterpt - Coefficients of the interpolation formula (dimension s*pinterp)

Level: advanced

-seealso: , TSROSW

External Links

source
PETSc.LibPETSc.TSRosWRegisterRos4Method
TSRosWRegisterRos4(petsclib::PetscLibType,name::TSRosWType, gamma::PetscReal, a2::PetscReal, a3::PetscReal, b3::PetscReal, e4::PetscReal)

register a fourth order Rosenbrock scheme by providing parameter choices

Not Collective, but the same schemes should be registered on all processes on which they will be used

Input Parameters:

  • name - identifier for method
  • gamma - leading coefficient (diagonal entry)
  • a2 - design parameter, see Table 7.2 of {cite}wanner1996solving
  • a3 - design parameter or PETSC_DETERMINE to satisfy one of the order five conditions (Eq 7.22)
  • b3 - design parameter, see Table 7.2 of {cite}wanner1996solving
  • e4 - design parameter for embedded method, see coefficient E4 in ros4.f code from Hairer

Level: developer

-seealso: , TSROSW, TSRosWRegister()

External Links

source
PETSc.LibPETSc.TSRosWSetRecomputeJacobianMethod
TSRosWSetRecomputeJacobian(petsclib::PetscLibType,ts::TS, flg::PetscBool)

Set whether to recompute the Jacobian at each stage. The default is to update the Jacobian once per step.

Logically Collective

Input Parameters:

  • ts - timestepping context
  • flg - PETSC_TRUE to recompute the Jacobian at each stage

Level: intermediate

-seealso: , TSRosWType, TSRosWGetType()

External Links

source
PETSc.LibPETSc.TSRosWSetTypeMethod
TSRosWSetType(petsclib::PetscLibType,ts::TS, roswtype::TSRosWType)

Set the type of Rosenbrock

Logically Collective

Input Parameters:

  • ts - timestepping context
  • roswtype - type of Rosenbrock-W scheme

Level: beginner

-seealso: , TSRosWGetType(), TSROSW, TSROSW2M, TSROSW2P, TSROSWRA3PW, TSROSWRA34PW2, TSROSWRODAS3, TSROSWSANDU3, TSROSWASSP3P3S1C, TSROSWLASSP3P4S2C, TSROSWLLSSP3P4S2C, TSROSWARK3

External Links

source
PETSc.LibPETSc.TSSSPFinalizePackageMethod
TSSSPFinalizePackage(petsclib::PetscLibType)

This function destroys everything in the TSSSP package. It is called from PetscFinalize().

Level: developer

-seealso: , PetscFinalize(), TSSSPInitiallizePackage(), TSInitializePackage()

External Links

source
PETSc.LibPETSc.TSSSPGetNumStagesMethod
nstages::PetscInt = TSSSPGetNumStages(petsclib::PetscLibType,ts::TS)

get the number of stages in the TSSSP time integration scheme

Logically Collective

Input Parameter:

  • ts - time stepping object

Output Parameter:

  • nstages - number of stages

Level: beginner

-seealso: , TSSSP, TSSSPGetType(), TSSSPSetNumStages(), TSSSPRKS2, TSSSPRKS3, TSSSPRK104

External Links

source
PETSc.LibPETSc.TSSSPGetTypeMethod
type::TSSSPType = TSSSPGetType(petsclib::PetscLibType,ts::TS)

get the TSSSP time integration scheme

Logically Collective

Input Parameter:

  • ts - time stepping object

Output Parameter:

  • type - type of scheme being used

Level: beginner

-seealso: , TSSSP, TSSSPSetType(), TSSSPSetNumStages(), TSSSPRKS2, TSSSPRKS3, TSSSPRK104

External Links

source
PETSc.LibPETSc.TSSSPInitializePackageMethod
TSSSPInitializePackage(petsclib::PetscLibType)

This function initializes everything in the TSSSP package. It is called from TSInitializePackage().

Level: developer

-seealso: , PetscInitialize(), TSSSPFinalizePackage(), TSInitializePackage()

External Links

source
PETSc.LibPETSc.TSSSPSetNumStagesMethod
TSSSPSetNumStages(petsclib::PetscLibType,ts::TS, nstages::PetscInt)

set the number of stages to use with the TSSSP method. Must be called after TSSSPSetType().

Logically Collective

Input Parameters:

  • ts - time stepping object
  • nstages - number of stages

Options Database Keys:

  • -ts_ssp_type <rks2> - Type of TSSSP method (one of) rks2 rks3 rk104
  • -ts_ssp_nstages<rks2: 5, rks3: 9> - Number of stages

Level: beginner

-seealso: , TSSSP, TSSSPGetNumStages(), TSSSPRKS2, TSSSPRKS3, TSSSPRK104

External Links

source
PETSc.LibPETSc.TSSSPSetTypeMethod
TSSSPSetType(petsclib::PetscLibType,ts::TS, ssptype::TSSSPType)

set the TSSSP time integration scheme to use

Logically Collective

Input Parameters:

  • ts - time stepping object
  • ssptype - type of scheme to use

Options Database Keys:

  • -ts_ssp_type <rks2> - Type of TSSSP method (one of) rks2 rks3 rk104
  • -ts_ssp_nstages<rks2: 5, rks3: 9> - Number of stages

Level: beginner

-seealso: , TSSSP, TSSSPGetType(), TSSSPSetNumStages(), TSSSPRKS2, TSSSPRKS3, TSSSPRK104

External Links

source
PETSc.LibPETSc.TSSetApplicationContextMethod
TSSetApplicationContext(petsclib::PetscLibType,ts::TS, ctx::PeCtx)

Sets an optional user TS callbacks with TSGetApplicationContext()

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • ctx - user context

Level: intermediate

-seealso: , TS, TSGetApplicationContext()

External Links

source
PETSc.LibPETSc.TSSetCFLTimeLocalMethod
TSSetCFLTimeLocal(petsclib::PetscLibType,ts::TS, cfltime::PetscReal)

Set the local CFL constraint relative to forward Euler

Logically Collective

Input Parameters:

  • ts - time stepping context
  • cfltime - maximum stable time step if using forward Euler (value can be different on each process)

-seealso: , TSGetCFLTime(), TSADAPTCFL

External Links

source
PETSc.LibPETSc.TSSetComputeExactErrorMethod
TSSetComputeExactError(petsclib::PetscLibType,ts::TS, exactError::external)

Set the function used to automatically compute the exact error for the timestepping.

Logically collective

Input Parameters:

  • ts - time stepping context
  • exactError - The function which computes the solution error

Calling sequence of exactError:

  • ts - The timestepping context
  • u - The approximate solution vector
  • e - The vector in which the error is stored

Level: advanced

-seealso: , TS, TSGetComputeExactError(), TSComputeExactError()

External Links

source
PETSc.LibPETSc.TSSetComputeInitialConditionMethod
TSSetComputeInitialCondition(petsclib::PetscLibType,ts::TS, initCondition::external)

Set the function used to automatically compute an initial condition for the timestepping.

Logically collective

Input Parameters:

  • ts - time stepping context
  • initCondition - The function which computes an initial condition

Calling sequence of initCondition:

  • ts - The timestepping context
  • e - The input vector in which the initial condition is to be stored

Level: advanced

-seealso: , TS, TSGetComputeInitialCondition(), TSComputeInitialCondition()

External Links

source
PETSc.LibPETSc.TSSetConvergedReasonMethod
TSSetConvergedReason(petsclib::PetscLibType,ts::TS, reason::TSConvergedReason)

Sets the reason for handling the convergence of TSSolve().

Logically Collective; reason must contain common value

Input Parameters:

  • ts - the TS context
  • reason - negative value indicates diverged, positive value converged, see TSConvergedReason or the

manual pages for the individual convergence tests for complete lists

Level: advanced

-seealso: , TS, TSSolve(), TSConvergedReason

External Links

source
PETSc.LibPETSc.TSSetCostGradientsMethod
TSSetCostGradients(petsclib::PetscLibType,ts::TS, numcost::PetscInt, lambda::Vector{PetscVec}, mu::Vector{PetscVec})

Sets the initial value of the gradients of the cost function w.r.t. initial values and w.r.t. the problem parameters for use by the TS adjoint routines.

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • numcost - number of gradients to be computed, this is the number of cost functions
  • lambda - gradients with respect to the initial condition variables, the dimension and parallel layout of these vectors is the same as the ODE solution vector
  • mu - gradients with respect to the parameters, the number of entries in these vectors is the same as the number of parameters

Level: beginner

-seealso: TS, TSAdjointSolve(), TSGetCostGradients()

External Links

source
PETSc.LibPETSc.TSSetCostHessianProductsMethod
TSSetCostHessianProducts(petsclib::PetscLibType,ts::TS, numcost::PetscInt, lambda2::Vector{PetscVec}, mu2::Vector{PetscVec}, dir::PetscVec)

Sets the initial value of the Hessian for use by the TS adjoint routines.

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • numcost - number of cost functions
  • lambda2 - 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 vector
  • mu2 - Hessian-vector product with respect to the parameters, the number of entries in these vectors is the same as the number of parameters
  • dir - the direction vector that are multiplied with the Hessian of the cost functions

Level: beginner

-seealso: , TS, TSAdjointSolve(), TSAdjointSetForward()

External Links

source
PETSc.LibPETSc.TSSetDMMethod
TSSetDM(petsclib::PetscLibType,ts::TS, dm::PetscDM)

Sets the DM that may be used by some nonlinear solvers or preconditioners under the TS

Logically Collective

Input Parameters:

  • ts - the TS integrator object
  • dm - the dm, cannot be NULL

Level: intermediate

-seealso: , TS, DM, TSGetDM(), SNESSetDM(), SNESGetDM()

External Links

source
PETSc.LibPETSc.TSSetEquationTypeMethod
TSSetEquationType(petsclib::PetscLibType,ts::TS, equation_type::TSEquationType)

Sets the type of the equation that TS is solving.

Not Collective

Input Parameters:

  • ts - the TS context
  • equation_type - see TSEquationType

Level: advanced

-seealso: , TS, TSGetEquationType(), TSEquationType

External Links

source
PETSc.LibPETSc.TSSetErrorIfStepFailsMethod
TSSetErrorIfStepFails(petsclib::PetscLibType,ts::TS, err::PetscBool)

Immediately error if no step succeeds during TSSolve()

Not Collective

Input Parameters:

  • ts - TS context
  • err - PETSC_TRUE to error if no step succeeds, PETSC_FALSE to return without failure

Options Database Key:

  • -ts_error_if_step_fails - Error if no step succeeds

Level: intermediate

-seealso: , TS, TSGetSNESIterations(), TSGetKSPIterations(), TSSetMaxStepRejections(), TSGetStepRejections(), TSGetSNESFailures(), TSGetConvergedReason()

External Links

source
PETSc.LibPETSc.TSSetEvaluationTimesMethod
TSSetEvaluationTimes(petsclib::PetscLibType,ts::TS, n::PetscInt, time_points::Vector{PetscReal})

sets the evaluation points. The solution will be computed and stored for each time requested

Collective

Input Parameters:

  • ts - the time-stepper
  • n - number of the time points
  • time_points - array of the time points, must be increasing

Options Database Key:

  • -ts_eval_times <t0,...tn> - Sets the evaluation times

Level: intermediate

-seealso: , TS, TSGetEvaluationTimes(), TSGetEvaluationSolutions(), TSSetTimeSpan()

External Links

source
PETSc.LibPETSc.TSSetEventHandlerMethod
TSSetEventHandler(petsclib::PetscLibType,ts::TS, nevents::PetscInt, direction::Vector{PetscInt}, terminate::Vector{PetscBool}, indicator::external, postevent::external, ctx::Cvoid)

Sets functions and parameters used for indicating events and handling them

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • 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 (see direction) mark presence of the events
  • postevent - [optional] user post-event callback; it can change the solution, ODE etc at the time of the event
  • ctx - [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 - the TS context
  • t - current time
  • U - current solution
  • fvalue - output array with values of local indicator functions (length == nevents) for time t and state-vector U
  • ctx - the context passed as the final argument to TSSetEventHandler()

Calling sequence of postevent:

  • ts - the TS context
  • nevents_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 events
  • t - current time
  • U - current solution
  • forwardsolve - flag to indicate whether TS is doing a forward solve (PETSC_TRUE) or adjoint solve (PETSC_FALSE)
  • ctx - the context passed as the final argument to TSSetEventHandler()

Options Database Keys:

  • -ts_event_tol <tol> - tolerance for zero crossing check of indicator functions
  • -ts_event_monitor - print choices made by event handler
  • -ts_event_recorder_initial_size <recsize> - initial size of event recorder
  • -ts_event_post_event_step <dt1> - first time step after event
  • -ts_event_post_event_second_step <dt2> - second time step after event
  • -ts_event_dt_min <dt> - minimum time step considered for TSEvent

Level: intermediate

-seealso: , TSEvent, TSCreate(), TSSetTimeStep(), TSSetConvergedReason()

External Links

source
PETSc.LibPETSc.TSSetEventTolerancesMethod
TSSetEventTolerances(petsclib::PetscLibType,ts::TS, tol::PetscReal, vtol::Vector{PetscReal})

Set tolerances for event (indicator function) zero crossings

Logically Collective

Input Parameters:

  • ts - time integration context
  • tol - tolerance, PETSC_CURRENT to leave the current value
  • vtol - array of tolerances or NULL, used in preference to tol if present

Options Database Key:

  • -ts_event_tol <tol> - tolerance for event (indicator function) zero crossing

Level: beginner

-seealso: , TS, TSEvent, TSSetEventHandler()

External Links

source
PETSc.LibPETSc.TSSetExactFinalTimeMethod
TSSetExactFinalTime(petsclib::PetscLibType,ts::TS, eftopt::TSExactFinalTimeOption)

Determines whether to adapt the final time step to match the exact final time, to interpolate the solution to the exact final time, or to just return at the final time TS computed (which may be slightly larger than the requested final time).

Logically Collective

Input Parameters:

  • ts - the time-step context
  • eftopt - exact final time option

-seealso: , TS, TSExactFinalTimeOption, TSGetExactFinalTime()

External Links

source
PETSc.LibPETSc.TSSetForcingFunctionMethod
TSSetForcingFunction(petsclib::PetscLibType,ts::TS, func::TSForcingFn, ctx::Cvoid)

Provide a function that computes a forcing term for a ODE or PDE

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • func - routine for evaluating the forcing function
  • ctx - [optional] user-defined context for private data for the function evaluation routine

(may be NULL)

Level: intermediate

-seealso: , TS, TSForcingFn, TSSetRHSJacobian(), TSSetIJacobian(), TSComputeSolutionFunction(), TSSetSolutionFunction()

External Links

source
PETSc.LibPETSc.TSSetFromOptionsMethod
TSSetFromOptions(petsclib::PetscLibType,ts::TS)

Sets various TS parameters from the options database

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Options Database Keys:

  • -ts_type <type> - EULER, BEULER, SUNDIALS, PSEUDO, CN, RK, THETA, ALPHA, GLLE, SSP, GLEE, BSYMP, IRK, see TSType
  • -ts_save_trajectory - checkpoint the solution at each time-step
  • -ts_max_time <time> - maximum time to compute to
  • -ts_time_span <t0,...tf> - sets the time span, solutions are computed and stored for each indicated time, inittime and maxtime are set
  • -ts_eval_times <t0,...tn> - time points where solutions are computed and stored for each indicated time
  • -ts_max_steps <steps> - maximum time-step number to execute until (possibly with nonzero starting value)
  • -ts_run_steps <steps> - maximum number of time steps for TSSolve to take on each call
  • -ts_init_time <time> - initial time to start computation
  • -ts_final_time <time> - final time to compute to (deprecated: use -ts_max_time)
  • -ts_dt <dt> - initial time step
  • -ts_exact_final_time <stepover,interpolate,matchstep> - whether to stop at the exact given final time and how to compute the solution at that time
  • -ts_max_snes_failures <maxfailures> - Maximum number of nonlinear solve failures allowed
  • -ts_max_reject <maxrejects> - Maximum number of step rejections before step fails
  • -ts_error_if_step_fails <true,false> - Error if no step succeeds
  • -ts_rtol <rtol> - relative tolerance for local truncation error
  • -ts_atol <atol> - Absolute tolerance for local truncation error
  • -ts_rhs_jacobian_test_mult -mat_shell_test_mult_view - test the Jacobian at each iteration against finite difference with RHS function
  • -ts_rhs_jacobian_test_mult_transpose - test the Jacobian at each iteration against finite difference with RHS function
  • -ts_adjoint_solve <yes,no> - After solving the ODE/DAE solve the adjoint problem (requires -ts_save_trajectory)
  • -ts_fd_color - Use finite differences with coloring to compute IJacobian
  • -ts_monitor - print information at each timestep
  • -ts_monitor_cancel - Cancel all monitors
  • -ts_monitor_wall_clock_time - Monitor wall-clock time, KSP iterations, and SNES iterations per step
  • -ts_monitor_lg_solution - Monitor solution graphically
  • -ts_monitor_lg_error - Monitor error graphically
  • -ts_monitor_error - Monitors norm of error
  • -ts_monitor_lg_timestep - Monitor timestep size graphically
  • -ts_monitor_lg_timestep_log - Monitor log timestep size graphically
  • -ts_monitor_lg_snes_iterations - Monitor number nonlinear iterations for each timestep graphically
  • -ts_monitor_lg_ksp_iterations - Monitor number nonlinear iterations for each timestep graphically
  • -ts_monitor_sp_eig - Monitor eigenvalues of linearized operator graphically
  • -ts_monitor_draw_solution - Monitor solution graphically
  • -ts_monitor_draw_solution_phase <xleft,yleft,xright,yright> - Monitor solution graphically with phase diagram, requires problem with exactly 2 degrees of freedom
  • -ts_monitor_draw_error - Monitor error graphically, requires use to have provided TSSetSolutionFunction()
  • -ts_monitor_solution [ascii binary draw][:filename][:viewerformat] - monitors the solution at each timestep
  • -ts_monitor_solution_interval <interval> - output once every interval (default=1) time steps. Use -1 to only output at the end of the simulation
  • -ts_monitor_solution_skip_initial - skip writing of initial condition
  • -ts_monitor_solution_vtk <filename.vts,filename.vtu> - Save each time step to a binary file, use filename-%%03" PetscIntFMT ".vts (filename-%%03" PetscIntFMT ".vtu)
  • -ts_monitor_solution_vtk_interval <interval> - output once every interval (default=1) time steps. Use -1 to only output at the end of the simulation
  • -ts_monitor_envelope - determine maximum and minimum value of each component of the solution over the solution time

Level: beginner

-seealso: , TS, TSGetType()

External Links

source
PETSc.LibPETSc.TSSetFunctionDomainErrorMethod
TSSetFunctionDomainError(petsclib::PetscLibType,ts::TS, func::external)

Set a function that tests if the current state vector is valid

Logically collective

Input Parameters:

  • ts - the TS context
  • func - function called within TSFunctionDomainError()

Calling sequence of func:

  • ts - the TS context
  • time - the current time (of the stage)
  • state - the state to check if it is valid
  • accept - (output parameter) PETSC_FALSE if the state is not acceptable, PETSC_TRUE if acceptable

Level: intermediate

-seealso: , TSAdaptCheckStage(), TSFunctionDomainError(), SNESSetFunctionDomainError(), TSGetSNES()

External Links

source
PETSc.LibPETSc.TSSetI2FunctionMethod
TSSetI2Function(petsclib::PetscLibType,ts::TS, F::PetscVec, fun::TSI2FunctionFn, ctx::Cvoid)

Set the function to compute F(t,U,Ut,Utt) where F = 0 is the DAE to be solved.

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • F - vector to hold the residual (or NULL to have it created internally)
  • fun - the function evaluation routine
  • ctx - user-defined context for private data for the function evaluation routine (may be NULL)

Level: beginner

-seealso: , TS, TSI2FunctionFn, TSSetI2Jacobian(), TSSetIFunction(), TSCreate(), TSSetRHSFunction()

External Links

source
PETSc.LibPETSc.TSSetI2JacobianMethod
TSSetI2Jacobian(petsclib::PetscLibType,ts::TS, J::PetscMat, P::PetscMat, jac::TSI2JacobianFn, ctx::Cvoid)

Set the function to compute the matrix dF/dU + vdF/dU_t + adF/dUtt where F(t,U,Ut,U_tt) is the function you provided with TSSetI2Function().

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • J - matrix to hold the Jacobian values
  • P - matrix for constructing the preconditioner (may be same as J)
  • jac - the Jacobian evaluation routine, see TSI2JacobianFn for the calling sequence
  • ctx - user-defined context for private data for the Jacobian evaluation routine (may be NULL)

Level: beginner

-seealso: , TS, TSI2JacobianFn, TSSetI2Function(), TSGetI2Jacobian()

External Links

source
PETSc.LibPETSc.TSSetIFunctionMethod
TSSetIFunction(petsclib::PetscLibType,ts::TS, r::PetscVec, f::TSIFunctionFn, ctx::Cvoid)

Set the function to compute F(t,U,U_t) where F() = 0 is the DAE to be solved.

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • r - vector to hold the residual (or NULL to have it created internally)
  • f - the function evaluation routine
  • ctx - user-defined context for private data for the function evaluation routine (may be NULL)

Level: beginner

-seealso: , TS, TSIFunctionFn, TSSetRHSJacobian(), TSSetRHSFunction(), TSSetIJacobian()

External Links

source
PETSc.LibPETSc.TSSetIHessianProductMethod
TSSetIHessianProduct(petsclib::PetscLibType,ts::TS, ihp1::PetscVec, ihessianproductfunc1::external, ihp2::PetscVec, ihessianproductfunc2::external, ihp3::PetscVec, ihessianproductfunc3::external, ihp4::PetscVec, ihessianproductfunc4::external, ctx::Cvoid)

Sets the function that computes the vector

Logically Collective

Input Parameters:

  • ts - TS context obtained from TSCreate()
  • ihp1 - an array of vectors storing the result of vector-Hessian-vector product for F_UU
  • hessianproductfunc1 - vector-Hessian-vector product function for F_UU
  • ihp2 - an array of vectors storing the result of vector-Hessian-vector product for F_UP
  • hessianproductfunc2 - vector-Hessian-vector product function for F_UP
  • ihp3 - an array of vectors storing the result of vector-Hessian-vector product for F_PU
  • hessianproductfunc3 - vector-Hessian-vector product function for F_PU
  • ihp4 - an array of vectors storing the result of vector-Hessian-vector product for F_PP
  • hessianproductfunc4 - vector-Hessian-vector product function for F_PP

Calling sequence of ihessianproductfunc1:

  • ts - the TS context
  • t - current timestep
  • U - input vector (current ODE solution)
  • Vl - an array of input vectors to be left-multiplied with the Hessian
  • Vr - input vector to be right-multiplied with the Hessian
  • VHV - an array of output vectors for vector-Hessian-vector product
  • ctx - [optional] user-defined function context

Level: intermediate

-seealso: , TS

External Links

source
PETSc.LibPETSc.TSSetIJacobianMethod
TSSetIJacobian(petsclib::PetscLibType,ts::TS, Amat::PetscMat, Pmat::PetscMat, f::TSIJacobianFn, ctx::Cvoid)

Set the function to compute the matrix dF/dU + a*dF/dUt where F(t,U,Ut) is the function provided with TSSetIFunction().

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • Amat - (approximate) matrix to store Jacobian entries computed by f
  • Pmat - matrix used to compute preconditioner (usually the same as Amat)
  • f - the Jacobian evaluation routine
  • ctx - user-defined context for private data for the Jacobian evaluation routine (may be NULL)

Level: beginner

-seealso: , TS, TSIJacobianFn, TSSetIFunction(), TSSetRHSJacobian(), SNESComputeJacobianDefaultColor(), SNESComputeJacobianDefault(), TSSetRHSFunction()

External Links

source
PETSc.LibPETSc.TSSetIJacobianPMethod
TSSetIJacobianP(petsclib::PetscLibType,ts::TS, Amat::PetscMat, func::external, ctx::Cvoid)

Sets the function that computes the Jacobian of F w.r.t. the parameters p where F(Udot,U,p,t) = G(U,p,t), as well as the location to store the matrix.

Logically Collective

Input Parameters:

  • ts - TS context obtained from TSCreate()
  • Amat - JacobianP matrix
  • func - function
  • ctx - [optional] user-defined function context

Calling sequence of func:

  • ts - the TS context
  • t - current timestep
  • U - input vector (current ODE solution)
  • Udot - time derivative of state vector
  • shift - shift to apply, see the note in TSSetIJacobian()
  • A - output matrix
  • ctx - [optional] user-defined function context

Level: intermediate

-seealso: , TSSetRHSJacobianP(), TS

External Links

source
PETSc.LibPETSc.TSSetMatStructureMethod
TSSetMatStructure(petsclib::PetscLibType,ts::TS, str::MatStructure)

sets the relationship between the nonzero structure of the RHS Jacobian matrix to the IJacobian matrix.

Logically Collective

Input Parameters:

  • ts - the time-stepper
  • str - the structure (the default is UNKNOWN_NONZERO_PATTERN)

Level: intermediate

-seealso: , TS, MatAXPY(), MatStructure

External Links

source
PETSc.LibPETSc.TSSetMaxSNESFailuresMethod
TSSetMaxSNESFailures(petsclib::PetscLibType,ts::TS, fails::PetscInt)

Sets the maximum number of failed SNES solves

Not Collective

Input Parameters:

  • ts - TS context
  • fails - maximum number of failed nonlinear solves, pass PETSC_UNLIMITED to allow any number of failures.

Options Database Key:

  • -ts_max_snes_failures - Maximum number of nonlinear solve failures

Level: intermediate

-seealso: , TS, SNES, TSGetSNESIterations(), TSGetKSPIterations(), TSSetMaxStepRejections(), TSGetStepRejections(), TSGetSNESFailures(), SNESGetConvergedReason(), TSGetConvergedReason()

External Links

source
PETSc.LibPETSc.TSSetMaxStepRejectionsMethod
TSSetMaxStepRejections(petsclib::PetscLibType,ts::TS, rejects::PetscInt)

Sets the maximum number of step rejections before a time step fails

Not Collective

Input Parameters:

  • ts - TS context
  • rejects - maximum number of rejected steps, pass PETSC_UNLIMITED for unlimited

Options Database Key:

  • -ts_max_reject - Maximum number of step rejections before a step fails

Level: intermediate

-seealso: , TS, SNES, TSGetSNESIterations(), TSGetKSPIterations(), TSSetMaxSNESFailures(), TSGetStepRejections(), TSGetSNESFailures(), TSSetErrorIfStepFails(), TSGetConvergedReason()

External Links

source
PETSc.LibPETSc.TSSetMaxStepsMethod
TSSetMaxSteps(petsclib::PetscLibType,ts::TS, maxsteps::PetscInt)

Sets the maximum number of steps to use.

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • maxsteps - maximum number of steps to use

Options Database Key:

  • -ts_max_steps <maxsteps> - Sets maxsteps

Level: intermediate

-seealso: , TS, TSGetMaxSteps(), TSSetMaxTime(), TSSetExactFinalTime()

External Links

source
PETSc.LibPETSc.TSSetMaxTimeMethod
TSSetMaxTime(petsclib::PetscLibType,ts::TS, maxtime::PetscReal)

Sets the maximum (or final) time for timestepping.

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • maxtime - final time to step to

Options Database Key:

  • -ts_max_time <maxtime> - Sets maxtime

Level: intermediate

-seealso: , TS, TSGetMaxTime(), TSSetMaxSteps(), TSSetExactFinalTime()

External Links

source
PETSc.LibPETSc.TSSetOptionsPrefixMethod
TSSetOptionsPrefix(petsclib::PetscLibType,ts::TS, prefix::String)

Sets the prefix used for searching for all TS options in the database.

Logically Collective

Input Parameters:

  • ts - The TS context
  • prefix - The prefix to prepend to all option names

Level: advanced

-seealso: , TS, TSSetFromOptions(), TSAppendOptionsPrefix()

External Links

source
PETSc.LibPETSc.TSSetPostEvaluateMethod
TSSetPostEvaluate(petsclib::PetscLibType,ts::TS, func::external)

Sets the general called at the end of each step evaluation.

Logically Collective

Input Parameters:

  • ts - The TS context obtained from TSCreate()
  • func - The function

Calling sequence of func:

  • ts - the TS context

Level: intermediate

-seealso: , TS, TSSetPreStage(), TSSetPreStep(), TSSetPostStep(), TSGetApplicationContext()

External Links

source
PETSc.LibPETSc.TSSetPostEventSecondStepMethod
TSSetPostEventSecondStep(petsclib::PetscLibType,ts::TS, dt2::PetscReal)

Set the second time step to use after the event

Logically Collective

Input Parameters:

  • ts - time integration context
  • dt2 - second post event step

Options Database Key:

  • -ts_event_post_event_second_step <dt2> - second time step after the event

Level: advanced

-seealso: , TS, TSEvent, TSSetEventHandler(), TSSetPostEventStep()

External Links

source
PETSc.LibPETSc.TSSetPostEventStepMethod
TSSetPostEventStep(petsclib::PetscLibType,ts::TS, dt1::PetscReal)

Set the first time step to use after the event

Logically Collective

Input Parameters:

  • ts - time integration context
  • dt1 - first post event step

Options Database Key:

  • -ts_event_post_event_step <dt1> - first time step after the event

Level: advanced

-seealso: , TS, TSEvent, TSSetEventHandler(), TSSetPostEventSecondStep()

External Links

source
PETSc.LibPETSc.TSSetPostStageMethod
TSSetPostStage(petsclib::PetscLibType,ts::TS, func::external)

Sets the general called once at the end of each stage.

Logically Collective

Input Parameters:

  • ts - The TS context obtained from TSCreate()
  • func - The function

Calling sequence of func:

  • ts - the TS context
  • stagetime - the stage time
  • stageindex - the stage index
  • Y - Array of vectors (of size = total number of stages) with the stage solutions

Level: intermediate

-seealso: , TS, TSSetPreStage(), TSSetPreStep(), TSSetPostStep(), TSGetApplicationContext()

External Links

source
PETSc.LibPETSc.TSSetPostStepMethod
TSSetPostStep(petsclib::PetscLibType,ts::TS, func::external)

Sets the general called once at the end of each successful time step.

Logically Collective

Input Parameters:

  • ts - The TS context obtained from TSCreate()
  • func - The function

Calling sequence of func:

  • ts - the TS context

Level: intermediate

-seealso: , TS, TSSetPreStep(), TSSetPreStage(), TSSetPostEvaluate(), TSGetTimeStep(), TSGetStepNumber(), TSGetTime(), TSRestartStep()

External Links

source
PETSc.LibPETSc.TSSetPreStageMethod
TSSetPreStage(petsclib::PetscLibType,ts::TS, func::external)

Sets the general called once at the beginning of each stage.

Logically Collective

Input Parameters:

  • ts - The TS context obtained from TSCreate()
  • func - The function

Calling sequence of func:

  • ts - the TS context
  • stagetime - the stage time

Level: intermediate

-seealso: , TS, TSSetPostStage(), TSSetPreStep(), TSSetPostStep(), TSGetApplicationContext()

External Links

source
PETSc.LibPETSc.TSSetPreStepMethod
TSSetPreStep(petsclib::PetscLibType,ts::TS, func::external)

Sets the general called once at the beginning of each time step.

Logically Collective

Input Parameters:

  • ts - The TS context obtained from TSCreate()
  • func - The function

Calling sequence of func:

  • ts - the TS context

Level: intermediate

-seealso: , TS, TSSetPreStage(), TSSetPostStage(), TSSetPostStep(), TSStep(), TSRestartStep()

External Links

source
PETSc.LibPETSc.TSSetProblemTypeMethod
TSSetProblemType(petsclib::PetscLibType,ts::TS, type::TSProblemType)

Sets the type of problem to be solved.

Not collective

Input Parameters:

  • ts - The TS
  • type - One of TS_LINEAR, TS_NONLINEAR where these types refer to problems of the forms

-seealso: , TSSetUp(), TSProblemType, TS

External Links

source
PETSc.LibPETSc.TSSetRHSFunctionMethod
TSSetRHSFunction(petsclib::PetscLibType,ts::TS, r::PetscVec, f::TSRHSFunctionFn, ctx::Cvoid)

Sets the routine for evaluating the function, where U_t = G(t,u).

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • r - vector to put the computed right-hand side (or NULL to have it created)
  • f - routine for evaluating the right-hand-side function
  • ctx - [optional] user-defined context for private data for the function evaluation routine (may be NULL)

Level: beginner

-seealso: , TS, TSRHSFunctionFn, TSSetRHSJacobian(), TSSetIJacobian(), TSSetIFunction()

External Links

source
PETSc.LibPETSc.TSSetRHSHessianProductMethod
TSSetRHSHessianProduct(petsclib::PetscLibType,ts::TS, rhshp1::Vector{PetscVec}, rhshessianproductfunc1::external, rhshp2::Vector{PetscVec}, rhshessianproductfunc2::external, rhshp3::Vector{PetscVec}, rhshessianproductfunc3::external, rhshp4::Vector{PetscVec}, rhshessianproductfunc4::external, ctx::Cvoid)

Sets the function that computes the vector product. The Hessian is the second-order derivative of G (RHSFunction) w.r.t. the state variable.

Logically Collective

Input Parameters:

  • ts - TS context obtained from TSCreate()
  • rhshp1 - an array of vectors storing the result of vector-Hessian-vector product for G_UU
  • hessianproductfunc1 - vector-Hessian-vector product function for G_UU
  • rhshp2 - an array of vectors storing the result of vector-Hessian-vector product for G_UP
  • hessianproductfunc2 - vector-Hessian-vector product function for G_UP
  • rhshp3 - an array of vectors storing the result of vector-Hessian-vector product for G_PU
  • hessianproductfunc3 - vector-Hessian-vector product function for G_PU
  • rhshp4 - an array of vectors storing the result of vector-Hessian-vector product for G_PP
  • hessianproductfunc4 - vector-Hessian-vector product function for G_PP
  • ctx - [optional] user-defined function context

Calling sequence of rhshessianproductfunc1:

  • ts - the TS context
  • t - current timestep
  • U - input vector (current ODE solution)
  • Vl - an array of input vectors to be left-multiplied with the Hessian
  • Vr - input vector to be right-multiplied with the Hessian
  • VHV - an array of output vectors for vector-Hessian-vector product
  • ctx - [optional] user-defined function context

Level: intermediate

-seealso: TS, TSAdjoint

External Links

source
PETSc.LibPETSc.TSSetRHSJacobianMethod
TSSetRHSJacobian(petsclib::PetscLibType,ts::TS, Amat::PetscMat, Pmat::PetscMat, f::TSRHSJacobianFn, ctx::Cvoid)

Sets the function to compute the Jacobian of G, where U_t = G(U,t), as well as the location to store the matrix.

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • Amat - (approximate) location to store Jacobian matrix entries computed by f
  • Pmat - matrix from which preconditioner is to be constructed (usually the same as Amat)
  • f - the Jacobian evaluation routine
  • ctx - [optional] user-defined context for private data for the Jacobian evaluation routine (may be NULL)

Level: beginner

-seealso: , TS, TSRHSJacobianFn, SNESComputeJacobianDefaultColor(), TSSetRHSFunction(), TSRHSJacobianSetReuse(), TSSetIJacobian(), TSRHSFunctionFn, TSIFunctionFn

External Links

source
PETSc.LibPETSc.TSSetRHSJacobianPMethod
TSSetRHSJacobianP(petsclib::PetscLibType,ts::TS, Amat::PetscMat, func::TSRHSJacobianPFn, ctx::Cvoid)

Sets the function that computes the Jacobian of G w.r.t. the parameters p where U_t = G(U,p,t), as well as the location to store the matrix.

Logically Collective

Input Parameters:

  • ts - TS context obtained from TSCreate()
  • Amat - JacobianP matrix
  • func - function
  • ctx - [optional] user-defined function context

Level: intermediate

-seealso: , TS, TSRHSJacobianPFn, TSGetRHSJacobianP()

External Links

source
PETSc.LibPETSc.TSSetResizeMethod
TSSetResize(petsclib::PetscLibType,ts::TS, rollback::PetscBool, setup::external, transfer::external, ctx::Cvoid)

Sets the resize callbacks.

Logically Collective

Input Parameters:

  • ts - The TS context obtained from TSCreate()
  • rollback - Whether a resize will restart the step
  • setup - The setup function
  • transfer - The transfer function
  • ctx - [optional] The user-defined context

Calling sequence of setup:

  • ts - the TS context
  • step - the current step
  • time - the current time
  • state - the current vector of state
  • resize - (output parameter) PETSC_TRUE if need resizing, PETSC_FALSE otherwise
  • ctx - user defined context

Calling sequence of transfer:

  • ts - the TS context
  • nv - the number of vectors to be transferred
  • vecsin - array of vectors to be transferred
  • vecsout - array of transferred vectors
  • ctx - user defined context

-seealso: , TS, TSSetDM(), TSSetIJacobian(), TSSetRHSJacobian()

External Links

source
PETSc.LibPETSc.TSSetRunStepsMethod
TSSetRunSteps(petsclib::PetscLibType,ts::TS, runsteps::PetscInt)

Sets the maximum number of steps to take in each call to TSSolve().

If the step count when TSSolve() is start_step, this will stop the simulation once current_step - start_step >= run_steps. Comparatively, TSSetMaxSteps() will stop if current_step >= max_steps. The simulation will stop when either condition is reached.

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • runsteps - maximum number of steps to take in each call to TSSolve();

Options Database Key:

  • -ts_run_steps <runsteps> - Sets runsteps

Level: intermediate

-seealso: , TS, TSGetRunSteps(), TSSetMaxTime(), TSSetExactFinalTime(), TSSetMaxSteps()

External Links

source
PETSc.LibPETSc.TSSetSNESMethod
TSSetSNES(petsclib::PetscLibType,ts::TS, snes::PetscSNES)

Set the SNES (nonlinear solver) to be used by the TS timestepping context

Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • snes - the nonlinear solver context

Level: developer

-seealso: , TS, SNES, TSCreate(), TSSetUp(), TSSolve(), TSGetSNES()

External Links

source
PETSc.LibPETSc.TSSetSaveTrajectoryMethod
TSSetSaveTrajectory(petsclib::PetscLibType,ts::TS)

Causes the TS to save its solutions as it iterates forward in time in a TSTrajectory object

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Options Database Keys:

  • -ts_save_trajectory - saves the trajectory to a file
  • -ts_trajectory_type type - set trajectory type

Level: intermediate

-seealso: , TS, TSTrajectory, TSGetTrajectory(), TSAdjointSolve()

External Links

source
PETSc.LibPETSc.TSSetSolutionMethod
TSSetSolution(petsclib::PetscLibType,ts::TS, u::PetscVec)

Sets the initial solution vector for use by the TS routines.

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • u - the solution vector

Level: beginner

-seealso: , TS, TSSetSolutionFunction(), TSGetSolution(), TSCreate()

External Links

source
PETSc.LibPETSc.TSSetSolutionFunctionMethod
TSSetSolutionFunction(petsclib::PetscLibType,ts::TS, f::TSSolutionFn, ctx::Cvoid)

Provide a function that computes the solution of the ODE or DAE

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • f - routine for evaluating the solution
  • ctx - [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 provided TSSetSolutionFunction()
  • -ts_monitor_draw_error - Monitor error graphically, requires user to have provided TSSetSolutionFunction()

Level: intermediate

-seealso: , TS, TSSolutionFn, TSSetRHSJacobian(), TSSetIJacobian(), TSComputeSolutionFunction(), TSSetForcingFunction(), TSSetSolution(), TSGetSolution(), TSMonitorLGError(), TSMonitorDrawError()

External Links

source
PETSc.LibPETSc.TSSetStepNumberMethod
TSSetStepNumber(petsclib::PetscLibType,ts::TS, steps::PetscInt)

Sets the number of steps completed.

Logically Collective

Input Parameters:

  • ts - the TS context
  • steps - number of steps completed so far

Level: developer

-seealso: , TS, TSGetStepNumber(), TSSetTime(), TSSetTimeStep(), TSSetSolution()

External Links

source
PETSc.LibPETSc.TSSetTimeMethod
TSSetTime(petsclib::PetscLibType,ts::TS, t::PetscReal)

Allows one to reset the time.

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • t - the time

Level: intermediate

-seealso: , TS, TSGetTime(), TSSetMaxSteps()

External Links

source
PETSc.LibPETSc.TSSetTimeErrorMethod
TSSetTimeError(petsclib::PetscLibType,ts::TS, v::PetscVec)

Sets the estimated error vector, if the chosen TSType has an error estimation functionality. This can be used to restart such a time integrator with a given error vector.

Not Collective, but v returned is parallel if ts is parallel

Input Parameters:

  • ts - the TS context obtained from TSCreate() (input parameter).
  • v - the vector containing the error (same size as the solution).

Level: intermediate

-seealso: , TS, TSSetSolution(), TSGetTimeError()

External Links

source
PETSc.LibPETSc.TSSetTimeSpanMethod
TSSetTimeSpan(petsclib::PetscLibType,ts::TS, n::PetscInt, span_times::Vector{PetscReal})

sets the time span. The solution will be computed and stored for each time requested in the span

Collective

Input Parameters:

  • ts - the time-stepper
  • n - number of the time points (>=2)
  • span_times - array of the time points, must be increasing. The first element and the last element are the initial time and the final time respectively.

Options Database Key:

  • -ts_time_span <t0,...tf> - Sets the time span

Level: intermediate

-seealso: , TS, TSSetEvaluationTimes(), TSGetEvaluationTimes(), TSGetEvaluationSolutions()

External Links

source
PETSc.LibPETSc.TSSetTimeStepMethod
TSSetTimeStep(petsclib::PetscLibType,ts::TS, time_step::PetscReal)

Allows one to reset the timestep at any time, useful for simple pseudo-timestepping codes.

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • time_step - the size of the timestep

Level: intermediate

-seealso: , TS, TSPSEUDO, TSGetTimeStep(), TSSetTime()

External Links

source
PETSc.LibPETSc.TSSetTolerancesMethod
TSSetTolerances(petsclib::PetscLibType,ts::TS, atol::PetscReal, vatol::PetscVec, rtol::PetscReal, vrtol::PetscVec)

Set tolerances for local truncation error when using an adaptive controller

Logically Collective

Input Parameters:

  • ts - time integration context
  • atol - scalar absolute tolerances
  • vatol - vector of absolute tolerances or NULL, used in preference to atol if present
  • rtol - scalar relative tolerances
  • vrtol - vector of relative tolerances or NULL, used in preference to rtol if present

Options Database Keys:

  • -ts_rtol <rtol> - relative tolerance for local truncation error
  • -ts_atol <atol> - Absolute tolerance for local truncation error

Level: beginner

-seealso: , TS, TSAdapt, TSErrorWeightedNorm(), TSGetTolerances()

External Links

source
PETSc.LibPETSc.TSSetTransientVariableMethod
TSSetTransientVariable(petsclib::PetscLibType,ts::TS, tvar::TSTransientVariableFn, ctx::Cvoid)

sets function to transform from state to transient variables

Logically Collective

Input Parameters:

  • ts - time stepping context on which to change the transient variable
  • tvar - a function that transforms to transient variables, see TSTransientVariableFn for the calling sequence
  • ctx - a context for tvar

Level: advanced

-seealso: , TS, TSBDF, TSTransientVariableFn, DMTSSetTransientVariable(), DMTSGetTransientVariable(), TSSetIFunction(), TSSetIJacobian()

External Links

source
PETSc.LibPETSc.TSSetTypeMethod
TSSetType(petsclib::PetscLibType,ts::TS, type::TSType)

Sets the algorithm/method to be used for integrating the ODE with the given TS.

Collective

Input Parameters:

  • ts - The TS context
  • type - A known method

Options Database Key:

  • -ts_type <type> - Sets the method; use -help for a list of available methods (for instance, euler)

Level: intermediate

-seealso: , TS, TSSolve(), TSCreate(), TSSetFromOptions(), TSDestroy(), TSType

External Links

source
PETSc.LibPETSc.TSSetUpMethod
TSSetUp(petsclib::PetscLibType,ts::TS)

Sets up the internal data structures for the later use of a timestepper.

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Level: advanced

-seealso: , TSCreate(), TS, TSStep(), TSDestroy(), TSSolve()

External Links

source
PETSc.LibPETSc.TSSetUseSplitRHSFunctionMethod
TSSetUseSplitRHSFunction(petsclib::PetscLibType,ts::TS, use_splitrhsfnc::PetscBool)

Use the split RHSFunction when a multirate method is used.

Logically Collective

Input Parameters:

  • ts - timestepping context
  • use_splitrhsfunction - PETSC_TRUE indicates that the split RHSFunction will be used

Options Database Key:

  • -ts_use_splitrhsfunction - <true,false>

Level: intermediate

-seealso: , TS, TSGetUseSplitRHSFunction()

External Links

source
PETSc.LibPETSc.TSSolveMethod
TSSolve(petsclib::PetscLibType,ts::TS, u::PetscVec)

Steps the requested number of timesteps.

Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • u - the solution vector (can be null if TSSetSolution() was used and TSSetExactFinalTime(ts,TS_EXACTFINALTIME_MATCHSTEP) was not used,

otherwise it must contain the initial conditions and will contain the solution at the final requested time

Level: beginner

-seealso: , TS, TSCreate(), TSSetSolution(), TSStep(), TSGetTime(), TSGetSolveTime()

External Links

source
PETSc.LibPETSc.TSStepMethod
TSStep(petsclib::PetscLibType,ts::TS)

Steps one time step

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Level: developer

-seealso: , TS, TSCreate(), TSSetUp(), TSDestroy(), TSSolve(), TSSetPreStep(), TSSetPreStage(), TSSetPostStage(), TSInterpolate()

External Links

source
PETSc.LibPETSc.TSSundialsGetIterationsMethod
TSSundialsGetIterations(petsclib::PetscLibType,ts::TS, nonlin::Cint, lin::Cint)

Gets the number of nonlinear and linear iterations used so far by TSSUNDIALS.

Not Collective

Input Parameter:

  • ts - the time-step context

Output Parameters:

  • nonlin - number of nonlinear iterations
  • lin - number of linear iterations

Level: advanced

-seealso: , TSSundialsSetType(), TSSundialsSetMaxl(), TSSundialsSetLinearTolerance(), TSSundialsSetGramSchmidtType(), TSSundialsSetTolerance(), TSSundialsGetPC(), TSSetExactFinalTime()

External Links

source
PETSc.LibPETSc.TSSundialsGetPCMethod
TSSundialsGetPC(petsclib::PetscLibType,ts::TS, pc::PC)

Extract the PC context from a time

Input Parameter:

  • ts - the time-step context

Output Parameter:

  • pc - the preconditioner context

Level: advanced

-seealso: , TSSundialsGetIterations(), TSSundialsSetType(), TSSundialsSetMaxl(), TSSundialsSetLinearTolerance(), TSSundialsSetGramSchmidtType(), TSSundialsSetTolerance()

External Links

source
PETSc.LibPETSc.TSSundialsMonitorInternalStepsMethod
TSSundialsMonitorInternalSteps(petsclib::PetscLibType,ts::TS, ft::PetscBool)

Monitor TSSUNDIALS internal steps (Defaults to false).

Input Parameters:

  • ts - the time-step context
  • ft - PETSC_TRUE if monitor, else PETSC_FALSE

Level: beginner

-seealso: , TSSundialsGetIterations(), TSSundialsSetType(), TSSundialsSetMaxl(), TSSundialsSetLinearTolerance(), TSSundialsSetGramSchmidtType(), TSSundialsSetTolerance(), TSSundialsGetPC()

External Links

source
PETSc.LibPETSc.TSSundialsSetGramSchmidtTypeMethod
TSSundialsSetGramSchmidtType(petsclib::PetscLibType,ts::TS, type::TSSundialsGramSchmidtType)

Sets type of orthogonalization used in GMRES method by TSSUNDIALS linear solver.

Logically Collective

Input Parameters:

  • ts - the time-step context
  • type - either SUNDIALS_MODIFIED_GS or SUNDIALS_CLASSICAL_GS

Level: advanced

-seealso: , TSSundialsGetIterations(), TSSundialsSetType(), TSSundialsSetMaxl(), TSSundialsSetLinearTolerance(), TSSundialsSetTolerance(), TSSundialsGetPC(), TSSetExactFinalTime()

External Links

source
PETSc.LibPETSc.TSSundialsSetLinearToleranceMethod
TSSundialsSetLinearTolerance(petsclib::PetscLibType,ts::TS, tol::PetscReal)

Sets the tolerance used to solve the linear system by TSSUNDIALS.

Logically Collective

Input Parameters:

  • ts - the time-step context
  • tol - the factor by which the tolerance on the nonlinear solver is

multiplied to get the tolerance on the linear solver, .05 by default.

Level: advanced

-seealso: , TSSundialsGetIterations(), TSSundialsSetType(), TSSundialsSetMaxl(), TSSundialsSetGramSchmidtType(), TSSundialsSetTolerance(), TSSundialsGetPC(), TSSetExactFinalTime()

External Links

source
PETSc.LibPETSc.TSSundialsSetMaxTimeStepMethod
TSSundialsSetMaxTimeStep(petsclib::PetscLibType,ts::TS, maxdt::PetscReal)

Largest time step to be chosen by the adaptive controller.

Input Parameters:

  • ts - the time-step context
  • maxdt - lowest time step if positive, negative to deactivate

Level: beginner

-seealso: , TSSundialsSetType(), TSSundialsSetTolerance(),

External Links

source
PETSc.LibPETSc.TSSundialsSetMaxlMethod
TSSundialsSetMaxl(petsclib::PetscLibType,ts::TS, maxl::PetscInt)

Sets the dimension of the Krylov space used by GMRES in the linear solver in TSSUNDIALS. TSSUNDIALS DOES NOT use restarted GMRES so this is the maximum number of GMRES steps that will be used.

Logically Collective

Input Parameters:

  • ts - the time-step context
  • maxl - number of direction vectors (the dimension of Krylov subspace).

Level: advanced

-seealso: , TSSundialsGetIterations(), TSSundialsSetType(), TSSundialsSetLinearTolerance(), TSSundialsSetGramSchmidtType(), TSSundialsSetTolerance(), TSSundialsGetPC(), TSSetExactFinalTime()

External Links

source
PETSc.LibPETSc.TSSundialsSetMaxordMethod
TSSundialsSetMaxord(petsclib::PetscLibType,ts::TS, maxord::PetscInt)

Sets the maximum order for BDF/Adams method used by TSSUNDIALS.

Logically Collective

Input Parameters:

  • ts - the time-step context
  • maxord - maximum order of BDF / Adams method

Level: advanced

-seealso: , TSSundialsGetIterations(), TSSundialsSetType(), TSSundialsSetLinearTolerance(), TSSundialsSetGramSchmidtType(), TSSundialsSetTolerance(), TSSundialsGetPC(), TSSetExactFinalTime()

External Links

source
PETSc.LibPETSc.TSSundialsSetMinTimeStepMethod
TSSundialsSetMinTimeStep(petsclib::PetscLibType,ts::TS, mindt::PetscReal)

Smallest time step to be chosen by the adaptive controller.

Input Parameters:

  • ts - the time-step context
  • mindt - lowest time step if positive, negative to deactivate

-seealso: , TSSundialsSetType(), TSSundialsSetTolerance(),

External Links

source
PETSc.LibPETSc.TSSundialsSetToleranceMethod
TSSundialsSetTolerance(petsclib::PetscLibType,ts::TS, aabs::PetscReal, rel::PetscReal)

Sets the absolute and relative tolerance used by TSSUNDIALS for error control.

Logically Collective

Input Parameters:

  • ts - the time-step context
  • aabs - the absolute tolerance
  • rel - the relative tolerance

See the CVODE/SUNDIALS users manual for exact details on these parameters. Essentially these regulate the size of the error for a SINGLE timestep.

Level: intermediate

-seealso: , TSSundialsGetIterations(), TSSundialsSetType(), TSSundialsSetGMRESMaxl(), TSSundialsSetLinearTolerance(), TSSundialsSetGramSchmidtType(), TSSundialsGetPC(), TSSetExactFinalTime()

External Links

source
PETSc.LibPETSc.TSSundialsSetTypeMethod
TSSundialsSetType(petsclib::PetscLibType,ts::TS, type::TSSundialsLmmType)

Sets the method that TSSUNDIALS will use for integration.

Logically Collective

Input Parameters:

  • ts - the time-step context
  • type - one of SUNDIALS_ADAMS or SUNDIALS_BDF

Level: intermediate

-seealso: , TSSundialsGetIterations(), TSSundialsSetMaxl(), TSSundialsSetLinearTolerance(), TSSundialsSetGramSchmidtType(), TSSundialsSetTolerance(), TSSundialsGetPC(), TSSetExactFinalTime()

External Links

source
PETSc.LibPETSc.TSSundialsSetUseDenseMethod
TSSundialsSetUseDense(petsclib::PetscLibType,ts::TS, use_dense::PetscBool)

Set a flag to use a dense linear solver in TSSUNDIALS (serial only)

Logically Collective

Input Parameters:

  • ts - the time-step context
  • use_dense - PETSC_TRUE to use the dense solver

Level: advanced

-seealso: , TSSUNDIALS

External Links

source
PETSc.LibPETSc.TSThetaGetEndpointMethod
endpoint::PetscBool = TSThetaGetEndpoint(petsclib::PetscLibType,ts::TS)

Gets whether to use the endpoint variant of the method (e.g. trapezoid/Crank

Not Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

  • endpoint - PETSC_TRUE when using the endpoint variant

Level: advanced

-seealso: , TSThetaSetEndpoint(), TSTHETA, TSCN

External Links

source
PETSc.LibPETSc.TSThetaGetThetaMethod
theta::PetscReal = TSThetaGetTheta(petsclib::PetscLibType,ts::TS)

Get the abscissa of the stage in (0,1] for TSTHETA

Not Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

  • theta - stage abscissa

Level: advanced

-seealso: , TSThetaSetTheta(), TSTHETA

External Links

source
PETSc.LibPETSc.TSThetaSetEndpointMethod
TSThetaSetEndpoint(petsclib::PetscLibType,ts::TS, flg::PetscBool)

Sets whether to use the endpoint variant of the method (e.g. trapezoid/Crank

Not Collective

Input Parameters:

  • ts - timestepping context
  • flg - PETSC_TRUE to use the endpoint variant

Options Database Key:

  • -ts_theta_endpoint <flg> - use the endpoint variant

Level: intermediate

-seealso: , TSTHETA, TSCN

External Links

source
PETSc.LibPETSc.TSThetaSetThetaMethod
TSThetaSetTheta(petsclib::PetscLibType,ts::TS, theta::PetscReal)

Set the abscissa of the stage in (0,1] for TSTHETA

Not Collective

Input Parameters:

  • ts - timestepping context
  • theta - stage abscissa

Options Database Key:

  • -ts_theta_theta <theta> - set theta

Level: intermediate

-seealso: , TSThetaGetTheta(), TSTHETA, TSCN

External Links

source
PETSc.LibPETSc.TSVISetVariableBoundsMethod
TSVISetVariableBounds(petsclib::PetscLibType,ts::TS, xl::PetscVec, xu::PetscVec)

Sets the lower and upper bounds for the solution vector. xl <= x <= xu

Input Parameters:

  • ts - the TS context.
  • xl - lower bound.
  • xu - upper bound.

Level: advanced

-seealso: , TS

External Links

source
PETSc.LibPETSc.TSViewMethod
TSView(petsclib::PetscLibType,ts::TS, viewer::PetscViewer)

Prints the TS data structure.

Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • viewer - visualization context

Options Database Key:

  • -ts_view - calls TSView() at end of TSStep()

Level: beginner

-seealso: , TS, PetscViewer, PetscViewerASCIIOpen()

External Links

source
PETSc.LibPETSc.TSViewFromOptionsMethod
TSViewFromOptions(petsclib::PetscLibType,ts::TS, obj::PetscObject, name::String)

View a TS based on values in the options database

Collective

Input Parameters:

  • ts - the TS context
  • obj - Optional object that provides the prefix for the options database keys
  • name - command line option string to be passed by user

Level: intermediate

-seealso: , TS, TSView, PetscObjectViewFromOptions(), TSCreate()

External Links

source

TS Add-ons

Additional TS utilities and helper functions:

PETSc.LibPETSc.TSAdaptCandidateAddMethod
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 with TSGetAdapt() or TSAdaptCreate()
  • name - name of the candidate scheme to add
  • order - order of the candidate scheme
  • stageorder - stage order of the candidate scheme
  • ccfl - stability coefficient relative to explicit Euler, used for CFL constraints
  • cost - relative measure of the amount of work required for the candidate scheme
  • inuse - indicates that this scheme is the one currently in use, this flag can only be set for one scheme

Level: developer

-seealso: , TSAdapt, TSAdaptCandidatesClear(), TSAdaptChoose()

External Links

source
PETSc.LibPETSc.TSAdaptCandidatesClearMethod
TSAdaptCandidatesClear(petsclib::PetscLibType,adapt::TSAdapt)

clear any previously set candidate schemes

Logically Collective

Input Parameter:

  • adapt - adaptive controller

Level: developer

-seealso: , TSAdapt, TSAdaptCreate(), TSAdaptCandidateAdd(), TSAdaptChoose()

External Links

source
PETSc.LibPETSc.TSAdaptCandidatesGetMethod
n::PetscInt,order::PetscInt,stageorder::PetscInt,ccfl::PetscReal,cost::PetscReal = TSAdaptCandidatesGet(petsclib::PetscLibType,adapt::TSAdapt)

Get the list of candidate orders of accuracy and cost

Not Collective

Input Parameter:

  • adapt - time step adaptivity context

Output Parameters:

  • n - number of candidate schemes, always at least 1
  • order - the order of each candidate scheme
  • stageorder - the stage order of each candidate scheme
  • ccfl - the CFL coefficient of each scheme
  • cost - the relative cost of each scheme

Level: developer

-seealso: , TSAdapt, TSAdaptCandidatesClear(), TSAdaptCandidateAdd(), TSAdaptChoose()

External Links

source
PETSc.LibPETSc.TSAdaptCheckStageMethod
accept::PetscBool = TSAdaptCheckStage(petsclib::PetscLibType,adapt::TSAdapt, ts::TS, t::PetscReal, Y::PetscVec)

checks whether to accept a stage, (e.g. reject and change time step size if nonlinear solve fails or solution vector is infeasible)

Collective

Input Parameters:

  • adapt - adaptive controller context
  • ts - time stepper
  • t - Current simulation time
  • Y - Current solution vector

Output Parameter:

  • accept - PETSC_TRUE to accept the stage, PETSC_FALSE to reject

Level: developer

-seealso: , TSAdapt

External Links

source
PETSc.LibPETSc.TSAdaptChooseMethod
next_sc::PetscInt,next_h::PetscReal,accept::PetscBool = TSAdaptChoose(petsclib::PetscLibType,adapt::TSAdapt, ts::TS, h::PetscReal)

choose which method and step size to use for the next step

Collective

Input Parameters:

  • adapt - adaptive controller
  • ts - time stepper
  • h - current step size

Output Parameters:

  • next_sc - optional, scheme to use for the next step
  • next_h - step size to use for the next step
  • accept - PETSC_TRUE to accept the current step, PETSC_FALSE to repeat the current step with the new step size

Level: developer

-seealso: , TSAdapt, TSAdaptCandidatesClear(), TSAdaptCandidateAdd()

External Links

source
PETSc.LibPETSc.TSAdaptCreateMethod
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 - new TSAdapt object

Level: developer

-seealso: , TSAdapt, TSGetAdapt(), TSAdaptSetType(), TSAdaptDestroy()

External Links

source
PETSc.LibPETSc.TSAdaptDSPSetFilterMethod
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 context
  • name - 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 to TSADAPTBASIC but with different criteria for step rejections.
  • PI30, PI42, PI33, PI34 - PI controllers.
  • PC11, PC47, PC36 - predictive controllers.
  • H0211, H211b, H211PI - digital filters with orders dynamics=2, adaptivity=1, filter=1.
  • H0312, H312b, H312PID - digital filters with orders dynamics=3, adaptivity=1, filter=2.
  • H0321, H321 - digital filters with orders dynamics=3, adaptivity=2, filter=1.

Level: intermediate

-seealso: , TSADAPTDSP, TS, TSAdapt, TSGetAdapt(), TSAdaptDSPSetPID()

External Links

source
PETSc.LibPETSc.TSAdaptDSPSetPIDMethod
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 context
  • kkI - Integral parameter
  • kkP - Proportional parameter
  • kkD - Derivative parameter

Options Database Key:

  • -ts_adapt_dsp_pid <kkI,kkP,kkD> - Sets PID controller parameters

Level: intermediate

-seealso: , TS, TSAdapt, TSGetAdapt(), TSAdaptDSPSetFilter()

External Links

source
PETSc.LibPETSc.TSAdaptGetClipMethod
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 factor
  • high - optional, admissible increase factor

Level: intermediate

-seealso: , TSAdapt, TSAdaptChoose(), TSAdaptSetClip(), TSAdaptSetScaleSolveFailed()

External Links

source
PETSc.LibPETSc.TSAdaptGetMaxIgnoreMethod
max_ignore::PetscReal = TSAdaptGetMaxIgnore(petsclib::PetscLibType,adapt::TSAdapt)

Get error estimation threshold. Solution components below this threshold value will not be considered when computing error norms for time step adaptivity (in absolute value).

Not Collective

Input Parameter:

  • adapt - adaptive controller context

Output Parameter:

  • max_ignore - threshold for solution components that are ignored during error estimation

Level: intermediate

-seealso: , TSAdapt, TSAdaptSetMaxIgnore(), TSAdaptChoose()

External Links

source
PETSc.LibPETSc.TSAdaptGetSafetyMethod
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 goal
  • reject_safety - extra safety factor to apply if the last step was rejected

Level: intermediate

-seealso: , TSAdapt, TSAdaptSetSafety(), TSAdaptChoose()

External Links

source
PETSc.LibPETSc.TSAdaptGetScaleSolveFailedMethod
scale::PetscReal = TSAdaptGetScaleSolveFailed(petsclib::PetscLibType,adapt::TSAdapt)

Gets the admissible decrease/increase factor in step size

Not Collective

Input Parameter:

  • adapt - adaptive controller context

Output Parameter:

  • scale - scale factor

Level: intermediate

-seealso: , TSAdapt, TSAdaptChoose(), TSAdaptSetScaleSolveFailed(), TSAdaptSetClip()

External Links

source
PETSc.LibPETSc.TSAdaptGetStepLimitsMethod
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 with TSGetAdapt()

Output Parameters:

  • hmin - minimum time step
  • hmax - maximum time step

Level: intermediate

-seealso: , TSAdapt, TSAdaptSetStepLimits(), TSAdaptChoose()

External Links

source
PETSc.LibPETSc.TSAdaptGetTypeMethod
type::TSAdaptType = TSAdaptGetType(petsclib::PetscLibType,adapt::TSAdapt)

gets the TS adapter method type (as a string).

Not Collective

Input Parameter:

  • adapt - The TS adapter, most likely obtained with TSGetAdapt()

Output Parameter:

  • type - The name of TS adapter method

Level: intermediate

-seealso: TSAdapt, TSAdaptType, TSAdaptSetType()

External Links

source
PETSc.LibPETSc.TSAdaptHistoryGetStepMethod
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 context
  • step - the step number

Output Parameters:

  • t - the time corresponding to the requested step (can be NULL)
  • dt - the time step to be taken at the requested step (can be NULL)

Level: advanced

-seealso: , TS, TSGetAdapt(), TSAdaptSetType(), TSAdaptHistorySetTrajectory(), TSADAPTHISTORY

External Links

source
PETSc.LibPETSc.TSAdaptHistorySetHistoryMethod
TSAdaptHistorySetHistory(petsclib::PetscLibType,adapt::TSAdapt, n::PetscInt, hist::Vector{PetscReal}, backward::PetscBool)

Sets the time history in the adaptor

Logically Collective

Input Parameters:

  • adapt - the TSAdapt context
  • n - size of the time history
  • hist - the time history
  • backward - if the time history has to be followed backward

Level: advanced

-seealso: , TSGetAdapt(), TSAdaptSetType(), TSAdaptHistorySetTrajectory(), TSADAPTHISTORY

External Links

source
PETSc.LibPETSc.TSAdaptHistorySetTrajectoryMethod
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 - the TSAdapt context
  • tj - the TSTrajectory context
  • backward - if the time history has to be followed backward

Level: advanced

-seealso: , TSGetAdapt(), TSAdaptSetType(), TSAdaptHistorySetHistory(), TSADAPTHISTORY, TSAdapt

External Links

source
PETSc.LibPETSc.TSAdaptLoadMethod
TSAdaptLoad(petsclib::PetscLibType,adapt::TSAdapt, viewer::PetscViewer)

Loads a TSAdapt that has been stored in binary with TSAdaptView().

Collective

Input Parameters:

  • adapt - the newly loaded TSAdapt, this needs to have been created with TSAdaptCreate() or

some related function before a call to TSAdaptLoad().

  • viewer - binary file viewer, obtained from PetscViewerBinaryOpen() or

HDF5 file viewer, obtained from PetscViewerHDF5Open()

Level: intermediate

-seealso: , PetscViewerBinaryOpen(), TSAdaptView(), MatLoad(), VecLoad(), TSAdapt

External Links

source
PETSc.LibPETSc.TSAdaptRegisterMethod
TSAdaptRegister(petsclib::PetscLibType,sname::String, fnc::external)

adds a TSAdapt implementation

Not Collective, No Fortran Support

Input Parameters:

  • sname - name of user-defined adaptivity scheme
  • function - routine to create method context

Level: advanced

-seealso: , TSAdaptRegisterAll()

External Links

source
PETSc.LibPETSc.TSAdaptResetMethod
TSAdaptReset(petsclib::PetscLibType,adapt::TSAdapt)

Resets a TSAdapt context to its defaults

Collective

Input Parameter:

  • adapt - the TSAdapt context obtained from TSGetAdapt() or TSAdaptCreate()

Level: developer

-seealso: , TSGetAdapt(), TSAdapt, TSAdaptCreate(), TSAdaptDestroy()

External Links

source
PETSc.LibPETSc.TSAdaptSetAlwaysAcceptMethod
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 with TSGetAdapt()
  • flag - whether to always accept steps

Options Database Key:

  • -ts_adapt_always_accept - to always accept steps

Level: intermediate

-seealso: , TSAdapt, TSGetAdapt(), TSAdaptChoose()

External Links

source
PETSc.LibPETSc.TSAdaptSetCheckStageMethod
TSAdaptSetCheckStage(petsclib::PetscLibType,adapt::TSAdapt, func::external)

Set a callback to check convergence for a stage

Logically Collective

Input Parameters:

  • adapt - adaptive controller context
  • func - stage check function

Calling sequence:

  • adapt - adaptive controller context
  • ts - time stepping context
  • t - current time
  • Y - current solution vector
  • accept - pending choice of whether to accept, can be modified by this routine

Level: advanced

-seealso: , TSAdapt, TSGetAdapt(), TSAdaptChoose()

External Links

source
PETSc.LibPETSc.TSAdaptSetClipMethod
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 context
  • low - admissible decrease factor
  • high - admissible increase factor

Options Database Key:

  • -ts_adapt_clip <low>,<high> - to set admissible time step decrease and increase factors

Level: intermediate

-seealso: , TSAdapt, TSAdaptChoose(), TSAdaptGetClip(), TSAdaptSetScaleSolveFailed()

External Links

source
PETSc.LibPETSc.TSAdaptSetFromOptionsMethod
TSAdaptSetFromOptions(petsclib::PetscLibType,adapt::TSAdapt, PetscOptionsObject::PetscOptionItems)

Sets various TSAdapt parameters from user options.

Collective

Input Parameters:

  • adapt - the TSAdapt context
  • PetscOptionsObject - object created by PetscOptionsBegin()

Options Database Keys:

  • -ts_adapt_type <type> - algorithm to use for adaptivity
  • -ts_adapt_always_accept - always accept steps regardless of error/stability goals
  • -ts_adapt_safety <safety> - safety factor relative to target error/stability goal
  • -ts_adapt_reject_safety <safety> - extra safety factor to apply if the last step was rejected
  • -ts_adapt_clip <low,high> - admissible time step decrease and increase factors
  • -ts_adapt_dt_min <min> - minimum timestep to use
  • -ts_adapt_dt_max <max> - maximum timestep to use
  • -ts_adapt_scale_solve_failed <scale> - scale timestep by this factor if a solve fails
  • -ts_adapt_wnormtype <2 or infinity> - type of norm for computing error estimates
  • -ts_adapt_time_step_increase_delay - number of timesteps to delay increasing the time step after it has been decreased due to failed solver

Level: advanced

-seealso: , TSAdapt, TSGetAdapt(), TSAdaptSetType(), TSAdaptSetAlwaysAccept(), TSAdaptSetSafety(), TSAdaptSetClip(), TSAdaptSetScaleSolveFailed(), TSAdaptSetStepLimits(), TSAdaptSetMonitor()

External Links

source
PETSc.LibPETSc.TSAdaptSetMaxIgnoreMethod
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 context
  • max_ignore - threshold for solution components that are ignored during error estimation

Options Database Key:

  • -ts_adapt_max_ignore <max_ignore> - to set the threshold

Level: intermediate

-seealso: , TSAdapt, TSAdaptGetMaxIgnore(), TSAdaptChoose()

External Links

source
PETSc.LibPETSc.TSAdaptSetMonitorMethod
TSAdaptSetMonitor(petsclib::PetscLibType,adapt::TSAdapt, flg::PetscBool)

Monitor the choices made by the adaptive controller

Collective

Input Parameters:

  • adapt - adaptive controller context
  • flg - PETSC_TRUE to active a monitor, PETSC_FALSE to disable

Options Database Key:

  • -ts_adapt_monitor - to turn on monitoring

Level: intermediate

-seealso: , TSAdapt, TSGetAdapt(), TSAdaptChoose()

External Links

source
PETSc.LibPETSc.TSAdaptSetSafetyMethod
TSAdaptSetSafety(petsclib::PetscLibType,adapt::TSAdapt, safety::PetscReal, reject_safety::PetscReal)

Set safety factors for time step adaptor

Logically Collective

Input Parameters:

  • adapt - adaptive controller context
  • safety - safety factor relative to target error/stability goal
  • reject_safety - extra safety factor to apply if the last step was rejected

Options Database Keys:

  • -ts_adapt_safety <safety> - to set safety factor
  • -ts_adapt_reject_safety <reject_safety> - to set reject safety factor

Level: intermediate

-seealso: , TSAdapt, TSAdaptGetSafety(), TSAdaptChoose()

External Links

source
PETSc.LibPETSc.TSAdaptSetScaleSolveFailedMethod
TSAdaptSetScaleSolveFailed(petsclib::PetscLibType,adapt::TSAdapt, scale::PetscReal)

Scale step size by this factor if solve fails

Logically Collective

Input Parameters:

  • adapt - adaptive controller context
  • scale - scale

Options Database Key:

  • -ts_adapt_scale_solve_failed <scale> - to set scale step by this factor if solve fails

Level: intermediate

-seealso: , TSAdapt, TSAdaptChoose(), TSAdaptGetScaleSolveFailed(), TSAdaptGetClip()

External Links

source
PETSc.LibPETSc.TSAdaptSetStepLimitsMethod
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 with TSGetAdapt()
  • hmin - minimum time step
  • hmax - maximum time step

Options Database Keys:

  • -ts_adapt_dt_min <min> - to set minimum time step
  • -ts_adapt_dt_max <max> - to set maximum time step

Level: intermediate

-seealso: , TSAdapt, TSAdaptGetStepLimits(), TSAdaptChoose()

External Links

source
PETSc.LibPETSc.TSAdaptSetTimeStepIncreaseDelayMethod
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 context
  • cnt - the number of timesteps

Options Database Key:

  • -ts_adapt_time_step_increase_delay cnt - number of steps to delay the increase

Level: advanced

-seealso: , TSAdapt

External Links

source
PETSc.LibPETSc.TSAdaptSetTypeMethod
TSAdaptSetType(petsclib::PetscLibType,adapt::TSAdapt, type::TSAdaptType)

sets the approach used for the error adapter

Logicially Collective

Input Parameters:

  • adapt - the TS adapter, most likely obtained with TSGetAdapt()
  • type - one of the TSAdaptType

Options Database Key:

  • -ts_adapt_type <basic or dsp or none> - to set the adapter type

Level: intermediate

-seealso: , TSGetAdapt(), TSAdaptDestroy(), TSAdaptType, TSAdaptGetType()

External Links

source
PETSc.LibPETSc.TSGLLEAdaptChooseMethod
next_sc::PetscInt,next_h::PetscReal,finish::PetscBool = TSGLLEAdaptChoose(petsclib::PetscLibType,adapt::TSGLLEAdapt, n::PetscInt, orders::Vector{PetscInt}, errors::Vector{PetscReal}, cost::Vector{PetscReal}, cur::PetscInt, h::PetscReal, tleft::PetscReal)

External Links

source
PETSc.LibPETSc.TSGLLEAdaptRegisterMethod
TSGLLEAdaptRegister(petsclib::PetscLibType,sname::String, fnc::external)

adds a TSGLLEAdapt implementation

Not Collective, No Fortran Support

Input Parameters:

  • sname - name of user-defined adaptivity scheme
  • function - routine to create method context

Level: advanced

-seealso: , TSGLLE, TSGLLEAdapt, TSGLLEAdaptRegisterAll()

External Links

source
PETSc.LibPETSc.TSMonitorDrawCtxCreateMethod
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 use
  • host - the X display to open, or NULL for the local machine
  • label - the title to put in the title bar
  • x - the x screen coordinates of the upper left coordinate of the window
  • y - the y screen coordinates of the upper left coordinate of the window
  • m - the screen width in pixels
  • n - the screen height in pixels
  • howoften - if positive then determines the frequency of the plotting, if -1 then only at the final time

Output Parameter:

  • ctx - the monitor context

Options Database Keys:

  • -ts_monitor_draw_solution - draw the solution at each time-step
  • -ts_monitor_draw_solution_initial - show initial solution as well as current solution

Level: intermediate

-seealso: , TS, TSMonitorDrawCtxDestroy(), TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorDrawCtx, PetscMonitorDrawSolution()

External Links

source
PETSc.LibPETSc.TSMonitorDrawCtxDestroyMethod
TSMonitorDrawCtxDestroy(petsclib::PetscLibType,ictx::TSMonitorDrawCtx)

Destroys the monitor context for TSMonitorDrawSolution()

Collective

Input Parameter:

  • ictx - the monitor context

Level: intermediate

-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorDrawSolution(), TSMonitorDrawError(), TSMonitorDrawCtx

External Links

source
PETSc.LibPETSc.TSMonitorEnvelopeCtxCreateMethod
ctx::TSMonitorEnvelopeCtx = TSMonitorEnvelopeCtxCreate(petsclib::PetscLibType,ts::TS)

Creates a context for use with TSMonitorEnvelope()

Collective

Input Parameter:

  • ts - the TS solver object

Output Parameter:

  • ctx - the context

Level: intermediate

-seealso: , TS, TSMonitorLGTimeStep(), TSMonitorSet(), TSMonitorLGSolution(), TSMonitorLGError()

External Links

source
PETSc.LibPETSc.TSMonitorEnvelopeCtxDestroyMethod
TSMonitorEnvelopeCtxDestroy(petsclib::PetscLibType,ctx::TSMonitorEnvelopeCtx)

Destroys a context that was created with TSMonitorEnvelopeCtxCreate().

Collective

Input Parameter:

  • ctx - the monitor context

Level: intermediate

-seealso: , TS, TSMonitorLGCtxCreate(), TSMonitorSet(), TSMonitorLGTimeStep()

External Links

source
PETSc.LibPETSc.TSMonitorLGCtxCreateMethod
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 use
  • host - the X display to open, or NULL for the local machine
  • label - the title to put in the title bar
  • x - the x screen coordinates of the upper left coordinate of the window
  • y - the y screen coordinates of the upper left coordinate of the window
  • m - the screen width in pixels
  • n - the screen height in pixels
  • howoften - 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 calling TSMonitorLGSetDisplayVariables() or TSMonitorLGCtxSetDisplayVariables())
  • -ts_monitor_lg_error - monitor the error
  • -ts_monitor_lg_ksp_iterations - monitor the number of KSP iterations needed for each timestep
  • -ts_monitor_lg_snes_iterations - monitor the number of SNES iterations needed for each timestep
  • -lg_use_markers <true,false> - mark the data points (at each time step) on the plot; default is true

Level: intermediate

-seealso: , TSMonitorLGTimeStep(), TSMonitorSet(), TSMonitorLGSolution(), TSMonitorLGError(), TSMonitorDefault(), VecView(), TSMonitorLGCtxSetVariableNames(), TSMonitorLGCtxGetVariableNames(), TSMonitorLGSetVariableNames(), TSMonitorLGGetVariableNames(), TSMonitorLGSetDisplayVariables(), TSMonitorLGCtxSetDisplayVariables(), TSMonitorLGCtxSetTransform(), TSMonitorLGSetTransform(), TSMonitorLGSNESIterations(), TSMonitorLGKSPIterations(), TSMonitorEnvelopeCtxCreate(), TSMonitorEnvelopeGetBounds(), TSMonitorEnvelopeCtxDestroy(), TSMonitorEnvelop()

External Links

source
PETSc.LibPETSc.TSMonitorLGCtxDestroyMethod
TSMonitorLGCtxDestroy(petsclib::PetscLibType,ctx::TSMonitorLGCtx)

Destroys a line graph context that was created with TSMonitorLGCtxCreate().

Collective

Input Parameter:

  • ctx - the monitor context

Level: intermediate

-seealso: , TS, TSMonitorLGCtxCreate(), TSMonitorSet(), TSMonitorLGTimeStep()

External Links

source
PETSc.LibPETSc.TSMonitorLGCtxNetworkSolutionMethod
TSMonitorLGCtxNetworkSolution(petsclib::PetscLibType,ts::TS, step::PetscInt, ptime::PetscReal, u::PetscVec, dctx::Cvoid)

Monitors progress of the TS solvers for a DMNETWORK solution with one window for each vertex and each edge

Collective

Input Parameters:

  • ts - the TS context
  • step - current time-step
  • ptime - current time
  • u - current solution
  • dctx - the TSMonitorLGCtxNetwork object that contains all the options for the monitoring, this is created with TSMonitorLGCtxCreateNetwork()

Options Database Key:

  • -ts_monitor_lg_solution_variables - monitor solution variables

Level: intermediate

-seealso: , TS, TSMonitorLGCtxNetworkDestroy()

External Links

source
PETSc.LibPETSc.TSMonitorLGCtxSetDisplayVariablesMethod
TSMonitorLGCtxSetDisplayVariables(petsclib::PetscLibType,ctx::TSMonitorLGCtx, displaynames::Cchar)

Sets the variables that are to be display in the monitor

Collective

Input Parameters:

  • ctx - the TSMonitorLG context
  • displaynames - the names of the components, final string must be NULL

Level: intermediate

-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorLGSetVariableNames()

External Links

source
PETSc.LibPETSc.TSMonitorLGCtxSetTransformMethod
TSMonitorLGCtxSetTransform(petsclib::PetscLibType,ctx::TSMonitorLGCtx, transform::external, destroy::PetscCtxDestroyFn, tctx::Cvoid)

Solution vector will be transformed by provided function before being displayed

Collective

Input Parameters:

  • tctx - the TS context
  • transform - the transform function
  • destroy - function to destroy the optional context, see PetscCtxDestroyFn for its calling sequence
  • ctx - optional context used by transform function

Level: intermediate

-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorLGSetVariableNames(), TSMonitorLGSetTransform(), PetscCtxDestroyFn

External Links

source
PETSc.LibPETSc.TSMonitorLGCtxSetVariableNamesMethod
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 - the TS context
  • names - the names of the components, final string must be NULL

Level: intermediate

-seealso: , TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorLGSetDisplayVariables(), TSMonitorLGSetVariableNames()

External Links

source
PETSc.LibPETSc.TSMonitorSPCtxCreateMethod
ctx::TSMonitorSPCtx = TSMonitorSPCtxCreate(petsclib::PetscLibType,comm::MPI_Comm, host::String, label::String, x::Cint, y::Cint, m::Cint, n::Cint, howoften::PetscInt, retain::PetscInt, phase::PetscBool, multispecies::PetscBool)

External Links

source
PETSc.LibPETSc.TSMonitorSPEigCtxCreateMethod
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 monitor
  • host - the X display to open, or NULL for the local machine
  • label - the title to put in the title bar
  • x - the horizontal screen coordinates of the upper left coordinate of the window
  • y - the vertical coordinates of the upper left coordinate of the window
  • m - the screen width in pixels
  • n - the screen height in pixels
  • howoften - if positive then determines the frequency of the plotting, if -1 then only at the final time

Output Parameter:

  • ctx - the context

Options Database Key:

  • -ts_monitor_sp_eig - plot egienvalues of linearized right-hand side

Level: intermediate

-seealso: , TSMonitorSPEigTimeStep(), TSMonitorSet(), TSMonitorLGSolution(), TSMonitorLGError()

External Links

source
PETSc.LibPETSc.TSMonitorSPEigCtxDestroyMethod
TSMonitorSPEigCtxDestroy(petsclib::PetscLibType,ctx::TSMonitorSPEigCtx)

Destroys a scatter plot context that was created with TSMonitorSPEigCtxCreate().

Collective

Input Parameter:

  • ctx - the monitor context

Level: intermediate

-seealso: , TSMonitorSPEigCtxCreate(), TSMonitorSet(), TSMonitorSPEig()

External Links

source
PETSc.LibPETSc.TSTrajectoryCreateMethod
tj::TSTrajectory = TSTrajectoryCreate(petsclib::PetscLibType,comm::MPI_Comm)

This function creates an empty trajectory object used to store the time dependent solution of an ODE/DAE

Collective

Input Parameter:

  • comm - the communicator

Output Parameter:

  • tj - the trajectory object

Level: developer

-seealso: , TS, TSTrajectory, TSTrajectorySetUp(), TSTrajectoryDestroy(), TSTrajectorySetType(), TSTrajectorySetVariableNames(), TSGetTrajectory(), TSTrajectorySetKeepFiles()

External Links

source
PETSc.LibPETSc.TSTrajectoryDestroyMethod
TSTrajectoryDestroy(petsclib::PetscLibType,tj::TSTrajectory)

Destroys a trajectory context

Collective

Input Parameter:

  • tj - the TSTrajectory context obtained from TSTrajectoryCreate()

Level: developer

-seealso: , TSTrajectory, TSTrajectoryCreate(), TSTrajectorySetUp()

External Links

source
PETSc.LibPETSc.TSTrajectoryGetMethod
time::PetscReal = TSTrajectoryGet(petsclib::PetscLibType,tj::TSTrajectory, ts::TS, stepnum::PetscInt)

Updates the solution vector of a time stepper object by querying the TSTrajectory

Collective

Input Parameters:

  • tj - the trajectory object
  • ts - the time stepper object
  • stepnum - the step number

Output Parameter:

  • time - the time associated with the step number

Level: developer

-seealso: , TS, TSSolve(), TSTrajectorySetUp(), TSTrajectoryDestroy(), TSTrajectorySetType(), TSTrajectorySetVariableNames(), TSGetTrajectory(), TSTrajectorySet(), TSTrajectoryGetVecs(), TSGetSolution()

External Links

source
PETSc.LibPETSc.TSTrajectoryGetNumStepsMethod
steps::PetscInt = TSTrajectoryGetNumSteps(petsclib::PetscLibType,tj::TSTrajectory)

Return the number of steps registered in the TSTrajectory via TSTrajectorySet().

Not Collective.

Input Parameter:

  • tj - the trajectory object

Output Parameter:

  • steps - the number of steps

Level: developer

-seealso: , TS, TSTrajectorySet()

External Links

source
PETSc.LibPETSc.TSTrajectoryGetSolutionOnlyMethod
solution_only::PetscBool = TSTrajectoryGetSolutionOnly(petsclib::PetscLibType,tj::TSTrajectory)

Gets the value set with TSTrajectorySetSolutionOnly().

Logically Collective

Input Parameter:

  • tj - the TSTrajectory context

Output Parameter:

  • solution_only - the boolean flag

Level: developer

-seealso: , TSTrajectory, TSSetSaveTrajectory(), TSTrajectoryCreate(), TSTrajectoryDestroy(), TSTrajectorySetSolutionOnly()

External Links

source
PETSc.LibPETSc.TSTrajectoryGetTypeMethod
type::TSTrajectoryType = TSTrajectoryGetType(petsclib::PetscLibType,tj::TSTrajectory, ts::TS)

Gets the trajectory type

Collective

Input Parameters:

  • tj - the TSTrajectory context
  • ts - the TS context

Output Parameter:

  • type - a known method

Level: developer

-seealso: , TS, TSTrajectory, TSTrajectoryCreate(), TSTrajectorySetFromOptions(), TSTrajectoryDestroy(), TSTrajectorySetType()

External Links

source
PETSc.LibPETSc.TSTrajectoryGetUpdatedHistoryVecsMethod
TSTrajectoryGetUpdatedHistoryVecs(petsclib::PetscLibType,tj::TSTrajectory, ts::TS, time::PetscReal, U::PetscVec, Udot::PetscVec)

Get updated state and time

Collective

Input Parameters:

  • tj - the TSTrajectory context
  • ts - the TS solver context
  • time - the requested time

Output Parameters:

  • U - state vector at given time (can be interpolated)
  • Udot - time-derivative vector at given time (can be interpolated)

Level: developer

-seealso: , TSTrajectory, TSSetSaveTrajectory(), TSTrajectoryCreate(), TSTrajectoryDestroy(), TSTrajectoryRestoreUpdatedHistoryVecs(), TSTrajectoryGetVecs()

External Links

source
PETSc.LibPETSc.TSTrajectoryGetVecsMethod
time::PetscReal = TSTrajectoryGetVecs(petsclib::PetscLibType,tj::TSTrajectory, ts::TS, stepnum::PetscInt, U::PetscVec, Udot::PetscVec)

Reconstructs the vector of state and its time derivative using information from the TSTrajectory and, possibly, from the TS

Collective

Input Parameters:

  • tj - the trajectory object
  • ts - the time stepper object (optional)
  • stepnum - the requested step number

Output Parameters:

  • time - On input time for the step if step number is PETSC_DECIDE, on output the time associated with the step number
  • U - state vector (can be NULL)
  • Udot - time derivative of state vector (can be NULL)

Level: developer

-seealso: , TS, TSTrajectory, TSTrajectorySetUp(), TSTrajectoryDestroy(), TSTrajectorySetType(), TSTrajectorySetVariableNames(), TSGetTrajectory(), TSTrajectorySet(), TSTrajectoryGet()

External Links

source
PETSc.LibPETSc.TSTrajectoryMemorySetTypeMethod
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 - the TSTrajectory context
  • tj_memory_type - Revolve or CAMS

Options Database Key:

  • -ts_trajectory_memory_type <tj_memory_type> - petsc, revolve, cams

Level: intermediate

-seealso: , TSTrajectory, TSTrajectorySetMaxUnitsRAM(), TSTrajectoryMemoryType

External Links

source
PETSc.LibPETSc.TSTrajectoryRegisterMethod
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 routine
  • function - the creation routine itself

Level: developer

-seealso: , TSTrajectoryRegisterAll()

External Links

source
PETSc.LibPETSc.TSTrajectoryResetMethod
TSTrajectoryReset(petsclib::PetscLibType,tj::TSTrajectory)

Resets a trajectory context

Collective

Input Parameter:

  • tj - the TSTrajectory context obtained from TSGetTrajectory()

Level: developer

-seealso: , TS, TSTrajectory, TSTrajectoryCreate(), TSTrajectorySetUp()

External Links

source
PETSc.LibPETSc.TSTrajectoryRestoreUpdatedHistoryVecsMethod
TSTrajectoryRestoreUpdatedHistoryVecs(petsclib::PetscLibType,tj::TSTrajectory, U::PetscVec, Udot::PetscVec)

Restores updated state and time

Collective

Input Parameters:

  • tj - the TSTrajectory context
  • U - state vector at given time (can be interpolated)
  • Udot - time-derivative vector at given time (can be interpolated)

Level: developer

-seealso: , TSTrajectory, TSTrajectoryGetUpdatedHistoryVecs()

External Links

source
PETSc.LibPETSc.TSTrajectorySetMethod
TSTrajectorySet(petsclib::PetscLibType,tj::TSTrajectory, ts::TS, stepnum::PetscInt, time::PetscReal, X::PetscVec)

Sets a vector of state in the trajectory object

Collective

Input Parameters:

  • tj - the trajectory object
  • ts - the time stepper object (optional)
  • stepnum - the step number
  • time - the current time
  • X - the current solution

Level: developer

-seealso: , TSTrajectorySetUp(), TSTrajectoryDestroy(), TSTrajectorySetType(), TSTrajectorySetVariableNames(), TSGetTrajectory(), TSTrajectoryGet(), TSTrajectoryGetVecs()

External Links

source
PETSc.LibPETSc.TSTrajectorySetDirnameMethod
TSTrajectorySetDirname(petsclib::PetscLibType,tj::TSTrajectory, dirname::String)

Specify the name of the directory where TSTrajectory disk checkpoints are stored.

Collective

Input Parameters:

  • tj - the TSTrajectory context
  • dirname - the directory name

Options Database Key:

  • -ts_trajectory_dirname - set the directory name

Level: developer

-seealso: , TSTrajectory, TSTrajectorySetFiletemplate(), TSTrajectorySetUp()

External Links

source
PETSc.LibPETSc.TSTrajectorySetFiletemplateMethod
TSTrajectorySetFiletemplate(petsclib::PetscLibType,tj::TSTrajectory, filetemplate::String)

Specify the name template for the files storing TSTrajectory checkpoints.

Collective

Input Parameters:

  • tj - the TSTrajectory context
  • filetemplate - the template

Options Database Key:

  • -ts_trajectory_file_template - set the file name template

Level: developer

-seealso: , TSTrajectory, TSTrajectorySetDirname(), TSTrajectorySetUp()

External Links

source
PETSc.LibPETSc.TSTrajectorySetFromOptionsMethod
TSTrajectorySetFromOptions(petsclib::PetscLibType,tj::TSTrajectory, ts::TS)

Sets various TSTrajectory parameters from user options.

Collective

Input Parameters:

  • tj - the TSTrajectory context obtained from TSGetTrajectory()
  • ts - the TS context

Options Database Keys:

  • -ts_trajectory_type <type> - basic, memory, singlefile, visualization
  • -ts_trajectory_keep_files <true,false> - keep the files generated by the code after the program ends. This is true by default for singlefile and visualization
  • -ts_trajectory_monitor - print TSTrajectory information

Level: developer

-seealso: , TSTrajectory, TSSetSaveTrajectory(), TSTrajectorySetUp()

External Links

source
PETSc.LibPETSc.TSTrajectorySetKeepFilesMethod
TSTrajectorySetKeepFiles(petsclib::PetscLibType,tj::TSTrajectory, flg::PetscBool)

Keep the files generated by the TSTrajectory once the program is done

Collective

Input Parameters:

  • tj - the TSTrajectory context
  • flg - PETSC_TRUE to save, PETSC_FALSE to disable

Options Database Key:

  • -ts_trajectory_keep_files - have it keep the files

Level: advanced

-seealso: , TSTrajectoryCreate(), TSTrajectoryDestroy(), TSTrajectorySetUp(), TSTrajectorySetMonitor()

External Links

source
PETSc.LibPETSc.TSTrajectorySetMaxCpsDiskMethod
max_cps_disk::PetscInt = TSTrajectorySetMaxCpsDisk(petsclib::PetscLibType,tj::TSTrajectory)

Set maximum number of checkpoints on disk

Logically Collective

Input Parameter:

  • tj - tstrajectory context

Output Parameter:

  • max_cps_disk - maximum number of checkpoints on disk

Level: intermediate

-seealso: , TSTrajectory, TSTrajectorySetMaxUnitsDisk(), TSTrajectorySetMaxUnitsRAM()

External Links

source
PETSc.LibPETSc.TSTrajectorySetMaxCpsRAMMethod
max_cps_ram::PetscInt = TSTrajectorySetMaxCpsRAM(petsclib::PetscLibType,tj::TSTrajectory)

Set maximum number of checkpoints in RAM

Logically Collective

Input Parameter:

  • tj - tstrajectory context

Output Parameter:

  • max_cps_ram - maximum number of checkpoints in RAM

Level: intermediate

-seealso: , TSTrajectory, TSTrajectorySetMaxUnitsRAM()

External Links

source
PETSc.LibPETSc.TSTrajectorySetMaxUnitsDiskMethod
max_units_disk::PetscInt = TSTrajectorySetMaxUnitsDisk(petsclib::PetscLibType,tj::TSTrajectory)

Set maximum number of checkpointing units on disk

Logically Collective

Input Parameter:

  • tj - tstrajectory context

Output Parameter:

  • max_units_disk - maximum number of checkpointing units on disk

Level: intermediate

-seealso: , TSTrajectory, TSTrajectorySetMaxCpsDisk()

External Links

source
PETSc.LibPETSc.TSTrajectorySetMaxUnitsRAMMethod
max_units_ram::PetscInt = TSTrajectorySetMaxUnitsRAM(petsclib::PetscLibType,tj::TSTrajectory)

Set maximum number of checkpointing units in RAM

Logically Collective

Input Parameter:

  • tj - tstrajectory context

Output Parameter:

  • max_units_ram - maximum number of checkpointing units in RAM

Level: intermediate

-seealso: , TSTrajectory, TSTrajectorySetMaxCpsRAM()

External Links

source
PETSc.LibPETSc.TSTrajectorySetMonitorMethod
TSTrajectorySetMonitor(petsclib::PetscLibType,tj::TSTrajectory, flg::PetscBool)

Monitor the schedules generated by the TSTrajectory checkpointing controller

Collective

Input Parameters:

  • tj - the TSTrajectory context
  • flg - PETSC_TRUE to active a monitor, PETSC_FALSE to disable

Options Database Key:

  • -ts_trajectory_monitor - print TSTrajectory information

Level: developer

-seealso: , TSTrajectory, TSTrajectoryCreate(), TSTrajectoryDestroy(), TSTrajectorySetUp()

External Links

source
PETSc.LibPETSc.TSTrajectorySetSolutionOnlyMethod
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 - the TSTrajectory context obtained with TSGetTrajectory()
  • solution_only - the boolean flag

Level: developer

-seealso: , TSTrajectory, TSSetSaveTrajectory(), TSTrajectoryCreate(), TSTrajectoryDestroy(), TSTrajectoryGetSolutionOnly()

External Links

source
PETSc.LibPETSc.TSTrajectorySetTransformMethod
TSTrajectorySetTransform(petsclib::PetscLibType,tj::TSTrajectory, transform::external, destroy::external, tctx::Cvoid)

Solution vector will be transformed by provided function before being saved to disk

Collective

Input Parameters:

  • tj - the TSTrajectory context
  • transform - the transform function
  • destroy - function to destroy the optional context
  • tctx - optional context used by transform function

Level: intermediate

-seealso: , TSTrajectorySetVariableNames(), TSTrajectory, TSMonitorLGSetTransform()

External Links

source
PETSc.LibPETSc.TSTrajectorySetTypeMethod
TSTrajectorySetType(petsclib::PetscLibType,tj::TSTrajectory, ts::TS, type::TSTrajectoryType)

Sets the storage method to be used as in a trajectory

Collective

Input Parameters:

  • tj - the TSTrajectory context
  • ts - the TS context
  • type - a known method

Options Database Key:

  • -ts_trajectory_type <type> - Sets the method; use -help for a list of available methods (for instance, basic)

Level: developer

-seealso: , TSTrajectory, TS, TSTrajectoryCreate(), TSTrajectorySetFromOptions(), TSTrajectoryDestroy(), TSTrajectoryGetType()

External Links

source
PETSc.LibPETSc.TSTrajectorySetUpMethod
TSTrajectorySetUp(petsclib::PetscLibType,tj::TSTrajectory, ts::TS)

Sets up the internal data structures, e.g. stacks, for the later use of a TS TSTrajectory.

Collective

Input Parameters:

  • tj - the TSTrajectory context
  • ts - the TS context obtained from TSCreate()

Level: developer

-seealso: , TSTrajectory, TSSetSaveTrajectory(), TSTrajectoryCreate(), TSTrajectoryDestroy()

External Links

source
PETSc.LibPETSc.TSTrajectorySetUseHistoryMethod
TSTrajectorySetUseHistory(petsclib::PetscLibType,tj::TSTrajectory, flg::PetscBool)

Use TSHistory in TSTrajectory

Collective

Input Parameters:

  • tj - the TSTrajectory context
  • flg - PETSC_TRUE to save, PETSC_FALSE to disable

Options Database Key:

  • -ts_trajectory_use_history - have it use TSHistory

Level: advanced

-seealso: , TSTrajectory, TSTrajectoryCreate(), TSTrajectoryDestroy(), TSTrajectorySetUp()

External Links

source
PETSc.LibPETSc.TSTrajectorySetVariableNamesMethod
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 context
  • names - the names of the components, final string must be NULL

Level: intermediate

-seealso: , TSTrajectory, TSGetTrajectory()

External Links

source
PETSc.LibPETSc.TSTrajectoryViewMethod
TSTrajectoryView(petsclib::PetscLibType,tj::TSTrajectory, viewer::PetscViewer)

Prints information about the trajectory object

Collective

Input Parameters:

  • tj - the TSTrajectory context obtained from TSTrajectoryCreate()
  • viewer - visualization context

Options Database Key:

  • -ts_trajectory_view - calls TSTrajectoryView() at end of TSAdjointStep()

Level: developer

-seealso: , TS, TSTrajectory, PetscViewer, PetscViewerASCIIOpen()

External Links

source
PETSc.LibPETSc.TSTrajectoryViewFromOptionsMethod
TSTrajectoryViewFromOptions(petsclib::PetscLibType,A::TSTrajectory, obj::PetscObject, name::String)

View a TSTrajectory based on values in the options database

Collective

Input Parameters:

  • A - the TSTrajectory context
  • obj - Optional object that provides prefix used for option name
  • name - command line option

Level: intermediate

-seealso: , TSTrajectory, TSTrajectoryView, PetscObjectViewFromOptions(), TSTrajectoryCreate()

External Links

source