function cmat = elasticityFcnHandleC3D(l,s,E,nu)
%elasticityFcnHandleC3D onstruct c-matrix for 3D elastic solid with function handle inputs. 
% Same definitions of quantities as in ELASTICITYC3D for numeric
% inputs but now it outputs a 45 x length(location.x) array
    G = E(l,s)./(2*(1+nu(l,s)));
    c1 = E(l,s).*(1-nu(l,s))./((1+nu(l,s)).*(1-2*nu(l,s)));
    c12 = c1.*nu(l,s)./(1-nu(l,s));
    cmat = zeros(45,length(l.x)); 
    cmat(1,:) = c1;
    cmat(3,:) = G;
    cmat(6,:) = G;
    cmat(8,:) = G;
    cmat(10,:) = c12;
    cmat(16,:) = G;
    cmat(18,:) = c1;
    cmat(21,:) = G;
    cmat(24,:) = G;
    cmat(28,:) = c12;
    cmat(36,:) = G;
    cmat(38,:) = c12;
    cmat(40,:) = G;
    cmat(42,:) = G;
    cmat(45,:) = c1;

end

