Skip to content

Commit 181f405

Browse files
committed
convince Julia to not store MeshT in a closure
1 parent 8a80e05 commit 181f405

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

src/callbacks_step/stepsize.jl

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,19 +202,17 @@ function calc_max_scaled_speed(backend::Nothing, u, mesh, constant_speed, equati
202202
return max_scaled_speed
203203
end
204204

205-
function calc_max_scaled_speed(backend::Backend, u, mesh, constant_speed, equations, dg,
206-
cache)
205+
function calc_max_scaled_speed(backend::Backend, u, ::MeshT, constant_speed, equations, dg,
206+
cache) where {MeshT}
207207
@unpack contravariant_vectors, inverse_jacobian = cache.elements
208-
meshT = typeof(mesh)
209208

210209
num_elements = nelements(dg, cache)
211210
init = neutral = AcceleratedKernels.neutral_element(Base.max, eltype(u))
212211

213212
# Provide a custom neutral and init element since we "reduce" over 1:num_elements
214-
max_scaled_speed =
215-
AcceleratedKernels.mapreduce(Base.max, 1:num_elements, backend; init, neutral) do element
216-
217-
max_scaled_speed_per_element(u, meshT, constant_speed,
213+
max_scaled_speed = AcceleratedKernels.mapreduce(Base.max, 1:num_elements, backend;
214+
init, neutral) do element
215+
max_scaled_speed_per_element(u, MeshT, constant_speed,
218216
equations, dg,
219217
contravariant_vectors,
220218
inverse_jacobian,

0 commit comments

Comments
 (0)