secmembre_kerr.C

00001 
00002 // Header Lorene:
00003 #include "nbr_spx.h"
00004 #include "utilitaires.h"
00005 #include "graphique.h"
00006 #include "math.h"
00007 #include "metric.h"
00008 #include "param.h"
00009 #include "param_elliptic.h"
00010 #include "tensor.h"
00011 
00012 
00013 Sym_tensor secmembre_kerr ( const Sym_tensor& hij, const Sym_tensor& aa,const Scalar& nn,const Scalar& ppsi,const Vector& bb) { 
00014 
00015   const int nz = (*(hij.get_mp().get_mg())).get_nzone(); 
00016  
00017 
00018   const Vector& beta = bb;
00019   const Sym_tensor& hh  = hij;
00020 
00021  
00022   const Scalar& psi4 = ppsi*ppsi*ppsi*ppsi;
00023   Scalar ln_psi = log(ppsi); ln_psi.std_spectral_base();
00024  
00025   const Scalar qq = nn*ppsi*ppsi; 
00026    
00027   
00028   const Metric_flat& ff = (hij.get_mp()).flat_met_spher() ;
00029    
00030   const Sym_tensor& tgam_uu = ff.con() + hh;
00031    
00032   const Metric tgam(tgam_uu);
00033     
00034   const Base_vect_spher& otriad = hij.get_mp().get_bvect_spher();
00035 
00036   // On met a zero les quantités supposees etre de "matiere"
00037 
00038   Scalar qpig(hij.get_mp()); qpig.annule_hard(); qpig.std_spectral_base();
00039   Sym_tensor strain_tens = hij; 
00040   for (int ii=1; ii<=3; ii++)
00041     for(int jj=1; jj<=3; jj++)
00042       { strain_tens.set(ii,jj).annule_hard();
00043       }
00044   strain_tens.std_spectral_base();
00045    
00046   //     On met a zero les quantités derivee temporelle
00047 
00048   Vector beta_point = bb;
00049  
00050   for (int ii=1; ii<=3; ii++)
00051    
00052     { beta_point.set(ii).annule_hard();
00053     }
00054   beta_point.annule_domain(nz-1) ; // Pour faire passer un assert, je ne comprends pas pourquoi...  
00055 
00056   
00057   
00058   beta_point.std_spectral_base();
00059   Scalar nn_point(hij.get_mp());
00060   nn_point.annule_hard();
00061   nn_point.annule_domain(nz -1);
00062  
00063   nn_point.std_spectral_base(); 
00064    
00065   Sym_tensor hh_point = hij; 
00066   for (int ii=1; ii<=3; ii++)
00067     for(int jj=1; jj<=3; jj++)
00068       { hh_point.set(ii,jj).annule_hard();
00069       }
00070   hh_point.annule_domain(nz-1); 
00071   hh_point.std_spectral_base();  
00072 
00073 
00074   // Note: Il sera probablement nécessaire de ne pas mettre a zero hh point;
00075    
00076 
00077   //Sym_tensor Rrij(map, CON, map.get_bvect_spher());
00078 
00079 
00080   // Rrij = 0.5*[ contract (( h_iju, 0,  h_iju.derive_cov(mets).derive_cov(mets), 3), 0,3) - contract((contract(h_iju.derive_cov(mets),1, h_iju.derive_cov(mets),2)), 1,3)] ;
00081                    
00082   //==================================
00083   // Source for hij
00084   //==================================
00085         
00086   const Sym_tensor& tgam_dd = tgam.cov() ;    // {\tilde \gamma}_{ij}
00087   //  const Sym_tensor& tgam_uu = tgam().con() ;    // {\tilde \gamma}^{ij}
00088   const Tensor_sym& dtgam = tgam_dd.derive_cov(ff) ;// D_k {\tilde \gamma}_{ij} // ff etant la métrique plate
00089   const Tensor_sym& dhh = hh.derive_cov(ff) ; // D_k h^{ij}
00090   const Vector& dln_psi = ln_psi.derive_cov(ff) ; // D_i ln(Psi)
00091   const Vector& tdln_psi_u = ln_psi.derive_con(tgam) ; // tD^i ln(Psi)
00092   const Vector& tdnn_u = nn.derive_con(tgam) ;       // tD^i N
00093   const Vector& dqq = qq.derive_cov(ff) ;         // D_i Q
00094   const Scalar& div_beta = beta.divergence(ff) ;  // D_k beta^k
00095 
00096   Scalar tmp(hij.get_mp()) ;
00097   Sym_tensor sym_tmp(hij.get_mp(), CON, otriad) ; 
00098 
00099   // Quadratic part of the Ricci tensor of gam_tilde 
00100   // ------------------------------------------------
00101         
00102   Sym_tensor ricci_star(hij.get_mp(), CON, otriad) ; 
00103         
00104   ricci_star = contract(hh, 0, 1, dhh.derive_cov(ff), 2, 3) ; 
00105 
00106   ricci_star.inc_dzpuis() ;   // dzpuis : 3 --> 4
00107 
00108   // des_profile (ricci_star(1,1), 1, 8, 1,1, "riccistar");  // A enlever
00109 
00110   for (int i=1; i<=3; i++) {
00111     for (int j=1; j<=i; j++) {
00112       tmp = 0 ; 
00113       for (int k=1; k<=3; k++) {
00114     for (int l=1; l<=3; l++) {
00115       tmp += dhh(i,k,l) * dhh(j,l,k) ; 
00116     }
00117       }
00118       sym_tmp.set(i,j) = tmp ; 
00119     }
00120   }
00121   ricci_star -= sym_tmp ;
00122   for (int i=1; i<=3; i++) {
00123     for (int j=1; j<=i; j++) {
00124       tmp = 0 ; 
00125       for (int k=1; k<=3; k++) {
00126     for (int l=1; l<=3; l++) {
00127       for (int m=1; m<=3; m++) {
00128         for (int n=1; n<=3; n++) {
00129           
00130           tmp += 0.5 * tgam_uu(i,k)* tgam_uu(j,l) 
00131         * dhh(m,n,k) * dtgam(m,n,l)
00132         + tgam_dd(n,l) * dhh(m,n,k) 
00133         * (tgam_uu(i,k) * dhh(j,l,m) + tgam_uu(j,k) *  dhh(i,l,m) )
00134         - tgam_dd(k,l) *tgam_uu(m,n) * dhh(i,k,m) * dhh(j,l,n) ;
00135         }
00136       } 
00137     }
00138       }
00139       sym_tmp.set(i,j) = tmp ; 
00140     }
00141   }
00142   ricci_star += sym_tmp ;
00143 
00144   ricci_star = 0.5 * ricci_star ; 
00145         
00146   // Curvature scalar of conformal metric :
00147   // -------------------------------------
00148         
00149   Scalar tricci_scal = 
00150     0.25 * contract(tgam_uu, 0, 1,
00151             contract(dhh, 0, 1, dtgam, 0, 1), 0, 1 ) 
00152     - 0.5  * contract(tgam_uu, 0, 1,
00153               contract(dhh, 0, 1, dtgam, 0, 2), 0, 1 ) ;  
00154                                                        
00155   // Full quadratic part of source for h : S^{ij}
00156   // --------------------------------------------
00157         
00158   Sym_tensor ss(hij.get_mp(), CON, otriad) ;  // Source secondaire 
00159         
00160   sym_tmp = nn * (ricci_star + 8.* tdln_psi_u * tdln_psi_u)
00161     + 4.*( tdln_psi_u * tdnn_u + tdnn_u * tdln_psi_u ) 
00162     - 0.3333333333333333 * 
00163     ( nn * (tricci_scal  + 8.* contract(dln_psi, 0, tdln_psi_u, 0) )
00164       + 8.* contract(dln_psi, 0, tdnn_u, 0) ) *tgam_uu ;
00165 
00166   ss = sym_tmp / psi4  ;
00167         
00168   sym_tmp = contract(tgam_uu, 1, 
00169              contract(tgam_uu, 1, dqq.derive_cov(ff), 0), 1) ;
00170                             
00171   sym_tmp.inc_dzpuis() ; // dzpuis : 3 --> 4
00172   //  des_profile (sym_tmp(1,1), 1, 8, 1,1, "sym_tmp");  // A enlever
00173   
00174 
00175   for (int i=1; i<=3; i++) {
00176     for (int j=1; j<=i; j++) {
00177       tmp = 0 ; 
00178       for (int k=1; k<=3; k++) {
00179     for (int l=1; l<=3; l++) {
00180       tmp += ( hh(i,k)*dhh(l,j,k) + hh(k,j)*dhh(i,l,k)
00181            - hh(k,l)*dhh(i,j,k) ) * dqq(l) ; 
00182     }
00183       }
00184       sym_tmp.set(i,j) += 0.5 * tmp ; 
00185     }
00186   }
00187         
00188   tmp = qq.derive_con(tgam).divergence(tgam) ; 
00189   tmp.inc_dzpuis() ; // dzpuis : 3 --> 4  // reverifier pourquoi
00190         
00191   //  des_profile (tmp, 1, 8, 1,1, "tmp");  // A enlever
00192 
00193   sym_tmp -= 0.3333333333333333 * tmp *tgam_uu ; 
00194                     
00195   ss -= sym_tmp / (psi4*ppsi*ppsi) ;  // Voir dans quel sens sont construits psi et psi4 (eviter les multiplications d'erreurs)
00196 
00197   for (int i=1; i<=3; i++) {
00198     for (int j=1; j<=i; j++) {
00199       tmp = 0 ; 
00200       for (int k=1; k<=3; k++) {
00201     for (int l=1; l<=3; l++) {
00202       tmp += tgam_dd(k,l) * aa(i,k) * aa(j,l) ; 
00203     }
00204       }
00205       sym_tmp.set(i,j) = tmp ; 
00206     }
00207   }
00208         
00209   tmp = psi4 * strain_tens.trace(tgam) ; // S = S_i^i  // Ces lignes sont probablement liees a l'ajout de matière: A verifier!!!
00210 
00211   ss += (2.*nn) * ( sym_tmp);// - qpig*( psi4* strain_tens 
00212   //   - 0.3333333333333333 * tmp * tgam_uu ) );
00213   Sym_tensor ss2 =2.*nn*( qpig*(psi4*strain_tens - 0.33333333333333 * tmp * tgam_uu));
00214   ss2.inc_dzpuis(4); // A retirer!
00215  
00216   //  des_profile (ss2(1,1), 1, 8, 1,1, "ss2");  // A enlever
00217 
00218   // cout << zone << endl; 
00219 
00220   //  ss2.annule_domain(nz-1); 
00221 
00222   //  ss += -ss2;  ATTENTION!!!! A RETABLIR!!!!
00223 
00224   // maxabs(ss, "ss tot") ; 
00225   
00226   // Source for h^{ij} 
00227   // -----------------
00228                  
00229   Sym_tensor lbh = hh.derive_lie(beta) ; 
00230 
00231   Sym_tensor source_hh =// (nn*nn/psi4 - 1.) 
00232     // * hh.derive_con(ff).divergence(ff) 
00233     + 2.* hh_point.derive_lie(beta); // - lbh.derive_lie(beta) ; // La double derivée de
00234   // Lie en Beta est retirée (prise en charge dans tensorelliptic.C)
00235 
00236   source_hh.inc_dzpuis() ; 
00237         
00238   //  des_profile (source_hh(1,1), 1, 8, 1,1, "sourcehh");  // A enlever
00239 
00240   source_hh += 2.* nn * ss ;
00241               
00242   //## Provisory: waiting for the Lie derivative to allow
00243   //  derivation with respect to a vector with dzpuis != 0
00244   Vector vtmp = beta_point ; 
00245   // vtmp.dec_dzpuis(2) ;  // A remettre si jamais beta point est non nul;
00246 
00247   sym_tmp = hh.derive_lie(vtmp) ; 
00248   sym_tmp.inc_dzpuis(2) ;             
00249 
00250   //  des_profile (sym_tmp(1,1), 1, 8, 1,1, "sym_tmp");  // A enlever
00251 
00252   source_hh += sym_tmp 
00253     + 1.3333333333333333 * div_beta* (hh_point - lbh)
00254     + 2. * (nn_point - nn.derive_lie(beta)) * aa  ;
00255               
00256 
00257   for (int i=1; i<=3; i++) {
00258     for (int j=1; j<=i; j++) {
00259       tmp = 0. ; 
00260       for (int k=1; k<=3; k++) {
00261     tmp += ( hh.derive_con(ff)(k,j,i) 
00262          + hh.derive_con(ff)(i,k,j) 
00263          - hh.derive_con(ff)(i,j,k) ) * dqq(k) ;
00264       }
00265       sym_tmp.set(i,j) = tmp ; 
00266     }
00267   }
00268             
00269   source_hh -= nn / (psi4*ppsi*ppsi) * sym_tmp ; 
00270          
00271   tmp =  beta_point.divergence(ff) - div_beta.derive_lie(beta) ; 
00272   tmp.inc_dzpuis() ; 
00273 
00274   //  des_profile (tmp, 1, 8, 1,1, "tmp");  // A enlever
00275 
00276   source_hh += 0.6666666666666666* 
00277     ( tmp - 0.6666666666666666* div_beta * div_beta ) * hh ; 
00278                
00279         
00280   // Term (d/dt - Lie_beta) (L beta)^{ij}--> sym_tmp        
00281   // ---------------------------------------
00282   Sym_tensor l_beta = beta.ope_killing_conf(ff) ; // Attention aux headers a inclure
00283 
00284   sym_tmp = beta_point.ope_killing_conf(ff) - l_beta.derive_lie(beta) ;
00285   
00286   sym_tmp.inc_dzpuis() ; 
00287   
00288   // Final source:
00289   // ------------
00290   source_hh += 0.6666666666666666* div_beta * l_beta - sym_tmp ; 
00291 
00292    
00293   // Annulation de la source
00294 //   for (int ii=1; ii<=3; ii++)
00295 //     for (int jj=1; jj<=3; jj++){
00296 //       source_hh.set(ii,jj).annule_hard();
00297 //     }
00298 //   source_hh.std_spectral_base();
00299  
00300 
00301 
00302 
00303   return source_hh; 
00304                            
00305 }          
00306 
00307 
00308 

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