tensorellipticBt.C

00001 #include<math.h>
00002 // Lorene headers
00003 #include "metric.h"
00004 #include "nbr_spx.h"
00005 #include "utilitaires.h"
00006 #include "graphique.h"
00007 #include "proto.h"
00008 #include "diff.h"
00009 
00010 
00011 // Inversion of the weakly degenerate eliptic operator associatd with spectral quantity tilde(B), with main characteristics
00012 //fit and fit2 (Suitable for tensorial resolution of BH spacetime)
00013 //See also function tilde(laplacian)
00014 
00015  void tensorellipticBt( Scalar source, Scalar& resu, double fit, double fit2, double fit0d2, double fit1d2, double fit0d3, double fit1d3) {
00016 
00017 
00018   const int nz = (*source.get_mp().get_mg()).get_nzone();   // Number of domains
00019   int nr = (*source.get_mp().get_mg()).get_nr(1);   // Number of collocation points in r in each domain
00020   int nt = (*source.get_mp().get_mg()).get_nt(1);   // Number of collocation points in theta in each domain
00021   int np = (*source.get_mp().get_mg()).get_np(1);   // Number of collocation points in phi in each domain
00022   const Map_af* map = dynamic_cast<const Map_af*>(&source.get_mp()) ;
00023   const Mg3d* mgrid = (*map).get_mg();
00024 
00025 
00026     // Some helpful stuff...
00027     
00028     const Coord& rr = (*map).r ;
00029     Scalar rrr (*map) ; 
00030     rrr = rr ; 
00031     rrr.set_spectral_va().set_base(source.get_spectral_va().base); 
00032 
00033     Scalar source_coq = source ;
00034     source_coq.mult_r() ;
00035     source_coq.mult_r() ;
00036     source.set_spectral_va().ylm() ;
00037     source_coq.set_spectral_va().ylm() ;
00038     Scalar phi(source.get_mp()) ;
00039     phi.annule_hard() ;
00040     //  phi.std_spectral_base();
00041         phi.set_spectral_va().set_base(source.get_spectral_va().base) ;
00042     phi.set_spectral_va().ylm() ;   
00043     Mtbl_cf& sol_coef = (*phi.set_spectral_va().c_cf) ;
00044 
00045     const Base_val& base = source.get_spectral_base() ;
00046     Mtbl_cf sol_part(mgrid, base) ; sol_part.annule_hard() ;
00047     Mtbl_cf sol_hom1(mgrid, base) ; sol_hom1.annule_hard() ;
00048     Mtbl_cf sol_hom2(mgrid, base) ; sol_hom2.annule_hard() ;
00049 
00050     int l_q, m_q, base_r ;
00051 
00052     { int lz = 0 ;
00053         for (int k=0; k < np; k++)
00054         for (int j=0; j<nt; j++) {
00055             base.give_quant_numbers(lz, k, j, m_q, l_q, base_r) ;
00056             if (nullite_plm(j, nt, k, np, base) == 1) {
00057               for (int ii=0 ; ii<nr ; ii++){
00058                 sol_hom1.set(lz, k, j, ii) = 0 ;
00059                 sol_part.set(lz, k, j, ii) = 0 ;
00060               }
00061 
00062             }
00063         }
00064     }
00065 
00066 
00067     { int lz = 1 ;    // The first shell is a really particular case, where the operator is different, and homogeneous solutions have to be handled really carefully.
00068         double alpha = (*map).get_alpha()[lz] ;
00069         double beta = (*map).get_beta()[lz] ;
00070         double ech = beta / alpha ; 
00071         for (int k=0; k < np; k++)
00072           for (int j=0; j<nt; j++) {
00073         base.give_quant_numbers(lz, k, j, m_q, l_q, base_r) ;
00074         if (nullite_plm(j, nt, k, np, base) == 1) {
00075           
00076           
00077           
00078           Matrice ope(nr,nr) ;
00079           ope.annule_hard() ;
00080           
00081           Diff_dsdx dx(base_r, nr) ; const Matrice& mdx = dx.get_matrice() ;
00082           Diff_dsdx2 dx2(base_r, nr) ; const Matrice& mdx2 = dx2.get_matrice() ;
00083           Diff_id id(base_r, nr) ; const Matrice& mid = id.get_matrice() ;
00084           Diff_xdsdx xdx(base_r, nr) ; const Matrice& mxdx = xdx.get_matrice() ;
00085           Diff_xdsdx2 xdx2(base_r, nr) ; const Matrice& mxdx2 = xdx2.get_matrice() ;
00086           Diff_x2dsdx2 x2dx2(base_r, nr) ; const Matrice& mx2dx2 = x2dx2.get_matrice() ;
00087           Diff_x3dsdx2 x3dx2 (base_r, nr); const Matrice& mx3dx2 = x3dx2.get_matrice();
00088           Diff_x4dsdx2 x4dx2 (base_r, nr); const Matrice& mx4dx2 = x4dx2.get_matrice();
00089           
00090           
00091     
00092 //          ope = mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2 + 2*(mxdx + ech*mdx)
00093 //        - l_q*(l_q+1)*mid  - (mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2) - (fit)*(mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2) + (fit)*beta*(mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2) + (fit)*alpha*(mx3dx2 + 2*ech*mx2dx2 + ech*ech*mxdx2)  ;
00094           
00095 
00096 //        ope = mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2 + 2*(mxdx + ech*mdx)
00097 //          - l_q*(l_q+1)*mid  - ((mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2) -(fit)*(mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2) + (fit)*beta*(mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2) 
00098 //                    + (fit)*alpha*(mx3dx2 + 2*ech*mx2dx2 + ech*ech*mxdx2) + fit2*alpha*alpha*(mx4dx2 + 2*ech*mx3dx2 + ech*ech*mx2dx2) 
00099 //                    + 2*fit2*alpha*(beta-1.)*(mx3dx2 + 2*ech*mx2dx2 + ech*ech*mxdx2) + fit2*(beta-1.)*(beta-1.)*(mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2));
00100           
00101 
00102 
00103           ope = mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2 + 2*(mxdx + ech*mdx)
00104             - l_q*(l_q+1)*mid + 2*l_q*mid - ((mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2) -(fit)*(mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2) + (fit)*beta*(mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2) 
00105                       + (fit)*alpha*(mx3dx2 + 2*ech*mx2dx2 + ech*ech*mxdx2) + fit2*alpha*alpha*(mx4dx2 + 2*ech*mx3dx2 + ech*ech*mx2dx2) 
00106                       + fit2*alpha*(beta-1.)*(mx3dx2 + 2*ech*mx2dx2 + ech*ech*mxdx2) + fit2*alpha*(beta- rrr.val_grid_point(1,0,0, nr-1))*(mx3dx2 + 2*ech*mx2dx2 + ech*ech*mxdx2)+ fit2*(beta-1.)*(beta- rrr.val_grid_point(1,0,0,nr -1))*(mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2));
00107           
00108 
00109 
00110 
00111           for (int col=0; col<nr; col++)
00112             ope.set(nr-1, col) = 0 ;
00113           ope.set(nr-1, 0) = 1 ;
00114 
00115           
00116           Tbl rhs(nr); 
00117           rhs.annule_hard() ;
00118           for (int i=0; i<nr; i++)
00119             rhs.set(i) = (*source_coq.get_spectral_va().c_cf)(1, k, j, i) ;
00120           rhs.set(nr-1) = 0 ;
00121           ope.set_lu() ;
00122           Tbl sol = ope.inverse(rhs) ;
00123 
00124           
00125           for (int i=0; i<nr; i++)
00126             sol_part.set(1, k, j, i) = sol(i) ;
00127           
00128           rhs.annule_hard();
00129           rhs.set(nr-1) = 1 ;
00130           sol = ope.inverse(rhs) ;
00131 
00132 
00133           for (int i=0; i<nr; i++)
00134             sol_hom1.set(1, k, j, i) = sol(i) ;              
00135           
00136           
00137         }
00138           }
00139     }
00140     
00141     // Attention! zones 2 et 3traitee separement egalement!!!
00142 
00143     
00144     // Current implementations only allow grids with more than 3 shells.
00145     
00146           { int lz = 2 ;
00147 
00148         double alpha = (*map).get_alpha()[lz] ;
00149         double beta = (*map).get_beta()[lz] ;
00150         double ech = beta / alpha ; 
00151     
00152       for (int k=0; k < np; k++)
00153         for (int j=0; j<nt; j++) {
00154           base.give_quant_numbers(lz, k, j, m_q, l_q, base_r) ;
00155           if (nullite_plm(j, nt, k, np, base) == 1) {
00156         
00157         Matrice ope(nr,nr) ;
00158         ope.annule_hard() ;
00159         
00160         Diff_dsdx dx(base_r, nr) ; const Matrice& mdx = dx.get_matrice() ;
00161         Diff_dsdx2 dx2(base_r, nr) ; const Matrice& mdx2 = dx2.get_matrice() ;
00162         Diff_id id(base_r, nr) ; const Matrice& mid = id.get_matrice() ;
00163         Diff_xdsdx xdx(base_r, nr) ; const Matrice& mxdx = xdx.get_matrice() ;
00164         Diff_xdsdx2 xdx2(base_r, nr) ; const Matrice& mxdx2 = xdx2.get_matrice() ;
00165         Diff_x2dsdx2 x2dx2(base_r, nr) ; const Matrice& mx2dx2 = x2dx2.get_matrice() ;
00166         Diff_x3dsdx2 x3dx2 (base_r, nr); const Matrice& mx3dx2 = x3dx2.get_matrice();
00167     
00168             ope = mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2 + 2*(mxdx + ech*mdx)
00169         - l_q*(l_q+1)*mid + 2*l_q*mid - fit0d2*(mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2) + (fit1d2)*(rrr.val_grid_point(lz, 0, 0, 0))*(mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2) - (fit1d2)*beta*(mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2) - (fit1d2)*alpha*(mx3dx2 + 2*ech*mx2dx2 + ech*ech*mxdx2)  ;
00170 
00171 
00172 
00173 //              ope = mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2 + 2*(mxdx + ech*mdx)
00174 //                - l_q*(l_q+1)*mid ;
00175         
00176         for (int col=0; col<nr; col++)
00177           ope.set(nr-1, col) = 0 ;
00178         ope.set(nr-1, 0) = 1 ;
00179         for (int col=0; col<nr; col++) {
00180           ope.set(nr-2, col) = 0 ;
00181         }
00182         ope.set(nr-2, 1) = 1 ;
00183     
00184         Tbl rhs(nr) ;
00185         rhs.annule_hard() ;
00186         for (int i=0; i<nr; i++)
00187           rhs.set(i) = (*source_coq.get_spectral_va().c_cf)(lz, k, j, i) ;
00188         rhs.set(nr-2) = 0 ;
00189         rhs.set(nr-1) = 0 ;
00190         ope.set_lu() ;
00191         Tbl sol = ope.inverse(rhs) ;
00192 
00193         for (int i=0; i<nr; i++)
00194                 sol_part.set(lz, k, j, i) = sol(i) ;
00195         
00196         rhs.annule_hard() ;
00197         rhs.set(nr-2) = 1 ;
00198         sol = ope.inverse(rhs) ;
00199         for (int i=0; i<nr; i++)
00200           sol_hom1.set(lz, k, j, i) = sol(i) ;
00201         
00202         rhs.set(nr-2) = 0 ;
00203         rhs.set(nr-1) = 1 ;
00204         sol = ope.inverse(rhs) ;
00205         for (int i=0; i<nr; i++)
00206           sol_hom2.set(lz, k, j, i) = sol(i) ;
00207         
00208           }
00209         }
00210       
00211       } 
00212 
00213 
00214     
00215           { int lz = 3 ;
00216 
00217         double alpha = (*map).get_alpha()[lz] ;
00218         double beta = (*map).get_beta()[lz] ;
00219         double ech = beta / alpha ; 
00220     
00221       for (int k=0; k < np; k++)
00222         for (int j=0; j<nt; j++) {
00223           base.give_quant_numbers(lz, k, j, m_q, l_q, base_r) ;
00224           if (nullite_plm(j, nt, k, np, base) == 1) {
00225         
00226         Matrice ope(nr,nr) ;
00227         ope.annule_hard() ;
00228         
00229         Diff_dsdx dx(base_r, nr) ; const Matrice& mdx = dx.get_matrice() ;
00230         Diff_dsdx2 dx2(base_r, nr) ; const Matrice& mdx2 = dx2.get_matrice() ;
00231         Diff_id id(base_r, nr) ; const Matrice& mid = id.get_matrice() ;
00232         Diff_xdsdx xdx(base_r, nr) ; const Matrice& mxdx = xdx.get_matrice() ;
00233         Diff_xdsdx2 xdx2(base_r, nr) ; const Matrice& mxdx2 = xdx2.get_matrice() ;
00234         Diff_x2dsdx2 x2dx2(base_r, nr) ; const Matrice& mx2dx2 = x2dx2.get_matrice() ;
00235         Diff_x3dsdx2 x3dx2 (base_r, nr); const Matrice& mx3dx2 = x3dx2.get_matrice();
00236     
00237             ope = mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2 + 2*(mxdx + ech*mdx)
00238         - l_q*(l_q+1)*mid  +2*l_q*mid - fit0d3*(mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2) + (fit1d3)*(rrr.val_grid_point(lz, 0, 0, 0))*(mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2) - (fit1d3)*beta*(mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2) - (fit1d3)*alpha*(mx3dx2 + 2*ech*mx2dx2 + ech*ech*mxdx2)  ;
00239 
00240 
00241 
00242 //              ope = mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2 + 2*(mxdx + ech*mdx)
00243 //                - l_q*(l_q+1)*mid ;
00244         
00245         for (int col=0; col<nr; col++)
00246           ope.set(nr-1, col) = 0 ;
00247         ope.set(nr-1, 0) = 1 ;
00248         for (int col=0; col<nr; col++) {
00249           ope.set(nr-2, col) = 0 ;
00250         }
00251         ope.set(nr-2, 1) = 1 ;
00252     
00253         Tbl rhs(nr) ;
00254         rhs.annule_hard() ;
00255         for (int i=0; i<nr; i++)
00256           rhs.set(i) = (*source_coq.get_spectral_va().c_cf)(lz, k, j, i) ;
00257         rhs.set(nr-2) = 0 ;
00258         rhs.set(nr-1) = 0 ;
00259         ope.set_lu() ;
00260         Tbl sol = ope.inverse(rhs) ;
00261 
00262         for (int i=0; i<nr; i++)
00263                 sol_part.set(lz, k, j, i) = sol(i) ;
00264         
00265         rhs.annule_hard() ;
00266         rhs.set(nr-2) = 1 ;
00267         sol = ope.inverse(rhs) ;
00268         for (int i=0; i<nr; i++)
00269           sol_hom1.set(lz, k, j, i) = sol(i) ;
00270         
00271         rhs.set(nr-2) = 0 ;
00272         rhs.set(nr-1) = 1 ;
00273         sol = ope.inverse(rhs) ;
00274         for (int i=0; i<nr; i++)
00275           sol_hom2.set(lz, k, j, i) = sol(i) ;
00276         
00277           }
00278         }
00279       
00280       } 
00281 
00282 
00283 
00284 
00285 
00286     
00287     
00288     // Current implementations only allow grids with more than 2 shells.
00289     
00290     for (int lz=4; lz<nz-1; lz++) {
00291       double ech = (*map).get_beta()[lz] / (*map).get_alpha()[lz] ;
00292       for (int k=0; k < np; k++)
00293         for (int j=0; j<nt; j++) {
00294           base.give_quant_numbers(lz, k, j, m_q, l_q, base_r) ;
00295           if (nullite_plm(j, nt, k, np, base) == 1) {
00296         
00297         Matrice ope(nr,nr) ;
00298         ope.annule_hard() ;
00299         
00300         Diff_dsdx dx(base_r, nr) ; const Matrice& mdx = dx.get_matrice() ;
00301         Diff_dsdx2 dx2(base_r, nr) ; const Matrice& mdx2 = dx2.get_matrice() ;
00302         Diff_id id(base_r, nr) ; const Matrice& mid = id.get_matrice() ;
00303         Diff_xdsdx xdx(base_r, nr) ; const Matrice& mxdx = xdx.get_matrice() ;
00304         Diff_xdsdx2 xdx2(base_r, nr) ; const Matrice& mxdx2 = xdx2.get_matrice() ;
00305         Diff_x2dsdx2 x2dx2(base_r, nr) ; const Matrice& mx2dx2 = x2dx2.get_matrice() ;
00306         ope = mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2 + 2*(mxdx + ech*mdx)
00307           - l_q*(l_q+1)*mid +2*l_q*mid ;
00308         
00309         for (int col=0; col<nr; col++)
00310           ope.set(nr-1, col) = 0 ;
00311         ope.set(nr-1, 0) = 1 ;
00312         for (int col=0; col<nr; col++) {
00313           ope.set(nr-2, col) = 0 ;
00314         }
00315         ope.set(nr-2, 1) = 1 ;
00316     
00317         Tbl rhs(nr) ;
00318         rhs.annule_hard() ;
00319         for (int i=0; i<nr; i++)
00320           rhs.set(i) = (*source_coq.get_spectral_va().c_cf)(lz, k, j, i) ;
00321         rhs.set(nr-2) = 0 ;
00322         rhs.set(nr-1) = 0 ;
00323         ope.set_lu() ;
00324         Tbl sol = ope.inverse(rhs) ;
00325 
00326         for (int i=0; i<nr; i++)
00327                 sol_part.set(lz, k, j, i) = sol(i) ;
00328         
00329         rhs.annule_hard() ;
00330         rhs.set(nr-2) = 1 ;
00331         sol = ope.inverse(rhs) ;
00332         for (int i=0; i<nr; i++)
00333           sol_hom1.set(lz, k, j, i) = sol(i) ;
00334         
00335         rhs.set(nr-2) = 0 ;
00336         rhs.set(nr-1) = 1 ;
00337         sol = ope.inverse(rhs) ;
00338         for (int i=0; i<nr; i++)
00339           sol_hom2.set(lz, k, j, i) = sol(i) ;
00340         
00341           }
00342         }
00343       
00344     }
00345     { int lz = nz-1 ;
00346     double alpha = (*map).get_alpha()[lz] ;
00347     for (int k=0; k < np; k++)
00348       for (int j=0; j<nt; j++) {
00349         base.give_quant_numbers(lz, k, j, m_q, l_q, base_r) ;
00350         if (nullite_plm(j, nt, k, np, base) == 1) {
00351           
00352           Matrice ope(nr,nr) ;
00353           ope.annule_hard() ;
00354           Diff_dsdx2 dx2(base_r, nr) ; const Matrice& mdx2 = dx2.get_matrice() ;
00355           Diff_sx2 sx2(base_r, nr) ; const Matrice& ms2 = sx2.get_matrice() ;
00356           
00357             ope = (mdx2 - l_q*(l_q+1)*ms2 + 2*l_q*ms2)/(alpha*alpha) ;
00358             
00359             for (int i=0; i<nr; i++)
00360               ope.set(nr-1, i) = 0 ;
00361             ope.set(nr-1, 0) = 1 ; //for the true homogeneous solution
00362             
00363             for (int i=0; i<nr; i++) {
00364               ope.set(nr-2, i) = 1 ; //for the limit at inifinity
00365             }
00366 
00367             if (l_q > 0) {
00368                 for (int i=0; i<nr; i++) {
00369                 ope.set(nr-3, i) = i*i ; //for the finite part (derivative = 0 at infty)
00370                 }
00371             }
00372             //  cout << "l: " << l_q << endl ;
00373 
00374             Tbl rhs(nr) ;
00375             rhs.annule_hard() ;
00376             for (int i=0; i<nr; i++)
00377                 rhs.set(i) = (*source.get_spectral_va().c_cf)(lz, k, j, i) ;
00378             if (l_q>0) rhs.set(nr-3) = 0 ;
00379             rhs.set(nr-2) = 0 ;
00380             rhs.set(nr-1) = 0 ;
00381             ope.set_lu() ;
00382             Tbl sol = ope.inverse(rhs) ;
00383                
00384             for (int i=0; i<nr; i++)
00385                 sol_part.set(lz, k, j, i) = sol(i) ;
00386 
00387             rhs.annule_hard() ;
00388             rhs.set(nr-1) = 1 ;
00389             sol = ope.inverse(rhs) ;
00390             for (int i=0; i<nr; i++)
00391                 sol_hom2.set(lz, k, j, i) = sol(i) ;
00392 
00393             }
00394         }
00395     }
00396 
00397     Mtbl_cf dpart = sol_part ; dpart.dsdx() ;
00398     Mtbl_cf dhom1 = sol_hom1 ; dhom1.dsdx() ;
00399     Mtbl_cf dhom2 = sol_hom2 ; dhom2.dsdx() ;
00400 
00401 
00402     // Now matching the homogeneous solutions between the different domains...
00403     
00404     for (int k=0; k < np; k++)
00405         for (int j=0; j<nt; j++) {
00406         base.give_quant_numbers(0, k, j, m_q, l_q, base_r) ;
00407         if (nullite_plm(j, nt, k, np, base) == 1) {
00408             Matrice systeme(2*nz-4, 2*nz-4) ;
00409             systeme.annule_hard() ;
00410             Tbl rhs(2*nz-4) ;
00411             rhs.annule_hard() ;
00412 
00413             //First shell 
00414             int lin = 0 ;
00415             int col = 0 ;
00416             
00417             double alpha = (*map).get_alpha()[1] ;
00418             
00419             systeme.set(lin, col) += sol_hom1.val_out_bound_jk(1, j, k) ;
00420             rhs.set(lin) -= sol_part.val_out_bound_jk(1, j, k) ;
00421             
00422             lin++ ;
00423             systeme.set(lin, col) += dhom1.val_out_bound_jk(1, j, k) / alpha ;
00424             rhs.set(lin) -=  dpart.val_out_bound_jk(1, j, k) / alpha ;
00425             col += 1 ;
00426             
00427             //Shells
00428             for (int lz=2; lz<nz-1; lz++) {
00429               alpha = (*map).get_alpha()[lz] ;
00430               lin-- ;
00431               systeme.set(lin,col) -= sol_hom1.val_in_bound_jk(lz, j, k) ;
00432               systeme.set(lin,col+1) -= sol_hom2.val_in_bound_jk(lz, j, k) ;
00433               rhs.set(lin) += sol_part.val_in_bound_jk(lz, j, k) ;
00434               
00435               lin++ ;
00436               systeme.set(lin,col) -= dhom1.val_in_bound_jk(lz, j, k) / alpha ;
00437               systeme.set(lin,col+1) -= dhom2.val_in_bound_jk(lz, j, k) / alpha ;
00438               rhs.set(lin) += dpart.val_in_bound_jk(lz, j, k) / alpha;
00439               
00440               lin++ ;
00441               systeme.set(lin, col) += sol_hom1.val_out_bound_jk(lz, j, k) ;
00442               systeme.set(lin, col+1) += sol_hom2.val_out_bound_jk(lz, j, k) ;
00443               rhs.set(lin) -= sol_part.val_out_bound_jk(lz, j, k) ;
00444               
00445               lin++ ;
00446               systeme.set(lin, col) += dhom1.val_out_bound_jk(lz, j, k) / alpha ;
00447               systeme.set(lin, col+1) += dhom2.val_out_bound_jk(lz, j, k) / alpha ;
00448               rhs.set(lin) -= dpart.val_out_bound_jk(lz, j, k) / alpha ;
00449               col += 2 ;
00450             }
00451             
00452             //CED
00453             alpha = (*map).get_alpha()[nz-1] ;
00454             lin-- ;
00455             systeme.set(lin,col) -= sol_hom2.val_in_bound_jk(nz-1, j, k) ;
00456             rhs.set(lin) += sol_part.val_in_bound_jk(nz-1, j, k) ;
00457 
00458             lin++ ;
00459             systeme.set(lin,col) -= (-4*alpha)*dhom2.val_in_bound_jk(nz-1, j, k) ;
00460             rhs.set(lin) += (-4*alpha)*dpart.val_in_bound_jk(nz-1, j, k) ;
00461 
00462             systeme.set_lu() ;
00463 
00464             // cout << systeme << endl;
00465 
00466             Tbl coef = systeme.inverse(rhs);
00467             int indice = 0 ;
00468                         
00469             //      int tryr; cin >> tryr;
00470             //          for (int i=0; i<mgrid.get_nr(0); i++)
00471             //          sol_coef.set(0, k, j, i) = 0 ;
00472             //          sol_coef.set(0, k, j, 0) =  (*bound.get_spectral_va().c_cf)(0, k, j, 0) ;
00473             
00474             for (int i=0; i<(*mgrid).get_nr(1); i++)
00475               sol_coef.set(1, k, j, i) = sol_part(1, k, j, i)
00476             +coef(indice)*sol_hom1(1, k, j, i) ;
00477             indice +=1;
00478             
00479             
00480             for (int lz=2; lz<nz-1; lz++) {
00481               for (int i=0; i<(*mgrid).get_nr(lz); i++)
00482             sol_coef.set(lz, k, j, i) = sol_part(lz, k, j, i)
00483               +coef(indice)*sol_hom1(lz, k, j, i) 
00484               +coef(indice+1)*sol_hom2(lz, k, j, i) ;
00485               indice += 2 ;
00486             }
00487             for (int i=0; i<(*mgrid).get_nr(nz-1); i++)
00488               sol_coef.set(nz-1, k, j, i) = sol_part(nz-1, k, j, i)
00489             +coef(indice)*sol_hom2(nz-1, k, j, i) ;
00490 
00491         }
00492         }
00493     
00494     
00495     delete phi.set_spectral_va().c ;
00496     phi.set_spectral_va().c = 0x0 ;
00497     //  phi.set_spectral_va().ylm_i() ;
00498     
00499     phi.annule_domain(nz-1);
00500     
00501     resu = phi;
00502 
00503 }

Generated on Tue Feb 7 01:35:21 2012 for LORENE by  doxygen 1.4.6