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

Fix sign error in 3D DGMultiFDSBP elixir #2164

Merged
merged 5 commits into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 4 additions & 1 deletion src/solvers/dgmulti/sbp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,10 @@ function calc_volume_integral!(du, u, mesh::DGMultiMesh,
for id in nzrange(A_base, i)
j = rows[id]
u_j = u[j]
A_ij = vals[id]

# we use the negative of A_ij since A is skew-symmetric,
# and we are accessing the transpose of A.
A_ij = -vals[id]
AF_ij = 2 * A_ij *
volume_flux(u_i, u_j, normal_direction, equations)
du_i = du_i + AF_ij
Expand Down
29 changes: 28 additions & 1 deletion test/test_threaded.jl
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ end
end
end

@trixi_testset "elixir_euler_fdsbp_periodic.jl" begin
@trixi_testset "elixir_euler_fdsbp_periodic.jl (2D)" begin
@test_trixi_include(joinpath(examples_dir(), "dgmulti_2d",
"elixir_euler_fdsbp_periodic.jl"),
l2=[
Expand All @@ -467,6 +467,33 @@ end
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000
end
end

@trixi_testset "elixir_euler_fdsbp_periodic.jl (3D)" begin
@test_trixi_include(joinpath(examples_dir(),
"dgmulti_3d/elixir_euler_fdsbp_periodic.jl"),
l2=[
7.561896970325353e-5,
6.884047859361093e-5,
6.884047859363204e-5,
6.884047859361148e-5,
0.000201107274617457
],
linf=[
0.0001337520020225913,
0.00011571467799287305,
0.0001157146779990903,
0.00011571467799376123,
0.0003446082308800058
])
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
let
t = sol.t[end]
u_ode = sol.u[end]
du_ode = similar(u_ode)
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
end
end
end
end

Expand Down
Loading