0001 function p=meshadac(p,varargin)
0002
0003 fprintf('current nt=%g, base nt=%g, ', p.nt, size(p.btria,2)); noa=nargin-1;
0004 q=p; ps=p.points; nps=p.np; onp=size(p.bpoints,2);
0005 lamd=p.tau(p.neq*nps+1);
0006 xo = p.points(1,:);yo = p.points(2,:);
0007 xn = p.bpoints(1,:);yn = p.bpoints(2,:);
0008 for i=1:p.neq
0009 z = p.u((i-1)*nps+1:i*nps);un=p2interpol(xn,yn,z,xo,yo);
0010 uc((i-1)*onp+1:i*onp)=un;
0011 end
0012 p.points=p.bpoints; p.edges=p.bedges; p.tria=p.btria; p.np=onp;
0013 p.nt=size(p.tria,2); p.u=uc';
0014 if(noa>0); p=meshada(p,varargin{:});
0015 else p=meshada(p);
0016 end
0017 figure(p.ifig);pdemesh(p.points,p.edges,p.tria);axis tight;
0018 plotsol(p,p.pfig,p.pcmp,p.pstyle); xi=1/p.np;
0019 if(p.isw>1); fprintf('old xi=%g, new xi=%g\n',p.xi,xi);
0020 xi=asknu('xi:',xi); end
0021 p.xi=xi;
0022 tau=zeros(p.np*p.neq,1); xn = p.points(1,:);yn = p.points(2,:);
0023 for i=1:p.neq
0024 z=p.tau((i-1)*nps+1:i*nps);taun=p2interpol(xn,yn,z,xo,yo);
0025 tau((i-1)*p.np+1:i*p.np) = taun;
0026 end
0027 tau(p.np*p.neq+1)=lamd;
0028 p.tau=tau/xinorm(tau,p.xi);p.headfu(p);