Skip to content
Snippets Groups Projects
Verified Commit 9b78e5aa authored by Florian Atteneder's avatar Florian Atteneder
Browse files

TCI structs should setup their own Vandermonde

parent eaf9ef7b
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,6 @@ function compute_indicator!(
tci::Minmod)
@unpack mesh = tci
@unpack D = mesh.element
@unpack invdetJ = get_static_variables(mesh.cache)
Npts, K = layout(mesh)
......
......@@ -2,7 +2,8 @@ Base.@kwdef struct ModalDecayAverage{T_Mesh<:Mesh1d} <: AbstractTCI
mesh::T_Mesh
threshold_min::Float64
threshold_max::Float64
# buffers
# helpers/buffers
invV::Matrix{Float64}
uh::Vector{Float64}
uh_perfect::Vector{Float64}
uh_mod::Vector{Float64}
......@@ -29,7 +30,10 @@ function ModalDecayAverage(mesh, threshold_min, threshold_max)
lsq_x = @. - log(rng_N)
lsq_y = deepcopy(lsq_x)
return ModalDecayAverage(mesh, threshold_min, threshold_max,
V = dg1d.vandermonde_matrix_legendre(mesh.element.z)
invV = inv(V)
return ModalDecayAverage(mesh, threshold_min, threshold_max, invV,
uh, uh_perfect, uh_mod, lsq_x, lsq_y)
end
......@@ -39,9 +43,8 @@ function compute_indicator!(
u, # inputs
tci::ModalDecayAverage)
@unpack mesh, threshold_min, threshold_max, uh,
@unpack mesh, threshold_min, threshold_max, uh, invV,
uh_mod, uh_perfect, lsq_x, lsq_y = tci
@unpack D, invV = mesh.element
L = layout(mesh)
Npts, K = L
......
......@@ -2,7 +2,9 @@ Base.@kwdef struct ModalDecayHighest{T_Mesh<:Mesh1d} <: AbstractTCI
mesh::T_Mesh
threshold_min::Float64
threshold_max::Float64
# buffers
# helpers/buffers
V::Matrix{Float64}
invV::Matrix{Float64}
uh_mod::Vector{Float64}
uh_mod_high::Vector{Float64}
end
......@@ -14,7 +16,9 @@ function ModalDecayHighest(mesh, threshold_min, threshold_max)
# storage for modal coefficients
uh_mod = zeros(Float64, Npts)
uh_mod_high = zeros(Float64, Npts)
return ModalDecayHighest(mesh, threshold_min, threshold_max, uh_mod, uh_mod_high)
V = dg1d.vandermonde_matrix_legendre(mesh.element.z)
invV = inv(V)
return ModalDecayHighest(mesh, threshold_min, threshold_max, invV, uh_mod, uh_mod_high)
end
......@@ -26,7 +30,6 @@ function compute_indicator!(
@unpack mesh, threshold_min, threshold_max,
uh_mod, uh_mod_high = tci
@unpack element = mesh
@unpack D, invV, V = mesh.element
@unpack invdetJ = get_static_variables(mesh.cache)
L = layout(mesh)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment