From a26d6bd2b8178ae0d27297e30f95eb7dd8e61251 Mon Sep 17 00:00:00 2001 From: Daniel_Doehring Date: Sun, 29 Oct 2023 16:18:33 +0100 Subject: [PATCH 1/4] Fix allocs --- src/solvers/dgmulti/dg.jl | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/solvers/dgmulti/dg.jl b/src/solvers/dgmulti/dg.jl index 182a486dce5..c777df56689 100644 --- a/src/solvers/dgmulti/dg.jl +++ b/src/solvers/dgmulti/dg.jl @@ -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 From d780e578a53b31134fd8173da522c10766faf52b Mon Sep 17 00:00:00 2001 From: Daniel_Doehring Date: Sun, 29 Oct 2023 19:27:39 +0100 Subject: [PATCH 2/4] remove unnecessary code --- src/solvers/dgmulti/dg.jl | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/solvers/dgmulti/dg.jl b/src/solvers/dgmulti/dg.jl index c777df56689..695260f4b9b 100644 --- a/src/solvers/dgmulti/dg.jl +++ b/src/solvers/dgmulti/dg.jl @@ -474,12 +474,6 @@ function calc_boundary_flux!(cache, t, boundary_conditions, mesh, end end -# terminate recursion -function calc_boundary_flux!(cache, t, boundary_conditions::NamedTuple{(), Tuple{}}, - mesh, have_nonconservative_terms, equations, dg::DGMulti) - nothing -end - function calc_single_boundary_flux!(cache, t, boundary_condition, boundary_key, mesh, have_nonconservative_terms::False, equations, dg::DGMulti{NDIMS}) where {NDIMS} From 5dc2020c7cb92af850437069c2f964b0ed0c702f Mon Sep 17 00:00:00 2001 From: Daniel_Doehring Date: Sun, 29 Oct 2023 19:32:38 +0100 Subject: [PATCH 3/4] rerun fmt --- src/solvers/dgmulti/dg.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/solvers/dgmulti/dg.jl b/src/solvers/dgmulti/dg.jl index 695260f4b9b..d2e1bfad72f 100644 --- a/src/solvers/dgmulti/dg.jl +++ b/src/solvers/dgmulti/dg.jl @@ -472,7 +472,7 @@ function calc_boundary_flux!(cache, t, boundary_conditions, mesh, key, mesh, have_nonconservative_terms, equations, dg) end -end +end function calc_single_boundary_flux!(cache, t, boundary_condition, boundary_key, mesh, have_nonconservative_terms::False, equations, From 041f62574c4014273ee0b7c958a93b4cab6ee36e Mon Sep 17 00:00:00 2001 From: Daniel_Doehring Date: Sun, 29 Oct 2023 19:35:17 +0100 Subject: [PATCH 4/4] format --- src/solvers/dgmulti/dg.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/solvers/dgmulti/dg.jl b/src/solvers/dgmulti/dg.jl index d2e1bfad72f..695260f4b9b 100644 --- a/src/solvers/dgmulti/dg.jl +++ b/src/solvers/dgmulti/dg.jl @@ -472,7 +472,7 @@ function calc_boundary_flux!(cache, t, boundary_conditions, mesh, key, mesh, have_nonconservative_terms, equations, dg) end -end +end function calc_single_boundary_flux!(cache, t, boundary_condition, boundary_key, mesh, have_nonconservative_terms::False, equations,