-
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.
Signed-off-by: thanasis@Dobby <giannakopoulos.th@gmail.com>
- Loading branch information
1 parent
312109b
commit 882b481
Showing
2 changed files
with
33 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using Test | ||
using SpheriCo | ||
|
||
@testset "ghost tests" begin | ||
|
||
# change D for number of points | ||
D = 4 | ||
Nr = (128)*2^D + 1 + 2 # +1 for last point, + 2 for ghosts left of r=0 | ||
# positions of outer boundary | ||
rmax = 10 | ||
# radial grid | ||
g = Grid( | ||
# discretization parameters | ||
Nr = Nr, | ||
r_max = rmax | ||
) | ||
|
||
# generate random data | ||
f = rand(Nr) | ||
g = rand(Nr) | ||
|
||
# populate ghosts on the left of r=0 | ||
f = even_ghosts(f) | ||
g = odd_ghosts(g) | ||
|
||
@test abs(f[4]-f[2]) < 1e-16 | ||
@test abs(f[5]-f[1]) < 1e-16 | ||
@test abs(g[4]+g[2]) < 1e-16 | ||
@test abs(g[5]+g[1]) < 1e-16 | ||
end |