@@ -10,24 +10,26 @@ function Trixi.rhs!(du, u, t,
1010 equations:: AbstractCovariantEquations{2} ,
1111 boundary_conditions, source_terms:: Source ,
1212 dg:: DG , cache) where {Source}
13+ backend = trixi_backend (u)
14+
1315 # Reset du
1416 Trixi. @trixi_timeit Trixi. timer () " reset ∂u/∂t" Trixi. set_zero! (du, dg, cache)
1517
1618 # Calculate volume integral
1719 Trixi. @trixi_timeit Trixi. timer () " volume integral" begin
18- Trixi. calc_volume_integral! (du, u, mesh,
20+ Trixi. calc_volume_integral! (backend, du, u, mesh,
1921 Trixi. have_nonconservative_terms (equations),
2022 equations, dg. volume_integral, dg, cache)
2123 end
2224
2325 # Prolong solution to interfaces
2426 Trixi. @trixi_timeit Trixi. timer () " prolong2interfaces" begin
25- Trixi. prolong2interfaces! (cache, u, mesh, equations, dg)
27+ Trixi. prolong2interfaces! (backend, cache, u, mesh, equations, dg)
2628 end
2729
2830 # Calculate interface fluxes
2931 Trixi. @trixi_timeit Trixi. timer () " interface flux" begin
30- Trixi. calc_interface_flux! (cache. elements. surface_flux_values, mesh,
32+ Trixi. calc_interface_flux! (backend, cache. elements. surface_flux_values, mesh,
3133 Trixi. have_nonconservative_terms (equations),
3234 equations, dg. surface_integral, dg, cache)
3335 end
@@ -48,12 +50,14 @@ function Trixi.rhs!(du, u, t,
4850
4951 # Calculate surface integrals
5052 Trixi. @trixi_timeit Trixi. timer () " surface integral" begin
51- Trixi. calc_surface_integral! (du, u, mesh, equations, dg. surface_integral, dg,
53+ Trixi. calc_surface_integral! (backend, du, u, mesh, equations,
54+ dg. surface_integral, dg,
5255 cache)
5356 end
5457
5558 # Apply Jacobian from mapping to reference element
56- Trixi. @trixi_timeit Trixi. timer () " Jacobian" Trixi. apply_jacobian! (du, mesh,
59+ Trixi. @trixi_timeit Trixi. timer () " Jacobian" Trixi. apply_jacobian! (backend, du,
60+ mesh,
5761 equations, dg,
5862 cache)
5963
126130
127131# Flux differencing kernel which uses contravariant flux components, passing the geometric
128132# information contained in the auxiliary variables to the flux function
129- @inline function Trixi. flux_differencing_kernel! (du, u, element, mesh :: P4estMesh{2} ,
133+ @inline function Trixi. flux_differencing_kernel! (du, u, element, :: Type{<: P4estMesh{2} } ,
130134 nonconservative_terms:: False ,
131135 equations:: AbstractCovariantEquations{2} ,
132136 volume_flux, dg:: DGSEM , cache,
180184# Non-conservative flux differencing kernel which uses contravariant flux components,
181185# passing the geometric information contained in the auxiliary variables to the flux
182186# function
183- @inline function Trixi. flux_differencing_kernel! (du, u, element, mesh:: P4estMesh{2} ,
187+ @inline function Trixi. flux_differencing_kernel! (du, u, element,
188+ MeshT:: Type{<:P4estMesh{2}} ,
184189 nonconservative_terms:: True ,
185190 equations:: AbstractCovariantEquations{2} ,
186191 volume_flux, dg:: DGSEM , cache,
190195 symmetric_flux, nonconservative_flux = volume_flux
191196
192197 # Apply the symmetric flux as usual
193- Trixi. flux_differencing_kernel! (du, u, element, mesh , False (), equations,
198+ Trixi. flux_differencing_kernel! (du, u, element, MeshT , False (), equations,
194199 symmetric_flux, dg, cache, alpha)
195200
196201 for j in eachnode (dg), i in eachnode (dg)
@@ -230,11 +235,12 @@ end
230235# Calculate the interface flux directly in the local coordinate system. This function
231236# differs from the standard approach in Trixi.jl in that one does not need to pass the
232237# normal vector to the pointwise flux calculation.
233- function Trixi. calc_interface_flux! (surface_flux_values,
238+ function Trixi. calc_interface_flux! (backend :: Nothing , surface_flux_values,
234239 mesh:: P4estMesh{2} ,
235240 nonconservative_terms,
236241 equations:: AbstractCovariantEquations{2} ,
237- surface_integral, dg:: DG , cache)
242+ surface_integral,
243+ dg:: DGSEM{<:LobattoLegendreBasis} , cache)
238244 (; neighbor_ids, node_indices) = cache. interfaces
239245 index_range = eachnode (dg)
240246 index_end = last (index_range)
294300@inline function Trixi. calc_interface_flux! (surface_flux_values, mesh:: P4estMesh{2} ,
295301 nonconservative_terms:: False ,
296302 equations:: AbstractCovariantEquations{2} ,
297- surface_integral, dg:: DG , cache,
303+ surface_integral,
304+ dg:: DGSEM{<:LobattoLegendreBasis} , cache,
298305 interface_index,
299306 primary_node_index,
300307 primary_direction_index,
355362@inline function Trixi. calc_interface_flux! (surface_flux_values, mesh:: P4estMesh{2} ,
356363 nonconservative_terms:: True ,
357364 equations:: AbstractCovariantEquations{2} ,
358- surface_integral, dg:: DG , cache,
365+ surface_integral,
366+ dg:: DGSEM{<:LobattoLegendreBasis} , cache,
359367 interface_index,
360368 primary_node_index,
361369 primary_direction_index,
@@ -449,7 +457,7 @@ function Trixi.calc_sources!(du, u, t, source_terms::Nothing,
449457end
450458
451459# Apply the exact Jacobian stored in auxiliary variables
452- function Trixi. apply_jacobian! (du, mesh:: P4estMesh{2} ,
460+ function Trixi. apply_jacobian! (backend :: Nothing , du, mesh:: P4estMesh{2} ,
453461 equations:: AbstractCovariantEquations{2} ,
454462 dg:: DG , cache)
455463 (; aux_node_vars) = cache. auxiliary_variables
0 commit comments