-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for spherical advection in Cartesian coordinates (#30)
* add tests for spherical advection in Cartesian coords * revert change to moist bubble case * revert change to moist bubble case * hard-code dimension of node coordinates to avoid type instability * metric terms for shell of radius != 1
- Loading branch information
1 parent
d8b0d31
commit 15062dc
Showing
4 changed files
with
56 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
module TestSphericalAdvection | ||
|
||
using Test | ||
using TrixiAtmo | ||
|
||
include("test_trixiatmo.jl") | ||
|
||
EXAMPLES_DIR = pkgdir(TrixiAtmo, "examples") | ||
|
||
@trixiatmo_testset "elixir_euler_spherical_advection_cartesian" begin | ||
@test_trixi_include(joinpath(EXAMPLES_DIR, | ||
"elixir_euler_spherical_advection_cartesian.jl"), | ||
l2=[ | ||
8.44505073e-03, | ||
8.23414117e-03, | ||
1.84210648e-03, | ||
0.00000000e+00, | ||
6.44302430e-02, | ||
], | ||
linf=[ | ||
9.48950488e-02, | ||
9.64811952e-02, | ||
1.37453400e-02, | ||
0.00000000e+00, | ||
4.09322999e-01, | ||
]) | ||
# 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 TrixiAtmo.Trixi.rhs!(du_ode, u_ode, semi, t)) < 100 | ||
end | ||
end | ||
|
||
end # module |