This file is indexed.

/usr/include/freefem++/idp/DDM-funcs-v2.idp is in libfreefem++-dev 3.47+dfsg1-2build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
NewMacro DMMDeffuncAndGlobals(prefix,comm,jpart,Whi,Vhc,Pknbcomp,Ai,vPbC,onG10,Pii,Usend,Vrecv,U2V)
/*
    
*/

int prefix#rgmres=0;
int prefix#kiter=-1;
/*  the global name user... */
/*
  jpart,njpart : partition 
  Usend, Vrecv : buffer
  Ai , Bi 
  rMj, sMj : matrices
  
  onG10:  tgv only on DDM s Gamma and not on Gamma
*/
/*----  for coarse  solver ... */


matrix prefix#AC,prefix#Rci,prefix#Pci;/**/
{
int[int] Sigma11=U2V;   
prefix#Pci=   interpolate(Whi,VhC,U2Vc=Sigma11);
prefix#Rci =  prefix#Pci'*Pii; 
/*Rci=   interpolate(Whi,VhC,t=1,U2Vc=Sigma11(0:Pknbcomp-1));
Pci =  Pii*Rci'; */
}

/*----End of Global Def -------------*/

/*-----------------*/
/*-----------------*/


func bool prefix#Update(real[int] &ui, real[int] &vi)
{
  for(int j=0;j<jpart.n;++j)
    Usend[j][]=sMj[j]*ui; 
   SendRecvUV(comm,jpart,Usend,Vrecv)
     vi = Pii*ui;
   for(int j=0;j<jpart.n;++j)
     vi += rMj[j]*Vrecv[j][]; 
   return true;
}
/*-----------------*/
/*-----------------*/
/*-----------------*/
 
