• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

trixi-framework / Trixi.jl / 21638916092

03 Feb 2026 04:42PM UTC coverage: 25.939% (-71.1%) from 97.034%
21638916092

Pull #2754

github

web-flow
Merge ee9b4b1c0 into ead0db32a
Pull Request #2754: `VolumeIntegralAdaptive` with `IndicatorEntropyChange`

0 of 83 new or added lines in 6 files covered. (0.0%)

31545 existing lines in 536 files now uncovered.

11563 of 44578 relevant lines covered (25.94%)

469675.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/examples/tree_3d_dgsem/elixir_euler_sedov_scO2.jl
1
using OrdinaryDiffEqSSPRK
2
using Trixi
3

4
###############################################################################
5
# semidiscretization of the compressible Euler equations
6

7
equations = CompressibleEulerEquations3D(1.4)
8

9
"""
10
    initial_condition_sedov_blast_wave(x, t, equations::CompressibleEulerEquations3D)
11

12
The Sedov blast wave setup based on example 35.1.4 from Flash
13
- https://flash.rochester.edu/site/flashcode/user_support/flash4_ug_4p8.pdf
14
"""
UNCOV
15
function initial_condition_sedov_blast_wave(x, t, equations::CompressibleEulerEquations3D)
×
16
    # Set up polar coordinates
UNCOV
17
    RealT = eltype(x)
×
UNCOV
18
    inicenter = SVector(0, 0, 0)
×
UNCOV
19
    x_norm = x[1] - inicenter[1]
×
UNCOV
20
    y_norm = x[2] - inicenter[2]
×
UNCOV
21
    z_norm = x[3] - inicenter[3]
×
UNCOV
22
    r = sqrt(x_norm^2 + y_norm^2 + z_norm^2)
×
23

24
    # Setup based on example 35.1.4 in https://flash.rochester.edu/site/flashcode/user_support/flash4_ug_4p8.pdf
UNCOV
25
    r0 = 0.21875f0 # = 3.5 * smallest dx (for domain length=4 and max-ref=6)
×
UNCOV
26
    E = 1
×
UNCOV
27
    nu = 3 # dims
×
UNCOV
28
    p0_inner = 3 * (equations.gamma - 1) * E / ((nu + 1) * convert(RealT, pi) * r0^nu)
×
UNCOV
29
    p0_outer = convert(RealT, 1.0e-5) # = true Sedov setup
×
30

31
    # Calculate primitive variables
UNCOV
32
    rho = 1
×
UNCOV
33
    v1 = 0
×
UNCOV
34
    v2 = 0
×
UNCOV
35
    v3 = 0
×
UNCOV
36
    p = r > r0 ? p0_outer : p0_inner
×
37

UNCOV
38
    return prim2cons(SVector(rho, v1, v2, v3, p), equations)
×
39
end
40
initial_condition = initial_condition_sedov_blast_wave
41

42
surface_flux = flux_lax_friedrichs
43
volume_flux = flux_chandrashekar
44
basis = LobattoLegendreBasis(3)
45
indicator_sc = IndicatorHennemannGassner(equations, basis,
46
                                         alpha_max = 0.5,
47
                                         alpha_min = 0.001,
48
                                         alpha_smooth = true,
49
                                         variable = density_pressure)
50
volume_integral = VolumeIntegralShockCapturingRRG(basis, indicator_sc;
51
                                                  volume_flux_dg = volume_flux,
52
                                                  volume_flux_fv = surface_flux,
53
                                                  slope_limiter = minmod)
54

55
solver = DGSEM(basis, surface_flux, volume_integral)
56

57
coordinates_min = (-2.0, -2.0, -2.0)
58
coordinates_max = (2.0, 2.0, 2.0)
59
mesh = TreeMesh(coordinates_min, coordinates_max,
60
                initial_refinement_level = 4,
61
                n_cells_max = 1_000_000)
62

63
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver)
64

65
###############################################################################
66
# ODE solvers, callbacks etc.
67

68
tspan = (0.0, 1.0)
69
ode = semidiscretize(semi, tspan)
70

71
summary_callback = SummaryCallback()
72

73
analysis_interval = 1000
74
analysis_callback = AnalysisCallback(semi, interval = analysis_interval)
75

76
alive_callback = AliveCallback(alive_interval = 20)
77

78
amr_indicator = IndicatorHennemannGassner(semi,
79
                                          alpha_max = 1.0,
80
                                          alpha_min = 0.0,
81
                                          alpha_smooth = false,
82
                                          variable = density_pressure)
83

84
amr_controller = ControllerThreeLevel(semi, amr_indicator,
85
                                      base_level = 2,
86
                                      max_level = 6, max_threshold = 0.0003)
87

88
amr_callback = AMRCallback(semi, amr_controller,
89
                           interval = 2,
90
                           adapt_initial_condition = true,
91
                           adapt_initial_condition_only_refine = true)
92

93
stepsize_callback = StepsizeCallback(cfl = 0.5)
94

95
callbacks = CallbackSet(summary_callback,
96
                        analysis_callback, alive_callback,
97
                        amr_callback, stepsize_callback)
98

99
###############################################################################
100
# run the simulation
101

102
sol = solve(ode, SSPRK54(thread = Trixi.True()); dt = 1.0,
103
            ode_default_options()..., callback = callbacks);
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc