Skip to content

Commit

Permalink
Similiarize Structured1D to Tree1D (#2153)
Browse files Browse the repository at this point in the history
* Similarize Structured1D to Tree1D

* Update src/meshes/structured_mesh.jl

---------

Co-authored-by: Hendrik Ranocha <[email protected]>
  • Loading branch information
DanielDoehring and ranocha authored Nov 8, 2024
1 parent 806c1b9 commit a0c14d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 5 additions & 0 deletions src/meshes/structured_mesh.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a0c14d7

Please sign in to comment.