Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
2bd998a
add auxliary variables
benegee Apr 3, 2025
8b9b556
add AcousticPerturbationEquations2DAuxVars
benegee Apr 3, 2025
d9d7054
add tests for AcousticPerturbationEquations2DAuxVars
benegee Apr 3, 2025
060054a
format
benegee Apr 3, 2025
88e7f12
extend 2D TreeMesh AMR for aux vars
benegee Apr 4, 2025
15cea5c
add elixir and test for AMR with aux vars
benegee Apr 4, 2025
fa33421
adapt mehtod used in VisualizationCallback
benegee Apr 4, 2025
5f8891f
do not use VisualizationCallback
benegee Apr 4, 2025
14ec2f5
lets fix something
benegee Apr 7, 2025
1e03b7e
and some more
benegee Apr 7, 2025
f429f9b
fix performance specilization testing
benegee Apr 9, 2025
a59ce7e
re-add slip wall BC
benegee Apr 9, 2025
18305b7
make ParallelTreeMesh compatible
benegee Apr 9, 2025
6346829
format
benegee Apr 9, 2025
4be0151
p4est mpi interface flux
benegee Apr 9, 2025
087f507
generic flux_central and DissipationLocalLaxFriedrichs
benegee Apr 9, 2025
9cec964
Merge branch 'main' into bg/feature-aux-vars
benegee Apr 10, 2025
7170717
format
benegee Apr 10, 2025
9d1020e
Merge branch 'main' into bg/feature-aux-vars
benegee May 7, 2025
d707495
add comments to apply_solution_variables
benegee May 7, 2025
ebe1b02
rename *auxiliary*variables* -> *aux*vars*
benegee May 7, 2025
0b2a08d
add comment that only TreeMesh2D is currently supported
benegee May 7, 2025
14868f3
comment
benegee May 7, 2025
64b4f51
fmt
benegee May 7, 2025
9de7add
rename file as well
benegee May 7, 2025
468a5db
add have_aux_node_vars to analysis callback
benegee May 9, 2025
1d739fd
renamed
benegee May 9, 2025
1a4d0ac
Merge branch 'main' into bg/feature-aux-vars
benegee May 9, 2025
2e19fe7
rename init_auxiliary_surface_node_variables
benegee May 9, 2025
258c5e4
more aux renaming
benegee May 12, 2025
1a32cf4
add aux_boundary_node_vars
benegee May 16, 2025
1af6698
changed order of arguments
benegee May 16, 2025
63849f9
some documentation
benegee May 16, 2025
d3328d2
news entry
benegee May 16, 2025
4ab46ba
fmt
benegee May 16, 2025
a720a18
Merge branch 'main' into bg/feature-aux-vars
benegee May 16, 2025
dc893e9
!fixup
benegee May 16, 2025
e731a01
!fixup
benegee May 16, 2025
8c770ce
!fixup
benegee May 19, 2025
3bc28ad
fix variables range
benegee May 19, 2025
17cb325
fmt
benegee May 19, 2025
2d15209
enabled more features
benegee May 22, 2025
809a57a
fmt
benegee May 22, 2025
b3ea5f9
fixes
benegee May 22, 2025
dc0c5b9
fixes
benegee May 22, 2025
4518f86
fmt
benegee May 22, 2025
528d23a
mortars
benegee May 24, 2025
2c1c8b8
aux mortar container
benegee May 24, 2025
2a8dab4
aux vars for MPI interfaces
benegee Aug 25, 2025
b75d164
Merge branch 'main' into bg/feature-aux-vars
benegee Aug 25, 2025
6af4abc
add MPI mortars
benegee Sep 1, 2025
3975943
Merge branch 'main' into bg/feature-aux-vars
benegee Sep 11, 2025
526b7c3
Merge branch 'bg/feature-aux-vars' of github.com:trixi-framework/Trix…
benegee Sep 12, 2025
b209dae
Apply suggestions from code review
benegee Sep 23, 2025
da3da00
Merge branch 'main' into bg/feature-aux-vars
JoshuaLampert Sep 23, 2025
01c1c01
Merge branch 'main' into bg/feature-aux-vars
benegee Sep 30, 2025
5908986
fmt
benegee Sep 30, 2025
4782e38
after merge fixes
benegee Sep 30, 2025
1707894
more fixes
benegee Oct 1, 2025
6f3cdc5
Merge branch 'main' into bg/feature-aux-vars
benegee Oct 1, 2025
94e97cf
post merge fixes
benegee Oct 1, 2025
8b8bbd1
Merge branch 'main' into bg/feature-aux-vars
benegee Oct 7, 2025
3b5bb64
next merge
benegee Oct 7, 2025
9bab9d0
more
benegee Oct 8, 2025
900914f
more
benegee Oct 8, 2025
34dc3bb
more #2
benegee Oct 8, 2025
3b59499
fixes
benegee Oct 8, 2025
19d0a72
fix parallel + parabolic
benegee Oct 8, 2025
9318af8
news
benegee Oct 8, 2025
21b38d1
another fix
benegee Oct 8, 2025
995ab5b
Merge branch 'main' into bg/feature-aux-vars
benegee Oct 13, 2025
87ff343
only leftright = 1 used for mortar atm
benegee Oct 13, 2025
791191c
Merge branch 'main' into bg/feature-aux-vars-merge
benegee May 8, 2026
29646ae
fix TreeMesh tests
benegee May 12, 2026
0ff3587
fmt
benegee May 12, 2026
bc6fb09
Merge branch 'main' into bg/feature-aux-vars-merge
benegee May 12, 2026
b1b5ebb
more fixes
benegee May 13, 2026
0f466c6
more
benegee May 13, 2026
69411f4
still some left
benegee May 13, 2026
8f3437c
add TreeMesh2D aux vars test with MPI and AMR
benegee May 15, 2026
0b36ca3
fix
benegee May 15, 2026
9517e98
removed part which are uncovered atm
benegee May 15, 2026
540c829
Merge branch 'main' into bg/feature-aux-vars-merge
benegee May 27, 2026
eaa1dfe
Apply suggestions from code review
benegee May 27, 2026
a078ffb
Merge branch 'bg/feature-aux-vars-merge' of github.com:trixi-framewor…
benegee May 27, 2026
68071e4
revert to passing surface_flux_values
benegee May 27, 2026
e40e6b0
extend news
benegee May 27, 2026
9b4beb6
comment
benegee May 27, 2026
a896214
rename constant_speed to have_constant_speed
benegee May 27, 2026
8909f98
fixes
benegee May 27, 2026
d7262a3
extend NEWS comment
benegee Jun 2, 2026
82191a6
dispatch a lot less in analyze
benegee Jun 2, 2026
bd27c1c
add LinearVariableScalarAdvectionEquation2D
benegee Jun 2, 2026
b0e4593
add boundary condition with aux vars
benegee Jun 2, 2026
5971eda
add test case for LinearVariableScalarAdvectionEquation2D
benegee Jun 2, 2026
29a66a9
simplify create_cache
benegee Jun 2, 2026
5057297
Merge branch 'main' into bg/feature-aux-vars-merge
benegee Jun 2, 2026
d1b8ac8
fmt
benegee Jun 3, 2026
05e953c
Merge branch 'bg/feature-aux-vars-merge' of github.com:trixi-framewor…
benegee Jun 3, 2026
56b33c7
Merge branch 'main' into bg/feature-aux-vars-merge
benegee Jun 3, 2026
6a601c8
Apply suggestions from code review
benegee Jun 5, 2026
ee30e6b
restore formatting
benegee Jun 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ for human readability.
## Changes in the v0.16 lifecycle

