]> Creatis software - CreaPhase.git/blob - octave_packages/secs2d-0.0.8/METLINES/METLINEScapcomp.m
Add a useful package (from Source forge) for octave
[CreaPhase.git] / octave_packages / secs2d-0.0.8 / METLINES / METLINEScapcomp.m
1 function [C,L,Lii,LiI,LII,Dnodes,varnodes]=...
2       METLINEScapcomp(imesh,epsilon,contacts)
3
4 ##
5 ##
6 ## [C,L,Lii,LiI,LII,Dnodes,varnodes]=METLINEScapcomp(imesh,epsilon,contacts)
7 ##
8 ##
9
10 Ncontacts = length(contacts);
11 Nnodes = columns(imesh.p);
12 varnodes = [1:Nnodes];
13
14 for ii=1:Ncontacts
15   Dnodes{ii}=Unodesonside(imesh,contacts{ii});
16   varnodes = setdiff(varnodes,Dnodes{ii});
17 end
18
19 L = Ucomplap (imesh,epsilon);
20
21 for ii=1:Ncontacts
22   Lii{ii} = L(Dnodes{ii},Dnodes{ii});
23   LiI{ii} = L(Dnodes{ii},varnodes);
24 end
25 LII =  L(varnodes,varnodes);
26
27 for ii=1:Ncontacts
28   for jj=ii:Ncontacts
29     if ii==jj
30       C(ii,jj)=sum(sum(Lii{ii}-LiI{ii}*(LII\(LiI{ii})')));
31     else
32       C(ii,jj)=sum(sum(-LiI{ii}*(LII\(LiI{jj})')));
33     end
34   end
35 end
36
37 for ii=1:4
38   for jj=1:ii-1
39     C(ii,jj)=C(jj,ii);
40   end
41 end