Skip to content

Commit

Permalink
fix allocations of P4estMesh2D BCs (#1636)
Browse files Browse the repository at this point in the history
  • Loading branch information
ranocha authored Sep 13, 2023
1 parent d206b76 commit bc67361
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/solvers/dgsem_p4est/dg_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,9 @@ function prolong2boundaries!(cache, u,
return nothing
end

function calc_boundary_flux!(cache, t, boundary_condition, boundary_indexing,
function calc_boundary_flux!(cache, t, boundary_condition::BC, boundary_indexing,
mesh::Union{P4estMesh{2}, T8codeMesh{2}},
equations, surface_integral, dg::DG)
equations, surface_integral, dg::DG) where {BC}
@unpack boundaries = cache
@unpack surface_flux_values = cache.elements
index_range = eachnode(dg)
Expand Down
11 changes: 10 additions & 1 deletion test/test_p4est_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ isdir(outdir) && rm(outdir, recursive=true)
l2 = [3.198940059144588e-5],
linf = [0.00030636069494005547])

# Ensure that we do not have excessive memory allocations
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
let
t = sol.t[end]
Expand Down Expand Up @@ -102,6 +102,15 @@ isdir(outdir) && rm(outdir, recursive=true)
l2 = [0.020291447969983396, 0.017479614254319948, 0.011387644425613437, 0.0514420126021293],
linf = [0.3582779022370579, 0.32073537890751663, 0.221818049107692, 0.9209559420400415],
tspan = (0.0, 0.15))

# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
let
t = sol.t[end]
u_ode = sol.u[end]
du_ode = similar(u_ode)
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
end
end

@trixi_testset "elixir_euler_forward_step_amr.jl" begin
Expand Down

0 comments on commit bc67361

Please sign in to comment.