diff --git a/src/solvers/dgsem/basis_lobatto_legendre.jl b/src/solvers/dgsem/basis_lobatto_legendre.jl index 3ea668c026..6c8bec9c93 100644 --- a/src/solvers/dgsem/basis_lobatto_legendre.jl +++ b/src/solvers/dgsem/basis_lobatto_legendre.jl @@ -40,31 +40,27 @@ function LobattoLegendreBasis(RealT, polydeg::Integer) nodes_, weights_ = gauss_lobatto_nodes_weights(nnodes_, RealT) inverse_weights_ = inv.(weights_) - _, inverse_vandermonde_legendre_ = vandermonde_legendre(nodes_, RealT) + _, inverse_vandermonde_legendre = vandermonde_legendre(nodes_, RealT) - boundary_interpolation_ = zeros(RealT, nnodes_, 2) - boundary_interpolation_[:, 1] = calc_lhat(-one(RealT), nodes_, weights_) - boundary_interpolation_[:, 2] = calc_lhat(one(RealT), nodes_, weights_) + boundary_interpolation = zeros(RealT, nnodes_, 2) + boundary_interpolation[:, 1] = calc_lhat(-one(RealT), nodes_, weights_) + boundary_interpolation[:, 2] = calc_lhat(one(RealT), nodes_, weights_) - derivative_matrix_ = polynomial_derivative_matrix(nodes_) - derivative_split_ = calc_dsplit(nodes_, weights_) - derivative_split_transpose_ = Matrix(derivative_split_') - derivative_dhat_ = calc_dhat(nodes_, weights_) + derivative_matrix = polynomial_derivative_matrix(nodes_) + derivative_split = calc_dsplit(nodes_, weights_) + derivative_split_transpose = Matrix(derivative_split') + derivative_dhat = calc_dhat(nodes_, weights_) - # 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_) inverse_weights = SVector{nnodes_, RealT}(inverse_weights_) - inverse_vandermonde_legendre = convert.(RealT, inverse_vandermonde_legendre_) - boundary_interpolation = convert.(RealT, boundary_interpolation_) - - # Usually as fast as `SMatrix` (when using `let` in the volume integral/`@threaded`) - derivative_matrix = Matrix{RealT}(derivative_matrix_) - derivative_split = Matrix{RealT}(derivative_split_) - derivative_split_transpose = Matrix{RealT}(derivative_split_transpose_) - derivative_dhat = Matrix{RealT}(derivative_dhat_) + # We keep the matrices above stored using the standard `Matrix` type + # since this is usually as fast as `SMatrix` + # (when using `let` in the volume integral/`@threaded`) + # and reduces latency return LobattoLegendreBasis{RealT, nnodes_, typeof(nodes), typeof(inverse_vandermonde_legendre),