@@ -30,22 +30,22 @@ dg = DGMulti(polydeg = 3,
30
30
cells_per_dimension = (32 , 32 )
31
31
mesh = DGMultiMesh (dg,
32
32
cells_per_dimension, # initial_refinement_level = 5
33
- coordinates_min= (- 2.0 , - 2.0 ),
34
- coordinates_max= ( 2.0 , 2.0 ),
35
- periodicity= true )
33
+ coordinates_min = (- 2.0 , - 2.0 ),
34
+ coordinates_max = ( 2.0 , 2.0 ),
35
+ periodicity = true )
36
36
37
37
semi = SemidiscretizationHyperbolic (mesh, equations, initial_condition, dg,
38
- boundary_conditions= boundary_condition_periodic)
38
+ boundary_conditions = boundary_condition_periodic)
39
39
tspan = (0.0 , 0.4 )
40
40
ode = semidiscretize (semi, tspan)
41
41
42
- alive_callback = AliveCallback (alive_interval= 10 )
43
- analysis_callback = AnalysisCallback (semi, interval= 100 , uEltype= real (dg))
42
+ alive_callback = AliveCallback (alive_interval = 10 )
43
+ analysis_callback = AnalysisCallback (semi, interval = 100 , uEltype = real (dg))
44
44
callbacks = CallbackSet (analysis_callback, alive_callback);
45
45
46
46
# Run the simulation with the same time integration algorithm as before.
47
- sol = solve (ode, RDPK3SpFSAL49 (), abstol= 1.0e-6 , reltol= 1.0e-6 ,
48
- callback= callbacks, save_everystep= false );
47
+ sol = solve (ode, RDPK3SpFSAL49 (), abstol = 1.0e-6 , reltol = 1.0e-6 ,
48
+ callback = callbacks, save_everystep = false );
49
49
# -
50
50
using Plots
51
51
pd = PlotData2D (sol)
@@ -60,7 +60,6 @@ plot!(getmesh(pd))
60
60
# (2021) provides a nice runtime comparison between the different mesh types. On the other hand,
61
61
# the functions are more general and thus we have more option we can choose from.
62
62
63
-
64
63
# ## Simulation with Gauss nodes
65
64
# For instance, we can change the approximation type of our simulation.
66
65
using Trixi, OrdinaryDiffEq
@@ -78,28 +77,27 @@ dg = DGMulti(polydeg = 3,
78
77
79
78
cells_per_dimension = (32 , 32 )
80
79
mesh = DGMultiMesh (dg,
81
- cells_per_dimension, # initial_refinement_level = 5
82
- coordinates_min= (- 2.0 , - 2.0 ),
83
- coordinates_max= ( 2.0 , 2.0 ),
84
- periodicity= true )
80
+ cells_per_dimension, # initial_refinement_level = 5
81
+ coordinates_min = (- 2.0 , - 2.0 ),
82
+ coordinates_max = ( 2.0 , 2.0 ),
83
+ periodicity = true )
85
84
86
85
semi = SemidiscretizationHyperbolic (mesh, equations, initial_condition, dg,
87
- boundary_conditions= boundary_condition_periodic)
86
+ boundary_conditions = boundary_condition_periodic)
88
87
tspan = (0.0 , 0.4 )
89
88
ode = semidiscretize (semi, tspan)
90
89
91
- alive_callback = AliveCallback (alive_interval= 10 )
92
- analysis_callback = AnalysisCallback (semi, interval= 100 , uEltype= real (dg))
90
+ alive_callback = AliveCallback (alive_interval = 10 )
91
+ analysis_callback = AnalysisCallback (semi, interval = 100 , uEltype = real (dg))
93
92
callbacks = CallbackSet (analysis_callback, alive_callback);
94
93
95
- sol = solve (ode, RDPK3SpFSAL49 (); abstol= 1.0e-6 , reltol= 1.0e-6 ,
96
- ode_default_options ()... , callback= callbacks);
94
+ sol = solve (ode, RDPK3SpFSAL49 (); abstol = 1.0e-6 , reltol = 1.0e-6 ,
95
+ ode_default_options ()... , callback = callbacks);
97
96
# -
98
97
using Plots
99
98
pd = PlotData2D (sol)
100
99
plot (pd)
101
100
102
-
103
101
# ## Simulation with triangular elements
104
102
# Also, we can set another element type. We want to use triangles now.
105
103
using Trixi, OrdinaryDiffEq
@@ -119,21 +117,21 @@ dg = DGMulti(polydeg = 3,
119
117
cells_per_dimension = (32 , 32 )
120
118
mesh = DGMultiMesh (dg,
121
119
cells_per_dimension, # initial_refinement_level = 5
122
- coordinates_min= (- 2.0 , - 2.0 ),
123
- coordinates_max= ( 2.0 , 2.0 ),
124
- periodicity= true )
120
+ coordinates_min = (- 2.0 , - 2.0 ),
121
+ coordinates_max = ( 2.0 , 2.0 ),
122
+ periodicity = true )
125
123
126
124
semi = SemidiscretizationHyperbolic (mesh, equations, initial_condition, dg,
127
- boundary_conditions= boundary_condition_periodic)
125
+ boundary_conditions = boundary_condition_periodic)
128
126
tspan = (0.0 , 0.4 )
129
127
ode = semidiscretize (semi, tspan)
130
128
131
- alive_callback = AliveCallback (alive_interval= 10 )
132
- analysis_callback = AnalysisCallback (semi, interval= 100 , uEltype= real (dg))
129
+ alive_callback = AliveCallback (alive_interval = 10 )
130
+ analysis_callback = AnalysisCallback (semi, interval = 100 , uEltype = real (dg))
133
131
callbacks = CallbackSet (analysis_callback, alive_callback);
134
132
135
- sol = solve (ode, RDPK3SpFSAL49 (); abstol= 1.0e-6 , reltol= 1.0e-6 ,
136
- ode_default_options ()... , callback= callbacks);
133
+ sol = solve (ode, RDPK3SpFSAL49 (); abstol = 1.0e-6 , reltol = 1.0e-6 ,
134
+ ode_default_options ()... , callback = callbacks);
137
135
# -
138
136
using Plots
139
137
pd = PlotData2D (sol)
@@ -142,7 +140,6 @@ plot(pd)
142
140
plot (pd[" rho" ])
143
141
plot! (getmesh (pd))
144
142
145
-
146
143
# ## Triangular meshes on non-Cartesian domains
147
144
# To use triangular meshes on a non-Cartesian domain, Trixi.jl uses the package [StartUpDG.jl](https://github.com/jlchan/StartUpDG.jl).
148
145
# The following example is based on [`elixir_euler_triangulate_pkg_mesh.jl`](https://github.com/trixi-framework/Trixi.jl/blob/main/examples/dgmulti_2d/elixir_euler_triangulate_pkg_mesh.jl)
@@ -157,7 +154,7 @@ source_terms = source_terms_convergence_test
157
154
158
155
# We create the solver `DGMulti` with triangular elements (`Tri()`) as before.
159
156
dg = DGMulti (polydeg = 3 , element_type = Tri (),
160
- approximation_type= Polynomial (),
157
+ approximation_type = Polynomial (),
161
158
surface_flux = flux_lax_friedrichs,
162
159
volume_integral = VolumeIntegralFluxDifferencing (flux_ranocha))
163
160
@@ -168,11 +165,11 @@ meshIO = StartUpDG.triangulate_domain(StartUpDG.RectangularDomainWithHole());
168
165
169
166
# The pre-defined Triangulate geometry in StartUpDG has integer boundary tags. With [`DGMultiMesh`](@ref)
170
167
# we assign boundary faces based on these integer boundary tags and create a mesh compatible with Trixi.jl.
171
- mesh = DGMultiMesh (dg, meshIO, Dict (:outer_boundary => 1 , :inner_boundary => 2 ))
168
+ mesh = DGMultiMesh (dg, meshIO, Dict (:outer_boundary => 1 , :inner_boundary => 2 ))
172
169
# -
173
170
boundary_condition_convergence_test = BoundaryConditionDirichlet (initial_condition)
174
171
boundary_conditions = (; :outer_boundary => boundary_condition_convergence_test,
175
- :inner_boundary => boundary_condition_convergence_test)
172
+ :inner_boundary => boundary_condition_convergence_test)
176
173
177
174
semi = SemidiscretizationHyperbolic (mesh, equations, initial_condition, dg,
178
175
source_terms = source_terms,
@@ -181,12 +178,12 @@ semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, dg,
181
178
tspan = (0.0 , 0.2 )
182
179
ode = semidiscretize (semi, tspan)
183
180
184
- alive_callback = AliveCallback (alive_interval= 20 )
185
- analysis_callback = AnalysisCallback (semi, interval= 200 , uEltype= real (dg))
181
+ alive_callback = AliveCallback (alive_interval = 20 )
182
+ analysis_callback = AnalysisCallback (semi, interval = 200 , uEltype = real (dg))
186
183
callbacks = CallbackSet (alive_callback, analysis_callback);
187
184
188
- sol = solve (ode, CarpenterKennedy2N54 (williamson_condition= false ),
189
- dt = 0.5 * estimate_dt (mesh, dg), save_everystep= false , callback= callbacks);
185
+ sol = solve (ode, CarpenterKennedy2N54 (williamson_condition = false ),
186
+ dt = 0.5 * estimate_dt (mesh, dg), save_everystep = false , callback = callbacks);
190
187
# -
191
188
using Plots
192
189
pd = PlotData2D (sol)
@@ -195,7 +192,6 @@ plot!(getmesh(pd))
195
192
196
193
# For more information, please have a look in the [StartUpDG.jl documentation](https://jlchan.github.io/StartUpDG.jl/stable/).
197
194
198
-
199
195
# ## Package versions
200
196
201
197
# These results were obtained using the following versions.
@@ -205,4 +201,4 @@ versioninfo()
205
201
206
202
using Pkg
207
203
Pkg. status ([" Trixi" , " StartUpDG" , " OrdinaryDiffEq" , " Plots" ],
208
- mode= PKGMODE_MANIFEST)
204
+ mode = PKGMODE_MANIFEST)
0 commit comments