tensorellipticCt.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 , associated with spectral variable tilde (C) with main characteristics
00012 //fit and fit2 (Suitable for tensorial resolution of BH spacetime)
00013 // See also tilde(laplacian)
00014 
00015  void tensorellipticCt( 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 
00027     // Some helpful stuff...
00028     
00029     const Coord& rr = (*map).r ;
00030     Scalar rrr (*map) ; 
00031     rrr = rr ; 
00032     rrr.set_spectral_va().set_base(source.get_spectral_va().base); 
00033 
00034     Scalar source_coq = source ;
00035     source_coq.mult_r() ;
00036     source_coq.mult_r() ;
00037     source.set_spectral_va().ylm() ;
00038     source_coq.set_spectral_va().ylm() ;
00039     Scalar phi(source.get_mp()) ;
00040     phi.annule_hard() ;
00041     //  phi.std_spectral_base();
00042         phi.set_spectral_va().set_base(source.get_spectral_va().base) ;
00043     phi.set_spectral_va().ylm() ;   
00044     Mtbl_cf& sol_coef = (*phi.set_spectral_va().c_cf) ;
00045 
00046     const Base_val& base = source.get_spectral_base() ;
00047     Mtbl_cf sol_part(mgrid, base) ; sol_part.annule_hard() ;
00048     Mtbl_cf sol_hom1(mgrid, base) ; sol_hom1.annule_hard() ;
00049     Mtbl_cf sol_hom2(mgrid, base) ; sol_hom2.annule_hard() ;
00050 
00051     int l_q, m_q, base_r ;
00052 
00053     { int lz = 0 ;
00054         for (int k=0; k < np; k++)
00055         for (int j=0; j<nt; j++) {
00056             base.give_quant_numbers(lz, k, j, m_q, l_q, base_r) ;
00057             if (nullite_plm(j, nt, k, np, base) == 1) {
00058               for (int ii=0 ; ii<nr ; ii++){
00059                 sol_hom1.set(lz, k, j, ii) = 0 ;
00060                 sol_part.set(lz, k, j, ii) = 0 ;
00061               }
00062 
00063             }
00064         }
00065     }
00066 
00067 
00068     { 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.
00069         double alpha = (*map).get_alpha()[lz] ;
00070         double beta = (*map).get_beta()[lz] ;
00071         double ech = beta / alpha ; 
00072         for (int k=0; k < np; k++)
00073           for (int j=0; j<nt; j++) {
00074         base.give_quant_numbers(lz, k, j, m_q, l_q, base_r) ;
00075         if (nullite_plm(j, nt, k, np, base) == 1) {
00076           
00077           
00078           
00079           Matrice ope(nr,nr) ;
00080           ope.annule_hard() ;
00081           
00082           Diff_dsdx dx(base_r, nr) ; const Matrice& mdx = dx.get_matrice() ;
00083           Diff_dsdx2 dx2(base_r, nr) ; const Matrice& mdx2 = dx2.get_matrice() ;
00084           Diff_id id(base_r, nr) ; const Matrice& mid = id.get_matrice() ;
00085           Diff_xdsdx xdx(base_r, nr) ; const Matrice& mxdx = xdx.get_matrice() ;
00086           Diff_xdsdx2 xdx2(base_r, nr) ; const Matrice& mxdx2 = xdx2.get_matrice() ;
00087           Diff_x2dsdx2 x2dx2(base_r, nr) ; const Matrice& mx2dx2 = x2dx2.get_matrice() ;
00088           Diff_x3dsdx2 x3dx2 (base_r, nr); const Matrice& mx3dx2 = x3dx2.get_matrice();
00089           Diff_x4dsdx2 x4dx2 (base_r, nr); const Matrice& mx4dx2 = x4dx2.get_matrice();
00090           
00091           
00092     
00093 //          ope = mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2 + 2*(mxdx + ech*mdx)
00094 //        - 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)  ;
00095           
00096 
00097 //        ope = mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2 + 2*(mxdx + ech*mdx)
00098 //          - 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) 
00099 //                    + (fit)*alpha*(mx3dx2 + 2*ech*mx2dx2 + ech*ech*mxdx2) + fit2*alpha*alpha*(mx4dx2 + 2*ech*mx3dx2 + ech*ech*mx2dx2) 
00100 //                    + 2*fit2*alpha*(beta-1.)*(mx3dx2 + 2*ech*mx2dx2 + ech*ech*mxdx2) + fit2*(beta-1.)*(beta-1.)*(mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2));
00101           
00102 
00103 
00104           ope = mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2 + 2*(mxdx + ech*mdx)
00105             - l_q*(l_q+1)*mid -2*(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) 
00106                       + (fit)*alpha*(mx3dx2 + 2*ech*mx2dx2 + ech*ech*mxdx2) + fit2*alpha*alpha*(mx4dx2 + 2*ech*mx3dx2 + ech*ech*mx2dx2) 
00107                       + 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));
00108           
00109 
00110 
00111 
00112           for (int col=0; col<nr; col++)
00113             ope.set(nr-1, col) = 0 ;
00114           ope.set(nr-1, 0) = 1 ;
00115 
00116           
00117           Tbl rhs(nr); 
00118           rhs.annule_hard() ;
00119           for (int i=0; i<nr; i++)
00120             rhs.set(i) = (*source_coq.get_spectral_va().c_cf)(1, k, j, i) ;
00121           rhs.set(nr-1) = 0 ;
00122           ope.set_lu() ;
00123           Tbl sol = ope.inverse(rhs) ;
00124 
00125           
00126           for (int i=0; i<nr; i++)
00127             sol_part.set(1, k, j, i) = sol(i) ;
00128           
00129           rhs.annule_hard();
00130           rhs.set(nr-1) = 1 ;
00131           sol = ope.inverse(rhs) ;
00132 
00133 
00134           for (int i=0; i<nr; i++)
00135             sol_hom1.set(1, k, j, i) = sol(i) ;              
00136           
00137           
00138         }
00139           }
00140     }
00141     
00142     // Attention! zones 2 et 3traitee separement egalement!!!
00143 
00144     
00145     // Current implementations only allow grids with more than 3 shells.
00146     
00147           { int lz = 2 ;
00148 
00149         double alpha = (*map).get_alpha()[lz] ;
00150         double beta = (*map).get_beta()[lz] ;
00151         double ech = beta / alpha ; 
00152     
00153       for (int k=0; k < np; k++)
00154         for (int j=0; j<nt; j++) {
00155           base.give_quant_numbers(lz, k, j, m_q, l_q, base_r) ;
00156           if (nullite_plm(j, nt, k, np, base) == 1) {
00157         
00158         Matrice ope(nr,nr) ;
00159         ope.annule_hard() ;
00160         
00161         Diff_dsdx dx(base_r, nr) ; const Matrice& mdx = dx.get_matrice() ;
00162         Diff_dsdx2 dx2(base_r, nr) ; const Matrice& mdx2 = dx2.get_matrice() ;
00163         Diff_id id(base_r, nr) ; const Matrice& mid = id.get_matrice() ;
00164         Diff_xdsdx xdx(base_r, nr) ; const Matrice& mxdx = xdx.get_matrice() ;
00165         Diff_xdsdx2 xdx2(base_r, nr) ; const Matrice& mxdx2 = xdx2.get_matrice() ;
00166         Diff_x2dsdx2 x2dx2(base_r, nr) ; const Matrice& mx2dx2 = x2dx2.get_matrice() ;
00167         Diff_x3dsdx2 x3dx2 (base_r, nr); const Matrice& mx3dx2 = x3dx2.get_matrice();
00168     
00169             ope = mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2 + 2*(mxdx + ech*mdx)
00170         - l_q*(l_q+1)*mid  -2*(l_q+1)*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)  ;
00171 
00172 
00173 
00174 //              ope = mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2 + 2*(mxdx + ech*mdx)
00175 //                - l_q*(l_q+1)*mid ;
00176         
00177         for (int col=0; col<nr; col++)
00178           ope.set(nr-1, col) = 0 ;
00179         ope.set(nr-1, 0) = 1 ;
00180         for (int col=0; col<nr; col++) {
00181           ope.set(nr-2, col) = 0 ;
00182         }
00183         ope.set(nr-2, 1) = 1 ;
00184     
00185         Tbl rhs(nr) ;
00186         rhs.annule_hard() ;
00187         for (int i=0; i<nr; i++)
00188           rhs.set(i) = (*source_coq.get_spectral_va().c_cf)(lz, k, j, i) ;
00189         rhs.set(nr-2) = 0 ;
00190         rhs.set(nr-1) = 0 ;
00191         ope.set_lu() ;
00192         Tbl sol = ope.inverse(rhs) ;
00193 
00194         for (int i=0; i<nr; i++)
00195                 sol_part.set(lz, k, j, i) = sol(i) ;
00196         
00197         rhs.annule_hard() ;
00198         rhs.set(nr-2) = 1 ;
00199         sol = ope.inverse(rhs) ;
00200         for (int i=0; i<nr; i++)
00201           sol_hom1.set(lz, k, j, i) = sol(i) ;
00202         
00203         rhs.set(nr-2) = 0 ;
00204         rhs.set(nr-1) = 1 ;
00205         sol = ope.inverse(rhs) ;
00206         for (int i=0; i<nr; i++)
00207           sol_hom2.set(lz, k, j, i) = sol(i) ;
00208         
00209           }
00210         }
00211       
00212       } 
00213 
00214 
00215     
00216           { int lz = 3 ;
00217 
00218         double alpha = (*map).get_alpha()[lz] ;
00219         double beta = (*map).get_beta()[lz] ;
00220         double ech = beta / alpha ; 
00221     
00222       for (int k=0; k < np; k++)
00223         for (int j=0; j<nt; j++) {
00224           base.give_quant_numbers(lz, k, j, m_q, l_q, base_r) ;
00225           if (nullite_plm(j, nt, k, np, base) == 1) {
00226         
00227         Matrice ope(nr,nr) ;
00228         ope.annule_hard() ;
00229         
00230         Diff_dsdx dx(base_r, nr) ; const Matrice& mdx = dx.get_matrice() ;
00231         Diff_dsdx2 dx2(base_r, nr) ; const Matrice& mdx2 = dx2.get_matrice() ;
00232         Diff_id id(base_r, nr) ; const Matrice& mid = id.get_matrice() ;
00233         Diff_xdsdx xdx(base_r, nr) ; const Matrice& mxdx = xdx.get_matrice() ;
00234         Diff_xdsdx2 xdx2(base_r, nr) ; const Matrice& mxdx2 = xdx2.get_matrice() ;
00235         Diff_x2dsdx2 x2dx2(base_r, nr) ; const Matrice& mx2dx2 = x2dx2.get_matrice() ;
00236         Diff_x3dsdx2 x3dx2 (base_r, nr); const Matrice& mx3dx2 = x3dx2.get_matrice();
00237     
00238             ope = mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2 + 2*(mxdx + ech*mdx)
00239         - l_q*(l_q+1)*mid  -2*(l_q+1)*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)  ;
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     // Current implementations only allow grids with more than 2 shells.
00285     
00286     for (int lz=4; lz<nz-1; lz++) {
00287       double ech = (*map).get_beta()[lz] / (*map).get_alpha()[lz] ;
00288       for (int k=0; k < np; k++)
00289         for (int j=0; j<nt; j++) {
00290           base.give_quant_numbers(lz, k, j, m_q, l_q, base_r) ;
00291           if (nullite_plm(j, nt, k, np, base) == 1) {
00292         
00293         Matrice ope(nr,nr) ;
00294         ope.annule_hard() ;
00295         
00296         Diff_dsdx dx(base_r, nr) ; const Matrice& mdx = dx.get_matrice() ;
00297         Diff_dsdx2 dx2(base_r, nr) ; const Matrice& mdx2 = dx2.get_matrice() ;
00298         Diff_id id(base_r, nr) ; const Matrice& mid = id.get_matrice() ;
00299         Diff_xdsdx xdx(base_r, nr) ; const Matrice& mxdx = xdx.get_matrice() ;
00300         Diff_xdsdx2 xdx2(base_r, nr) ; const Matrice& mxdx2 = xdx2.get_matrice() ;
00301         Diff_x2dsdx2 x2dx2(base_r, nr) ; const Matrice& mx2dx2 = x2dx2.get_matrice() ;
00302         ope = mx2dx2 + 2*ech*mxdx2 + ech*ech*mdx2 + 2*(mxdx + ech*mdx)
00303           - l_q*(l_q+1)*mid -2*(l_q+1)*mid;
00304         
00305         for (int col=0; col<nr; col++)
00306           ope.set(nr-1, col) = 0 ;
00307         ope.set(nr-1, 0) = 1 ;
00308         for (int col=0; col<nr; col++) {
00309           ope.set(nr-2, col) = 0 ;
00310         }
00311         ope.set(nr-2, 1) = 1 ;
00312     
00313         Tbl rhs(nr) ;
00314         rhs.annule_hard() ;
00315         for (int i=0; i<nr; i++)
00316           rhs.set(i) = (*source_coq.get_spectral_va().c_cf)(lz, k, j, i) ;
00317         rhs.set(nr-2) = 0 ;
00318         rhs.set(nr-1) = 0 ;
00319         ope.set_lu() ;
00320         Tbl sol = ope.inverse(rhs) ;
00321 
00322         for (int i=0; i<nr; i++)
00323                 sol_part.set(lz, k, j, i) = sol(i) ;
00324         
00325         rhs.annule_hard() ;
00326         rhs.set(nr-2) = 1 ;
00327         sol = ope.inverse(rhs) ;
00328         for (int i=0; i<nr; i++)
00329           sol_hom1.set(lz, k, j, i) = sol(i) ;
00330         
00331         rhs.set(nr-2) = 0 ;
00332         rhs.set(nr-1) = 1 ;
00333         sol = ope.inverse(rhs) ;
00334         for (int i=0; i<nr; i++)
00335           sol_hom2.set(lz, k, j, i) = sol(i) ;
00336         
00337           }
00338         }
00339       
00340     }
00341     { int lz = nz-1 ;
00342     double alpha = (*map).get_alpha()[lz] ;
00343     for (int k=0; k < np; k++)
00344       for (int j=0; j<nt; j++) {
00345         base.give_quant_numbers(lz, k, j, m_q, l_q, base_r) ;
00346         if (nullite_plm(j, nt, k, np, base) == 1) {
00347           
00348           Matrice ope(nr,nr) ;
00349           ope.annule_hard() ;
00350           Diff_dsdx2 dx2(base_r, nr) ; const Matrice& mdx2 = dx2.get_matrice() ;
00351           Diff_sx2 sx2(base_r, nr) ; const Matrice& ms2 = sx2.get_matrice() ;
00352           
00353             ope = (mdx2 - l_q*(l_q+1)*ms2 -2*(l_q+1)*ms2)/(alpha*alpha) ;
00354             
00355             for (int i=0; i<nr; i++)
00356               ope.set(nr-1, i) = 0 ;
00357             ope.set(nr-1, 0) = 1 ; //for the true homogeneous solution
00358             
00359             for (int i=0; i<nr; i++) {
00360               ope.set(nr-2, i) = 1 ; //for the limit at inifinity
00361             }
00362 
00363             if (l_q > 0) {
00364                 for (int i=0; i<nr; i++) {
00365                 ope.set(nr-3, i) = i*i ; //for the finite part (derivative = 0 at infty)
00366                 }
00367             }
00368             //  cout << "l: " << l_q << endl ;
00369 
00370             Tbl rhs(nr) ;
00371             rhs.annule_hard() ;
00372             for (int i=0; i<nr; i++)
00373                 rhs.set(i) = (*source.get_spectral_va().c_cf)(lz, k, j, i) ;
00374             if (l_q>0) rhs.set(nr-3) = 0 ;
00375             rhs.set(nr-2) = 0 ;
00376             rhs.set(nr-1) = 0 ;
00377             ope.set_lu() ;
00378             Tbl sol = ope.inverse(rhs) ;
00379                
00380             for (int i=0; i<nr; i++)
00381                 sol_part.set(lz, k, j, i) = sol(i) ;
00382 
00383             rhs.annule_hard() ;
00384             rhs.set(nr-1) = 1 ;
00385             sol = ope.inverse(rhs) ;
00386             for (int i=0; i<nr; i++)
00387                 sol_hom2.set(lz, k, j, i) = sol(i) ;
00388 
00389             }
00390         }
00391     }
00392 
00393     Mtbl_cf dpart = sol_part ; dpart.dsdx() ;
00394     Mtbl_cf dhom1 = sol_hom1 ; dhom1.dsdx() ;
00395     Mtbl_cf dhom2 = sol_hom2 ; dhom2.dsdx() ;
00396 
00397 
00398 //  cout << sol_hom1 << endl;
00399 //  int thj; cin >> thj;
00400 //  cout << sol_hom2 << endl;
00401 //  int thj2; cin >> thj2;
00402 //  cout << sol_part << endl;
00403 //  int thj3; cin >> thj3;
00404  
00405 
00406 
00407 
00408     // Now matching the homogeneous solutions between the different domains...
00409     
00410     for (int k=0; k < np; k++)
00411         for (int j=0; j<nt; j++) {
00412         base.give_quant_numbers(0, k, j, m_q, l_q, base_r) ;
00413         if (nullite_plm(j, nt, k, np, base) == 1) {
00414             Matrice systeme(2*nz-4, 2*nz-4) ;
00415             systeme.annule_hard() ;
00416             Tbl rhs(2*nz-4) ;
00417             rhs.annule_hard() ;
00418 
00419             //First shell 
00420             int lin = 0 ;
00421             int col = 0 ;
00422             
00423             double alpha = (*map).get_alpha()[1] ;
00424             
00425             systeme.set(lin, col) += sol_hom1.val_out_bound_jk(1, j, k) ;
00426             rhs.set(lin) -= sol_part.val_out_bound_jk(1, j, k) ;
00427             
00428             lin++ ;
00429             systeme.set(lin, col) += dhom1.val_out_bound_jk(1, j, k) / alpha ;
00430             rhs.set(lin) -=  dpart.val_out_bound_jk(1, j, k) / alpha ;
00431             col += 1 ;
00432             
00433             //Shells
00434             for (int lz=2; lz<nz-1; lz++) {
00435               alpha = (*map).get_alpha()[lz] ;
00436               lin-- ;
00437               systeme.set(lin,col) -= sol_hom1.val_in_bound_jk(lz, j, k) ;
00438               systeme.set(lin,col+1) -= sol_hom2.val_in_bound_jk(lz, j, k) ;
00439               rhs.set(lin) += sol_part.val_in_bound_jk(lz, j, k) ;
00440               
00441               lin++ ;
00442               systeme.set(lin,col) -= dhom1.val_in_bound_jk(lz, j, k) / alpha ;
00443               systeme.set(lin,col+1) -= dhom2.val_in_bound_jk(lz, j, k) / alpha ;
00444               rhs.set(lin) += dpart.val_in_bound_jk(lz, j, k) / alpha;
00445               
00446               lin++ ;
00447               systeme.set(lin, col) += sol_hom1.val_out_bound_jk(lz, j, k) ;
00448               systeme.set(lin, col+1) += sol_hom2.val_out_bound_jk(lz, j, k) ;
00449               rhs.set(lin) -= sol_part.val_out_bound_jk(lz, j, k) ;
00450               
00451               lin++ ;
00452               systeme.set(lin, col) += dhom1.val_out_bound_jk(lz, j, k) / alpha ;
00453               systeme.set(lin, col+1) += dhom2.val_out_bound_jk(lz, j, k) / alpha ;
00454               rhs.set(lin) -= dpart.val_out_bound_jk(lz, j, k) / alpha ;
00455               col += 2 ;
00456             }
00457             
00458             //CED
00459             alpha = (*map).get_alpha()[nz-1] ;
00460             lin-- ;
00461             systeme.set(lin,col) -= sol_hom2.val_in_bound_jk(nz-1, j, k) ;
00462             rhs.set(lin) += sol_part.val_in_bound_jk(nz-1, j, k) ;
00463 
00464             lin++ ;
00465             systeme.set(lin,col) -= (-4*alpha)*dhom2.val_in_bound_jk(nz-1, j, k) ;
00466             rhs.set(lin) += (-4*alpha)*dpart.val_in_bound_jk(nz-1, j, k) ;
00467 
00468             systeme.set_lu() ;
00469 
00470             // cout << systeme << endl;
00471 
00472             Tbl coef = systeme.inverse(rhs);
00473             int indice = 0 ;
00474                         
00475             //      int tryr; cin >> tryr;
00476             //          for (int i=0; i<mgrid.get_nr(0); i++)
00477             //          sol_coef.set(0, k, j, i) = 0 ;
00478             //          sol_coef.set(0, k, j, 0) =  (*bound.get_spectral_va().c_cf)(0, k, j, 0) ;
00479             
00480             for (int i=0; i<(*mgrid).get_nr(1); i++)
00481               sol_coef.set(1, k, j, i) = sol_part(1, k, j, i)
00482             +coef(indice)*sol_hom1(1, k, j, i) ;
00483             indice +=1;
00484             
00485             
00486             for (int lz=2; lz<nz-1; lz++) {
00487               for (int i=0; i<(*mgrid).get_nr(lz); i++)
00488             sol_coef.set(lz, k, j, i) = sol_part(lz, k, j, i)
00489               +coef(indice)*sol_hom1(lz, k, j, i) 
00490               +coef(indice+1)*sol_hom2(lz, k, j, i) ;
00491               indice += 2 ;
00492             }
00493             for (int i=0; i<(*mgrid).get_nr(nz-1); i++)
00494               sol_coef.set(nz-1, k, j, i) = sol_part(nz-1, k, j, i)
00495             +coef(indice)*sol_hom2(nz-1, k, j, i) ;
00496 
00497         }
00498         }
00499     
00500 
00501 
00502     //  cout << "sol coef" << endl;
00503 
00504 //  int trg; cin >> trg;
00505 //  cout << sol_coef << endl;
00506  
00507 //  int dn; cin >> dn;
00508  
00509             for (int lz=0; lz<nz; lz++) {
00510           for (int i=0; i<(*mgrid).get_nr(lz); i++) 
00511 
00512             sol_coef.set(lz,0,0,i) = 0.;   // Probleme de définition de l'operateur pour k=j=0; a revoir.
00513  
00514         }
00515 
00516 
00517 
00518 //  cout << "sol coef" << endl;
00519 
00520 //  cin >> trg;
00521 //  cout << sol_coef << endl;
00522  
00523 //  cin >> dn;
00524       
00525 
00526 
00527     delete phi.set_spectral_va().c ;
00528     phi.set_spectral_va().c = 0x0 ;
00530     //  phi.set_spectral_va().ylm();
00531  
00532     phi.annule_domain(nz-1);
00533     
00534     resu = phi;
00535 
00536 }

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