Skip to content

Commit 0c7ff40

Browse files
Apply suggestions from code review
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 4d33b11 commit 0c7ff40

2 files changed

Lines changed: 15 additions & 6 deletions

File tree

src/callbacks_step/analysis_dg2d.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,8 @@ function integrate_via_indices(func::Func, u,
345345
T8codeMesh{2}},
346346
equations, dg::DGSEM, cache,
347347
args...; normalize = true) where {Func}
348-
return integrate_via_indices(func, trixi_backend(u), u, mesh, equations, dg, cache, args...; normalize = normalize)
348+
return integrate_via_indices(func, trixi_backend(u), u, mesh, equations, dg, cache,
349+
args...; normalize = normalize)
349350
end
350351

351352
function integrate_via_indices(func::Func, ::Nothing, u,
@@ -398,12 +399,15 @@ function integrate_via_indices(func::Func, backend::Backend, u,
398399
# `func(u, 1,1,1, equations, dg, args...)` might access GPU memory
399400
# so we have to rely on the compiler to correctly infer the type of the integral here.
400401
# TODO: Technically we need device_promote_op here that "infers" the function within the context of the GPU.
401-
integral₀ = zero(Base.promote_op(func, typeof(u), Int, Int, Int, typeof(equations), typeof(dg), map(typeof, args)...))
402+
integral₀ = zero(Base.promote_op(func, typeof(u), Int, Int, Int, typeof(equations),
403+
typeof(dg), map(typeof, args)...))
402404
init = neutral = (integral₀, zero(real(mesh)))
403405

404406
# Use quadrature to numerically integrate over entire domain
405407
num_elements = nelements(dg, cache)
406-
_integral, _total_volume = AcceleratedKernels.mapreduce(local_plus, 1:num_elements, backend; init, neutral) do element
408+
_integral, _total_volume = AcceleratedKernels.mapreduce(local_plus, 1:num_elements,
409+
backend; init,
410+
neutral) do element
407411
# Initialize integral with zeros of the right shape
408412
integral, total_volume = neutral
409413

src/callbacks_step/analysis_dg3d.jl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,8 @@ function integrate_via_indices(func::Func, u,
394394
T8codeMesh{3}},
395395
equations, dg::DGSEM, cache,
396396
args...; normalize = true) where {Func}
397-
return integrate_via_indices(func, trixi_backend(u), u, mesh, equations, dg, cache, args...; normalize = normalize)
397+
return integrate_via_indices(func, trixi_backend(u), u, mesh, equations, dg, cache,
398+
args...; normalize = normalize)
398399
end
399400

400401
function integrate_via_indices(func::Func, ::Nothing, u,
@@ -443,12 +444,16 @@ function integrate_via_indices(func::Func, backend::Backend, u,
443444
# `func(u, 1,1,1,1, equations, dg, args...)` might access GPU memory
444445
# so we have to rely on the compiler to correctly infer the type of the integral here.
445446
# TODO: Technically we need device_promote_op here that "infers" the function within the context of the GPU.
446-
integral₀ = zero(Base.promote_op(func, typeof(u), Int, Int, Int, Int, typeof(equations), typeof(dg), map(typeof, args)...))
447+
integral₀ = zero(Base.promote_op(func, typeof(u), Int, Int, Int, Int,
448+
typeof(equations), typeof(dg),
449+
map(typeof, args)...))
447450
init = neutral = (integral₀, zero(real(mesh)))
448451

449452
# Use quadrature to numerically integrate over entire domain
450453
num_elements = nelements(dg, cache)
451-
_integral, _total_volume = AcceleratedKernels.mapreduce(local_plus, 1:num_elements, backend; init, neutral) do element
454+
_integral, _total_volume = AcceleratedKernels.mapreduce(local_plus, 1:num_elements,
455+
backend; init,
456+
neutral) do element
452457
# Initialize integral with zeros of the right shape
453458
integral, total_volume = neutral
454459

0 commit comments

Comments
 (0)