function L = condif_DD(coeffs,m,n)
%
% Returns the sparse matrix for the discrete convection-diffusion 
% operator 
%
%          Lu = (Laplacian)u + cu + du_x + eu_y 
%
% with Dirichlet boundary conditions on an mxn grid on [0,1]X[0,1]
% or a subdomain thereof. The grid spacing is passed in through a
% global variable h_GL. 
%
%  Inputs (required): 
%   coeffs    = row vector of coefficients [c d e].
%   m         = number of meshpoints in the y-direction. 
%   n         = number of meshpoints in the x-direction.
%
% Output:
%   L         = sparse discrete convection-diffusion operator. 
% 

global h_GL

if nargin ~= 3, 
  error('condif_DD: Number of arguments must be exactly 3.'); 
end 

c = coeffs(1,1); d = coeffs(1,2); e = coeffs(1,3); 

Im = speye(m,m);
Em = sparse(2:m,1:m-1,1,m,m);
DDm = -2*Im + Em + Em';

In = speye(n,n);
En = sparse(2:n,1:n-1,1,n,n);
DDn = -2*In + En + En';

Sm = ((h_GL^2)\1)*DDm + ((2*h_GL)\e)*(Em' - Em) + (2\c)*Im;
Sn = ((h_GL^2)\1)*DDn + ((2*h_GL)\d)*(En' - En) + (2\c)*In;

L = kron(Sm,In) + kron(Im,Sn);
