function [Dtan,stress_gp,stress_vmisses_gp,strain_gp,strain_vmisses_gp,stress_trial]=...
    StVenant_Kirchhoff_response(StVenant_Kirchhoff,material_type_e,F,...
    stress_gp,stress_vmisses_gp,strain_gp,strain_vmisses_gp,I,L,L1,IdyadI)


LAM=StVenant_Kirchhoff(material_type_e(1,2),1);
MU=StVenant_Kirchhoff(material_type_e(1,2),2);

% Computation of L1_4th
dl=eye(3); %Kroneker delta
L1_4th=zeros(3,3,3,3);
for i=1:3
    for j=1:3
        for k=1:3
            for l=1:3
                L1_4th(i,j,k,l)=dl(i,k)*dl(j,l)+dl(i,l)*dl(j,k);
            end
        end
    end
end
                
[EyedyadEye,~]= TensorProduct(dl,dl); % fourth order dyadic product

cf=F'*F; % right cauchy tensor
ef=(cf-eye(3))/2; %Green Lagrangian strain
%Vector interpretation of the 2nd oreder tensors
EF=[ef(1,1) ef(2,2) ef(3,3) ef(1,2) ef(2,3) ef(1,3)]';
epsilon=EF;


%Elasticity Tensor
Dtan_S = LAM*IdyadI+2*MU*L1;
Dtan_S_4th = LAM*EyedyadEye+MU*L1_4th;

%Second Piola-Kirchhoff stress
secondPiola = LAM*trace(ef)*dl+2*MU*ef; %second order
secondPiola_voigt = LAM*trace(ef)*I+2*MU*EF; %voigt notation

firstPiola=F*secondPiola;
stress_trial=[firstPiola(1,1);firstPiola(2,2);firstPiola(3,3);firstPiola(1,2);firstPiola(2,1);firstPiola(2,3);firstPiola(3,2);firstPiola(3,1);firstPiola(1,3)];

%2nd piola transformation to the first piola transformation
Dtan_P_4th = Second2First(F,Dtan_S_4th,secondPiola,dl); %4th order

Dtan=zeros(9);
idx1=[1 2 3 1 2 2 3 3 1];
idx2=[1 2 3 2 1 3 2 1 3];

for i=1:9
    for j=1:9
        
        Dtan(i,j)= Dtan_P_4th(idx1(i),idx2(i),idx1(j),idx2(j));
    end
end


end


