Skip to content

Commit

Permalink
add TODOs for code pieces that should move to TrixiShallowWater package
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewwinters5000 committed Jul 6, 2023
1 parent a851866 commit 8711313
Show file tree
Hide file tree
Showing 31 changed files with 242 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ using Trixi

###############################################################################
# Semidiscretization of the shallow water equations
#
# TODO: TrixiShallowWater: wet/dry example elixir

equations = ShallowWaterEquations2D(gravity_constant=9.81, H0=1.4)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ using Trixi

###############################################################################
# Semidiscretization of the shallow water equations
#
# TODO: TrixiShallowWater: wet/dry example elixir

equations = ShallowWaterEquations2D(gravity_constant=9.81)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ using Printf: @printf, @sprintf

###############################################################################
# Semidiscretization of the shallow water equations
#
# TODO: TrixiShallowWater: wet/dry example elixir


equations = ShallowWaterEquations2D(gravity_constant=9.812)
Expand Down
2 changes: 2 additions & 0 deletions examples/tree_1d_dgsem/elixir_shallowwater_beach.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ using Trixi

###############################################################################
# Semidiscretization of the shallow water equations
#
# TODO: TrixiShallowWater: wet/dry example elixir

equations = ShallowWaterEquations1D(gravity_constant=9.812)

Expand Down
2 changes: 2 additions & 0 deletions examples/tree_1d_dgsem/elixir_shallowwater_parabolic_bowl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ using Trixi

###############################################################################
# Semidiscretization of the shallow water equations
#
# TODO: TrixiShallowWater: wet/dry example elixir

equations = ShallowWaterEquations1D(gravity_constant=9.81)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ using Printf: @printf, @sprintf

###############################################################################
# Semidiscretization of the shallow water equations
#
# TODO: TrixiShallowWater: wet/dry example elixir

equations = ShallowWaterEquations1D(gravity_constant=9.812)

Expand Down
2 changes: 2 additions & 0 deletions examples/tree_2d_dgsem/elixir_shallowwater_conical_island.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ using Trixi

###############################################################################
# semidiscretization of the shallow water equations
#
# TODO: TrixiShallowWater: wet/dry example elixir

equations = ShallowWaterEquations2D(gravity_constant=9.81, H0=1.4)

Expand Down
2 changes: 2 additions & 0 deletions examples/tree_2d_dgsem/elixir_shallowwater_parabolic_bowl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ using Trixi

###############################################################################
# Semidiscretization of the shallow water equations
#
# TODO: TrixiShallowWater: wet/dry example elixir

equations = ShallowWaterEquations2D(gravity_constant=9.81)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ using Printf: @printf, @sprintf

###############################################################################
# Semidiscretization of the shallow water equations
#
# TODO: TrixiShallowWater: wet/dry example elixir

equations = ShallowWaterEquations2D(gravity_constant=9.812)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ using Trixi

###############################################################################
# semidiscretization of the shallow water equations
#
# TODO: TrixiShallowWater: wet/dry example elixir


equations = ShallowWaterEquations2D(gravity_constant=9.81, H0=1.875,
threshold_limiter=1e-12, threshold_wet=1e-14)
Expand Down
2 changes: 2 additions & 0 deletions src/Trixi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ export flux, flux_central, flux_lax_friedrichs, flux_hll, flux_hllc, flux_hlle,
flux_fjordholm_etal, flux_nonconservative_fjordholm_etal, flux_es_fjordholm_etal,
flux_wintermeyer_etal, flux_nonconservative_wintermeyer_etal,
hydrostatic_reconstruction_audusse_etal, flux_nonconservative_audusse_etal,
# TODO: TrixiShallowWater: move anything with "chen_noelle" to new file
hydrostatic_reconstruction_chen_noelle, flux_nonconservative_chen_noelle,
flux_hll_chen_noelle,
FluxPlusDissipation, DissipationGlobalLaxFriedrichs, DissipationLocalLaxFriedrichs,
Expand Down Expand Up @@ -217,6 +218,7 @@ export DG,
VolumeIntegralFluxDifferencing,
VolumeIntegralPureLGLFiniteVolume,
VolumeIntegralShockCapturingHG, IndicatorHennemannGassner,
# TODO: TrixiShallowWater: move new indicator
IndicatorHennemannGassnerShallowWater,
VolumeIntegralUpwind,
SurfaceIntegralWeakForm, SurfaceIntegralStrongForm,
Expand Down
1 change: 1 addition & 0 deletions src/callbacks_stage/callbacks_stage.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
#! format: noindent

