Skip to content
This repository was archived by the owner on Jul 19, 2023. It is now read-only.

Commit 2da4fb9

Browse files
committed
temporary tests added to isolate issue with broken test
1 parent 6353e90 commit 2da4fb9

File tree

2 files changed

+116
-4
lines changed

2 files changed

+116
-4
lines changed

src/derivative_operators/derivative_operator_functions.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ function LinearAlgebra.mul!(x_temp::AbstractArray{T,3}, A::AbstractDiffEqComposi
522522
if length(ops_1) == 0 && length(ops_2) == 0
523523
convolve_BC_left!(view(x_temp,i,j,:), view(M,i+offset_x,j+offset_y,:), opsA[ops_3_max_bpc_idx...])
524524
convolve_BC_right!(view(x_temp,i,j,:), view(M,i+offset_x,j+offset_y,:), opsA[ops_3_max_bpc_idx...])
525-
if i <= pad[1] || i > size(x_temp)[1]-pad[1] #TODO 525-527
525+
if i <= pad[1] || i > size(x_temp)[1]-pad[1]
526526
convolve_interior!(view(x_temp,i,j,:), view(M,i+offset_x,j+offset_y,:), opsA[ops_3_max_bpc_idx...])
527527
end
528528

test/2D_3D_fast_multiplication.jl

Lines changed: 115 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,12 +1489,124 @@ end
14891489
@test M_temp ((Lx2*M)[1:N,2:N+1,:]+(Lx3*M)[1:N,2:N+1,:]+(Lx4*M)[1:N,2:N+1,:]+(Ly2*M)[2:N+1,1:N,:]+(Ly3*M)[2:N+1,1:N,:]+(Ly4*M)[2:N+1,1:N,:])
14901490

14911491
# Test that composition of both y and z operators works
1492-
A = Ly2 +Ly3 + Ly4 + Lz2 + Lz3 + Lz4
1492+
A = Ly2 + Ly3 + Ly4 + Lz2 + Lz3 + Lz4
14931493
M_temp = zeros(N+2,N,N)
14941494
mul!(M_temp, A, M)
14951495
# Need to figure out why this test is exploding
14961496
@test_broken M_temp ((Ly2*M)[:,1:N,2:N+1]+(Ly3*M)[:,1:N,2:N+1]+(Ly4*M)[:,1:N,2:N+1]+(Lz2*M)[:,2:N+1,1:N]+(Lz3*M)[:,2:N+1,1:N]+(Lz4*M)[:,2:N+1,1:N])
14971497

1498+
############################################################################
1499+
# Tests to isolate the above problem
1500+
############################################################################
1501+
1502+
A = Ly2 + Ly3 + Ly4
1503+
M_temp = zeros(N+2,N,N+2)
1504+
mul!(M_temp, A, M)
1505+
@test M_temp Ly2*M + Ly3*M + Ly4*M
1506+
1507+
### Test the addition of Lz2, Lz3, Lz4 seperately
1508+
1509+
A = Ly2 + Ly3 + Ly4 + Lz2
1510+
M_temp = zeros(N+2,N,N)
1511+
mul!(M_temp, A, M)
1512+
@test M_temp ((Ly2*M)[:,1:N,2:N+1]+(Ly3*M)[:,1:N,2:N+1]+(Ly4*M)[:,1:N,2:N+1]+(Lz2*M)[:,2:N+1,1:N])
1513+
1514+
A = Ly2 + Ly3 + Ly4 + Lz3
1515+
M_temp = zeros(N+2,N,N)
1516+
mul!(M_temp, A, M)
1517+
@test M_temp ((Ly2*M)[:,1:N,2:N+1]+(Ly3*M)[:,1:N,2:N+1]+(Ly4*M)[:,1:N,2:N+1]+(Lz3*M)[:,2:N+1,1:N])
1518+
1519+
A = Ly2 + Ly3 + Ly4 + Lz4
1520+
M_temp = zeros(N+2,N,N)
1521+
mul!(M_temp, A, M)
1522+
@test M_temp ((Ly2*M)[:,1:N,2:N+1]+(Ly3*M)[:,1:N,2:N+1]+(Ly4*M)[:,1:N,2:N+1]+(Lz4*M)[:,2:N+1,1:N])
1523+
1524+
###
1525+
1526+
A = Ly2 + Ly3 + Ly4 + Lz2 + Lz3
1527+
M_temp = zeros(N+2,N,N)
1528+
mul!(M_temp, A, M)
1529+
@test_broken M_temp ((Ly2*M)[:,1:N,2:N+1]+(Ly3*M)[:,1:N,2:N+1]+(Ly4*M)[:,1:N,2:N+1]+(Lz2*M)[:,2:N+1,1:N]+(Lz3*M)[:,2:N+1,1:N])
1530+
1531+
A = Ly2 + Ly3 + Ly4 + Lz2 + Lz4
1532+
M_temp = zeros(N+2,N,N)
1533+
mul!(M_temp, A, M)
1534+
@test_broken M_temp ((Ly2*M)[:,1:N,2:N+1]+(Ly3*M)[:,1:N,2:N+1]+(Ly4*M)[:,1:N,2:N+1]+(Lz2*M)[:,2:N+1,1:N]+(Lz4*M)[:,2:N+1,1:N])
1535+
1536+
A = Ly2 + Ly3 + Ly4 + Lz3 + Lz4
1537+
M_temp = zeros(N+2,N,N)
1538+
mul!(M_temp, A, M)
1539+
@test_broken M_temp ((Ly2*M)[:,1:N,2:N+1]+(Ly3*M)[:,1:N,2:N+1]+(Ly4*M)[:,1:N,2:N+1]+(Lz3*M)[:,2:N+1,1:N]+(Lz4*M)[:,2:N+1,1:N])
1540+
1541+
1542+
###
1543+
1544+
A = Ly2 + Ly3 + Ly4 + Lz2 + Lz2
1545+
M_temp = zeros(N+2,N,N)
1546+
mul!(M_temp, A, M)
1547+
@test_broken M_temp ((Ly2*M)[:,1:N,2:N+1]+(Ly3*M)[:,1:N,2:N+1]+(Ly4*M)[:,1:N,2:N+1]+(Lz2*M)[:,2:N+1,1:N]+(Lz2*M)[:,2:N+1,1:N])
1548+
# It appears that multiple z operators with some y operators is causing the issues
1549+
1550+
###
1551+
1552+
A = Lz2 + Lz3 + Lz4
1553+
M_temp = zeros(N+2,N+2,N)
1554+
mul!(M_temp, A, M)
1555+
@test M_temp Lz2*M + Lz3*M + Lz4*M
1556+
1557+
A = Lz2 + Lz3 + Lz4 + Ly2
1558+
M_temp = zeros(N+2,N,N)
1559+
mul!(M_temp, A, M)
1560+
@test M_temp ((Ly2*M)[:,1:N,2:N+1]+(Lz2*M)[:,2:N+1,1:N]+(Lz3*M)[:,2:N+1,1:N]+(Lz4*M)[:,2:N+1,1:N])
1561+
1562+
A = Lz2 + Lz3 + Lz4 + Ly3
1563+
M_temp = zeros(N+2,N,N)
1564+
mul!(M_temp, A, M)
1565+
@test_broken M_temp ((Ly3*M)[:,1:N,2:N+1]+(Lz2*M)[:,2:N+1,1:N]+(Lz3*M)[:,2:N+1,1:N]+(Lz4*M)[:,2:N+1,1:N])
1566+
# It seems that the y paddign could be the issue
1567+
1568+
A = Lz2 + Lz3 + Lz4 + Ly4
1569+
M_temp = zeros(N+2,N,N)
1570+
mul!(M_temp, A, M)
1571+
@test_broken M_temp ((Ly4*M)[:,1:N,2:N+1]+(Lz2*M)[:,2:N+1,1:N]+(Lz3*M)[:,2:N+1,1:N]+(Lz4*M)[:,2:N+1,1:N])
1572+
# It seems that the y paddign could be the issue
1573+
1574+
A = Lz2 + Lz3 + Lz4 + Ly4 + Ly3
1575+
M_temp = zeros(N+2,N,N)
1576+
mul!(M_temp, A, M)
1577+
@test_broken M_temp ((Ly3*M)[:,1:N,2:N+1]+(Ly4*M)[:,1:N,2:N+1]+(Lz2*M)[:,2:N+1,1:N]+(Lz3*M)[:,2:N+1,1:N]+(Lz4*M)[:,2:N+1,1:N])
1578+
# It seems that the y paddign could be the issue
1579+
1580+
A = Lz2 + Lz3 + Lz4 + Ly4 + Ly2
1581+
M_temp = zeros(N+2,N,N)
1582+
mul!(M_temp, A, M)
1583+
@test_broken M_temp ((Ly2*M)[:,1:N,2:N+1]+(Ly4*M)[:,1:N,2:N+1]+(Lz2*M)[:,2:N+1,1:N]+(Lz3*M)[:,2:N+1,1:N]+(Lz4*M)[:,2:N+1,1:N])
1584+
# It seems that the y paddign could be the issue
1585+
1586+
###
1587+
1588+
A = Lz2 + Lz3 +Ly3
1589+
M_temp = zeros(N+2,N,N)
1590+
mul!(M_temp, A, M)
1591+
@test_broken M_temp ((Ly3*M)[:,1:N,2:N+1]+(Lz2*M)[:,2:N+1,1:N]+(Lz3*M)[:,2:N+1,1:N])
1592+
1593+
A = Lz3 +Ly3
1594+
M_temp = zeros(N+2,N,N)
1595+
mul!(M_temp, A, M)
1596+
@test M_temp ((Ly3*M)[:,1:N,2:N+1]+(Lz3*M)[:,2:N+1,1:N])
1597+
1598+
A = Lz2 + Lz3 +Ly2
1599+
M_temp = zeros(N+2,N,N)
1600+
mul!(M_temp, A, M)
1601+
@test M_temp ((Ly2*M)[:,1:N,2:N+1]+(Lz2*M)[:,2:N+1,1:N]+(Lz3*M)[:,2:N+1,1:N])
1602+
1603+
# It seems that the padding of y is forcing multiple z operators to fail
1604+
1605+
1606+
1607+
############################################################################
1608+
############################################################################
1609+
14981610
# Test that composition of x, y, and z operators works
14991611
A = Lx2 + Lz2 + Lx3 + Lz3 + Lz4 + Lx4 + Ly2 + Ly3 + Ly4
15001612
M_temp = zeros(N,N,N)
@@ -1503,9 +1615,9 @@ end
15031615
+ (Lz3*M)[2:N+1,2:N+1,1:N] + (Lx4*M)[1:N,2:N+1,2:N+1] +(Ly4*M)[2:N+1,1:N,2:N+1]+(Lz4*M)[2:N+1,2:N+1,1:N])
15041616

15051617
# Last case where we now have some `irregular-grid` operators operating on the
1506-
# regular-spaced axis y
1618+
# regular-spaced axis x and z
15071619

1508-
# These operators are operating on the regular grid y, but are constructed as though
1620+
# These operators are operating on the regular grid x and z, but are constructed as though
15091621
# they were irregular grid operators. Hence we test if we can seperate irregular and
15101622
# regular gird operators on the same axis
15111623
# Lx2 has 0 boundary points

0 commit comments

Comments
 (0)