Skip to content

Commit

Permalink
Merge branch 'bb/subcell-limiting-structuredmesh' into subcell-limiti…
Browse files Browse the repository at this point in the history
…ng-mergemain
  • Loading branch information
bennibolm committed May 23, 2024
2 parents 2e6b0a8 + 12400ee commit a271a1c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/callbacks_stage/subcell_bounds_check_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
@muladd begin
#! format: noindent

@inline function check_bounds(u, mesh::AbstractMesh{2}, equations, solver, cache,
@inline function check_bounds(u,
mesh::Union{TreeMesh{2}, StructuredMesh{2}, P4estMesh{2}},
equations, solver, cache,
limiter::SubcellLimiterIDP)
(; local_twosided, positivity, local_onesided) = solver.volume_integral.limiter
(; variable_bounds) = limiter.cache.subcell_limiter_coefficients
Expand Down
5 changes: 4 additions & 1 deletion src/callbacks_stage/subcell_limiter_idp_correction_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
@muladd begin
#! format: noindent

function perform_idp_correction!(u, dt, mesh::AbstractMesh{2}, equations, dg, cache)
function perform_idp_correction!(u, dt,
mesh::Union{TreeMesh{2}, StructuredMesh{2},
P4estMesh{2}},
equations, dg, cache)
@unpack inverse_weights = dg.basis
@unpack antidiffusive_flux1_L, antidiffusive_flux2_L, antidiffusive_flux1_R, antidiffusive_flux2_R = cache.antidiffusive_fluxes
@unpack alpha1, alpha2 = dg.volume_integral.limiter.cache.subcell_limiter_coefficients
Expand Down
13 changes: 9 additions & 4 deletions src/solvers/dgsem_tree/dg_2d_subcell_limiters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@muladd begin
#! format: noindent

function create_cache(mesh::AbstractMesh{2},
function create_cache(mesh::Union{TreeMesh{2}, StructuredMesh{2}, P4estMesh{2}},
equations, volume_integral::VolumeIntegralSubcellLimiting,
dg::DG, uEltype)
cache = create_cache(mesh, equations,
Expand Down Expand Up @@ -62,7 +62,8 @@ function create_cache(mesh::AbstractMesh{2},
end

function calc_volume_integral!(du, u,
mesh::Union{TreeMesh, StructuredMesh, P4estMesh},
mesh::Union{TreeMesh{2}, StructuredMesh{2},
P4estMesh{2}},
nonconservative_terms, equations,
volume_integral::VolumeIntegralSubcellLimiting,
dg::DGSEM, cache, t, boundary_conditions)
Expand Down Expand Up @@ -507,7 +508,9 @@ end
# Calculate the antidiffusive flux `antidiffusive_flux` as the subtraction between `fhat` and `fstar` for conservative systems.
@inline function calcflux_antidiffusive!(fhat1_L, fhat1_R, fhat2_L, fhat2_R,
fstar1_L, fstar1_R, fstar2_L, fstar2_R,
u, mesh::AbstractMesh{2},
u,
mesh::Union{TreeMesh{2}, StructuredMesh{2},
P4estMesh{2}},
nonconservative_terms::False, equations,
limiter::SubcellLimiterIDP, dg, element, cache)
@unpack antidiffusive_flux1_L, antidiffusive_flux2_L, antidiffusive_flux1_R, antidiffusive_flux2_R = cache.antidiffusive_fluxes
Expand Down Expand Up @@ -545,7 +548,9 @@ end
# Calculate the antidiffusive flux `antidiffusive_flux` as the subtraction between `fhat` and `fstar` for conservative systems.
@inline function calcflux_antidiffusive!(fhat1_L, fhat1_R, fhat2_L, fhat2_R,
fstar1_L, fstar1_R, fstar2_L, fstar2_R,
u, mesh::AbstractMesh{2},
u,
mesh::Union{TreeMesh{2}, StructuredMesh{2},
P4estMesh{2}},
nonconservative_terms::True, equations,
limiter::SubcellLimiterIDP, dg, element, cache)
@unpack antidiffusive_flux1_L, antidiffusive_flux2_L, antidiffusive_flux1_R, antidiffusive_flux2_R = cache.antidiffusive_fluxes
Expand Down
1 change: 0 additions & 1 deletion test/test_structured_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,6 @@ end
end
end


@trixi_testset "elixir_euler_sedov_blast_wave_sc_subcell.jl (local bounds)" begin
@test_trixi_include(joinpath(EXAMPLES_DIR,
"elixir_euler_sedov_blast_wave_sc_subcell.jl"),
Expand Down

0 comments on commit a271a1c

Please sign in to comment.