Path: blob/main/examples/tree_2d_dgsem/elixir_advection_restart.jl
2055 views
using OrdinaryDiffEqLowStorageRK1using Trixi23###############################################################################4# Define time integration algorithm5alg = CarpenterKennedy2N54(williamson_condition = false)6# Create a restart file7base_elixir = "elixir_advection_extended.jl"8trixi_include(@__MODULE__, joinpath(@__DIR__, base_elixir), alg = alg,9tspan = (0.0, 10.0))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_000000040.h5")18mesh = load_mesh(restart_filename)1920semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver)2122tspan = (load_time(restart_filename), 10.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.27save_solution.condition.save_initial_solution = false2829integrator = init(ode, alg;30dt = dt, # solve needs some value here but it will be overwritten by the stepsize_callback31callback = callbacks,32ode_default_options()...); # default options because an adaptive time stepping method is used in test_mpi_tree.jl3334# Load saved context for adaptive time integrator35if integrator.opts.adaptive36load_adaptive_time_integrator!(integrator, restart_filename)37end3839# Get the last time index and work with that.40load_timestep!(integrator, restart_filename)4142###############################################################################43# run the simulation4445sol = solve!(integrator)464748