function r = matlb(ipsos,nu,mod)
%  define material stiffness matrix
%  based on plane stress / plane strain

switch ipsos
    case 1 %plane strain
        xb=mod/((1-2*nu)*(1+nu)) ;
        r=xb*[(1-nu)    nu    0; nu  (1-nu)   0; 0      0 (1-2*nu)];
    case 2 %plane stress
        xb=mod/((1-nu)*(1+nu));
        r=xb*[  1  nu    0; nu   1    0; 0   0 (1-nu)];
end
