From 28500ea8965bd8ecf54ce35166d2ff6bf35ab212 Mon Sep 17 00:00:00 2001 From: Daniel Doehring Date: Tue, 31 Oct 2023 16:03:26 +0100 Subject: [PATCH] Fix allocs (#1695) * Fix allocs * remove unnecessary code * rerun fmt * format --- src/solvers/dgmulti/dg.jl | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/src/solvers/dgmulti/dg.jl b/src/solvers/dgmulti/dg.jl index 182a486dce5..695260f4b9b 100644 --- a/src/solvers/dgmulti/dg.jl +++ b/src/solvers/dgmulti/dg.jl @@ -465,24 +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) -end - -# terminate recursion -function calc_boundary_flux!(cache, t, boundary_conditions::NamedTuple{(), Tuple{}}, - mesh, have_nonconservative_terms, equations, dg::DGMulti) - nothing + 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 function calc_single_boundary_flux!(cache, t, boundary_condition, boundary_key, mesh,