Skip to content

Commit 78fbcfa

Browse files
authored
Merge branch 'main' into arr/euler_gravity_geopotential
2 parents 9a3ba67 + aa057e7 commit 78fbcfa

File tree

4 files changed

+27
-9
lines changed

4 files changed

+27
-9
lines changed

src/meshes/dgmulti_icosahedron_tri.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function DGMultiMeshTriIcosahedron2D(dg::DGMulti{NDIMS, <:Tri}, radius;
4242
vk = ntuple(n -> Vxyz_old[n][k], NDIMS_AMBIENT)
4343
vl = ntuple(n -> Vxyz_old[n][l], NDIMS_AMBIENT)
4444
midpoint = 0.5 .* (vk .+ vl)
45-
midpoint = midpoint .* (EARTH_RADIUS / norm(midpoint)) # Normalize to outer radius
45+
midpoint = midpoint .* (radius / norm(midpoint)) # Normalize to outer radius
4646
for n in 1:NDIMS_AMBIENT
4747
push!(Vxyz[n], midpoint[n])
4848
end

src/solvers/dgmulti/dg_manifold_covariant.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,15 @@ function Trixi.calc_interface_flux!(cache, surface_integral::SurfaceIntegralWeak
9797
uP = u_face_values[idP]
9898
auxM = aux_face_values[idM]
9999
auxP = aux_face_values[idP]
100+
100101
# Transform uP to the same coordinate system as uM
101102
uP_global = contravariant2global(uP, auxP, equations)
102103
uP_transformed_to_M = global2contravariant(uP_global, auxM, equations)
103104

104105
# Compute ref_index from face_node_index in order to access covariant normal vector
105106
# in reference element coordinates.
106107
ref_index = mod(face_node_index - 1, Nfq) + 1
107-
normal = SVector(ntuple(k -> nrstJ[k][ref_index], NDIMS))
108+
normal = SVector{NDIMS}(getindex.(nrstJ, ref_index))
108109

109110
flux_face_values[idM] = surface_flux(uM, uP_transformed_to_M, auxM, auxM, normal,
110111
equations)

test/test_2d_shallow_water_covariant.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,12 @@ end
102102

103103
@trixi_testset "elixir_tri_barotropic_instability" begin
104104
@test_trixi_include(joinpath(EXAMPLES_DIR,
105-
"elixir_barotropic_instability.jl"),
106-
l2=[41.05018196765347, 0.04598801953369521, 0.03324228006147076],
107-
linf=[202.17195189961058, 0.2046503536574818, 0.14813768215260187]),
108-
polydeg = 3,
109-
initial_refinement_level = 1,
110-
tspan = (0.0, 1.0 * SECONDS_PER_DAY)
105+
"elixir_tri_barotropic_instability.jl"),
106+
l2=[41.05018196765347, 0.04598801953369521, 0.03324228006147076],
107+
linf=[202.17195189961058, 0.2046503536574818, 0.14813768215260187],
108+
polydeg=3,
109+
initial_refinement_level=1,
110+
tspan=(0.0, 1.0 * SECONDS_PER_DAY))
111111
# Ensure that we do not have excessive memory allocations
112112
# (e.g., from type instabilities)
113113
@test_allocations(TrixiAtmo.Trixi.rhs!, semi, sol, 100)

test/test_threaded.jl

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,24 @@ include("test_trixiatmo.jl")
2929
tspan=(0.0, 0.1))
3030
# Ensure that we do not have excessive memory allocations
3131
# (e.g., from type instabilities)
32-
@test_allocations(TrixiAtmo.Trixi.rhs!, semi, sol, 2500)
32+
@test_allocations(TrixiAtmo.Trixi.rhs!, semi, sol, 5000)
33+
end
34+
35+
@trixi_testset "elixir_tri_barotropic_instability threaded" begin
36+
@test_trixi_include(abspath(joinpath(EXAMPLES_DIR, "shallow_water/covariant",
37+
"elixir_tri_barotropic_instability.jl")),
38+
l2=[41.05018196765347, 0.04598801953369521, 0.03324228006147076],
39+
linf=[
40+
202.17195189961058,
41+
0.2046503536574818,
42+
0.14813768215260187
43+
],
44+
polydeg=3,
45+
initial_refinement_level=1,
46+
tspan=(0.0, 1.0 * SECONDS_PER_DAY))
47+
# Ensure that we do not have excessive memory allocations
48+
# (e.g., from type instabilities)
49+
@test_allocations(TrixiAtmo.Trixi.rhs!, semi, sol, 5000)
3350
end
3451
end
3552
end # module

0 commit comments

Comments
 (0)