Skip to content
Snippets Groups Projects
Commit 5c427347 authored by Florian Atteneder's avatar Florian Atteneder
Browse files

TCI: tci's should setup their own vandermonde matrices...

TCI: tci's should setup their own vandermonde matrices (!217)
parent 6c126e8f
No related branches found
No related tags found
1 merge request!217TCI: tci's should setup their own vandermonde matrices
Pipeline #7222 passed
...@@ -11,7 +11,6 @@ function compute_indicator!( ...@@ -11,7 +11,6 @@ function compute_indicator!(
tci::Minmod) tci::Minmod)
@unpack mesh = tci @unpack mesh = tci
@unpack D = mesh.element
@unpack invdetJ = get_static_variables(mesh.cache) @unpack invdetJ = get_static_variables(mesh.cache)
Npts, K = layout(mesh) Npts, K = layout(mesh)
......
...@@ -2,7 +2,8 @@ Base.@kwdef struct ModalDecayAverage{T_Mesh<:Mesh1d} <: AbstractTCI ...@@ -2,7 +2,8 @@ Base.@kwdef struct ModalDecayAverage{T_Mesh<:Mesh1d} <: AbstractTCI
mesh::T_Mesh mesh::T_Mesh
threshold_min::Float64 threshold_min::Float64
threshold_max::Float64 threshold_max::Float64
# buffers # helpers/buffers
invV::Matrix{Float64}
uh::Vector{Float64} uh::Vector{Float64}
uh_perfect::Vector{Float64} uh_perfect::Vector{Float64}
uh_mod::Vector{Float64} uh_mod::Vector{Float64}
...@@ -29,7 +30,10 @@ function ModalDecayAverage(mesh, threshold_min, threshold_max) ...@@ -29,7 +30,10 @@ function ModalDecayAverage(mesh, threshold_min, threshold_max)
lsq_x = @. - log(rng_N) lsq_x = @. - log(rng_N)
lsq_y = deepcopy(lsq_x) 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) uh, uh_perfect, uh_mod, lsq_x, lsq_y)
end end
...@@ -39,9 +43,8 @@ function compute_indicator!( ...@@ -39,9 +43,8 @@ function compute_indicator!(
u, # inputs u, # inputs
tci::ModalDecayAverage) 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 uh_mod, uh_perfect, lsq_x, lsq_y = tci
@unpack D, invV = mesh.element
L = layout(mesh) L = layout(mesh)
Npts, K = L Npts, K = L
......
...@@ -2,7 +2,9 @@ Base.@kwdef struct ModalDecayHighest{T_Mesh<:Mesh1d} <: AbstractTCI ...@@ -2,7 +2,9 @@ Base.@kwdef struct ModalDecayHighest{T_Mesh<:Mesh1d} <: AbstractTCI
mesh::T_Mesh mesh::T_Mesh
threshold_min::Float64 threshold_min::Float64
threshold_max::Float64 threshold_max::Float64
# buffers # helpers/buffers
V::Matrix{Float64}
invV::Matrix{Float64}
uh_mod::Vector{Float64} uh_mod::Vector{Float64}
uh_mod_high::Vector{Float64} uh_mod_high::Vector{Float64}
end end
...@@ -14,7 +16,9 @@ function ModalDecayHighest(mesh, threshold_min, threshold_max) ...@@ -14,7 +16,9 @@ function ModalDecayHighest(mesh, threshold_min, threshold_max)
# storage for modal coefficients # storage for modal coefficients
uh_mod = zeros(Float64, Npts) uh_mod = zeros(Float64, Npts)
uh_mod_high = 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, V, invV, uh_mod, uh_mod_high)
end end
......
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