include("positivity_zhang_shu.jl")
# TODO: TrixiShallowWater: move specific limiter file
include("positivity_shallow_water.jl")
end # @muladd
2 changes: 2 additions & 0 deletions src/callbacks_stage/positivity_shallow_water.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
@muladd begin
#! format: noindent

# TODO: TrixiShallowWater: generic wet/dry limiter

"""
PositivityPreservingLimiterShallowWater(; variables)
Expand Down
2 changes: 2 additions & 0 deletions src/callbacks_stage/positivity_shallow_water_dg1d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
@muladd begin
#! format: noindent

# TODO: TrixiShallowWater: 1D wet/dry limiter should move

function limiter_shallow_water!(u, threshold::Real, variable,
mesh::AbstractMesh{1},
equations::ShallowWaterEquations1D,
Expand Down
2 changes: 2 additions & 0 deletions src/callbacks_stage/positivity_shallow_water_dg2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
@muladd begin
#! format: noindent

# TODO: TrixiShallowWater: 2D wet/dry limiter should move

function limiter_shallow_water!(u, threshold::Real, variable,
mesh::AbstractMesh{2},
equations::ShallowWaterEquations2D, dg::DGSEM, cache)
Expand Down
2 changes: 2 additions & 0 deletions src/equations/numerical_fluxes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@ See [`FluxHLL`](@ref).
"""
const flux_hll = FluxHLL()

# TODO: TrixiShallowWater: move the chen_noelle flux structure to the new package

