Skip to content

Commit

Permalink
Reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
huiyuxie committed Sep 11, 2024
1 parent 94f233b commit 9838536
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
17 changes: 3 additions & 14 deletions examples/shallowwater_dirichlet_1d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,9 @@ using OrdinaryDiffEq
###############################################################################
# Semidiscretization of the shallow water equations

equations = ShallowWaterEquations1D(gravity_constant = 1.0, H0 = 3.0)
equations = ShallowWaterEquations1D(gravity_constant = 9.81, H0 = 3.0)

# An initial condition with constant total water height and zero velocities to test well-balancedness.
function initial_condition_well_balancedness(x, t, equations::ShallowWaterEquations1D)
# Set the background values
H = equations.H0
v = 0.0

b = (1.5 / exp(0.5 * ((x[1] - 1.0)^2)) + 0.75 / exp(0.5 * ((x[1] + 1.0)^2)))

return prim2cons(SVector(H, v, b), equations)
end

initial_condition = initial_condition_well_balancedness
initial_condition = initial_condition_convergence_test

boundary_condition = BoundaryConditionDirichlet(initial_condition)

Expand Down Expand Up @@ -49,7 +38,7 @@ semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver,
###############################################################################
# ODE solvers, callbacks etc.

tspan = (0.0, 100.0)
tspan = (0.0, 1.0)
ode = semidiscretize_gpu(semi, tspan) # from TrixiGPU.jl

summary_callback = SummaryCallback()
Expand Down
1 change: 0 additions & 1 deletion test/test_shallowwater_dirichlet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ isdir(outdir) && rm(outdir, recursive = true)
# Test precision of the semidiscretization process
@testset "Test Shallow Water" begin
@testset "Shallow Water 1D" begin

equations = ShallowWaterEquations1D(gravity_constant = 9.81, H0 = 3.0)

initial_condition = initial_condition_convergence_test
Expand Down

0 comments on commit 9838536

Please sign in to comment.