Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mean value in Zhang-Shu limiter on curved meshes #1945

Merged
merged 16 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/callbacks_stage/positivity_zhang_shu_dg2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function limiter_zhang_shu!(u, threshold::Real, variable,
total_volume = zero(eltype(u))
for j in eachnode(dg), i in eachnode(dg)
volume_jacobian = abs(inv(get_inverse_jacobian(inverse_jacobian, mesh,
element, i, j)))
i, j, element)))
u_node = get_node_vars(u, equations, dg, i, j, element)
u_mean += u_node * weights[i] * weights[j] * volume_jacobian
total_volume += weights[i] * weights[j] * volume_jacobian
Expand Down
2 changes: 1 addition & 1 deletion src/callbacks_stage/positivity_zhang_shu_dg3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function limiter_zhang_shu!(u, threshold::Real, variable,
total_volume = zero(eltype(u))
for k in eachnode(dg), j in eachnode(dg), i in eachnode(dg)
volume_jacobian = abs(inv(get_inverse_jacobian(inverse_jacobian, mesh,
element, i, j, k)))
i, j, k, element)))
u_node = get_node_vars(u, equations, dg, i, j, k, element)
u_mean += u_node * weights[i] * weights[j] * weights[k] * volume_jacobian
total_volume += weights[i] * weights[j] * weights[k] * volume_jacobian
Expand Down
4 changes: 2 additions & 2 deletions src/solvers/dgsem_structured/dg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ end
mesh::Union{StructuredMesh, StructuredMeshView,
UnstructuredMesh2D, P4estMesh,
T8codeMesh},
element, indices...)
return inverse_jacobian[indices..., element]
indices...)
return inverse_jacobian[indices...]
end

include("containers.jl")
Expand Down
4 changes: 2 additions & 2 deletions src/solvers/dgsem_tree/dg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ function volume_jacobian(element, mesh::TreeMesh, cache)
end

@inline function get_inverse_jacobian(inverse_jacobian, mesh::TreeMesh,
element, indices...)
return inverse_jacobian[element]
indices...)
return inverse_jacobian[last(indices...)]
ranocha marked this conversation as resolved.
Show resolved Hide resolved
end

# Indicators used for shock-capturing and AMR
Expand Down
Loading