%   Author: Reija Ristilä <reija@hut.fi>
%   Last modified: 1999-04-19 17:00:30 EEST

% tehtava 4: f=1+sin(t)
% reunaehdot (b) exportattu pdetoolista

[p,e,t]=initmesh('circleg','Hmax',1);

error=[]; err=10;
for i=1:4
  u=assempde(b,p,e,t,1,0,0);
  exa=1+sqrt(p(1,:).^2+p(2,:).^2).*sin(atan2(p(2,:),p(1,:)));
  err=norm(u-exa',inf)
  error=[error err];
  figure(1),pdemesh(p,e,t);
  figure(2),pdesurf(p,t,u);
  figure(3),pdesurf(p,t,u-exa');
  pause
  [p,e,t]=refinemesh('circleg',p,e,t);
end

