Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

Commit

Permalink
Adding Stokes autodiff test
Browse files Browse the repository at this point in the history
  • Loading branch information
oriolcg committed Dec 9, 2021
1 parent 9be6d01 commit 7cb1ecc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/TransientFEsTests/StokesEquationAutoDiffTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,12 @@ cell_j_t = get_array(jac_t(0.5,(xh,xh),dx,dy))
cell_j_auto = get_array(jacobian(x->res(0.5,(x,xh),dy),xh))
cell_j_t_auto = get_array(jacobian(x->res(0.5,(xh,x),dy),xh))

test_array(cell_j_auto,cell_j,)
test_array(cell_j_t_auto,cell_j_t,)
for i in 1:length(cell_j)
test_array(cell_j[i].array[1,1],cell_j_auto[i].array[1,1],)
test_array(cell_j[i].array[1,2],cell_j_auto[i].array[1,2],)
test_array(cell_j[i].array[2,1],cell_j_auto[i].array[2,1],)
test_array(cell_j_t[i].array[1,1],cell_j_t_auto[i].array[1,1],)
end

op = TransientFEOperator(res,X,Y)

Expand Down
2 changes: 2 additions & 0 deletions test/TransientFEsTests/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ using Test

@testset "HeatEquationAutoDiffTests" begin include("HeatEquationAutoDiffTests.jl") end

@testset "StokesEquationAutoDiffTests" begin include("StokesEquationAutoDiffTests.jl") end

@testset "ForwardEulerHeatEquationTests" begin include("ForwardEulerHeatEquationTests.jl") end

end # module

0 comments on commit 7cb1ecc

Please sign in to comment.