Path: blob/main/examples/t8code_3d_dgsem/elixir_advection_restart.jl
5586 views
using OrdinaryDiffEqLowStorageRK1using Trixi2using Accessors: @reset34###############################################################################5# create a restart file67trixi_include(@__MODULE__, joinpath(@__DIR__, "elixir_advection_basic.jl"),8trees_per_dimension = (2, 2, 2))910###############################################################################11# adapt the parameters that have changed compared to "elixir_advection_extended.jl"1213# Note: If you get a restart file from somewhere else, you need to provide14# appropriate setups in the elixir loading a restart file1516restart_filename = joinpath("out", "restart_000000010.h5")17mesh = load_mesh(restart_filename)1819semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_convergence_test,20solver;21boundary_conditions = boundary_condition_periodic)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.28@reset save_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