]> Creatis software - CreaPhase.git/blob - octave_packages/secs2d-0.0.8/Utilities/Usmoothguess.m
Add a useful package (from Source forge) for octave
[CreaPhase.git] / octave_packages / secs2d-0.0.8 / Utilities / Usmoothguess.m
1 function guess = Usmoothguess(mesh,new,old,Dsides);
2
3 % guess = Usmoothguess(mesh,new,old,Dsides);
4
5   if ~isfield("mesh","wjacdet")
6     mesh = Umeshproperties(mesh);
7   end
8
9   Nelements = columns(mesh.t);
10   Nnodes = columns(mesh.p);
11
12   Dnodes = Unodesonside(mesh,Dsides);
13   varnodes = setdiff([1:Nnodes]',Dnodes);
14   guess = new;
15
16   A = Ucomplap(mesh,ones(Nelements,1));
17   Aie = A(varnodes,Dnodes);
18   Aii = A(varnodes,varnodes);
19
20   guess(varnodes) = Aii\(-Aie*(new(Dnodes)-old(Dnodes))+Aii*old(varnodes));