Advection

SemiLagrangian.AdvectionType
struct 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 data
  • N : number of dimensions
  • I : commun type of interpolation
  • timeopt::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 series
  • tab_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 meshes
  • t_mesh_v : tuple of velocity meshes
  • t_interp_sp : tuple of space interpolation types
  • t_interp_v : tuple of velocity interpolation types
  • dt_base::T : time unit of an advection series
  • tab_coef : coefficient table
  • v_square : precompute for ke
  • nbsplit : number of slices for split
  • mpiid : MPI id

Throws

  • ArgumentError : Nsp must be less or equal to Nv.
source
SemiLagrangian.AdvectionDataType
mutable 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 data
  • N : number of dimensions
  • timeopt::TimeOptimization : time optimization

Arguments

  • adv::Advection{T,N} : link to the constant data of this advection
  • data::Array{T,Nsum} : Initial data of this advection
  • parext : external data of this advection to compute alpha of each interpolations

Implementation

  • adv::Advection{T,N,timeopt} : link to the constant data of this advection
  • state_coef::Int : state that is the index of tab_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 state
  • data::Array{T,Nsum} : it is the working buffer
  • bufdata::Vector{T} : vector of the same size of the working buffer
  • fmrtabdata::NTuple{Nsum,Array{T,Nsum}} : tuple of array with the same size than data but with permutated dimensions
  • t_buf::NTuple{Nsum, Array{T,2}} : tuple of buffer that is used to get the linear data for interpolation, one buffer per thread
  • cache_alpha::Union{T,Nothing} : cache for precal, the precal is compute only when the alpha or decint values change
  • cache_decint::Int64 : for precal cache
  • cache_precal::Vector{T} : for precal cache
  • parext::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. The self.parext mutable 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::Advection

  • state_gen::Int64

  • time_cur::Any

  • data::Array

  • bufdata::Array

  • fmrtabdata::Array{Array{T, N}, 1} where {T, N}

  • t_buf::Array{Array{T}, 1} where T

  • t_itr::Any

  • tt_split::Any

  • t_cache::Array{Array{SemiLagrangian.CachePrecal{T}, 1}, 1} where T

  • parext::SemiLagrangian.AbstractExtDataAdv

  • bufcur::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}

source
SemiLagrangian.StateAdvType
struct StateAdv{N}
  • ind::Int64

  • perm::Vector{Int64}

  • invp::Vector{Int64}

  • ndims::Int64

  • stcoef::Int64

  • isconstdec::Bool

source
SemiLagrangian.advection!Method
advection!(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 continue
  • false : means that the advection series is ended.
source
SemiLagrangian.retnsMethod
retns(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 : true if the series must continue false at the end of the series.
source
SemiLagrangian.sizeallMethod
sizeall(adv)

Return a tuple of the sizes of each dimensions

Argument

  • adv::Advection : Advection structure.
source