Advection
SemiLagrangian.hamsplit_3_11 — Methodhamsplit_3_11(dt)
hamsplit_3_11(dt, fltrace)
SemiLagrangian.magicsplit — Methodmagicsplit(dt)
SemiLagrangian.nosplit — Methodnosplit(dt)
SemiLagrangian.order6split — Methodorder6split(dt)
SemiLagrangian.standardsplit — Methodstandardsplit(dt)
SemiLagrangian.strangsplit — Methodstrangsplit(dt)
SemiLagrangian.table2split — Methodtable2split(dt)
SemiLagrangian.triplejumpsplit — Methodtriplejumpsplit(dt)
SemiLagrangian.Advection — Typestruct Advection{T, N, I, timeopt, timealg, ordalg}Advection{T}
Advection(
t_mesh::NTuple{N,UniformMesh{T}},
t_interp::Vector{I}
dt_base::T;
tab_coef = [1 // 1],
tab_fct = missing,
timeopt::TimeOptimization = NoTimeOpt,
) where {T, N, I <: AbstractInterpolation{T}}Immutable structure that contains constant parameters for multidimensional advection
Type parameters
T::DataType: type of dataN: number of dimensionsI: commun type of interpolationtimeopt::TimeOptimization: time optimization
Arguments
t_mesh::NTuple{N, UniformMesh{T}}: tuple of meshes (one for each dimension)t_interp::Vector{I}: tuple of interpolations (one for each dimension)dt_base::T: time delta for one advection series
Keywords
tab_coef=[1//2, 1//1, 1//2]: coefficient table for one advection series, the coefficients at odd indexes is for space advection series, the coefficients at even indexes is for velocity advection seriestab_fct=[identity, identity, identity]: function table for one advection series, with the same indexes than tab_coef
Implementation
sizeall: tuple of the sizes of all dimensions (space before velocity)t_mesh_sp: tuple of space meshest_mesh_v: tuple of velocity meshest_interp_sp: tuple of space interpolation typest_interp_v: tuple of velocity interpolation typesdt_base::T: time unit of an advection seriestab_coef: coefficient tablev_square: precompute for kenbsplit: number of slices for splitmpiid: MPI id
Throws
ArgumentError:Nspmust be less or equal toNv.
SemiLagrangian.AdvectionData — Typemutable struct AdvectionData{T, N, timeopt, timealg}AdvectionData{T,N,timeopt}
AdvectionData(
adv::Advection{T,N,timeopt},
data::Array{T,N},
parext)Mutable structure that contains variable parameters of advection series
Type parameters
T::DataType: type of dataN: number of dimensionstimeopt::TimeOptimization: time optimization
Arguments
adv::Advection{T,N}: link to the constant data of this advectiondata::Array{T,Nsum}: Initial data of this advectionparext: external data of this advection to compute alpha of each interpolations
Implementation
adv::Advection{T,N,timeopt}: link to the constant data of this advectionstate_coef::Int: state that is the index oftab_coef, it is from one to lenth(tab_coef)state_dim::Int: the dimension index, from 1 to Nsp in space states, from one to Nv in velocity statedata::Array{T,Nsum}: it is the working bufferbufdata::Vector{T}: vector of the same size of the working bufferfmrtabdata::NTuple{Nsum,Array{T,Nsum}}: tuple of array with the same size than data but with permutated dimensionst_buf::NTuple{Nsum, Array{T,2}}: tuple of buffer that is used to get the linear data for interpolation, one buffer per threadcache_alpha::Union{T,Nothing}: cache for precal, the precal is compute only when the alpha or decint values changecache_decint::Int64: for precal cachecache_precal::Vector{T}: for precal cacheparext::ExtDataAdv: external data of this advection to compute alpha of each interpolations
Methods to define
initcoef!(parext::AbstractExtDataAdv, self::Advection1dData): this method called at the beginning of each advection to initialize parext data. Theself.parextmutable structure is the only data that initcoef! can modify otherwise it leads to unpredictable behaviour.getalpha(parext::AbstractExtDataAdv, self::Advection1dData, ind): return the alpha number that is used for interpolation.getperm(parext::AbstractExtDataAdv, advd::Advection1dData): get the permutation of the dimension as a function of the current state, the dimension where advection occurs must be first, the dimensions used to compute alpha must be at the end.
adv::Advectionstate_gen::Int64time_cur::Anydata::Arraybufdata::Arrayfmrtabdata::Array{Array{T, N}, 1} where {T, N}t_buf::Array{Array{T}, 1} where Tt_itr::Anytt_split::Anyt_cache::Array{Array{SemiLagrangian.CachePrecal{T}, 1}, 1} where Tparext::SemiLagrangian.AbstractExtDataAdvbufcur::Union{Missing, Array{OpTuple{N, T}, N}} where {T, N}t_bufc::Array{Array{OpTuple{N, T}, N}, 1} where {T, N}initdatas::Union{Missing, Array{Array{T, N}, 1}} where {T, N}
SemiLagrangian.StateAdv — Typestruct StateAdv{N}ind::Int64perm::Vector{Int64}invp::Vector{Int64}ndims::Int64stcoef::Int64isconstdec::Bool
SemiLagrangian.advection! — Methodadvection!(self)
Advection function of a multidimensional function f discretized on mesh
Argument
self::AdvectionData: mutable structure of variables data
Return value
true: means that the advection series must continuefalse: means that the advection series is ended.
SemiLagrangian.copydata! — Methodcopydata!(advd, f)
SemiLagrangian.decbegin! — Methoddecbegin!(t_trv, t_cal, t_interp)
SemiLagrangian.getformdata — Methodgetformdata(advd)
SemiLagrangian.initcoef! — Methodinitcoef!(self)
SemiLagrangian.nextstate! — Methodnextstate!(self)
SemiLagrangian.retns — Methodretns(self, extdata)
Function called at the end of advection function to update internal state of AdvectionData structure
Argument
self::AdvectionData{T, N}: object to update
return value
ret::Bool:trueif the series must continuefalseat the end of the series.
SemiLagrangian.sizeall — Methodsizeall(adv)
Return a tuple of the sizes of each dimensions
Argument
adv::Advection: Advection structure.