Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
huiyuxie committed Jan 20, 2025
1 parent 6149104 commit 3de1657
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
8 changes: 3 additions & 5 deletions src/solvers/dgsem/basis_lobatto_legendre.jl
Original file line number Diff line number Diff line change
Expand Up @@ -253,15 +253,13 @@ function SolutionAnalyzer(basis::LobattoLegendreBasis;
nnodes_ = analysis_polydeg + 1

nodes_, weights_ = gauss_lobatto_nodes_weights(nnodes_, RealT)
vandermonde_ = polynomial_interpolation_matrix(get_nodes(basis), nodes_)
vandermonde = polynomial_interpolation_matrix(get_nodes(basis), nodes_)

# type conversions to get the requested real type and enable possible
# optimizations of runtime performance and latency
# Type conversions to enable possible optimizations of runtime performance
# and latency
nodes = SVector{nnodes_, RealT}(nodes_)
weights = SVector{nnodes_, RealT}(weights_)

vandermonde = Matrix{RealT}(vandermonde_)

return LobattoLegendreAnalyzer{RealT, nnodes_, typeof(nodes), typeof(vandermonde)}(nodes,
weights,
vandermonde)
Expand Down
12 changes: 6 additions & 6 deletions src/solvers/dgsem/l2projection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ function calc_reverse_upper(n_nodes, ::Val{:gauss_lobatto}, RealT = Float64)
wbary = barycentric_weights(nodes)

# Calculate projection matrix (actually: discrete L2 projection with errors)
operator = zeros(n_nodes, n_nodes)
operator = zeros(RealT, n_nodes, n_nodes)
for j in 1:n_nodes
poly = lagrange_interpolating_polynomials(1 / 2 * (nodes[j] + 1), nodes, wbary)
poly = lagrange_interpolating_polynomials(0.5f0 * (nodes[j] + 1), nodes, wbary)
for i in 1:n_nodes
operator[i, j] = 1 / 2 * poly[i] * weights[j] / weights[i]
operator[i, j] = 0.5f0 * poly[i] * weights[j] / weights[i]
end
end

Expand All @@ -141,11 +141,11 @@ function calc_reverse_lower(n_nodes, ::Val{:gauss_lobatto}, RealT = Float64)
wbary = barycentric_weights(nodes)

# Calculate projection matrix (actually: discrete L2 projection with errors)
operator = zeros(n_nodes, n_nodes)
operator = zeros(RealT, n_nodes, n_nodes)
for j in 1:n_nodes
poly = lagrange_interpolating_polynomials(1 / 2 * (nodes[j] - 1), nodes, wbary)
poly = lagrange_interpolating_polynomials(0.5f0 * (nodes[j] - 1), nodes, wbary)
for i in 1:n_nodes
operator[i, j] = 1 / 2 * poly[i] * weights[j] / weights[i]
operator[i, j] = 0.5f0 * poly[i] * weights[j] / weights[i]
end
end

Expand Down

0 comments on commit 3de1657

Please sign in to comment.