1 function u=poisson_fft3q(f,h)
2 % solve poisson equation with QUIC boundary conditions:
3 % lambda = 0 top and size, dlambda/dz = 0 on the bottom
5 % reflect top to the bottom
6 r = zeros(n(1),n(2),2*n(3));
7 r(:,:,1:n(3))=f(:,:,n(3):-1:1);
8 r(:,:,n(3)+1:2*n(3))=f;
9 % solve with zero boundary conditions
11 % check up and down symmetry
12 err_sym = big(u(:,:,n(3):-1:1)-u(:,:,n(3)+1:2*n(3)))
14 u = u(:,:,n(3)+1:2*n(3));