hole_bhns.C

00001 /*
00002  *  Methods of class Hole_bhns
00003  *
00004  *    (see file hole_bhns.h for documentation).
00005  *
00006  */
00007 
00008 /*
00009  *   Copyright (c) 2005-2007 Keisuke Taniguchi
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 hole_bhns_C[] = "$Header: /cvsroot/Lorene/C++/Source/Hole_bhns/hole_bhns.C,v 1.2 2008/05/15 19:03:00 k_taniguchi Exp $" ;
00029 
00030 /*
00031  * $Id: hole_bhns.C,v 1.2 2008/05/15 19:03:00 k_taniguchi Exp $
00032  * $Log: hole_bhns.C,v $
00033  * Revision 1.2  2008/05/15 19:03:00  k_taniguchi
00034  * Change of some parameters.
00035  *
00036  * Revision 1.1  2007/06/22 01:24:16  k_taniguchi
00037  * *** empty log message ***
00038  *
00039  *
00040  * $Header: /cvsroot/Lorene/C++/Source/Hole_bhns/hole_bhns.C,v 1.2 2008/05/15 19:03:00 k_taniguchi Exp $
00041  *
00042  */
00043 
00044 // C++ headers
00045 //#include <>
00046 
00047 // C headers
00048 #include <math.h>
00049 
00050 // Lorene headers
00051 #include "hole_bhns.h"
00052 #include "unites.h"
00053 
00054 
00055                     //----------------------//
00056                     //     Constructors     //
00057                     //----------------------//
00058 
00059 // Standard constructor
00060 // --------------------
00061 Hole_bhns::Hole_bhns(Map& mp_i, bool kerrschild_i, bool bc_nd_i,
00062              bool bc_fs_i, bool irrot_i, double massbh)
00063       : Black_hole(mp_i, kerrschild_i, massbh),
00064     bc_lapconf_nd(bc_nd_i),
00065     bc_lapconf_fs(bc_fs_i),
00066     irrotational(irrot_i),
00067     lapconf_auto_rs(mp_i),
00068     lapconf_auto_bh(mp_i),
00069     lapconf_auto(mp_i),
00070     lapconf_comp(mp_i),
00071     lapconf_tot(mp_i),
00072     lapse_auto(mp_i),
00073     lapse_tot(mp_i),
00074     d_lapconf_auto_rs(mp_i, COV, mp_i.get_bvect_cart()),
00075     d_lapconf_auto_bh(mp_i, COV, mp_i.get_bvect_cart()),
00076     d_lapconf_auto(mp_i, COV, mp_i.get_bvect_cart()),
00077     d_lapconf_comp(mp_i, COV, mp_i.get_bvect_cart()),
00078     shift_auto_rs(mp_i, CON, mp_i.get_bvect_cart()),
00079     shift_auto_bh(mp_i, CON, mp_i.get_bvect_cart()),
00080     shift_auto(mp_i, CON, mp_i.get_bvect_cart()),
00081     shift_comp(mp_i, CON, mp_i.get_bvect_cart()),
00082     shift_tot(mp_i, CON, mp_i.get_bvect_cart()),
00083     d_shift_auto_rs(mp_i, 2, CON, mp_i.get_bvect_cart()),
00084     d_shift_auto_bh(mp_i, 2, CON, mp_i.get_bvect_cart()),
00085     d_shift_auto(mp_i, 2, CON, mp_i.get_bvect_cart()),
00086     d_shift_comp(mp_i, 2, CON, mp_i.get_bvect_cart()),
00087     confo_auto_rs(mp_i),
00088     confo_auto_bh(mp_i),
00089     confo_auto(mp_i),
00090     confo_comp(mp_i),
00091     confo_tot(mp_i),
00092     d_confo_auto_rs(mp_i, COV, mp_i.get_bvect_cart()),
00093     d_confo_auto_bh(mp_i, COV, mp_i.get_bvect_cart()),
00094     d_confo_auto(mp_i, COV, mp_i.get_bvect_cart()),
00095     d_confo_comp(mp_i, COV, mp_i.get_bvect_cart()),
00096     taij_tot_rs(mp_i, CON, mp_i.get_bvect_cart()),
00097     taij_tot_rot(mp_i, CON, mp_i.get_bvect_cart()),
00098     taij_tot_bh(mp_i, CON, mp_i.get_bvect_cart()),
00099     taij_tot(mp_i, CON, mp_i.get_bvect_cart()),
00100     taij_auto_rs(mp_i, CON, mp_i.get_bvect_cart()),
00101     taij_auto(mp_i, CON, mp_i.get_bvect_cart()),
00102     taij_comp(mp_i, CON, mp_i.get_bvect_cart()),
00103     taij_quad_tot_rs(mp_i),
00104     taij_quad_tot_rot(mp_i),
00105     taij_quad_tot_bh(mp_i),
00106     taij_quad_tot(mp_i),
00107     taij_quad_auto(mp_i),
00108     taij_quad_comp(mp_i)
00109 {
00110 
00111     omega_spin = 0. ;
00112 
00113     // The metric quantities are initialized to the flat one or zero
00114     lapconf_auto_rs = 0. ;
00115     lapconf_auto_rs.std_spectral_base() ;
00116     lapconf_auto_bh = 1. ;
00117     lapconf_auto_bh.std_spectral_base() ;
00118     lapconf_auto = 1. ;
00119     lapconf_auto.std_spectral_base() ;
00120     lapconf_comp = 0. ;
00121     lapconf_comp.std_spectral_base() ;
00122     lapconf_tot = 1. ;
00123     lapconf_tot.std_spectral_base() ;
00124 
00125     lapse_auto = 1. ;
00126     lapse_auto.std_spectral_base() ;
00127     lapse_tot = 1. ;
00128     lapse_tot.std_spectral_base() ;
00129 
00130     d_lapconf_auto_rs.set_etat_zero() ;
00131     d_lapconf_auto_bh.set_etat_zero() ;
00132     d_lapconf_auto.set_etat_zero() ;
00133     d_lapconf_comp.set_etat_zero() ;
00134 
00135     shift_auto_rs.set_etat_zero() ;
00136     shift_auto_bh.set_etat_zero() ;
00137     shift_auto.set_etat_zero() ;
00138     shift_comp.set_etat_zero() ;
00139     shift_tot.set_etat_zero() ;
00140 
00141     d_shift_auto_rs.set_etat_zero() ;
00142     d_shift_auto_bh.set_etat_zero() ;
00143     d_shift_auto.set_etat_zero() ;
00144     d_shift_comp.set_etat_zero() ;
00145 
00146     confo_auto_rs = 0. ;
00147     confo_auto_rs.std_spectral_base() ;
00148     confo_auto_bh = 1. ;
00149     confo_auto_bh.std_spectral_base() ;
00150     confo_auto = 1. ;
00151     confo_auto.std_spectral_base() ;
00152     confo_comp = 0. ;
00153     confo_comp.std_spectral_base() ;
00154     confo_tot = 1. ;
00155     confo_tot.std_spectral_base() ;
00156 
00157     d_confo_auto_rs.set_etat_zero() ;
00158     d_confo_auto_bh.set_etat_zero() ;
00159     d_confo_auto.set_etat_zero() ;
00160     d_confo_comp.set_etat_zero() ;
00161 
00162     taij_tot_rs.set_etat_zero() ;
00163     taij_tot_rot.set_etat_zero() ;
00164     taij_tot_bh.set_etat_zero() ;
00165     taij_tot.set_etat_zero() ;
00166     taij_auto_rs.set_etat_zero() ;
00167     taij_auto.set_etat_zero() ;
00168     taij_comp.set_etat_zero() ;
00169 
00170     taij_quad_tot_rs = 0. ;
00171     taij_quad_tot_rs.std_spectral_base() ;
00172     taij_quad_tot_rot = 0. ;
00173     taij_quad_tot_rot.std_spectral_base() ;
00174     taij_quad_tot_bh = 0. ;
00175     taij_quad_tot_bh.std_spectral_base() ;
00176     taij_quad_tot = 0. ;
00177     taij_quad_tot.std_spectral_base() ;
00178     taij_quad_auto = 0. ;
00179     taij_quad_auto.std_spectral_base() ;
00180     taij_quad_comp = 0. ;
00181     taij_quad_comp.std_spectral_base() ;
00182 
00183     // Pointers of derived quantities initialized to zero :
00184     set_der_0x0() ;
00185 
00186 }
00187 
00188 // Copy constructor
00189 // ----------------
00190 Hole_bhns::Hole_bhns(const Hole_bhns& hole)
00191       : Black_hole(hole),
00192     bc_lapconf_nd(hole.bc_lapconf_nd),
00193     bc_lapconf_fs(hole.bc_lapconf_fs),
00194     irrotational(hole.irrotational),
00195     omega_spin(hole.omega_spin),
00196     lapconf_auto_rs(hole.lapconf_auto_rs),
00197     lapconf_auto_bh(hole.lapconf_auto_bh),
00198     lapconf_auto(hole.lapconf_auto),
00199     lapconf_comp(hole.lapconf_comp),
00200     lapconf_tot(hole.lapconf_tot),
00201     lapse_auto(hole.lapse_auto),
00202     lapse_tot(hole.lapse_tot),
00203     d_lapconf_auto_rs(hole.d_lapconf_auto_rs),
00204     d_lapconf_auto_bh(hole.d_lapconf_auto_bh),
00205     d_lapconf_auto(hole.d_lapconf_auto),
00206     d_lapconf_comp(hole.d_lapconf_comp),
00207     shift_auto_rs(hole.shift_auto_rs),
00208     shift_auto_bh(hole.shift_auto_bh),
00209     shift_auto(hole.shift_auto),
00210     shift_comp(hole.shift_comp),
00211     shift_tot(hole.shift_tot),
00212     d_shift_auto_rs(hole.d_shift_auto_rs),
00213     d_shift_auto_bh(hole.d_shift_auto_bh),
00214     d_shift_auto(hole.d_shift_auto),
00215     d_shift_comp(hole.d_shift_comp),
00216     confo_auto_rs(hole.confo_auto_rs),
00217     confo_auto_bh(hole.confo_auto_bh),
00218     confo_auto(hole.confo_auto),
00219     confo_comp(hole.confo_comp),
00220     confo_tot(hole.confo_tot),
00221     d_confo_auto_rs(hole.d_confo_auto_rs),
00222     d_confo_auto_bh(hole.d_confo_auto_bh),
00223     d_confo_auto(hole.d_confo_auto),
00224     d_confo_comp(hole.d_confo_comp),
00225     taij_tot_rs(hole.taij_tot_rs),
00226     taij_tot_rot(hole.taij_tot_rot),
00227     taij_tot_bh(hole.taij_tot_bh),
00228     taij_tot(hole.taij_tot),
00229     taij_auto_rs(hole.taij_auto_rs),
00230     taij_auto(hole.taij_auto),
00231     taij_comp(hole.taij_comp),
00232     taij_quad_tot_rs(hole.taij_quad_tot_rs),
00233     taij_quad_tot_rot(hole.taij_quad_tot_rot),
00234     taij_quad_tot_bh(hole.taij_quad_tot_bh),
00235     taij_quad_tot(hole.taij_quad_tot),
00236     taij_quad_auto(hole.taij_quad_auto),
00237     taij_quad_comp(hole.taij_quad_comp)
00238 {
00239     set_der_0x0() ;
00240 }
00241 
00242 // Constructor from a file
00243 // -----------------------
00244 Hole_bhns::Hole_bhns(Map& mp_i, FILE* fich)
00245       : Black_hole(mp_i, fich),
00246     lapconf_auto_rs(mp_i, *(mp_i.get_mg()), fich),
00247     lapconf_auto_bh(mp_i),
00248     lapconf_auto(mp_i),
00249     lapconf_comp(mp_i),
00250     lapconf_tot(mp_i),
00251     lapse_auto(mp_i),
00252     lapse_tot(mp_i),
00253     d_lapconf_auto_rs(mp_i, COV, mp_i.get_bvect_cart()),
00254     d_lapconf_auto_bh(mp_i, COV, mp_i.get_bvect_cart()),
00255     d_lapconf_auto(mp_i, COV, mp_i.get_bvect_cart()),
00256     d_lapconf_comp(mp_i, COV, mp_i.get_bvect_cart()),
00257     shift_auto_rs(mp_i, mp_i.get_bvect_cart(), fich),
00258     shift_auto_bh(mp_i, CON, mp_i.get_bvect_cart()),
00259     shift_auto(mp_i, CON, mp_i.get_bvect_cart()),
00260     shift_comp(mp_i, CON, mp_i.get_bvect_cart()),
00261     shift_tot(mp_i, CON, mp_i.get_bvect_cart()),
00262     d_shift_auto_rs(mp_i, 2, CON, mp_i.get_bvect_cart()),
00263     d_shift_auto_bh(mp_i, 2, CON, mp_i.get_bvect_cart()),
00264     d_shift_auto(mp_i, 2, CON, mp_i.get_bvect_cart()),
00265     d_shift_comp(mp_i, 2, CON, mp_i.get_bvect_cart()),
00266     confo_auto_rs(mp_i, *(mp_i.get_mg()), fich),
00267     confo_auto_bh(mp_i),
00268     confo_auto(mp_i),
00269     confo_comp(mp_i),
00270     confo_tot(mp_i),
00271     d_confo_auto_rs(mp_i, COV, mp_i.get_bvect_cart()),
00272     d_confo_auto_bh(mp_i, COV, mp_i.get_bvect_cart()),
00273     d_confo_auto(mp_i, COV, mp_i.get_bvect_cart()),
00274     d_confo_comp(mp_i, COV, mp_i.get_bvect_cart()),
00275     taij_tot_rs(mp_i, CON, mp_i.get_bvect_cart()),
00276     taij_tot_rot(mp_i, CON, mp_i.get_bvect_cart()),
00277     taij_tot_bh(mp_i, CON, mp_i.get_bvect_cart()),
00278     taij_tot(mp_i, CON, mp_i.get_bvect_cart()),
00279     taij_auto_rs(mp_i, CON, mp_i.get_bvect_cart()),
00280     taij_auto(mp_i, CON, mp_i.get_bvect_cart()),
00281     taij_comp(mp_i, CON, mp_i.get_bvect_cart()),
00282     taij_quad_tot_rs(mp_i),
00283     taij_quad_tot_rot(mp_i),
00284     taij_quad_tot_bh(mp_i),
00285     taij_quad_tot(mp_i),
00286     taij_quad_auto(mp_i),
00287     taij_quad_comp(mp_i)
00288 {
00289 
00290     // bc_lapconf_nd, bc_lapconf_fs, irrotational, and omega_spin
00291     // are read from the file
00292     fread(&bc_lapconf_nd, sizeof(bool), 1, fich) ;
00293     fread(&bc_lapconf_fs, sizeof(bool), 1, fich) ;
00294     fread(&irrotational, sizeof(bool), 1, fich) ;
00295     fread(&omega_spin, sizeof(double), 1, fich) ;
00296 
00297     // All other quantities are initialized to zero
00298     // --------------------------------------------
00299 
00300     lapconf_auto_bh = 1. ;
00301     lapconf_auto_bh.std_spectral_base() ;
00302     lapconf_auto = 1. ;
00303     lapconf_auto.std_spectral_base() ;
00304     lapconf_comp = 0. ;
00305     lapconf_comp.std_spectral_base() ;
00306     lapconf_tot = 1. ;
00307     lapconf_tot.std_spectral_base() ;
00308 
00309     lapse_auto = 1. ;
00310     lapse_auto.std_spectral_base() ;
00311     lapse_tot = 1. ;
00312     lapse_tot.std_spectral_base() ;
00313 
00314     d_lapconf_auto_rs.set_etat_zero() ;
00315     d_lapconf_auto_bh.set_etat_zero() ;
00316     d_lapconf_auto.set_etat_zero() ;
00317     d_lapconf_comp.set_etat_zero() ;
00318 
00319     shift_auto_bh.set_etat_zero() ;
00320     shift_auto.set_etat_zero() ;
00321     shift_comp.set_etat_zero() ;
00322     shift_tot.set_etat_zero() ;
00323     d_shift_auto_rs.set_etat_zero() ;
00324     d_shift_auto_bh.set_etat_zero() ;
00325     d_shift_auto.set_etat_zero() ;
00326     d_shift_comp.set_etat_zero() ;
00327 
00328     confo_auto_bh = 1. ;
00329     confo_auto_bh.std_spectral_base() ;
00330     confo_auto = 1. ;
00331     confo_auto.std_spectral_base() ;
00332     confo_comp = 0. ;
00333     confo_comp.std_spectral_base() ;
00334     confo_tot = 1. ;
00335     confo_tot.std_spectral_base() ;
00336 
00337     d_confo_auto_rs.set_etat_zero() ;
00338     d_confo_auto_bh.set_etat_zero() ;
00339     d_confo_auto.set_etat_zero() ;
00340     d_confo_comp.set_etat_zero() ;
00341 
00342     taij_tot_rs.set_etat_zero() ;
00343     taij_tot_rot.set_etat_zero() ;
00344     taij_tot_bh.set_etat_zero() ;
00345     taij_tot.set_etat_zero() ;
00346     taij_auto_rs.set_etat_zero() ;
00347     taij_auto.set_etat_zero() ;
00348     taij_comp.set_etat_zero() ;
00349     taij_quad_tot_rs = 0. ;
00350     taij_quad_tot_rs.std_spectral_base() ;
00351     taij_quad_tot_rot = 0. ;
00352     taij_quad_tot_rot.std_spectral_base() ;
00353     taij_quad_tot_bh = 0. ;
00354     taij_quad_tot_bh.std_spectral_base() ;
00355     taij_quad_tot = 0. ;
00356     taij_quad_tot.std_spectral_base() ;
00357     taij_quad_auto = 0. ;
00358     taij_quad_auto.std_spectral_base() ;
00359     taij_quad_comp = 0. ;
00360     taij_quad_comp.std_spectral_base() ;
00361 
00362     // Pointers of derived quantities initialized to zero
00363     // --------------------------------------------------
00364     set_der_0x0() ;
00365 
00366 }
00367 
00368 
00369                     //--------------------//
00370                     //     Destructor     //
00371                     //--------------------//
00372 
00373 Hole_bhns::~Hole_bhns()
00374 {
00375 
00376     del_deriv() ;
00377 
00378 }
00379 
00380 
00381                     //------------------------------------------//
00382                     //     Management of derived quantities     //
00383                     //------------------------------------------//
00384 
00385 void Hole_bhns::del_deriv() const {
00386 
00387     Black_hole::del_deriv() ;
00388 
00389     if (p_mass_irr_bhns != 0x0) delete p_mass_irr_bhns ;
00390     if (p_spin_am_bhns != 0x0) delete p_spin_am_bhns ;
00391 
00392     set_der_0x0() ;
00393 
00394 }
00395 
00396 void Hole_bhns::set_der_0x0() const {
00397 
00398     Black_hole::set_der_0x0() ;
00399 
00400     p_mass_irr_bhns = 0x0 ;
00401     p_spin_am_bhns = 0x0 ;
00402 
00403 }
00404 
00405 
00406                     //--------------------//
00407                     //     Assignment     //
00408                     //--------------------//
00409 
00410 // Assignment to another Hole_bhns
00411 // -------------------------------
00412 void Hole_bhns::operator=(const Hole_bhns& hole) {
00413 
00414     // Assignment of quantities common to the derived classes of Black_hole
00415     Black_hole::operator=(hole) ;
00416 
00417     // Assignment of proper quantities of class Hole_bhns
00418     bc_lapconf_nd = hole.bc_lapconf_nd ;
00419     bc_lapconf_fs = hole.bc_lapconf_fs ;
00420     irrotational = hole.irrotational ;
00421     omega_spin = hole.omega_spin ;
00422     lapconf_auto_rs = hole.lapconf_auto_rs ;
00423     lapconf_auto_bh = hole.lapconf_auto_bh ;
00424     lapconf_auto = hole.lapconf_auto ;
00425     lapconf_comp = hole.lapconf_comp ;
00426     lapconf_tot = hole.lapconf_tot ;
00427     lapse_auto = hole.lapse_auto ;
00428     lapse_tot = hole.lapse_tot ;
00429     d_lapconf_auto_rs = hole.d_lapconf_auto_rs ;
00430     d_lapconf_auto_bh = hole.d_lapconf_auto_bh ;
00431     d_lapconf_auto = hole.d_lapconf_auto ;
00432     d_lapconf_comp = hole.d_lapconf_comp ;
00433     shift_auto_rs = hole.shift_auto_rs ;
00434     shift_auto_bh = hole.shift_auto_bh ;
00435     shift_auto = hole.shift_auto ;
00436     shift_comp = hole.shift_comp ;
00437     shift_tot = hole.shift_tot ;
00438     d_shift_auto_rs = hole.d_shift_auto_rs ;
00439     d_shift_auto_bh = hole.d_shift_auto_bh ;
00440     d_shift_auto = hole.d_shift_auto ;
00441     d_shift_comp = hole.d_shift_comp ;
00442     confo_auto_rs = hole.confo_auto_rs ;
00443     confo_auto_bh = hole.confo_auto_bh ;
00444     confo_auto = hole.confo_auto ;
00445     confo_comp = hole.confo_comp ;
00446     confo_tot = hole.confo_tot ;
00447     d_confo_auto_rs = hole.d_confo_auto_rs ;
00448     d_confo_auto_bh = hole.d_confo_auto_bh ;
00449     d_confo_auto = hole.d_confo_auto ;
00450     d_confo_comp = hole.d_confo_comp ;
00451     taij_tot_rs = hole.taij_tot_rs ;
00452     taij_tot_rot = hole.taij_tot_rot ;
00453     taij_tot_bh = hole.taij_tot_bh ;
00454     taij_tot = hole.taij_tot ;
00455     taij_auto_rs = hole.taij_auto_rs ;
00456     taij_auto = hole.taij_auto ;
00457     taij_comp = hole.taij_comp ;
00458     taij_quad_tot_rs = hole.taij_quad_tot_rs ;
00459     taij_quad_tot_rot = hole.taij_quad_tot_rot ;
00460     taij_quad_tot_bh = hole.taij_quad_tot_bh ;
00461     taij_quad_tot = hole.taij_quad_tot ;
00462     taij_quad_auto = hole.taij_quad_auto ;
00463     taij_quad_comp = hole.taij_quad_comp ;
00464 
00465     del_deriv() ;
00466 
00467 }
00468 
00469 
00470 Scalar& Hole_bhns::set_lapconf_auto_rs() {
00471 
00472     del_deriv() ;
00473     return lapconf_auto_rs ;
00474 
00475 }
00476 
00477 Scalar& Hole_bhns::set_lapconf_auto_bh() {
00478 
00479     del_deriv() ;
00480     return lapconf_auto_bh ;
00481 
00482 }
00483 
00484 Scalar& Hole_bhns::set_lapconf_auto() {
00485 
00486     del_deriv() ;
00487     return lapconf_auto ;
00488 
00489 }
00490 
00491 Scalar& Hole_bhns::set_lapconf_comp() {
00492 
00493     del_deriv() ;
00494     return lapconf_comp ;
00495 
00496 }
00497 
00498 Scalar& Hole_bhns::set_lapconf_tot() {
00499 
00500     del_deriv() ;
00501     return lapconf_tot ;
00502 
00503 }
00504 
00505 Scalar& Hole_bhns::set_lapse_auto() {
00506 
00507     del_deriv() ;
00508     return lapse_auto ;
00509 
00510 }
00511 
00512 Scalar& Hole_bhns::set_lapse_tot() {
00513 
00514     del_deriv() ;
00515     return lapse_tot ;
00516 
00517 }
00518 
00519 Vector& Hole_bhns::set_shift_auto_rs() {
00520 
00521     del_deriv() ;
00522     return shift_auto_rs ;
00523 
00524 }
00525 
00526 Vector& Hole_bhns::set_shift_auto_bh() {
00527 
00528     del_deriv() ;
00529     return shift_auto_bh ;
00530 
00531 }
00532 
00533 Vector& Hole_bhns::set_shift_auto() {
00534 
00535     del_deriv() ;
00536     return shift_auto ;
00537 
00538 }
00539 
00540 Vector& Hole_bhns::set_shift_comp() {
00541 
00542     del_deriv() ;
00543     return shift_comp ;
00544 
00545 }
00546 
00547 Vector& Hole_bhns::set_shift_tot() {
00548 
00549     del_deriv() ;
00550     return shift_tot ;
00551 
00552 }
00553 
00554 Scalar& Hole_bhns::set_confo_auto_rs() {
00555 
00556     del_deriv() ;
00557     return confo_auto_rs ;
00558 
00559 }
00560 
00561 Scalar& Hole_bhns::set_confo_auto_bh() {
00562 
00563     del_deriv() ;
00564     return confo_auto_bh ;
00565 
00566 }
00567 
00568 Scalar& Hole_bhns::set_confo_auto() {
00569 
00570     del_deriv() ;
00571     return confo_auto ;
00572 
00573 }
00574 
00575 Scalar& Hole_bhns::set_confo_comp() {
00576 
00577     del_deriv() ;
00578     return confo_comp ;
00579 
00580 }
00581 
00582 Scalar& Hole_bhns::set_confo_tot() {
00583 
00584     del_deriv() ;
00585     return confo_tot ;
00586 
00587 }
00588 
00589 
00590                     //-----------------//
00591                     //     Outputs     //
00592                     //-----------------//
00593 
00594 // Save in a file
00595 // --------------
00596 void Hole_bhns::sauve(FILE* fich) const {
00597 
00598     Black_hole::sauve(fich) ;
00599 
00600     lapconf_auto_rs.sauve(fich) ;
00601     shift_auto_rs.sauve(fich) ;
00602     confo_auto_rs.sauve(fich) ;
00603 
00604     fwrite(&bc_lapconf_nd, sizeof(bool), 1, fich) ;
00605     fwrite(&bc_lapconf_fs, sizeof(bool), 1, fich) ;
00606     fwrite(&irrotational, sizeof(bool), 1, fich) ;
00607     fwrite(&omega_spin, sizeof(double), 1, fich) ;
00608 
00609 }
00610 
00611 // Printing
00612 // --------
00613 ostream& Hole_bhns::operator>>(ostream& ost) const {
00614 
00615     using namespace Unites ;
00616 
00617     //    Black_hole::operator>>(ost) ;
00618 
00619     ost << endl ;
00620     ost << "Black hole in a BHNS binary" << endl ;
00621     ost << "---------------------------" << endl ;
00622 
00623     int nt = mp.get_mg()->get_nt(1) ;
00624 
00625     ost << "Irreducible mass of BH :         "
00626     << mass_irr_bhns() / msol << " [Mo]" << endl ;
00627     ost << "Mass in the background :         "
00628     << mass_bh / msol << " [Mo]" << endl ;
00629     ost << "Radius of the apparent horison : "
00630     << rad_ah() / km << " [km]" << endl ;
00631     ost << "Spin angular velocity :          "
00632     << omega_spin * f_unit << " [rad/s]" << endl ;
00633     ost << "Lapse function on the AH :       "
00634     << lapse_tot.val_grid_point(1,0,nt-1,0) << endl ;
00635     ost << "Conformal factor on the AH :     "
00636     << confo_tot.val_grid_point(1,0,nt-1,0) << endl ;
00637     ost << "shift(1) on the AH :             "
00638     << shift_tot(1).val_grid_point(1,0,nt-1,0) << endl ;
00639     ost << "shift(2) on the AH :             "
00640     << shift_tot(2).val_grid_point(1,0,nt-1,0) << endl ;
00641     ost << "shift(3) on the AH :             "
00642     << shift_tot(3).val_grid_point(1,0,nt-1,0) << endl ;
00643 
00644     return ost ;
00645 
00646 }
00647 
00648                     //--------------------------------//
00649                     //     Computational routines     //
00650                     //--------------------------------//
00651 
00652 void Hole_bhns::relax_bhns(const Hole_bhns& hole_prev,
00653                double relax_met, int mer, int fmer_met) {
00654 
00655     double relax_met_jm1 = 1. - relax_met ;
00656 
00657     if ( (mer != 0) && (mer % fmer_met == 0)) {
00658 
00659         lapconf_auto_rs = relax_met * lapconf_auto_rs
00660         + relax_met_jm1 * hole_prev.lapconf_auto_rs ;
00661 
00662     shift_auto_rs = relax_met * shift_auto_rs
00663         + relax_met_jm1 * hole_prev.shift_auto_rs ;
00664 
00665     confo_auto_rs = relax_met * confo_auto_rs
00666         + relax_met_jm1 * hole_prev.confo_auto_rs ;
00667 
00668     }
00669 
00670     del_deriv() ;
00671 
00672 }
00673 

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