function d = gradj(c,h,u)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%gradient topologique 2 materiaux
%pondere par h^puis, gradj=
%-(saut/moy)*h^puis*sigma:eps
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

global hm hp b p e t a f

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

saut = hm-h;
moy = (h+hm)/2;
d = -saut.*(h.^puis).*d./moy;

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