#### Added
- Experimental support for auxiliary variables ([#2348]).
An additional container `aux_vars` in `cache` is made available in central functions like
flux computations. Possible applications are steady background states, variable velocity
fields, geometrical information, or any other pointwise, passive (constant in time)
quantity that is required in addition to the unknows in the governing equations. The
auxiliary variables are set up by supplying a function to the
`SemidiscretizationHyperbolic` constructor via the keyword argument `aux_field`.
The current `equations` need to set `have_aux_node_vars to `True()` and `n_aux_node_vars`
to the number of auxiliary variables per node.
So far, a simplifying continuity assumption is made for the auxiliary variables, which
e.g. allows to directly compute values at neighboring (mortar) interfaces instead of
MPI-communicating their values.
- Added support for plotting 1D solutions with Makie.jl, matching the existing Plots.jl interface ([#3035]).
- `VolumeIntegralAdaptive` is now also available with `VolumeIntegralSubcellLimiting` for `TreeMesh` in 2D and 3D using the heuristic a-priori indicator `IndicatorHennemannGassner` ([#2924], [#2986]).
- A new EOS type `AbstractHelmholtzEOS`, with concrete implementation `HelmholtzIdealGas`. This implementation roughly follows Klein et al.'s approach in
Expand Down
66 changes: 66 additions & 0 deletions examples/tree_2d_dgsem/elixir_acoustics_convergence_auxvars.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
using OrdinaryDiffEqLowStorageRK
using Trixi

###############################################################################
# semidiscretization of the acoustic perturbation equations

function auxiliary_variables_mean_values(x, equations)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense (or be interesting) to compute first the initial condition and then pass also the initial condition u0 as a parameter to the auxiliary field function?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this would be convenient when e.g. setting up perturbations of a steady background state.

However, u0 is computed using compute_coefficients(t, semi), which takes a Semidiscretization object, right?

# constant auxiliary variables (mean state)
return global_mean_vars(equations)
end
Comment on lines +8 to +10

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it really make sense to introduce this set of equations if the auxiliary variables are only given by some constants that are also stored in the equations? Could it be better to use something that appears to be less artificial, e.g., a 2D linear advection equation with variable velocity field? If it is required to be divergence free, a reasonable discretization can be a split form (but we can test the weak form as well, of course).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is indeed not really useful; merely a proof of concept that can be compared to something in main as a sanity check.

Non trivial velocity fields would be more exciting. I like the swirling flow by LeVeque:
swirling

Although in this form it requires time dependent aux vars, which I added quick and dirty here

# Recompute aux vars
@trixi_timeit_ext backend timer() "recompute aux vars" begin
recompute_aux_vars!(mesh, have_aux_node_vars(equations), equations, dg, cache,
t)

One could of course start with a time constant variant of it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice example! Something like this with constant-in-time (but variable-in-space) velocity would already be nice to ensure that the non-constant case works as expected.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in examples/tree_2d_dgsem/elixir_advection_variable_swirling_flow.jl


equations = AcousticPerturbationEquations2DAuxVars(v_mean_global = (0.5, 0.3),
c_mean_global = 2.0,
rho_mean_global = 0.9)

initial_condition = initial_condition_convergence_test

# Create DG solver with polynomial degree = 3 and (local) Lax-Friedrichs/Rusanov flux as surface flux
solver = DGSEM(polydeg = 3, surface_flux = flux_lax_friedrichs)

coordinates_min = (0.0, 0.0) # minimum coordinates (min(x), min(y))
coordinates_max = (2.0, 2.0) # maximum coordinates (max(x), max(y))

# Create a uniformly refined mesh with periodic boundaries
mesh = TreeMesh(coordinates_min, coordinates_max,
initial_refinement_level = 3,
n_cells_max = 30_000, periodicity = true) # set maximum capacity of tree data structure

# A semidiscretization collects data structures and functions for the spatial discretization
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver,
source_terms = source_terms_convergence_test,
boundary_conditions = boundary_condition_periodic,
aux_field = auxiliary_variables_mean_values)
Comment thread
benegee marked this conversation as resolved.

###############################################################################
# ODE solvers, callbacks etc.

# Create ODE problem with time span from 0.0 to 1.0
tspan = (0.0, 1.0)
ode = semidiscretize(semi, tspan)

# At the beginning of the main loop, the SummaryCallback prints a summary of the simulation setup
# and resets the timers
summary_callback = SummaryCallback()

# The AnalysisCallback allows to analyse the solution in regular intervals and prints the results
analysis_callback = AnalysisCallback(semi, interval = 100)

# The SaveSolutionCallback allows to save the solution to a file in regular intervals
save_solution = SaveSolutionCallback(interval = 100,
solution_variables = cons2prim)

# The StepsizeCallback handles the re-calculation of the maximum Δt after each time step
stepsize_callback = StepsizeCallback(cfl = 0.5)

# Create a CallbackSet to collect all callbacks such that they can be passed to the ODE solver
callbacks = CallbackSet(summary_callback, analysis_callback, save_solution,
stepsize_callback)

###############################################################################
# run the simulation

# OrdinaryDiffEq's `solve` method evolves the solution in time and executes the passed callbacks
sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false);
dt = 1.0, # solve needs some value here but it will be overwritten by the stepsize_callback
ode_default_options()..., callback = callbacks);
95 changes: 95 additions & 0 deletions examples/tree_2d_dgsem/elixir_acoustics_gauss_wall_amr_auxvars.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
using OrdinaryDiffEqLowStorageRK
using Trixi
using Plots

###############################################################################
# semidiscretization of the acoustic perturbation equations

equations = AcousticPerturbationEquations2DAuxVars(v_mean_global = (0.5, 0.0),
c_mean_global = 1.0,
rho_mean_global = 1.0)

# Create DG solver with polynomial degree = 5 and (local) Lax-Friedrichs/Rusanov flux as surface flux
solver = DGSEM(polydeg = 5, surface_flux = flux_lax_friedrichs)

coordinates_min = (-100.0, 0.0) # minimum coordinates (min(x), min(y))
coordinates_max = (100.0, 200.0) # maximum coordinates (max(x), max(y))

# Create a uniformly refined mesh with periodic boundaries
mesh = TreeMesh(coordinates_min, coordinates_max,
initial_refinement_level = 2,
n_cells_max = 100_000,
periodicity = false)

"""
initial_condition_gauss_wall(x, t, equations::AcousticPerturbationEquations2DAuxVars)

A Gaussian pulse, used in the `gauss_wall` example elixir in combination with
[`boundary_condition_wall`](@ref). Uses the global mean values from `equations`.
"""
function initial_condition_gauss_wall(x, t,
equations::AcousticPerturbationEquations2DAuxVars)
RealT = eltype(x)
v1_prime = 0
v2_prime = 0
p_prime = exp(-log(convert(RealT, 2)) * (x[1]^2 + (x[2] - 25)^2) / 25)
p_prime_scaled = p_prime / equations.c_mean_global^2

return SVector(v1_prime, v2_prime, p_prime_scaled)
end
initial_condition = initial_condition_gauss_wall

function auxiliary_variables_mean_values(x, equations)
# constant auxiliary variables (mean state)
return global_mean_vars(equations)
end

@inline function p_prime(u, equations::AcousticPerturbationEquations2DAuxVars)
return u[3]
end

# A semidiscretization collects data structures and functions for the spatial discretization
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver,
boundary_conditions = boundary_condition_wall,
aux_field = auxiliary_variables_mean_values)

###############################################################################
# ODE solvers, callbacks etc.

# Create ODE problem with time span from 0.0 to 30.0
tspan = (0.0, 30.0)
ode = semidiscretize(semi, tspan)

# At the beginning of the main loop, the SummaryCallback prints a summary of the simulation setup
# and resets the timers
summary_callback = SummaryCallback()

# The AnalysisCallback allows to analyse the solution in regular intervals and prints the results
analysis_callback = AnalysisCallback(semi, interval = 100)

# The SaveSolutionCallback allows to save the solution to a file in regular intervals
save_solution = SaveSolutionCallback(interval = 100, solution_variables = cons2state)

# The StepsizeCallback handles the re-calculation of the maximum Δt after each time step
stepsize_callback = StepsizeCallback(cfl = 0.7)

amr_controller = ControllerThreeLevel(semi, IndicatorMax(semi, variable = p_prime),
base_level = 2,
med_level = 4, med_threshold = 0.1,
max_level = 5, max_threshold = 0.2)
amr_callback = AMRCallback(semi, amr_controller,
interval = 5,
adapt_initial_condition = true,
adapt_initial_condition_only_refine = true)

# Create a CallbackSet to collect all callbacks such that they can be passed to the ODE solver
callbacks = CallbackSet(summary_callback, analysis_callback, save_solution,
amr_callback, stepsize_callback)

###############################################################################
# run the simulation

# OrdinaryDiffEq's `solve` method evolves the solution in time and executes the passed callbacks
sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false);
dt = 1.0, # solve needs some value here but it will be overwritten by the stepsize_callback
ode_default_options()..., callback = callbacks)
81 changes: 81 additions & 0 deletions examples/tree_2d_dgsem/elixir_acoustics_gauss_wall_auxvars.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
using OrdinaryDiffEqLowStorageRK
using Trixi

###############################################################################
# semidiscretization of the acoustic perturbation equations

equations = AcousticPerturbationEquations2DAuxVars(v_mean_global = (0.5, 0.0),
c_mean_global = 1.0,
rho_mean_global = 1.0)

# Create DG solver with polynomial degree = 5 and (local) Lax-Friedrichs/Rusanov flux as surface flux
solver = DGSEM(polydeg = 5, surface_flux = flux_lax_friedrichs)

coordinates_min = (-100.0, 0.0) # minimum coordinates (min(x), min(y))
coordinates_max = (100.0, 200.0) # maximum coordinates (max(x), max(y))

# Create a uniformly refined mesh with periodic boundaries
mesh = TreeMesh(coordinates_min, coordinates_max,
initial_refinement_level = 4,
n_cells_max = 100_000,
periodicity = false)

"""
initial_condition_gauss_wall(x, t, equations::AcousticPerturbationEquations2DAuxVars)

A Gaussian pulse, used in the `gauss_wall` example elixir in combination with
[`boundary_condition_wall`](@ref). Uses the global mean values from `equations`.
"""
function initial_condition_gauss_wall(x, t,
equations::AcousticPerturbationEquations2DAuxVars)
RealT = eltype(x)
v1_prime = 0
v2_prime = 0
p_prime = exp(-log(convert(RealT, 2)) * (x[1]^2 + (x[2] - 25)^2) / 25)
p_prime_scaled = p_prime / equations.c_mean_global^2

return SVector(v1_prime, v2_prime, p_prime_scaled)
end
initial_condition = initial_condition_gauss_wall

function auxiliary_variables_mean_values(x, equations)
# constant auxiliary variables (mean state)
return global_mean_vars(equations)
end

# A semidiscretization collects data structures and functions for the spatial discretization
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver,
boundary_conditions = boundary_condition_wall,
aux_field = auxiliary_variables_mean_values)

###############################################################################
# ODE solvers, callbacks etc.

# Create ODE problem with time span from 0.0 to 30.0
tspan = (0.0, 30.0)
ode = semidiscretize(semi, tspan)

# At the beginning of the main loop, the SummaryCallback prints a summary of the simulation setup
# and resets the timers
summary_callback = SummaryCallback()

# The AnalysisCallback allows to analyse the solution in regular intervals and prints the results
analysis_callback = AnalysisCallback(semi, interval = 100)

# The SaveSolutionCallback allows to save the solution to a file in regular intervals
save_solution = SaveSolutionCallback(interval = 100, solution_variables = cons2state)

# The StepsizeCallback handles the re-calculation of the maximum Δt after each time step
stepsize_callback = StepsizeCallback(cfl = 0.7)

# Create a CallbackSet to collect all callbacks such that they can be passed to the ODE solver
callbacks = CallbackSet(summary_callback, analysis_callback, save_solution,
stepsize_callback)

###############################################################################
# run the simulation

# OrdinaryDiffEq's `solve` method evolves the solution in time and executes the passed callbacks
sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false);
dt = 1.0, # solve needs some value here but it will be overwritten by the stepsize_callback
ode_default_options()..., callback = callbacks)
126 changes: 126 additions & 0 deletions examples/tree_2d_dgsem/elixir_advection_variable_swirling_flow.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
using OrdinaryDiffEqLowStorageRK
using Trixi
using Plots

# Advection test case following
# Randall J. LeVeque
# High-Resolution Conservative Algorithms for Advection in Incompressible Flow
# https://doi.org/10.1137/0733033

############################################################################################
# initial condition

equations = LinearVariableScalarAdvectionEquation2D()

function initial_condition_advected_objects(x, t,
equations::LinearVariableScalarAdvectionEquation2D)
RealT = eltype(x)

# smooth hump
x_0, y_0, r_0 = 0.25f0, 0.5f0, convert(RealT, 0.15)
r = sqrt((x[1] - x_0)^2 + (x[2] - y_0)^2)
r = min(r, r_0) / r_0
hump = 0.25f0 * (1 + cospi(r))

# cone
x_1, y_1, r_1 = 0.5f0, 0.25f0, convert(RealT, 0.15)
r = sqrt((x[1] - x_1)^2 + (x[2] - y_1)^2)
cone = 1.0f0 - min(r, r_1) / r_1

# slotted disc
x_2, y_2, r_2 = 0.5f0, 0.75f0, convert(RealT, 0.15)
w, l = 0.05f0, convert(RealT, 0.25)
r = sqrt((x[1] - x_2)^2 + (x[2] - y_2)^2)
disc = 0
if r <= r_2 && (x[2] >= y_2 - r_2 + l || abs(x[1] - x_2) >= w)
disc = 1.0f0
end

return SVector(hump + cone + disc)
end

# velocity field at time t = 0 (see reference)
@inline function velocity_swirling(x, equations)
u = sinpi(x[1])^2 * sinpi(2 * x[2])
v = -sinpi(x[2])^2 * sinpi(2 * x[1])
return SVector(u, v)
end

############################################################################################
# semidiscretization
polydeg = 3

initial_condition = initial_condition_advected_objects

surface_flux = flux_lax_friedrichs
solver = DGSEM(polydeg = polydeg, surface_flux = surface_flux)

coordinates_min = (0.0, 0.0)
coordinates_max = (1.0, 1.0)

mesh = TreeMesh(coordinates_min, coordinates_max,
initial_refinement_level = 2,
periodicity = false)

# boundary conditions
boundary_condition_dirichlet = BoundaryConditionDirichlet(initial_condition_advected_objects)
boundary_conditions = (; x_neg = boundary_condition_dirichlet,
x_pos = boundary_condition_dirichlet,
y_neg = boundary_condition_dirichlet,
y_pos = boundary_condition_dirichlet)

# the velocity is passed as auxiliary_field into the cache
semi = SemidiscretizationHyperbolic(mesh,
equations,
initial_condition,
solver,
boundary_conditions = boundary_conditions,
aux_field = velocity_swirling)

##############################################################################################
# ODE solvers, callbacks etc.

tspan = (0.0, 1.0)
ode = semidiscretize(semi, tspan)

summary_callback = SummaryCallback()

analysis_interval = 100
solution_variables = cons2prim

analysis_callback = AnalysisCallback(semi,
interval = analysis_interval)

alive_callback = AliveCallback(analysis_interval = analysis_interval)

save_solution = SaveSolutionCallback(interval = 10,
save_initial_solution = true,
save_final_solution = true,
output_directory = "out_swirling",
solution_variables = solution_variables)

amr_controller = ControllerThreeLevel(semi, IndicatorMax(semi, variable = first),
base_level = 2,
med_level = 4, med_threshold = 0.3,
max_level = 6, max_threshold = 0.8)
amr_callback = AMRCallback(semi, amr_controller,
interval = 20,
adapt_initial_condition = true,
adapt_initial_condition_only_refine = true)

stepsize_callback = StepsizeCallback(cfl = 1.0)

visualization = VisualizationCallback(semi; interval = 20) #, show_mesh = true)

callbacks = CallbackSet(summary_callback,
analysis_callback,
alive_callback,
stepsize_callback,
amr_callback,
#visualization,
save_solution)

###############################################################################
# run the simulation
sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false);
dt = 1.0, ode_default_options()..., callback = callbacks);
Loading