et_bin_upmetr_der.C

00001 /*
00002  * Methods Etoile_bin::update_metric_der_comp
00003  *
00004  * (see file etoile.h for documentation)
00005  *
00006  */
00007 
00008 /*
00009  *   Copyright (c) 2000-2001 Eric Gourgoulhon
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 as published by
00015  *   the Free Software Foundation; either version 2 of the License, or
00016  *   (at your option) any later version.
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 
00030 char et_bin_upmetr_der_C[] = "$Header: /cvsroot/Lorene/C++/Source/Etoile/et_bin_upmetr_der.C,v 1.6 2003/10/24 12:27:16 k_taniguchi Exp $" ;
00031 
00032 /*
00033  * $Id: et_bin_upmetr_der.C,v 1.6 2003/10/24 12:27:16 k_taniguchi Exp $
00034  * $Log: et_bin_upmetr_der.C,v $
00035  * Revision 1.6  2003/10/24 12:27:16  k_taniguchi
00036  * Suppress the method of update metric for NS-BH
00037  *
00038  * Revision 1.5  2003/10/24 11:47:02  k_taniguchi
00039  * Change some notations
00040  *
00041  * Revision 1.4  2002/12/19 14:53:38  e_gourgoulhon
00042  * Added the new function
00043  *  void update_metric_der_comp(const Bhole& comp)
00044  * to treat the case where the companion is a black hole
00045  *
00046  * Revision 1.3  2002/12/10 15:12:07  k_taniguchi
00047  * Change the multiplication "*" to "%".
00048  *
00049  * Revision 1.2  2001/12/14 15:15:30  k_taniguchi
00050  * Change of the method to calculate derivatives with respect to the companion star
00051  *
00052  * Revision 1.1.1.1  2001/11/20 15:19:28  e_gourgoulhon
00053  * LORENE
00054  *
00055  * Revision 2.4  2000/03/13  14:03:38  eric
00056  * Modif commentaires.
00057  *
00058  * Revision 2.3  2000/03/07  14:54:54  eric
00059  * Ajout du calcul de akcar_comp.
00060  *
00061  * Revision 2.2  2000/03/07  08:34:04  eric
00062  * Appel de Cmp::import_sym / asym (pour tenir compte de la symetrie /
00063  *  plan y=0).
00064  *
00065  * Revision 2.1  2000/02/10  18:56:38  eric
00066  * Traitement du cas ETATZERO.
00067  *
00068  * Revision 2.0  2000/02/04  16:38:11  eric
00069  * *** empty log message ***
00070  *
00071  *
00072  * $Header: /cvsroot/Lorene/C++/Source/Etoile/et_bin_upmetr_der.C,v 1.6 2003/10/24 12:27:16 k_taniguchi Exp $
00073  *
00074  */
00075 
00076 // Headers Lorene
00077 #include "etoile.h"
00078 #include "bhole.h"
00079 
00080 void Etoile_bin::update_metric_der_comp(const Etoile_bin& comp) {
00081 
00082     // Computation of d_logn_comp
00083     // --------------------------
00084 
00085     if ( (comp.d_logn_auto).get_etat() == ETATZERO ) {
00086     d_logn_comp.set_etat_zero() ;
00087     }
00088     else{
00089       d_logn_comp = logn_comp.gradient() ;
00090     }
00091 
00092     d_logn_comp.change_triad(ref_triad) ;
00093 
00094     // Computation of d_beta_comp
00095     // --------------------------
00096 
00097     if ( (comp.d_beta_auto).get_etat() == ETATZERO ) {
00098     d_beta_comp.set_etat_zero() ;
00099     }
00100     else {
00101       d_beta_comp = beta_comp.gradient() ;
00102     }
00103 
00104     d_beta_comp.change_triad(ref_triad) ;
00105 
00106     // Computation of tkij_comp
00107     // ------------------------
00108 
00109     if ( (comp.tkij_auto).get_etat() == ETATZERO ) {
00110     tkij_comp.set_etat_zero() ;
00111     }
00112     else{
00113 
00114       // Components of shift_comp with respect to the Cartesian triad
00115       //  (d/dx, d/dy, d/dz) of the mapping :
00116       Tenseur shift_comp_local = shift_comp ;
00117       shift_comp_local.change_triad( mp.get_bvect_cart() ) ;
00118 
00119       // Gradient (partial derivatives with respect to
00120       //           the Cartesian coordinates of the mapping)
00121       // D_j N^i
00122 
00123       Tenseur dn_comp = shift_comp_local.gradient() ;
00124 
00125       // Return to the absolute reference frame
00126       dn_comp.change_triad(ref_triad) ;
00127 
00128       // Trace of D_j N^i = divergence of N^i :
00129       Tenseur divn_comp = contract(dn_comp, 0, 1) ;
00130 
00131       // Computation of A^2 K^{ij}
00132       // -------------------------
00133       tkij_comp.set_etat_qcq() ;
00134 
00135       for (int i=0; i<3; i++) {
00136     for (int j=i; j<3; j++) {
00137       tkij_comp.set(i, j) = dn_comp(i, j) + dn_comp(j, i)  ;
00138     }
00139     tkij_comp.set(i, i) -= double(2)/double(3) * divn_comp() ;
00140       }
00141 
00142       tkij_comp = - 0.5 * tkij_comp / nnn ;
00143 
00144     }
00145 
00146     tkij_comp.set_triad( *((comp.tkij_auto).get_triad()) ) ;
00147     tkij_comp.set_std_base() ;
00148 
00149     if (relativistic) {
00150     // Computation of akcar_comp
00151     // -------------------------
00152     
00153     akcar_comp.set_etat_qcq() ;
00154     
00155     akcar_comp.set() = 0 ;
00156 
00157     for (int i=0; i<3; i++) {
00158         for (int j=0; j<3; j++) {
00159 
00160         akcar_comp.set() += tkij_auto(i, j) % tkij_comp(i, j) ;
00161 
00162         }
00163     }
00164 
00165     akcar_comp.set_std_base() ;
00166     akcar_comp = a_car % akcar_comp ;
00167 
00168     }
00169 
00170     // The derived quantities are obsolete
00171     // -----------------------------------
00172 
00173     del_deriv() ;
00174 
00175 
00176     //-----------------------------------------------------
00177     // The previous way to calculate d_logn_comp and so on
00178     //  which we do not use
00179     //-----------------------------------------------------
00180 
00181     //#################################
00182     /*
00183     int nz = mp.get_mg()->get_nzone() ;
00184     int nzm1 = nz - 1 ;
00185 
00186     // Computation of d_logn_comp
00187     // --------------------------
00188 
00189     if ( (comp.d_logn_auto).get_etat() == ETATZERO ) {
00190     d_logn_comp.set_etat_zero() ;
00191     }
00192     else{
00193 
00194     // 1/ Division by r^2 of comp.d_logn_auto in the ZEC
00195     Tenseur vecttmp = comp.d_logn_auto ;
00196     vecttmp.dec2_dzpuis() ;
00197 
00198     // 2/ Interpolation of the result
00199     //## OUTSIDE THE ZEC
00200 
00201     d_logn_comp.set_etat_qcq() ;
00202     (d_logn_comp.set(0)).import_symy(nzm1, vecttmp(0) ) ;  // d/dx sym.
00203     (d_logn_comp.set(1)).import_asymy(nzm1, vecttmp(1) ) ; // d/dy antisym.
00204     (d_logn_comp.set(2)).import_symy(nzm1, vecttmp(2) ) ;  // d/dz sym.
00205 
00206     }
00207     
00208     d_logn_comp.set_triad( *((comp.d_logn_auto).get_triad()) ) ;
00209 
00210 
00211     // Computation of d_beta_comp
00212     // --------------------------
00213 
00214     if ( (comp.d_beta_auto).get_etat() == ETATZERO ) {
00215     d_beta_comp.set_etat_zero() ; 
00216     }
00217     else {
00218     // 1/ Division by r^2 of comp.d_logn_auto in the ZEC
00219     Tenseur vecttmp = comp.d_beta_auto ;
00220     vecttmp.dec2_dzpuis() ;
00221 
00222     // 2/ Interpolation of the result 
00223     //## OUTSIDE THE ZEC
00224 
00225     d_beta_comp.set_etat_qcq() ;
00226 
00227     (d_beta_comp.set(0)).import_symy(nzm1, vecttmp(0) ) ;  // d/dx sym.
00228     (d_beta_comp.set(1)).import_asymy(nzm1, vecttmp(1) ) ; // d/dy antisym.
00229     (d_beta_comp.set(2)).import_symy(nzm1, vecttmp(2) ) ;  // d/dz sym.
00230 
00231     }
00232 
00233     d_beta_comp.set_triad( *((comp.d_beta_auto).get_triad()) ) ;
00234 
00235     // Computation of tkij_comp
00236     // ------------------------
00237     
00238     if ( (comp.tkij_auto).get_etat() == ETATZERO ) {
00239     tkij_comp.set_etat_zero() ;
00240     }
00241     else{
00242 
00243     // 1/ Division by r^2 of comp.d_logn_auto in the ZEC
00244     Tenseur_sym tenstmp = comp.tkij_auto ;
00245     tenstmp.dec2_dzpuis() ;
00246 
00247     // 2/ Interpolation of the result
00248     //## OUTSIDE THE ZEC
00249 
00250     tkij_comp.set_etat_qcq() ;
00251 
00252     (tkij_comp.set(0, 0)).import_asymy(nzm1, tenstmp(0, 0) ) ; // K_xx antisym
00253     (tkij_comp.set(0, 1)).import_symy(nzm1, tenstmp(0, 1) ) ;  // K_xy sym.
00254     (tkij_comp.set(0, 2)).import_asymy(nzm1, tenstmp(0, 2) ) ; // K_xz antisym
00255     (tkij_comp.set(1, 1)).import_asymy(nzm1, tenstmp(1, 1) ) ; // K_yy antisym.
00256     (tkij_comp.set(1, 2)).import_symy(nzm1, tenstmp(1, 2) ) ;  // K_yz sym
00257     (tkij_comp.set(2, 2)).import_asymy(nzm1, tenstmp(2, 2) ) ; // K_zz antisym.
00258 
00259     }
00260 
00261     tkij_comp.set_triad( *((comp.tkij_auto).get_triad()) ) ;
00262 
00263     if (relativistic) {
00264     // Computation of akcar_comp
00265     // -------------------------
00266 
00267     akcar_comp.set_etat_qcq() ;
00268 
00269     akcar_comp.set() = 0 ;
00270     
00271     for (int i=0; i<3; i++) {
00272         for (int j=0; j<3; j++) {
00273 
00274         akcar_comp.set() += tkij_auto(i, j) * tkij_comp(i, j) ; 
00275 
00276         }
00277     }
00278 
00279     akcar_comp = a_car * akcar_comp ;
00280     }
00281 
00282 
00283     // The derived quantities are obsolete
00284     // -----------------------------------
00285 
00286     del_deriv() ;
00287     */
00288     //#################################
00289 
00290 }

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