function d = gradj0(c,u)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%gradient topologique 2 materiaux
%version simplifiee
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

global hm hp b p e t a f

[ux,uy] = pdegrad(p,t,u);
[cgxu,cgyu] = pdecgrad(p,t,c,u);
d = (ux.*cgxu+uy.*cgyu);
d = d(1,:)+d(2,:);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
