excision_lapse_4.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 #include "unites.h"
00012 #include "excision_surf.h"
00013 //Sym_tensor secmembre_kerr ( const Sym_tensor& hij, const Sym_tensor& aa,const Scalar& nn,const Scalar& ppsi,const Vector& bb) { 
00014 const Scalar& Excision_surf::get_BC_lapse_4 (Scalar& old_nn, Vector& beta_point, Sym_tensor& strain_tens) const{ 
00015 
00016   using namespace Unites;
00017   if (p_get_BC_lapse_4 == 0x0){
00018 
00019     Scalar nn = lapse;
00020     Scalar ppsi = conf_fact;
00021     Vector bb = shift;
00022     Sym_tensor aa = Kij.up_down(gamij)*ppsi*ppsi*ppsi*ppsi;
00023     
00024   const int nz = (*(aa.get_mp().get_mg())).get_nzone(); 
00025 
00026   Sym_tensor hij = gamij.con();
00027    for (int ii=1; ii<=3; ii++)
00028     for(int jj=1; jj<=3; jj++)
00029       { hij.set(ii,jj).annule_hard();
00030       }
00031   hij.annule_domain(nz-1); 
00032   hij.std_spectral_base();    // Set non conformally flat part to zero.
00033 
00034 
00035   const Vector& beta = bb;
00036  
00037   const Scalar& psi4 = ppsi*ppsi*ppsi*ppsi;
00038   Scalar ln_psi = log(ppsi); ln_psi.std_spectral_base();
00039   ln_psi.annule_domain(nz-1);
00040 
00041   const Scalar qq = nn*ppsi*ppsi; 
00042    
00043   
00044   const Metric_flat& ff = (hij.get_mp()).flat_met_spher() ;
00045    
00046   const Sym_tensor& tgam_uu = ff.con(); 
00047     
00048   const Base_vect_spher& otriad = hij.get_mp().get_bvect_spher();
00049 
00050   Scalar nn_point(hij.get_mp());
00051   nn_point.annule_hard();
00052   nn_point.annule_domain(nz -1);
00053  
00054   nn_point.std_spectral_base(); 
00055  
00056 
00057                            
00058   const Sym_tensor& tgam_dd = ff.cov() ;    // {\tilde \gamma}_{ij}
00059   const Vector& dln_psi = ln_psi.derive_cov(ff) ; // D_i ln(Psi)
00060   const Vector& tdln_psi_u = ln_psi.derive_con(ff) ; // tD^i ln(Psi)
00061   const Vector& tdnn_u = nn.derive_con(ff) ;       // tD^i N
00062   const Vector& dqq = qq.derive_cov(ff) ;         // D_i Q
00063   const Scalar& div_beta = beta.divergence(ff) ;  // D_k beta^k
00064   Sym_tensor l_beta = beta.ope_killing_conf(ff) ; // Attention aux headers a inclure
00065 
00066   //==================================
00067   // Source for hij
00068   //==================================
00069 
00070 
00071   Scalar tmp(hij.get_mp()) ;
00072   Sym_tensor sym_tmp(hij.get_mp(), CON, otriad) ; 
00073        
00074   // Full quadratic part of source for h : S^{ij}
00075   // --------------------------------------------
00076         
00077   Sym_tensor ss(hij.get_mp(), CON, otriad) ;  // Source secondaire 
00078         
00079   sym_tmp = nn * (8.* tdln_psi_u * tdln_psi_u)
00080     + 4.*( tdln_psi_u * tdnn_u + tdnn_u * tdln_psi_u ) 
00081     - 0.3333333333333333 * 
00082     ( nn * ( 8.* contract(dln_psi, 0, tdln_psi_u, 0) )
00083       + 8.* contract(dln_psi, 0, tdnn_u, 0) ) *tgam_uu ;
00084 
00085   ss = sym_tmp / psi4  ;
00086         
00087   sym_tmp = contract(tgam_uu, 1, 
00088              contract(tgam_uu, 1, dqq.derive_cov(ff), 0), 1) ;
00089                             
00090   sym_tmp.inc_dzpuis() ; // dzpuis : 3 --> 4
00091 
00092   tmp = qq.derive_con(ff).divergence(ff) ; 
00093   tmp.inc_dzpuis() ; // dzpuis : 3 --> 4  
00094 
00095   sym_tmp -= 0.3333333333333333 * tmp *tgam_uu ; 
00096                     
00097   ss -= sym_tmp / (psi4*ppsi*ppsi) ;  // Voir dans quel sens sont construits psi et psi4 (eviter les multiplications d'erreurs)
00098 
00099   for (int i=1; i<=3; i++) {
00100     for (int j=1; j<=i; j++) {
00101       tmp = 0 ; 
00102       for (int k=1; k<=3; k++) {
00103     for (int l=1; l<=3; l++) {
00104       tmp += tgam_dd(k,l) * aa(i,k) * aa(j,l) ; 
00105     }
00106       }
00107       sym_tmp.set(i,j) = tmp ; 
00108     }
00109   }
00110         
00111   tmp = psi4 * strain_tens.trace(ff) ; // S = S_i^i 
00112 
00113   ss += (2.*nn) * ( sym_tmp );
00114   Sym_tensor ss2 =2.*nn*( qpig*(psi4*strain_tens - 0.33333333333333 * tmp * tgam_uu));
00115 
00116   ss2.annule_domain(nz-1); //Dont care, i want only data on the horizon...
00117 
00118   ss += -ss2;
00119   
00120   // Source for h^{ij} 
00121   // -----------------
00122                 
00123 
00124  Sym_tensor source_hh = 2.* nn * ss ;
00125   source_hh += 2. *  nn.derive_lie(beta) * aa  ;  //HERE
00126 
00127   // Term (d/dt - Lie_beta) (L beta)^{ij}--> sym_tmp        
00128   // ---------------------------------------
00129 
00130   sym_tmp = beta_point.ope_killing_conf(ff);
00131   sym_tmp.annule_domain(nz-1);
00132   sym_tmp = sym_tmp - l_beta.derive_lie(beta) ;
00133   
00134   sym_tmp.annule_domain(nz-1); 
00135   
00136 
00137   // Final source:
00138   // ------------
00139   source_hh += 0.6666666666666666* div_beta * l_beta - sym_tmp ; 
00140 
00141 Scalar dNdt(hij.get_mp());
00142 
00143  dNdt = -source_hh(1,1)/2.*aa(1,1); // Take any component as long as the aa part does not vanish...
00144 
00145  dNdt.annule_domain(nz-1);
00146 
00147 Scalar bound_N = old_nn + dNdt*delta_t; bound_N.std_spectral_base();
00148  bound_N.set_spectral_va().ylm();
00149  
00150  p_get_BC_lapse_4 = new Scalar(bound_N); 
00151     
00152 }
00153 return *p_get_BC_lapse_4 ;
00154 }
00155 
00156 

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