function [Diffusion,Advection,Mass] = LocalStiffnessMatricesPerturbed(S,PWL,l,m,Transform,coeffMass,number_QuadTriangle)
%% Compute the enteries of the diffussion matrix which do not depend on alpha

T1_11 = ones(number_QuadTriangle,1) * ...
                         ( PWL.coefficient(1,:,l) .* PWL.coefficient(1,:,m) );

T1_12 = ones(number_QuadTriangle,1) * ...
                         ( PWL.coefficient(1,:,l) .* PWL.coefficient(2,:,m) );

T1_21 = ones(number_QuadTriangle,1) * ...
                         ( PWL.coefficient(2,:,l) .* PWL.coefficient(1,:,m) );

T1_22 = ones(number_QuadTriangle,1) * ...
                         ( PWL.coefficient(2,:,l) .* PWL.coefficient(2,:,m) );


%% Term 1:

Diffusion = (Transform.inv_grad11 .* T1_11 + Transform.inv_grad12 .* T1_12) .* S ...
          + (Transform.inv_grad12 .* T1_21 + Transform.inv_grad22 .* T1_22) ./ S; 

                    
%% Term 2:

T2_1 = ( ones(number_QuadTriangle,1) * PWL.coefficient(1,:,m) ).* PWL.evaluation(:,:,l);

T2_2 = ( ones(number_QuadTriangle,1) * PWL.coefficient(2,:,m) ).* PWL.evaluation(:,:,l);           
            
Advection = (Transform.inv_grad11 .* T2_1 ...
                 + Transform.inv_grad12 .* T2_2) .* S;


%% Compute the enteries of the mass matrix which do not depend on alpha

Mass = coeffMass .* S .* PWL.evaluation(:,:,l) .* PWL.evaluation(:,:,m); 


 end

