-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bugfix in compute bottom height (#3940)
* add the tests * fix docs
- Loading branch information
1 parent
e074e5f
commit 2c955da
Showing
4 changed files
with
12 additions
and
7 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 |
---|---|---|
@@ -1,16 +1,20 @@ | ||
include("dependencies_for_runtests.jl") | ||
|
||
grid = RectilinearGrid(; size=(2, 2, 2), extent = (1, 1, 1)) | ||
grid = RectilinearGrid(; size=(100, 100, 100), extent = (1, 1, 1)) | ||
|
||
@testset "Testing Immersed Boundaries" begin | ||
|
||
@info "Testing the immersed boundary construction..." | ||
|
||
bottom(x, y) = -1 + 0.5 * exp(-x^2 - y^2) | ||
bottom(x, y) = rand() | ||
|
||
ibg = ImmersedBoundaryGrid(grid, GridFittedBottom(bottom)) | ||
|
||
# Unit test (bottom is at the right position) | ||
# Test that the bottom is at the same position | ||
bottom_height = interior(ibg.immersed_boundary.bottom_height) | ||
|
||
@info "Testing stably stratified initial conditions..." | ||
zfaces = znodes(ibg, Face()) | ||
|
||
for i in 1:size(ibg, 1), j in 1:size(ibg, 2) | ||
@test bottom_height[i, j, 1] ∈ zfaces | ||
end | ||
end |