-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
82 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "Trixi" | ||
uuid = "a7f1ee26-1774-49b1-8366-f1abc58fbfcb" | ||
authors = ["Michael Schlottke-Lakemper <[email protected]>", "Gregor Gassner <[email protected]>", "Hendrik Ranocha <[email protected]>", "Andrew R. Winters <[email protected]>", "Jesse Chan <[email protected]>"] | ||
version = "0.7.15-pre" | ||
version = "0.7.16-pre" | ||
|
||
[deps] | ||
CodeTracking = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2" | ||
|
@@ -111,4 +111,4 @@ julia = "1.8" | |
[extras] | ||
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" | ||
Convex = "f65535da-76fb-5f13-bab9-19810c17039a" | ||
ECOS = "e2685f51-7e38-5353-a97d-a921fd2c8199" | ||
ECOS = "e2685f51-7e38-5353-a97d-a921fd2c8199" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
|
||
using OrdinaryDiffEq | ||
using Trixi | ||
|
||
############################################################################### | ||
# Define time integration algorithm | ||
alg = CarpenterKennedy2N54(williamson_condition = false) | ||
# Create a restart file | ||
trixi_include(@__MODULE__, joinpath(@__DIR__, "elixir_advection_extended.jl"), alg = alg, | ||
tspan = (0.0, 3.0)) | ||
|
||
############################################################################### | ||
# adapt the parameters that have changed compared to "elixir_advection_extended.jl" | ||
|
||
# Note: If you get a restart file from somewhere else, you need to provide | ||
# appropriate setups in the elixir loading a restart file | ||
|
||
restart_filename = joinpath("out", "restart_000040.h5") | ||
mesh = load_mesh(restart_filename) | ||
|
||
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) | ||
|
||
tspan = (load_time(restart_filename), 5.0) | ||
dt = load_dt(restart_filename) | ||
ode = semidiscretize(semi, tspan, restart_filename); | ||
|
||
# Do not overwrite the initial snapshot written by elixir_advection_extended.jl. | ||
save_solution.condition.save_initial_solution = false | ||
|
||
# Add AMR callback | ||
amr_controller = ControllerThreeLevel(semi, IndicatorMax(semi, variable = first), | ||
base_level = 3, | ||
med_level = 4, med_threshold = 0.8, | ||
max_level = 5, max_threshold = 1.2) | ||
amr_callback = AMRCallback(semi, amr_controller, | ||
interval = 5, | ||
adapt_initial_condition = false, | ||
adapt_initial_condition_only_refine = true) | ||
callbacks_ext = CallbackSet(amr_callback, callbacks.discrete_callbacks...) | ||
|
||
integrator = init(ode, alg, | ||
dt = dt, # solve needs some value here but it will be overwritten by the stepsize_callback | ||
callback = callbacks_ext, maxiters = 100_000; ode_default_options()...) | ||
|
||
# Load saved context for adaptive time integrator | ||
if integrator.opts.adaptive | ||
load_adaptive_time_integrator!(integrator, restart_filename) | ||
end | ||
|
||
# Get the last time index and work with that. | ||
load_timestep!(integrator, restart_filename) | ||
|
||
############################################################################### | ||
# run the simulation | ||
|
||
sol = solve!(integrator) | ||
|
||
summary_callback() # print the timer summary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters