Path: blob/main/examples/tree_3d_dgsem/elixir_advection_restart.jl
2055 views
using OrdinaryDiffEqLowStorageRK1using Trixi23###############################################################################4# create a restart file56trixi_include(@__MODULE__, joinpath(@__DIR__, "elixir_advection_extended.jl"))78###############################################################################9# adapt the parameters that have changed compared to "elixir_advection_extended.jl"1011# Note: If you get a restart file from somewhere else, you need to provide12# appropriate setups in the elixir loading a restart file1314restart_filename = joinpath("out", "restart_000000019.h5")15mesh = load_mesh(restart_filename)1617semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver)1819tspan = (load_time(restart_filename), 2.0)20dt = load_dt(restart_filename)21ode = semidiscretize(semi, tspan, restart_filename)2223# Do not overwrite the initial snapshot written by elixir_advection_extended.jl.24save_solution.condition.save_initial_solution = false2526integrator = init(ode, CarpenterKennedy2N54(williamson_condition = false);27dt = dt, # solve needs some value here but it will be overwritten by the stepsize_callback28ode_default_options()..., callback = callbacks, maxiters = 100_000);2930# Get the last time index and work with that.31load_timestep!(integrator, restart_filename)3233###############################################################################34# run the simulation3536sol = solve!(integrator)373839