strot_dirac_solvenq.C

00001 /*
00002  *  Solution of the two scalar Poisson equations for rotating stars 
00003  *  in Dirac gauge.
00004  *
00005  *    (see file star_rot_Dirac.h for documentation).
00006  *
00007  */
00008 
00009 /*
00010  *   Copyright (c) 2005 Lap-Ming Lin & Jerome Novak
00011  *
00012  *   This file is part of LORENE.
00013  *
00014  *   LORENE is free software; you can redistribute it and/or modify
00015  *   it under the terms of the GNU General Public License version 2
00016  *   as published by the Free Software Foundation.
00017  *
00018  *   LORENE is distributed in the hope that it will be useful,
00019  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  *   GNU General Public License for more details.
00022  *
00023  *   You should have received a copy of the GNU General Public License
00024  *   along with LORENE; if not, write to the Free Software
00025  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00026  *
00027  */
00028 
00029 char strot_dirac_solvenq_C[] = "$Header: /cvsroot/Lorene/C++/Source/Star/strot_dirac_solvenq.C,v 1.3 2005/02/17 17:31:29 f_limousin Exp $" ;
00030 
00031 /*
00032  * $Id: strot_dirac_solvenq.C,v 1.3 2005/02/17 17:31:29 f_limousin Exp $
00033  * $Log: strot_dirac_solvenq.C,v $
00034  * Revision 1.3  2005/02/17 17:31:29  f_limousin
00035  * Change the name of some quantities to be consistent with other classes
00036  * (for instance nnn is changed to nn, shift to beta, beta to lnq...)
00037  *
00038  * Revision 1.2  2005/02/02 09:23:20  lm_lin
00039  *
00040  * Correct a mistake in the calculation of log(N).
00041  *
00042  *
00043  * $Header: /cvsroot/Lorene/C++/Source/Star/strot_dirac_solvenq.C,v 1.3 2005/02/17 17:31:29 f_limousin Exp $
00044  *
00045  */
00046 
00047 // C headers
00048 #include<math.h>
00049 #include <assert.h>
00050 
00051 // Lorene headers
00052 #include "star_rot_dirac.h"
00053 #include "unites.h"
00054 
00055 void Star_rot_Dirac::solve_logn_f(Scalar& ln_f_new) const {
00056 
00057     using namespace Unites ;
00058     
00059   //================================================
00060   // Source for log(n) containing matter field terms
00061   //================================================
00062     
00063     Scalar source_logn = qpig* psi4* (ener_euler + s_euler) ;
00064     
00065     ln_f_new = source_logn.poisson() ;
00066 
00067 }
00068 
00069 void Star_rot_Dirac::solve_logn_q(Scalar& ln_q_new) const {
00070 
00071     const Metric_flat& mets = mp.flat_met_spher() ;
00072     const Base_vect_spher& bspher = mp.get_bvect_spher() ;
00073     
00074     const Vector& dln_psi = ln_psi.derive_cov(mets) ; // D_i ln(Psi)
00075     const Vector& dln = logn.derive_cov(mets) ;         // D_i ln(N)
00076 
00077 
00078 
00079   //=============================================
00080   // Source for log(n) containing quadratic terms
00081   //=============================================
00082 
00083     Scalar source_logn = psi4* aa_quad 
00084       - contract(dln.up_down(mets), 0, dln, 0)
00085       - 2.* contract(dln_psi, 0, logn.derive_con(tgamma), 0) ;
00086 
00087          
00088     Tensor_sym tmp(mp, 2, COV, bspher, 0, 1) ;
00089     tmp = dln.derive_cov(mets) ;
00090     tmp.inc_dzpuis() ; //dzpuis 3 -> 4
00091 
00092     source_logn -= contract( hh, 0, 1, tmp+dln*dln, 0, 1 ) ;
00093         
00094     ln_q_new = source_logn.poisson() ;
00095     
00096 }
00097 
00098 void Star_rot_Dirac::solve_qqq(Scalar& q_new) const {
00099 
00100     using namespace Unites ;
00101 
00102     const Metric_flat& mets = mp.flat_met_spher() ;
00103 
00104     // Source for Q
00105     // ------------
00106         
00107     const Vector& dln_psi = ln_psi.derive_cov(mets) ; // D_i ln(Psi)
00108     const Vector& dqq = qqq.derive_cov(mets) ;           // D_i Q
00109     const Tensor_sym& dhh = hh.derive_cov(mets) ;       // D_k h^{ij}
00110     const Tensor_sym& dtgam = tgamma.cov().derive_cov(mets) ;    
00111                                                     // D_k {\tilde \gamma}_{ij}
00112     Scalar source_qq = psi4 * qqq * ( qpig* s_euler + 0.75* aa_quad ) ;
00113         
00114     Scalar tmp = contract( hh, 0, 1, dqq.derive_cov(mets), 0, 1 ) ; 
00115     tmp.inc_dzpuis() ; 
00116         
00117     source_qq -= tmp ;  
00118                         
00119 
00120     // tmp = \tilde{R}_{*}/4 + 2 D_i ln(Psi) \tilde{D}^i ln(Psi)
00121     tmp = 0.0625 * contract( dhh, 0, 1, dtgam, 0, 1 ).trace(tgamma) 
00122           - 0.125 * contract( dhh, 0, 1, dtgam, 0, 2 ).trace(tgamma) 
00123           + 2.* contract( dln_psi, 0, ln_psi.derive_con(tgamma), 0) ; 
00124      
00125     source_qq += psi2 * ( nn * tmp 
00126                 + 2*contract(dln_psi, 0, nn.derive_con(tgamma), 0) ) ; 
00127                              
00128                
00129     q_new = source_qq.poisson() + 1. ; 
00130 
00131     if (q_new.get_etat() == ETATUN) q_new.std_spectral_base() ; 
00132 
00133 }

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