From a255fc00baf61371942f478bbbe2c4df2954f505 Mon Sep 17 00:00:00 2001 From: Daniel Doehring Date: Thu, 5 Dec 2024 14:57:53 +0100 Subject: [PATCH] Remove unused `surface_integral` for `prolong2mortar` functions (#2188) * Remove unused `surface_integral` for `prolong2mortar` functions * remove * remove at some more places --------- Co-authored-by: Hendrik Ranocha --- src/solvers/dgsem_p4est/dg_2d.jl | 2 +- src/solvers/dgsem_p4est/dg_2d_parabolic.jl | 11 +++++------ src/solvers/dgsem_p4est/dg_2d_parallel.jl | 2 +- src/solvers/dgsem_p4est/dg_3d.jl | 2 +- src/solvers/dgsem_p4est/dg_3d_parabolic.jl | 4 ++-- src/solvers/dgsem_p4est/dg_3d_parallel.jl | 6 +++--- src/solvers/dgsem_tree/dg_2d.jl | 4 ++-- src/solvers/dgsem_tree/dg_2d_parabolic.jl | 6 +++--- src/solvers/dgsem_tree/dg_2d_parallel.jl | 6 +++--- src/solvers/dgsem_tree/dg_3d.jl | 4 ++-- src/solvers/dgsem_tree/dg_3d_parabolic.jl | 4 ++-- src/solvers/fdsbp_tree/fdsbp.jl | 2 +- 12 files changed, 26 insertions(+), 27 deletions(-) diff --git a/src/solvers/dgsem_p4est/dg_2d.jl b/src/solvers/dgsem_p4est/dg_2d.jl index 1b38eaa2d40..6a7bbbb71d7 100644 --- a/src/solvers/dgsem_p4est/dg_2d.jl +++ b/src/solvers/dgsem_p4est/dg_2d.jl @@ -384,7 +384,7 @@ end function prolong2mortars!(cache, u, mesh::Union{P4estMesh{2}, T8codeMesh{2}}, equations, mortar_l2::LobattoLegendreMortarL2, - surface_integral, dg::DGSEM) + dg::DGSEM) @unpack neighbor_ids, node_indices = cache.mortars index_range = eachnode(dg) diff --git a/src/solvers/dgsem_p4est/dg_2d_parabolic.jl b/src/solvers/dgsem_p4est/dg_2d_parabolic.jl index baa9f7bf516..9f8306031c1 100644 --- a/src/solvers/dgsem_p4est/dg_2d_parabolic.jl +++ b/src/solvers/dgsem_p4est/dg_2d_parabolic.jl @@ -33,7 +33,7 @@ for `P4estMesh`es we call ``` prolong2mortars_divergence!(cache, flux_viscous, mesh, equations_parabolic, - dg.mortar, dg.surface_integral, dg) + dg.mortar, dg) calc_mortar_flux_divergence!(cache_parabolic.elements.surface_flux_values, mesh, equations_parabolic, dg.mortar, @@ -42,11 +42,11 @@ for `P4estMesh`es we call instead of ``` prolong2mortars!(cache, flux_viscous, mesh, equations_parabolic, - dg.mortar, dg.surface_integral, dg) + dg.mortar, dg) calc_mortar_flux!(cache_parabolic.elements.surface_flux_values, mesh, equations_parabolic, - dg.mortar, dg.surface_integral, dg, cache) + dg.mortar, dg, cache) ``` =# function rhs_parabolic!(du, u, t, mesh::Union{P4estMesh{2}, P4estMesh{3}}, @@ -126,7 +126,7 @@ function rhs_parabolic!(du, u, t, mesh::Union{P4estMesh{2}, P4estMesh{3}}, # !!! NOTE: we reuse the hyperbolic cache here since it contains "mortars" and "u_threaded". See https://github.com/trixi-framework/Trixi.jl/issues/1674 for a discussion @trixi_timeit timer() "prolong2mortars" begin prolong2mortars_divergence!(cache, flux_viscous, mesh, equations_parabolic, - dg.mortar, dg.surface_integral, dg) + dg.mortar, dg) end # Calculate mortar fluxes (specialized for AbstractEquationsParabolic) @@ -253,7 +253,7 @@ function calc_gradient!(gradients, u_transformed, t, # Prolong solution to mortars. This resues the hyperbolic version of `prolong2mortars` @trixi_timeit timer() "prolong2mortars" begin prolong2mortars!(cache, u_transformed, mesh, equations_parabolic, - dg.mortar, dg.surface_integral, dg) + dg.mortar, dg) end # Calculate mortar fluxes. This reuses the hyperbolic version of `calc_mortar_flux`, @@ -676,7 +676,6 @@ function prolong2mortars_divergence!(cache, flux_viscous::Vector{Array{uEltype, mesh::Union{P4estMesh{2}, T8codeMesh{2}}, equations, mortar_l2::LobattoLegendreMortarL2, - surface_integral, dg::DGSEM) where {uEltype <: Real} @unpack neighbor_ids, node_indices = cache.mortars @unpack contravariant_vectors = cache.elements diff --git a/src/solvers/dgsem_p4est/dg_2d_parallel.jl b/src/solvers/dgsem_p4est/dg_2d_parallel.jl index 633c6f1d067..5d5225c6f9e 100644 --- a/src/solvers/dgsem_p4est/dg_2d_parallel.jl +++ b/src/solvers/dgsem_p4est/dg_2d_parallel.jl @@ -137,7 +137,7 @@ function prolong2mpimortars!(cache, u, mesh::Union{ParallelP4estMesh{2}, ParallelT8codeMesh{2}}, equations, mortar_l2::LobattoLegendreMortarL2, - surface_integral, dg::DGSEM) + dg::DGSEM) @unpack node_indices = cache.mpi_mortars index_range = eachnode(dg) diff --git a/src/solvers/dgsem_p4est/dg_3d.jl b/src/solvers/dgsem_p4est/dg_3d.jl index 0632e3d3d8e..ac87f339d7c 100644 --- a/src/solvers/dgsem_p4est/dg_3d.jl +++ b/src/solvers/dgsem_p4est/dg_3d.jl @@ -418,7 +418,7 @@ end function prolong2mortars!(cache, u, mesh::Union{P4estMesh{3}, T8codeMesh{3}}, equations, mortar_l2::LobattoLegendreMortarL2, - surface_integral, dg::DGSEM) + dg::DGSEM) @unpack fstar_tmp_threaded = cache @unpack neighbor_ids, node_indices = cache.mortars index_range = eachnode(dg) diff --git a/src/solvers/dgsem_p4est/dg_3d_parabolic.jl b/src/solvers/dgsem_p4est/dg_3d_parabolic.jl index b1204e5a15c..f79d599364d 100644 --- a/src/solvers/dgsem_p4est/dg_3d_parabolic.jl +++ b/src/solvers/dgsem_p4est/dg_3d_parabolic.jl @@ -148,7 +148,7 @@ function calc_gradient!(gradients, u_transformed, t, # !!! should we have a separate mortars/u_threaded in cache_parabolic? @trixi_timeit timer() "prolong2mortars" begin prolong2mortars!(cache, u_transformed, mesh, equations_parabolic, - dg.mortar, dg.surface_integral, dg) + dg.mortar, dg) end # Calculate mortar fluxes. These should reuse the hyperbolic version of `calc_mortar_flux`, @@ -647,7 +647,7 @@ function prolong2mortars_divergence!(cache, flux_viscous, mesh::Union{P4estMesh{3}, T8codeMesh{3}}, equations, mortar_l2::LobattoLegendreMortarL2, - surface_integral, dg::DGSEM) + dg::DGSEM) @unpack neighbor_ids, node_indices = cache.mortars @unpack fstar_tmp_threaded = cache @unpack contravariant_vectors = cache.elements diff --git a/src/solvers/dgsem_p4est/dg_3d_parallel.jl b/src/solvers/dgsem_p4est/dg_3d_parallel.jl index e51836e8a51..cd64e77e739 100644 --- a/src/solvers/dgsem_p4est/dg_3d_parallel.jl +++ b/src/solvers/dgsem_p4est/dg_3d_parallel.jl @@ -20,7 +20,7 @@ function rhs!(du, u, t, # Prolong solution to MPI mortars @trixi_timeit timer() "prolong2mpimortars" begin prolong2mpimortars!(cache, u, mesh, equations, - dg.mortar, dg.surface_integral, dg) + dg.mortar, dg) end # Start to send MPI data @@ -64,7 +64,7 @@ function rhs!(du, u, t, # Prolong solution to mortars @trixi_timeit timer() "prolong2mortars" begin prolong2mortars!(cache, u, mesh, equations, - dg.mortar, dg.surface_integral, dg) + dg.mortar, dg) end # Calculate mortar fluxes @@ -305,7 +305,7 @@ function prolong2mpimortars!(cache, u, mesh::Union{ParallelP4estMesh{3}, ParallelT8codeMesh{3}}, equations, mortar_l2::LobattoLegendreMortarL2, - surface_integral, dg::DGSEM) + dg::DGSEM) @unpack node_indices = cache.mpi_mortars index_range = eachnode(dg) diff --git a/src/solvers/dgsem_tree/dg_2d.jl b/src/solvers/dgsem_tree/dg_2d.jl index 069d4f09bc4..98bd0889206 100644 --- a/src/solvers/dgsem_tree/dg_2d.jl +++ b/src/solvers/dgsem_tree/dg_2d.jl @@ -152,7 +152,7 @@ function rhs!(du, u, t, # Prolong solution to mortars @trixi_timeit timer() "prolong2mortars" begin prolong2mortars!(cache, u, mesh, equations, - dg.mortar, dg.surface_integral, dg) + dg.mortar, dg) end # Calculate mortar fluxes @@ -798,7 +798,7 @@ end function prolong2mortars!(cache, u, mesh::TreeMesh{2}, equations, - mortar_l2::LobattoLegendreMortarL2, surface_integral, + mortar_l2::LobattoLegendreMortarL2, dg::DGSEM) @threaded for mortar in eachmortar(dg, cache) large_element = cache.mortars.neighbor_ids[3, mortar] diff --git a/src/solvers/dgsem_tree/dg_2d_parabolic.jl b/src/solvers/dgsem_tree/dg_2d_parabolic.jl index 22c29eb4725..2123eae5459 100644 --- a/src/solvers/dgsem_tree/dg_2d_parabolic.jl +++ b/src/solvers/dgsem_tree/dg_2d_parabolic.jl @@ -89,7 +89,7 @@ function rhs_parabolic!(du, u, t, mesh::Union{TreeMesh{2}, TreeMesh{3}}, # Prolong solution to mortars @trixi_timeit timer() "prolong2mortars" begin prolong2mortars!(cache, flux_viscous, mesh, equations_parabolic, - dg.mortar, dg.surface_integral, dg) + dg.mortar, dg) end # Calculate mortar fluxes @@ -519,7 +519,7 @@ end function prolong2mortars!(cache, flux_viscous::Vector{Array{uEltype, 4}}, mesh::TreeMesh{2}, equations_parabolic::AbstractEquationsParabolic, - mortar_l2::LobattoLegendreMortarL2, surface_integral, + mortar_l2::LobattoLegendreMortarL2, dg::DGSEM) where {uEltype <: Real} flux_viscous_x, flux_viscous_y = flux_viscous @threaded for mortar in eachmortar(dg, cache) @@ -830,7 +830,7 @@ function calc_gradient!(gradients, u_transformed, t, # NOTE: This re-uses the implementation for hyperbolic terms in "dg_2d.jl" @trixi_timeit timer() "prolong2mortars" begin prolong2mortars!(cache, u_transformed, mesh, equations_parabolic, - dg.mortar, dg.surface_integral, dg) + dg.mortar, dg) end # Calculate mortar fluxes diff --git a/src/solvers/dgsem_tree/dg_2d_parallel.jl b/src/solvers/dgsem_tree/dg_2d_parallel.jl index b21933f0a5f..b77308c32fe 100644 --- a/src/solvers/dgsem_tree/dg_2d_parallel.jl +++ b/src/solvers/dgsem_tree/dg_2d_parallel.jl @@ -463,7 +463,7 @@ function rhs!(du, u, t, # Prolong solution to MPI mortars @trixi_timeit timer() "prolong2mpimortars" begin prolong2mpimortars!(cache, u, mesh, equations, - dg.mortar, dg.surface_integral, dg) + dg.mortar, dg) end # Start to send MPI data @@ -510,7 +510,7 @@ function rhs!(du, u, t, # Prolong solution to mortars @trixi_timeit timer() "prolong2mortars" begin prolong2mortars!(cache, u, mesh, equations, - dg.mortar, dg.surface_integral, dg) + dg.mortar, dg) end # Calculate mortar fluxes @@ -597,7 +597,7 @@ end function prolong2mpimortars!(cache, u, mesh::ParallelTreeMesh{2}, equations, - mortar_l2::LobattoLegendreMortarL2, surface_integral, + mortar_l2::LobattoLegendreMortarL2, dg::DGSEM) @unpack mpi_mortars = cache diff --git a/src/solvers/dgsem_tree/dg_3d.jl b/src/solvers/dgsem_tree/dg_3d.jl index 381534d2079..43f88bc9198 100644 --- a/src/solvers/dgsem_tree/dg_3d.jl +++ b/src/solvers/dgsem_tree/dg_3d.jl @@ -200,7 +200,7 @@ function rhs!(du, u, t, # Prolong solution to mortars @trixi_timeit timer() "prolong2mortars" begin prolong2mortars!(cache, u, mesh, equations, - dg.mortar, dg.surface_integral, dg) + dg.mortar, dg) end # Calculate mortar fluxes @@ -864,7 +864,7 @@ end function prolong2mortars!(cache, u, mesh::TreeMesh{3}, equations, mortar_l2::LobattoLegendreMortarL2, - surface_integral, dg::DGSEM) + dg::DGSEM) # temporary buffer for projections @unpack fstar_tmp1_threaded = cache diff --git a/src/solvers/dgsem_tree/dg_3d_parabolic.jl b/src/solvers/dgsem_tree/dg_3d_parabolic.jl index 657f39bbffb..445a40e3a48 100644 --- a/src/solvers/dgsem_tree/dg_3d_parabolic.jl +++ b/src/solvers/dgsem_tree/dg_3d_parabolic.jl @@ -496,7 +496,7 @@ function prolong2mortars!(cache, mesh::TreeMesh{3}, equations_parabolic::AbstractEquationsParabolic, mortar_l2::LobattoLegendreMortarL2, - surface_integral, dg::DGSEM) where {uEltype <: Real} + dg::DGSEM) where {uEltype <: Real} # temporary buffer for projections @unpack fstar_tmp1_threaded = cache @@ -966,7 +966,7 @@ function calc_gradient!(gradients, u_transformed, t, # NOTE: This re-uses the implementation for hyperbolic terms in "dg_3d.jl" @trixi_timeit timer() "prolong2mortars" begin prolong2mortars!(cache, u_transformed, mesh, equations_parabolic, - dg.mortar, dg.surface_integral, dg) + dg.mortar, dg) end # Calculate mortar fluxes diff --git a/src/solvers/fdsbp_tree/fdsbp.jl b/src/solvers/fdsbp_tree/fdsbp.jl index 11b09c6df9c..5824c6595fa 100644 --- a/src/solvers/fdsbp_tree/fdsbp.jl +++ b/src/solvers/fdsbp_tree/fdsbp.jl @@ -51,7 +51,7 @@ create_cache(mesh, equations, mortar::Nothing, uEltype) = NamedTuple() nmortars(mortar::Nothing) = 0 function prolong2mortars!(cache, u, mesh, equations, mortar::Nothing, - surface_integral, dg::DG) + dg::DG) @assert isempty(eachmortar(dg, cache)) end