An optimized Julia implementation of the WENO reconstruction algorithm of any order. Based on the work of Dumbser, Hidalgo, and Zanotti in High Order Space-Time Adaptive WENO Finite Volume Schemes for Non-Conservative Hyperbolic Systems (DOI 10.1016/j.cma.2013.09.022).
Your input data must take the form of an array
u with shape
nvar is the number of variables contained in each cell and
nx,ny,nz are the number of cells in the x,y,z-axes, respectively.
If your grid is 1D or 2D, set
nz=1, as necessary.
N+1 is the desired order of accuracy.
The coefficients of the WENO reconstruction are obtained by calling:
This call will construct the WENO coefficient matrices
M1,M2,M3,M4 and the oscillation indicator matrix
Σ each time.
If many WENO reconstructions are required, it will be more computationally efficient to precalculate these entities:
julia> M1,M2,M3,M4 = coefficient_matrices(N); julia> Σ = oscillation_indicator(N); julia> chΣT = chol(Σ)'; julia> weno(u,N,M1,M2,M3,M4,chΣT);
test/test.jl contains an example,