TS (Time Stepping) - Low-level Interface

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

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

Overview

TS supports various time integration methods including:

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

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

Basic Usage

using PETSc, MPI

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

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

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

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

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

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

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

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

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

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

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

# Cleanup
LibPETSc.TSDestroy(petsclib, ts)

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

Common Workflow

  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.TS2GetSolution — Method
u::PetscVec,v::PetscVec = TS2GetSolution(petsclib::PetscLibType, ts::AbstractTS)

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

Not Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameters:

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

Level: intermediate

See also: TS, TS2SetSolution(), TSGetTimeStep(), TSGetTime()

External Links

source
PETSc.LibPETSc.TS2SetSolution — Method
TS2SetSolution(petsclib::PetscLibType, ts::AbstractTS, u::AbstractPetscVec, v::AbstractPetscVec)

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

Logically Collective

Input Parameters:

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

Level: beginner

See also: TS

External Links

source
PETSc.LibPETSc.TSARKIMEXGetFastSlowSplit — Method
fastslow::PetscBool = TSARKIMEXGetFastSlowSplit(petsclib::PetscLibType, ts::AbstractTS)

Gets whether to use TSARKIMEX for a fast-slow system

Not Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

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

Level: intermediate

See also: TSARKIMEX, TSARKIMEXSetFastSlowSplit()

External Links

source
PETSc.LibPETSc.TSARKIMEXGetFullyImplicit — Method
flg::PetscBool = TSARKIMEXGetFullyImplicit(petsclib::PetscLibType, ts::AbstractTS)

Inquires if both parts of the equation are solved implicitly

Logically Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

  • flg - PETSC_TRUE for fully implicit

Level: intermediate

See also: TSARKIMEXGetType(), TSARKIMEXSetFullyImplicit()

External Links

source
PETSc.LibPETSc.TSARKIMEXGetType — Method
arktype::String = TSARKIMEXGetType(petsclib::PetscLibType, ts::AbstractTS)

Get the type of TSARKIMEX scheme

Logically Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

  • arktype - type of TSARKIMEX scheme

Level: intermediate

See also: TSARKIMEX

External Links

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

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

Logically Collective

Input Parameters:

  • name - identifier for 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

See also: TSARKIMEX, TSType, TS

External Links

source
PETSc.LibPETSc.TSARKIMEXSetFastSlowSplit — Method
TSARKIMEXSetFastSlowSplit(petsclib::PetscLibType, ts::AbstractTS, fastslow::PetscBool)

Use TSARKIMEX for solving a fast-slow system

Logically Collective

Input Parameters:

  • ts - timestepping 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) - enables the TSARKIMEX solver for a fast-slow system where the RHS is split component-wise

Level: intermediate

See also: TSARKIMEX, TSARKIMEXGetFastSlowSplit(), TSRHSSplitSetIS()

External Links

source
PETSc.LibPETSc.TSARKIMEXSetFullyImplicit — Method
TSARKIMEXSetFullyImplicit(petsclib::PetscLibType, ts::AbstractTS, flg::PetscBool)

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

Logically Collective

Input Parameters:

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

Options Database Key:

  • -ts_arkimex_fully_implicit (true|false) - Solve both parts of the equation implicitly

Level: intermediate

See also: TSARKIMEX, TSARKIMEXGetType(), TSARKIMEXGetFullyImplicit()

External Links

source
PETSc.LibPETSc.TSARKIMEXSetType — Method
TSARKIMEXSetType(petsclib::PetscLibType, ts::AbstractTS, arktype::String)

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, see TSARKIMEXType

Level: intermediate

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

External Links

source
PETSc.LibPETSc.TSAdjointMonitor — Method
TSAdjointMonitor(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, numcost::PetscInt, lambda::Vector{<:AbstractPetscVec}, mu::Vector{<:AbstractPetscVec})

Runs all user-provided adjoint monitor routines set using TSAdjointMonitorSet()

Collective

Input Parameters:

  • ts - time stepping context obtained 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

See also: TSAdjointMonitorSet(), TSAdjointSolve()

External Links

source
PETSc.LibPETSc.TSAdjointMonitorDefault — Method
TSAdjointMonitorDefault(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, time::PetscReal, v::AbstractPetscVec, numcost::PetscInt, lambda::Vector{<:AbstractPetscVec}, mu::Vector{<:AbstractPetscVec}, vf::Vector{PetscViewerAndFormat})

the default monitor of adjoint computations

Input Parameters:

  • ts - 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 functions
  • lambda - sensitivities to initial conditions
  • mu - sensitivities to parameters
  • vf - the viewer and format

Level: intermediate

See also: TS, TSAdjointSolve(), TSAdjointMonitorSet()

External Links

source
PETSc.LibPETSc.TSAdjointMonitorDrawSensi — Method
TSAdjointMonitorDrawSensi(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, numcost::PetscInt, lambda::Vector{<:AbstractPetscVec}, mu::Vector{<:AbstractPetscVec}, dummy::Ptr{Cvoid})

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

Collective

Input Parameters:

  • ts - 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

See also: TSAdjointSolve(), TSAdjointMonitorSet(), TSAdjointMonitorDefault(), VecView()

External Links

source
PETSc.LibPETSc.TSAdjointMonitorSet — Method
TSAdjointMonitorSet(petsclib::PetscLibType, ts::AbstractTS, adjointmonitor::external, adjointmctx::Ptr{Cvoid}, adjointmdestroy::Ptr{Cvoid})

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

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • adjointmonitor - monitoring routine
  • adjointmctx - [optional] 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 functions
  • lambda - sensitivities to initial conditions
  • mu - sensitivities to parameters
  • adjointmctx - [optional] adjoint monitoring context

Level: intermediate

See also: TS, TSAdjointSolve(), TSAdjointMonitorCancel(), PetscCtxDestroyFn

External Links

source
PETSc.LibPETSc.TSAdjointMonitorSetFromOptions — Method
TSAdjointMonitorSetFromOptions(petsclib::PetscLibType, ts::AbstractTS, name::String, help::String, manual::String, monitor::external, monitorsetup::external)

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

Collective

Input Parameters:

  • ts - 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

Calling sequence of monitor:

  • 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
  • u - current iterate
  • numcost - number of cost functions
  • lambda - sensitivities to initial conditions
  • mu - sensitivities to parameters
  • vf - the PetscViewer and format the monitor is using

Calling sequence of monitorsetup:

  • ts - the TS object being monitored
  • vf - the PetscViewer and format the monitor is using

Level: developer

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

External Links

source
PETSc.LibPETSc.TSAdjointReset — Method
TSAdjointReset(petsclib::PetscLibType, ts::AbstractTS)

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

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Level: beginner

See also: TSCreate(), TSAdjointSetUp(), TSDestroy()

External Links

source
PETSc.LibPETSc.TSAdjointResetForward — Method
TSAdjointResetForward(petsclib::PetscLibType, ts::AbstractTS)

Reset the tangent linear solver and destroy the tangent linear context

Logically Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Level: intermediate

See also: TSAdjointSetForward()

External Links

source
PETSc.LibPETSc.TSAdjointSetForward — Method
TSAdjointSetForward(petsclib::PetscLibType, ts::AbstractTS, didp::AbstractPetscMat)

Trigger the tangent linear solver and initialize the forward sensitivities

Logically Collective

Input Parameters:

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

Level: intermediate

See also: TSAdjointSolve(), TSSetCostHessianProducts(), TSAdjointResetForward()

External Links

