strot_dirac_solvehij.C

00001 /*
00002  *  Solution of the tensor Poisson equation for rotating stars in Dirac gauge.
00003  *
00004  *    (see file star_rot_dirac.h for documentation).
00005  *
00006  */
00007 
00008 /*
00009  *   Copyright (c) 2005 Lap-Ming Lin & Jerome Novak
00010  *
00011  *   This file is part of LORENE.
00012  *
00013  *   LORENE is free software; you can redistribute it and/or modify
00014  *   it under the terms of the GNU General Public License version 2
00015  *   as published by the Free Software Foundation.
00016  *
00017  *   LORENE is distributed in the hope that it will be useful,
00018  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  *   GNU General Public License for more details.
00021  *
00022  *   You should have received a copy of the GNU General Public License
00023  *   along with LORENE; if not, write to the Free Software
00024  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025  *
00026  */
00027 
00028 char strot_dirac_solvehij_C[] = "$Header: /cvsroot/Lorene/C++/Source/Star/strot_dirac_solvehij.C,v 1.9 2010/10/11 10:21:31 j_novak Exp $" ;
00029 
00030 /*
00031  * $Id: strot_dirac_solvehij.C,v 1.9 2010/10/11 10:21:31 j_novak Exp $
00032  * $Log: strot_dirac_solvehij.C,v $
00033  * Revision 1.9  2010/10/11 10:21:31  j_novak
00034  * Less output
00035  *
00036  * Revision 1.8  2005/11/28 14:45:16  j_novak
00037  * Improved solution of the Poisson tensor equation in the case of a transverse
00038  * tensor.
00039  *
00040  * Revision 1.7  2005/09/16 14:04:49  j_novak
00041  * The equation for hij is now solved only for mer >  mer_fix_omega. It uses the
00042  * Poisson solver of the class Sym_tensor_trans.
00043  *
00044  * Revision 1.6  2005/04/20 14:26:29  j_novak
00045  * Removed some outputs.
00046  *
00047  * Revision 1.5  2005/04/05 09:24:05  j_novak
00048  * minor modifs
00049  *
00050  * Revision 1.4  2005/02/17 17:32:16  f_limousin
00051  * Change the name of some quantities to be consistent with other classes
00052  * (for instance nnn is changed to nn, shift to beta, beta to lnq...)
00053  *
00054  * Revision 1.3  2005/02/16 12:51:49  j_novak
00055  * Corrected an error on the matter source terms.
00056  *
00057  * Revision 1.2  2005/02/09 13:34:56  lm_lin
00058  *
00059  * Remove the Laplacian of hij from the term source_hh and fix an overall
00060  * minus error.
00061  *
00062  * Revision 1.1  2005/01/31 08:51:48  j_novak
00063  * New files for rotating stars in Dirac gauge (still under developement).
00064  *
00065  *
00066  * $Header: /cvsroot/Lorene/C++/Source/Star/strot_dirac_solvehij.C,v 1.9 2010/10/11 10:21:31 j_novak Exp $
00067  *
00068  */
00069 
00070 // Lorene headers
00071 #include "star_rot_dirac.h"
00072 #include "unites.h"
00073 
00074 void Star_rot_Dirac::solve_hij(Sym_tensor_trans& hij_new) const {
00075 
00076     using namespace Unites ;
00077 
00078     const Metric_flat& mets = mp.flat_met_spher() ;
00079     const Base_vect_spher& bspher = mp.get_bvect_spher() ;
00080     
00081   //==================================
00082   // Source for hij
00083   //==================================
00084     
00085     const Vector& dln_psi = ln_psi.derive_cov(mets) ; // D_i ln(Psi)
00086     const Vector& dqq = qqq.derive_cov(mets) ;           // D_i Q
00087     const Tensor_sym& dhh = hh.derive_cov(mets) ;       // D_k h^{ij}
00088     const Tensor_sym& dtgam = tgamma.cov().derive_cov(mets) ;    
00089     const Sym_tensor& tgam_dd = tgamma.cov() ;    // {\tilde \gamma}_{ij}
00090     const Sym_tensor& tgam_uu = tgamma.con() ;    // {\tilde \gamma}^{ij}
00091     const Vector& tdln_psi_u = ln_psi.derive_con(tgamma) ; // tD^i ln(Psi)
00092     const Vector& tdnn_u = nn.derive_con(tgamma) ;       // tD^i N
00093 //    const Scalar& div_beta = beta.divergence(mets) ;  // D_k beta^k
00094     Scalar div_beta(mp) ; //##
00095     div_beta.set_etat_zero() ;
00096 
00097     Scalar tmp(mp) ;
00098     Sym_tensor sym_tmp(mp, CON, bspher) ; 
00099 
00100   // Quadratic part of the Ricci tensor of gam_tilde 
00101   // ------------------------------------------------
00102         
00103   Sym_tensor ricci_star(mp, CON, bspher) ; 
00104         
00105   ricci_star = contract(hh, 0, 1, dhh.derive_cov(mets), 2, 3) ; 
00106 
00107   ricci_star.inc_dzpuis() ;   // dzpuis : 3 --> 4
00108 
00109   for (int i=1; i<=3; i++) {
00110     for (int j=1; j<=i; j++) {
00111       tmp = 0 ; 
00112       for (int k=1; k<=3; k++) {
00113     for (int l=1; l<=3; l++) {
00114       tmp += dhh(i,k,l) * dhh(j,l,k) ; 
00115     }
00116       }
00117       sym_tmp.set(i,j) = tmp ; 
00118     }
00119   }
00120   ricci_star -= sym_tmp ;
00121 
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(mp, CON, bspher) ; 
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(mets), 0), 1) ;
00170                             
00171   sym_tmp.inc_dzpuis() ; // dzpuis : 3 --> 4
00172         
00173   for (int i=1; i<=3; i++) {
00174     for (int j=1; j<=i; j++) {
00175       tmp = 0 ; 
00176       for (int k=1; k<=3; k++) {
00177     for (int l=1; l<=3; l++) {
00178       tmp += ( hh(i,k)*dhh(l,j,k) + hh(k,j)*dhh(i,l,k)
00179            - hh(k,l)*dhh(i,j,k) ) * dqq(l) ; 
00180     }
00181       }
00182       sym_tmp.set(i,j) += 0.5 * tmp ; 
00183     }
00184   }
00185         
00186   tmp = qqq.derive_con(tgamma).divergence(tgamma) ; 
00187   tmp.inc_dzpuis() ; // dzpuis : 3 --> 4
00188         
00189   sym_tmp -= 0.3333333333333333 * tmp *tgam_uu ; 
00190                     
00191   ss -= sym_tmp / (psi4*psi2) ; 
00192 
00193   for (int i=1; i<=3; i++) {
00194     for (int j=1; j<=i; j++) {
00195       tmp = 0 ; 
00196       for (int k=1; k<=3; k++) {
00197     for (int l=1; l<=3; l++) {
00198       tmp += tgam_dd(k,l) * aa(i,k) * aa(j,l) ; 
00199     }
00200       }
00201       sym_tmp.set(i,j) = tmp ; 
00202     }
00203   }
00204         
00205   ss += (2.*nn) * ( sym_tmp - qpig*( psi4* stress_euler
00206                                        - 0.3333333333333333 * s_euler * tgam_uu ) 
00207                     )   ; 
00208 
00209 //  maxabs(ss, "ss tot") ; 
00210   
00211   // Source for h^{ij} 
00212   // -----------------
00213                  
00214   Sym_tensor lbh = hh.derive_lie(beta) ; 
00215 
00216   Sym_tensor source_hh = - lbh.derive_lie(beta) ;
00217   source_hh.inc_dzpuis() ; 
00218         
00219   source_hh += 2.* nn * ss ;
00220               
00221   source_hh += - 1.3333333333333333 * div_beta* lbh
00222     - 2. * nn.derive_lie(beta) * aa  ;
00223               
00224 
00225   for (int i=1; i<=3; i++) {
00226     for (int j=1; j<=i; j++) {
00227       tmp = 0 ; 
00228       for (int k=1; k<=3; k++) {
00229     tmp += ( hh.derive_con(mets)(k,j,i) 
00230          + hh.derive_con(mets)(i,k,j) 
00231          - hh.derive_con(mets)(i,j,k) ) * dqq(k) ;
00232       }
00233       sym_tmp.set(i,j) = tmp ; 
00234     }
00235   }
00236             
00237   source_hh -= nn / (psi4*psi2) * sym_tmp ; 
00238          
00239   tmp = - div_beta.derive_lie(beta) ; 
00240   tmp.inc_dzpuis() ; 
00241   source_hh += 0.6666666666666666* 
00242     ( tmp - 0.6666666666666666* div_beta * div_beta ) * hh ; 
00243                
00244         
00245   // Term (d/dt - Lie_beta) (L beta)^{ij}--> sym_tmp        
00246   // ---------------------------------------
00247   Sym_tensor l_beta = beta.ope_killing_conf(mets) ; 
00248 
00249   sym_tmp = - l_beta.derive_lie(beta) ;
00250 
00251   sym_tmp.inc_dzpuis() ; 
00252   
00253   // Final source:
00254   // ------------
00255   source_hh += 0.6666666666666666* div_beta * l_beta - sym_tmp ; 
00256 
00257   source_hh = - ( psi4/nn/nn )*source_hh ;
00258 
00259   for (int i=1; i<=3; i++)
00260       for (int j=i; j<=3; j++) {
00261       source_hh.set(i,j).set_dzpuis(4) ;
00262       }
00263 
00264   Sym_tensor_trans source_hht(mp, bspher, mets) ;
00265   source_hht = source_hh ;
00266 //   cout << " Max( divergence of source_hh ) " << endl ;
00267 //   for (int i=1; i<=3; i++) 
00268 //       cout << max(abs(source_htt.divergence(mets)(i))) ;
00269 
00270   Scalar h_prev = hh.trace(mets) ;
00271   hij_new = source_hht.poisson(&h_prev) ;
00272 
00273   if (mp.get_mg()->get_np(0) == 1) { //Axial symmetry
00274       hij_new.set(1,3).set_etat_zero() ;
00275       hij_new.set(2,3).set_etat_zero() ;
00276   }
00277       
00278 }

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