Path: blob/main/examples/unstructured_2d_dgsem/elixir_euler_restart.jl
5586 views
using OrdinaryDiffEqLowStorageRK1using Trixi2using Accessors: @reset34###############################################################################5# create a restart file67trixi_include(@__MODULE__, joinpath(@__DIR__, "elixir_euler_basic.jl"))89###############################################################################10# adapt the parameters that have changed compared to "elixir_advection_extended.jl"1112# Note: If you get a restart file from somewhere else, you need to provide13# appropriate setups in the elixir loading a restart file1415restart_filename = joinpath("out", "restart_000000050.h5")16mesh = load_mesh(restart_filename)1718semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver,19source_terms = source_terms,20boundary_conditions = boundary_conditions)2122tspan = (load_time(restart_filename), 1.0)23dt = load_dt(restart_filename)24ode = semidiscretize(semi, tspan, restart_filename)2526# Do not overwrite the initial snapshot written by elixir_advection_extended.jl.27@reset save_solution.condition.save_initial_solution = false2829integrator = init(ode, CarpenterKennedy2N54(williamson_condition = false);30dt = dt, # solve needs some value here but it will be overwritten by the stepsize_callback31ode_default_options()..., callback = callbacks, maxiters = 100_000);3233# Get the last time index and work with that.34load_timestep!(integrator, restart_filename)3536###############################################################################37# run the simulation3839sol = solve!(integrator)404142