%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% optimisation topologique
% en contraintes planes
% version simplifiee
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% initialisation :
% c = tenseur des contraintes
% hm <= h = densite variable <= hp
% reduc = proportion retiree a chaque
% iteration
% a prendre .8 <= reduc <= .9*
% propfin = proportion finale matiere
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear all; 
global hm hp b p e t a f
load poutre; 
reduc = .95; propfin = .7;
[aux,nbt] =  size(t);
cplein = fairec(c,nbt); c = cplein;
h = ones(1,nbt); hm = 1e-3; hp = 1;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% suppression des elements
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

plein = 1; figure(1);

while plein >= propfin
 plein = plein*reduc; vide = 1-plein;
 disp('enleve, plein='); disp(plein);
 [c,h] = retire0(c,cplein,vide);

 figure(2);
 pdeplot(p,e,t,'xydata',h,...
 'xystyle','flat','mesh','off');
 pause(1);
end

figure(1);
voirmis;

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