function [bc_Lap, bc_dx, bc_dy] = bc_vectors_DD(uu)
%
% Determines (m*n)x1 vectors bc_Lap, bc_dx, bc_dy incorporating
% the boundary values from the (m+2)x(n+2) array uu.
%
% NOTE: This is called by ras.m, which uses second-order central
% differences to approximate first derivatives. 
%
% Input: 
%   uu  = (m+2)x(n+2) array of 2D grid data. 
%         m = index of y-values; n  = index of x-values. 
%

mp2 = size(uu,1); 
np2 = size(uu,2); 
m = mp2 - 2; 
n = np2 - 2; 

bc_Lap = zeros(m*n,1);
bc_dy = zeros(m*n,1);
bc_dx = zeros(m*n,1);

bc_dy(1:n,1) = -uu(1,2:n+1)';
bc_dy(m*n-n+1:m*n,1) = uu(mp2,2:n+1)'; 

bc_dx(1:n:m*n-n+1,1) = -uu(2:m+1,1);
bc_dx(n:n:m*n,1) = uu(2:m+1,np2); 

bc_Lap(1:n,1) = uu(1,2:n+1)'; 
bc_Lap(m*n-n+1:m*n,1) = uu(mp2,2:n+1)'; 
bc_Lap(1:n:m*n-n+1,1) = bc_Lap(1:n:m*n-n+1,1) + uu(2:m+1,1);
bc_Lap(n:n:m*n,1) = bc_Lap(n:n:m*n,1) + uu(2:m+1,np2); 