func bool  prefix#CoarseSolve(real[int]& V,real[int]& U,mpiComm& comm)
{
    if(prefix#AC.n==0 && mpiRank(comm)==0)
      prefix#AC = vPbC(VhC,VhC,solver=sparsesolver);
   /*  solvibg the coarse probleme */
   real[int] Uc(prefix#Rci.n),Bc(Uc.n); 
   Uc= prefix#Rci*U;
   mpiReduce(Uc,Bc,processor(0,comm),mpiSUM);
   if(mpiRank(comm)==0) 
      Uc = prefix#AC^-1*Bc;
    broadcast(processor(0,comm),Uc);
   V = prefix#Pci*Uc;
}

/*-----------------*/
/*-----------------*/
/*-----------------*/

func real[int] prefix#DJ(real[int]& U)
{ 
  ++prefix#kiter;
  real[int] V(U.n); 
  V =  Ai*U;
  V = onG10 ? 0.: V;  
  return V; 
}

func real[int] prefix#PDJ(real[int]& U) /* C1*/
{ 
  real[int] V(U.n); 
  
  real[int] b= onG10 ? 0. :  U; 
  V =  Ai^-1*b;	
  prefix#Update(V,U);
  return U; 
}

func real[int] prefix#PDJC(real[int]& U) /**/ 
{ /* Precon  C1= Precon , C2  precon Coarse
   Idea : F. Nataf. 
     0 ~  (I-C1A)(I-C2A) => I ~  - C1AC2A +C1A +C2A 
     New Prec P= C1+C2 - C1AC2   = C1(I- A C2) +C2
   (  C1(I- A C2) +C2 ) Uo 
     V =  - C2*Uo
  .... */
  real[int] V(U.n); 
  prefix#CoarseSolve(V,U,comm);
  V = -V; /*  -C2*Uo  */
  U  += Ai*V; /* U =  (I-A C2) Uo */
  real[int] b= onG10 ? 0. :  U; 
  U =  Ai^-1*b;	/*  ( C1( I -A C2) Uo */
  V = U -V; /**/
  prefix#Update(V,U);
  return U; 
}

/*-----------------*/
/*-----------------*/
/*-----------------*/

func real[int] prefix#PDJC2(real[int]& U) /*  bogus ???? */
{ /* Precon  C1= precon Coarse C2  precon Precon
   Idea : F. Nataf. 
      0 ~  (I C1A)(I-C2A) => I ~  - C1AC2A +C1A +C2A 
      New Prec P= C1+C2 - C1AC2   = C1(I- A C2) +C2
      (  C1(I- A C2) +C2 ) Uo 
      V =  - C2*Uo
      .... 
      V = - C2 Uo 
      W = Uo + A V 
      V + C1 W  
      */
  real[int] V(U.n);
  real[int] b= onG10 ? 0. :  U; 
  V =  Ai^-1*b;	
  b=U; 
  
  V = -V; 
  prefix#Update(V,U);
  U  += Ai*V;  

  prefix#CoarseSolve(U,b,comm);
  V = U -V;   
  prefix#Update(V,U);
  return U; 
}
/*-----------------*/
/*-----------------*/
/*-----------------*/

 func real[int] prefix#DJ0(real[int]& U)
{ 
  ++prefix#kiter;
  real[int] V(U.n); 
  real[int] b= onG10 .* U;
  b  = onG10 ? b : Bi ;  
  V = Ai^-1*b;	
  prefix#Update(V,U);
  V -= U;
   return V; 
}

/*-----------------*/
/*-----------------*/
/*-----------------*/

func bool  prefix#CheckUpdate()
{ /* verification.....*/

  Whi defPk#Pknbcomp(u,) =Times#Pknbcomp(1),defPk#Pknbcomp(v,);
  prefix#Update(u[],v[]);
  u[]-=v[];
  if(mpirank==0) cout << "CheckUpdate  " << u[].linfty << endl;
  if(u[].linfty>1e-6) plot(u,cmm="bug ????");
  assert( u[].linfty<1e-6); 
  
  return 1; }

func bool prefix#Saveff(string sff,real epss,int ksplit,int nloc,int sizeoverlaps)
{  if(sff != "")
  {
    ofstream ff(sff+".txt",append);
    cout << " ++++  " ;
    cout  << mpirank <<"/" <<  mpisize << " k=" <<  ksplit << " n= " << nloc << " " 
           << sizeoverlaps << " it=  " << prefix#kiter  ;  
    for (int i=1; i<ittt;++i)	
      cout << " " << ttt[i]-ttt[i-1] << " ";
    cout << epss << " " << Ai.nbcoef << " " << Ai.n << endl;
    
    /*
      1 mpirank
      2 mpisize 
      3 ksplit 
      4 nloc
      5 sizeoverlaps
      6 kiter
      7 mesh & part build  
      8 build the partion 
      9 build mesh, transfere , and the fine mesh .. 
      10 build the matrix,  the trans matrix, factorizatioon 
      11 GMRES 
    */
    ff   << mpirank << " " << mpisize << " " << sPk << " " ;
    ff <<  ksplit << " " << nloc << " " << sizeoverlaps << " " << prefix#kiter  ;  
    for (int i=1; i<ittt;++i)	
      ff << " " << ttt[i]-ttt[i-1] << " ";
    ff << epss << " " << Ai.nbcoef << " " << Ai.n << " " << gmres << endl;
    
  }
  return 1;
}
//
/*-----------------*/
/*-----------------*/
/*-----------------*/
/*-----------------*/
/*-----------------*/


NewMacro prefix#DDMSolver(Bi,u,v,gmres,epss,vdebug) 
{
 settt
 int ipart=mpiRank(comm);
 if(gmres==1)
  {
   prefix#rgmres=MPIAffineGMRES(prefix#DJ0,u[],veps=epss,nbiter=300,comm=comm,dimKrylov=100,verbosity=ipart ? 0: 50);
   real[int] b= onG10 .* u[];
   b  = onG10 ? b : Bi ;
   v[] = Ai^-1*b;	
   prefix#Update(v[],u[]);
  }
else if(gmres==2)
  prefix#rgmres= MPILinearGMRES(prefix#DJ,precon=prefix#PDJ,u[],Bi,veps=epss,nbiter=1000,comm=comm,
                         dimKrylov=100,verbosity=ipart ? 0: 50);
else if(gmres==3)
  prefix#rgmres= MPILinearGMRES(prefix#DJ,precon=prefix#PDJC,u[],Bi,veps=epss,nbiter=1000,comm=comm,
                          dimKrylov=100,verbosity=ipart ? 0: 50);
else if(gmres==4)
   prefix#rgmres= MPILinearGMRES(prefix#DJ,precon=prefix#PDJC2,u[],Bi,veps=epss,nbiter=1000,comm=comm,
                          dimKrylov=100,verbosity=ipart ? 0: 50);
else /*algo Shwarz for demo */
   for(int iter=0;iter <100; ++iter)
     {
       prefix#kiter=iter;
       real[int] b= onG10 .* u[];
       b  = onG10 ? b : Bi ;
       v[] = Ai^-1*b;	
       b=v[];
       prefix#Update(v[],u[]);
       if(vdebug) plotMPIall(Thi,u[],"u-"+iter);
        b -= u[];
       
       real err = b.l1;
       real umax = u[].max;
       real[int] aa=[err,umax], bb(2);
       mpiAllReduce(aa,bb,comm,mpiMAX);
       real errg = bb[0];
       real umaxg = bb[1];
       
       if(ipart==0)
	     cout << ipart << " " << iter << " err = " << errg << " u. max  " << umaxg << endl;
       if(errg< 1e-10 ) break;
     }
     prefix#Update(u[],v[]);  
 
if(vdebug) plotMPIall(Thi,v[],"u-final");
 u[]=v[];
 settt
}
EndMacro  /*prefix#DDMSolver*/

EndMacro