Skip to content

Commit

Permalink
Add linalg tests
Browse files Browse the repository at this point in the history
  • Loading branch information
utkinis committed Mar 3, 2024
1 parent a2710ea commit 1ee6a87
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[deps]
KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
8 changes: 8 additions & 0 deletions test/test_fields.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ using Chmy.Architectures
using Chmy.Fields
using Chmy.Grids

using LinearAlgebra

for backend in backends
@testset "$(basename(@__FILE__)) (backend: $backend)" begin
# test setup
Expand Down Expand Up @@ -51,6 +53,12 @@ for backend in backends
0.0; 0.0;; 1.0; 1.0;; 2.0; 2.0]
end
end
@testset "linalg" begin
f = Field(backend, grid, Center())
set!(f, 1.0)
@test norm(f, 1) 8
@test norm(f, 2) norm(f) sqrt(8)
end
@testset "constant field" begin
@testset "zero" begin
field = ZeroField{Float64}()
Expand Down

0 comments on commit 1ee6a87

Please sign in to comment.