source
PETSc.LibPETSc.TSAdjointSetFromOptions — Method
TSAdjointSetFromOptions(petsclib::PetscLibType, ts::AbstractTS, 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

See also: TSSetSaveTrajectory(), TSTrajectorySetUp()

External Links

source
PETSc.LibPETSc.TSAdjointSetSteps — Method
TSAdjointSetSteps(petsclib::PetscLibType, ts::AbstractTS, steps::PetscInt)

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

Logically Collective

Input Parameters:

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

Level: intermediate

See also: TSAdjointSolve(), TS, TSSetExactFinalTime()

External Links

source
PETSc.LibPETSc.TSAdjointSetUp — Method
TSAdjointSetUp(petsclib::PetscLibType, ts::AbstractTS)

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

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Level: advanced

See also: TSCreate(), TSAdjointStep(), TSSetCostGradients()

External Links

source
PETSc.LibPETSc.TSAdjointSolve — Method
TSAdjointSolve(petsclib::PetscLibType, ts::AbstractTS)

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

See also: TSCreate(), TSSetCostGradients(), TSSetSolution(), TSAdjointStep()

External Links

source
PETSc.LibPETSc.TSAdjointStep — Method
TSAdjointStep(petsclib::PetscLibType, ts::AbstractTS)

Steps one time step backward in the adjoint run

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Level: intermediate

See also: TSAdjointSetUp(), TSAdjointSolve()

External Links

source
PETSc.LibPETSc.TSAlpha2GetParams — Method
alpha_m::PetscReal,alpha_f::PetscReal,gamma::PetscReal,beta::PetscReal = TSAlpha2GetParams(petsclib::PetscLibType, ts::AbstractTS)

gets the algorithmic parameters for TSALPHA2

Not Collective

Input Parameter:

  • ts - timestepping context

Output Parameters:

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

Level: advanced

See also: TS, TSALPHA2, TSAlpha2SetRadius(), TSAlpha2SetParams()

External Links

source
PETSc.LibPETSc.TSAlpha2SetParams — Method
TSAlpha2SetParams(petsclib::PetscLibType, ts::AbstractTS, alpha_m::PetscReal, alpha_f::PetscReal, gamma::PetscReal, beta::PetscReal)

sets the algorithmic parameters for TSALPHA2

Logically Collective

Input Parameters:

  • ts - timestepping 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

See also: TS, TSALPHA2, TSAlpha2SetRadius(), TSAlpha2GetParams()

External Links

source
PETSc.LibPETSc.TSAlpha2SetPredictor — Method
TSAlpha2SetPredictor(petsclib::PetscLibType, ts::AbstractTS, predictor::Ptr{Cvoid}, ctx::Ptr{Cvoid})

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

Input Parameters:

  • ts - timestepping 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

See also: TS, TSALPHA2, TSAlpha2PredictorFn

External Links

source
PETSc.LibPETSc.TSAlpha2SetRadius — Method
TSAlpha2SetRadius(petsclib::PetscLibType, ts::AbstractTS, radius::PetscReal)

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

Logically Collective

Input Parameters:

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

Options Database Key:

  • -ts_alpha_radius radius - set the desired spectral radius

Level: intermediate

See also: TS, TSALPHA2, TSAlpha2SetParams(), TSAlpha2GetParams()

External Links

source
PETSc.LibPETSc.TSAlphaGetParams — Method
alpha_m::PetscReal,alpha_f::PetscReal,gamma::PetscReal = TSAlphaGetParams(petsclib::PetscLibType, ts::AbstractTS)

gets the algorithmic parameters for TSALPHA

Not Collective

Input Parameter:

  • ts - timestepping context

Output Parameters:

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

Level: advanced

See also: TS, TSALPHA, TSAlphaSetRadius(), TSAlphaSetParams()

External Links

source
PETSc.LibPETSc.TSAlphaSetParams — Method
TSAlphaSetParams(petsclib::PetscLibType, ts::AbstractTS, alpha_m::PetscReal, alpha_f::PetscReal, gamma::PetscReal)

sets the algorithmic parameters for TSALPHA

Logically Collective

Input Parameters:

  • ts - timestepping 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

See also: TS, TSALPHA, TSAlphaSetRadius(), TSAlphaGetParams()

External Links

source
PETSc.LibPETSc.TSAlphaSetRadius — Method
TSAlphaSetRadius(petsclib::PetscLibType, ts::AbstractTS, radius::PetscReal)

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

Logically Collective

Input Parameters:

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

Options Database Key:

  • -ts_alpha_radius radius - set alpha radius

Level: intermediate

See also: TS, TSALPHA, TSAlphaSetParams(), TSAlphaGetParams()

External Links

source
PETSc.LibPETSc.TSAppendOptionsPrefix — Method
TSAppendOptionsPrefix(petsclib::PetscLibType, ts::AbstractTS, prefix::String)

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

Logically Collective

Input Parameters:

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

Level: advanced

See also: TS, TSGetOptionsPrefix(), TSSetOptionsPrefix(), TSSetFromOptions()

External Links

source
PETSc.LibPETSc.TSBDFGetOrder — Method
order::PetscInt = TSBDFGetOrder(petsclib::PetscLibType, ts::AbstractTS)

Get the order of the TSBDF method

Not Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

  • order - order of the method

Level: intermediate

See also: TSBDFSetOrder(), TS, TSBDF

External Links

source
PETSc.LibPETSc.TSBDFSetOrder — Method
TSBDFSetOrder(petsclib::PetscLibType, ts::AbstractTS, 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

See also: TSBDFGetOrder(), TS, TSBDF

External Links

source
PETSc.LibPETSc.TSBasicSymplecticGetType — Method
TSBasicSymplecticGetType(petsclib::PetscLibType, ts::AbstractTS, bsymptype::TSBasicSymplecticType)

Get the type of the basic symplectic method

Logically Collective

Input Parameters:

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

Level: intermediate

See also: TSBASICSYMPLECTIC, TSBasicSymplecticType, TSBasicSymplecticSetType()

External Links

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

register a basic symplectic integration scheme by providing the coefficients.

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

Input Parameters:

  • name - identifier for 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

See also: TSBASICSYMPLECTIC

External Links

source
PETSc.LibPETSc.TSBasicSymplecticRegisterAll — Method
TSBasicSymplecticRegisterAll(petsclib::PetscLibType)

Registers all of the basic symplectic integration methods in TSBASICSYMPLECTIC

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

Level: advanced

See also: TSBASICSYMPLECTIC, TSBasicSymplecticRegisterDestroy()

External Links

source
PETSc.LibPETSc.TSBasicSymplecticSetType — Method
TSBasicSymplecticSetType(petsclib::PetscLibType, ts::AbstractTS, bsymptype::String)

Set the type of the basic symplectic method

Logically Collective

Input Parameters:

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

Options Database Key:

  • -ts_basicsymplectic_type scheme - select the scheme

Level: intermediate

See also: TSBASICSYMPLECTIC, TSBasicSymplecticType

External Links

source
PETSc.LibPETSc.TSClone — Method
tsout::TS = TSClone(petsclib::PetscLibType, tsin::AbstractTS)

This function clones a time step TS object.

Collective

Input Parameter:

  • tsin - The input TS

Output Parameter:

  • tsout - The output TS (cloned)

Level: developer

See also: TS, SNES, TSCreate(), TSSetType(), TSSetUp(), TSDestroy(), TSSetProblemType()

External Links

source
PETSc.LibPETSc.TSComputeCostIntegrand — Method
TSComputeCostIntegrand(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Q::AbstractPetscVec)

Evaluates the integral function in the cost functions.

Input Parameters:

  • ts - 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

See also: TS, TSAdjointSolve(), TSSetCostIntegrand()

External Links

source
PETSc.LibPETSc.TSComputeExactError — Method
TSComputeExactError(petsclib::PetscLibType, ts::AbstractTS, u::AbstractPetscVec, e::AbstractPetscVec)

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

Collective

Input Parameters:

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

Level: advanced

See also: TS, TSGetComputeInitialCondition(), TSSetComputeInitialCondition(), TSSolve()

External Links

source
PETSc.LibPETSc.TSComputeForcingFunction — Method
TSComputeForcingFunction(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec)

Evaluates the forcing function.

Collective

Input Parameters:

  • ts - the TS context
  • t - current time

Output Parameter:

  • U - the function value

Level: developer

See also: TS, TSSetSolutionFunction(), TSSetRHSFunction(), TSComputeIFunction()

External Links

source
PETSc.LibPETSc.TSComputeI2Function — Method
TSComputeI2Function(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, V::AbstractPetscVec, A::AbstractPetscVec, F::AbstractPetscVec)

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

Collective

Input Parameters:

  • ts - 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

See also: TS, TSSetI2Function(), TSGetI2Function()

External Links

source
PETSc.LibPETSc.TSComputeI2Jacobian — Method
TSComputeI2Jacobian(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, V::AbstractPetscVec, A::AbstractPetscVec, shiftV::PetscReal, shiftA::PetscReal, J::AbstractPetscMat, P::AbstractPetscMat)

Evaluates the Jacobian of the DAE

Collective

Input Parameters:

  • ts - 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

See also: TS, TSSetI2Jacobian()

External Links

source
PETSc.LibPETSc.TSComputeIFunction — Method
TSComputeIFunction(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Udot::AbstractPetscVec, Y::AbstractPetscVec, imex::PetscBool)

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

Collective

Input Parameters:

  • ts - 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

See also: TS, TSSetIFunction(), TSComputeRHSFunction()

External Links

source
PETSc.LibPETSc.TSComputeIFunctionLinear — Method
TSComputeIFunctionLinear(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Udot::AbstractPetscVec, F::AbstractPetscVec, ctx::Ptr{Cvoid})

Evaluate the left hand side via the user-provided Jacobian, for linear problems only

Collective

Input Parameters:

  • ts - time stepping 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

See also: TS, TSSetIFunction(), TSSetIJacobian(), TSComputeIJacobianConstant(), TSComputeRHSFunctionLinear()

External Links

source
PETSc.LibPETSc.TSComputeIHessianProductFunctionPP — Method
TSComputeIHessianProductFunctionPP(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Vl::Vector{<:AbstractPetscVec}, Vr::AbstractPetscVec, VHV::Vector{<:AbstractPetscVec})

Runs the user-defined vector-Hessian-vector product function for Fpp.

Collective

Input Parameters:

  • ts - 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

See also: TSSetIHessianProduct()

External Links

source
PETSc.LibPETSc.TSComputeIHessianProductFunctionPU — Method
TSComputeIHessianProductFunctionPU(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Vl::Vector{<:AbstractPetscVec}, Vr::AbstractPetscVec, VHV::Vector{<:AbstractPetscVec})

Runs the user-defined vector-Hessian-vector product function for Fpu.

Collective

Input Parameters:

  • ts - 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

See also: TSSetIHessianProduct()

External Links

source
PETSc.LibPETSc.TSComputeIHessianProductFunctionUP — Method
TSComputeIHessianProductFunctionUP(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Vl::Vector{<:AbstractPetscVec}, Vr::AbstractPetscVec, VHV::Vector{<:AbstractPetscVec})

Runs the user-defined vector-Hessian-vector product function for Fup.

Collective

Input Parameters:

  • ts - 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

See also: TSSetIHessianProduct()

External Links

source
PETSc.LibPETSc.TSComputeIHessianProductFunctionUU — Method
TSComputeIHessianProductFunctionUU(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Vl::Vector{<:AbstractPetscVec}, Vr::AbstractPetscVec, VHV::Vector{<:AbstractPetscVec})

Runs the user-defined vector-Hessian-vector product function for Fuu.

Collective

Input Parameters:

  • ts - 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

See also: TSSetIHessianProduct()

External Links

source
PETSc.LibPETSc.TSComputeIJacobian — Method
TSComputeIJacobian(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Udot::AbstractPetscVec, shift::PetscReal, A::AbstractPetscMat, B::AbstractPetscMat, imex::PetscBool)

Evaluates the Jacobian of the DAE

Collective

Input Parameters:

  • ts - 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

See also: TS, TSSetIJacobian()

External Links

source
PETSc.LibPETSc.TSComputeIJacobianConstant — Method
TSComputeIJacobianConstant(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Udot::AbstractPetscVec, shift::PetscReal, A::AbstractPetscMat, B::AbstractPetscMat, ctx::Ptr{Cvoid})

Reuses the matrix previously computed with the provided TSIJacobianFn for a semi-implicit DAE or ODE

Collective

Input Parameters:

  • ts - time stepping 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

See also: TS, TSROSW, TSARKIMEX, TSSetIFunction(), TSSetIJacobian(), TSComputeIFunctionLinear()

External Links

source
PETSc.LibPETSc.TSComputeIJacobianDefaultColor — Method
TSComputeIJacobianDefaultColor(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Udot::AbstractPetscVec, shift::PetscReal, J::AbstractPetscMat, B::AbstractPetscMat, ctx::Ptr{Cvoid})

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

Collective

Input Parameters:

  • ts - 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 application 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

See also: TS, TSSetIJacobian(), MatFDColoringCreate(), MatFDColoringSetFunction()

External Links

source
PETSc.LibPETSc.TSComputeIJacobianP — Method
TSComputeIJacobianP(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Udot::AbstractPetscVec, shift::PetscReal, Amat::AbstractPetscMat, imex::PetscBool)

Runs the user-defined IJacobianP function.

Collective

Input Parameters:

  • ts - 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

See also: TS, TSSetIJacobianP()

External Links

source
PETSc.LibPETSc.TSComputeInitialCondition — Method
TSComputeInitialCondition(petsclib::PetscLibType, ts::AbstractTS, u::AbstractPetscVec)

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

Collective

Input Parameters:

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

Level: advanced

See also: TS, TSGetComputeInitialCondition(), TSSetComputeInitialCondition(), TSSolve()

External Links

source
PETSc.LibPETSc.TSComputeLinearStability — Method
yr::PetscReal,yi::PetscReal = TSComputeLinearStability(petsclib::PetscLibType, ts::AbstractTS, xr::PetscReal, xi::PetscReal)

computes the linear stability function at a point

Collective

Input Parameters:

  • ts - 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

See also: TS, TSSetRHSFunction(), TSComputeIFunction()

External Links

source
PETSc.LibPETSc.TSComputeRHSFunction — Method
TSComputeRHSFunction(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, y::AbstractPetscVec)

Evaluates the right-hand-side function for a TS

Collective

Input Parameters:

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

Output Parameter:

  • y - right-hand side

Level: developer

See also: TS, TSSetRHSFunction(), TSComputeIFunction()

External Links

source
PETSc.LibPETSc.TSComputeRHSFunctionLinear — Method
TSComputeRHSFunctionLinear(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, F::AbstractPetscVec, ctx::Ptr{Cvoid})

Evaluate the right-hand side via the user-provided Jacobian, for linear problems Udot = A U only

Collective

Input Parameters:

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

Output Parameter:

  • F - right-hand side

Level: intermediate

See also: TS, TSSetRHSFunction(), TSSetRHSJacobian(), TSComputeRHSJacobianConstant()

External Links

source
PETSc.LibPETSc.TSComputeRHSHessianProductFunctionPP — Method
TSComputeRHSHessianProductFunctionPP(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Vl::Vector{<:AbstractPetscVec}, Vr::AbstractPetscVec, VHV::Vector{<:AbstractPetscVec})

Runs the user-defined vector-Hessian-vector product function for G_{pp}.

Collective

Input Parameters:

  • ts - 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

See also: TSSetRHSHessianProduct()

External Links

source
PETSc.LibPETSc.TSComputeRHSHessianProductFunctionPU — Method
TSComputeRHSHessianProductFunctionPU(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Vl::Vector{<:AbstractPetscVec}, Vr::AbstractPetscVec, VHV::Vector{<:AbstractPetscVec})

Runs the user-defined vector-Hessian-vector product function for G_{pu}.

Collective

Input Parameters:

  • ts - 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

See also: TSSetRHSHessianProduct()

External Links

source
PETSc.LibPETSc.TSComputeRHSHessianProductFunctionUP — Method
TSComputeRHSHessianProductFunctionUP(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Vl::Vector{<:AbstractPetscVec}, Vr::AbstractPetscVec, VHV::Vector{<:AbstractPetscVec})

Runs the user-defined vector-Hessian-vector product function for G_{up}.

Collective

Input Parameters:

  • ts - 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

See also: TS, TSSetRHSHessianProduct()

External Links

source
PETSc.LibPETSc.TSComputeRHSHessianProductFunctionUU — Method
TSComputeRHSHessianProductFunctionUU(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Vl::Vector{<:AbstractPetscVec}, Vr::AbstractPetscVec, VHV::Vector{<:AbstractPetscVec})

Runs the user-defined vector-Hessian-vector product function for G_{uu}.

Collective

Input Parameters:

  • ts - 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

See also: TS, TSSetRHSHessianProduct()

External Links

source
PETSc.LibPETSc.TSComputeRHSJacobian — Method
TSComputeRHSJacobian(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, A::AbstractPetscMat, B::AbstractPetscMat)

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

Collective

Input Parameters:

  • ts - 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

See also: TS, TSSetRHSJacobian(), KSPSetOperators()

External Links

source
PETSc.LibPETSc.TSComputeRHSJacobianConstant — Method
TSComputeRHSJacobianConstant(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, A::AbstractPetscMat, B::AbstractPetscMat, ctx::Ptr{Cvoid})

Reuses a Jacobian that is time-independent.

Collective

Input Parameters:

  • ts - time stepping 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

See also: TS, TSSetRHSFunction(), TSSetRHSJacobian(), TSComputeRHSFunctionLinear()

External Links

source
PETSc.LibPETSc.TSComputeRHSJacobianP — Method
TSComputeRHSJacobianP(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec, Amat::AbstractPetscMat)

Runs the user-defined JacobianP function.

Collective

Input Parameters:

  • ts - 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

See also: TSSetRHSJacobianP(), TS

External Links

source
PETSc.LibPETSc.TSComputeSNESJacobian — Method
TSComputeSNESJacobian(petsclib::PetscLibType, ts::AbstractTS, x::AbstractPetscVec, J::AbstractPetscMat, Jpre::AbstractPetscMat)

Compute the Jacobian needed for the SNESSolve() in TS

Collective

Input Parameters:

  • ts - 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

See also: SNES, TS, SNESSetJacobian(), TSSetRHSJacobian(), TSSetIJacobian()

External Links

source
PETSc.LibPETSc.TSComputeSolutionFunction — Method
TSComputeSolutionFunction(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec)

Evaluates the solution function.

Collective

Input Parameters:

  • ts - the TS context
  • t - current time

Output Parameter:

  • U - the solution

Level: developer

See also: TS, TSSetSolutionFunction(), TSSetRHSFunction(), TSComputeIFunction()

External Links

source
PETSc.LibPETSc.TSComputeTransientVariable — Method
TSComputeTransientVariable(petsclib::PetscLibType, ts::AbstractTS, U::AbstractPetscVec, C::AbstractPetscVec)

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

Logically Collective

Input Parameters:

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

Output Parameter:

  • C - transient (conservative) variable

Level: developer

See also: TS, TSBDF, DMTSSetTransientVariable(), TSComputeIFunction(), TSComputeIJacobian()

External Links

source
PETSc.LibPETSc.TSCreate — Method
ts::TS = TSCreate(petsclib::PetscLibType, comm::MPI_Comm)

This function creates an empty timestepper. The problem type can then be set with TSSetProblemType() and the type of solver can then be set with TSSetType().

Collective

Input Parameter:

  • comm - The communicator

Output Parameter:

  • ts - The TS

Level: beginner

See also: TS, SNES, TSSetType(), TSSetUp(), TSDestroy(), TSSetProblemType(), TSSetTimeStep()

External Links

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

Create a sub-TS that evaluates integrals over time

Input Parameters:

  • ts - 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

See also: TSGetQuadratureTS()

External Links

source
PETSc.LibPETSc.TSDIRKGetType — Method
dirktype::String = TSDIRKGetType(petsclib::PetscLibType, ts::AbstractTS)

Get the type of TSDIRK scheme

Logically Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

  • dirktype - type of TSDIRK scheme

Level: intermediate

See also: TSDIRKSetType()

External Links

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

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

Logically Collective.

Input Parameters:

  • name - identifier for 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

See also: TSDIRK, TSType, TS

External Links

source
PETSc.LibPETSc.TSDIRKSetType — Method
TSDIRKSetType(petsclib::PetscLibType, ts::AbstractTS, dirktype::String)

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

See also: TSDIRKGetType(), TSDIRK, TSDIRKType

External Links

source
PETSc.LibPETSc.TSDMSwarmMonitorMoments — Method
TSDMSwarmMonitorMoments(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, t::PetscReal, U::AbstractPetscVec, vf::Vector{PetscViewerAndFormat})

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

Not Collective

Input Parameters:

  • ts - 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

See also: TS, TSMonitorSet(), TSMonitorDefault(), DMSWARM

External Links

source
PETSc.LibPETSc.TSDestroy — Method
TSDestroy(petsclib::PetscLibType, ts::AbstractTS)

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

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Level: beginner

See also: TS, TSCreate(), TSSetUp(), TSSolve()

External Links

source
PETSc.LibPETSc.TSDiscGradGetFormulation — Method
TSDiscGradGetFormulation(petsclib::PetscLibType, ts::AbstractTS, noname::Ptr{Cvoid})

Get the construction method for S, F, and grad F from the formulation u_t = S \nabla F for TSDISCGRAD

Not Collective

Input Parameter:

  • ts - timestepping context

Output Parameters:

  • Sfunc - constructor for the S matrix from the formulation
  • Ffunc - functional F from the formulation
  • Gfunc - constructor for the gradient of F from the formulation
  • ctx - the application context

Calling sequence of Sfunc:

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

Calling sequence of Ffunc:

  • ts - the integrator
  • time - the current time
  • u - the solution
  • F - the computed function from the formulation
  • ctx - the application 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 application context

Level: intermediate

See also: TS, TSDISCGRAD, TSDiscGradSetFormulation()

External Links

source
PETSc.LibPETSc.TSDiscGradGetType — Method
dgtype::TSDGType = TSDiscGradGetType(petsclib::PetscLibType, ts::AbstractTS)

Checks for which discrete gradient to use in formulation for TSDISCGRAD

Not Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

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

Level: advanced

See also: TSDISCGRAD, TSDiscGradSetType()

External Links

source
PETSc.LibPETSc.TSDiscGradSetFormulation — Method
TSDiscGradSetFormulation(petsclib::PetscLibType, ts::AbstractTS, Sfunc::external, Ffunc::external, Gfunc::external, ctx::Ptr{Cvoid})

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

Not Collective

Input Parameters:

  • ts - timestepping 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 application context

Calling sequence of Ffunc:

  • ts - the integrator
  • time - the current time
  • u - the solution
  • F - the computed function from the formulation
  • ctx - the application 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 application context

Level: intermediate

See also: TSDISCGRAD, TSDiscGradGetFormulation()

External Links

source
PETSc.LibPETSc.TSDiscGradSetType — Method
TSDiscGradSetType(petsclib::PetscLibType, ts::AbstractTS, 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 (gonzalez|average|none) - flag to choose discrete gradient type

Level: intermediate

See also: TSDISCGRAD, TSDGType

External Links

source
PETSc.LibPETSc.TSEIMEXSetMaxRows — Method
TSEIMEXSetMaxRows(petsclib::PetscLibType, ts::AbstractTS, nrows::PetscInt)

Set the maximum number of rows for TSEIMEX schemes

Logically Collective

Input Parameters:

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

Level: intermediate

See also: TSEIMEXSetRowCol(), TSEIMEXSetOrdAdapt(), TSEIMEX

External Links

source
PETSc.LibPETSc.TSEIMEXSetOrdAdapt — Method
TSEIMEXSetOrdAdapt(petsclib::PetscLibType, ts::AbstractTS, flg::PetscBool)

Set the order adaptativity for the TSEIMEX schemes

Logically Collective

Input Parameters:

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

Level: intermediate

See also: TSEIMEXSetRowCol(), TSEIMEX

External Links

source
PETSc.LibPETSc.TSEIMEXSetRowCol — Method
TSEIMEXSetRowCol(petsclib::PetscLibType, ts::AbstractTS, row::PetscInt, col::PetscInt)

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

Logically Collective

Input Parameters:

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

Level: intermediate

See also: TSEIMEXSetMaxRows(), TSEIMEXSetOrdAdapt(), TSEIMEX

External Links

source
PETSc.LibPETSc.TSErrorWeightedENorm — Method
norm::PetscReal,norma::PetscReal,normr::PetscReal = TSErrorWeightedENorm(petsclib::PetscLibType, ts::AbstractTS, E::AbstractPetscVec, U::AbstractPetscVec, Y::AbstractPetscVec, wnormtype::NormType)

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

Collective

Input Parameters:

  • ts - time stepping 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

See also: TS, VecErrorWeightedNorms(), TSErrorWeightedNorm()

External Links

source
PETSc.LibPETSc.TSErrorWeightedNorm — Method
norm::PetscReal,norma::PetscReal,normr::PetscReal = TSErrorWeightedNorm(petsclib::PetscLibType, ts::AbstractTS, U::AbstractPetscVec, Y::AbstractPetscVec, wnormtype::NormType)

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

Collective

Input Parameters:

  • ts - time stepping 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

See also: TS, VecErrorWeightedNorms(), TSErrorWeightedENorm()

External Links

source
PETSc.LibPETSc.TSEvaluateStep — Method
done::PetscBool = TSEvaluateStep(petsclib::PetscLibType, ts::AbstractTS, order::PetscInt, U::AbstractPetscVec)

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

Collective

Input Parameters:

  • ts - time stepping 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

See also: TS, TSStep(), TSAdapt

External Links

source
PETSc.LibPETSc.TSEvaluateWLTE — Method
order::PetscInt,wlte::PetscReal = TSEvaluateWLTE(petsclib::PetscLibType, ts::AbstractTS, wnormtype::NormType)

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

Collective

Input Parameters:

  • ts - time stepping 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

See also: TS, TSStep(), TSAdapt, TSErrorWeightedNorm()

External Links

source
PETSc.LibPETSc.TSFinalizePackage — Method
TSFinalizePackage(petsclib::PetscLibType)

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

Level: developer

See also: TS, PetscFinalize(), TSInitializePackage()

External Links

source
PETSc.LibPETSc.TSForwardGetSensitivities — Method
nump::PetscInt,Smat::PetscMat = TSForwardGetSensitivities(petsclib::PetscLibType, ts::AbstractTS)

Returns the trajectory sensitivities

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

Output Parameters:

  • ts - 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

See also: TSForwardSetSensitivities(), TSForwardSetIntegralGradients(), TSForwardGetIntegralGradients(), TSForwardStep()

External Links

source
PETSc.LibPETSc.TSForwardGetStages — Method
ns::PetscInt,S::PetscMat = TSForwardGetStages(petsclib::PetscLibType, ts::AbstractTS)

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

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameters:

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

Level: advanced

See also: TS

External Links

source
PETSc.LibPETSc.TSForwardReset — Method
TSForwardReset(petsclib::PetscLibType, ts::AbstractTS)

Reset the internal data structures used by forward sensitivity analysis

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Level: advanced

See also: TSCreate(), TSDestroy(), TSForwardSetUp()

External Links

source
PETSc.LibPETSc.TSForwardSetSensitivities — Method
TSForwardSetSensitivities(petsclib::PetscLibType, ts::AbstractTS, nump::PetscInt, Smat::AbstractPetscMat)

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

Logically Collective

Input Parameters:

  • ts - 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

See also: TSForwardGetSensitivities(), TSForwardSetIntegralGradients(), TSForwardGetIntegralGradients(), TSForwardStep()

External Links

source
PETSc.LibPETSc.TSForwardSetUp — Method
TSForwardSetUp(petsclib::PetscLibType, ts::AbstractTS)

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

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Level: advanced

See also: TS, TSCreate(), TSDestroy(), TSSetUp()

External Links

source
PETSc.LibPETSc.TSForwardStep — Method
TSForwardStep(petsclib::PetscLibType, ts::AbstractTS)

Compute the forward sensitivity for one time step.

Collective

Input Parameter:

  • ts - time stepping context

Level: advanced

See also: TSForwardSetSensitivities(), TSForwardGetSensitivities(), TSForwardSetIntegralGradients(), TSForwardGetIntegralGradients(), TSForwardSetUp()

External Links

source
PETSc.LibPETSc.TSFunctionDomainError — Method
accept::PetscBool = TSFunctionDomainError(petsclib::PetscLibType, ts::AbstractTS, stagetime::PetscReal, Y::AbstractPetscVec)

Checks if the current state is valid

Collective

Input Parameters:

  • ts - 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

See also: TS, TSSetFunctionDomainError()

External Links

source
PETSc.LibPETSc.TSGLEEGetType — Method
gleetype::String = TSGLEEGetType(petsclib::PetscLibType, ts::AbstractTS)

Get the type of TSGLEE scheme

Logically Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

  • gleetype - type of TSGLEE scheme

Level: intermediate

See also: TSGLEE, TSGLEESetType()

External Links

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

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

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

Input Parameters:

  • name - identifier for 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

See also: TSGLEE

External Links

source
PETSc.LibPETSc.TSGLEERegisterAll — Method
TSGLEERegisterAll(petsclib::PetscLibType)

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

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

Level: advanced

See also: TSGLEERegisterDestroy()

External Links

source
PETSc.LibPETSc.TSGLEESetType — Method
TSGLEESetType(petsclib::PetscLibType, ts::AbstractTS, gleetype::String)

Set the type of TSGLEE scheme

Logically Collective

Input Parameters:

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

Level: intermediate

See also: TSGLEEGetType(), TSGLEE

External Links

source
PETSc.LibPETSc.TSGLLEAcceptRegister — Method
TSGLLEAcceptRegister(petsclib::PetscLibType, sname::String, fnc::Ptr{Cvoid})

adds a TSGLLE acceptance scheme

Not Collective

Input Parameters:

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

Level: advanced

See also: TSGLLE, TSGLLEType, TSGLLERegisterAll(), TSGLLEAcceptFn

External Links

source
PETSc.LibPETSc.TSGLLEFinalizePackage — Method
TSGLLEFinalizePackage(petsclib::PetscLibType)

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

Level: developer

See also: PetscFinalize(), TSGLLEInitializePackage(), TSInitializePackage()

External Links

source
PETSc.LibPETSc.TSGLLEGetAdapt — Method
adapt::TSGLLEAdapt = TSGLLEGetAdapt(petsclib::PetscLibType, ts::AbstractTS)

gets the TSGLLEAdapt object from the TS

Not Collective

Input Parameter:

  • ts - the TS context

Output Parameter:

  • adapt - the TSGLLEAdapt context

Level: advanced

See also: TS, TSGLLE, TSGLLEAdapt, TSGLLEAdaptRegister()

External Links

source
PETSc.LibPETSc.TSGLLERegister — Method
TSGLLERegister(petsclib::PetscLibType, sname::String, fnc::external)

adds a TSGLLE implementation

Not Collective, No Fortran Support

Input Parameters:

  • sname - name of user-defined general linear scheme
  • function - routine to create method context

Level: advanced

See also: TSGLLE, TSGLLEType, TSGLLERegisterAll(), TSGLLESetType()

External Links

source
PETSc.LibPETSc.TSGLLESetAcceptType — Method
TSGLLESetAcceptType(petsclib::PetscLibType, ts::AbstractTS, type::String)

sets the acceptance test for TSGLLE

Logically Collective

Input Parameters:

  • ts - the TS context
  • type - the type

Options Database Key:

  • -ts_gl_accept_type (always) - sets the method used to determine whether to accept or reject a step

Level: intermediate

See also: TS, TSGLLE, TSGLLEAcceptRegister(), TSGLLEAdapt

External Links

source
PETSc.LibPETSc.TSGLLESetType — Method
TSGLLESetType(petsclib::PetscLibType, ts::AbstractTS, type::String)

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

Collective

Input Parameters:

  • ts - the TS context
  • type - a method, currently only TSGLLE_IRKS is available

Options Database Key:

  • -ts_gl_type (irks) - sets the method

Level: intermediate

See also: TS, TSGLLEType, TSGLLE, TSGLLERegister(), TSGLLE_IRKS, TSGLLEGetAcceptType(), TSGLLESetAcceptType(), TSGLLEAcceptType()

External Links

source
PETSc.LibPETSc.TSGetAdapt — Method
adapt::TSAdapt = TSGetAdapt(petsclib::PetscLibType, ts::AbstractTS)

Get the adaptive controller context for the current method

Collective if controller has not yet been created

Input Parameter:

  • ts - time stepping context

Output Parameter:

  • adapt - adaptive controller

Level: intermediate

See also: TS, TSAdapt, TSAdaptSetType(), TSAdaptChoose()

External Links

source
PETSc.LibPETSc.TSGetApplicationContext — Method
ctx::Ptr{Cvoid} = TSGetApplicationContext(petsclib::PetscLibType, ts::AbstractTS)

Gets the user-defined context for the timestepper that was set with TSSetApplicationContext()

Not Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameter:

  • ctx - a pointer to the application context

Level: intermediate

See also: TS, TSSetApplicationContext()

External Links

source
PETSc.LibPETSc.TSGetAuxSolution — Method
TSGetAuxSolution(petsclib::PetscLibType, ts::AbstractTS, v::AbstractPetscVec)

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

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

Input Parameters:

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

Level: intermediate

See also: TS, TSGetSolution()

External Links

source
PETSc.LibPETSc.TSGetCFLTime — Method
cfltime::PetscReal = TSGetCFLTime(petsclib::PetscLibType, ts::AbstractTS)

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

Collective

Input Parameter:

  • ts - time stepping context

Output Parameter:

  • cfltime - maximum stable time step for forward Euler

Level: advanced

See also: TSSetCFLTimeLocal()

External Links

source
PETSc.LibPETSc.TSGetComputeExactError — Method
TSGetComputeExactError(petsclib::PetscLibType, ts::AbstractTS, noname::Ptr{Cvoid})

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

Not collective

Input Parameter:

  • ts - time stepping context

Output Parameter:

  • exactError - The function which computes the solution error

Calling sequence of exactError:

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

Level: advanced

See also: TS, TSComputeExactError()

External Links

source
PETSc.LibPETSc.TSGetComputeInitialCondition — Method
TSGetComputeInitialCondition(petsclib::PetscLibType, ts::AbstractTS, noname::Ptr{Cvoid})

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

Not collective

Input Parameter:

  • ts - time stepping context

Output Parameter:

  • initCondition - The function which computes an initial condition

Calling sequence of initCondition:

  • ts - The timestepping context
  • u - The input vector in which the initial condition is stored

Level: advanced

See also: TS, TSSetComputeInitialCondition(), TSComputeInitialCondition()

External Links

source
PETSc.LibPETSc.TSGetConvergedReason — Method
reason::TSConvergedReason = TSGetConvergedReason(petsclib::PetscLibType, ts::AbstractTS)

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

See also: TS, TSSolve(), TSConvergedReason

External Links

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

Returns the gradients from the TSAdjointSolve()

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

Input Parameter:

  • ts - 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

See also: TS, TSAdjointSolve(), TSSetCostGradients()

External Links

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

Returns the gradients from the TSAdjointSolve()

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

Input Parameter:

  • ts - 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

See also: TSAdjointSolve(), TSSetCostHessianProducts()

External Links

source
PETSc.LibPETSc.TSGetCostIntegral — Method
v::PetscVec = TSGetCostIntegral(petsclib::PetscLibType, ts::AbstractTS)

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

Not Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameter:

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

Level: intermediate

See also: TS, TSAdjointSolve(), TSSetCostIntegrand()

External Links

source
PETSc.LibPETSc.TSGetDM — Method
dm::PetscDM = TSGetDM(petsclib::PetscLibType, ts::AbstractTS)

Gets the DM that may be used by some preconditioners

Not Collective

Input Parameter:

  • ts - the TS

Output Parameter:

  • dm - the DM

Level: intermediate

See also: TS, DM, TSSetDM(), SNESSetDM(), SNESGetDM()

External Links

source
PETSc.LibPETSc.TSGetEquationType — Method
equation_type::TSEquationType = TSGetEquationType(petsclib::PetscLibType, ts::AbstractTS)

Gets the type of the equation that TS is solving.

Not Collective

Input Parameter:

  • ts - the TS context

Output Parameter:

  • equation_type - see TSEquationType

Level: beginner

See also: TS, TSSetEquationType(), TSEquationType

External Links

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

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

Input Parameter:

  • ts - 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

See also: TS, TSSetEvaluationTimes(), TSGetEvaluationTimes()

External Links

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

gets the evaluation times set with TSSetEvaluationTimes()

Not Collective

Input Parameter:

  • ts - the time-stepper

Output Parameters:

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

Level: beginner

See also: TS, TSSetEvaluationTimes(), TSGetEvaluationSolutions()

External Links

source
PETSc.LibPETSc.TSGetExactFinalTime — Method
eftopt::TSExactFinalTimeOption = TSGetExactFinalTime(petsclib::PetscLibType, ts::AbstractTS)

Gets the exact final time option set with TSSetExactFinalTime()

Not Collective

Input Parameter:

  • ts - the TS context

Output Parameter:

  • eftopt - exact final time option

Level: beginner

See also: TS, TSExactFinalTimeOption, TSSetExactFinalTime()

External Links

source
PETSc.LibPETSc.TSGetI2Function — Method
r::PetscVec,fun::Ptr{Cvoid},ctx::Ptr{Cvoid} = TSGetI2Function(petsclib::PetscLibType, ts::AbstractTS)

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

Not Collective

Input Parameter:

  • ts - 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

See also: TS, TSSetIFunction(), SNESGetFunction(), TSCreate()

External Links

source
PETSc.LibPETSc.TSGetI2Jacobian — Method
J::PetscMat,P::PetscMat,jac::Ptr{Cvoid},ctx::Ptr{Cvoid} = TSGetI2Jacobian(petsclib::PetscLibType, ts::AbstractTS)

Returns the implicit Jacobian at the present timestep.

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

Input Parameter:

  • ts - 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

See also: TS, TSGetTimeStep(), TSGetMatrices(), TSGetTime(), TSGetStepNumber(), TSSetI2Jacobian(), TSGetI2Function(), TSCreate()

External Links

source
PETSc.LibPETSc.TSGetIFunction — Method
r::PetscVec,func::Ptr{Cvoid},ctx::Ptr{Cvoid} = TSGetIFunction(petsclib::PetscLibType, ts::AbstractTS)

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

Not Collective

Input Parameter:

  • ts - 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

See also: TS, TSSetIFunction(), SNESGetFunction()

External Links

source
PETSc.LibPETSc.TSGetIJacobian — Method
Amat::PetscMat,Pmat::PetscMat,f::Ptr{Cvoid},ctx::Ptr{Cvoid} = TSGetIJacobian(petsclib::PetscLibType, ts::AbstractTS)

Returns the implicit Jacobian at the present timestep.

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

Input Parameter:

  • ts - 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

See also: TS, TSGetTimeStep(), TSGetRHSJacobian(), TSGetMatrices(), TSGetTime(), TSGetStepNumber()

External Links

source
PETSc.LibPETSc.TSGetIJacobianP — Method
Amat::PetscMat = TSGetIJacobianP(petsclib::PetscLibType, ts::AbstractTS, noname::Ptr{Cvoid})

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

Logically Collective

Input Parameter:

  • ts - TS context obtained from TSCreate()

Output Parameters:

  • Amat - JacobianP matrix
  • func - the function that computes the JacobianP
  • ctx - [optional] 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] function context

Level: intermediate

See also: TSSetRHSJacobianP(), TS, TSSetIJacobianP(), TSGetRHSJacobianP()

External Links

source
PETSc.LibPETSc.TSGetKSP — Method
ksp::KSP = TSGetKSP(petsclib::PetscLibType, ts::AbstractTS)

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

Not Collective, but ksp is parallel if ts is parallel

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameter:

  • ksp - the nonlinear solver context

Level: beginner

See also: TS, SNES, KSP, TSCreate(), TSSetUp(), TSSolve(), TSGetSNES()

External Links

source
PETSc.LibPETSc.TSGetKSPIterations — Method
lits::PetscInt = TSGetKSPIterations(petsclib::PetscLibType, ts::AbstractTS)

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

Not Collective

Input Parameter:

  • ts - TS context

Output Parameter:

  • lits - number of linear iterations

Level: intermediate

See also: TS, TSSolve(), TSGetSNESIterations()

External Links

source
PETSc.LibPETSc.TSGetMaxSteps — Method
maxsteps::PetscInt = TSGetMaxSteps(petsclib::PetscLibType, ts::AbstractTS)

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

See also: TS, TSSetMaxSteps(), TSGetMaxTime(), TSSetMaxTime()

External Links

source
PETSc.LibPETSc.TSGetMaxTime — Method
maxtime::PetscReal = TSGetMaxTime(petsclib::PetscLibType, ts::AbstractTS)

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

See also: TS, TSSetMaxTime(), TSGetMaxSteps(), TSSetMaxSteps()

External Links

source
PETSc.LibPETSc.TSGetNumEvents — Method
nevents::PetscInt = TSGetNumEvents(petsclib::PetscLibType, ts::AbstractTS)

Get the number of events defined on the given MPI process

Logically Collective

Input Parameter:

  • ts - the TS context

Output Parameter:

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

Level: intermediate

See also: TSEvent, TSSetEventHandler()

External Links

source
PETSc.LibPETSc.TSGetOptionsPrefix — Method
prefix::String = TSGetOptionsPrefix(petsclib::PetscLibType, ts::AbstractTS)

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

Not Collective

Input Parameter:

  • ts - The TS context

Output Parameter:

  • prefix - A pointer to the prefix string used

Level: intermediate

See also: TS, TSAppendOptionsPrefix(), TSSetFromOptions()

External Links

source
PETSc.LibPETSc.TSGetPrevTime — Method
t::PetscReal = TSGetPrevTime(petsclib::PetscLibType, ts::AbstractTS)

Gets the starting time of the previously completed step.

Not Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameter:

  • t - the previous time

Level: beginner

See also: TS, TSGetTime(), TSGetSolveTime(), TSGetTimeStep()

External Links

source
PETSc.LibPETSc.TSGetProblemType — Method
type::TSProblemType = TSGetProblemType(petsclib::PetscLibType, ts::AbstractTS)

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

$M U_t = A U M(t) U_t = A(t) U F(t,U,U_t)$

Level: beginner

See also: TSSetUp(), TSProblemType, TS

External Links

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

Return the sub-TS that evaluates integrals over time

Input Parameter:

  • ts - 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

See also: TSCreateQuadratureTS()

External Links

source
PETSc.LibPETSc.TSGetRHSFunction — Method
r::PetscVec,func::Ptr{Cvoid},ctx::Ptr{Cvoid} = TSGetRHSFunction(petsclib::PetscLibType, ts::AbstractTS)

Returns the vector where the right-hand side is stored and the function/context to compute it.

Not Collective

Input Parameter:

  • ts - 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

See also: TS, TSSetRHSFunction(), SNESGetFunction()

External Links

source
PETSc.LibPETSc.TSGetRHSJacobian — Method
Amat::PetscMat,Pmat::PetscMat,func::Ptr{Cvoid},ctx::Ptr{Cvoid} = TSGetRHSJacobian(petsclib::PetscLibType, ts::AbstractTS)

Returns the Jacobian J at the present timestep.

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

Input Parameter:

  • ts - 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

See also: TS, TSGetTimeStep(), TSGetMatrices(), TSGetTime(), TSGetStepNumber()

External Links

source
PETSc.LibPETSc.TSGetRHSJacobianP — Method
Amat::PetscMat,func::Ptr{Cvoid},ctx::Ptr{Cvoid} = TSGetRHSJacobianP(petsclib::PetscLibType, ts::AbstractTS)

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

Logically Collective

Input Parameter:

  • ts - TS context obtained from TSCreate()

Output Parameters:

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

Level: intermediate

See also: TSSetRHSJacobianP(), TS, TSRHSJacobianPFn

External Links

source
PETSc.LibPETSc.TSGetRunSteps — Method
runsteps::PetscInt = TSGetRunSteps(petsclib::PetscLibType, ts::AbstractTS)

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

Not Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameter:

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

Level: advanced

See also: TS, TSSetRunSteps(), TSGetMaxTime(), TSSetMaxTime(), TSGetMaxSteps()

External Links

source
PETSc.LibPETSc.TSGetSNES — Method
snes::SNES = TSGetSNES(petsclib::PetscLibType, ts::AbstractTS)

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

Not Collective, but snes is parallel if ts is parallel

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameter:

  • snes - the nonlinear solver context

Level: beginner

See also: TS, SNES, TSCreate(), TSSetUp(), TSSolve()

External Links

source
PETSc.LibPETSc.TSGetSNESFailures — Method
fails::PetscInt = TSGetSNESFailures(petsclib::PetscLibType, ts::AbstractTS)

Gets the total number of failed SNES solves in a TS

Not Collective

Input Parameter:

  • ts - TS context

Output Parameter:

  • fails - number of failed nonlinear solves

Level: intermediate

See also: TS, TSSolve(), TSGetSNESIterations(), TSGetKSPIterations(), TSSetMaxStepRejections(), TSGetStepRejections(), TSSetMaxSNESFailures()

External Links

source
PETSc.LibPETSc.TSGetSNESIterations — Method
nits::PetscInt = TSGetSNESIterations(petsclib::PetscLibType, ts::AbstractTS)

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

Not Collective

Input Parameter:

  • ts - TS context

Output Parameter:

  • nits - number of nonlinear iterations

Level: intermediate

See also: TS, TSSolve(), TSGetKSPIterations()

External Links

source
PETSc.LibPETSc.TSGetSolution — Method
v::PetscVec = TSGetSolution(petsclib::PetscLibType, ts::AbstractTS)

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

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

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameter:

  • v - the vector containing the solution

Level: intermediate

See also: TS, TSGetTimeStep(), TSGetTime(), TSGetSolveTime(), TSGetSolutionComponents(), TSSetSolutionFunction()

External Links

source
PETSc.LibPETSc.TSGetSolutionComponents — Method
n::PetscInt = TSGetSolutionComponents(petsclib::PetscLibType, ts::AbstractTS, v::AbstractPetscVec)

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

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

Input Parameters:

  • ts - 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

See also: TS, TSGetSolution()

External Links

source
PETSc.LibPETSc.TSGetSolveTime — Method
ftime::PetscReal = TSGetSolveTime(petsclib::PetscLibType, ts::AbstractTS)

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

See also: TS, TSSolve(), TSConvergedReason

External Links

source
PETSc.LibPETSc.TSGetStages — Method
ns::PetscInt,Y::PetscVec = TSGetStages(petsclib::PetscLibType, ts::AbstractTS)

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

See also: TS, TSCreate()

External Links

source
PETSc.LibPETSc.TSGetStepNumber — Method
steps::PetscInt = TSGetStepNumber(petsclib::PetscLibType, ts::AbstractTS)

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

See also: TS, TSGetTime(), TSGetTimeStep(), TSSetPreStep(), TSSetPreStage(), TSSetPostStage(), TSSetPostStep()

External Links

source
PETSc.LibPETSc.TSGetStepRejections — Method
rejects::PetscInt = TSGetStepRejections(petsclib::PetscLibType, ts::AbstractTS)

Gets the total number of rejected steps.

Not Collective

Input Parameter:

  • ts - TS context

Output Parameter:

  • rejects - number of steps rejected

Level: intermediate

See also: TS, TSSolve(), TSGetSNESIterations(), TSGetKSPIterations(), TSSetMaxStepRejections(), TSGetSNESFailures(), TSSetMaxSNESFailures(), TSSetErrorIfStepFails()

External Links

source
PETSc.LibPETSc.TSGetStepResize — Method
flg::PetscBool = TSGetStepResize(petsclib::PetscLibType, ts::AbstractTS)

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

Not collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameter:

  • flg - the resize flag

Level: advanced

See also: TS, TSCreate(), TSSetResize()

External Links

source
PETSc.LibPETSc.TSGetStepRollBack — Method
flg::PetscBool = TSGetStepRollBack(petsclib::PetscLibType, ts::AbstractTS)

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

Not collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameter:

  • flg - the rollback flag

Level: advanced

See also: TS, TSCreate(), TSRollBack()

External Links

source
PETSc.LibPETSc.TSGetTime — Method
t::PetscReal = TSGetTime(petsclib::PetscLibType, ts::AbstractTS)

Gets the time of the most recently completed step.

Not Collective

Input Parameter:

  • ts - 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

See also: TS, TSGetSolveTime(), TSSetTime(), TSGetTimeStep(), TSGetStepNumber()

External Links

source
PETSc.LibPETSc.TSGetTimeError — Method
TSGetTimeError(petsclib::PetscLibType, ts::AbstractTS, n::PetscInt, v::AbstractPetscVec)

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

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

Input Parameters:

  • ts - 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

See also: TSGetSolution(), TSSetTimeError()

External Links

source
PETSc.LibPETSc.TSGetTimeStep — Method
dt::PetscReal = TSGetTimeStep(petsclib::PetscLibType, ts::AbstractTS)

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

See also: TS, TSSetTimeStep(), TSGetTime()

External Links

source
PETSc.LibPETSc.TSGetTolerances — Method
atol::PetscReal,vatol::PetscVec,rtol::PetscReal,vrtol::PetscVec = TSGetTolerances(petsclib::PetscLibType, ts::AbstractTS)

Get tolerances for local truncation error when using adaptive controller

Logically Collective

Input Parameter:

  • ts - time integration context

Output Parameters:

  • atol - scalar absolute tolerances, 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

See also: TS, TSAdapt, TSErrorWeightedNorm(), TSSetTolerances()

External Links

source
PETSc.LibPETSc.TSGetTrajectory — Method
tr::TSTrajectory = TSGetTrajectory(petsclib::PetscLibType, ts::AbstractTS)

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

See also: TS, TSTrajectory, TSAdjointSolve(), TSTrajectoryCreate()

External Links

source
PETSc.LibPETSc.TSGetType — Method
type::String = TSGetType(petsclib::PetscLibType, ts::AbstractTS)

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

Not Collective

Input Parameter:

  • ts - The TS

Output Parameter:

  • type - The TSType

Level: intermediate

See also: TS, TSType, TSSetType(), PetscObjectTypeCompare(), PetscObjectTypeCompareAny()

External Links

source
PETSc.LibPETSc.TSGetUseSplitRHSFunction — Method
use_splitrhsfunction::PetscBool = TSGetUseSplitRHSFunction(petsclib::PetscLibType, ts::AbstractTS)

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

Not Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

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

Level: intermediate

See also: TS, TSSetUseSplitRHSFunction()

External Links

source
PETSc.LibPETSc.TSHasTransientVariable — Method
has::PetscBool = TSHasTransientVariable(petsclib::PetscLibType, ts::AbstractTS)

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

See also: TS, TSBDF, DMTSSetTransientVariable(), TSComputeTransientVariable()

External Links

source
PETSc.LibPETSc.TSIRKGetNumStages — Method
nstages::PetscInt = TSIRKGetNumStages(petsclib::PetscLibType, ts::AbstractTS)

Get the number of stages of TSIRK scheme

Logically Collective

Input Parameters:

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

Level: intermediate

See also: TSIRKSetNumStages(), TSIRK

External Links

source
PETSc.LibPETSc.TSIRKGetType — Method
irktype::String = TSIRKGetType(petsclib::PetscLibType, ts::AbstractTS)

Get the type of TSIRK IMEX scheme being used

Logically Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

  • irktype - type of TSIRK IMEX scheme

Level: intermediate

See also: TSIRK, TSIRKType, TSIRKGAUSS

External Links

source
PETSc.LibPETSc.TSIRKInitializePackage — Method
TSIRKInitializePackage(petsclib::PetscLibType)

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

Level: developer

See also: TSIRK, PetscInitialize(), TSIRKFinalizePackage(), TSInitializePackage()

External Links

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

adds a TSIRK implementation

Not Collective, No Fortran Support

Input Parameters:

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

Level: advanced

See also: TSIRK, TSIRKRegisterAll()

External Links

source
PETSc.LibPETSc.TSIRKSetNumStages — Method
TSIRKSetNumStages(petsclib::PetscLibType, ts::AbstractTS, nstages::PetscInt)

Set the number of stages of TSIRK scheme to use

Logically Collective

Input Parameters:

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

Options Database Key:

  • -ts_irk_nstages int - set number of stages

Level: intermediate

See also: TSIRKGetNumStages(), TSIRK

External Links

source
PETSc.LibPETSc.TSIRKSetType — Method
TSIRKSetType(petsclib::PetscLibType, ts::AbstractTS, irktype::String)

Set the type of TSIRK scheme to use

Logically Collective

Input Parameters:

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

Options Database Key:

  • -ts_irk_type gauss - set irk type

Level: intermediate

See also: TSIRKGetType(), TSIRK, TSIRKType, TSIRKGAUSS

External Links

source
PETSc.LibPETSc.TSIRKTableauCreate — Method
TSIRKTableauCreate(petsclib::PetscLibType, ts::AbstractTS, nstages::PetscInt, A::Vector{PetscReal}, b::Vector{PetscReal}, c::Vector{PetscReal}, binterp::Vector{PetscReal}, A_inv::Vector{PetscScalar}, A_inv_rowsum::Vector{PetscScalar}, I_s::Vector{PetscScalar})

create the tableau for TSIRK and provide the entries

Not Collective

Input Parameters:

  • ts - timestepping 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), optional (use NULL to skip)
  • A_inv - inverse of A (dimension nstages * nstages, row-major), optional (use NULL to skip)
  • A_inv_rowsum - row sum of the inverse of A (dimension nstages), optional (use NULL to skip)
  • I_s - identity matrix (dimension nstages * nstages), optional (use NULL to skip)

Level: advanced

See also: TSIRK, TSIRKRegister()

External Links

source
PETSc.LibPETSc.TSInitializePackage — Method
TSInitializePackage(petsclib::PetscLibType)

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

Level: developer

See also: TS, PetscInitialize(), TSFinalizePackage()

External Links

source
PETSc.LibPETSc.TSInterpolate — Method
TSInterpolate(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal, U::AbstractPetscVec)

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

Collective

Input Parameters:

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

Output Parameter:

  • U - state at given time

Level: intermediate

See also: TS, TSSetExactFinalTime(), TSSolve()

External Links

source
PETSc.LibPETSc.TSLoad — Method
TSLoad(petsclib::PetscLibType, ts::AbstractTS, viewer::PetscViewer)

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

Collective

Input Parameters:

  • ts - the newly 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

See also: TS, PetscViewer, PetscViewerBinaryOpen(), TSView(), MatLoad(), VecLoad()

External Links

source
PETSc.LibPETSc.TSMPRKGetType — Method
mprktype::String = TSMPRKGetType(petsclib::PetscLibType, ts::AbstractTS)

Get the type of TSMPRK scheme

Not Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

  • mprktype - type of TSMPRK scheme

Level: intermediate

See also: TSMPRK

External Links

source
PETSc.LibPETSc.TSMPRKInitializePackage — Method
TSMPRKInitializePackage(petsclib::PetscLibType)

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

Level: developer

See also: TSMPRK, PetscInitialize()

External Links

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

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

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

Input Parameters:

  • name - identifier for 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

See also: TSMPRK

External Links

source
PETSc.LibPETSc.TSMPRKSetType — Method
TSMPRKSetType(petsclib::PetscLibType, ts::AbstractTS, mprktype::String)

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

See also: TSMPRKGetType(), TSMPRK, TSMPRKType

External Links

source
PETSc.LibPETSc.TSMonitor — Method
TSMonitor(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec)

Runs all user-provided monitor routines set using TSMonitorSet()

Collective

Input Parameters:

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

Level: developer

See also: TS, TSMonitorSet(), TSMonitorSetFromOptions()

External Links

source
PETSc.LibPETSc.TSMonitorCancel — Method
TSMonitorCancel(petsclib::PetscLibType, ts::AbstractTS)

Clears all the monitors that have been set on a time-step object.

Logically Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Level: intermediate

See also: TS, TSMonitorDefault(), TSMonitorSet()

External Links

source
PETSc.LibPETSc.TSMonitorDMDARay — Method
TSMonitorDMDARay(petsclib::PetscLibType, ts::AbstractTS, steps::PetscInt, time::PetscReal, u::AbstractPetscVec, mctx::Ptr{Cvoid})

Monitors the solution of a DMDA-based TS by scattering values along a ray to a viewer

Collective

Input Parameters:

  • ts - the TS context
  • steps - the current time-step number
  • time - the current time
  • u - the current solution (unused; the current TS solution is fetched)
  • mctx - the TSMonitorDMDARayCtx context

Level: developer

See also: TS, DMDA, TSMonitorSet(), TSMonitorLGDMDARay(), TSMonitorDMDARayDestroy()

External Links

source
PETSc.LibPETSc.TSMonitorDMDARayDestroy — Method
TSMonitorDMDARayDestroy(petsclib::PetscLibType, mctx::Ptr{Cvoid})

Destroys the context created for the -ts_monitor_dmda_ray and -ts_monitor_lg_dmda_ray monitors

Collective

Input Parameter:

  • mctx - pointer to the TSMonitorDMDARayCtx context

Level: developer

See also: TS, TSMonitorSet(), TSMonitorDMDARay(), TSMonitorLGDMDARay()

External Links

source
PETSc.LibPETSc.TSMonitorDefault — Method
TSMonitorDefault(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, v::AbstractPetscVec, vf::Vector{PetscViewerAndFormat})

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

Input Parameters:

  • ts - 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

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

External Links

source
PETSc.LibPETSc.TSMonitorDrawError — Method
TSMonitorDrawError(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, Ctx::Ptr{Cvoid})

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

Collective

Input Parameters:

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

Options Database Key:

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

Level: intermediate

See also: TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSSetSolutionFunction()

External Links

source
PETSc.LibPETSc.TSMonitorDrawSolution — Method
TSMonitorDrawSolution(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, ctx::Ptr{Cvoid})

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

Collective

Input Parameters:

  • ts - the TS context
  • step - current time-step
  • ptime - current time
  • u - the solution at the current time
  • ctx - 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

See also: TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorDrawCtxCreate(), TSMonitorDrawCtxDestroy()

External Links

source
PETSc.LibPETSc.TSMonitorDrawSolutionFunction — Method
TSMonitorDrawSolutionFunction(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, Ctx::Ptr{Cvoid})

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

Collective

Input Parameters:

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

Options Database Key:

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

Level: intermediate

See also: TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSSetSolutionFunction()

External Links

source
PETSc.LibPETSc.TSMonitorDrawSolutionPhase — Method
TSMonitorDrawSolutionPhase(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, ctx::Ptr{Cvoid})

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

Collective

Input Parameters:

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

Level: intermediate

See also: TS, TSMonitorSet(), TSMonitorDefault(), VecView()

External Links

source
PETSc.LibPETSc.TSMonitorEnvelope — Method
TSMonitorEnvelope(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, dctx::Ptr{Cvoid})

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

Collective

Input Parameters:

  • ts - 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

See also: TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorEnvelopeGetBounds(), TSMonitorEnvelopeCtxCreate()

External Links

source
PETSc.LibPETSc.TSMonitorEnvelopeGetBounds — Method
max::PetscVec,min::PetscVec = TSMonitorEnvelopeGetBounds(petsclib::PetscLibType, ts::AbstractTS)

Gets the bounds for the components of the solution

Collective

Input Parameter:

  • ts - the TS context

Output Parameters:

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

Level: intermediate

See also: TSMonitorEnvelopeCtx, TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorLGSetDisplayVariables()

External Links

source
PETSc.LibPETSc.TSMonitorError — Method
TSMonitorError(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, vf::Vector{PetscViewerAndFormat})

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

Collective

Input Parameters:

  • ts - 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

See also: TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSSetSolutionFunction()

External Links

source
PETSc.LibPETSc.TSMonitorExtreme — Method
TSMonitorExtreme(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, v::AbstractPetscVec, vf::Vector{PetscViewerAndFormat})

Prints the extreme values of the solution at each timestep

Input Parameters:

  • ts - 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

See also: TS, TSMonitorSet()

External Links

source
PETSc.LibPETSc.TSMonitorHGSwarmSolution — Method
TSMonitorHGSwarmSolution(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, dctx::Ptr{Cvoid})

Graphically displays histograms of DMSWARM particles

Input Parameters:

  • ts - 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 (true|false) - Plot in velocity space, as opposed to coordinate space

Level: intermediate

See also: TSMonitorSet()

External Links

source
PETSc.LibPETSc.TSMonitorLGDMDARay — Method
TSMonitorLGDMDARay(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, ctx::Ptr{Cvoid})

Monitors the solution of a DMDA-based TS by plotting values along a ray in a line graph

Collective

Input Parameters:

  • ts - the TS context
  • step - the current time-step number
  • ptime - the current time
  • u - the current solution
  • ctx - the TSMonitorDMDARayCtx context, which contains the ray scatter and an embedded TSMonitorLGCtx

Level: developer

See also: TS, DMDA, TSMonitorSet(), TSMonitorDMDARay(), TSMonitorDMDARayDestroy()

External Links

source
PETSc.LibPETSc.TSMonitorLGError — Method
TSMonitorLGError(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, Ctx::Ptr{Cvoid})

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

Collective

Input Parameters:

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

Options Database Key:

  • -ts_monitor_lg_error - create a graphical monitor of error history

Level: intermediate

See also: TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSSetSolutionFunction()

External Links

source
PETSc.LibPETSc.TSMonitorLGGetVariableNames — Method
names::String = TSMonitorLGGetVariableNames(petsclib::PetscLibType, ts::AbstractTS)

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

Collective

Input Parameter:

  • ts - the TS context

Output Parameter:

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

Level: intermediate

See also: TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorLGSetDisplayVariables()

External Links

source
PETSc.LibPETSc.TSMonitorLGKSPIterations — Method
TSMonitorLGKSPIterations(petsclib::PetscLibType, ts::AbstractTS, n::PetscInt, ptime::PetscReal, v::AbstractPetscVec, monctx::Ptr{Cvoid})

Monitors the number of linear (KSP) iterations used per time step in a line-graph plot

Collective

Input Parameters:

  • ts - the TS context
  • n - iteration number (a negative value indicates an interpolated solution and is ignored)
  • ptime - current time
  • v - current solution
  • monctx - the TSMonitorLGCtx object that contains all the options for the monitoring, created with TSMonitorLGCtxCreate()

Level: intermediate

See also: TS, TSMonitorSet(), TSMonitorLGCtxCreate(), TSMonitorLGSNESIterations()

External Links

source
PETSc.LibPETSc.TSMonitorLGSNESIterations — Method
TSMonitorLGSNESIterations(petsclib::PetscLibType, ts::AbstractTS, n::PetscInt, ptime::PetscReal, v::AbstractPetscVec, monctx::Ptr{Cvoid})

Monitors the number of nonlinear (SNES) iterations used per time step in a line-graph plot

Collective

Input Parameters:

  • ts - the TS context
  • n - iteration number (a negative value indicates an interpolated solution and is ignored)
  • ptime - current time
  • v - current solution
  • monctx - the TSMonitorLGCtx object that contains all the options for the monitoring, created with TSMonitorLGCtxCreate()

Level: intermediate

See also: TS, TSMonitorSet(), TSMonitorLGCtxCreate(), TSMonitorLGKSPIterations()

External Links

source
PETSc.LibPETSc.TSMonitorLGSetDisplayVariables — Method
TSMonitorLGSetDisplayVariables(petsclib::PetscLibType, ts::AbstractTS, displaynames::Cchar)

Sets the variables that are to be display in the monitor

Collective

Input Parameters:

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

Level: intermediate

See also: TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorLGSetVariableNames()

External Links

source
PETSc.LibPETSc.TSMonitorLGSetTransform — Method
TSMonitorLGSetTransform(petsclib::PetscLibType, ts::AbstractTS, transform::external, destroy::Ptr{Cvoid}, tctx::Ptr{Cvoid})

Solution vector will be transformed by provided function before being displayed

Collective

Input Parameters:

  • ts - 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

Calling sequence of transform:

  • tctx - context used by the transform function
  • u - the input solution vector
  • w - the output transformed vector

Level: intermediate

See also: TSMonitorSet(), TSMonitorLGCtxSetTransform(), TSMonitorDefault(), VecView(), TSMonitorLGSetVariableNames(), PetscCtxDestroyFn

External Links

source
PETSc.LibPETSc.TSMonitorLGSetVariableNames — Method
TSMonitorLGSetVariableNames(petsclib::PetscLibType, ts::AbstractTS, names::Cchar)

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

Collective

Input Parameters:

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

Level: intermediate

See also: TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorLGSetDisplayVariables(), TSMonitorLGCtxSetVariableNames()

External Links

source
PETSc.LibPETSc.TSMonitorLGSolution — Method
TSMonitorLGSolution(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, dctx::Ptr{Cvoid})

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

Collective

Input Parameters:

  • ts - 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

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

External Links

source
PETSc.LibPETSc.TSMonitorLGTimeStep — Method
TSMonitorLGTimeStep(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, v::AbstractPetscVec, monctx::Ptr{Cvoid})

Monitors a TS by printing the time-steps

Collective

Input Parameters:

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

Level: advanced

See also: TS, TSMonitorLGCtxCreate(), TSMonitorSet(), TSMonitorLGCtxDestroy()

External Links

source
PETSc.LibPETSc.TSMonitorSPEig — Method
TSMonitorSPEig(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, v::AbstractPetscVec, monctx::Ptr{Cvoid})

Monitors the eigenvalues of the linearized right-hand-side operator on a scatter plot at each time step

Collective

Input Parameters:

  • ts - the TS context
  • step - the current time-step number (a negative value indicates an interpolated solution and is ignored)
  • ptime - the current time
  • v - the current solution
  • monctx - the TSMonitorSPEigCtx context, created with TSMonitorSPEigCtxCreate()

Options Database Key:

  • -ts_monitor_sp_eig - plot eigenvalues of linearized right-hand side

Level: intermediate

See also: TS, TSMonitorSet(), TSMonitorSPEigCtxCreate(), TSMonitorSPEigCtxDestroy()

External Links

source
PETSc.LibPETSc.TSMonitorSPSwarmSolution — Method
TSMonitorSPSwarmSolution(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, dctx::Ptr{Cvoid})

Graphically displays phase plots of DMSWARM particles on a scatter plot

Input Parameters:

  • ts - 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 (true|false) - Color each species differently
  • -ts_monitor_sp_swarm_phase (true|false) - Plot in phase space, as opposed to coordinate space

Level: intermediate

See also: TS, TSMonitorSet(), DMSWARM, TSMonitorSPCtxCreate()

External Links

source
PETSc.LibPETSc.TSMonitorSet — Method
TSMonitorSet(petsclib::PetscLibType, ts::AbstractTS, monitor::external, mctx::Ptr{Cvoid}, mdestroy::Ptr{Cvoid})

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

Logically Collective

Input Parameters:

  • ts - 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

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

External Links

source
PETSc.LibPETSc.TSMonitorSetFromOptions — Method
TSMonitorSetFromOptions(petsclib::PetscLibType, ts::AbstractTS, name::String, help::String, manual::String, monitor::external, monitorsetup::external)

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

Collective

Input Parameters:

  • ts - 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

Calling sequence of monitor:

  • ts - the TS to monitor
  • step - the current time-step
  • time - the current time
  • u - the current solution
  • vf - the PetscViewer and format to monitor with

Calling sequence of monitorsetup:

  • ts - the TS to monitor
  • vf - the PetscViewer and format to monitor with

Level: developer

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

External Links

source
PETSc.LibPETSc.TSMonitorSolution — Method
TSMonitorSolution(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, vf::Vector{PetscViewerAndFormat})

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

Collective

Input Parameters:

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

Level: intermediate

See also: TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorSolutionSetup()

External Links

source
PETSc.LibPETSc.TSMonitorSolutionSetup — Method
TSMonitorSolutionSetup(petsclib::PetscLibType, ts::AbstractTS, vf::Vector{PetscViewerAndFormat})

Setups the context for TSMonitorSolution()

Collective

Input Parameters:

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

Level: intermediate

See also: TS, TSMonitorSolution(), TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorSetFromOptions()

External Links

source
PETSc.LibPETSc.TSMonitorSolutionVTK — Method
TSMonitorSolutionVTK(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, ctx::TSMonitorVTKCtx)

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

Collective

Input Parameters:

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

Level: developer

See also: TS, TSMonitorSet(), TSMonitorDefault(), VecView()

External Links

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

Create the monitor context to be used in TSMonitorSolutionVTK()

Not collective

Input Parameter:

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

Output Parameter:

  • ctx - the monitor context

Level: developer

See also: TSMonitorSet(), TSMonitorSolutionVTK(), TSMonitorSolutionVTKDestroy()

External Links

source
PETSc.LibPETSc.TSMonitorSolutionVTKDestroy — Method
TSMonitorSolutionVTKDestroy(petsclib::PetscLibType, ctx::Union{TSMonitorVTKCtx, Ref{TSMonitorVTKCtx}})

Destroy the monitor context created with TSMonitorSolutionVTKCtxCreate()

Not Collective

Input Parameter:

  • ctx - the monitor context

Level: developer

See also: TSMonitorSet(), TSMonitorSolutionVTK()

External Links

source
PETSc.LibPETSc.TSMonitorWallClockTime — Method
TSMonitorWallClockTime(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, v::AbstractPetscVec, vf::Vector{PetscViewerAndFormat})

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

Input Parameters:

  • ts - 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

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

External Links

source
PETSc.LibPETSc.TSMonitorWallClockTimeSetUp — Method
TSMonitorWallClockTimeSetUp(petsclib::PetscLibType, ts::AbstractTS, vf::Vector{PetscViewerAndFormat})

Setup routine passed to TSMonitorSetFromOptions() when using -ts_monitor_wall_clock_time

Input Parameters:

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

Level: intermediate

See also: TSMonitorSet()

External Links

source
PETSc.LibPETSc.TSPostEvaluate — Method
TSPostEvaluate(petsclib::PetscLibType, ts::AbstractTS)

Runs the user-defined post-evaluate function set using TSSetPostEvaluate()

Collective

Input Parameter:

  • ts - The TS context obtained from TSCreate()

Level: developer

See also: TS, TSSetPostEvaluate(), TSSetPreStep(), TSPreStep(), TSPostStep()

External Links

source
PETSc.LibPETSc.TSPostStage — Method
TSPostStage(petsclib::PetscLibType, ts::AbstractTS, stagetime::PetscReal, stageindex::PetscInt, Y::Vector{<:AbstractPetscVec})

Runs the user-defined post-stage function set using TSSetPostStage()

Collective

Input Parameters:

  • ts - 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

See also: TS, TSPreStage(), TSSetPreStep(), TSPreStep(), TSPostStep()

External Links

source
PETSc.LibPETSc.TSPostStep — Method
TSPostStep(petsclib::PetscLibType, ts::AbstractTS)

Runs the user-defined post-step function that was set with TSSetPostStep()

Collective

Input Parameter:

  • ts - The TS context obtained from TSCreate()

See also: TS, TSSetPreStep(), TSSetPreStage(), TSSetPostEvaluate(), TSGetTimeStep(), TSGetStepNumber(), TSGetTime(), TSSetPostStep()

External Links

source
PETSc.LibPETSc.TSPreStage — Method
TSPreStage(petsclib::PetscLibType, ts::AbstractTS, stagetime::PetscReal)

Runs the user-defined pre-stage function set using TSSetPreStage()

Collective

Input Parameters:

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

Level: developer

See also: TS, TSPostStage(), TSSetPreStep(), TSPreStep(), TSPostStep()

External Links

source
PETSc.LibPETSc.TSPreStep — Method
TSPreStep(petsclib::PetscLibType, ts::AbstractTS)

Runs the user-defined pre-step function provided with TSSetPreStep()

Collective

Input Parameter:

  • ts - The TS context obtained from TSCreate()

Level: developer

See also: TS, TSSetPreStep(), TSPreStage(), TSPostStage(), TSPostStep()

External Links

source
PETSc.LibPETSc.TSPruneIJacobianColor — Method
TSPruneIJacobianColor(petsclib::PetscLibType, ts::AbstractTS, J::AbstractPetscMat, B::AbstractPetscMat)

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

Collective

Input Parameters:

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

Level: intermediate

See also: TS, MatFDColoring, TSComputeIJacobianDefaultColor(), MatEliminateZeros(), MatFDColoringCreate(), MatFDColoringSetFunction()

External Links

source
PETSc.LibPETSc.TSPseudoComputeFunction — Method
residual::PetscVec,fnorm::PetscReal = TSPseudoComputeFunction(petsclib::PetscLibType, ts::AbstractTS, solution::AbstractPetscVec)

Compute nonlinear residual for pseudo-timestepping

This computes the residual for \dot U = 0, i.e. F(U, 0) for the IFunction.

Collective

Input Parameters:

  • ts - the timestep context
  • solution - the solution vector

Output Parameter:

  • residual - the nonlinear residual
  • fnorm - the norm of the nonlinear residual

Level: advanced

See also: TSPSEUDO

External Links

source
PETSc.LibPETSc.TSPseudoIncrementDtFromInitialDt — Method
TSPseudoIncrementDtFromInitialDt(petsclib::PetscLibType, ts::AbstractTS)

Indicates that a new timestep is computed via the formula dt = initial_dtinitial_fnorm/current_fnorm rather than the default update, dt = current_dtprevious_fnorm/current_fnorm.

Logically Collective

Input Parameter:

  • ts - the timestep context

Options Database Key:

  • -ts_pseudo_increment_dt_from_initial_dt (true|false) - use the initial dt to determine increment

Level: advanced

See also: TSPSEUDO, TSPseudoSetTimeStep(), TSPseudoTimeStepDefault()

External Links

source
PETSc.LibPETSc.TSPseudoSetMaxTimeStep — Method
TSPseudoSetMaxTimeStep(petsclib::PetscLibType, ts::AbstractTS, maxdt::PetscReal)

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

Logically Collective

Input Parameters:

  • ts - the timestep 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

See also: TSPSEUDO, TSPseudoSetTimeStep(), TSPseudoTimeStepDefault()

External Links

source
PETSc.LibPETSc.TSPseudoSetTimeStep — Method
TSPseudoSetTimeStep(petsclib::PetscLibType, ts::AbstractTS, dt::external, ctx::Ptr{Cvoid})

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

Logically Collective

Input Parameters:

  • ts - timestep 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

See also: TSPSEUDO, TSPseudoTimeStepDefault(), TSPseudoComputeTimeStep()

External Links

source
PETSc.LibPETSc.TSPseudoSetTimeStepIncrement — Method
TSPseudoSetTimeStepIncrement(petsclib::PetscLibType, ts::AbstractTS, inc::PetscReal)

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

Logically Collective

Input Parameters:

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

Options Database Key:

  • -ts_pseudo_increment increment - set pseudo increment

Level: advanced

See also: TSPSEUDO, TSPseudoSetTimeStep(), TSPseudoTimeStepDefault()

External Links

source
PETSc.LibPETSc.TSPseudoSetVerifyTimeStep — Method
TSPseudoSetVerifyTimeStep(petsclib::PetscLibType, ts::AbstractTS, dt::external, ctx::Ptr{Cvoid})

Sets a user-defined routine to verify the quality of the last timestep.

Logically Collective

Input Parameters:

  • ts - timestep 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

See also: TSPSEUDO, TSPseudoVerifyTimeStepDefault(), TSPseudoVerifyTimeStep()

External Links

source
PETSc.LibPETSc.TSPseudoTimeStepDefault — Method
newdt::PetscReal = TSPseudoTimeStepDefault(petsclib::PetscLibType, ts::AbstractTS, dtctx::Ptr{Cvoid})

Default code to compute pseudo-timestepping. Use with TSPseudoSetTimeStep().

Collective, No Fortran Support

Input Parameters:

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

Output Parameter:

  • newdt - the timestep to use for the next step

Level: advanced

See also: TSPseudoSetTimeStep(), TSPseudoComputeTimeStep(), TSPSEUDO

External Links

source
PETSc.LibPETSc.TSPythonGetType — Method
pyname::String = TSPythonGetType(petsclib::PetscLibType, ts::AbstractTS)

Get the type of a TS object implemented in Python.

Not Collective

Input Parameter:

  • ts - the TS context

Output Parameter:

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

Level: intermediate

See also: TSCreate(), TSSetType(), TSPYTHON, PetscPythonInitialize(), TSPythonSetType()

External Links

source
PETSc.LibPETSc.TSPythonSetType — Method
TSPythonSetType(petsclib::PetscLibType, ts::AbstractTS, 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

See also: TSCreate(), TSSetType(), TSPYTHON, PetscPythonInitialize()

External Links

source
PETSc.LibPETSc.TSRHSJacobianSetReuse — Method
TSRHSJacobianSetReuse(petsclib::PetscLibType, ts::AbstractTS, reuse::PetscBool)

restore the RHS Jacobian before calling the user-provided TSRHSJacobianFn function again

Logically Collective

Input Parameters:

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

Level: intermediate

See also: TS, TSSetRHSJacobian(), TSComputeRHSJacobianConstant()

External Links

source
PETSc.LibPETSc.TSRHSJacobianTest — Method
flg::PetscBool = TSRHSJacobianTest(petsclib::PetscLibType, ts::AbstractTS)

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

Logically Collective

Input Parameter:

  • ts - the time stepping routine

Output Parameter:

  • flg - PETSC_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

See also: TS, Mat, MATSHELL, MatCreateShell(), MatShellGetContext(), MatShellGetOperation(), MatShellTestMultTranspose(), TSRHSJacobianTestTranspose()

External Links

source
PETSc.LibPETSc.TSRHSJacobianTestTranspose — Method
flg::PetscBool = TSRHSJacobianTestTranspose(petsclib::PetscLibType, ts::AbstractTS)

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

Logically Collective

Input Parameter:

  • ts - the time stepping routine

Output Parameter:

  • flg - PETSC_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

See also: TS, Mat, MatCreateShell(), MatShellGetContext(), MatShellGetOperation(), MatShellTestMultTranspose(), TSRHSJacobianTest()

External Links

source
PETSc.LibPETSc.TSRHSSplitGetIS — Method
is::IS = TSRHSSplitGetIS(petsclib::PetscLibType, ts::AbstractTS, splitname::String)

Retrieves the elements for a split as an IS

Logically Collective

Input Parameters:

  • ts - 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

See also: TS, IS, TSRHSSplitSetIS()

External Links

source
PETSc.LibPETSc.TSRHSSplitGetSNES — Method
snes::SNES = TSRHSSplitGetSNES(petsclib::PetscLibType, ts::AbstractTS)

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

Not Collective, but snes is parallel if ts is parallel

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameter:

  • snes - the nonlinear solver context

Level: intermediate

See also: TS, SNES, TSCreate(), TSRHSSplitSetSNES()

External Links

source
PETSc.LibPETSc.TSRHSSplitGetSubTS — Method
subts::TS = TSRHSSplitGetSubTS(petsclib::PetscLibType, ts::AbstractTS, splitname::String)

Get the sub-TS by split name.

Logically Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameters:

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

Level: advanced

See also: TS, IS, TSGetRHSSplitFunction()

External Links

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

Get an array of all sub-TS contexts.

Logically Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Output Parameters:

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

Level: advanced

See also: TS, IS, TSGetRHSSplitFunction()

External Links

source
PETSc.LibPETSc.TSRHSSplitSetIFunction — Method
TSRHSSplitSetIFunction(petsclib::PetscLibType, ts::AbstractTS, splitname::String, r::AbstractPetscVec, ifunc::Ptr{Cvoid}, ctx::Ptr{Cvoid})

Set the split implicit function for TSARKIMEX

Logically Collective

Input Parameters:

  • ts - 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

See also: TS, TSIFunctionFn, IS, TSRHSSplitSetIS(), TSARKIMEX, TSARKIMEXSetFastSlowSplit()

External Links

source
PETSc.LibPETSc.TSRHSSplitSetIJacobian — Method
TSRHSSplitSetIJacobian(petsclib::PetscLibType, ts::AbstractTS, splitname::String, Amat::AbstractPetscMat, Pmat::AbstractPetscMat, ijac::Ptr{Cvoid}, ctx::Ptr{Cvoid})

Set the Jacobian for the split implicit function with TSARKIMEX

Logically Collective

Input Parameters:

  • ts - 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

See also: TS, TSRHSSplitSetIFunction, TSIJacobianFn, IS, TSRHSSplitSetIS(), TSARKIMEXSetFastSlowSplit()

External Links

source
PETSc.LibPETSc.TSRHSSplitSetIS — Method
TSRHSSplitSetIS(petsclib::PetscLibType, ts::AbstractTS, splitname::String, is::AbstractIS)

Set the index set for the specified split

Logically Collective

Input Parameters:

  • ts - 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

See also: TS, IS, TSRHSSplitGetIS(), TSARKIMEXSetFastSlowSplit()

External Links

source
PETSc.LibPETSc.TSRHSSplitSetRHSFunction — Method
TSRHSSplitSetRHSFunction(petsclib::PetscLibType, ts::AbstractTS, splitname::String, r::AbstractPetscVec, rhsfunc::Ptr{Cvoid}, ctx::Ptr{Cvoid})

Set the split right-hand-side functions.

Logically Collective

Input Parameters:

  • ts - 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

See also: TS, TSRHSFunctionFn, IS, TSRHSSplitSetIS()

External Links

source
PETSc.LibPETSc.TSRHSSplitSetSNES — Method
TSRHSSplitSetSNES(petsclib::PetscLibType, ts::AbstractTS, snes::AbstractSNES)

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

Collective

Input Parameters:

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

Level: intermediate

See also: TS, SNES, TSCreate(), TSRHSSplitGetSNES()

External Links

source
PETSc.LibPETSc.TSRKGetMultirate — Method
use_multirate::PetscBool = TSRKGetMultirate(petsclib::PetscLibType, ts::AbstractTS)

Gets whether to use the interpolation-based multirate TSRK method

Not Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

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

Level: intermediate

See also: TSRK, TSRKSetMultirate()

External Links

source
PETSc.LibPETSc.TSRKGetOrder — Method
order::PetscInt = TSRKGetOrder(petsclib::PetscLibType, ts::AbstractTS)

Get the order of the TSRK scheme

Not Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

  • order - order of TSRK scheme

Level: intermediate

See also: TSRK, TSRKGetType()

External Links

source
PETSc.LibPETSc.TSRKGetTableau — Method
s::PetscInt,A::Vector{PetscReal},b::Vector{PetscReal},c::Vector{PetscReal},bembed::Vector{PetscReal},p::PetscInt,binterp::Vector{PetscReal},FSAL::PetscBool = TSRKGetTableau(petsclib::PetscLibType, ts::AbstractTS)

Get info on the TSRK tableau

Not Collective

Input Parameter:

  • ts - timestepping context

Output Parameters:

  • s - number of stages, this is the dimension of the matrices 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

See also: TSRK, TSRKRegister(), TSRKSetType()

External Links

source
PETSc.LibPETSc.TSRKGetType — Method
rktype::String = TSRKGetType(petsclib::PetscLibType, ts::AbstractTS)

Get the type of TSRK scheme

Not Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

  • rktype - type of TSRK-scheme

Level: intermediate

See also: TSRKSetType()

External Links

source
PETSc.LibPETSc.TSRKInitializePackage — Method
TSRKInitializePackage(petsclib::PetscLibType)

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

Level: developer

See also: TSInitializePackage(), PetscInitialize(), TSRKFinalizePackage()

External Links

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

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

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

Input Parameters:

  • name - identifier for 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

See also: TSRK

External Links

source
PETSc.LibPETSc.TSRKSetMultirate — Method
TSRKSetMultirate(petsclib::PetscLibType, ts::AbstractTS, use_multirate::PetscBool)

Use the interpolation-based multirate TSRK method

Logically Collective

Input Parameters:

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

Options Database Key:

  • -ts_rk_multirate (true|false) - enable the multirate RK method

Level: intermediate

See also: TSRK, TSRKGetMultirate()

External Links

source
PETSc.LibPETSc.TSRKSetType — Method
TSRKSetType(petsclib::PetscLibType, ts::AbstractTS, rktype::String)

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|2b|3|3bs|4|5f|5dp|5bs|6vr|7vr|8vr) - the type

Level: intermediate

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

External Links

source
PETSc.LibPETSc.TSRegister — Method
TSRegister(petsclib::PetscLibType, sname::String, fnc::external)

Adds a creation method to the TS package.

Not Collective, No Fortran Support

Input Parameters:

  • sname - The name of a new user-defined creation routine
  • function - The creation routine itself

Calling sequence of function:

  • ts - the TS being setup for the new TSType being registered

Level: advanced

See also: TSSetType(), TSType, TSRegisterAll(), TSRegisterDestroy()

External Links

source
PETSc.LibPETSc.TSRemoveTrajectory — Method
TSRemoveTrajectory(petsclib::PetscLibType, ts::AbstractTS)

Destroys and removes the internal TSTrajectory object from a TS

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Level: intermediate

See also: TSTrajectory, TSResetTrajectory(), TSAdjointSolve()

External Links

source
PETSc.LibPETSc.TSReset — Method
TSReset(petsclib::PetscLibType, ts::AbstractTS)

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

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Level: developer

See also: TS, TSCreate(), TSSetUp(), TSDestroy(), TSSetResize()

External Links

source
PETSc.LibPETSc.TSResetTrajectory — Method
TSResetTrajectory(petsclib::PetscLibType, ts::AbstractTS)

Destroys and recreates the internal TSTrajectory object

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Level: intermediate

See also: TSTrajectory, TSGetTrajectory(), TSAdjointSolve(), TSRemoveTrajectory()

External Links

source
PETSc.LibPETSc.TSResize — Method
TSResize(petsclib::PetscLibType, ts::AbstractTS)

Runs the user-defined transfer functions provided with TSSetResize()

Collective

Input Parameter:

  • ts - The TS context obtained from TSCreate()

Level: developer

See also: TS, TSSetResize()

External Links

source
PETSc.LibPETSc.TSResizeRegisterVec — Method
TSResizeRegisterVec(petsclib::PetscLibType, ts::AbstractTS, name::String, vec::AbstractPetscVec)

Register a vector to be transferred with TSResize().

Collective

Input Parameters:

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

Level: developer

See also: TS, TSSetResize(), TSResize(), TSResizeRetrieveVec()

External Links

source
PETSc.LibPETSc.TSResizeRetrieveVec — Method
TSResizeRetrieveVec(petsclib::PetscLibType, ts::AbstractTS, name::String, vec::AbstractPetscVec)

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

See also: TS, TSSetResize(), TSResize(), TSResizeRegisterVec()

External Links

source
PETSc.LibPETSc.TSRestartStep — Method
TSRestartStep(petsclib::PetscLibType, ts::AbstractTS)

Flags the solver to restart the next step

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Level: advanced

See also: TS, TSBDF, TSSolve(), TSSetPreStep(), TSSetPostStep()

External Links

source
PETSc.LibPETSc.TSRollBack — Method
TSRollBack(petsclib::PetscLibType, ts::AbstractTS)

Rolls back one time step

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Level: advanced

See also: TS, TSGetStepRollBack(), TSCreate(), TSSetUp(), TSDestroy(), TSSolve(), TSSetPreStep(), TSSetPreStage(), TSInterpolate()

External Links

source
PETSc.LibPETSc.TSRosWGetType — Method
rostype::String = TSRosWGetType(petsclib::PetscLibType, ts::AbstractTS)

Get the type of Rosenbrock-W scheme

Logically Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

  • rostype - type of Rosenbrock-W scheme

Level: intermediate

See also: TSRosWType, TSRosWSetType()

External Links

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

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

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

Input Parameters:

  • name - identifier for 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

See also: TSROSW

External Links

source
PETSc.LibPETSc.TSRosWRegisterRos4 — Method
TSRosWRegisterRos4(petsclib::PetscLibType, name::String, gamma::PetscReal, a2::PetscReal, a3::PetscReal, b3::PetscReal, e4::PetscReal)

register a fourth order Rosenbrock scheme by providing parameter choices

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

Input Parameters:

  • name - identifier for 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

See also: TSROSW, TSRosWRegister()

External Links

source
PETSc.LibPETSc.TSRosWSetRecomputeJacobian — Method
TSRosWSetRecomputeJacobian(petsclib::PetscLibType, ts::AbstractTS, flg::PetscBool)

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

Logically Collective

Input Parameters:

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

Level: intermediate

See also: TSRosWType, TSRosWGetType()

External Links

source
PETSc.LibPETSc.TSRosWSetType — Method
TSRosWSetType(petsclib::PetscLibType, ts::AbstractTS, roswtype::String)

Set the type of Rosenbrock-W, TSROSW, scheme

Logically Collective

Input Parameters:

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

Level: beginner

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

External Links

source
PETSc.LibPETSc.TSSSPFinalizePackage — Method
TSSSPFinalizePackage(petsclib::PetscLibType)

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

Level: developer

See also: PetscFinalize(), TSSSPInitiallizePackage(), TSInitializePackage()

External Links

source
PETSc.LibPETSc.TSSSPGetNumStages — Method
nstages::PetscInt = TSSSPGetNumStages(petsclib::PetscLibType, ts::AbstractTS)

get the number of stages in the TSSSP time integration scheme

Logically Collective

Input Parameter:

  • ts - time stepping object

Output Parameter:

  • nstages - number of stages

Level: beginner

See also: TSSSP, TSSSPGetType(), TSSSPSetNumStages(), TSSSPRKS2, TSSSPRKS3, TSSSPRK104

External Links

source
PETSc.LibPETSc.TSSSPGetType — Method
type::String = TSSSPGetType(petsclib::PetscLibType, ts::AbstractTS)

get the TSSSP time integration scheme

Logically Collective

Input Parameter:

  • ts - time stepping object

Output Parameter:

  • type - type of scheme being used

Level: beginner

See also: TSSSP, TSSSPSetType(), TSSSPSetNumStages(), TSSSPRKS2, TSSSPRKS3, TSSSPRK104

External Links

source
PETSc.LibPETSc.TSSSPInitializePackage — Method
TSSSPInitializePackage(petsclib::PetscLibType)

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

Level: developer

See also: PetscInitialize(), TSSSPFinalizePackage(), TSInitializePackage()

External Links

source
PETSc.LibPETSc.TSSSPSetNumStages — Method
TSSSPSetNumStages(petsclib::PetscLibType, ts::AbstractTS, nstages::PetscInt)

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

Logically Collective

Input Parameters:

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

Options Database Keys:

  • -ts_ssp_type (rks2|rks3|rk104) - Type of TSSSP method, see TSSSPType
  • -ts_ssp_num_stages nstages - number of stages

Level: beginner

See also: TSSSP, TSSSPGetNumStages(), TSSSPRKS2, TSSSPRKS3, TSSSPRK104

External Links

source
PETSc.LibPETSc.TSSSPSetType — Method
TSSSPSetType(petsclib::PetscLibType, ts::AbstractTS, ssptype::String)

set the TSSSP time integration scheme to use

Logically Collective

Input Parameters:

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

Options Database Keys:

  • -ts_ssp_type (rks2|rks3|rk104) - Type of TSSSP method, see TSSSPType
  • -ts_ssp_num_stages nstages - Number of stages

Level: beginner

See also: TSSSP, TSSSPGetType(), TSSSPSetNumStages(), TSSSPRKS2, TSSSPRKS3, TSSSPRK104

External Links

source
PETSc.LibPETSc.TSSetApplicationContext — Method
TSSetApplicationContext(petsclib::PetscLibType, ts::AbstractTS, ctx::Ptr{Cvoid})

Sets an optional user-defined context for the timesteppers that may be accessed, for example inside the user provided TS callbacks with TSGetApplicationContext()

Logically Collective

Input Parameters:

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

Level: intermediate

See also: TS, TSGetApplicationContext()

External Links

source
PETSc.LibPETSc.TSSetCFLTimeLocal — Method
TSSetCFLTimeLocal(petsclib::PetscLibType, ts::AbstractTS, cfltime::PetscReal)

Set the local CFL constraint relative to forward Euler

Logically Collective

Input Parameters:

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

See also: TSGetCFLTime(), TSADAPTCFL

External Links

source
PETSc.LibPETSc.TSSetComputeExactError — Method
TSSetComputeExactError(petsclib::PetscLibType, ts::AbstractTS, exactError::external)

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

Logically collective

Input Parameters:

  • ts - time stepping 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

See also: TS, TSGetComputeExactError(), TSComputeExactError()

External Links

source
PETSc.LibPETSc.TSSetComputeInitialCondition — Method
TSSetComputeInitialCondition(petsclib::PetscLibType, ts::AbstractTS, initCondition::external)

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

Logically collective

Input Parameters:

  • ts - time stepping 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

See also: TS, TSGetComputeInitialCondition(), TSComputeInitialCondition()

External Links

source
PETSc.LibPETSc.TSSetConvergedReason — Method
TSSetConvergedReason(petsclib::PetscLibType, ts::AbstractTS, reason::TSConvergedReason)

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

Logically Collective; reason must contain common value

Input Parameters:

  • ts - 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

See also: TS, TSSolve(), TSConvergedReason

External Links

source
PETSc.LibPETSc.TSSetCostGradients — Method
TSSetCostGradients(petsclib::PetscLibType, ts::AbstractTS, numcost::PetscInt, lambda::Vector{<:AbstractPetscVec}, mu::Vector{<:AbstractPetscVec})

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

Logically Collective

Input Parameters:

  • ts - 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

See also: TS, TSAdjointSolve(), TSGetCostGradients()

External Links

source
PETSc.LibPETSc.TSSetCostHessianProducts — Method
TSSetCostHessianProducts(petsclib::PetscLibType, ts::AbstractTS, numcost::PetscInt, lambda2::Vector{<:AbstractPetscVec}, mu2::Vector{<:AbstractPetscVec}, dir::AbstractPetscVec)

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

Logically Collective

Input Parameters:

  • ts - 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

See also: TS, TSAdjointSolve(), TSAdjointSetForward()

External Links

source
PETSc.LibPETSc.TSSetDM — Method
TSSetDM(petsclib::PetscLibType, ts::AbstractTS, dm::AbstractPetscDM)

Sets the DM that may be used by some nonlinear solvers or preconditioners under the TS

Logically Collective

Input Parameters:

  • ts - the TS integrator object
  • dm - the dm, cannot be NULL

Level: intermediate

See also: TS, DM, TSGetDM(), SNESSetDM(), SNESGetDM()

External Links

source
PETSc.LibPETSc.TSSetEquationType — Method
TSSetEquationType(petsclib::PetscLibType, ts::AbstractTS, equation_type::TSEquationType)

Sets the type of the equation that TS is solving.

Not Collective

Input Parameters:

  • ts - the TS context
  • equation_type - see TSEquationType

Level: advanced

See also: TS, TSGetEquationType(), TSEquationType

External Links

source
PETSc.LibPETSc.TSSetErrorIfStepFails — Method
TSSetErrorIfStepFails(petsclib::PetscLibType, ts::AbstractTS, 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

See also: TS, TSGetSNESIterations(), TSGetKSPIterations(), TSSetMaxStepRejections(), TSGetStepRejections(), TSGetSNESFailures(), TSGetConvergedReason()

External Links

source
PETSc.LibPETSc.TSSetEvaluationTimes — Method
TSSetEvaluationTimes(petsclib::PetscLibType, ts::AbstractTS, n::PetscInt, time_points::Vector{PetscReal})

sets the evaluation points. The solution will be computed and stored for each time requested

Collective

Input Parameters:

  • ts - the time-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

See also: TS, TSGetEvaluationTimes(), TSGetEvaluationSolutions(), TSSetTimeSpan()

External Links

source
PETSc.LibPETSc.TSSetEventHandler — Method
TSSetEventHandler(petsclib::PetscLibType, ts::AbstractTS, nevents::PetscInt, direction::Vector{PetscInt}, terminate::Vector{PetscBool}, indicator::external, postevent::external, ctx::Ptr{Cvoid})

Sets functions and parameters used for indicating events and handling them

Logically Collective

Input Parameters:

  • ts - 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

See also: TSEvent, TSCreate(), TSSetTimeStep(), TSSetConvergedReason()

External Links

source
PETSc.LibPETSc.TSSetEventTolerances — Method
TSSetEventTolerances(petsclib::PetscLibType, ts::AbstractTS, tol::PetscReal, vtol::Vector{PetscReal})

Set tolerances for event (indicator function) zero crossings

Logically Collective

Input Parameters:

  • ts - time integration 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

See also: TS, TSEvent, TSSetEventHandler()

External Links

source
PETSc.LibPETSc.TSSetExactFinalTime — Method
TSSetExactFinalTime(petsclib::PetscLibType, ts::AbstractTS, eftopt::TSExactFinalTimeOption)

Determines whether to adapt the final time step to match the exact final time, to interpolate the solution to the exact final time, or to just return at the final time TS computed (which may be slightly larger than the requested final time).

Logically Collective

Input Parameters:

  • ts - the time-step context
  • eftopt - exact final time option

$TS_EXACTFINALTIME_STEPOVER - Don't do anything if final time is exceeded, just use it TS_EXACTFINALTIME_INTERPOLATE - Interpolate back to final time if the final time is exceeded TS_EXACTFINALTIME_MATCHSTEP - Adapt final time step to ensure the computed final time exactly equals the requested final time$

Options Database Key:

  • -ts_exact_final_time stepover,interpolate,matchstep - select the final step approach at runtime

Level: beginner

See also: TS, TSExactFinalTimeOption, TSGetExactFinalTime()

External Links

source
PETSc.LibPETSc.TSSetForcingFunction — Method
TSSetForcingFunction(petsclib::PetscLibType, ts::AbstractTS, func::Ptr{Cvoid}, ctx::Ptr{Cvoid})

Provide a function that computes a forcing term for a ODE or PDE

Logically Collective

Input Parameters:

  • ts - 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

See also: TS, TSForcingFn, TSSetRHSJacobian(), TSSetIJacobian(), TSComputeSolutionFunction(), TSSetSolutionFunction()

External Links

source
PETSc.LibPETSc.TSSetFromOptions — Method
TSSetFromOptions(petsclib::PetscLibType, ts::AbstractTS)

Sets various TS parameters from the options database

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Options Database Keys:

  • -ts_type type - 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_time_step dt - initial time step (only a suggestion, the actual initial time step used differ)
  • -ts_exact_final_time (stepover,interpolate,matchstep) - whether to stop at the exact given final time and how to compute the solution at that time
  • -ts_max_snes_failures maxfailures - Maximum number of nonlinear solve failures allowed
  • -ts_max_step_rejections maxrejects - Maximum number of step rejections before step fails
  • -ts_error_if_step_fails (true|false) - Error if no step succeeds
  • -ts_rtol rtol - relative tolerance for local truncation error
  • -ts_atol atol - Absolute tolerance for local truncation error
  • -ts_rhs_jacobian_test_mult -mat_shell_test_mult_view - test the Jacobian at each iteration against finite difference with RHS function
  • -ts_rhs_jacobian_test_mult_transpose - test the Jacobian at each iteration against finite difference with RHS function
  • -ts_adjoint_solve (true|false) - After solving the ODE/DAE solve the adjoint problem (requires -ts_save_trajectory)
  • -ts_fd_color - Use finite differences with coloring to compute IJacobian
  • -ts_monitor - print information at each timestep
  • -ts_monitor_cancel - Cancel all monitors
  • -ts_monitor_wall_clock_time - Monitor wall-clock time, 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

See also: TS, TSGetType()

External Links

source
PETSc.LibPETSc.TSSetFunctionDomainError — Method
TSSetFunctionDomainError(petsclib::PetscLibType, ts::AbstractTS, func::external)

Set a function that tests if the current state vector is valid

Logically collective

Input Parameters:

  • ts - 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

See also: TSAdaptCheckStage(), TSFunctionDomainError(), SNESSetFunctionDomainError(), TSGetSNES()

External Links

source
PETSc.LibPETSc.TSSetI2Function — Method
TSSetI2Function(petsclib::PetscLibType, ts::AbstractTS, F::AbstractPetscVec, fun::Ptr{Cvoid}, ctx::Ptr{Cvoid})

Set the function to compute F(t,U,Ut,Utt) where F = 0 is the DAE to be solved.

Logically Collective

Input Parameters:

  • ts - 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

See also: TS, TSI2FunctionFn, TSSetI2Jacobian(), TSSetIFunction(), TSCreate(), TSSetRHSFunction()

External Links

source
PETSc.LibPETSc.TSSetI2Jacobian — Method
TSSetI2Jacobian(petsclib::PetscLibType, ts::AbstractTS, J::AbstractPetscMat, P::AbstractPetscMat, jac::Ptr{Cvoid}, ctx::Ptr{Cvoid})

Set the function to compute the matrix dF/dU + vdF/dU_t + adF/dUtt where F(t,U,Ut,U_tt) is the function you provided with TSSetI2Function().

Logically Collective

Input Parameters:

  • ts - 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

See also: TS, TSI2JacobianFn, TSSetI2Function(), TSGetI2Jacobian()

External Links

source
PETSc.LibPETSc.TSSetIFunction — Method
TSSetIFunction(petsclib::PetscLibType, ts::AbstractTS, r::AbstractPetscVec, f::Ptr{Cvoid}, ctx::Ptr{Cvoid})

Set the function to compute F(t,U,U_t) where F() = 0 is the DAE to be solved.

Logically Collective

Input Parameters:

  • ts - 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

See also: TS, TSIFunctionFn, TSSetRHSJacobian(), TSSetRHSFunction(), TSSetIJacobian()

External Links

source
PETSc.LibPETSc.TSSetIHessianProduct — Method
TSSetIHessianProduct(petsclib::PetscLibType, ts::AbstractTS, ihp1::Vector{<:AbstractPetscVec}, ihessianproductfunc1::external, ihp2::Vector{<:AbstractPetscVec}, ihessianproductfunc2::external, ihp3::Vector{<:AbstractPetscVec}, ihessianproductfunc3::external, ihp4::Vector{<:AbstractPetscVec}, ihessianproductfunc4::external, ctx::Ptr{Cvoid})

Sets the function that computes the vector-Hessian-vector product. The Hessian is the second-order derivative of F (IFunction) w.r.t. the state variable.

Logically Collective

Input Parameters:

  • ts - TS context obtained from TSCreate()
  • ihp1 - an array of vectors storing the result of vector-Hessian-vector product for F_{UU}
  • ihessianproductfunc1 - vector-Hessian-vector product function for F_{UU}
  • ihp2 - an array of vectors storing the result of vector-Hessian-vector product for F_{UP}
  • ihessianproductfunc2 - vector-Hessian-vector product function for F_{UP}
  • ihp3 - an array of vectors storing the result of vector-Hessian-vector product for F_{PU}
  • ihessianproductfunc3 - vector-Hessian-vector product function for F_{PU}
  • ihp4 - an array of vectors storing the result of vector-Hessian-vector product for F_{PP}
  • ihessianproductfunc4 - vector-Hessian-vector product function for F_{PP}
  • ctx - [optional] function context

Calling sequence of ihessianproductfunc1:

  • ts - 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] function context

Level: intermediate

See also: TS

External Links

source
PETSc.LibPETSc.TSSetIJacobian — Method
TSSetIJacobian(petsclib::PetscLibType, ts::AbstractTS, Amat::AbstractPetscMat, Pmat::AbstractPetscMat, f::Ptr{Cvoid}, ctx::Ptr{Cvoid})

Set the function to compute the matrix dF/dU + a*dF/dUt where F(t,U,Ut) is the function provided with TSSetIFunction().

Logically Collective

Input Parameters:

  • ts - 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

See also: TS, TSIJacobianFn, TSSetIFunction(), TSSetRHSJacobian(), SNESComputeJacobianDefaultColor(), SNESComputeJacobianDefault(), TSSetRHSFunction()

External Links

source
PETSc.LibPETSc.TSSetIJacobianP — Method
TSSetIJacobianP(petsclib::PetscLibType, ts::AbstractTS, Amat::AbstractPetscMat, func::external, ctx::Ptr{Cvoid})

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

Logically Collective

Input Parameters:

  • ts - TS context obtained from TSCreate()
  • Amat - JacobianP matrix
  • func - function
  • ctx - [optional] 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] function context

