Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise bounds check for MCL #118

Merged
merged 14 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/tree_2d_dgsem/elixir_euler_sedov_blast_wave_MCL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ callbacks = CallbackSet(summary_callback,
###############################################################################
# run the simulation

stage_callbacks = (BoundsCheckCallback(save_errors=false),)
output_directory = "out"
stage_callbacks = (BoundsCheckCallback(save_errors=true, interval=100, output_directory = output_directory),)
amrueda marked this conversation as resolved.
Show resolved Hide resolved

sol = Trixi.solve(ode, Trixi.SimpleSSPRK33(stage_callbacks=stage_callbacks);
dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback
Expand Down
12 changes: 5 additions & 7 deletions src/callbacks_stage/subcell_bounds_check.jl
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ function init_callback(callback::BoundsCheckCallback, semi, limiter::SubcellLimi
return nothing
end

# TODO: Revise Bounds Check for MCL

@unpack output_directory = callback
mkpath(output_directory)
open("$output_directory/deviations.txt", "a") do f
Expand All @@ -128,7 +126,7 @@ function init_callback(callback::BoundsCheckCallback, semi, limiter::SubcellLimi
if limiter.PressurePositivityLimiterKuzmin
print(f, ", pressure_min")
end
# No check for entropy limiting rn
# TODO: Bounds check for entropy limiting
bennibolm marked this conversation as resolved.
Show resolved Hide resolved
println(f)
end

Expand Down Expand Up @@ -201,12 +199,12 @@ end
println("─"^100)
variables = varnames(cons2cons, semi.equations)
for v in eachvariable(semi.equations)
println(variables[v], ":\n- lower bound: ", idp_bounds_delta[1, v],
"\n- upper bound: ", idp_bounds_delta[2, v])
println(variables[v], ":\n- lower bound: ", idp_bounds_delta[2, 1, v],
"\n- upper bound: ", idp_bounds_delta[2, 2, v])
end
if limiter.PressurePositivityLimiterKuzmin
println("pressure:\n- lower bound: ",
idp_bounds_delta[1, nvariables(semi.equations) + 1])
println("pressure:\n- positivity: ",
idp_bounds_delta[2, 1, nvariables(semi.equations) + 1])
end
println("─"^100 * "\n")

Expand Down
Loading