31 Cmp prolonge_c1(
const Cmp& uu,
const int nzet) {
33 const Map_radial* mpi =
dynamic_cast<const Map_radial*
>( uu.get_mp() ) ;
37 "prolonge_c1 : The mapping does not belong to the class Map_radial !" 42 const Map_radial& mp = *mpi ;
44 const Mg3d& mg = *(mp.get_mg()) ;
46 int nz = mg.get_nzone() ;
47 assert((nzet > 0)&&(nzet<nz)) ;
51 double nbc = uu(0, 0, 0, 0) ;
52 double resu_ext = - 0.2 * nbc ;
53 const Coord& rr = mp.r ;
54 double rout = (+rr)(nzet,0,0,mg.get_nr(nzet)-1) ;
55 double rin = 0 ;
double resu1 = 0 ;
double dresu1 = 0 ;
56 double a = 0 ;
double b = 0 ;
57 for (
int k=0; k<mg.get_np(0); k++)
58 for (
int j=0; j<mg.get_nt(0); j++) {
69 for (
int lz=0; lz <= nzet; lz++) {
70 for (
int i=1; i<mg.get_nr(lz); i++) {
75 rp1 = (+rr)(lz,k,j,i) ;
80 if ((np1<=0.) && dedans) {
82 cout <<
"Problem prolonge_c1!" << endl ;
85 resu1 = nm1 * (r0-rp1)*(rm2-rp1)
86 / ((r0-rm1)*(rm2-rm1))
87 + nm2 * (r0-rp1)*(rm1-rp1) / ((r0-rm2)*(rm1-rm2))
88 + nb0 * (rm1-rp1)*(rm2-rp1) / ((rm1-r0)*(rm2-r0)) ;
89 resu.set(lz,k,j,i) = resu1 ;
90 dresu1 = nm1 * ((rp1-r0) + (rp1-rm2))
91 / ((r0-rm1)*(rm2-rm1))
92 + nm2 * ((rp1-r0) + (rp1-rm1)) / ((r0-rm2)*(rm1-rm2))
93 + nb0 * ((rp1-rm1) + (rp1-rm2)) / ((rm1-r0)*(rm2-r0)) ;
94 a = (dresu1 - 2*(resu_ext - resu1)/(rout - rp1))/
95 ((rout-rp1)*(rout-rp1)) ;
96 b = 0.5*(-dresu1/(rout-rp1) - a*(rout+rp1)) ;
101 resu.set(lz,k,j,i) = (dedans ? np1 :
102 resu1*(rout-rp1)/(rout-rin) + resu_ext*(rin-rp1)/(rin-rout)
103 +(rp1-rin)*(rp1-rout)*(a*rp1+b) );
106 resu.set(lz,k,j,0) = (lz==0 ? nbc :
107 resu(lz-1, k, j, mg.get_nr(lz-1)-1 ) ) ;
112 resu2.annule(0,nzet) ;
113 resu.annule(nzet+1, nz-1) ;
115 resu.std_base_scal() ;