0001 function Gu=getGu(p,u,lam,r)
0002
0003
0004 global pj lamj;
0005 bc=p.bcf(p,u,lam); del=1e-6;
0006 if(p.jsw<2)
0007 [c,fu,flam,b]=p.jac(p,u,lam); zerov=zeros(p.neq,1);
0008 [Gu,Glam]=assempde(bc,p.points,p.edges,p.tria,c,-fu,zerov);
0009 if(any(b))
0010 Kadv=assemadv(p.points,p.tria,b);
0011 Gu=Gu-Kadv;
0012 end
0013 else
0014 [S,F]=assempde(bc,p.points,p.edges,p.tria,0,ones(p.neq*p.neq,1),0,ones(p.np*p.neq,1));
0015 thresh=del*ones(size(u)); pj=p; lamj=lam;
0016 [Gu,fac,G]=numjac('resinj',0,u,r,thresh,[],0,S,[]);
0017 end