NSDETimeParallel.jl
This is the documentation of NSDETimeParallel.jl, a Julia package implementing time-parallel methods.
API
All exported types and functions are considered part of the public API, and thus documented in this manual.
NSDETimeParallel.AbstractPararealParameters
— TypeAn abstract type for parameters of Parareal
s.
NSDETimeParallel.AbstractTimeParallelCache
— TypeAn abstract type for caching intermediate computations in AbstractTimeParallelSolver
s.
NSDETimeParallel.AbstractTimeParallelIterate
— TypeAn abstract type for iterates in AbstractTimeParallelSolution
s.
NSDETimeParallel.AbstractTimeParallelParameters
— TypeAn abstract type for parameters in AbstractTimeParallelSolver
s.
NSDETimeParallel.AbstractTimeParallelSolution
— TypeAn abstract type for time-parallel solutions of NSDEBase.AbstractInitialValueProblem
s.
NSDETimeParallel.AbstractTimeParallelSolver
— TypeAn abstract type for time-parallel solvers of NSDEBase.AbstractInitialValueProblem
s.
NSDETimeParallel.AbstractTolerance
— TypeAn abstract type for tolerance parameters in AbstractTimeParallelSolver
s.
NSDETimeParallel.AbstractWeights
— TypeAn abstract type for proximity-function weights used by AbstractTimeParallelSolver
s.
NSDETimeParallel.Parareal
— TypeParareal <: AbstractTimeParallelSolver
A composite type for the Parareal algorithm.
Constructors
Parareal(finesolver, coarsesolver, parameters, tolerance)
Parareal(finesolver, coarsesolver; parameters=PararealParameters(), tolerance=Tolerance())
Arguments
finesolver :: AbstractInitialValueSolver
: fine solver (accurate but expensive).coarsesolver :: AbstractInitialValueSolver
: coarse solver (rough but quick).parameters :: AbstractPararealParameters
: parameters for the correction step.tolerance :: AbstractTolerance
: tolerance and error mechanism.
Methods
(parareal::Parareal)(solution::PararealSolution, problem::AbstractInitialValueProblem)
(parareal::Parareal)(problem::AbstractInitialValueProblem)
returns the solution
of a problem
using parareal
.
NSDETimeParallel.PararealIterate
— TypePararealIterate <: AbstractTimeParallelIterate
A composite type for a single iterate in a PararealSolution
.
Constructors
PararealIterate(chunks::AbstractVector{𝕊}) where 𝕊<:AbstractInitialValueSolution
PararealIterate(problem::AbstractInitialValueProblem, parareal::Parareal)
Functions
firstindex
: first index.getindex
: get chunk.lastindex
: last index.length
: number of chunks.numchunks
: number of chunks.setindex!
: set chunk.
Methods
(iterate::PararealIterate)(t::Real)
returns the value of iterate
at t
via interpolation.
NSDETimeParallel.PararealParameters
— TypePararealParameters <: AbstractPararealParameters
A composite type for the basic parameters of Parareal.
Constructors
PararealParameters(N, K)
PararealParameters(; N=10, K=N)
Arguments
N :: Integer
: number of time chunks/processors.K :: Integer
: maximum number of iterations.
NSDETimeParallel.PararealSolution
— TypePararealSolution <: AbstractTimeParallelSolution
A composite type for an AbstractTimeParallelSolution
obtained using Parareal
.
Constructors
PararealSolution(lastiterate, errors)
PararealSolution(problem::AbstractInitialValueProblem, parareal::Parareal)
Arguments
lastiterate :: PararealIterate
errors :: AbstractVector{ℝ} where ℝ<:Real
: iteration errors.
Functions
firstindex
: first index.getindex
: get iterate.lastindex
: last index.numiterates
: number of iterates.numchunks
: number of chunks of last iterate.setindex!
: set iterate.
Methods
(solution::PararealSolution)(t::Real)
returns the value of solution
at t
via interpolation.
NSDETimeParallel.Tolerance
— TypeTolerance <: AbstractTolerance
A composite type for the tolerance mechanism of an time-parallel solver.
Constructors
Tolerance(ϵ, ψ, weights)
Tolerance(; ϵ=1e-12, ψ=ψ₁, weights=Weights())
Arguments
ϵ :: Real
: tolerance.ψ :: Function
: error function.weights :: Weights
: weights for ψ.
NSDETimeParallel.Weights
— TypeWeights <: AbstractWeights
A composite type for the weights of Tolerance
.
Constructors
Weights(; w=1.0, updatew=false)
Arguments
w :: Union{AbstractVector{ℝ}, ℝ} where ℝ<:Real
: weighting factor for ψ.updatew :: Bool
: flags when toupdate!
w
using (an approximation of) the Lipschitz function of the fine solver.
Functions
update!
: updatesw
using (an approximation of) the Lipschitz function of the fine solver.
Base.firstindex
— Methodfirstindex(iterate::PararealIterate)
returns the first index of iterate
.
Base.firstindex
— Methodfirstindex(solution::PararealSolution)
returns the first index of solution
.
Base.getindex
— Methodgetindex(iterate::PararealIterate, n::Integer)
returns the n
-th chunk of iterate
.
Base.getindex
— Methodgetindex(solution::PararealSolution, n::Integer)
returns the n
-th chunk of the last iteration of a PararealSolution
.
Base.lastindex
— Methodlastindex(iterate::PararealIterate)
returns the last index of iterate
.
Base.lastindex
— Methodlastindex(solution::PararealSolution)
returns the last index of solution
.
Base.length
— Methodlength(iterate::PararealIterate)
returns the number of chunks of iterate
.
Base.length
— Methodlength(solution::PararealSolution)
returns the number of chunks of solution
.
Base.setindex!
— Methodsetindex!(iterate::PararealIterate, value::AbstractInitialValueSolution, n::Integer)
stores value
into the n
-th chunk of iterate
.
Base.setindex!
— Methodsetindex!(solution::PararealSolution, chunk::AbstractInitialValueSolution, n::Integer)
stores an AbstractInitialValueSolution
as the n
-th chunk of the last iteration of a PararealSolution
.
NSDEBase.solve!
— Methodsolve!(solution::AbstractTimeParallelSolution, problem, solver::AbstractTimeParallelSolver; kwargs...) :: AbstractTimeParallelSolution
computes the solution
of problem
using solver
.
NSDEBase.solve
— Methodsolve(problem, solver::AbstractTimeParallelSolver; kwargs...) :: AbstractTimeParallelSolution
computes the solution of problem
using solver
.
NSDETimeParallel.TimeParallelSolution
— MethodTimeParallelSolution(problem::AbstractInitialValueProblem, parareal::Parareal)
returns a PararealSolution
constructor for the solution of problem
with parareal
.
NSDETimeParallel.numchunks
— Methodnumchunks(iterate::PararealIterate)
returns the number of chunks of iterate
.
NSDETimeParallel.numchunks
— Methodnumchunks(solution::PararealSolution)
returns the number of chunks of solution
.
NSDETimeParallel.numiterates
— Methodnumiterates(solution::PararealSolution)
returns the number of iterates of solution
.
NSDETimeParallel.parareal_distributed!
— MethodDistributed implementation of Parareal.
NSDETimeParallel.parareal_mpi!
— MethodMPI implementation of Parareal.
NSDETimeParallel.update!
— Methodupdate!(weights::Weights, U<:AbstractVector{𝕍}, F<:AbstractVector{𝕍}) where 𝕍<:AbstractVector{ℂ} where ℂ<:Number
updates weights.w
based on U
and F
.
NSDETimeParallel.ψ₁
— Methodstandard error function.
NSDETimeParallel.ψ₂
— Methodweighted error function.