diff --git a/src/bspline.jl b/src/bspline.jl index ba72694af931c2054f470a29c9ce6a5bd254a81d..3919fd54d332437a2c6b3404d004c79358246df6 100644 --- a/src/bspline.jl +++ b/src/bspline.jl @@ -384,7 +384,7 @@ function integrate(f::Function, idxs::AbstractVector{<:Integer}, bs::Bspline2) @toggled_assert length(idxs) == bs.Npts+1 sum = 0.0 @inbounds for i in bs.Npts+1 - fi, xl, xr = f[idxs[i]], bs.xs[i], bs.xs[i+3] + fi, xl, xr = f(idxs[i]), bs.xs[i], bs.xs[i+3] sum += fi * (xr-xl)/3 end return sum diff --git a/src/callbacks.jl b/src/callbacks.jl index f1c99d86b1238d3c36c1d344e4b2edaa5aae3db1..ae191044cd39ed79e7f4073aaea573f6c89a35dd 100644 --- a/src/callbacks.jl +++ b/src/callbacks.jl @@ -844,7 +844,6 @@ mutable struct ProgressCallback <: AbstractCallback prog_buffer = IOBuffer(; sizehint=2048) prog = Progress(100, # % dt=0.0, # always update - barglyphs=BarGlyphs('|','â–ˆ', ['â–' ,'â–‚' ,'â–ƒ' ,'â–„' ,'â–…' ,'â–†', 'â–‡'],' ','|',), showspeed=true, output=prog_buffer) # accumulate report here report_buffer = IOBuffer(; sizehint=2048) diff --git a/src/dgelement.jl b/src/dgelement.jl index e78129c0af170cd6da1a62171086a2f493defe3a..8c54066361e9c6cc1ddcd750c6b60cdca8aafe5a 100644 --- a/src/dgelement.jl +++ b/src/dgelement.jl @@ -68,7 +68,6 @@ struct DGElement invM = inv(M) end z = quadr_z - D = first_derivative_matrix(z) V = vandermonde_matrix_legendre(z) l_lhs = zeros(Float64, Npts) l_rhs = zeros(Float64, Npts) @@ -83,7 +82,6 @@ struct DGElement purge_zeros!(quadr_z) z = collect(range(-1.0,1.0,Npts)) purge_zeros!(z) - D = [ Bernstein.derivative_bernstein_polynomial(z[i], j, N) for i in 1:Npts, j in 1:Npts ] M = Bernstein.mass_matrix(Npts) S = Bernstein.stiffness_matrix(Npts) invM = inv(M) @@ -111,7 +109,6 @@ struct DGElement # We use a Gauss rule to avoid evaluating the Bspline on subcell interfaces and bdrys. quadr_z, quadr_w = LG.rule(3) # TODO Derivatives at bspline control points is ill-defined, because the splines are C^0 there - D = [ Bspline.derivative_polynomial(z[i], j, bs1) for i in 1:Npts, j in 1:Npts ] M = Bspline.mass_matrix(bs1) S = Bspline.stiffness_matrix(bs1) invM = inv(M) @@ -143,7 +140,6 @@ struct DGElement # for which a 4th order accurate LG rule should suffice. # We use a Gauss rule to avoid evaluating the Bspline on subcell interfaces and bdrys. quadr_z, quadr_w = LG.rule(3) - D = [ Bspline.derivative_polynomial(z[i], j, bs2) for i in 1:Npts, j in 1:Npts ] M = Bspline.mass_matrix(bs2) S = Bspline.stiffness_matrix(bs2) invM = inv(M) @@ -154,6 +150,11 @@ struct DGElement l_rhs[end] = 1.0 end + # differentiation is not defined for all dg kinds, e.g. modal_bspline1 + # we generally use the weak DG form, so its not needed for evolutions + # otherwise we should just use a Lagrange approximation + D = first_derivative_matrix(z) + # just set up something, its unused for the other kinds if kind !== :modal_bspline1 bs1 = Bspline.Bspline1(z)