diff --git a/examples/structured_1d_dgsem/elixir_traffic_flow_lwr_greenlight.jl b/examples/structured_1d_dgsem/elixir_traffic_flow_lwr_greenlight.jl index e5badf14451..3cb4735e132 100644 --- a/examples/structured_1d_dgsem/elixir_traffic_flow_lwr_greenlight.jl +++ b/examples/structured_1d_dgsem/elixir_traffic_flow_lwr_greenlight.jl @@ -8,8 +8,8 @@ equations = TrafficFlowLWREquations1D() solver = DGSEM(polydeg = 3, surface_flux = FluxHLL(min_max_speed_davis)) -coordinates_min = (-1.0,) # minimum coordinate -coordinates_max = (1.0,) # maximum coordinate +coordinates_min = -1.0 # minimum coordinate +coordinates_max = 1.0 # maximum coordinate cells_per_dimension = (64,) mesh = StructuredMesh(cells_per_dimension, coordinates_min, coordinates_max, diff --git a/src/meshes/structured_mesh.jl b/src/meshes/structured_mesh.jl index 0e4d9a359ca..ef2ed211f58 100644 --- a/src/meshes/structured_mesh.jl +++ b/src/meshes/structured_mesh.jl @@ -171,6 +171,11 @@ end function coordinates2mapping(coordinates_min::NTuple{1}, coordinates_max::NTuple{1}) mapping(xi) = linear_interpolate(xi, coordinates_min[1], coordinates_max[1]) end +# Convenience function for 1D: Do not insist on tuples +function coordinates2mapping(coordinates_min::RealT, + coordinates_max::RealT) where {RealT <: Real} + mapping(xi) = linear_interpolate(xi, coordinates_min, coordinates_max) +end function coordinates2mapping(coordinates_min::NTuple{2}, coordinates_max::NTuple{2}) function mapping(xi, eta)