-
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.
Merge branch 'main' of github.com:michael-petersen/PerturbPlasma
- Loading branch information
Showing
9 changed files
with
112 additions
and
136 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
name: CI | ||
on: | ||
- push | ||
|
||
jobs: | ||
Benchmark: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: julia-actions/setup-julia@v1 | ||
with: | ||
version: 1.6.7 | ||
arch: x64 | ||
- name: instantiate environment | ||
run: | | ||
julia --project=fht -e ' | ||
using Pkg | ||
Pkg.add("BenchmarkTools") | ||
Pkg.add("ArgParse") | ||
Pkg.add(url="https://github.com/michael-petersen/FiniteHilbertTransform.jl.git")' | ||
- uses: julia-actions/julia-runtest@v1 | ||
with: | ||
project: fht | ||
- uses: julia-actions/julia-processcoverage@v1 | ||
with: | ||
project: fht | ||
- uses: codecov/codecov-action@v1 | ||
with: | ||
file: lcov.info |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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,66 @@ | ||
|
||
|
||
|
||
|
||
using FiniteHilbertTransform | ||
using Test | ||
|
||
Ku = 10 | ||
tabu,tabw,tabc,tabP = FiniteHilbertTransform.tabGLquad(Ku) | ||
FHT = FiniteHilbertTransform.LegendreFHT(Ku) | ||
|
||
tol = 1e-10 | ||
|
||
@testset "Legendre Initialisation" begin | ||
@test (@allocated tabu,tabw,tabc,tabP = FiniteHilbertTransform.tabGLquad(Ku)) < 5000 | ||
@test (@allocated FHT = FiniteHilbertTransform.LegendreFHT(Ku)) < 5000 | ||
@test FHT.Ku == 10 | ||
@test FHT.tabu[1] ≈ -0.9739065285171717 atol=tol | ||
@test FHT.tabw[1] ≈ 0.06667134430868821 atol=tol | ||
end | ||
|
||
# select an unstable frequency | ||
ϖ = 0.02 + 0.02im | ||
FiniteHilbertTransform.GettabD!(ϖ,FHT) | ||
|
||
@testset "Unstable Frequency" begin | ||
@test (@elapsed FiniteHilbertTransform.GettabD!(ϖ,FHT)) < 1.e-4 | ||
@test (@allocated FiniteHilbertTransform.GettabD!(ϖ,FHT)) == 0 | ||
@test real(FHT.tabDLeg[1]) ≈ -0.0399893282162609 atol=tol | ||
@test imag(FHT.tabDLeg[1]) ≈ 3.1015819920460506 atol=tol | ||
@test real(FHT.tabDLeg[1]) == real(FHT.tabQLeg[1]) | ||
@test imag(FHT.tabDLeg[1]) == imag(FHT.tabQLeg[1]) | ||
@test real(FHT.tabPLeg[1]) == 0.0 | ||
@test imag(FHT.tabPLeg[1]) == 0.0 | ||
end | ||
|
||
# select an unstable frequency | ||
ϖ = 0.00 + 0.00im | ||
FiniteHilbertTransform.GettabD!(ϖ,FHT) | ||
|
||
@testset "Neutral Frequency" begin | ||
@test (@elapsed FiniteHilbertTransform.GettabD!(ϖ,FHT)) < 1.e-4 | ||
@test (@allocated FiniteHilbertTransform.GettabD!(ϖ,FHT)) == 0 | ||
@test real(FHT.tabDLeg[1]) == 0.0 | ||
@test imag(FHT.tabDLeg[1]) ≈ 3.141592653589793 atol=tol | ||
@test real(FHT.tabQLeg[1]) == 0.0 | ||
@test imag(FHT.tabQLeg[1]) == 0.0 | ||
@test real(FHT.tabPLeg[1]) == 1.0 | ||
@test imag(FHT.tabPLeg[1]) == 0.0 | ||
end | ||
|
||
# select a damped frequency | ||
ϖ = 0.02 - 0.02im | ||
FiniteHilbertTransform.GettabD!(ϖ,FHT) | ||
|
||
@testset "Damped Frequency" begin | ||
@test (@elapsed FiniteHilbertTransform.GettabD!(ϖ,FHT)) < 1.e-4 | ||
@test (@allocated FiniteHilbertTransform.GettabD!(ϖ,FHT)) == 0 | ||
@test real(FHT.tabDLeg[1]) ≈ -0.0399893282162609 atol=tol | ||
@test imag(FHT.tabDLeg[1]) ≈ 3.1816033151335357 atol=tol | ||
@test real(FHT.tabQLeg[1]) == real(FHT.tabDLeg[1]) | ||
@test imag(FHT.tabQLeg[1]) ≈ -3.1015819920460506 atol=tol | ||
@test real(FHT.tabPLeg[1]) == 1.0 | ||
@test imag(FHT.tabPLeg[1]) == 0.0 | ||
end | ||
|