function D = ComputeConvectionMatrix2(X,T,Un)
ngaus = 2; 
zgp = [-sqrt(3)/3; sqrt(3)/3];
wgp= [1 1];
N = [(1-zgp)/2 (1+zgp)/2];
Nxi = [-1/2 1/2; -1/2 1/2];

npt = size(X,1); 
[numel,nen] = size(T); 
D = spalloc(npt,npt,3*npt); 
for ielem = 1:numel
    Te = T(ielem,:); 
    Xe = X(Te,:); 
    u_e = Un(Te);
    
    De = zeros(nen);
    for ig=1:ngaus
        N_ig   = N(ig,:);
        Nxi_ig = Nxi(ig,:);
        %Jacobia 
        J = Nxi_ig*Xe; 
        % Derivadas de las funciones de forma respecto a (x,y)
        Nx_ig = J\Nxi_ig; 
        % diferencial de volum
        dvolu = wgp(ig)*det(J); 
        De = De + N_ig'*(Nx_ig*u_e)*N_ig*dvolu; 
    end
    D(Te,Te) = D(Te,Te) + De;
end