@@ -22,12 +22,7 @@ include("test_trixiatmo.jl")
2222 # and small reference values
2323 # Ensure that we do not have excessive memory allocations
2424 # (e.g., from type instabilities)
25- let
26- t = sol. t[end ]
27- u_ode = sol. u[end ]
28- du_ode = similar (u_ode)
29- @test (@allocated TrixiAtmo. Trixi. rhs! (du_ode, u_ode, semi, t)) < 100
30- end
25+ @test_allocations (TrixiAtmo. Trixi. rhs!, semi, sol, 100 )
3126end
3227
3328@trixi_testset " Spherical advection (quad icosahedron), Cartesian weak form, LLF surface flux" begin
5045 # and small reference values
5146 # Ensure that we do not have excessive memory allocations
5247 # (e.g., from type instabilities)
53- let
54- t = sol. t[end ]
55- u_ode = sol. u[end ]
56- du_ode = similar (u_ode)
57- @test (@allocated TrixiAtmo. Trixi. rhs! (du_ode, u_ode, semi, t)) < 100
58- end
48+ @test_allocations (TrixiAtmo. Trixi. rhs!, semi, sol, 100 )
5949end
6050
6151@trixi_testset " Spherical advection, Cartesian weak form, element-local mapping" begin
7868 # and small reference values
7969 # Ensure that we do not have excessive memory allocations
8070 # (e.g., from type instabilities)
81- let
82- t = sol. t[end ]
83- u_ode = sol. u[end ]
84- du_ode = similar (u_ode)
85- @test (@allocated TrixiAtmo. Trixi. rhs! (du_ode, u_ode, semi, t)) < 100
86- end
71+ @test_allocations (TrixiAtmo. Trixi. rhs!, semi, sol, 100 )
8772end
8873
8974@trixi_testset " Spherical advection, covariant weak form, LLF surface flux" begin
9378 linf= [14.235905681508598 , 0.0 , 0.0 ])
9479 # Ensure that we do not have excessive memory allocations
9580 # (e.g., from type instabilities)
96- let
97- t = sol. t[end ]
98- u_ode = sol. u[end ]
99- du_ode = similar (u_ode)
100- @test (@allocated TrixiAtmo. Trixi. rhs! (du_ode, u_ode, semi, t)) < 100
101- end
81+ @test_allocations (TrixiAtmo. Trixi. rhs!, semi, sol, 100 )
10282end
10383
10484@trixi_testset " Spherical advection, covariant weak form, LLF surface flux, global spherical coords" begin
10989 global_coordinate_system= GlobalSphericalCoordinates ())
11090 # Ensure that we do not have excessive memory allocations
11191 # (e.g., from type instabilities)
112- let
113- t = sol. t[end ]
114- u_ode = sol. u[end ]
115- du_ode = similar (u_ode)
116- @test (@allocated TrixiAtmo. Trixi. rhs! (du_ode, u_ode, semi, t)) < 100
117- end
92+ @test_allocations (TrixiAtmo. Trixi. rhs!, semi, sol, 100 )
11893end
11994
12095# The covariant flux-differencing form should be equivalent to the weak form when the
127102 volume_integral= VolumeIntegralFluxDifferencing (flux_central))
128103 # Ensure that we do not have excessive memory allocations
129104 # (e.g., from type instabilities)
130- let
131- t = sol. t[end ]
132- u_ode = sol. u[end ]
133- du_ode = similar (u_ode)
134- @test (@allocated TrixiAtmo. Trixi. rhs! (du_ode, u_ode, semi, t)) < 100
135- end
105+ @test_allocations (TrixiAtmo. Trixi. rhs!, semi, sol, 100 )
136106end
137107
138108# Version with arithmetic mean used for both the volume and surface fluxes
145115 surface_flux= flux_central)
146116 # Ensure that we do not have excessive memory allocations
147117 # (e.g., from type instabilities)
148- let
149- t = sol. t[end ]
150- u_ode = sol. u[end ]
151- du_ode = similar (u_ode)
152- @test (@allocated TrixiAtmo. Trixi. rhs! (du_ode, u_ode, semi, t)) < 100
153- end
118+ @test_allocations (TrixiAtmo. Trixi. rhs!, semi, sol, 100 )
154119end
155120
156121@trixi_testset " Spherical advection on icosahedral grid, covariant weak form, LLF surface flux" begin
160125 linf= [13.54834739856517 , 0.0 , 0.0 ])
161126 # Ensure that we do not have excessive memory allocations
162127 # (e.g., from type instabilities)
163- let
164- t = sol. t[end ]
165- u_ode = sol. u[end ]
166- du_ode = similar (u_ode)
167- @test (@allocated TrixiAtmo. Trixi. rhs! (du_ode, u_ode, semi, t)) < 100
168- end
128+ @test_allocations (TrixiAtmo. Trixi. rhs!, semi, sol, 100 )
169129end
170130
171131end # module
0 commit comments