Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Hendrik Ranocha <[email protected]>
  • Loading branch information
andrewwinters5000 and ranocha authored Aug 19, 2024
1 parent ecd9570 commit 570cf75
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions examples/t8code_2d_dgsem/elixir_euler_weak_blast_wave_amr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,7 @@ sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false),
dt = 1.0, # solve needs some value here but it will be overwritten by the stepsize_callback
save_everystep = false, callback = callbacks);#, maxiters=4);
summary_callback() # print the timer summary

# Finalize `T8codeMesh` to make sure MPI related objects in t8code are
# released before `MPI` finalizes.
!isinteractive() && finalize(mesh)
4 changes: 4 additions & 0 deletions examples/t8code_3d_dgsem/elixir_euler_weak_blast_wave_amr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,7 @@ sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false),
dt = 1.0, # solve needs some value here but it will be overwritten by the stepsize_callback
save_everystep = false, callback = callbacks);
summary_callback() # print the timer summary

# Finalize `T8codeMesh` to make sure MPI related objects in t8code are
# released before `MPI` finalizes.
!isinteractive() && finalize(mesh)
4 changes: 2 additions & 2 deletions src/callbacks_step/amr_dg2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function refine!(u_ode::AbstractVector, adaptor, mesh::Union{TreeMesh{2}, P4estM
# child element and save the result
for m in 0:3 # loop over the children
for v in eachvariable(equations)
u[v, .., element_id + m] .*= (0.25 .*
u[v, .., element_id + m] .*= (0.25f0 .*
cache.elements.inverse_jacobian[..,
element_id + m])
end
Expand Down Expand Up @@ -517,7 +517,7 @@ function adapt!(u_ode::AbstractVector, adaptor, mesh::T8codeMesh{2}, equations,
# child element and save the result
for m in 0:3 # loop over the children
for v in eachvariable(equations)
u[v, .., new_index + m] .*= (0.25 .*
u[v, .., new_index + m] .*= (0.25f0 .*
cache.elements.inverse_jacobian[..,
new_index + m])
end
Expand Down
4 changes: 2 additions & 2 deletions src/callbacks_step/amr_dg3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function refine!(u_ode::AbstractVector, adaptor, mesh::Union{TreeMesh{3}, P4estM
# child element and save the result
for m in 0:7 # loop over the children
for v in eachvariable(equations)
u[v, .., element_id + m] .*= (0.125 .*
u[v, .., element_id + m] .*= (0.125f0 .*
cache.elements.inverse_jacobian[..,
element_id + m])
end
Expand Down Expand Up @@ -453,7 +453,7 @@ function adapt!(u_ode::AbstractVector, adaptor, mesh::T8codeMesh{3}, equations,
# child element and save the result
for m in 0:7 # loop over the children
for v in eachvariable(equations)
u[v, .., new_index + m] .*= (0.125 .*
u[v, .., new_index + m] .*= (0.125f0 .*
cache.elements.inverse_jacobian[..,
new_index + m])
end
Expand Down

0 comments on commit 570cf75

Please sign in to comment.