Level: intermediate

See also: TSSetRHSJacobianP(), TS

External Links

source
PETSc.LibPETSc.TSSetMatStructure — Method
TSSetMatStructure(petsclib::PetscLibType, ts::AbstractTS, str::MatStructure)

sets the relationship between the nonzero structure of the RHS Jacobian matrix to the IJacobian matrix.

Logically Collective

Input Parameters:

  • ts - the time-stepper
  • str - the structure (the default is UNKNOWN_NONZERO_PATTERN)

Level: intermediate

See also: TS, MatAXPY(), MatStructure

External Links

source
PETSc.LibPETSc.TSSetMaxSNESFailures — Method
TSSetMaxSNESFailures(petsclib::PetscLibType, ts::AbstractTS, fails::PetscInt)

Sets the maximum number of failed SNES solves allowed before TSSolve() is ended with a TSConvergedReason of TS_DIVERGED_NONLINEAR_SOLVE

Not Collective

Input Parameters:

  • ts - 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

See also: TS, SNES, TSGetSNESIterations(), TSGetKSPIterations(), TSSetMaxStepRejections(), TSGetStepRejections(), TSGetSNESFailures(), SNESGetConvergedReason(), TSGetConvergedReason(), TS_DIVERGED_NONLINEAR_SOLVE, TSConvergedReason

