Path: blob/main/examples/t8code_2d_dgsem/elixir_advection_restart.jl
2055 views
using OrdinaryDiffEqLowStorageRK1using Trixi23###############################################################################4# create a restart file56elixir_file = "elixir_advection_extended.jl"7restart_file = "restart_000000021.h5"89trixi_include(@__MODULE__, joinpath(@__DIR__, elixir_file))1011###############################################################################12# adapt the parameters that have changed compared to "elixir_advection_extended.jl"1314# Note: If you get a restart file from somewhere else, you need to provide15# appropriate setups in the elixir loading a restart file1617restart_filename = joinpath("out", restart_file)18mesh = load_mesh(restart_filename)1920semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver,21boundary_conditions = boundary_conditions)2223tspan = (load_time(restart_filename), 2.0)24dt = load_dt(restart_filename)25ode = semidiscretize(semi, tspan, restart_filename)2627# Do not overwrite the initial snapshot written by elixir_advection_extended.jl.28save_solution.condition.save_initial_solution = false2930integrator = init(ode, CarpenterKennedy2N54(williamson_condition = false);31dt = dt, # solve needs some value here but it will be overwritten by the stepsize_callback32ode_default_options()..., callback = callbacks, maxiters = 100_000);3334# Get the last time index and work with that.35load_timestep!(integrator, restart_filename)3637###############################################################################38# run the simulation3940sol = solve!(integrator)414243