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 Parareals.
NSDETimeParallel.AbstractTimeParallelCache — TypeAn abstract type for caching intermediate computations in AbstractTimeParallelSolvers.
NSDETimeParallel.AbstractTimeParallelIterate — TypeAn abstract type for iterates in AbstractTimeParallelSolutions.
NSDETimeParallel.AbstractTimeParallelParameters — TypeAn abstract type for parameters in AbstractTimeParallelSolvers.
NSDETimeParallel.AbstractTimeParallelSolution — TypeAn abstract type for time-parallel solutions of NSDEBase.AbstractInitialValueProblems.
NSDETimeParallel.AbstractTimeParallelSolver — TypeAn abstract type for time-parallel solvers of NSDEBase.AbstractInitialValueProblems.
NSDETimeParallel.AbstractTolerance — TypeAn abstract type for tolerance parameters in AbstractTimeParallelSolvers.
NSDETimeParallel.AbstractWeights — TypeAn abstract type for proximity-function weights used by AbstractTimeParallelSolvers.
NSDETimeParallel.Parareal — TypeParareal <: AbstractTimeParallelSolverA 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 <: AbstractTimeParallelIterateA 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 <: AbstractPararealParametersA 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 <: AbstractTimeParallelSolutionA 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 <: AbstractToleranceA 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 <: AbstractWeightsA 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 to- update!- wusing (an approximation of) the Lipschitz function of the fine solver.
Functions
- update!: updates- wusing (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...) :: AbstractTimeParallelSolutioncomputes the solution of problem using solver.
NSDEBase.solve — Methodsolve(problem, solver::AbstractTimeParallelSolver; kwargs...) :: AbstractTimeParallelSolutioncomputes 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 ℂ<:Numberupdates weights.w based on U and F.
NSDETimeParallel.ψ₁ — Methodstandard error function.
NSDETimeParallel.ψ₂ — Methodweighted error function.