diff --git a/Project.toml b/Project.toml index b912305b..1dcbc12e 100644 --- a/Project.toml +++ b/Project.toml @@ -19,5 +19,5 @@ Printf = "1" Roots = "2.1.6" Static = "1.1.1" StaticArrays = "1.9" -Trixi = "0.14" +Trixi = "0.15" julia = "1.10" diff --git a/docs/Project.toml b/docs/Project.toml index c6b2100e..01f6e37d 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -25,6 +25,6 @@ HOHQMesh = "0.2" Literate = "2.20" OrdinaryDiffEqLowStorageRK = "1.3" OrdinaryDiffEqSSPRK = "1.2" -Trixi = "0.14" +Trixi = "0.15" Trixi2Vtk = "0.3.16" TrixiBottomTopography = "0.1" \ No newline at end of file diff --git a/docs/src/tutorials/elixir_shallowwater_monai_tsunami.jl b/docs/src/tutorials/elixir_shallowwater_monai_tsunami.jl index d80ac5ee..0aec28bd 100644 --- a/docs/src/tutorials/elixir_shallowwater_monai_tsunami.jl +++ b/docs/src/tutorials/elixir_shallowwater_monai_tsunami.jl @@ -255,10 +255,10 @@ end; # are the default names provided by HOHQMesh. As per the problem definition, # three of the domain boundaries are walls and the incident wave maker boundary condition # implemented above is set at the `Left` domain -boundary_condition = Dict(:Bottom => boundary_condition_slip_wall, - :Top => boundary_condition_slip_wall, - :Right => boundary_condition_slip_wall, - :Left => boundary_condition_wave_maker); +boundary_condition = (; Bottom = boundary_condition_slip_wall, + Top = boundary_condition_slip_wall, + Right = boundary_condition_slip_wall, + Left = boundary_condition_wave_maker); # For this application, we also need to model the bottom friction. # Thus, we create a new source term, which adds a Manning friction term to the momentum equations. diff --git a/examples/dgmulti_1d/elixir_shallow_water_quasi_1d.jl b/examples/dgmulti_1d/elixir_shallow_water_quasi_1d.jl index caa006ba..57030ac5 100644 --- a/examples/dgmulti_1d/elixir_shallow_water_quasi_1d.jl +++ b/examples/dgmulti_1d/elixir_shallow_water_quasi_1d.jl @@ -16,7 +16,7 @@ volume_flux = (flux_chan_etal, flux_nonconservative_chan_etal) # In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`. # Thus, we exchanged in PR#2458 of Trixi.jl the default wave speed used in the LLF flux and dissipation operator to `max_abs_speed`. # To ensure that every example still runs we specify explicitly `DissipationLocalLaxFriedrichs(max_abs_speed_naive)`. -# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the +# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the # `StepsizeCallback` (CFL-Condition) and less diffusion. surface_flux = (FluxPlusDissipation(flux_chan_etal, DissipationLocalLaxFriedrichs(max_abs_speed_naive)), @@ -31,7 +31,8 @@ mesh = DGMultiMesh(dg, cells_per_dimension, coordinates_min = (0.0,), coordinates_max = (sqrt(2),), periodicity = true) semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, dg; - source_terms = source_terms_convergence_test) + source_terms = source_terms_convergence_test, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/dgmulti_2d/elixir_shallowwater_source_terms.jl b/examples/dgmulti_2d/elixir_shallowwater_source_terms.jl index 9c32a203..fb79e05f 100644 --- a/examples/dgmulti_2d/elixir_shallowwater_source_terms.jl +++ b/examples/dgmulti_2d/elixir_shallowwater_source_terms.jl @@ -15,7 +15,7 @@ volume_flux = (flux_wintermeyer_etal, flux_nonconservative_wintermeyer_etal) # In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`. # Thus, we exchanged in PR#2458 of Trixi.jl the default wave speed used in the LLF flux to `max_abs_speed`. # To ensure that every example still runs we specify explicitly `FluxLaxFriedrichs(max_abs_speed_naive)`. -# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the +# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the # `StepsizeCallback` (CFL-Condition) and less diffusion. surface_flux = (FluxLaxFriedrichs(max_abs_speed_naive), flux_nonconservative_fjordholm_etal) dg = DGMulti(polydeg = 3, element_type = Quad(), approximation_type = SBP(), @@ -28,7 +28,8 @@ mesh = DGMultiMesh(dg, cells_per_dimension, periodicity = true) semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, dg; - source_terms = source_terms_convergence_test) + source_terms = source_terms_convergence_test, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/p4est_2d_dgsem/elixir_shallowwater_multilayer_blast_wet_dry_sc_subcell.jl b/examples/p4est_2d_dgsem/elixir_shallowwater_multilayer_blast_wet_dry_sc_subcell.jl index 99b04ea4..1e110b31 100644 --- a/examples/p4est_2d_dgsem/elixir_shallowwater_multilayer_blast_wet_dry_sc_subcell.jl +++ b/examples/p4est_2d_dgsem/elixir_shallowwater_multilayer_blast_wet_dry_sc_subcell.jl @@ -4,7 +4,7 @@ using Trixi using TrixiShallowWater ############################################################################### -# Semidiscretization of the multilayer shallow water equations with a single layer and a bottom +# Semidiscretization of the multilayer shallow water equations with a single layer and a bottom # topography function for a blast wave test with a wet/dry front with discontinuous initial conditions. # This example combines the subcell limiter with a velocity desingularization callback to ensure # robustness at wet/dry fronts. @@ -36,10 +36,10 @@ end initial_condition = initial_condition_blast_wave -boundary_condition = Dict(:x_neg => boundary_condition_slip_wall, - :y_neg => boundary_condition_slip_wall, - :x_pos => boundary_condition_slip_wall, - :y_pos => boundary_condition_slip_wall) +boundary_condition = (; x_neg = boundary_condition_slip_wall, + y_neg = boundary_condition_slip_wall, + x_pos = boundary_condition_slip_wall, + y_pos = boundary_condition_slip_wall) ############################################################################### # Get the DG approximation space @@ -66,7 +66,7 @@ solver = DGSEM(basis, surface_flux, volume_integral) # Get the P4estMesh coordinates_min = (0.0, 0.0) # minimum coordinates (min(x), min(y)) -coordinates_max = (4.0, 4.0) # maximum coordinates (max(x), max(y)) +coordinates_max = (4.0, 4.0) # maximum coordinates (max(x), max(y)) trees_per_dimension = (1, 1) @@ -106,7 +106,7 @@ callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback, sav ############################################################################### -# Setup the stage callbacks +# Setup the stage callbacks stage_limiter! = VelocityDesingularization() stage_callbacks = (SubcellLimiterIDPCorrection(), stage_limiter!) diff --git a/examples/p4est_2d_dgsem/elixir_shallowwater_multilayer_convergence_sc_subcell.jl b/examples/p4est_2d_dgsem/elixir_shallowwater_multilayer_convergence_sc_subcell.jl index 5b1de0bf..30469f64 100644 --- a/examples/p4est_2d_dgsem/elixir_shallowwater_multilayer_convergence_sc_subcell.jl +++ b/examples/p4est_2d_dgsem/elixir_shallowwater_multilayer_convergence_sc_subcell.jl @@ -39,7 +39,8 @@ mesh = P4estMesh(trees_per_dimension, polydeg = 3, # create the semi discretization object semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, - source_terms = source_terms_convergence_test) + source_terms = source_terms_convergence_test, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/p4est_2d_dgsem/elixir_shallowwater_multilayer_monai_flood_amr.jl b/examples/p4est_2d_dgsem/elixir_shallowwater_multilayer_monai_flood_amr.jl index 3462d7ba..95d361bd 100644 --- a/examples/p4est_2d_dgsem/elixir_shallowwater_multilayer_monai_flood_amr.jl +++ b/examples/p4est_2d_dgsem/elixir_shallowwater_multilayer_monai_flood_amr.jl @@ -111,10 +111,10 @@ H_from_wave_maker(t::RealT) = spline_interpolation(h_spline_struct, t) return flux, noncons_flux end -boundary_condition = Dict(:Bottom => boundary_condition_slip_wall, - :Top => boundary_condition_slip_wall, - :Right => boundary_condition_slip_wall, - :Left => boundary_condition_wave_maker) +boundary_condition = (; Bottom = boundary_condition_slip_wall, + Top = boundary_condition_slip_wall, + Right = boundary_condition_slip_wall, + Left = boundary_condition_wave_maker) # Manning friction source term @inline function source_terms_manning_friction(u, x, t, @@ -147,7 +147,7 @@ volume_flux = (flux_ersing_etal, flux_nonconservative_ersing_etal) # In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`. # Thus, we exchanged in PR#2458 of Trixi.jl the default wave speed used in the LLF flux and dissipation operator to `max_abs_speed`. # To ensure that every example still runs we specify explicitly `DissipationLocalLaxFriedrichs(max_abs_speed_naive)`. -# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the +# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the # `StepsizeCallback` (CFL-Condition) and less diffusion. surface_flux = (FluxHydrostaticReconstruction(FluxPlusDissipation(flux_ersing_etal, DissipationLocalLaxFriedrichs(max_abs_speed_naive)), diff --git a/examples/p4est_2d_dgsem/elixir_shallowwater_multilayer_perturbation_wet_dry_amr.jl b/examples/p4est_2d_dgsem/elixir_shallowwater_multilayer_perturbation_wet_dry_amr.jl index 3bc77888..b7036622 100644 --- a/examples/p4est_2d_dgsem/elixir_shallowwater_multilayer_perturbation_wet_dry_amr.jl +++ b/examples/p4est_2d_dgsem/elixir_shallowwater_multilayer_perturbation_wet_dry_amr.jl @@ -48,7 +48,7 @@ end initial_condition = initial_condition_perturbation # Wall BCs -boundary_condition = Dict(:all => boundary_condition_slip_wall) +boundary_condition = (; all = boundary_condition_slip_wall) ############################################################################### # Get the DG approximation space @@ -60,7 +60,7 @@ volume_flux = (flux_ersing_etal, flux_nonconservative_ersing_etal) # In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`. # Thus, we exchanged in PR#2458 of Trixi.jl the default wave speed used in the LLF flux and dissipation operator to `max_abs_speed`. # To ensure that every example still runs we specify explicitly `DissipationLocalLaxFriedrichs(max_abs_speed_naive)`. -# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the +# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the # `StepsizeCallback` (CFL-Condition) and less diffusion. surface_flux = (FluxHydrostaticReconstruction(FluxPlusDissipation(flux_ersing_etal, DissipationLocalLaxFriedrichs(max_abs_speed_naive)), diff --git a/examples/p4est_2d_dgsem/elixir_shallowwater_multilayer_three_mound_dam_break_amr.jl b/examples/p4est_2d_dgsem/elixir_shallowwater_multilayer_three_mound_dam_break_amr.jl index 31461a72..69e2a303 100644 --- a/examples/p4est_2d_dgsem/elixir_shallowwater_multilayer_three_mound_dam_break_amr.jl +++ b/examples/p4est_2d_dgsem/elixir_shallowwater_multilayer_three_mound_dam_break_amr.jl @@ -80,10 +80,10 @@ function boundary_condition_outflow(u_inner, normal_direction::AbstractVector, x return flux, noncons_flux end -boundary_conditions = Dict(:Bottom => boundary_condition_slip_wall, - :Top => boundary_condition_slip_wall, - :Right => boundary_condition_outflow, - :Left => boundary_condition_slip_wall) +boundary_conditions = (; Bottom = boundary_condition_slip_wall, + Top = boundary_condition_slip_wall, + Right = boundary_condition_outflow, + Left = boundary_condition_slip_wall) ############################################################################### # Get the DG approximation space @@ -95,7 +95,7 @@ volume_flux = (flux_ersing_etal, flux_nonconservative_ersing_etal) # In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`. # Thus, we exchanged in PR#2458 of Trixi.jl the default wave speed used in the LLF flux and dissipation operator to `max_abs_speed`. # To ensure that every example still runs we specify explicitly `DissipationLocalLaxFriedrichs(max_abs_speed_naive)`. -# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the +# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the # `StepsizeCallback` (CFL-Condition) and less diffusion. surface_flux = (FluxHydrostaticReconstruction(FluxPlusDissipation(flux_ersing_etal, DissipationLocalLaxFriedrichs(max_abs_speed_naive)), diff --git a/examples/p4est_2d_dgsem/elixir_shallowwater_multilayer_well_balanced_wet_dry_nonconforming.jl b/examples/p4est_2d_dgsem/elixir_shallowwater_multilayer_well_balanced_wet_dry_nonconforming.jl index 5b655cfa..9708384f 100644 --- a/examples/p4est_2d_dgsem/elixir_shallowwater_multilayer_well_balanced_wet_dry_nonconforming.jl +++ b/examples/p4est_2d_dgsem/elixir_shallowwater_multilayer_well_balanced_wet_dry_nonconforming.jl @@ -50,7 +50,7 @@ end initial_condition = initial_condition_well_balancedness -boundary_condition = Dict(:all => boundary_condition_slip_wall) +boundary_condition = (; all = boundary_condition_slip_wall) ############################################################################### # Get the DG approximation space @@ -62,7 +62,7 @@ volume_flux = (flux_ersing_etal, flux_nonconservative_ersing_etal) # In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`. # Thus, we exchanged in PR#2458 of Trixi.jl the default wave speed used in the LLF flux and dissipation operator to `max_abs_speed`. # To ensure that every example still runs we specify explicitly `DissipationLocalLaxFriedrichs(max_abs_speed_naive)`. -# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the +# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the # `StepsizeCallback` (CFL-Condition) and less diffusion. surface_flux = (FluxHydrostaticReconstruction(FluxPlusDissipation(flux_ersing_etal, DissipationLocalLaxFriedrichs(max_abs_speed_naive)), diff --git a/examples/p4est_2d_dgsem/elixir_shallowwater_perturbation_amr.jl b/examples/p4est_2d_dgsem/elixir_shallowwater_perturbation_amr.jl index 3e5f34c7..16973d11 100644 --- a/examples/p4est_2d_dgsem/elixir_shallowwater_perturbation_amr.jl +++ b/examples/p4est_2d_dgsem/elixir_shallowwater_perturbation_amr.jl @@ -30,10 +30,10 @@ end initial_condition = initial_condition_perturbation -boundary_condition = Dict(:x_neg => boundary_condition_slip_wall, - :y_neg => boundary_condition_slip_wall, - :x_pos => boundary_condition_slip_wall, - :y_pos => boundary_condition_slip_wall) +boundary_condition = (; x_neg = boundary_condition_slip_wall, + y_neg = boundary_condition_slip_wall, + x_pos = boundary_condition_slip_wall, + y_pos = boundary_condition_slip_wall) ############################################################################### # Get the DG approximation space diff --git a/examples/p4est_2d_dgsem/elixir_shallowwater_perturbation_wet_dry_amr.jl b/examples/p4est_2d_dgsem/elixir_shallowwater_perturbation_wet_dry_amr.jl index 567d75da..ce42c14d 100644 --- a/examples/p4est_2d_dgsem/elixir_shallowwater_perturbation_wet_dry_amr.jl +++ b/examples/p4est_2d_dgsem/elixir_shallowwater_perturbation_wet_dry_amr.jl @@ -48,7 +48,7 @@ end initial_condition = initial_condition_perturbation # Wall BCs -boundary_condition = Dict(:all => boundary_condition_slip_wall) +boundary_condition = (; all = boundary_condition_slip_wall) ############################################################################### # Get the DG approximation space diff --git a/examples/p4est_2d_dgsem/elixir_shallowwater_source_terms.jl b/examples/p4est_2d_dgsem/elixir_shallowwater_source_terms.jl index cbb71417..be658b3c 100644 --- a/examples/p4est_2d_dgsem/elixir_shallowwater_source_terms.jl +++ b/examples/p4est_2d_dgsem/elixir_shallowwater_source_terms.jl @@ -17,7 +17,7 @@ initial_condition = initial_condition_convergence_test # MMS EOC test # In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`. # Thus, we exchanged in PR#2458 of Trixi.jl the default wave speed used in the LLF flux to `max_abs_speed`. # To ensure that every example still runs we specify explicitly `FluxLaxFriedrichs(max_abs_speed_naive)`. -# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the +# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the # `StepsizeCallback` (CFL-Condition) and less diffusion. surface_flux = (FluxLaxFriedrichs(max_abs_speed_naive), flux_nonconservative_fjordholm_etal) volume_flux = (flux_wintermeyer_etal, flux_nonconservative_wintermeyer_etal) @@ -35,11 +35,12 @@ coordinates_max = (sqrt(2.0), sqrt(2.0)) # maximum coordinates (max(x), max(y)) trees_per_dimension = (8, 8) mesh = P4estMesh(trees_per_dimension, polydeg = 3, coordinates_min = coordinates_min, coordinates_max = coordinates_max, - initial_refinement_level = 1) + initial_refinement_level = 1, periodicity = true) # A semidiscretization collects data structures and functions for the spatial discretization semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, - source_terms = source_terms_convergence_test) + source_terms = source_terms_convergence_test, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/p4est_2d_dgsem/elixir_shallowwater_well_balanced_nonconforming.jl b/examples/p4est_2d_dgsem/elixir_shallowwater_well_balanced_nonconforming.jl index 0ff127a3..6f84b44a 100644 --- a/examples/p4est_2d_dgsem/elixir_shallowwater_well_balanced_nonconforming.jl +++ b/examples/p4est_2d_dgsem/elixir_shallowwater_well_balanced_nonconforming.jl @@ -30,7 +30,7 @@ end initial_condition = initial_condition_well_balancedness -boundary_condition = Dict(:all => boundary_condition_slip_wall) +boundary_condition = (; all = boundary_condition_slip_wall) ############################################################################### # Get the DG approximation space diff --git a/examples/p4est_2d_dgsem/elixir_shallowwater_well_balanced_wet_dry_nonconforming.jl b/examples/p4est_2d_dgsem/elixir_shallowwater_well_balanced_wet_dry_nonconforming.jl index a50f5134..ced20ddc 100644 --- a/examples/p4est_2d_dgsem/elixir_shallowwater_well_balanced_wet_dry_nonconforming.jl +++ b/examples/p4est_2d_dgsem/elixir_shallowwater_well_balanced_wet_dry_nonconforming.jl @@ -37,7 +37,7 @@ end initial_condition = initial_condition_well_balancedness -boundary_condition = Dict(:all => boundary_condition_slip_wall) +boundary_condition = (; all = boundary_condition_slip_wall) ############################################################################### # Get the DG approximation space diff --git a/examples/structured_2d_dgsem/elixir_shallowwater_conical_island.jl b/examples/structured_2d_dgsem/elixir_shallowwater_conical_island.jl index 71d454e9..094e0388 100644 --- a/examples/structured_2d_dgsem/elixir_shallowwater_conical_island.jl +++ b/examples/structured_2d_dgsem/elixir_shallowwater_conical_island.jl @@ -75,10 +75,12 @@ coordinates_max = (1.0, 1.0) cells_per_dimension = (16, 16) -mesh = StructuredMesh(cells_per_dimension, coordinates_min, coordinates_max) +mesh = StructuredMesh(cells_per_dimension, coordinates_min, coordinates_max, + periodicity = true) # Create the semi discretization object -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver; + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solver diff --git a/examples/structured_2d_dgsem/elixir_shallowwater_parabolic_bowl.jl b/examples/structured_2d_dgsem/elixir_shallowwater_parabolic_bowl.jl index a7fb1cbf..e6e8a22f 100644 --- a/examples/structured_2d_dgsem/elixir_shallowwater_parabolic_bowl.jl +++ b/examples/structured_2d_dgsem/elixir_shallowwater_parabolic_bowl.jl @@ -80,10 +80,12 @@ coordinates_max = (2.0, 2.0) cells_per_dimension = (150, 150) -mesh = StructuredMesh(cells_per_dimension, coordinates_min, coordinates_max) +mesh = StructuredMesh(cells_per_dimension, coordinates_min, coordinates_max; + periodicity = true) # create the semi discretization object -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver; + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/structured_2d_dgsem/elixir_shallowwater_source_terms.jl b/examples/structured_2d_dgsem/elixir_shallowwater_source_terms.jl index b98953f4..6ac25939 100644 --- a/examples/structured_2d_dgsem/elixir_shallowwater_source_terms.jl +++ b/examples/structured_2d_dgsem/elixir_shallowwater_source_terms.jl @@ -15,7 +15,7 @@ initial_condition = initial_condition_convergence_test # In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`. # Thus, we exchanged in PR#2458 of Trixi.jl the default wave speed used in the LLF flux to `max_abs_speed`. # To ensure that every example still runs we specify explicitly `FluxLaxFriedrichs(max_abs_speed_naive)`. -# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the +# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the # `StepsizeCallback` (CFL-Condition) and less diffusion. surface_flux = (FluxLaxFriedrichs(max_abs_speed_naive), flux_nonconservative_fjordholm_etal) volume_flux = (flux_wintermeyer_etal, flux_nonconservative_wintermeyer_etal) @@ -28,10 +28,12 @@ coordinates_max = (sqrt(2.0), sqrt(2.0)) cells_per_dimension = (8, 8) -mesh = StructuredMesh(cells_per_dimension, coordinates_min, coordinates_max) +mesh = StructuredMesh(cells_per_dimension, coordinates_min, coordinates_max, + periodicity = true) semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, - source_terms = source_terms_convergence_test) + source_terms = source_terms_convergence_test, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/structured_2d_dgsem/elixir_shallowwater_well_balanced.jl b/examples/structured_2d_dgsem/elixir_shallowwater_well_balanced.jl index 373f9553..7bd184a9 100644 --- a/examples/structured_2d_dgsem/elixir_shallowwater_well_balanced.jl +++ b/examples/structured_2d_dgsem/elixir_shallowwater_well_balanced.jl @@ -35,7 +35,7 @@ volume_flux = (flux_wintermeyer_etal, flux_nonconservative_wintermeyer_etal) # In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`. # Thus, we exchanged in PR#2458 of Trixi.jl the default wave speed used in the LLF flux to `max_abs_speed`. # To ensure that every example still runs we specify explicitly `FluxLaxFriedrichs(max_abs_speed_naive)`. -# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the +# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the # `StepsizeCallback` (CFL-Condition) and less diffusion. surface_flux = (FluxHydrostaticReconstruction(FluxLaxFriedrichs(max_abs_speed_naive), hydrostatic_reconstruction_audusse_etal), @@ -51,10 +51,12 @@ coordinates_max = (2.0, 2.0) cells_per_dimension = (4, 4) -mesh = StructuredMesh(cells_per_dimension, coordinates_min, coordinates_max) +mesh = StructuredMesh(cells_per_dimension, coordinates_min, coordinates_max, + periodicity = true) # Create the semi discretization object -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver; + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solver diff --git a/examples/structured_2d_dgsem/elixir_shallowwater_well_balanced_wet_dry.jl b/examples/structured_2d_dgsem/elixir_shallowwater_well_balanced_wet_dry.jl index 980207cc..5e9fbd46 100644 --- a/examples/structured_2d_dgsem/elixir_shallowwater_well_balanced_wet_dry.jl +++ b/examples/structured_2d_dgsem/elixir_shallowwater_well_balanced_wet_dry.jl @@ -80,10 +80,12 @@ coordinates_max = (1.0, 1.0) cells_per_dimension = (16, 16) -mesh = StructuredMesh(cells_per_dimension, coordinates_min, coordinates_max) +mesh = StructuredMesh(cells_per_dimension, coordinates_min, coordinates_max, + periodicity = true) # create the semi discretization object -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver; + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/t8code_2d_dgsem/elixir_shallowwater_source_terms.jl b/examples/t8code_2d_dgsem/elixir_shallowwater_source_terms.jl index d476f894..72846c70 100644 --- a/examples/t8code_2d_dgsem/elixir_shallowwater_source_terms.jl +++ b/examples/t8code_2d_dgsem/elixir_shallowwater_source_terms.jl @@ -17,7 +17,7 @@ initial_condition = initial_condition_convergence_test # MMS EOC test # In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`. # Thus, we exchanged in PR#2458 of Trixi.jl the default wave speed used in the LLF flux to `max_abs_speed`. # To ensure that every example still runs we specify explicitly `FluxLaxFriedrichs(max_abs_speed_naive)`. -# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the +# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the # `StepsizeCallback` (CFL-Condition) and less diffusion. surface_flux = (FluxLaxFriedrichs(max_abs_speed_naive), flux_nonconservative_fjordholm_etal) volume_flux = (flux_wintermeyer_etal, flux_nonconservative_wintermeyer_etal) @@ -35,11 +35,12 @@ trees_per_dimension = (8, 8) mesh = T8codeMesh(trees_per_dimension, polydeg = 3, coordinates_min = coordinates_min, coordinates_max = coordinates_max, - initial_refinement_level = 1) + initial_refinement_level = 1, periodicity = true) # A semidiscretization collects data structures and functions for the spatial discretization -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, - source_terms = source_terms_convergence_test) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver; + source_terms = source_terms_convergence_test, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/tree_1d_dgsem/elixir_shallow_water_quasi_1d_source_terms.jl b/examples/tree_1d_dgsem/elixir_shallow_water_quasi_1d_source_terms.jl index d414757d..99e8aa57 100644 --- a/examples/tree_1d_dgsem/elixir_shallow_water_quasi_1d_source_terms.jl +++ b/examples/tree_1d_dgsem/elixir_shallow_water_quasi_1d_source_terms.jl @@ -19,7 +19,7 @@ volume_flux = (flux_chan_etal, flux_nonconservative_chan_etal) # In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`. # Thus, we exchanged in PR#2458 of Trixi.jl the default wave speed used in the LLF flux and dissipation operator to `max_abs_speed`. # To ensure that every example still runs we specify explicitly `DissipationLocalLaxFriedrichs(max_abs_speed_naive)`. -# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the +# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the # `StepsizeCallback` (CFL-Condition) and less diffusion. surface_flux = (FluxPlusDissipation(flux_chan_etal, DissipationLocalLaxFriedrichs(max_abs_speed_naive)), @@ -39,7 +39,8 @@ mesh = TreeMesh(coordinates_min, coordinates_max, # create the semi discretization object semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, - source_terms = source_terms_convergence_test) + source_terms = source_terms_convergence_test, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/tree_1d_dgsem/elixir_shallowwater_ec.jl b/examples/tree_1d_dgsem/elixir_shallowwater_ec.jl index 17f11154..ceef051e 100644 --- a/examples/tree_1d_dgsem/elixir_shallowwater_ec.jl +++ b/examples/tree_1d_dgsem/elixir_shallowwater_ec.jl @@ -54,10 +54,12 @@ coordinates_min = -1.0 coordinates_max = 1.0 mesh = TreeMesh(coordinates_min, coordinates_max, initial_refinement_level = 4, - n_cells_max = 10_000) + n_cells_max = 10_000, + periodicity = true) # Create the semi discretization object -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver; + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solver diff --git a/examples/tree_1d_dgsem/elixir_shallowwater_exner_channel.jl b/examples/tree_1d_dgsem/elixir_shallowwater_exner_channel.jl index 6a999fb1..bb4ee185 100644 --- a/examples/tree_1d_dgsem/elixir_shallowwater_exner_channel.jl +++ b/examples/tree_1d_dgsem/elixir_shallowwater_exner_channel.jl @@ -80,7 +80,8 @@ mesh = TreeMesh(coordinates_min, coordinates_max, periodicity = true) # Create the semi discretization object -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solver diff --git a/examples/tree_1d_dgsem/elixir_shallowwater_exner_dam_break_symmetric.jl b/examples/tree_1d_dgsem/elixir_shallowwater_exner_dam_break_symmetric.jl index 40fce585..8d8a6f40 100644 --- a/examples/tree_1d_dgsem/elixir_shallowwater_exner_dam_break_symmetric.jl +++ b/examples/tree_1d_dgsem/elixir_shallowwater_exner_dam_break_symmetric.jl @@ -65,7 +65,8 @@ mesh = TreeMesh(coordinates_min, coordinates_max, periodicity = true) # Create the semi discretization object -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver; + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solver diff --git a/examples/tree_1d_dgsem/elixir_shallowwater_exner_source_terms_grass.jl b/examples/tree_1d_dgsem/elixir_shallowwater_exner_source_terms_grass.jl index c6a77394..baf3110c 100644 --- a/examples/tree_1d_dgsem/elixir_shallowwater_exner_source_terms_grass.jl +++ b/examples/tree_1d_dgsem/elixir_shallowwater_exner_source_terms_grass.jl @@ -35,7 +35,8 @@ mesh = TreeMesh(coordinates_min, coordinates_max, # create the semi discretization object semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, - source_terms = source_terms_convergence_test) + source_terms = source_terms_convergence_test, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/tree_1d_dgsem/elixir_shallowwater_exner_source_terms_mpm.jl b/examples/tree_1d_dgsem/elixir_shallowwater_exner_source_terms_mpm.jl index 87247cab..c553fe26 100644 --- a/examples/tree_1d_dgsem/elixir_shallowwater_exner_source_terms_mpm.jl +++ b/examples/tree_1d_dgsem/elixir_shallowwater_exner_source_terms_mpm.jl @@ -36,7 +36,8 @@ mesh = TreeMesh(coordinates_min, coordinates_max, # create the semi discretization object semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, - source_terms = source_terms_convergence_test) + source_terms = source_terms_convergence_test, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/tree_1d_dgsem/elixir_shallowwater_moving_water_shock.jl b/examples/tree_1d_dgsem/elixir_shallowwater_moving_water_shock.jl index fb322842..d03957d1 100644 --- a/examples/tree_1d_dgsem/elixir_shallowwater_moving_water_shock.jl +++ b/examples/tree_1d_dgsem/elixir_shallowwater_moving_water_shock.jl @@ -5,7 +5,7 @@ using TrixiShallowWater using Roots ############################################################################### -# semidiscretization of the shallow water equations for a transonic moving water +# semidiscretization of the shallow water equations for a transonic moving water # steady-state with a standing shock. equations = ShallowWaterEquations1D(gravity = 9.812, H0 = 3.25) @@ -14,7 +14,7 @@ equations = ShallowWaterEquations1D(gravity = 9.812, H0 = 3.25) inverse_transform(E, hv, sigma, b) Inverse transformation from equilibrium variables (E, hv) to conservative variables (h, hv). Besides the -equilibrium variables, which are the total energy `E` and momentum `hv`, the function also depends +equilibrium variables, which are the total energy `E` and momentum `hv`, the function also depends on the bottom topography `b` and the flow regime `sigma` (supersonic = 1 , sonic = 0 or subsonic = -1). The implementation follows the procedure described in Section 2.1 of the paper: @@ -61,7 +61,7 @@ end """ initial_condition_moving_water_transonic(x, t, equations::ShallowWaterEquations1D) -Set the initial condition for a transonic moving water steady-state and a quadratic bottom +Set the initial condition for a transonic moving water steady-state and a quadratic bottom topography, to test the well-balancedness of the scheme. The test parameters are taken from Section 4.1 of the paper: @@ -112,7 +112,7 @@ initial_condition = initial_condition_moving_water_shock boundary_condition_inflow = BoundaryConditionMomentum(0.18, equations) boundary_condition_outflow = BoundaryConditionDirichlet(initial_condition_moving_water_shock) -boundary_conditions = (x_neg = boundary_condition_inflow, +boundary_conditions = (; x_neg = boundary_condition_inflow, x_pos = boundary_condition_outflow) ############################################################################### @@ -124,7 +124,7 @@ volume_flux = (flux_wintermeyer_etal, flux_nonconservative_wintermeyer_etal) # In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`. # Thus, we exchanged in PR#2458 of Trixi.jl the default wave speed used in the LLF flux and dissipation operator to `max_abs_speed`. # To ensure that every example still runs we specify explicitly `DissipationLocalLaxFriedrichs(max_abs_speed_naive)`. -# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the +# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the # `StepsizeCallback` (CFL-Condition) and less diffusion. surface_flux = (FluxPlusDissipation(flux_wintermeyer_etal, DissipationLocalLaxFriedrichs(max_abs_speed_naive)), diff --git a/examples/tree_1d_dgsem/elixir_shallowwater_moving_water_subsonic.jl b/examples/tree_1d_dgsem/elixir_shallowwater_moving_water_subsonic.jl index 816cb82a..7c757711 100644 --- a/examples/tree_1d_dgsem/elixir_shallowwater_moving_water_subsonic.jl +++ b/examples/tree_1d_dgsem/elixir_shallowwater_moving_water_subsonic.jl @@ -12,7 +12,7 @@ equations = ShallowWaterEquations1D(gravity = 9.812, H0 = 3.25) inverse_transform(E, hv, sigma, b) Inverse transformation from equilibrium variables (E, hv) to conservative variables (h, hv). Besides the -equilibrium variables, which are the total energy `E` and momentum `hv`, the function also depends +equilibrium variables, which are the total energy `E` and momentum `hv`, the function also depends on the bottom topography `b` and the flow regime `sigma` (supersonic = 1 , sonic = 0 or subsonic = -1). The implementation follows the procedure described in Section 2.1 of the paper: @@ -94,7 +94,7 @@ initial_condition = initial_condition_moving_water_subsonic boundary_condition_inflow = BoundaryConditionMomentum(4.42, equations) boundary_condition_outflow = BoundaryConditionWaterHeight(2.0, equations) -boundary_conditions = (x_neg = boundary_condition_inflow, +boundary_conditions = (; x_neg = boundary_condition_inflow, x_pos = boundary_condition_outflow) ############################################################################### diff --git a/examples/tree_1d_dgsem/elixir_shallowwater_moving_water_transonic.jl b/examples/tree_1d_dgsem/elixir_shallowwater_moving_water_transonic.jl index 4cb1c230..de0977f4 100644 --- a/examples/tree_1d_dgsem/elixir_shallowwater_moving_water_transonic.jl +++ b/examples/tree_1d_dgsem/elixir_shallowwater_moving_water_transonic.jl @@ -13,7 +13,7 @@ equations = ShallowWaterEquations1D(gravity = 9.812, H0 = 3.25) inverse_transform(E, hv, sigma, b) Inverse transformation from equilibrium variables (E, hv) to conservative variables (h, hv). Besides the -equilibrium variables, which are the total energy `E` and momentum `hv`, the function also depends +equilibrium variables, which are the total energy `E` and momentum `hv`, the function also depends on the bottom topography `b` and the flow regime `sigma` (supersonic = 1 , sonic = 0 or subsonic = -1). The implementation follows the procedure described in Section 2.1 of the paper: @@ -61,7 +61,7 @@ end """ initial_condition_moving_water_transonic(x, t, equations::ShallowWaterEquations1D) -Set the initial condition for a smooth transonic moving water steady-state and a quadratic bottom +Set the initial condition for a smooth transonic moving water steady-state and a quadratic bottom topography, to test the well-balancedness of the scheme. The test parameters are taken from Section 5 of the paper: @@ -105,7 +105,7 @@ initial_condition = initial_condition_moving_water_transonic boundary_condition_inflow = BoundaryConditionMomentum(1.53, equations) boundary_condition_outflow = BoundaryConditionDirichlet(initial_condition_moving_water_transonic) -boundary_conditions = (x_neg = boundary_condition_inflow, +boundary_conditions = (; x_neg = boundary_condition_inflow, x_pos = boundary_condition_outflow) ############################################################################### diff --git a/examples/tree_1d_dgsem/elixir_shallowwater_multilayer_convergence.jl b/examples/tree_1d_dgsem/elixir_shallowwater_multilayer_convergence.jl index 051e15f0..7739b8bd 100644 --- a/examples/tree_1d_dgsem/elixir_shallowwater_multilayer_convergence.jl +++ b/examples/tree_1d_dgsem/elixir_shallowwater_multilayer_convergence.jl @@ -31,7 +31,8 @@ mesh = TreeMesh(coordinates_min, coordinates_max, # create the semi discretization object semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, - source_terms = source_terms_convergence_test) + source_terms = source_terms_convergence_test, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/tree_1d_dgsem/elixir_shallowwater_multilayer_parabolic_bowl.jl b/examples/tree_1d_dgsem/elixir_shallowwater_multilayer_parabolic_bowl.jl index a59b1c2d..7a2016a8 100644 --- a/examples/tree_1d_dgsem/elixir_shallowwater_multilayer_parabolic_bowl.jl +++ b/examples/tree_1d_dgsem/elixir_shallowwater_multilayer_parabolic_bowl.jl @@ -64,7 +64,7 @@ volume_flux = (flux_ersing_etal, flux_nonconservative_ersing_etal) # In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`. # Thus, we exchanged in PR#2458 of Trixi.jl the default wave speed used in the LLF flux and dissipation operator to `max_abs_speed`. # To ensure that every example still runs we specify explicitly `DissipationLocalLaxFriedrichs(max_abs_speed_naive)`. -# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the +# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the # `StepsizeCallback` (CFL-Condition) and less diffusion. surface_flux = (FluxHydrostaticReconstruction(FluxPlusDissipation(flux_ersing_etal, DissipationLocalLaxFriedrichs(max_abs_speed_naive)), @@ -93,10 +93,12 @@ coordinates_max = 2.0 mesh = TreeMesh(coordinates_min, coordinates_max, initial_refinement_level = 6, - n_cells_max = 10_000) + n_cells_max = 10_000, + periodicity = true) # create the semi discretization object -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/tree_1d_dgsem/elixir_shallowwater_multilayer_well_balanced.jl b/examples/tree_1d_dgsem/elixir_shallowwater_multilayer_well_balanced.jl index 360195ac..a80c09cd 100644 --- a/examples/tree_1d_dgsem/elixir_shallowwater_multilayer_well_balanced.jl +++ b/examples/tree_1d_dgsem/elixir_shallowwater_multilayer_well_balanced.jl @@ -51,7 +51,8 @@ mesh = TreeMesh(coordinates_min, coordinates_max, periodicity = true) # create the semi discretization object -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/tree_1d_dgsem/elixir_shallowwater_multilayer_well_balanced_wet_dry.jl b/examples/tree_1d_dgsem/elixir_shallowwater_multilayer_well_balanced_wet_dry.jl index 2333c532..5283b6bc 100644 --- a/examples/tree_1d_dgsem/elixir_shallowwater_multilayer_well_balanced_wet_dry.jl +++ b/examples/tree_1d_dgsem/elixir_shallowwater_multilayer_well_balanced_wet_dry.jl @@ -108,7 +108,7 @@ volume_flux = (flux_ersing_etal, flux_nonconservative_ersing_etal) # In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`. # Thus, we exchanged in PR#2458 of Trixi.jl the default wave speed used in the LLF flux and dissipation operator to `max_abs_speed`. # To ensure that every example still runs we specify explicitly `DissipationLocalLaxFriedrichs(max_abs_speed_naive)`. -# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the +# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the # `StepsizeCallback` (CFL-Condition) and less diffusion. surface_flux = (FluxHydrostaticReconstruction(FluxPlusDissipation(flux_ersing_etal, DissipationLocalLaxFriedrichs(max_abs_speed_naive)), @@ -139,7 +139,8 @@ mesh = TreeMesh(coordinates_min, coordinates_max, periodicity = true) # create the semi discretization object -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/tree_1d_dgsem/elixir_shallowwater_parabolic_bowl.jl b/examples/tree_1d_dgsem/elixir_shallowwater_parabolic_bowl.jl index 1ebb71c7..3b0311b9 100644 --- a/examples/tree_1d_dgsem/elixir_shallowwater_parabolic_bowl.jl +++ b/examples/tree_1d_dgsem/elixir_shallowwater_parabolic_bowl.jl @@ -80,10 +80,12 @@ coordinates_max = 2.0 mesh = TreeMesh(coordinates_min, coordinates_max, initial_refinement_level = 6, - n_cells_max = 10_000) + n_cells_max = 10_000, + periodicity = true) # create the semi discretization object -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/tree_1d_dgsem/elixir_shallowwater_quasi_1d_discontinuous.jl b/examples/tree_1d_dgsem/elixir_shallowwater_quasi_1d_discontinuous.jl index e0086ddf..10fffbe6 100644 --- a/examples/tree_1d_dgsem/elixir_shallowwater_quasi_1d_discontinuous.jl +++ b/examples/tree_1d_dgsem/elixir_shallowwater_quasi_1d_discontinuous.jl @@ -35,7 +35,7 @@ volume_flux = (flux_chan_etal, flux_nonconservative_chan_etal) # In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`. # Thus, we exchanged in PR#2458 of Trixi.jl the default wave speed used in the LLF flux to `max_abs_speed`. # To ensure that every example still runs we specify explicitly `FluxLaxFriedrichs(max_abs_speed_naive)`. -# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the +# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the # `StepsizeCallback` (CFL-Condition) and less diffusion. surface_flux = (FluxLaxFriedrichs(max_abs_speed_naive), flux_nonconservative_chan_etal) solver = DGSEM(polydeg = 3, surface_flux = surface_flux, @@ -52,7 +52,8 @@ mesh = TreeMesh(coordinates_min, coordinates_max, periodicity = true) # create the semi discretization object -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/tree_1d_dgsem/elixir_shallowwater_quasi_1d_well_balanced.jl b/examples/tree_1d_dgsem/elixir_shallowwater_quasi_1d_well_balanced.jl index d6bf752e..c85a53ef 100644 --- a/examples/tree_1d_dgsem/elixir_shallowwater_quasi_1d_well_balanced.jl +++ b/examples/tree_1d_dgsem/elixir_shallowwater_quasi_1d_well_balanced.jl @@ -45,10 +45,12 @@ coordinates_min = -1.0 coordinates_max = 1.0 mesh = TreeMesh(coordinates_min, coordinates_max, initial_refinement_level = 3, - n_cells_max = 10_000) + n_cells_max = 10_000, + periodicity = true) # Create the semi discretization object -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solver diff --git a/examples/tree_1d_dgsem/elixir_shallowwater_source_terms.jl b/examples/tree_1d_dgsem/elixir_shallowwater_source_terms.jl index e9130975..725aea6f 100644 --- a/examples/tree_1d_dgsem/elixir_shallowwater_source_terms.jl +++ b/examples/tree_1d_dgsem/elixir_shallowwater_source_terms.jl @@ -18,7 +18,7 @@ initial_condition = initial_condition_convergence_test # In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`. # Thus, we exchanged in PR#2458 of Trixi.jl the default wave speed used in the LLF flux to `max_abs_speed`. # To ensure that every example still runs we specify explicitly `FluxLaxFriedrichs(max_abs_speed_naive)`. -# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the +# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the # `StepsizeCallback` (CFL-Condition) and less diffusion. surface_flux = (FluxLaxFriedrichs(max_abs_speed_naive), flux_nonconservative_fjordholm_etal) volume_flux = (flux_wintermeyer_etal, flux_nonconservative_wintermeyer_etal) @@ -38,7 +38,8 @@ mesh = TreeMesh(coordinates_min, coordinates_max, # create the semi discretization object semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, - source_terms = source_terms_convergence_test) + source_terms = source_terms_convergence_test, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/tree_1d_dgsem/elixir_shallowwater_twolayer_convergence.jl b/examples/tree_1d_dgsem/elixir_shallowwater_twolayer_convergence.jl index 64937f92..a1171496 100644 --- a/examples/tree_1d_dgsem/elixir_shallowwater_twolayer_convergence.jl +++ b/examples/tree_1d_dgsem/elixir_shallowwater_twolayer_convergence.jl @@ -31,7 +31,8 @@ mesh = TreeMesh(coordinates_min, coordinates_max, # create the semi discretization object semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, - source_terms = source_terms_convergence_test) + source_terms = source_terms_convergence_test, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/tree_1d_dgsem/elixir_shallowwater_twolayer_well_balanced.jl b/examples/tree_1d_dgsem/elixir_shallowwater_twolayer_well_balanced.jl index e7abc9cc..9823e3ef 100644 --- a/examples/tree_1d_dgsem/elixir_shallowwater_twolayer_well_balanced.jl +++ b/examples/tree_1d_dgsem/elixir_shallowwater_twolayer_well_balanced.jl @@ -52,7 +52,8 @@ mesh = TreeMesh(coordinates_min, coordinates_max, periodicity = true) # create the semi discretization object -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/tree_1d_dgsem/elixir_shallowwater_well_balanced.jl b/examples/tree_1d_dgsem/elixir_shallowwater_well_balanced.jl index f819306a..766f89fc 100644 --- a/examples/tree_1d_dgsem/elixir_shallowwater_well_balanced.jl +++ b/examples/tree_1d_dgsem/elixir_shallowwater_well_balanced.jl @@ -48,10 +48,12 @@ coordinates_min = -1.0 coordinates_max = 1.0 mesh = TreeMesh(coordinates_min, coordinates_max, initial_refinement_level = 3, - n_cells_max = 10_000) + n_cells_max = 10_000, + periodicity = true) # Create the semi discretization object -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solver diff --git a/examples/tree_1d_dgsem/elixir_shallowwater_well_balanced_wet_dry.jl b/examples/tree_1d_dgsem/elixir_shallowwater_well_balanced_wet_dry.jl index 2b025eda..bdcda291 100644 --- a/examples/tree_1d_dgsem/elixir_shallowwater_well_balanced_wet_dry.jl +++ b/examples/tree_1d_dgsem/elixir_shallowwater_well_balanced_wet_dry.jl @@ -78,10 +78,12 @@ coordinates_max = 1.0 mesh = TreeMesh(coordinates_min, coordinates_max, initial_refinement_level = 6, - n_cells_max = 10_000) + n_cells_max = 10_000, + periodicity = true) # create the semi discretization object -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/tree_2d_dgsem/elixir_shallowwater_ec.jl b/examples/tree_2d_dgsem/elixir_shallowwater_ec.jl index 44762de1..5d5be01e 100644 --- a/examples/tree_2d_dgsem/elixir_shallowwater_ec.jl +++ b/examples/tree_2d_dgsem/elixir_shallowwater_ec.jl @@ -28,10 +28,12 @@ coordinates_min = (-1.0, -1.0) coordinates_max = (1.0, 1.0) mesh = TreeMesh(coordinates_min, coordinates_max, initial_refinement_level = 2, - n_cells_max = 10_000) + n_cells_max = 10_000, + periodicity = true) # Create the semi discretization object -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solver diff --git a/examples/tree_2d_dgsem/elixir_shallowwater_inflow_outflow.jl b/examples/tree_2d_dgsem/elixir_shallowwater_inflow_outflow.jl index 3ab56de5..2f0dc024 100644 --- a/examples/tree_2d_dgsem/elixir_shallowwater_inflow_outflow.jl +++ b/examples/tree_2d_dgsem/elixir_shallowwater_inflow_outflow.jl @@ -29,7 +29,7 @@ boundary_condition_inflow = BoundaryConditionMomentum(t -> -0.1 + 0.05 * t, equations) boundary_condition_outflow = BoundaryConditionWaterHeight(t -> 1.0 + 0.1 * cos(π / 2 * t), equations) -boundary_conditions = (x_neg = boundary_condition_inflow, +boundary_conditions = (; x_neg = boundary_condition_inflow, x_pos = boundary_condition_outflow, y_neg = boundary_condition_inflow, y_pos = boundary_condition_outflow) @@ -43,7 +43,7 @@ volume_flux = (flux_wintermeyer_etal, flux_nonconservative_wintermeyer_etal) # In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`. # Thus, we exchanged in PR#2458 of Trixi.jl the default wave speed used in the LLF flux and dissipation operator to `max_abs_speed`. # To ensure that every example still runs we specify explicitly `DissipationLocalLaxFriedrichs(max_abs_speed_naive)`. -# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the +# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the # `StepsizeCallback` (CFL-Condition) and less diffusion. surface_flux = (FluxPlusDissipation(flux_wintermeyer_etal, DissipationLocalLaxFriedrichs(max_abs_speed_naive)), diff --git a/examples/tree_2d_dgsem/elixir_shallowwater_multilayer_convergence.jl b/examples/tree_2d_dgsem/elixir_shallowwater_multilayer_convergence.jl index 8baf72fa..5c8c4eb4 100644 --- a/examples/tree_2d_dgsem/elixir_shallowwater_multilayer_convergence.jl +++ b/examples/tree_2d_dgsem/elixir_shallowwater_multilayer_convergence.jl @@ -31,7 +31,8 @@ mesh = TreeMesh(coordinates_min, coordinates_max, # create the semi discretization object semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, - source_terms = source_terms_convergence_test) + source_terms = source_terms_convergence_test, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/tree_2d_dgsem/elixir_shallowwater_multilayer_convergence_sc_subcell.jl b/examples/tree_2d_dgsem/elixir_shallowwater_multilayer_convergence_sc_subcell.jl index 5e232463..1dc503a9 100644 --- a/examples/tree_2d_dgsem/elixir_shallowwater_multilayer_convergence_sc_subcell.jl +++ b/examples/tree_2d_dgsem/elixir_shallowwater_multilayer_convergence_sc_subcell.jl @@ -38,7 +38,8 @@ mesh = TreeMesh(coordinates_min, coordinates_max, # create the semi discretization object semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, - source_terms = source_terms_convergence_test) + source_terms = source_terms_convergence_test, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/tree_2d_dgsem/elixir_shallowwater_multilayer_well_balanced.jl b/examples/tree_2d_dgsem/elixir_shallowwater_multilayer_well_balanced.jl index f3c3b525..de1a9d38 100644 --- a/examples/tree_2d_dgsem/elixir_shallowwater_multilayer_well_balanced.jl +++ b/examples/tree_2d_dgsem/elixir_shallowwater_multilayer_well_balanced.jl @@ -45,7 +45,8 @@ mesh = TreeMesh(coordinates_min, coordinates_max, periodicity = true) # Create the semi discretization object -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solver diff --git a/examples/tree_2d_dgsem/elixir_shallowwater_multilayer_well_balanced_wet_dry_sc_subcell.jl b/examples/tree_2d_dgsem/elixir_shallowwater_multilayer_well_balanced_wet_dry_sc_subcell.jl index b13418f5..294f10e4 100644 --- a/examples/tree_2d_dgsem/elixir_shallowwater_multilayer_well_balanced_wet_dry_sc_subcell.jl +++ b/examples/tree_2d_dgsem/elixir_shallowwater_multilayer_well_balanced_wet_dry_sc_subcell.jl @@ -7,9 +7,9 @@ using Printf: @printf, @sprintf ############################################################################### # Semidiscretization of the multilayer shallow water equations with a bottom topography function # to test well-balancedness. -# Note! When using subcell limiting with a non-conservative equation, well-balancedness is only -# guaranteed for non-conservative terms in the form local * jump that vanish in the equilibrium -# state. In this particular case, `flux_nonconservative_ersing_etal_local_jump` provides +# Note! When using subcell limiting with a non-conservative equation, well-balancedness is only +# guaranteed for non-conservative terms in the form local * jump that vanish in the equilibrium +# state. In this particular case, `flux_nonconservative_ersing_etal_local_jump` provides # well-balancedness for a single-layer equation. equations = ShallowWaterMultiLayerEquations2D(gravity = 9.81, rhos = (1.0)) @@ -18,7 +18,7 @@ equations = ShallowWaterMultiLayerEquations2D(gravity = 9.81, rhos = (1.0)) initial_condition_well_balanced_chen_noelle(x, t, equations:: ShallowWaterMultiLayerEquations2D) Initial condition with a complex (discontinuous) bottom topography to test the well-balanced -property including dry areas within the domain. The errors from the analysis callback are not +property including dry areas within the domain. The errors from the analysis callback are not important but the error for this lake-at-rest test case `∑|H0-(h+b)|` should be around machine roundoff. The initial condition is taken from Section 5.2 of the paper: @@ -85,7 +85,8 @@ mesh = TreeMesh(coordinates_min, coordinates_max, periodicity = true) # Create the semi discretization object -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solver @@ -141,7 +142,7 @@ callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback, sav stepsize_callback) ############################################################################### -# Setup the stage callbacks +# Setup the stage callbacks stage_limiter! = VelocityDesingularization() stage_callbacks = (SubcellLimiterIDPCorrection(), stage_limiter!) diff --git a/examples/tree_2d_dgsem/elixir_shallowwater_parabolic_bowl.jl b/examples/tree_2d_dgsem/elixir_shallowwater_parabolic_bowl.jl index 62b9a9c7..f182d3c5 100644 --- a/examples/tree_2d_dgsem/elixir_shallowwater_parabolic_bowl.jl +++ b/examples/tree_2d_dgsem/elixir_shallowwater_parabolic_bowl.jl @@ -81,10 +81,12 @@ coordinates_max = (2.0, 2.0) mesh = TreeMesh(coordinates_min, coordinates_max, initial_refinement_level = 5, - n_cells_max = 10_000) + n_cells_max = 10_000, + periodicity = true) # create the semi discretization object -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/tree_2d_dgsem/elixir_shallowwater_source_terms.jl b/examples/tree_2d_dgsem/elixir_shallowwater_source_terms.jl index aaa1aa04..0436803a 100644 --- a/examples/tree_2d_dgsem/elixir_shallowwater_source_terms.jl +++ b/examples/tree_2d_dgsem/elixir_shallowwater_source_terms.jl @@ -18,7 +18,7 @@ initial_condition = initial_condition_convergence_test # MMS EOC test # In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`. # Thus, we exchanged in PR#2458 of Trixi.jl the default wave speed used in the LLF flux to `max_abs_speed`. # To ensure that every example still runs we specify explicitly `FluxLaxFriedrichs(max_abs_speed_naive)`. -# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the +# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the # `StepsizeCallback` (CFL-Condition) and less diffusion. surface_flux = (FluxLaxFriedrichs(max_abs_speed_naive), flux_nonconservative_fjordholm_etal) volume_flux = (flux_wintermeyer_etal, flux_nonconservative_wintermeyer_etal) @@ -38,7 +38,8 @@ mesh = TreeMesh(coordinates_min, coordinates_max, # create the semi discretization object semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, - source_terms = source_terms_convergence_test) + source_terms = source_terms_convergence_test, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/tree_2d_dgsem/elixir_shallowwater_twolayer_convergence.jl b/examples/tree_2d_dgsem/elixir_shallowwater_twolayer_convergence.jl index 51a25805..2465e563 100644 --- a/examples/tree_2d_dgsem/elixir_shallowwater_twolayer_convergence.jl +++ b/examples/tree_2d_dgsem/elixir_shallowwater_twolayer_convergence.jl @@ -31,7 +31,8 @@ mesh = TreeMesh(coordinates_min, coordinates_max, # Create the semi discretization object semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, - source_terms = source_terms_convergence_test) + source_terms = source_terms_convergence_test, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/tree_2d_dgsem/elixir_shallowwater_twolayer_well_balanced.jl b/examples/tree_2d_dgsem/elixir_shallowwater_twolayer_well_balanced.jl index 3b63fc81..9ed1be00 100644 --- a/examples/tree_2d_dgsem/elixir_shallowwater_twolayer_well_balanced.jl +++ b/examples/tree_2d_dgsem/elixir_shallowwater_twolayer_well_balanced.jl @@ -48,7 +48,8 @@ mesh = TreeMesh(coordinates_min, coordinates_max, periodicity = true) # Create the semi discretization object -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solver diff --git a/examples/tree_2d_dgsem/elixir_shallowwater_well_balanced.jl b/examples/tree_2d_dgsem/elixir_shallowwater_well_balanced.jl index bd0f5a83..a03320a7 100644 --- a/examples/tree_2d_dgsem/elixir_shallowwater_well_balanced.jl +++ b/examples/tree_2d_dgsem/elixir_shallowwater_well_balanced.jl @@ -41,10 +41,12 @@ coordinates_min = (-1.0, -1.0) coordinates_max = (1.0, 1.0) mesh = TreeMesh(coordinates_min, coordinates_max, initial_refinement_level = 2, - n_cells_max = 10_000) + n_cells_max = 10_000, + periodicity = true) # Create the semi discretization object -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solver diff --git a/examples/tree_2d_dgsem/elixir_shallowwater_well_balanced_wet_dry.jl b/examples/tree_2d_dgsem/elixir_shallowwater_well_balanced_wet_dry.jl index 4cb2d8b4..d37bedd1 100644 --- a/examples/tree_2d_dgsem/elixir_shallowwater_well_balanced_wet_dry.jl +++ b/examples/tree_2d_dgsem/elixir_shallowwater_well_balanced_wet_dry.jl @@ -78,10 +78,12 @@ coordinates_max = (1.0, 1.0) mesh = TreeMesh(coordinates_min, coordinates_max, initial_refinement_level = 3, - n_cells_max = 10_000) + n_cells_max = 10_000, + periodicity = true) # create the semi discretization object -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/unstructured_2d_dgsem/elixir_shallowwater_dirichlet.jl b/examples/unstructured_2d_dgsem/elixir_shallowwater_dirichlet.jl index fdad0e08..f6ae2ca4 100644 --- a/examples/unstructured_2d_dgsem/elixir_shallowwater_dirichlet.jl +++ b/examples/unstructured_2d_dgsem/elixir_shallowwater_dirichlet.jl @@ -25,7 +25,7 @@ end initial_condition = initial_condition_well_balancedness boundary_condition_constant = BoundaryConditionDirichlet(initial_condition) -boundary_condition = Dict(:OuterCircle => boundary_condition_constant) +boundary_condition = (; OuterCircle = boundary_condition_constant) ############################################################################### # Get the DG approximation space diff --git a/examples/unstructured_2d_dgsem/elixir_shallowwater_ec.jl b/examples/unstructured_2d_dgsem/elixir_shallowwater_ec.jl index ae950755..84a83007 100644 --- a/examples/unstructured_2d_dgsem/elixir_shallowwater_ec.jl +++ b/examples/unstructured_2d_dgsem/elixir_shallowwater_ec.jl @@ -34,7 +34,8 @@ mesh_file = default_mesh_file mesh = UnstructuredMesh2D(mesh_file, periodicity = true) # Create the semi discretization object -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solver diff --git a/examples/unstructured_2d_dgsem/elixir_shallowwater_ec_float32.jl b/examples/unstructured_2d_dgsem/elixir_shallowwater_ec_float32.jl index 6f6f24fe..01788178 100644 --- a/examples/unstructured_2d_dgsem/elixir_shallowwater_ec_float32.jl +++ b/examples/unstructured_2d_dgsem/elixir_shallowwater_ec_float32.jl @@ -35,7 +35,8 @@ mesh_file = Trixi.download("https://gist.githubusercontent.com/andrewwinters5000 mesh = UnstructuredMesh2D(mesh_file, periodicity = true, RealT = Float32) # Create the semi discretization object -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solver diff --git a/examples/unstructured_2d_dgsem/elixir_shallowwater_ec_shockcapturing.jl b/examples/unstructured_2d_dgsem/elixir_shallowwater_ec_shockcapturing.jl index 026a598b..58bf23d7 100644 --- a/examples/unstructured_2d_dgsem/elixir_shallowwater_ec_shockcapturing.jl +++ b/examples/unstructured_2d_dgsem/elixir_shallowwater_ec_shockcapturing.jl @@ -43,7 +43,8 @@ mesh_file = default_mesh_file mesh = UnstructuredMesh2D(mesh_file, periodicity = true) # Create the semi discretization object -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solver diff --git a/examples/unstructured_2d_dgsem/elixir_shallowwater_inflow_outflow.jl b/examples/unstructured_2d_dgsem/elixir_shallowwater_inflow_outflow.jl index 06f446dd..8cf50dbc 100644 --- a/examples/unstructured_2d_dgsem/elixir_shallowwater_inflow_outflow.jl +++ b/examples/unstructured_2d_dgsem/elixir_shallowwater_inflow_outflow.jl @@ -21,16 +21,16 @@ end initial_condition = initial_condition_channel_flow # Setup boundary conditions. -# At the inlet, we prescribe constant momentum to simulate inflow. +# At the inlet, we prescribe constant momentum to simulate inflow. # At the outlet, we prescribe the water height as a time-dependent cosine wave. boundary_condition_inflow = BoundaryConditionMomentum(0.4, 0.4, equations) boundary_condition_outflow = BoundaryConditionWaterHeight(t -> 1.0 + 0.1 * cos(π / 2 * t), equations) -boundary_conditions = Dict(:Bottom => boundary_condition_inflow, - :Top => boundary_condition_outflow, - :Left => boundary_condition_slip_wall, - :Right => boundary_condition_slip_wall) +boundary_conditions = (; Bottom = boundary_condition_inflow, + Top = boundary_condition_outflow, + Left = boundary_condition_slip_wall, + Right = boundary_condition_slip_wall) ############################################################################### # Get the DG approximation space @@ -41,7 +41,7 @@ volume_flux = (flux_wintermeyer_etal, flux_nonconservative_wintermeyer_etal) # In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`. # Thus, we exchanged in PR#2458 of Trixi.jl the default wave speed used in the LLF flux and dissipation operator to `max_abs_speed`. # To ensure that every example still runs we specify explicitly `DissipationLocalLaxFriedrichs(max_abs_speed_naive)`. -# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the +# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the # `StepsizeCallback` (CFL-Condition) and less diffusion. surface_flux = (FluxPlusDissipation(flux_wintermeyer_etal, DissipationLocalLaxFriedrichs(max_abs_speed_naive)), diff --git a/examples/unstructured_2d_dgsem/elixir_shallowwater_multilayer_convergence.jl b/examples/unstructured_2d_dgsem/elixir_shallowwater_multilayer_convergence.jl index 8e16c648..7f25604e 100644 --- a/examples/unstructured_2d_dgsem/elixir_shallowwater_multilayer_convergence.jl +++ b/examples/unstructured_2d_dgsem/elixir_shallowwater_multilayer_convergence.jl @@ -31,7 +31,8 @@ mesh = UnstructuredMesh2D(mesh_file, periodicity = true) # Create the semidiscretization object semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, - source_terms = source_terms_convergence_test) + source_terms = source_terms_convergence_test, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/unstructured_2d_dgsem/elixir_shallowwater_multilayer_dam_break.jl b/examples/unstructured_2d_dgsem/elixir_shallowwater_multilayer_dam_break.jl index be8b033e..7af3eace 100644 --- a/examples/unstructured_2d_dgsem/elixir_shallowwater_multilayer_dam_break.jl +++ b/examples/unstructured_2d_dgsem/elixir_shallowwater_multilayer_dam_break.jl @@ -52,10 +52,10 @@ mesh_file = Trixi.download("https://gist.githubusercontent.com/andrewwinters5000 mesh = UnstructuredMesh2D(mesh_file, periodicity = false) # Boundary conditions -boundary_condition = Dict(:Top => boundary_condition_slip_wall, - :Left => boundary_condition_slip_wall, - :Right => boundary_condition_slip_wall, - :Bottom => boundary_condition_slip_wall) +boundary_condition = (; Top = boundary_condition_slip_wall, + Left = boundary_condition_slip_wall, + Right = boundary_condition_slip_wall, + Bottom = boundary_condition_slip_wall) # Create the semi discretization object semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, diff --git a/examples/unstructured_2d_dgsem/elixir_shallowwater_multilayer_dam_break_dry.jl b/examples/unstructured_2d_dgsem/elixir_shallowwater_multilayer_dam_break_dry.jl index ab0c6678..b2debb74 100644 --- a/examples/unstructured_2d_dgsem/elixir_shallowwater_multilayer_dam_break_dry.jl +++ b/examples/unstructured_2d_dgsem/elixir_shallowwater_multilayer_dam_break_dry.jl @@ -57,7 +57,7 @@ volume_flux = (flux_ersing_etal, flux_nonconservative_ersing_etal) # In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`. # Thus, we exchanged in PR#2458 of Trixi.jl the default wave speed used in the LLF flux and dissipation operator to `max_abs_speed`. # To ensure that every example still runs we specify explicitly `DissipationLocalLaxFriedrichs(max_abs_speed_naive)`. -# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the +# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the # `StepsizeCallback` (CFL-Condition) and less diffusion. surface_flux = (FluxHydrostaticReconstruction(FluxPlusDissipation(flux_ersing_etal, DissipationLocalLaxFriedrichs(max_abs_speed_naive)), @@ -85,10 +85,10 @@ mesh_file = Trixi.download("https://gist.githubusercontent.com/andrewwinters5000 mesh = UnstructuredMesh2D(mesh_file, periodicity = false) # Boundary conditions -boundary_condition = Dict(:Top => boundary_condition_slip_wall, - :Left => boundary_condition_slip_wall, - :Right => boundary_condition_slip_wall, - :Bottom => boundary_condition_slip_wall) +boundary_condition = (; Top = boundary_condition_slip_wall, + Left = boundary_condition_slip_wall, + Right = boundary_condition_slip_wall, + Bottom = boundary_condition_slip_wall) # Create the semi discretization object semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, diff --git a/examples/unstructured_2d_dgsem/elixir_shallowwater_multilayer_well_balanced.jl b/examples/unstructured_2d_dgsem/elixir_shallowwater_multilayer_well_balanced.jl index 6cf1fa91..6f9b017d 100644 --- a/examples/unstructured_2d_dgsem/elixir_shallowwater_multilayer_well_balanced.jl +++ b/examples/unstructured_2d_dgsem/elixir_shallowwater_multilayer_well_balanced.jl @@ -44,7 +44,8 @@ mesh_file = Trixi.download("https://gist.githubusercontent.com/andrewwinters5000 mesh = UnstructuredMesh2D(mesh_file, periodicity = true) # Create the semidiscretization object -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solver diff --git a/examples/unstructured_2d_dgsem/elixir_shallowwater_multilayer_well_balanced_wet_dry.jl b/examples/unstructured_2d_dgsem/elixir_shallowwater_multilayer_well_balanced_wet_dry.jl index 9461bf1d..9c578912 100644 --- a/examples/unstructured_2d_dgsem/elixir_shallowwater_multilayer_well_balanced_wet_dry.jl +++ b/examples/unstructured_2d_dgsem/elixir_shallowwater_multilayer_well_balanced_wet_dry.jl @@ -53,7 +53,7 @@ volume_flux = (flux_ersing_etal, flux_nonconservative_ersing_etal) # In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`. # Thus, we exchanged in PR#2458 of Trixi.jl the default wave speed used in the LLF flux and dissipation operator to `max_abs_speed`. # To ensure that every example still runs we specify explicitly `DissipationLocalLaxFriedrichs(max_abs_speed_naive)`. -# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the +# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the # `StepsizeCallback` (CFL-Condition) and less diffusion. surface_flux = (FluxHydrostaticReconstruction(FluxPlusDissipation(flux_ersing_etal, DissipationLocalLaxFriedrichs(max_abs_speed_naive)), @@ -86,7 +86,8 @@ mesh_file = default_mesh_file mesh = UnstructuredMesh2D(mesh_file, periodicity = true) # Create the semi discretization object -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solver diff --git a/examples/unstructured_2d_dgsem/elixir_shallowwater_source_terms.jl b/examples/unstructured_2d_dgsem/elixir_shallowwater_source_terms.jl index f737d640..6b1fbf7a 100644 --- a/examples/unstructured_2d_dgsem/elixir_shallowwater_source_terms.jl +++ b/examples/unstructured_2d_dgsem/elixir_shallowwater_source_terms.jl @@ -33,7 +33,8 @@ mesh = UnstructuredMesh2D(mesh_file, periodicity = true) # Create the semi discretization object semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, - source_terms = source_terms_convergence_test) + source_terms = source_terms_convergence_test, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/unstructured_2d_dgsem/elixir_shallowwater_three_mound_dam_break.jl b/examples/unstructured_2d_dgsem/elixir_shallowwater_three_mound_dam_break.jl index b456192c..11effb57 100644 --- a/examples/unstructured_2d_dgsem/elixir_shallowwater_three_mound_dam_break.jl +++ b/examples/unstructured_2d_dgsem/elixir_shallowwater_three_mound_dam_break.jl @@ -65,10 +65,10 @@ function boundary_condition_outflow(u_inner, normal_direction::AbstractVector, x return flux, noncons_flux end -boundary_conditions = Dict(:Bottom => boundary_condition_slip_wall, - :Top => boundary_condition_slip_wall, - :Right => boundary_condition_outflow, - :Left => boundary_condition_slip_wall) +boundary_conditions = (; Bottom = boundary_condition_slip_wall, + Top = boundary_condition_slip_wall, + Right = boundary_condition_outflow, + Left = boundary_condition_slip_wall) ############################################################################### # Get the DG approximation space diff --git a/examples/unstructured_2d_dgsem/elixir_shallowwater_twolayer_convergence.jl b/examples/unstructured_2d_dgsem/elixir_shallowwater_twolayer_convergence.jl index d99b06d8..ea701244 100644 --- a/examples/unstructured_2d_dgsem/elixir_shallowwater_twolayer_convergence.jl +++ b/examples/unstructured_2d_dgsem/elixir_shallowwater_twolayer_convergence.jl @@ -31,7 +31,8 @@ mesh = UnstructuredMesh2D(mesh_file, periodicity = true) # Create the semidiscretization object semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, - source_terms = source_terms_convergence_test) + source_terms = source_terms_convergence_test, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solvers, callbacks etc. diff --git a/examples/unstructured_2d_dgsem/elixir_shallowwater_twolayer_dam_break.jl b/examples/unstructured_2d_dgsem/elixir_shallowwater_twolayer_dam_break.jl index 39b85066..0cd7eba8 100644 --- a/examples/unstructured_2d_dgsem/elixir_shallowwater_twolayer_dam_break.jl +++ b/examples/unstructured_2d_dgsem/elixir_shallowwater_twolayer_dam_break.jl @@ -54,10 +54,10 @@ mesh_file = Trixi.download("https://gist.githubusercontent.com/andrewwinters5000 mesh = UnstructuredMesh2D(mesh_file, periodicity = false) # Boundary conditions -boundary_condition = Dict(:Top => boundary_condition_slip_wall, - :Left => boundary_condition_slip_wall, - :Right => boundary_condition_slip_wall, - :Bottom => boundary_condition_slip_wall) +boundary_condition = (; Top = boundary_condition_slip_wall, + Left = boundary_condition_slip_wall, + Right = boundary_condition_slip_wall, + Bottom = boundary_condition_slip_wall) # Create the semi discretization object semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, diff --git a/examples/unstructured_2d_dgsem/elixir_shallowwater_twolayer_well_balanced.jl b/examples/unstructured_2d_dgsem/elixir_shallowwater_twolayer_well_balanced.jl index 71228ee6..ad8ef895 100644 --- a/examples/unstructured_2d_dgsem/elixir_shallowwater_twolayer_well_balanced.jl +++ b/examples/unstructured_2d_dgsem/elixir_shallowwater_twolayer_well_balanced.jl @@ -48,7 +48,8 @@ mesh_file = Trixi.download("https://gist.githubusercontent.com/andrewwinters5000 mesh = UnstructuredMesh2D(mesh_file, periodicity = true) # Create the semi discretization object -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solver diff --git a/examples/unstructured_2d_dgsem/elixir_shallowwater_wall_bc_shockcapturing.jl b/examples/unstructured_2d_dgsem/elixir_shallowwater_wall_bc_shockcapturing.jl index 6235aa51..6b5623a7 100644 --- a/examples/unstructured_2d_dgsem/elixir_shallowwater_wall_bc_shockcapturing.jl +++ b/examples/unstructured_2d_dgsem/elixir_shallowwater_wall_bc_shockcapturing.jl @@ -30,7 +30,7 @@ end initial_condition = initial_condition_stone_throw -boundary_condition = Dict(:OuterCircle => boundary_condition_slip_wall) +boundary_condition = (; OuterCircle = boundary_condition_slip_wall) ############################################################################### # Get the DG approximation space diff --git a/examples/unstructured_2d_dgsem/elixir_shallowwater_well_balanced.jl b/examples/unstructured_2d_dgsem/elixir_shallowwater_well_balanced.jl index 861f6f21..7fdf794b 100644 --- a/examples/unstructured_2d_dgsem/elixir_shallowwater_well_balanced.jl +++ b/examples/unstructured_2d_dgsem/elixir_shallowwater_well_balanced.jl @@ -47,7 +47,8 @@ mesh_file = default_mesh_file mesh = UnstructuredMesh2D(mesh_file, periodicity = true) # Create the semi discretization object -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions = boundary_condition_periodic) ############################################################################### # ODE solver diff --git a/test/Project.toml b/test/Project.toml index d2fd1e65..08911bc0 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -14,6 +14,6 @@ OrdinaryDiffEqSSPRK = "1.2" Printf = "1" Roots = "2.1.6" Test = "1" -Trixi = "0.14" +Trixi = "0.15" TrixiBottomTopography = "0.1" TrixiTest = "0.2.1" diff --git a/test/test_p4est_2d.jl b/test/test_p4est_2d.jl index 4532771e..fbc2249b 100644 --- a/test/test_p4est_2d.jl +++ b/test/test_p4est_2d.jl @@ -158,16 +158,11 @@ end # SWE tspan=(0.0, 0.1)) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) - let - t = sol.t[end] - u_ode = sol.u[end] - du_ode = similar(u_ode) - # Larger values for allowed allocations due to usage of custom - # integrator which are not *recorded* for the methods from - # OrdinaryDiffEq.jl - # Corresponding issue: https://github.com/trixi-framework/Trixi.jl/issues/1877 - @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 15000 - end + # Larger values for allowed allocations due to usage of custom + # integrator which are not *recorded* for the methods from + # OrdinaryDiffEq.jl + # Corresponding issue: https://github.com/trixi-framework/Trixi.jl/issues/1877 + @test_allocations(Trixi.rhs!, semi, sol, 15000) end @trixi_testset "elixir_shallowwater_multilayer_well_balanced_wet_dry_nonconforming.jl" begin @@ -275,22 +270,17 @@ end # SWE 4.440892098500626e-16 ], tspan=(0.0, 0.05), - # Increase the absolute tolerance to account for varying results with + # Increase the absolute tolerance to account for varying results with # with the two-sided limiter on different architectures. # See https://github.com/trixi-framework/Trixi.jl/pull/2007 atol=5e-4) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) - let - t = sol.t[end] - u_ode = sol.u[end] - du_ode = similar(u_ode) - # Larger values for allowed allocations due to usage of custom - # integrator which are not *recorded* for the methods from - # OrdinaryDiffEq.jl - # Corresponding issue: https://github.com/trixi-framework/Trixi.jl/issues/1877 - @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 15000 - end + # Larger values for allowed allocations due to usage of custom + # integrator which are not *recorded* for the methods from + # OrdinaryDiffEq.jl + # Corresponding issue: https://github.com/trixi-framework/Trixi.jl/issues/1877 + @test_allocations(Trixi.rhs!, semi, sol, 15000) end @trixi_testset "elixir_shallowwater_multilayer_blast_wet_dry_sc_subcell with periodic BC.jl" begin @@ -315,23 +305,19 @@ end # SWE initial_refinement_level = 5, periodicity = true), semi=SemidiscretizationHyperbolic(mesh, equations, - initial_condition, solver), - # Increase the absolute tolerance to account for varying results with + initial_condition, solver, + boundary_conditions = boundary_condition_periodic), + # Increase the absolute tolerance to account for varying results with # with the two-sided limiter on different architectures. # See https://github.com/trixi-framework/Trixi.jl/pull/2007 atol=5e-4) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) - let - t = sol.t[end] - u_ode = sol.u[end] - du_ode = similar(u_ode) - # Larger values for allowed allocations due to usage of custom - # integrator which are not *recorded* for the methods from - # OrdinaryDiffEq.jl - # Corresponding issue: https://github.com/trixi-framework/Trixi.jl/issues/1877 - @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 15000 - end + # Larger values for allowed allocations due to usage of custom + # integrator which are not *recorded* for the methods from + # OrdinaryDiffEq.jl + # Corresponding issue: https://github.com/trixi-framework/Trixi.jl/issues/1877 + @test_allocations(Trixi.rhs!, semi, sol, 15000) end end # MLSWE end # P4estMesh2D diff --git a/test/test_tree_2d.jl b/test/test_tree_2d.jl index 5f1ea040..8ab78f16 100644 --- a/test/test_tree_2d.jl +++ b/test/test_tree_2d.jl @@ -98,7 +98,7 @@ isdir(outdir) && rm(outdir, recursive = true) # In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`. # Thus, we exchanged in PR#2458 of Trixi.jl the default wave speed used in the LLF flux to `max_abs_speed`. # To ensure that every example still runs we specify explicitly `FluxLaxFriedrichs(max_abs_speed_naive)`. - # We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the + # We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the # `StepsizeCallback` (CFL-Condition) and less diffusion. surface_flux=(FluxHydrostaticReconstruction(FluxLaxFriedrichs(max_abs_speed_naive), hydrostatic_reconstruction_audusse_etal), @@ -461,7 +461,7 @@ end # SWE # In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`. # Thus, we exchanged in PR#2458 of Trixi.jl the default wave speed used in the LLF flux to `max_abs_speed`. # To ensure that every example still runs we specify explicitly `FluxLaxFriedrichs(max_abs_speed_naive)`. - # We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the + # We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the # `StepsizeCallback` (CFL-Condition) and less diffusion. surface_flux=(FluxLaxFriedrichs(max_abs_speed_naive), flux_nonconservative_ersing_etal), @@ -538,7 +538,7 @@ end # 2LSWE # In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`. # Thus, we exchanged in PR#2458 of Trixi.jl the default wave speed used in the LLF flux to `max_abs_speed`. # To ensure that every example still runs we specify explicitly `FluxLaxFriedrichs(max_abs_speed_naive)`. - # We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the + # We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the # `StepsizeCallback` (CFL-Condition) and less diffusion. surface_flux=(FluxLaxFriedrichs(max_abs_speed_naive), flux_nonconservative_ersing_etal), @@ -616,16 +616,11 @@ end # 2LSWE tspan=(0.0, 0.1)) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) - let - t = sol.t[end] - u_ode = sol.u[end] - du_ode = similar(u_ode) - # Larger values for allowed allocations due to usage of custom - # integrator which are not *recorded* for the methods from - # OrdinaryDiffEq.jl - # Corresponding issue: https://github.com/trixi-framework/Trixi.jl/issues/1877 - @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 15000 - end + # Larger values for allowed allocations due to usage of custom + # integrator which are not *recorded* for the methods from + # OrdinaryDiffEq.jl + # Corresponding issue: https://github.com/trixi-framework/Trixi.jl/issues/1877 + @test_allocations(Trixi.rhs!, semi, sol, 15000) end @trixi_testset "elixir_shallowwater_multilayer_well_balanced.jl" begin @@ -705,7 +700,7 @@ end # 2LSWE # In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`. # Thus, we exchanged in PR#2458 of Trixi.jl the default wave speed used in the LLF flux to `max_abs_speed`. # To ensure that every example still runs we specify explicitly `FluxLaxFriedrichs(max_abs_speed_naive)`. - # We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the + # We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the # `StepsizeCallback` (CFL-Condition) and less diffusion. surface_flux=(FluxLaxFriedrichs(max_abs_speed_naive), flux_nonconservative_ersing_etal), @@ -733,16 +728,11 @@ end # 2LSWE tspan=(0.0, 1.0)) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) - let - t = sol.t[end] - u_ode = sol.u[end] - du_ode = similar(u_ode) - # Larger values for allowed allocations due to usage of custom - # integrator which are not *recorded* for the methods from - # OrdinaryDiffEq.jl - # Corresponding issue: https://github.com/trixi-framework/Trixi.jl/issues/1877 - @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 15000 - end + # Larger values for allowed allocations due to usage of custom + # integrator which are not *recorded* for the methods from + # OrdinaryDiffEq.jl + # Corresponding issue: https://github.com/trixi-framework/Trixi.jl/issues/1877 + @test_allocations(Trixi.rhs!, semi, sol, 15000) end @trixi_testset "elixir_shallowwater_multilayer_dam_break.jl" begin @@ -810,7 +800,7 @@ end # 2LSWE # In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`. # Thus, we exchanged in PR#2458 of Trixi.jl the default wave speed used in the LLF flux to `max_abs_speed`. # To ensure that every example still runs we specify explicitly `FluxLaxFriedrichs(max_abs_speed_naive)`. - # We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the + # We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the # `StepsizeCallback` (CFL-Condition) and less diffusion. surface_flux=(FluxLaxFriedrichs(max_abs_speed_naive), flux_nonconservative_ersing_etal), @@ -869,22 +859,17 @@ end # 2LSWE 4.440892098500626e-16 ], tspan=(0.0, 0.05), - # Increase the absolute tolerance to account for varying results with + # Increase the absolute tolerance to account for varying results with # with the two-sided limiter on different architectures. # See https://github.com/trixi-framework/Trixi.jl/pull/2007 atol=5e-4) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) - let - t = sol.t[end] - u_ode = sol.u[end] - du_ode = similar(u_ode) - # Larger values for allowed allocations due to usage of custom - # integrator which are not *recorded* for the methods from - # OrdinaryDiffEq.jl - # Corresponding issue: https://github.com/trixi-framework/Trixi.jl/issues/1877 - @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 15000 - end + # Larger values for allowed allocations due to usage of custom + # integrator which are not *recorded* for the methods from + # OrdinaryDiffEq.jl + # Corresponding issue: https://github.com/trixi-framework/Trixi.jl/issues/1877 + @test_allocations(Trixi.rhs!, semi, sol, 15000) end end # MLSWE end # TreeMesh2D diff --git a/test/test_upstream.jl b/test/test_upstream.jl index d7059fb9..0627c369 100644 --- a/test/test_upstream.jl +++ b/test/test_upstream.jl @@ -161,22 +161,17 @@ end 4.440892098500626e-16 ], tspan=(0.0, 0.05), - # Increase the absolute tolerance to account for varying results with + # Increase the absolute tolerance to account for varying results with # with the two-sided limiter on different architectures. # See https://github.com/trixi-framework/Trixi.jl/pull/2007 atol=5e-4) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) - let - t = sol.t[end] - u_ode = sol.u[end] - du_ode = similar(u_ode) - # Larger values for allowed allocations due to usage of custom - # integrator which are not *recorded* for the methods from - # OrdinaryDiffEq.jl - # Corresponding issue: https://github.com/trixi-framework/Trixi.jl/issues/1877 - @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 15000 - end + # Larger values for allowed allocations due to usage of custom + # integrator which are not *recorded* for the methods from + # OrdinaryDiffEq.jl + # Corresponding issue: https://github.com/trixi-framework/Trixi.jl/issues/1877 + @test_allocations(Trixi.rhs!, semi, sol, 15000) end # Clean up afterwards: delete output directory