Skip to content

Commit

Permalink
Start
Browse files Browse the repository at this point in the history
  • Loading branch information
huiyuxie committed Sep 15, 2024
1 parent 03ac99b commit 0317588
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
8 changes: 8 additions & 0 deletions src/solvers/dg_3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1285,6 +1285,14 @@ function cuda_interface_flux!(mesh::TreeMesh{3}, nonconservative_terms::False, e
return nothing
end

# Pack kernels for calculating interface fluxes
function cuda_interface_flux!(mesh::TreeMesh{3}, nonconservative_terms::True, equations, dg::DGSEM,
cache)
surface_flux, nonconservative_flux = dg.surface_integral.surface_flux

return nothing
end

# Dummy function for asserting boundaries
function cuda_prolong2boundaries!(u, mesh::TreeMesh{3},
boundary_condition::BoundaryConditionPeriodic, equations, cache)
Expand Down
12 changes: 6 additions & 6 deletions test/test_script.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ TrixiGPU.cuda_prolong2interfaces!(u_gpu, mesh_gpu, equations_gpu, cache_gpu)
Trixi.prolong2interfaces!(cache, u, mesh, equations, solver.surface_integral, solver)
@test_approx cache_gpu.interfaces.u cache.interfaces.u

# # Test `cuda_interface_flux!`
# TrixiGPU.cuda_interface_flux!(mesh_gpu, Trixi.have_nonconservative_terms(equations_gpu),
# equations_gpu, solver_gpu, cache_gpu)
# Trixi.calc_interface_flux!(cache.elements.surface_flux_values, mesh,
# Trixi.have_nonconservative_terms(equations), equations,
# solver.surface_integral, solver, cache)
# Test `cuda_interface_flux!`
TrixiGPU.cuda_interface_flux!(mesh_gpu, Trixi.have_nonconservative_terms(equations_gpu),
equations_gpu, solver_gpu, cache_gpu)
Trixi.calc_interface_flux!(cache.elements.surface_flux_values, mesh,
Trixi.have_nonconservative_terms(equations), equations,
solver.surface_integral, solver, cache)
# @test_approx cache_gpu.elements.surface_flux_values ≈ cache.elements.surface_flux_values

# # Test `cuda_prolong2boundaries!`
Expand Down

0 comments on commit 0317588

Please sign in to comment.