Path: blob/main/examples/t8code_3d_dgsem/elixir_advection_restart.jl
2055 views
using OrdinaryDiffEqLowStorageRK1using Trixi23###############################################################################4# create a restart file56trixi_include(@__MODULE__, joinpath(@__DIR__, "elixir_advection_basic.jl"),7trees_per_dimension = (2, 2, 2))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_000000010.h5")16mesh = load_mesh(restart_filename)1718semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_convergence_test,19solver)2021tspan = (load_time(restart_filename), 2.0)22dt = load_dt(restart_filename)23ode = semidiscretize(semi, tspan, restart_filename)2425# Do not overwrite the initial snapshot written by elixir_advection_extended.jl.26save_solution.condition.save_initial_solution = false2728integrator = init(ode, CarpenterKennedy2N54(williamson_condition = false);29dt = dt, # solve needs some value here but it will be overwritten by the stepsize_callback30ode_default_options()..., callback = callbacks, maxiters = 100_000);3132# Get the last time index and work with that.33load_timestep!(integrator, restart_filename)3435###############################################################################36# run the simulation3738sol = solve!(integrator)394041