Skip to content

Commit

Permalink
Added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiManyer committed Dec 3, 2023
1 parent 32253b7 commit 5e63614
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/BlockSparseMatrixAssemblersTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ function is_same_vector(x::BlockPVector,y::PVector,Ub,U)
end

function is_same_matrix(Ab::BlockPMatrix,A::PSparseMatrix,Xb,X)
yb = mortar(map(Aii->pfill(0.0,partition(axes(Aii,1))),diag(blocks(Ab))));
xb = mortar(map(Aii->pfill(1.0,partition(axes(Aii,2))),diag(blocks(Ab))));
yb = allocate_in_range(Ab)
xb = allocate_in_domain(Ab); fill!(xb,1.0)
mul!(yb,Ab,xb)

y = pfill(0.0,partition(axes(A,1)))
x = pfill(1.0,partition(axes(A,2)))
y = allocate_in_range(A)
x = allocate_in_domain(A); fill!(x,1.0)
mul!(y,A,x)

return is_same_vector(yb,y,Xb,X)
Expand Down

0 comments on commit 5e63614

Please sign in to comment.