From e2fd3a56d08910bc6b7ac213a146c83652102c06 Mon Sep 17 00:00:00 2001
From: bennibolm <benjamin.bolm@gmx.de>
Date: Thu, 23 Nov 2023 13:12:36 +0100
Subject: [PATCH] Remove default routine for `get_boundary_outer_state`

---
 ...ixir_euler_supersonic_cylinder_sc_subcell.jl | 17 +++++++++++++++++
 src/equations/compressible_euler_2d.jl          |  1 +
 .../dgsem_tree/dg_2d_subcell_limiters.jl        |  7 -------
 3 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/examples/p4est_2d_dgsem/elixir_euler_supersonic_cylinder_sc_subcell.jl b/examples/p4est_2d_dgsem/elixir_euler_supersonic_cylinder_sc_subcell.jl
index b97862ace17..45ad75c8d6a 100644
--- a/examples/p4est_2d_dgsem/elixir_euler_supersonic_cylinder_sc_subcell.jl
+++ b/examples/p4est_2d_dgsem/elixir_euler_supersonic_cylinder_sc_subcell.jl
@@ -48,6 +48,16 @@ initial_condition = initial_condition_mach3_flow
     return flux
 end
 
+@inline function Trixi.get_boundary_outer_state(u_inner, cache, t,
+                                                boundary_condition::typeof(boundary_condition_supersonic_inflow),
+                                                normal_direction::AbstractVector, direction,
+                                                equations,
+                                                dg::DG, indices...)
+    x = Trixi.get_node_coords(cache.elements.node_coordinates, equations, dg, indices...)
+
+    return initial_condition(x, t, equations)
+end
+
 # Supersonic outflow boundary condition.
 # Calculate the boundary flux entirely from the internal solution state. Analogous to supersonic inflow
 # except all the solution state values are set from the internal solution as everything leaves the domain
@@ -59,6 +69,13 @@ end
     return flux
 end
 
+@inline function Trixi.get_boundary_outer_state(u_inner, cache, t,
+                                                boundary_condition::typeof(boundary_condition_outflow),
+                                                orientation_or_normal, direction, equations,
+                                                dg, indices...)
+    return u_inner
+end
+
 # boundary_condition_inflow_outflow = BoundaryConditionCharacteristic(initial_condition)
 
 # boundary_conditions = Dict(:Bottom => boundary_condition_slip_wall,
diff --git a/src/equations/compressible_euler_2d.jl b/src/equations/compressible_euler_2d.jl
index 182ce73d253..9e4f3bfb6e8 100644
--- a/src/equations/compressible_euler_2d.jl
+++ b/src/equations/compressible_euler_2d.jl
@@ -450,6 +450,7 @@ end
     # Get inverse of density
     srho = 1 / u_inner[1]
 
+    # Get normal velocity
     vn = srho * (normal_direction[1] * u_inner[2] + normal_direction[2] * u_inner[3]) /
          norm(normal_direction)
 
diff --git a/src/solvers/dgsem_tree/dg_2d_subcell_limiters.jl b/src/solvers/dgsem_tree/dg_2d_subcell_limiters.jl
index 7d997d8389a..a5166e89251 100644
--- a/src/solvers/dgsem_tree/dg_2d_subcell_limiters.jl
+++ b/src/solvers/dgsem_tree/dg_2d_subcell_limiters.jl
@@ -1850,13 +1850,6 @@ end
                    u_inner[4])
 end
 
-# Default implementation of `get_boundary_outer_state` returns inner value.
-@inline function get_boundary_outer_state(u_inner, cache, t, boundary_condition,
-                                          orientation_or_normal, direction, equations,
-                                          dg, indices...)
-    return u_inner
-end
-
 @inline function get_boundary_outer_state(u_inner, cache, t,
                                           boundary_condition::BoundaryConditionDirichlet,
                                           orientation_or_normal, direction, equations,