Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply Runic.jl formatter #2070

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 12 additions & 8 deletions benchmark/benchmark_ec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ function tabulate_benchmarks(args...; kwargs...)
result = run_benchmarks(args...; kwargs...)
println("#Elements | Runtime in seconds")
for (level, runtime) in zip(result.levels, result.runtimes)
@printf("%9d | %.2e\n", 4^level, 1.0e-9*runtime)
@printf("%9d | %.2e\n", 4^level, 1.0e-9 * runtime)
end
for (level, runtime) in zip(result.levels, result.runtimes)
@printf("%.16e\n", 1.0e-9*runtime)
@printf("%.16e\n", 1.0e-9 * runtime)
end
end

Expand All @@ -31,12 +31,16 @@ function benchmark_euler(; initial_refinement_level = 1, polydeg = 3)

coordinates_min = (-2.0, -2.0)
coordinates_max = (2.0, 2.0)
mesh = TreeMesh(coordinates_min, coordinates_max,
initial_refinement_level = initial_refinement_level,
n_cells_max = 100_000)

semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_weak_blast_wave,
solver)
mesh = TreeMesh(
coordinates_min, coordinates_max,
initial_refinement_level = initial_refinement_level,
n_cells_max = 100_000
)

semi = SemidiscretizationHyperbolic(
mesh, equations, initial_condition_weak_blast_wave,
solver
)

t0 = 0.0
u0 = compute_coefficients(t0, semi)
Expand Down
31 changes: 19 additions & 12 deletions benchmark/elixir_2d_euler_vortex_p4est.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

using OrdinaryDiffEq
using Trixi

Expand Down Expand Up @@ -50,9 +49,11 @@ solver = DGSEM(polydeg = 3, surface_flux = flux_lax_friedrichs)

coordinates_min = (-10.0, -10.0)
coordinates_max = (10.0, 10.0)
mesh = P4estMesh((1, 1), polydeg = Trixi.polydeg(solver),
coordinates_min = coordinates_min, coordinates_max = coordinates_max,
initial_refinement_level = 4)
mesh = P4estMesh(
(1, 1), polydeg = Trixi.polydeg(solver),
coordinates_min = coordinates_min, coordinates_max = coordinates_max,
initial_refinement_level = 4
)

semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver)

Expand All @@ -65,12 +66,16 @@ ode = semidiscretize(semi, tspan)
summary_callback = SummaryCallback()

analysis_interval = 100
analysis_callback = AnalysisCallback(semi, interval = analysis_interval,
save_analysis = true,
extra_analysis_errors = (:conservation_error,),
extra_analysis_integrals = (entropy, energy_total,
energy_kinetic,
energy_internal))
analysis_callback = AnalysisCallback(
semi, interval = analysis_interval,
save_analysis = true,
extra_analysis_errors = (:conservation_error,),
extra_analysis_integrals = (
entropy, energy_total,
energy_kinetic,
energy_internal,
)
)

alive_callback = AliveCallback(analysis_interval = analysis_interval)

Expand All @@ -79,6 +84,8 @@ callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback)
###############################################################################
# run the simulation

sol = solve(ode, BS3(),
save_everystep = false, callback = callbacks);
sol = solve(
ode, BS3(),
save_everystep = false, callback = callbacks
);
summary_callback() # print the timer summary
23 changes: 14 additions & 9 deletions benchmark/elixir_2d_euler_vortex_structured.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

using OrdinaryDiffEq
using Trixi

Expand Down Expand Up @@ -64,12 +63,16 @@ ode = semidiscretize(semi, tspan)
summary_callback = SummaryCallback()

analysis_interval = 100
analysis_callback = AnalysisCallback(semi, interval = analysis_interval,
save_analysis = true,
extra_analysis_errors = (:conservation_error,),
extra_analysis_integrals = (entropy, energy_total,
energy_kinetic,
energy_internal))
analysis_callback = AnalysisCallback(
semi, interval = analysis_interval,
save_analysis = true,
extra_analysis_errors = (:conservation_error,),
extra_analysis_integrals = (
entropy, energy_total,
energy_kinetic,
energy_internal,
)
)

alive_callback = AliveCallback(analysis_interval = analysis_interval)

Expand All @@ -78,6 +81,8 @@ callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback)
###############################################################################
# run the simulation

sol = solve(ode, BS3(),
save_everystep = false, callback = callbacks);
sol = solve(
ode, BS3(),
save_everystep = false, callback = callbacks
);
summary_callback() # print the timer summary
31 changes: 19 additions & 12 deletions benchmark/elixir_2d_euler_vortex_tree.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

using OrdinaryDiffEq
using Trixi

Expand Down Expand Up @@ -50,9 +49,11 @@ solver = DGSEM(polydeg = 3, surface_flux = flux_lax_friedrichs)

coordinates_min = (-10.0, -10.0)
coordinates_max = (10.0, 10.0)
mesh = TreeMesh(coordinates_min, coordinates_max,
initial_refinement_level = 4,
n_cells_max = 10_000)
mesh = TreeMesh(
coordinates_min, coordinates_max,
initial_refinement_level = 4,
n_cells_max = 10_000
)

semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver)

Expand All @@ -65,12 +66,16 @@ ode = semidiscretize(semi, tspan)
summary_callback = SummaryCallback()

analysis_interval = 100
analysis_callback = AnalysisCallback(semi, interval = analysis_interval,
save_analysis = true,
extra_analysis_errors = (:conservation_error,),
extra_analysis_integrals = (entropy, energy_total,
energy_kinetic,
energy_internal))
analysis_callback = AnalysisCallback(
semi, interval = analysis_interval,
save_analysis = true,
extra_analysis_errors = (:conservation_error,),
extra_analysis_integrals = (
entropy, energy_total,
energy_kinetic,
energy_internal,
)
)

alive_callback = AliveCallback(analysis_interval = analysis_interval)

Expand All @@ -79,6 +84,8 @@ callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback)
###############################################################################
# run the simulation

sol = solve(ode, BS3(),
save_everystep = false, callback = callbacks);
sol = solve(
ode, BS3(),
save_everystep = false, callback = callbacks
);
summary_callback() # print the timer summary
29 changes: 18 additions & 11 deletions benchmark/elixir_2d_euler_vortex_unstructured.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

using OrdinaryDiffEq
using Trixi

Expand Down Expand Up @@ -48,8 +47,10 @@ end
initial_condition = initial_condition_isentropic_vortex
solver = DGSEM(polydeg = 3, surface_flux = flux_lax_friedrichs)

mesh_file = Trixi.download("https://gist.githubusercontent.com/ranocha/f4ea19ba3b62348968c971db43d7798b/raw/a506abb9479c020920cf6068c142670fc1a9aadc/mesh_uniform_cartesian.mesh",
joinpath(@__DIR__, "mesh_uniform_cartesian.mesh"))
mesh_file = Trixi.download(
"https://gist.githubusercontent.com/ranocha/f4ea19ba3b62348968c971db43d7798b/raw/a506abb9479c020920cf6068c142670fc1a9aadc/mesh_uniform_cartesian.mesh",
joinpath(@__DIR__, "mesh_uniform_cartesian.mesh")
)

mesh = UnstructuredMesh2D(mesh_file, periodicity = true)

Expand All @@ -64,12 +65,16 @@ ode = semidiscretize(semi, tspan)
summary_callback = SummaryCallback()

analysis_interval = 100
analysis_callback = AnalysisCallback(semi, interval = analysis_interval,
save_analysis = true,
extra_analysis_errors = (:conservation_error,),
extra_analysis_integrals = (entropy, energy_total,
energy_kinetic,
energy_internal))
analysis_callback = AnalysisCallback(
semi, interval = analysis_interval,
save_analysis = true,
extra_analysis_errors = (:conservation_error,),
extra_analysis_integrals = (
entropy, energy_total,
energy_kinetic,
energy_internal,
)
)

alive_callback = AliveCallback(analysis_interval = analysis_interval)

Expand All @@ -78,6 +83,8 @@ callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback)
###############################################################################
# run the simulation

sol = solve(ode, BS3(),
save_everystep = false, callback = callbacks);
sol = solve(
ode, BS3(),
save_everystep = false, callback = callbacks
);
summary_callback() # print the timer summary
13 changes: 8 additions & 5 deletions benchmark/elixir_3d_euler_source_terms_structured.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

using OrdinaryDiffEq
using Trixi

Expand All @@ -16,8 +15,10 @@ coordinates_max = (2.0, 2.0, 2.0)
cells_per_dimension = (4, 4, 4)
mesh = StructuredMesh(cells_per_dimension, coordinates_min, coordinates_max)

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
)

###############################################################################
# ODE solvers, callbacks etc.
Expand All @@ -37,6 +38,8 @@ callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback)
###############################################################################
# run the simulation

sol = solve(ode, BS3(),
save_everystep = false, callback = callbacks);
sol = solve(
ode, BS3(),
save_everystep = false, callback = callbacks
);
summary_callback() # print the timer summary
21 changes: 13 additions & 8 deletions benchmark/elixir_3d_euler_source_terms_tree.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

using OrdinaryDiffEq
using Trixi

Expand All @@ -13,12 +12,16 @@ solver = DGSEM(polydeg = 3, surface_flux = flux_lax_friedrichs)

coordinates_min = (0.0, 0.0, 0.0)
coordinates_max = (2.0, 2.0, 2.0)
mesh = TreeMesh(coordinates_min, coordinates_max,
initial_refinement_level = 2,
n_cells_max = 10_000)
mesh = TreeMesh(
coordinates_min, coordinates_max,
initial_refinement_level = 2,
n_cells_max = 10_000
)

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
)

###############################################################################
# ODE solvers, callbacks etc.
Expand All @@ -38,6 +41,8 @@ callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback)
###############################################################################
# run the simulation

sol = solve(ode, BS3(),
save_everystep = false, callback = callbacks);
sol = solve(
ode, BS3(),
save_everystep = false, callback = callbacks
);
summary_callback() # print the timer summary
Loading
Loading