Skip to content

Commit

Permalink
BUGFIX: apply_jacobian_parabolic! was incorrect for P4estMesh
Browse files Browse the repository at this point in the history
  • Loading branch information
jlchan committed Oct 7, 2023
1 parent 39cc7b8 commit e33bcfa
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/solvers/dgsem_tree/dg_2d_parabolic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ end
# This is because the parabolic fluxes are assumed to be of the form
# `du/dt + df/dx = dg/dx + source(x,t)`,
# where f(u) is the inviscid flux and g(u) is the viscous flux.
function apply_jacobian_parabolic!(du, mesh::Union{TreeMesh{2}, P4estMesh{2}},
function apply_jacobian_parabolic!(du, mesh::TreeMesh{2},
equations::AbstractEquationsParabolic, dg::DG, cache)
@unpack inverse_jacobian = cache.elements

Expand All @@ -950,4 +950,23 @@ function apply_jacobian_parabolic!(du, mesh::Union{TreeMesh{2}, P4estMesh{2}},

return nothing
end

function apply_jacobian_parabolic!(du, mesh::P4estMesh{2},
equations::AbstractEquationsParabolic,
dg::DG, cache)
@unpack inverse_jacobian = cache.elements

@threaded for element in eachelement(dg, cache)
for j in eachnode(dg), i in eachnode(dg)
factor = inverse_jacobian[i, j, element]

for v in eachvariable(equations)
du[v, i, j, element] *= factor
end
end
end

return nothing
end

end # @muladd

0 comments on commit e33bcfa

Please sign in to comment.