# An empty version of the `min_max_speed_chen_noelle` function is declared here
# in order to create a dimension agnostic version of `flux_hll_chen_noelle`.
# The full description of this wave speed estimate can be found in the docstrings
Expand Down
8 changes: 8 additions & 0 deletions src/equations/shallow_water_1d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ References for the SWE are many but a good introduction is available in Chapter
Finite Volume Methods for Hyperbolic Problems
[DOI: 10.1017/CBO9780511791253](https://doi.org/10.1017/CBO9780511791253)
"""
# TODO: TrixiShallowWater: where should the `threshold_limiter` and `threshold_wet` live?
# how to "properly" export these constants across the two packages?
struct ShallowWaterEquations1D{RealT <: Real} <: AbstractShallowWaterEquations{1, 3}
gravity::RealT # gravitational constant
H0::RealT # constant "lake-at-rest" total water height
Expand Down Expand Up @@ -347,6 +349,7 @@ Further details on the hydrostatic reconstruction and its motivation can be foun
A new hydrostatic reconstruction scheme based on subcell reconstructions
[DOI:10.1137/15M1053074](https://dx.doi.org/10.1137/15M1053074)
"""
# TODO: TrixiShallowWater: move wet/dry specific routine
@inline function flux_nonconservative_chen_noelle(u_ll, u_rr,
orientation::Integer,
equations::ShallowWaterEquations1D)
Expand Down Expand Up @@ -495,6 +498,7 @@ Further details on this hydrostatic reconstruction and its motivation can be fou
A new hydrostatic reconstruction scheme based on subcell reconstructions
[DOI:10.1137/15M1053074](https://dx.doi.org/10.1137/15M1053074)
"""
# TODO: TrixiShallowWater: move wet/dry specific routine
@inline function hydrostatic_reconstruction_chen_noelle(u_ll, u_rr,
equations::ShallowWaterEquations1D)
# Unpack left and right water heights and bottom topographies
Expand Down Expand Up @@ -617,6 +621,7 @@ Further details on this hydrostatic reconstruction and its motivation can be fou
A new hydrostatic reconstruction scheme based on subcell reconstructions
[DOI:10.1137/15M1053074](https://dx.doi.org/10.1137/15M1053074)
"""
# TODO: TrixiShallowWater: move wet/dry specific routine
@inline function min_max_speed_chen_noelle(u_ll, u_rr, orientation::Integer,
equations::ShallowWaterEquations1D)
# Get the velocity quantities
Expand Down Expand Up @@ -736,6 +741,9 @@ end
# Calculate the error for the "lake-at-rest" test case where H = h+b should
# be a constant value over time. Note, assumes there is a single reference
# water height `H0` with which to compare.
#
# TODO: TrixiShallowWater: where should `threshold_limiter` live? May need
# to modify or have different versions of the `lake_at_rest_error` function
@inline function lake_at_rest_error(u, equations::ShallowWaterEquations1D)
h, _, b = u

Expand Down
8 changes: 8 additions & 0 deletions src/equations/shallow_water_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ References for the SWE are many but a good introduction is available in Chapter
Finite Volume Methods for Hyperbolic Problems
[DOI: 10.1017/CBO9780511791253](https://doi.org/10.1017/CBO9780511791253)
"""
# TODO: TrixiShallowWater: where should the `threshold_limiter` and `threshold_wet` live?
# how to "properly" export these constants across the two packages?
struct ShallowWaterEquations2D{RealT <: Real} <: AbstractShallowWaterEquations{2, 4}
gravity::RealT # gravitational constant
H0::RealT # constant "lake-at-rest" total water height
Expand Down Expand Up @@ -469,6 +471,7 @@ Further details on this hydrostatic reconstruction and its motivation can be fou
A new hydrostatic reconstruction scheme based on subcell reconstructions
[DOI:10.1137/15M1053074](https://dx.doi.org/10.1137/15M1053074)
"""
# TODO: TrixiShallowWater: move wet/dry specific routine
@inline function hydrostatic_reconstruction_chen_noelle(u_ll, u_rr,
equations::ShallowWaterEquations2D)
# Unpack left and right water heights and bottom topographies
Expand Down Expand Up @@ -622,6 +625,7 @@ Further details on the hydrostatic reconstruction and its motivation can be foun
A new hydrostatic reconstruction scheme based on subcell reconstructions
[DOI:10.1137/15M1053074](https://dx.doi.org/10.1137/15M1053074)
"""
# TODO: TrixiShallowWater: move wet/dry specific routine
@inline function flux_nonconservative_chen_noelle(u_ll, u_rr, orientation::Integer,
equations::ShallowWaterEquations2D)
# Pull the water height and bottom topography on the left
Expand Down Expand Up @@ -962,6 +966,7 @@ the reference below. The definition of the wave speeds are given in Equation (2.
A new hydrostatic reconstruction scheme based on subcell reconstructions
[DOI:10.1137/15M1053074](https://dx.doi.org/10.1137/15M1053074)
"""
# TODO: TrixiShallowWater: move wet/dry specific routine
@inline function min_max_speed_chen_noelle(u_ll, u_rr, orientation::Integer,
equations::ShallowWaterEquations2D)
h_ll = waterheight(u_ll, equations)
Expand Down Expand Up @@ -1106,6 +1111,9 @@ end
# Calculate the error for the "lake-at-rest" test case where H = h+b should
# be a constant value over time. Note, assumes there is a single reference
# water height `H0` with which to compare.
#
# TODO: TrixiShallowWater: where should `threshold_limiter` live? May need
# to modify or have different versions of the `lake_at_rest_error` function
@inline function lake_at_rest_error(u, equations::ShallowWaterEquations2D)
h, _, _, b = u

Expand Down
2 changes: 2 additions & 0 deletions src/equations/shallow_water_two_layer_1d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
@muladd begin
#! format: noindent

# TODO: TrixiShallowWater: 1D two layer equations should move to new package

@doc raw"""
ShallowWaterTwoLayerEquations1D(gravity, H0, rho_upper, rho_lower)
Expand Down
Loading

0 comments on commit 8711313

Please sign in to comment.