Skip to content

Commit

Permalink
Fix allocs
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielDoehring committed Oct 29, 2023
1 parent dc0dc1d commit a26d6bd
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/solvers/dgmulti/dg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -465,18 +465,13 @@ function calc_boundary_flux!(cache, t, boundary_conditions::BoundaryConditionPer
nothing
end

# "lispy tuple programming" instead of for loop for type stability
function calc_boundary_flux!(cache, t, boundary_conditions, mesh,
have_nonconservative_terms, equations, dg::DGMulti)

# peel off first boundary condition
calc_single_boundary_flux!(cache, t, first(boundary_conditions),
first(keys(boundary_conditions)),
mesh, have_nonconservative_terms, equations, dg)

# recurse on the remainder of the boundary conditions
calc_boundary_flux!(cache, t, Base.tail(boundary_conditions),
mesh, have_nonconservative_terms, equations, dg)
for (key, value) in zip(keys(boundary_conditions), boundary_conditions)
calc_single_boundary_flux!(cache, t, value,
key,
mesh, have_nonconservative_terms, equations, dg)
end
end

# terminate recursion
Expand Down

0 comments on commit a26d6bd

Please sign in to comment.