External Links

source
PETSc.LibPETSc.TSSetMaxStepRejections — Method
TSSetMaxStepRejections(petsclib::PetscLibType, ts::AbstractTS, rejects::PetscInt)

Sets the maximum number of step rejections allowed in a single time-step attempt before a time step fails in TSSolve() with TS_DIVERGED_STEP_REJECTED

Not Collective

Input Parameters:

  • ts - TS context
  • rejects - maximum number of rejected steps, pass PETSC_UNLIMITED for unlimited

Options Database Key:

  • -ts_max_step_rejections - Maximum number of step rejections before a step fails

Level: intermediate

See also: TS, SNES, TSGetSNESIterations(), TSGetKSPIterations(), TSSetMaxSNESFailures(), TSGetStepRejections(), TSGetSNESFailures(), TSSetErrorIfStepFails(), TSGetConvergedReason(), TSSolve(), TS_DIVERGED_STEP_REJECTED

External Links

source
PETSc.LibPETSc.TSSetMaxSteps — Method
TSSetMaxSteps(petsclib::PetscLibType, ts::AbstractTS, 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

See also: TS, TSGetMaxSteps(), TSSetMaxTime(), TSSetExactFinalTime()

External Links

source
PETSc.LibPETSc.TSSetMaxTime — Method
TSSetMaxTime(petsclib::PetscLibType, ts::AbstractTS, 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

See also: TS, TSGetMaxTime(), TSSetMaxSteps(), TSSetExactFinalTime()

External Links

source
PETSc.LibPETSc.TSSetOptionsPrefix — Method
TSSetOptionsPrefix(petsclib::PetscLibType, ts::AbstractTS, prefix::String)

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

Logically Collective

Input Parameters:

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

Level: advanced

See also: TS, TSSetFromOptions(), TSAppendOptionsPrefix()

External Links

source
PETSc.LibPETSc.TSSetPostEvaluate — Method
TSSetPostEvaluate(petsclib::PetscLibType, ts::AbstractTS, func::external)

Sets the general-purpose function called at the end of each step evaluation.

Logically Collective

Input Parameters:

  • ts - The TS context obtained from TSCreate()
  • func - The function

Calling sequence of func:

  • ts - the TS context

Level: intermediate

See also: TS, TSSetPreStage(), TSSetPreStep(), TSSetPostStep(), TSGetApplicationContext()

External Links

source
PETSc.LibPETSc.TSSetPostEventSecondStep — Method
TSSetPostEventSecondStep(petsclib::PetscLibType, ts::AbstractTS, dt2::PetscReal)

Set the second time step to use after the event

Logically Collective

Input Parameters:

  • ts - time integration context
  • dt2 - second post event step

Options Database Key:

  • -ts_event_post_event_second_step dt2 - second time step after the event

Level: advanced

See also: TS, TSEvent, TSSetEventHandler(), TSSetPostEventStep()

External Links

source
PETSc.LibPETSc.TSSetPostEventStep — Method
TSSetPostEventStep(petsclib::PetscLibType, ts::AbstractTS, dt1::PetscReal)

Set the first time step to use after the event

Logically Collective

Input Parameters:

  • ts - time integration context
  • dt1 - first post event step

Options Database Key:

  • -ts_event_post_event_step dt1 - first time step after the event

Level: advanced

See also: TS, TSEvent, TSSetEventHandler(), TSSetPostEventSecondStep()

External Links

source
PETSc.LibPETSc.TSSetPostStage — Method
TSSetPostStage(petsclib::PetscLibType, ts::AbstractTS, func::external)

Sets the general-purpose function called once at the end of each stage.

Logically Collective

Input Parameters:

  • ts - 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

See also: TS, TSSetPreStage(), TSSetPreStep(), TSSetPostStep(), TSGetApplicationContext()

External Links

source
PETSc.LibPETSc.TSSetPostStep — Method
TSSetPostStep(petsclib::PetscLibType, ts::AbstractTS, func::external)

Sets the general-purpose function called once at the end of each successful time step.

Logically Collective

Input Parameters:

  • ts - The TS context obtained from TSCreate()
  • func - The function

Calling sequence of func:

  • ts - the TS context

Level: intermediate

See also: TS, TSSetPreStep(), TSSetPreStage(), TSSetPostEvaluate(), TSGetTimeStep(), TSGetStepNumber(), TSGetTime(), TSRestartStep()

External Links

source
PETSc.LibPETSc.TSSetPreStage — Method
TSSetPreStage(petsclib::PetscLibType, ts::AbstractTS, func::external)

Sets the general-purpose function called once at the beginning of each stage.

Logically Collective

Input Parameters:

  • ts - The TS context obtained from TSCreate()
  • func - The function

Calling sequence of func:

  • ts - the TS context
  • stagetime - the stage time

Level: intermediate

See also: TS, TSSetPostStage(), TSSetPreStep(), TSSetPostStep(), TSGetApplicationContext()

External Links

source
PETSc.LibPETSc.TSSetPreStep — Method
TSSetPreStep(petsclib::PetscLibType, ts::AbstractTS, func::external)

Sets the general-purpose function called once at the beginning of each time step.

Logically Collective

Input Parameters:

  • ts - The TS context obtained from TSCreate()
  • func - The function

Calling sequence of func:

  • ts - the TS context

Level: intermediate

See also: TS, TSSetPreStage(), TSSetPostStage(), TSSetPostStep(), TSStep(), TSRestartStep()

External Links

source
PETSc.LibPETSc.TSSetProblemType — Method
TSSetProblemType(petsclib::PetscLibType, ts::AbstractTS, 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

$U_t - A U = 0 (linear) U_t - A(t) U = 0 (linear) F(t,U,U_t) = 0 (nonlinear)$

Level: beginner

See also: TSSetUp(), TSProblemType, TS

External Links

source
PETSc.LibPETSc.TSSetRHSFunction — Method
TSSetRHSFunction(petsclib::PetscLibType, ts::AbstractTS, r::AbstractPetscVec, f::Ptr{Cvoid}, ctx::Ptr{Cvoid})

Sets the routine for evaluating the function, where U_t = G(t,u).

Logically Collective

Input Parameters:

  • ts - 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

See also: TS, TSRHSFunctionFn, TSSetRHSJacobian(), TSSetIJacobian(), TSSetIFunction()

External Links

source
PETSc.LibPETSc.TSSetRHSHessianProduct — Method
TSSetRHSHessianProduct(petsclib::PetscLibType, ts::AbstractTS, rhshp1::Vector{<:AbstractPetscVec}, rhshessianproductfunc1::external, rhshp2::Vector{<:AbstractPetscVec}, rhshessianproductfunc2::external, rhshp3::Vector{<:AbstractPetscVec}, rhshessianproductfunc3::external, rhshp4::Vector{<:AbstractPetscVec}, rhshessianproductfunc4::external, ctx::Ptr{Cvoid})

Sets the function that computes the vector-Hessian-vector product. The Hessian is the second-order derivative of G (RHSFunction) w.r.t. the state variable.

Logically Collective

Input Parameters:

  • ts - TS context obtained from TSCreate()
  • rhshp1 - an array of vectors storing the result of vector-Hessian-vector product for G_{UU}
  • rhshessianproductfunc1 - vector-Hessian-vector product function for G_{UU}
  • rhshp2 - an array of vectors storing the result of vector-Hessian-vector product for G_{UP}
  • rhshessianproductfunc2 - vector-Hessian-vector product function for G_{UP}
  • rhshp3 - an array of vectors storing the result of vector-Hessian-vector product for G_{PU}
  • rhshessianproductfunc3 - vector-Hessian-vector product function for G_{PU}
  • rhshp4 - an array of vectors storing the result of vector-Hessian-vector product for G_{PP}
  • rhshessianproductfunc4 - vector-Hessian-vector product function for G_{PP}
  • ctx - [optional] function context

Calling sequence of rhshessianproductfunc1:

  • ts - 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] function context

Level: intermediate

See also: TS, TSAdjoint

External Links

source
PETSc.LibPETSc.TSSetRHSJacobian — Method
TSSetRHSJacobian(petsclib::PetscLibType, ts::AbstractTS, Amat::AbstractPetscMat, Pmat::AbstractPetscMat, f::Ptr{Cvoid}, ctx::Ptr{Cvoid})

Sets the function to compute the Jacobian of G, where U_t = G(U,t), as well as the location to store the matrix.

Logically Collective

Input Parameters:

  • ts - 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

See also: TS, TSRHSJacobianFn, SNESComputeJacobianDefaultColor(), TSSetRHSFunction(), TSRHSJacobianSetReuse(), TSSetIJacobian(), TSRHSFunctionFn, TSIFunctionFn

External Links

source
PETSc.LibPETSc.TSSetRHSJacobianP — Method
TSSetRHSJacobianP(petsclib::PetscLibType, ts::AbstractTS, Amat::AbstractPetscMat, func::Ptr{Cvoid}, ctx::Ptr{Cvoid})

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

Logically Collective

Input Parameters:

  • ts - TS context obtained from TSCreate()
  • Amat - JacobianP matrix
  • func - function
  • ctx - [optional] function context

Level: intermediate

See also: TS, TSRHSJacobianPFn, TSGetRHSJacobianP()

External Links

source
PETSc.LibPETSc.TSSetResize — Method
TSSetResize(petsclib::PetscLibType, ts::AbstractTS, rollback::PetscBool, setup::external, transfer::external, ctx::Ptr{Cvoid})

Sets the resize callbacks.

Logically Collective

Input Parameters:

  • ts - 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

See also: TS, TSSetDM(), TSSetIJacobian(), TSSetRHSJacobian()

External Links

source
PETSc.LibPETSc.TSSetRunSteps — Method
TSSetRunSteps(petsclib::PetscLibType, ts::AbstractTS, runsteps::PetscInt)

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

If the step count when TSSolve() is start_step, this will stop the simulation once current_step - start_step >= run_steps. Comparatively, TSSetMaxSteps() will stop if current_step >= max_steps. The simulation will stop when either condition is reached.

Logically Collective

Input Parameters:

  • ts - 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

See also: TS, TSGetRunSteps(), TSSetMaxTime(), TSSetExactFinalTime(), TSSetMaxSteps()

External Links

source
PETSc.LibPETSc.TSSetSNES — Method
TSSetSNES(petsclib::PetscLibType, ts::AbstractTS, snes::AbstractSNES)

Set the SNES (nonlinear solver) to be used by the TS timestepping context

Collective

Input Parameters:

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

Level: developer

See also: TS, SNES, TSCreate(), TSSetUp(), TSSolve(), TSGetSNES()

External Links

source
PETSc.LibPETSc.TSSetSaveTrajectory — Method
TSSetSaveTrajectory(petsclib::PetscLibType, ts::AbstractTS)

Causes the TS to save its solutions as it iterates forward in time in a TSTrajectory object

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Options Database Keys:

  • -ts_save_trajectory - saves the trajectory to a file
  • -ts_trajectory_type (basic|singlefile|memory|visualization) - set trajectory type

Level: intermediate

See also: TS, TSTrajectoryType, TSTrajectory, TSGetTrajectory(), TSAdjointSolve()

External Links

source
PETSc.LibPETSc.TSSetSolution — Method
TSSetSolution(petsclib::PetscLibType, ts::AbstractTS, u::AbstractPetscVec)

Sets the initial solution vector for use by the TS routines.

Logically Collective

Input Parameters:

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

Level: beginner

See also: TS, TSSetSolutionFunction(), TSGetSolution(), TSCreate()

External Links

source
PETSc.LibPETSc.TSSetSolutionFunction — Method
TSSetSolutionFunction(petsclib::PetscLibType, ts::AbstractTS, f::Ptr{Cvoid}, ctx::Ptr{Cvoid})

Provide a function that computes the solution of the ODE or DAE

Logically Collective

Input Parameters:

  • ts - 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

See also: TS, TSSolutionFn, TSSetRHSJacobian(), TSSetIJacobian(), TSComputeSolutionFunction(), TSSetForcingFunction(), TSSetSolution(), TSGetSolution(), TSMonitorLGError(), TSMonitorDrawError()

External Links

source
PETSc.LibPETSc.TSSetStepNumber — Method
TSSetStepNumber(petsclib::PetscLibType, ts::AbstractTS, 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

See also: TS, TSGetStepNumber(), TSSetTime(), TSSetTimeStep(), TSSetSolution()

External Links

source
PETSc.LibPETSc.TSSetTime — Method
TSSetTime(petsclib::PetscLibType, ts::AbstractTS, t::PetscReal)

Allows one to reset the time.

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • t - the time

Level: intermediate

See also: TS, TSGetTime(), TSSetMaxSteps()

External Links

source
PETSc.LibPETSc.TSSetTimeError — Method
TSSetTimeError(petsclib::PetscLibType, ts::AbstractTS, v::AbstractPetscVec)

Sets the estimated error vector, if the chosen TSType has an error estimation functionality. This can be used to restart such a time integrator with a given error vector.

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

Input Parameters:

  • ts - the TS context obtained from TSCreate() (input parameter).
  • v - the vector containing the error (same size as the solution).

Level: intermediate

See also: TS, TSSetSolution(), TSGetTimeError()

External Links

source
PETSc.LibPETSc.TSSetTimeSpan — Method
TSSetTimeSpan(petsclib::PetscLibType, ts::AbstractTS, n::PetscInt, span_times::Vector{PetscReal})

sets the time span. The solution will be computed and stored for each time requested in the span

Collective

Input Parameters:

  • ts - the time-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

See also: TS, TSSetEvaluationTimes(), TSGetEvaluationTimes(), TSGetEvaluationSolutions()

External Links

source
PETSc.LibPETSc.TSSetTimeStep — Method
TSSetTimeStep(petsclib::PetscLibType, ts::AbstractTS, time_step::PetscReal)

Allows one to reset the timestep at any time.

Logically Collective

Input Parameters:

  • ts - the TS context obtained from TSCreate()
  • time_step - the size of the timestep

Options Database Key:

  • -ts_time_step dt - provide the initial time step

Level: intermediate

See also: TS, TSPSEUDO, TSGetTimeStep(), TSSetTime()

External Links

source
PETSc.LibPETSc.TSSetTolerances — Method
TSSetTolerances(petsclib::PetscLibType, ts::AbstractTS, atol::PetscReal, vatol::AbstractPetscVec, rtol::PetscReal, vrtol::AbstractPetscVec)

Set tolerances for local truncation error when using an adaptive controller

Logically Collective

Input Parameters:

  • ts - time integration 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

See also: TS, TSAdapt, TSErrorWeightedNorm(), TSGetTolerances()

External Links

source
PETSc.LibPETSc.TSSetTransientVariable — Method
TSSetTransientVariable(petsclib::PetscLibType, ts::AbstractTS, tvar::Ptr{Cvoid}, ctx::Ptr{Cvoid})

sets function to transform from state to transient variables

Logically Collective

Input Parameters:

  • ts - time stepping context on which to change the transient variable
  • tvar - a function that transforms to transient variables, see TSTransientVariableFn for the calling sequence
  • ctx - a context for tvar

Level: advanced

See also: TS, TSBDF, TSTransientVariableFn, DMTSSetTransientVariable(), DMTSGetTransientVariable(), TSSetIFunction(), TSSetIJacobian()

External Links

source
PETSc.LibPETSc.TSSetType — Method
TSSetType(petsclib::PetscLibType, ts::AbstractTS, type::String)

Sets the algorithm/method to be used for integrating the ODE with the given TS.

Collective

Input Parameters:

  • ts - The TS context
  • type - A known method

Options Database Key:

  • -ts_type type - Sets the method; see TSType

Level: intermediate

See also: TS, TSSolve(), TSCreate(), TSSetFromOptions(), TSDestroy(), TSType

External Links

source
PETSc.LibPETSc.TSSetUp — Method
TSSetUp(petsclib::PetscLibType, ts::AbstractTS)

Sets up the internal data structures for the later use of a timestepper.

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Level: advanced

See also: TSCreate(), TS, TSStep(), TSDestroy(), TSSolve()

External Links

source
PETSc.LibPETSc.TSSetUseSplitRHSFunction — Method
TSSetUseSplitRHSFunction(petsclib::PetscLibType, ts::AbstractTS, use_splitrhsfunction::PetscBool)

Use the split RHSFunction when a multirate method is used.

Logically Collective

Input Parameters:

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

Options Database Key:

  • -ts_use_splitrhsfunction (true|false) - use the split RHS function for multirate solvers

Level: intermediate

See also: TS, TSGetUseSplitRHSFunction()

External Links

source
PETSc.LibPETSc.TSSolve — Method
TSSolve(petsclib::PetscLibType, ts::AbstractTS, u::AbstractPetscVec)

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

See also: TS, TSCreate(), TSSetSolution(), TSStep(), TSGetTime(), TSGetSolveTime()

External Links

source
PETSc.LibPETSc.TSStep — Method
TSStep(petsclib::PetscLibType, ts::AbstractTS)

Steps one time step

Collective

Input Parameter:

  • ts - the TS context obtained from TSCreate()

Level: developer

See also: TS, TSCreate(), TSSetUp(), TSDestroy(), TSSolve(), TSSetPreStep(), TSSetPreStage(), TSSetPostStage(), TSInterpolate()

External Links

source
PETSc.LibPETSc.TSSundialsGetIterations — Method
nonlin::Cint,lin::Cint = TSSundialsGetIterations(petsclib::PetscLibType, ts::AbstractTS)

Gets the number of nonlinear and linear iterations used so far by TSSUNDIALS.

Not Collective

Input Parameter:

  • ts - the time-step context

Output Parameters:

  • nonlin - number of nonlinear iterations
  • lin - number of linear iterations

Level: advanced

See also: TSSundialsSetType(), TSSundialsSetMaxl(), TSSundialsSetLinearTolerance(), TSSundialsSetGramSchmidtType(), TSSundialsSetTolerance(), TSSundialsGetPC(), TSSetExactFinalTime()

External Links

source
PETSc.LibPETSc.TSSundialsGetPC — Method
pc::PC = TSSundialsGetPC(petsclib::PetscLibType, ts::AbstractTS)

Extract the PC context from a time-step context for TSSUNDIALS.

Input Parameter:

  • ts - the time-step context

Output Parameter:

  • pc - the preconditioner context

Level: advanced

See also: TSSundialsGetIterations(), TSSundialsSetType(), TSSundialsSetMaxl(), TSSundialsSetLinearTolerance(), TSSundialsSetGramSchmidtType(), TSSundialsSetTolerance()

External Links

source
PETSc.LibPETSc.TSSundialsMonitorInternalSteps — Method
TSSundialsMonitorInternalSteps(petsclib::PetscLibType, ts::AbstractTS, 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

See also: TSSundialsGetIterations(), TSSundialsSetType(), TSSundialsSetMaxl(), TSSundialsSetLinearTolerance(), TSSundialsSetGramSchmidtType(), TSSundialsSetTolerance(), TSSundialsGetPC()

External Links

source
PETSc.LibPETSc.TSSundialsSetGramSchmidtType — Method
TSSundialsSetGramSchmidtType(petsclib::PetscLibType, ts::AbstractTS, type::TSSundialsGramSchmidtType)

Sets type of orthogonalization used in GMRES method by TSSUNDIALS linear solver.

Logically Collective

Input Parameters:

  • ts - the time-step context
  • type - either SUNDIALS_MODIFIED_GS or SUNDIALS_CLASSICAL_GS

Level: advanced

See also: TSSundialsGetIterations(), TSSundialsSetType(), TSSundialsSetMaxl(), TSSundialsSetLinearTolerance(), TSSundialsSetTolerance(), TSSundialsGetPC(), TSSetExactFinalTime()

External Links

source
PETSc.LibPETSc.TSSundialsSetLinearTolerance — Method
TSSundialsSetLinearTolerance(petsclib::PetscLibType, ts::AbstractTS, tol::PetscReal)

Sets the tolerance used to solve the linear system by TSSUNDIALS.

Logically Collective

Input Parameters:

  • ts - the time-step 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

See also: TSSundialsGetIterations(), TSSundialsSetType(), TSSundialsSetMaxl(), TSSundialsSetGramSchmidtType(), TSSundialsSetTolerance(), TSSundialsGetPC(), TSSetExactFinalTime()

External Links

source
PETSc.LibPETSc.TSSundialsSetMaxTimeStep — Method
TSSundialsSetMaxTimeStep(petsclib::PetscLibType, ts::AbstractTS, maxdt::PetscReal)

Largest time step to be chosen by the adaptive controller.

Input Parameters:

  • ts - the time-step context
  • maxdt - lowest time step if positive, negative to deactivate

Level: beginner

See also: TSSundialsSetType(), TSSundialsSetTolerance()

External Links

source
PETSc.LibPETSc.TSSundialsSetMaxl — Method
TSSundialsSetMaxl(petsclib::PetscLibType, ts::AbstractTS, maxl::PetscInt)

Sets the dimension of the Krylov space used by GMRES in the linear solver in TSSUNDIALS. TSSUNDIALS DOES NOT use restarted GMRES so this is the maximum number of GMRES steps that will be used.

Logically Collective

Input Parameters:

  • ts - the time-step context
  • maxl - number of direction vectors (the dimension of Krylov subspace).

Level: advanced

See also: TSSundialsGetIterations(), TSSundialsSetType(), TSSundialsSetLinearTolerance(), TSSundialsSetGramSchmidtType(), TSSundialsSetTolerance(), TSSundialsGetPC(), TSSetExactFinalTime()

External Links

source
PETSc.LibPETSc.TSSundialsSetMaxord — Method
TSSundialsSetMaxord(petsclib::PetscLibType, ts::AbstractTS, maxord::PetscInt)

Sets the maximum order for BDF/Adams method used by TSSUNDIALS.

Logically Collective

Input Parameters:

  • ts - the time-step context
  • maxord - maximum order of BDF / Adams method

Level: advanced

See also: TSSundialsGetIterations(), TSSundialsSetType(), TSSundialsSetLinearTolerance(), TSSundialsSetGramSchmidtType(), TSSundialsSetTolerance(), TSSundialsGetPC(), TSSetExactFinalTime()

External Links

source
PETSc.LibPETSc.TSSundialsSetMinTimeStep — Method
TSSundialsSetMinTimeStep(petsclib::PetscLibType, ts::AbstractTS, mindt::PetscReal)

Smallest time step to be chosen by the adaptive controller.

Input Parameters:

  • ts - the time-step context
  • mindt - lowest time step if positive, negative to deactivate

See also: TSSundialsSetType(), TSSundialsSetTolerance()

External Links

source
PETSc.LibPETSc.TSSundialsSetTolerance — Method
TSSundialsSetTolerance(petsclib::PetscLibType, ts::AbstractTS, aabs::PetscReal, rel::PetscReal)

Sets the absolute and relative tolerance used by TSSUNDIALS for error control.

Logically Collective

Input Parameters:

  • ts - the time-step 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

See also: TSSundialsGetIterations(), TSSundialsSetType(), TSSundialsSetGMRESMaxl(), TSSundialsSetLinearTolerance(), TSSundialsSetGramSchmidtType(), TSSundialsGetPC(), TSSetExactFinalTime()

External Links

source
PETSc.LibPETSc.TSSundialsSetType — Method
TSSundialsSetType(petsclib::PetscLibType, ts::AbstractTS, type::TSSundialsLmmType)

Sets the method that TSSUNDIALS will use for integration.

Logically Collective

Input Parameters:

  • ts - the time-step context
  • type - one of SUNDIALS_ADAMS or SUNDIALS_BDF

Level: intermediate

See also: TSSundialsGetIterations(), TSSundialsSetMaxl(), TSSundialsSetLinearTolerance(), TSSundialsSetGramSchmidtType(), TSSundialsSetTolerance(), TSSundialsGetPC(), TSSetExactFinalTime()

External Links

source
PETSc.LibPETSc.TSSundialsSetUseDense — Method
TSSundialsSetUseDense(petsclib::PetscLibType, ts::AbstractTS, use_dense::PetscBool)

Set a flag to use a dense linear solver in TSSUNDIALS (serial only)

Logically Collective

Input Parameters:

  • ts - the time-step context
  • use_dense - PETSC_TRUE to use the dense solver

Level: advanced

See also: TSSUNDIALS

External Links

source
PETSc.LibPETSc.TSThetaGetEndpoint — Method
endpoint::PetscBool = TSThetaGetEndpoint(petsclib::PetscLibType, ts::AbstractTS)

Gets whether to use the endpoint variant of the method (e.g. trapezoid/Crank-Nicolson instead of midpoint rule) for TSTHETA

Not Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

  • endpoint - PETSC_TRUE when using the endpoint variant

Level: advanced

See also: TSThetaSetEndpoint(), TSTHETA, TSCN

External Links

source
PETSc.LibPETSc.TSThetaGetTheta — Method
theta::PetscReal = TSThetaGetTheta(petsclib::PetscLibType, ts::AbstractTS)

Get the abscissa of the stage in (0,1] for TSTHETA

Not Collective

Input Parameter:

  • ts - timestepping context

Output Parameter:

  • theta - stage abscissa

Level: advanced

See also: TSThetaSetTheta(), TSTHETA

External Links

source
PETSc.LibPETSc.TSThetaSetEndpoint — Method
TSThetaSetEndpoint(petsclib::PetscLibType, ts::AbstractTS, flg::PetscBool)

Sets whether to use the endpoint variant of the method (e.g. trapezoid/Crank-Nicolson instead of midpoint rule) for TSTHETA

Not Collective

Input Parameters:

  • ts - timestepping context
  • flg - PETSC_TRUE to use the endpoint variant

Options Database Key:

  • -ts_theta_endpoint flg - use the endpoint variant

Level: intermediate

See also: TSTHETA, TSCN

External Links

source
PETSc.LibPETSc.TSThetaSetTheta — Method
TSThetaSetTheta(petsclib::PetscLibType, ts::AbstractTS, theta::PetscReal)

Set the abscissa of the stage in (0,1] for TSTHETA

Not Collective

Input Parameters:

  • ts - timestepping context
  • theta - stage abscissa

Options Database Key:

  • -ts_theta_theta theta - set theta

Level: intermediate

See also: TSThetaGetTheta(), TSTHETA, TSCN

External Links

source
PETSc.LibPETSc.TSVISetVariableBounds — Method
TSVISetVariableBounds(petsclib::PetscLibType, ts::AbstractTS, xl::AbstractPetscVec, xu::AbstractPetscVec)

Sets the lower and upper bounds for the solution vector. xl <= x <= xu

Input Parameters:

  • ts - the TS context.
  • xl - lower bound.
  • xu - upper bound.

Level: advanced

See also: TS

External Links

source
PETSc.LibPETSc.TSView — Method
TSView(petsclib::PetscLibType, ts::AbstractTS, 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

See also: TS, PetscViewer, PetscViewerASCIIOpen()

External Links

source
PETSc.LibPETSc.TSViewFromOptions — Method
TSViewFromOptions(petsclib::PetscLibType, ts::AbstractTS, obj, name::String)

View a TS based on values in the options database

Collective

Input Parameters:

  • ts - 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

Options Database Key:

  • -name [viewertype][:...] - option name and values. See PetscObjectViewFromOptions() for the possible arguments

Level: intermediate

See also: TS, TSView, PetscObjectViewFromOptions(), TSCreate()

External Links

source

TS Add-ons

Additional TS utilities and helper functions:

PETSc.LibPETSc.TSAdaptCandidateAdd — Method
TSAdaptCandidateAdd(petsclib::PetscLibType, adapt::TSAdapt, name::String, order::PetscInt, stageorder::PetscInt, ccfl::PetscReal, cost::PetscReal, inuse::PetscBool)

add a candidate scheme for the adaptive controller to select from

Logically Collective; No Fortran Support

Input Parameters:

  • adapt - time step adaptivity context, obtained 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

See also: TSAdapt, TSAdaptCandidatesClear(), TSAdaptChoose()

External Links

source
PETSc.LibPETSc.TSAdaptCandidatesClear — Method
TSAdaptCandidatesClear(petsclib::PetscLibType, adapt::TSAdapt)

clear any previously set candidate schemes

Logically Collective

Input Parameter:

  • adapt - adaptive controller

Level: developer

See also: TSAdapt, TSAdaptCreate(), TSAdaptCandidateAdd(), TSAdaptChoose()

External Links

source
PETSc.LibPETSc.TSAdaptCandidatesGet — Method
n::PetscInt,order::Ptr{PetscInt},stageorder::Ptr{PetscInt},ccfl::Ptr{PetscReal},cost::Ptr{PetscReal} = TSAdaptCandidatesGet(petsclib::PetscLibType, adapt::TSAdapt)

Get the list of candidate orders of accuracy and cost

Not Collective

Input Parameter:

  • adapt - time step adaptivity context

Output Parameters:

  • n - number of candidate schemes, always at least 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

See also: TSAdapt, TSAdaptCandidatesClear(), TSAdaptCandidateAdd(), TSAdaptChoose()

External Links

source
PETSc.LibPETSc.TSAdaptCheckStage — Method
accept::PetscBool = TSAdaptCheckStage(petsclib::PetscLibType, adapt::TSAdapt, ts::AbstractTS, t::PetscReal, Y::AbstractPetscVec)

checks whether to accept a stage, (e.g. reject and change time step size if nonlinear solve fails or solution vector is infeasible)

Collective

Input Parameters:

  • adapt - adaptive controller 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

See also: TSAdapt

External Links

source
PETSc.LibPETSc.TSAdaptChoose — Method
next_sc::PetscInt,next_h::PetscReal,accept::PetscBool = TSAdaptChoose(petsclib::PetscLibType, adapt::TSAdapt, ts::AbstractTS, h::PetscReal)

choose which method and step size to use for the next step

Collective

Input Parameters:

  • adapt - adaptive 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

See also: TSAdapt, TSAdaptCandidatesClear(), TSAdaptCandidateAdd()

External Links

source
PETSc.LibPETSc.TSAdaptCreate — Method
inadapt::TSAdapt = TSAdaptCreate(petsclib::PetscLibType, comm::MPI_Comm)

create an adaptive controller context for time stepping

Collective

Input Parameter:

  • comm - The communicator

Output Parameter:

  • inadapt - new TSAdapt object

Level: developer

See also: TSAdapt, TSGetAdapt(), TSAdaptSetType(), TSAdaptDestroy()

External Links

source
PETSc.LibPETSc.TSAdaptDSPSetFilter — Method
TSAdaptDSPSetFilter(petsclib::PetscLibType, adapt::TSAdapt, name::String)

Sets internal parameters corresponding to the named filter {cite}soderlind2006adaptive {cite}soderlind2003digital

Collective

Input Parameters:

  • adapt - adaptive controller 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

See also: TSADAPTDSP, TS, TSAdapt, TSGetAdapt(), TSAdaptDSPSetPID()

External Links

source
PETSc.LibPETSc.TSAdaptDSPSetPID — Method
TSAdaptDSPSetPID(petsclib::PetscLibType, adapt::TSAdapt, kkI::PetscReal, kkP::PetscReal, kkD::PetscReal)

Set the PID controller parameters {cite}soderlind2006adaptive {cite}soderlind2003digital

Input Parameters:

  • adapt - adaptive controller 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

See also: TS, TSAdapt, TSGetAdapt(), TSAdaptDSPSetFilter()

External Links

source
PETSc.LibPETSc.TSAdaptDestroy — Method
TSAdaptDestroy(petsclib::PetscLibType, adapt::Union{TSAdapt, Ref{TSAdapt}})

Destroys a TSAdapt context

Collective

Input Parameter:

  • adapt - the TSAdapt context obtained from TSGetAdapt() or TSAdaptCreate()

Level: intermediate

See also: TSAdapt, TSAdaptCreate(), TSGetAdapt()

External Links

source
PETSc.LibPETSc.TSAdaptGetClip — Method
low::PetscReal,high::PetscReal = TSAdaptGetClip(petsclib::PetscLibType, adapt::TSAdapt)

Gets the admissible decrease/increase factor in step size in the time step adapter

Not Collective

Input Parameter:

  • adapt - adaptive controller context

Output Parameters:

  • low - optional, admissible decrease factor
  • high - optional, admissible increase factor

Level: intermediate

See also: TSAdapt, TSAdaptChoose(), TSAdaptSetClip(), TSAdaptSetScaleSolveFailed()

External Links

source
PETSc.LibPETSc.TSAdaptGetMaxIgnore — Method
max_ignore::PetscReal = TSAdaptGetMaxIgnore(petsclib::PetscLibType, adapt::TSAdapt)

Get error estimation threshold. Solution components below this threshold value will not be considered when computing error norms for time step adaptivity (in absolute value).

Not Collective

Input Parameter:

  • adapt - adaptive controller context

Output Parameter:

  • max_ignore - threshold for solution components that are ignored during error estimation

Level: intermediate

See also: TSAdapt, TSAdaptSetMaxIgnore(), TSAdaptChoose()

External Links

source
PETSc.LibPETSc.TSAdaptGetSafety — Method
safety::PetscReal,reject_safety::PetscReal = TSAdaptGetSafety(petsclib::PetscLibType, adapt::TSAdapt)

Get safety factors for time step adapter

Not Collective

Input Parameter:

  • adapt - adaptive controller context

Output Parameters:

  • safety - safety factor relative to target error/stability goal
  • reject_safety - extra safety factor to apply if the last step was rejected

Level: intermediate

See also: TSAdapt, TSAdaptSetSafety(), TSAdaptChoose()

External Links

source
PETSc.LibPETSc.TSAdaptGetScaleSolveFailed — Method
scale::PetscReal = TSAdaptGetScaleSolveFailed(petsclib::PetscLibType, adapt::TSAdapt)

Gets the admissible decrease/increase factor in step size

Not Collective

Input Parameter:

  • adapt - adaptive controller context

Output Parameter:

  • scale - scale factor

Level: intermediate

See also: TSAdapt, TSAdaptChoose(), TSAdaptSetScaleSolveFailed(), TSAdaptSetClip()

External Links

source
PETSc.LibPETSc.TSAdaptGetStepLimits — Method
hmin::PetscReal,hmax::PetscReal = TSAdaptGetStepLimits(petsclib::PetscLibType, adapt::TSAdapt)

Get the minimum and maximum step sizes to be considered by the time step controller

Not Collective

Input Parameter:

  • adapt - time step adaptivity context, usually gotten with TSGetAdapt()

Output Parameters:

  • hmin - minimum time step
  • hmax - maximum time step

Level: intermediate

See also: TSAdapt, TSAdaptSetStepLimits(), TSAdaptChoose()

External Links

source
PETSc.LibPETSc.TSAdaptGetType — Method
type::String = TSAdaptGetType(petsclib::PetscLibType, adapt::TSAdapt)

gets the TS adapter method type (as a string).

Not Collective

Input Parameter:

  • adapt - The TS adapter, most likely obtained with TSGetAdapt()

Output Parameter:

  • type - The name of TS adapter method

Level: intermediate

See also: TSAdapt, TSAdaptType, TSAdaptSetType()

External Links

source
PETSc.LibPETSc.TSAdaptHistoryGetStep — Method
t::PetscReal,dt::PetscReal = TSAdaptHistoryGetStep(petsclib::PetscLibType, adapt::TSAdapt, step::PetscInt)

Gets time and time step for a given step number in the history

Logically Collective

Input Parameters:

  • adapt - the TSAdapt 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

See also: TS, TSGetAdapt(), TSAdaptSetType(), TSAdaptHistorySetTrajectory(), TSADAPTHISTORY

External Links

source
PETSc.LibPETSc.TSAdaptHistorySetHistory — Method
TSAdaptHistorySetHistory(petsclib::PetscLibType, adapt::TSAdapt, n::PetscInt, hist::Vector{PetscReal}, backward::PetscBool)

Sets the time history in the adaptor

Logically Collective

Input Parameters:

  • adapt - 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

See also: TSGetAdapt(), TSAdaptSetType(), TSAdaptHistorySetTrajectory(), TSADAPTHISTORY

External Links

source
PETSc.LibPETSc.TSAdaptHistorySetTrajectory — Method
TSAdaptHistorySetTrajectory(petsclib::PetscLibType, adapt::TSAdapt, tj::TSTrajectory, backward::PetscBool)

Sets a time history in the adaptor from a given TSTrajectory

Logically Collective

Input Parameters:

  • adapt - the TSAdapt context
  • tj - the TSTrajectory context
  • backward - if the time history has to be followed backward

Level: advanced

See also: TSGetAdapt(), TSAdaptSetType(), TSAdaptHistorySetHistory(), TSADAPTHISTORY, TSAdapt

External Links

source
PETSc.LibPETSc.TSAdaptLoad — Method
TSAdaptLoad(petsclib::PetscLibType, adapt::TSAdapt, viewer::PetscViewer)

Loads a TSAdapt that has been stored in binary with TSAdaptView().

Collective

Input Parameters:

  • adapt - the newly 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

See also: PetscViewerBinaryOpen(), TSAdaptView(), MatLoad(), VecLoad(), TSAdapt

External Links

source
PETSc.LibPETSc.TSAdaptRegister — Method
TSAdaptRegister(petsclib::PetscLibType, sname::String, fnc::external)

adds a TSAdapt implementation

Not Collective, No Fortran Support

Input Parameters:

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

Level: advanced

See also: TSAdaptRegisterAll()

External Links

source
PETSc.LibPETSc.TSAdaptReset — Method
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

See also: TSGetAdapt(), TSAdapt, TSAdaptCreate(), TSAdaptDestroy()

External Links

source
PETSc.LibPETSc.TSAdaptSetAlwaysAccept — Method
TSAdaptSetAlwaysAccept(petsclib::PetscLibType, adapt::TSAdapt, flag::PetscBool)

Set whether to always accept steps regardless of any error or stability condition not meeting the prescribed goal.

Logically Collective

Input Parameters:

  • adapt - time step adaptivity context, usually gotten with TSGetAdapt()
  • flag - whether to always accept steps

Options Database Key:

  • -ts_adapt_always_accept - to always accept steps

Level: intermediate

See also: TSAdapt, TSGetAdapt(), TSAdaptChoose()

External Links

source
PETSc.LibPETSc.TSAdaptSetCheckStage — Method
TSAdaptSetCheckStage(petsclib::PetscLibType, adapt::TSAdapt, func::external)

Set a callback to check convergence for a stage

Logically Collective

Input Parameters:

  • adapt - adaptive controller 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

See also: TSAdapt, TSGetAdapt(), TSAdaptChoose()

External Links

source
PETSc.LibPETSc.TSAdaptSetClip — Method
TSAdaptSetClip(petsclib::PetscLibType, adapt::TSAdapt, low::PetscReal, high::PetscReal)

Sets the admissible decrease/increase factor in step size in the time step adapter

Logically collective

Input Parameters:

  • adapt - adaptive controller 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

See also: TSAdapt, TSAdaptChoose(), TSAdaptGetClip(), TSAdaptSetScaleSolveFailed()

External Links

source
PETSc.LibPETSc.TSAdaptSetFromOptions — Method
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 (basic|dsp|none|cfl|glee|history) - algorithm to use for adaptivity
  • -ts_adapt_always_accept (true|false) - always accept steps regardless of error/stability goals
  • -ts_adapt_safety safety - safety factor relative to target error/stability goal
  • -ts_adapt_reject_safety safety - extra safety factor to apply if the last step was rejected
  • -ts_adapt_clip low,high - admissible time step decrease and increase factors
  • -ts_adapt_dt_min min - minimum timestep to use
  • -ts_adapt_dt_max max - maximum timestep to use
  • -ts_adapt_scale_solve_failed scale - scale timestep by this factor if a solve fails
  • -ts_adapt_wnormtype (2|infinity) - type of norm for computing error estimates
  • -ts_adapt_time_step_increase_delay steps - number of timesteps to delay increasing the time step after it has been decreased due to failed solver

Level: advanced

See also: TSAdapt, TSGetAdapt(), TSAdaptSetType(), TSAdaptSetAlwaysAccept(), TSAdaptSetSafety(), TSAdaptSetClip(), TSAdaptSetScaleSolveFailed(), TSAdaptSetStepLimits(), TSAdaptSetMonitor()

External Links

source
PETSc.LibPETSc.TSAdaptSetMaxIgnore — Method
TSAdaptSetMaxIgnore(petsclib::PetscLibType, adapt::TSAdapt, max_ignore::PetscReal)

Set error estimation threshold. Solution components below this threshold value will not be considered when computing error norms for time step adaptivity (in absolute value). A negative value (default) of the threshold leads to considering all solution components.

Logically Collective

Input Parameters:

  • adapt - adaptive controller 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

See also: TSAdapt, TSAdaptGetMaxIgnore(), TSAdaptChoose()

External Links

source
PETSc.LibPETSc.TSAdaptSetMonitor — Method
TSAdaptSetMonitor(petsclib::PetscLibType, adapt::TSAdapt, flg::PetscBool)

Monitor the choices made by the adaptive controller

Collective

Input Parameters:

  • adapt - adaptive controller context
  • flg - PETSC_TRUE to active a monitor, PETSC_FALSE to disable

Options Database Key:

  • -ts_adapt_monitor - to turn on monitoring

Level: intermediate

See also: TSAdapt, TSGetAdapt(), TSAdaptChoose()

External Links

source
PETSc.LibPETSc.TSAdaptSetOptionsPrefix — Method
TSAdaptSetOptionsPrefix(petsclib::PetscLibType, adapt::TSAdapt, prefix::String)

Sets the prefix used for searching for TSAdapt options in the options database

Logically Collective

Input Parameters:

  • adapt - the TSAdapt context, most likely obtained with TSGetAdapt()
  • prefix - the prefix to prepend to all option names

Level: advanced

See also: TSAdapt, TSGetAdapt(), TSSetOptionsPrefix()

External Links

source
PETSc.LibPETSc.TSAdaptSetSafety — Method
TSAdaptSetSafety(petsclib::PetscLibType, adapt::TSAdapt, safety::PetscReal, reject_safety::PetscReal)

Set safety factors for time step adaptor

Logically Collective

Input Parameters:

  • adapt - adaptive controller 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

See also: TSAdapt, TSAdaptGetSafety(), TSAdaptChoose()

External Links

source
PETSc.LibPETSc.TSAdaptSetScaleSolveFailed — Method
TSAdaptSetScaleSolveFailed(petsclib::PetscLibType, adapt::TSAdapt, scale::PetscReal)

Scale step size by this factor if solve fails

Logically Collective

Input Parameters:

  • adapt - adaptive controller context
  • scale - scale

Options Database Key:

  • -ts_adapt_scale_solve_failed scale - to set scale step by this factor if solve fails

Level: intermediate

See also: TSAdapt, TSAdaptChoose(), TSAdaptGetScaleSolveFailed(), TSAdaptGetClip()

External Links

source
PETSc.LibPETSc.TSAdaptSetStepLimits — Method
TSAdaptSetStepLimits(petsclib::PetscLibType, adapt::TSAdapt, hmin::PetscReal, hmax::PetscReal)

Set the minimum and maximum step sizes to be considered by the time step controller

Logically Collective

Input Parameters:

  • adapt - time step adaptivity context, usually gotten 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

See also: TSAdapt, TSAdaptGetStepLimits(), TSAdaptChoose()

External Links

source
PETSc.LibPETSc.TSAdaptSetTimeStepIncreaseDelay — Method
TSAdaptSetTimeStepIncreaseDelay(petsclib::PetscLibType, adapt::TSAdapt, cnt::PetscInt)

The number of timesteps to wait after a decrease in the timestep due to failed solver before increasing the time step.

Logicially Collective

Input Parameters:

  • adapt - adaptive controller 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

See also: TSAdapt

External Links

source
PETSc.LibPETSc.TSAdaptSetType — Method
TSAdaptSetType(petsclib::PetscLibType, adapt::TSAdapt, type::String)

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|dsp|none|cfl|glee|history) - to set the adapter type

Level: intermediate

See also: TSGetAdapt(), TSAdaptDestroy(), TSAdaptType, TSAdaptGetType()

External Links

source
PETSc.LibPETSc.TSAdaptView — Method
TSAdaptView(petsclib::PetscLibType, adapt::TSAdapt, viewer::PetscViewer)

Prints the TSAdapt data structure.

Collective

Input Parameters:

  • adapt - the TSAdapt context obtained from TSGetAdapt()
  • viewer - visualization context

Options Database Key:

  • -ts_view - calls TSView() at end of TSStep()

Level: advanced

See also: TSAdapt, TSView(), PetscViewer, PetscViewerASCIIOpen()

External Links

source
PETSc.LibPETSc.TSGLLEAdaptChoose — Method
next_sc::PetscInt,next_h::PetscReal,finish::PetscBool = TSGLLEAdaptChoose(petsclib::PetscLibType, adapt::TSGLLEAdapt, n::PetscInt, orders::Vector{PetscInt}, errors::Vector{PetscReal}, cost::Vector{PetscReal}, cur::PetscInt, h::PetscReal, tleft::PetscReal)

Choose the next scheme and step size using a TSGLLEAdapt step-size and order controller

Logically Collective

Input Parameters:

  • adapt - the TSGLLEAdapt context
  • n - the number of candidate schemes
  • orders - the orders of accuracy of the candidate schemes
  • errors - the error estimates for each candidate scheme
  • cost - the relative cost of each candidate scheme
  • cur - the index of the currently active scheme
  • h - the last step size that was taken
  • tleft - the amount of remaining integration time

Output Parameters:

  • next_sc - the index of the scheme to use next
  • next_h - the step size to take next
  • finish - PETSC_TRUE if next_h was truncated to tleft because the end of the interval has been reached

Level: developer

See also: TSGLLE, TSGLLEAdapt, TSGLLEAdaptCreate(), TSGLLEAdaptSetType()

External Links

source
PETSc.LibPETSc.TSGLLEAdaptCreate — Method
inadapt::TSGLLEAdapt = TSGLLEAdaptCreate(petsclib::PetscLibType, comm::MPI_Comm)

Create a TSGLLEAdapt step-size and order adaptivity object

Collective

Input Parameter:

  • comm - the MPI communicator

Output Parameter:

  • inadapt - the newly created TSGLLEAdapt context

Level: intermediate

See also: TSGLLE, TSGLLEAdapt, TSGLLEAdaptSetType(), TSGLLEAdaptDestroy()

External Links

source
PETSc.LibPETSc.TSGLLEAdaptDestroy — Method
TSGLLEAdaptDestroy(petsclib::PetscLibType, adapt::Union{TSGLLEAdapt, Ref{TSGLLEAdapt}})

Destroys a TSGLLEAdapt context

Collective

Input Parameter:

  • adapt - the TSGLLEAdapt context

Level: intermediate

See also: TSGLLE, TSGLLEAdapt, TSGLLEAdaptCreate()

External Links

source
PETSc.LibPETSc.TSGLLEAdaptRegister — Method
TSGLLEAdaptRegister(petsclib::PetscLibType, sname::String, fnc::external)

adds a TSGLLEAdapt implementation

Not Collective, No Fortran Support

Input Parameters:

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

Level: advanced

See also: TSGLLE, TSGLLEAdapt, TSGLLEAdaptRegisterAll()

External Links

source
PETSc.LibPETSc.TSGLLEAdaptSetFromOptions — Method
TSGLLEAdaptSetFromOptions(petsclib::PetscLibType, adapt::TSGLLEAdapt, PetscOptionsObject::PetscOptionItems)

Sets options from the options database for a TSGLLEAdapt context

Collective

Input Parameters:

  • adapt - the TSGLLEAdapt context
  • PetscOptionsObject - the PetscOptionItems used to process options

Options Database Key:

  • -ts_adapt_type (none|size|both) - algorithm to use for adaptivity

Level: advanced

See also: TSGLLE, TSGLLEAdapt, TSGLLEAdaptSetType()

External Links

source
PETSc.LibPETSc.TSGLLEAdaptSetOptionsPrefix — Method
TSGLLEAdaptSetOptionsPrefix(petsclib::PetscLibType, adapt::TSGLLEAdapt, prefix::String)

Sets the prefix used for searching for TSGLLEAdapt options in the options database

Logically Collective

Input Parameters:

  • adapt - the TSGLLEAdapt context
  • prefix - the prefix to prepend to all option names

Level: advanced

See also: TSGLLE, TSGLLEAdapt, TSGLLEAdaptSetFromOptions()

External Links

source
PETSc.LibPETSc.TSGLLEAdaptSetType — Method
TSGLLEAdaptSetType(petsclib::PetscLibType, adapt::TSGLLEAdapt, type::String)

Sets the type of a TSGLLEAdapt step-size and order adaptivity object

Logically Collective

Input Parameters:

  • adapt - the TSGLLEAdapt context
  • type - the name of the adaptivity scheme, e.g. TSGLLEADAPT_NONE, TSGLLEADAPT_SIZE, TSGLLEADAPT_BOTH

Level: intermediate

See also: TSGLLE, TSGLLEAdapt, TSGLLEAdaptCreate(), TSGLLEAdaptType, TSGLLEAdaptRegister()

External Links

source
PETSc.LibPETSc.TSGLLEAdaptView — Method
TSGLLEAdaptView(petsclib::PetscLibType, adapt::TSGLLEAdapt, viewer::PetscViewer)

Views a TSGLLEAdapt step-size and order adaptivity object

Collective

Input Parameters:

  • adapt - the TSGLLEAdapt context
  • viewer - the PetscViewer used to view the object

Level: intermediate

See also: TSGLLE, TSGLLEAdapt, TSGLLEAdaptCreate(), PetscViewer

External Links

source
PETSc.LibPETSc.TSMonitorDrawCtxCreate — Method
ctx::TSMonitorDrawCtx = TSMonitorDrawCtxCreate(petsclib::PetscLibType, comm::MPI_Comm, host::String, label::String, x::Cint, y::Cint, m::Cint, n::Cint, howoften::PetscInt)

Creates the monitor context for TSMonitorDrawCtx

Collective

Input Parameters:

  • comm - the MPI communicator to 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

See also: TS, TSMonitorDrawCtxDestroy(), TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorDrawCtx, PetscMonitorDrawSolution()

External Links

source
PETSc.LibPETSc.TSMonitorDrawCtxDestroy — Method
TSMonitorDrawCtxDestroy(petsclib::PetscLibType, ictx::Union{TSMonitorDrawCtx, Ref{TSMonitorDrawCtx}})

Destroys the monitor context for TSMonitorDrawSolution()

Collective

Input Parameter:

  • ictx - the monitor context

Level: intermediate

See also: TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorDrawSolution(), TSMonitorDrawError(), TSMonitorDrawCtx

External Links

source
PETSc.LibPETSc.TSMonitorEnvelopeCtxCreate — Method
ctx::TSMonitorEnvelopeCtx = TSMonitorEnvelopeCtxCreate(petsclib::PetscLibType, ts::AbstractTS)

Creates a context for use with TSMonitorEnvelope()

Collective

Input Parameter:

  • ts - the TS solver object

Output Parameter:

  • ctx - the context

Level: intermediate

See also: TS, TSMonitorLGTimeStep(), TSMonitorSet(), TSMonitorLGSolution(), TSMonitorLGError()

External Links

source
PETSc.LibPETSc.TSMonitorEnvelopeCtxDestroy — Method
TSMonitorEnvelopeCtxDestroy(petsclib::PetscLibType, ctx::Union{TSMonitorEnvelopeCtx, Ref{TSMonitorEnvelopeCtx}})

Destroys a context that was created with TSMonitorEnvelopeCtxCreate().

Collective

Input Parameter:

  • ctx - the monitor context

Level: intermediate

See also: TS, TSMonitorLGCtxCreate(), TSMonitorSet(), TSMonitorLGTimeStep()

External Links

source
PETSc.LibPETSc.TSMonitorHGCtxCreate — Method
ctx::TSMonitorHGCtx = TSMonitorHGCtxCreate(petsclib::PetscLibType, comm::MPI_Comm, host::String, label::String, x::Cint, y::Cint, m::Cint, n::Cint, howoften::PetscInt, Ns::PetscInt, Nb::PetscInt, velocity::PetscBool)

Creates a TSMonitorHGCtx histogram monitor context for use with DMSWARM particle visualizations

Collective

Input Parameters:

  • comm - the MPI communicator to 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
  • Ns - the number of species to histogram
  • Nb - the number of histogram bins
  • velocity - PETSC_TRUE to plot histograms in velocity space, PETSC_FALSE for coordinate space

Output Parameter:

  • ctx - the newly created histogram monitor context

Level: intermediate

See also: TS, DMSWARM, TSMonitorSet(), TSMonitorHGSwarmSolution(), TSMonitorHGCtxDestroy()

External Links

source
PETSc.LibPETSc.TSMonitorHGCtxDestroy — Method
TSMonitorHGCtxDestroy(petsclib::PetscLibType, ctx::Union{TSMonitorHGCtx, Ref{TSMonitorHGCtx}})

Destroys a TSMonitorHGCtx that was created with TSMonitorHGCtxCreate()

Not Collective

Input Parameter:

  • ctx - the histogram monitor context

Level: intermediate

See also: TS, TSMonitorSet(), TSMonitorHGCtxCreate(), TSMonitorHGSwarmSolution()

External Links

source
PETSc.LibPETSc.TSMonitorLGCtxCreate — Method
ctx::TSMonitorLGCtx = TSMonitorLGCtxCreate(petsclib::PetscLibType, comm::MPI_Comm, host::String, label::String, x::Cint, y::Cint, m::Cint, n::Cint, howoften::PetscInt)

Creates a TSMonitorLGCtx context for use with TS to monitor the solution process graphically in various ways

Collective

Input Parameters:

  • comm - the MPI communicator to 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

See also: 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.TSMonitorLGCtxDestroy — Method
TSMonitorLGCtxDestroy(petsclib::PetscLibType, ctx::Union{TSMonitorLGCtx, Ref{TSMonitorLGCtx}})

Destroys a line graph context that was created with TSMonitorLGCtxCreate().

Collective

Input Parameter:

  • ctx - the monitor context

Level: intermediate

See also: TS, TSMonitorLGCtxCreate(), TSMonitorSet(), TSMonitorLGTimeStep()

External Links

source
PETSc.LibPETSc.TSMonitorLGCtxNetworkCreate — Method
ctx::TSMonitorLGCtxNetwork = TSMonitorLGCtxNetworkCreate(petsclib::PetscLibType, ts::AbstractTS, host::String, label::String, x::Cint, y::Cint, m::Cint, n::Cint, howoften::PetscInt)

Creates a TSMonitorLGCtxNetwork context with one line-graph window for each edge and each vertex of a DMNETWORK

Collective

Input Parameters:

  • ts - the TS context whose DM is a DMNETWORK
  • 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 newly created network line-graph monitor context

Level: intermediate

See also: TS, DMNETWORK, TSMonitorSet(), TSMonitorLGCtxNetworkSolution(), TSMonitorLGCtxNetworkDestroy()

External Links

source
PETSc.LibPETSc.TSMonitorLGCtxNetworkDestroy — Method
TSMonitorLGCtxNetworkDestroy(petsclib::PetscLibType, ctx::Union{TSMonitorLGCtxNetwork, Ref{TSMonitorLGCtxNetwork}})

Destroys line graph contexts that where created with TSMonitorLGCtxNetworkCreate().

Collective

Input Parameter:

  • ctx - the monitor context

Level: intermediate

See also: TS, TSMonitorLGCtxNetworkSolution()

External Links

source
PETSc.LibPETSc.TSMonitorLGCtxNetworkSolution — Method
TSMonitorLGCtxNetworkSolution(petsclib::PetscLibType, ts::AbstractTS, step::PetscInt, ptime::PetscReal, u::AbstractPetscVec, dctx::Ptr{Cvoid})

Monitors progress of the TS solvers for a DMNETWORK solution with one window for each vertex and each edge

Collective

Input Parameters:

  • ts - 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

See also: TS, TSMonitorLGCtxNetworkDestroy()

External Links

source
PETSc.LibPETSc.TSMonitorLGCtxSetDisplayVariables — Method
TSMonitorLGCtxSetDisplayVariables(petsclib::PetscLibType, ctx::TSMonitorLGCtx, displaynames::Cchar)

Sets the variables that are to be display in the monitor

Collective

Input Parameters:

  • ctx - the TSMonitorLG context
  • displaynames - the names of the components, final string must be NULL

Level: intermediate

See also: TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorLGSetVariableNames()

External Links

source
PETSc.LibPETSc.TSMonitorLGCtxSetTransform — Method
TSMonitorLGCtxSetTransform(petsclib::PetscLibType, ctx::TSMonitorLGCtx, transform::external, destroy::Ptr{Cvoid}, tctx::Ptr{Cvoid})

Solution vector will be transformed by provided function before being displayed

Collective

Input Parameters:

  • tctx - 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

Calling sequence of transform:

  • tctx - context used by the transform function
  • u - the input solution vector
  • w - the output transformed vector

Level: intermediate

See also: TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorLGSetVariableNames(), TSMonitorLGSetTransform(), PetscCtxDestroyFn

External Links

source
PETSc.LibPETSc.TSMonitorLGCtxSetVariableNames — Method
TSMonitorLGCtxSetVariableNames(petsclib::PetscLibType, ctx::TSMonitorLGCtx, names::Cchar)

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

Collective

Input Parameters:

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

Level: intermediate

See also: TS, TSMonitorSet(), TSMonitorDefault(), VecView(), TSMonitorLGSetDisplayVariables(), TSMonitorLGSetVariableNames()

External Links

source
PETSc.LibPETSc.TSMonitorSPCtxCreate — Method
ctx::TSMonitorSPCtx = TSMonitorSPCtxCreate(petsclib::PetscLibType, comm::MPI_Comm, host::String, label::String, x::Cint, y::Cint, m::Cint, n::Cint, howoften::PetscInt, retain::PetscInt, phase::PetscBool, multispecies::PetscBool)

Creates a TSMonitorSPCtx scatter-plot monitor context for use with DMSWARM particle visualizations

Collective

Input Parameters:

  • comm - the MPI communicator to 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
  • retain - the number of old points to retain in the plot, or 0 to clear, or -1 to retain all
  • phase - PETSC_TRUE to plot in phase space rather than coordinate space
  • multispecies - PETSC_TRUE to color particles by species

Output Parameter:

  • ctx - the newly created scatter plot monitor context

Level: intermediate

See also: TS, DMSWARM, TSMonitorSet(), TSMonitorSPSwarmSolution(), TSMonitorSPCtxDestroy()

External Links

source
PETSc.LibPETSc.TSMonitorSPCtxDestroy — Method
TSMonitorSPCtxDestroy(petsclib::PetscLibType, ctx::Union{TSMonitorSPCtx, Ref{TSMonitorSPCtx}})

Destroys a TSMonitorSPCtx that was created with TSMonitorSPCtxCreate()

Not Collective

Input Parameter:

  • ctx - the scatter plot monitor context

Level: intermediate

See also: TS, TSMonitorSet(), TSMonitorSPCtxCreate(), TSMonitorSPSwarmSolution()

External Links

source
PETSc.LibPETSc.TSMonitorSPEigCtxCreate — Method
ctx::TSMonitorSPEigCtx = TSMonitorSPEigCtxCreate(petsclib::PetscLibType, comm::MPI_Comm, host::String, label::String, x::Cint, y::Cint, m::Cint, n::Cint, howoften::PetscInt)

Creates a context for use with TS to monitor the eigenvalues of the linearized operator

Collective

Input Parameters:

  • comm - the communicator to share the 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

See also: TSMonitorSPEigTimeStep(), TSMonitorSet(), TSMonitorLGSolution(), TSMonitorLGError()

External Links

source
PETSc.LibPETSc.TSMonitorSPEigCtxDestroy — Method
TSMonitorSPEigCtxDestroy(petsclib::PetscLibType, ctx::Union{TSMonitorSPEigCtx, Ref{TSMonitorSPEigCtx}})

Destroys a scatter plot context that was created with TSMonitorSPEigCtxCreate().

Collective

Input Parameter:

  • ctx - the monitor context

Level: intermediate

See also: TSMonitorSPEigCtxCreate(), TSMonitorSet(), TSMonitorSPEig()

External Links

source
PETSc.LibPETSc.TSTrajectoryCreate — Method
tj::TSTrajectory = TSTrajectoryCreate(petsclib::PetscLibType, comm::MPI_Comm)

This function creates an empty trajectory object used to store the time dependent solution of an ODE/DAE

Collective

Input Parameter:

  • comm - the communicator

Output Parameter:

  • tj - the trajectory object

Level: developer

See also: TS, TSTrajectory, TSTrajectorySetUp(), TSTrajectoryDestroy(), TSTrajectorySetType(), TSTrajectorySetVariableNames(), TSGetTrajectory(), TSTrajectorySetKeepFiles()

External Links

source
PETSc.LibPETSc.TSTrajectoryDestroy — Method
TSTrajectoryDestroy(petsclib::PetscLibType, tj::Union{TSTrajectory, Ref{TSTrajectory}})

Destroys a trajectory context

Collective

Input Parameter:

  • tj - the TSTrajectory context obtained from TSTrajectoryCreate()

Level: developer

See also: TSTrajectory, TSTrajectoryCreate(), TSTrajectorySetUp()

External Links

source
PETSc.LibPETSc.TSTrajectoryGet — Method
time::PetscReal = TSTrajectoryGet(petsclib::PetscLibType, tj::TSTrajectory, ts::AbstractTS, stepnum::PetscInt)

Updates the solution vector of a time stepper object by querying the TSTrajectory

Collective

Input Parameters:

  • tj - the trajectory object
  • ts - the time stepper object
  • stepnum - the step number

Output Parameter:

  • time - the time associated with the step number

Level: developer

See also: TS, TSSolve(), TSTrajectorySetUp(), TSTrajectoryDestroy(), TSTrajectorySetType(), TSTrajectorySetVariableNames(), TSGetTrajectory(), TSTrajectorySet(), TSTrajectoryGetVecs(), TSGetSolution()

External Links

source
PETSc.LibPETSc.TSTrajectoryGetNumSteps — Method
steps::PetscInt = TSTrajectoryGetNumSteps(petsclib::PetscLibType, tj::TSTrajectory)

Return the number of steps registered in the TSTrajectory via TSTrajectorySet().

Not Collective.

Input Parameter:

  • tj - the trajectory object

Output Parameter:

  • steps - the number of steps

Level: developer

See also: TS, TSTrajectorySet()

External Links

source
PETSc.LibPETSc.TSTrajectoryGetSolutionOnly — Method
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

See also: TSTrajectory, TSSetSaveTrajectory(), TSTrajectoryCreate(), TSTrajectoryDestroy(), TSTrajectorySetSolutionOnly()

External Links

source
PETSc.LibPETSc.TSTrajectoryGetType — Method
type::String = TSTrajectoryGetType(petsclib::PetscLibType, tj::TSTrajectory, ts::AbstractTS)

Gets the trajectory type

Collective

Input Parameters:

  • tj - the TSTrajectory context
  • ts - the TS context

Output Parameter:

  • type - a known method

Level: developer

See also: TS, TSTrajectory, TSTrajectoryCreate(), TSTrajectorySetFromOptions(), TSTrajectoryDestroy(), TSTrajectorySetType()

External Links

source
PETSc.LibPETSc.TSTrajectoryGetUpdatedHistoryVecs — Method
U::PetscVec,Udot::PetscVec = TSTrajectoryGetUpdatedHistoryVecs(petsclib::PetscLibType, tj::TSTrajectory, ts::AbstractTS, time::PetscReal)

Get updated state and time-derivative history vectors.

Collective

Input Parameters:

  • tj - 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

See also: TSTrajectory, TSSetSaveTrajectory(), TSTrajectoryCreate(), TSTrajectoryDestroy(), TSTrajectoryRestoreUpdatedHistoryVecs(), TSTrajectoryGetVecs()

External Links

source
PETSc.LibPETSc.TSTrajectoryGetVecs — Method
time::PetscReal = TSTrajectoryGetVecs(petsclib::PetscLibType, tj::TSTrajectory, ts::AbstractTS, stepnum::PetscInt, U::AbstractPetscVec, Udot::AbstractPetscVec)

Reconstructs the vector of state and its time derivative using information from the TSTrajectory and, possibly, from the TS

Collective

Input Parameters:

  • tj - the trajectory 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

See also: TS, TSTrajectory, TSTrajectorySetUp(), TSTrajectoryDestroy(), TSTrajectorySetType(), TSTrajectorySetVariableNames(), TSGetTrajectory(), TSTrajectorySet(), TSTrajectoryGet()

External Links

source
PETSc.LibPETSc.TSTrajectoryMemorySetType — Method
TSTrajectoryMemorySetType(petsclib::PetscLibType, tj::TSTrajectory, tj_memory_type::TSTrajectoryMemoryType)

sets the software that is used to generate the checkpointing schedule.

Logically Collective

Input Parameters:

  • tj - the TSTrajectory context
  • tj_memory_type - Revolve or CAMS

Options Database Key:

  • -ts_trajectory_memory_type tj_memory_type - petsc, revolve, cams

Level: intermediate

See also: TSTrajectory, TSTrajectorySetMaxUnitsRAM(), TSTrajectoryMemoryType

External Links

source
PETSc.LibPETSc.TSTrajectoryRegister — Method
TSTrajectoryRegister(petsclib::PetscLibType, sname::String, fnc::external)

Adds a way of storing trajectories to the TS package

Not Collective, No Fortran Support

Input Parameters:

  • sname - the name of a new user-defined creation routine
  • function - the creation routine itself

Level: developer

See also: TSTrajectoryRegisterAll()

External Links

source
PETSc.LibPETSc.TSTrajectoryReset — Method
TSTrajectoryReset(petsclib::PetscLibType, tj::TSTrajectory)

Resets a trajectory context

Collective

Input Parameter:

  • tj - the TSTrajectory context obtained from TSGetTrajectory()

Level: developer

See also: TS, TSTrajectory, TSTrajectoryCreate(), TSTrajectorySetUp()

External Links

source
PETSc.LibPETSc.TSTrajectoryRestoreUpdatedHistoryVecs — Method
TSTrajectoryRestoreUpdatedHistoryVecs(petsclib::PetscLibType, tj::TSTrajectory, U::AbstractPetscVec, Udot::AbstractPetscVec)

Restores updated state and time-derivative history vectors obtained with TSTrajectoryGetUpdatedHistoryVecs().

Collective

Input Parameters:

  • tj - the TSTrajectory context
  • U - state vector at given time (can be interpolated)
  • Udot - time-derivative vector at given time (can be interpolated)

Level: developer

See also: TSTrajectory, TSTrajectoryGetUpdatedHistoryVecs()

External Links

source
PETSc.LibPETSc.TSTrajectorySet — Method
TSTrajectorySet(petsclib::PetscLibType, tj::TSTrajectory, ts::AbstractTS, stepnum::PetscInt, time::PetscReal, X::AbstractPetscVec)

Sets a vector of state in the trajectory object

Collective

Input Parameters:

  • tj - the trajectory object
  • ts - the time stepper object (optional)
  • stepnum - the step number
  • time - the current time
  • X - the current solution

Level: developer

See also: TSTrajectorySetUp(), TSTrajectoryDestroy(), TSTrajectorySetType(), TSTrajectorySetVariableNames(), TSGetTrajectory(), TSTrajectoryGet(), TSTrajectoryGetVecs()

External Links

source
PETSc.LibPETSc.TSTrajectorySetDirname — Method
TSTrajectorySetDirname(petsclib::PetscLibType, tj::TSTrajectory, dirname::String)

Specify the name of the directory where TSTrajectory disk checkpoints are stored.

Collective

Input Parameters:

  • tj - the TSTrajectory context
  • dirname - the directory name

Options Database Key:

  • -ts_trajectory_dirname - set the directory name

Level: developer

See also: TSTrajectory, TSTrajectorySetFiletemplate(), TSTrajectorySetUp()

External Links

source
PETSc.LibPETSc.TSTrajectorySetFiletemplate — Method
TSTrajectorySetFiletemplate(petsclib::PetscLibType, tj::TSTrajectory, filetemplate::String)

Specify the name template for the files storing TSTrajectory checkpoints.

Collective

Input Parameters:

  • tj - the TSTrajectory context
  • filetemplate - the template

Options Database Key:

  • -ts_trajectory_file_template - set the file name template

Level: developer

See also: TSTrajectory, TSTrajectorySetDirname(), TSTrajectorySetUp()

External Links

source
PETSc.LibPETSc.TSTrajectorySetFromOptions — Method
TSTrajectorySetFromOptions(petsclib::PetscLibType, tj::TSTrajectory, ts::AbstractTS)

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 (basic|singlefile|memory|visualization) - how to manage the trajectory
  • -ts_trajectory_keep_files (true|false) - keep the files generated by the code after the program ends. This is true by default for singlefile and visualization
  • -ts_trajectory_monitor - print TSTrajectory information

Level: developer

See also: TSTrajectory, TSSetSaveTrajectory(), TSTrajectorySetUp()

External Links

source
PETSc.LibPETSc.TSTrajectorySetKeepFiles — Method
TSTrajectorySetKeepFiles(petsclib::PetscLibType, tj::TSTrajectory, flg::PetscBool)

Keep the files generated by the TSTrajectory once the program is done

Collective

Input Parameters:

  • tj - 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

See also: TSTrajectoryCreate(), TSTrajectoryDestroy(), TSTrajectorySetUp(), TSTrajectorySetMonitor()

External Links

source
PETSc.LibPETSc.TSTrajectorySetMaxCpsDisk — Method
TSTrajectorySetMaxCpsDisk(petsclib::PetscLibType, tj::TSTrajectory, max_cps_disk::PetscInt)

Set maximum number of checkpoints on disk

Logically Collective

Input Parameter:

  • tj - tstrajectory context

Output Parameter:

  • max_cps_disk - maximum number of checkpoints on disk

Level: intermediate

See also: TSTrajectory, TSTrajectorySetMaxUnitsDisk(), TSTrajectorySetMaxUnitsRAM()

External Links

source
PETSc.LibPETSc.TSTrajectorySetMaxCpsRAM — Method
TSTrajectorySetMaxCpsRAM(petsclib::PetscLibType, tj::TSTrajectory, max_cps_ram::PetscInt)

Set maximum number of checkpoints in RAM

Logically Collective

Input Parameter:

  • tj - tstrajectory context

Output Parameter:

  • max_cps_ram - maximum number of checkpoints in RAM

Level: intermediate

See also: TSTrajectory, TSTrajectorySetMaxUnitsRAM()

External Links

source
PETSc.LibPETSc.TSTrajectorySetMaxUnitsDisk — Method
TSTrajectorySetMaxUnitsDisk(petsclib::PetscLibType, tj::TSTrajectory, max_units_disk::PetscInt)

Set maximum number of checkpointing units on disk

Logically Collective

Input Parameter:

  • tj - tstrajectory context

Output Parameter:

  • max_units_disk - maximum number of checkpointing units on disk

Level: intermediate

See also: TSTrajectory, TSTrajectorySetMaxCpsDisk()

External Links

source
PETSc.LibPETSc.TSTrajectorySetMaxUnitsRAM — Method
TSTrajectorySetMaxUnitsRAM(petsclib::PetscLibType, tj::TSTrajectory, max_units_ram::PetscInt)

Set maximum number of checkpointing units in RAM

Logically Collective

Input Parameter:

  • tj - tstrajectory context

Output Parameter:

  • max_units_ram - maximum number of checkpointing units in RAM

Level: intermediate

See also: TSTrajectory, TSTrajectorySetMaxCpsRAM()

External Links

source
PETSc.LibPETSc.TSTrajectorySetMonitor — Method
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

See also: TSTrajectory, TSTrajectoryCreate(), TSTrajectoryDestroy(), TSTrajectorySetUp()

External Links

source
PETSc.LibPETSc.TSTrajectorySetSolutionOnly — Method
TSTrajectorySetSolutionOnly(petsclib::PetscLibType, tj::TSTrajectory, solution_only::PetscBool)

Tells the trajectory to store just the solution, and not any intermediate stage information

Collective

Input Parameters:

  • tj - the TSTrajectory context obtained with TSGetTrajectory()
  • solution_only - the boolean flag

Level: developer

See also: TSTrajectory, TSSetSaveTrajectory(), TSTrajectoryCreate(), TSTrajectoryDestroy(), TSTrajectoryGetSolutionOnly()

External Links

source
PETSc.LibPETSc.TSTrajectorySetTransform — Method
TSTrajectorySetTransform(petsclib::PetscLibType, tj::TSTrajectory, transform::external, destroy::Ptr{Cvoid}, tctx::Ptr{Cvoid})

Solution vector will be transformed by provided function before being saved to disk

Collective

Input Parameters:

  • tj - the TSTrajectory context
  • transform - the transform function
  • destroy - function to destroy the optional context
  • tctx - optional context used by transform function

Level: intermediate

See also: TSTrajectorySetVariableNames(), TSTrajectory, TSMonitorLGSetTransform()

External Links

source
PETSc.LibPETSc.TSTrajectorySetType — Method
TSTrajectorySetType(petsclib::PetscLibType, tj::TSTrajectory, ts::AbstractTS, type::String)

Sets the storage method to be used as in a trajectory

Collective

Input Parameters:

  • tj - the TSTrajectory context
  • ts - the TS context
  • type - a known method

Options Database Key:

  • -ts_trajectory_type (basic|singlefile|memory|visualization) - Sets the trajectory type

Level: developer

See also: TSTrajectory, TSTrajectoryType, TS, TSTrajectoryCreate(), TSTrajectorySetFromOptions(), TSTrajectoryDestroy(), TSTrajectoryGetType()

External Links

source
PETSc.LibPETSc.TSTrajectorySetUp — Method
TSTrajectorySetUp(petsclib::PetscLibType, tj::TSTrajectory, ts::AbstractTS)

Sets up the internal data structures, e.g. stacks, for the later use of a TS TSTrajectory.

Collective

Input Parameters:

  • tj - the TSTrajectory context
  • ts - the TS context obtained from TSCreate()

Level: developer

See also: TSTrajectory, TSSetSaveTrajectory(), TSTrajectoryCreate(), TSTrajectoryDestroy()

External Links

source
PETSc.LibPETSc.TSTrajectorySetUseHistory — Method
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

See also: TSTrajectory, TSTrajectoryCreate(), TSTrajectoryDestroy(), TSTrajectorySetUp()

External Links

source
PETSc.LibPETSc.TSTrajectorySetVariableNames — Method
TSTrajectorySetVariableNames(petsclib::PetscLibType, ctx::TSTrajectory, names::Cchar)

Sets the name of each component in the solution vector so that it may be saved with the trajectory

Collective

Input Parameters:

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

Level: intermediate

See also: TSTrajectory, TSGetTrajectory()

External Links

source
PETSc.LibPETSc.TSTrajectoryView — Method
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

See also: TS, TSTrajectory, PetscViewer, PetscViewerASCIIOpen()

External Links

source
PETSc.LibPETSc.TSTrajectoryViewFromOptions — Method
TSTrajectoryViewFromOptions(petsclib::PetscLibType, A::TSTrajectory, obj, name::String)

View a TSTrajectory based on values in the options database

Collective

Input Parameters:

  • A - the TSTrajectory context
  • obj - Optional object that provides prefix used for option name
  • name - command line option

Options Database Key:

  • -name [viewertype][:...] - option name and values. See PetscObjectViewFromOptions() for the possible arguments

Level: intermediate

See also: TSTrajectory, TSTrajectoryView, PetscObjectViewFromOptions(), TSTrajectoryCreate()

External Links

source

Hand-written overloads

Some LibPETSc.TS* methods are written by hand in src/ts.jl rather than generated. They take a raw @cfunction pointer where the generated binding expects PETSc's own function-wrapper type, or they return a value the generated binding takes as an argument and overwrites (e.g., TSGetSolution, TSGetSNES and TSGetKSP).

Their docstrings are written inside the PETSc module, so they are listed with the rest of src/ts.jl on the high-level TS page.