-
Notifications
You must be signed in to change notification settings - Fork 16
/
gallery_tests.jl
52 lines (44 loc) · 1.5 KB
/
gallery_tests.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using PartitionedArrays
using Test
using SparseMatricesCSR
function gallery_tests(distribute)
gallery_tests(distribute,(4,))
gallery_tests(distribute,(2,2))
gallery_tests(distribute,(2,1,2))
end
function gallery_tests(distribute,parts_per_dir)
p = prod(parts_per_dir)
ranks = distribute(LinearIndices((p,)))
nodes_per_dir = map(i->2*i,parts_per_dir)
args = laplacian_fdm(nodes_per_dir,parts_per_dir,ranks)
A = psparse(args...) |> fetch
A |> centralize |> display
y = A*pones(axes(A,2))
@test isa(y,PVector)
A = psparse(args...;assembled=true) |> fetch
y = A*pones(axes(A,2))
@test isa(y,PVector)
args = laplacian_fem(nodes_per_dir,parts_per_dir,ranks)
A = psparse(args...) |> fetch
A |> centralize |> display
Y = A*pones(axes(A,2))
@test isa(y,PVector)
A = psparse(sparsecsr,args...) |> fetch
A |> centralize |> display
Y = A*pones(axes(A,2))
@test isa(y,PVector)
A = psparse(SparseMatrixCSR{1,Float64,Int32},args...) |> fetch
A |> centralize |> display
Y = A*pones(axes(A,2))
@test isa(y,PVector)
args = linear_elasticity_fem(nodes_per_dir,parts_per_dir,ranks)
A = psparse(args...) |> fetch
A |> centralize |> display
Y = A*pones(axes(A,2))
@test isa(y,PVector)
x = node_coorinates_unit_cube(nodes_per_dir,parts_per_dir,ranks)
B = near_nullspace_linear_elasticity(x)
@test isa(B[1],PVector)
B = near_nullspace_linear_elasticity(x,partition(axes(A,2)))
@test isa(B[1],PVector)
end