| 1 | /* |
| 2 | * Definition of Lorene class Bin_ns_bh |
| 3 | * |
| 4 | */ |
| 5 | |
| 6 | /* |
| 7 | * Copyright (c) 2002 Philippe Grandclement, Keisuke Taniguchi, |
| 8 | * Eric Gourgoulhon |
| 9 | * |
| 10 | * This file is part of LORENE. |
| 11 | * |
| 12 | * LORENE is free software; you can redistribute it and/or modify |
| 13 | * it under the terms of the GNU General Public License version 2 |
| 14 | * as published by the Free Software Foundation. |
| 15 | * |
| 16 | * LORENE is distributed in the hope that it will be useful, |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 | * GNU General Public License for more details. |
| 20 | * |
| 21 | * You should have received a copy of the GNU General Public License |
| 22 | * along with LORENE; if not, write to the Free Software |
| 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 24 | * |
| 25 | */ |
| 26 | |
| 27 | #ifndef __BIN_NS_BH_H_ |
| 28 | #define __BIN_NS_BH_H_ |
| 29 | |
| 30 | /* |
| 31 | * $Id: bin_ns_bh.h,v 1.19 2014/10/13 08:52:32 j_novak Exp $ |
| 32 | * $Log: bin_ns_bh.h,v $ |
| 33 | * Revision 1.19 2014/10/13 08:52:32 j_novak |
| 34 | * Lorene classes and functions now belong to the namespace Lorene. |
| 35 | * |
| 36 | * Revision 1.18 2007/04/26 14:14:59 f_limousin |
| 37 | * The function fait_tkij now have default values for bound_nn and lim_nn |
| 38 | * |
| 39 | * Revision 1.17 2007/04/24 20:15:30 f_limousin |
| 40 | * Implementation of Dirichlet and Neumann BC for the lapse |
| 41 | * |
| 42 | * Revision 1.16 2006/09/25 10:01:45 p_grandclement |
| 43 | * Addition of N-dimensional Tbl |
| 44 | * |
| 45 | * Revision 1.15 2006/06/23 07:09:22 p_grandclement |
| 46 | * Addition of spinning black hole |
| 47 | * |
| 48 | * Revision 1.14 2006/06/01 12:47:50 p_grandclement |
| 49 | * update of the Bin_ns_bh project |
| 50 | * |
| 51 | * Revision 1.13 2006/04/25 07:21:54 p_grandclement |
| 52 | * Various changes for the NS_BH project |
| 53 | * |
| 54 | * Revision 1.12 2005/12/01 12:59:08 p_grandclement |
| 55 | * Files for bin_ns_bh project |
| 56 | * |
| 57 | * Revision 1.11 2005/11/30 11:09:03 p_grandclement |
| 58 | * Changes for the Bin_ns_bh project |
| 59 | * |
| 60 | * Revision 1.10 2005/10/18 13:12:31 p_grandclement |
| 61 | * update of the mixted binary codes |
| 62 | * |
| 63 | * Revision 1.9 2005/08/29 15:10:12 p_grandclement |
| 64 | * Addition of things needed : |
| 65 | * 1) For BBH with different masses |
| 66 | * 2) Provisory files for the mixted binaries (Bh and NS) : THIS IS NOT |
| 67 | * WORKING YET !!! |
| 68 | * |
| 69 | * Revision 1.8 2004/06/09 06:23:50 k_taniguchi |
| 70 | * Introduce analytical_omega() and analytical_shift(). |
| 71 | * |
| 72 | * Revision 1.7 2003/11/25 07:25:44 k_taniguchi |
| 73 | * Change the attribute of fait_decouple() from private to public. |
| 74 | * |
| 75 | * Revision 1.6 2003/10/24 16:56:30 k_taniguchi |
| 76 | * Add the method for the calculation of the orbital angular velocity |
| 77 | * |
| 78 | * Revision 1.5 2003/10/24 12:45:22 k_taniguchi |
| 79 | * Change the class for the star from Etoile_bin to Et_bin_nsbh |
| 80 | * |
| 81 | * Revision 1.4 2003/02/13 16:40:24 p_grandclement |
| 82 | * Addition of various things for the Bin_ns_bh project, non of them being |
| 83 | * completely tested |
| 84 | * |
| 85 | * Revision 1.3 2002/12/19 14:46:16 e_gourgoulhon |
| 86 | * |
| 87 | * Modified prototype of functions set_omega and set_x_axe |
| 88 | * |
| 89 | * Revision 1.2 2002/12/18 10:29:18 e_gourgoulhon |
| 90 | * |
| 91 | * Added set_omega() and set_x_axe() |
| 92 | * |
| 93 | * Revision 1.1 2002/12/17 13:10:49 e_gourgoulhon |
| 94 | * Definition of class Bin_ns_bh |
| 95 | * |
| 96 | * |
| 97 | * |
| 98 | * |
| 99 | * $Header: /cvsroot/Lorene/C++/Include/bin_ns_bh.h,v 1.19 2014/10/13 08:52:32 j_novak Exp $ |
| 100 | * |
| 101 | */ |
| 102 | |
| 103 | |
| 104 | // Lorene headers |
| 105 | #include "et_bin_nsbh.h" |
| 106 | #include "bhole.h" |
| 107 | |
| 108 | namespace Lorene { |
| 109 | /** |
| 110 | * Neutron star - black hole binary system. |
| 111 | * |
| 112 | * The class {\tt Bin\_ns\_bh} is composed of an object of class |
| 113 | * {\tt Et\_bin\_nsbh} and an object of class {\tt Bhole}. |
| 114 | * |
| 115 | * @version #$Id: bin_ns_bh.h,v 1.19 2014/10/13 08:52:32 j_novak Exp $# |
| 116 | */ |
| 117 | class Bin_ns_bh { |
| 118 | |
| 119 | // Data : |
| 120 | // ----- |
| 121 | private: |
| 122 | /** Cartesian triad of the absolute reference frame |
| 123 | * |
| 124 | */ |
| 125 | const Base_vect_cart ref_triad ; |
| 126 | |
| 127 | /// The neutron star |
| 128 | Et_bin_nsbh star ; |
| 129 | |
| 130 | /// The black hole |
| 131 | Bhole hole ; |
| 132 | |
| 133 | /** Angular velocity with respect to an asymptotically inertial |
| 134 | * observer |
| 135 | */ |
| 136 | double omega ; |
| 137 | |
| 138 | /** Absolute X coordinate of the rotation axis |
| 139 | */ |
| 140 | double x_axe ; |
| 141 | |
| 142 | // Derived data : |
| 143 | // ------------ |
| 144 | private: |
| 145 | /// Total ADM mass of the system |
| 146 | mutable double* p_mass_adm ; |
| 147 | |
| 148 | /// Total Komar mass of the system |
| 149 | mutable double* p_mass_kom ; |
| 150 | |
| 151 | /// Total angular momentum of the system |
| 152 | mutable Tbl* p_angu_mom ; |
| 153 | |
| 154 | /// Total energy of the system |
| 155 | mutable double* p_total_ener ; |
| 156 | |
| 157 | /// Virial theorem error |
| 158 | mutable double* p_virial ; |
| 159 | |
| 160 | /// Virial theorem error by E.Gourgoulhon and S.Bonazzola. |
| 161 | mutable double* p_virial_gb ; |
| 162 | |
| 163 | /// Virial theorem error by J.L.Friedman, K.Uryu, and M.Shibata. |
| 164 | mutable double* p_virial_fus ; |
| 165 | |
| 166 | /// Relative error on the Hamiltonian constraint |
| 167 | mutable double* p_ham_constr ; |
| 168 | |
| 169 | /// Relative error on the momentum constraint |
| 170 | mutable Tbl* p_mom_constr ; |
| 171 | |
| 172 | |
| 173 | // Constructors - Destructor |
| 174 | // ------------------------- |
| 175 | public: |
| 176 | /** Standard constructor. |
| 177 | * |
| 178 | * @param mp_ns Mapping on which {\tt star} will be defined |
| 179 | * @param nzet Number of domains occupied by {\tt star} |
| 180 | * @param eos Equation of state of {\tt star} |
| 181 | * @param irrot_ns should be {\tt true} if {\tt star} is irrotational, |
| 182 | * {\tt false} if {\tt star} is corotating |
| 183 | * @param mp_bh Mapping on which {\tt bhole} will be defined |
| 184 | * |
| 185 | */ |
| 186 | Bin_ns_bh(Map& mp_ns, int nzet, const Eos& eos, bool irrot_ns, |
| 187 | Map_af& mp_bh) ; |
| 188 | |
| 189 | |
| 190 | Bin_ns_bh(const Bin_ns_bh& ) ; /// Copy constructor |
| 191 | |
| 192 | /** Constructor from a file (see {\tt sauve(FILE* )}). |
| 193 | * |
| 194 | * @param mp_ns Mapping on which {\tt star} will be defined |
| 195 | * @param eos Equation of state of {\tt star} |
| 196 | * @param mp_bh Mapping on which {\tt star} will be defined |
| 197 | * @param fich input file (must have been created by the function |
| 198 | * {\tt sauve}) |
| 199 | */ |
| 200 | Bin_ns_bh(Map& mp_ns, const Eos& eos, Map_af& mp_bh, FILE* fich, bool old = false) ; |
| 201 | |
| 202 | virtual ~Bin_ns_bh() ; /// Destructor |
| 203 | |
| 204 | |
| 205 | // Memory management |
| 206 | // ----------------- |
| 207 | private: |
| 208 | /// Deletes all the derived quantities |
| 209 | void del_deriv() const ; |
| 210 | |
| 211 | /// Sets to {\tt 0x0} all the pointers on derived quantities |
| 212 | void set_der_0x0() const ; |
| 213 | |
| 214 | |
| 215 | // Mutators / assignment |
| 216 | // --------------------- |
| 217 | public: |
| 218 | /// Assignment to another Bin_ns_bh |
| 219 | void operator=(const Bin_ns_bh& ) ; |
| 220 | |
| 221 | /// Read/write of the neutron star |
| 222 | Et_bin_nsbh& set_ns() |
| 223 | { del_deriv() ; |
| 224 | return star ;} ; |
| 225 | |
| 226 | /// Read/write of the black hole |
| 227 | Bhole& set_bh() |
| 228 | { del_deriv() ; |
| 229 | return hole ;} ; |
| 230 | |
| 231 | /// Sets the orbital angular velocity [{\tt f\_unit}] |
| 232 | void set_omega(double ) ; |
| 233 | |
| 234 | /// Sets the absolute coordinate X of the rotation axis [{\tt r\_unit}] |
| 235 | void set_x_axe(double ) ; |
| 236 | |
| 237 | // Accessors |
| 238 | // --------- |
| 239 | public: |
| 240 | /// Returns a constant reference to the neutron star |
| 241 | const Et_bin_nsbh& get_ns() const |
| 242 | { return star ;} ; |
| 243 | |
| 244 | /// Returns a constant reference to the black hole |
| 245 | const Bhole& get_bh() const |
| 246 | { return hole ;} ; |
| 247 | |
| 248 | /// Returns the orbital velocity |
| 249 | double get_omega() const |
| 250 | { return omega ;} ; |
| 251 | |
| 252 | /// Returns a constant reference to the black hole |
| 253 | double get_x_axe() const |
| 254 | { return x_axe ;} ; |
| 255 | |
| 256 | /// Return the separation |
| 257 | double separation() const ; |
| 258 | |
| 259 | // Outputs |
| 260 | // ------- |
| 261 | public: |
| 262 | virtual void sauve(FILE *) const ; /// Save in a file |
| 263 | |
| 264 | /// Display |
| 265 | friend ostream& operator<<(ostream& , const Bin_ns_bh& ) ; |
| 266 | |
| 267 | private: |
| 268 | /// Operator >> (function called by the operator <<). |
| 269 | ostream& operator>>(ostream& ) const ; |
| 270 | |
| 271 | public: |
| 272 | /** Function used to compute the {\tt decouple} functions for both |
| 273 | * the NS and the BH |
| 274 | **/ |
| 275 | void fait_decouple() ; |
| 276 | |
| 277 | /** Computation of the extrinsic curvature tensor for both |
| 278 | * {\tt star} and {\tt bhole}. |
| 279 | **/ |
| 280 | void fait_tkij(int bound_nn = -1, double lim_nn = 0) ; |
| 281 | |
| 282 | // Computational routines |
| 283 | // ---------------------- |
| 284 | public: |
| 285 | /** Computes the orbital angular velocity {\tt omega} |
| 286 | * |
| 287 | * @param fact_omeg_min [input] : determines the lower bound of the |
| 288 | * interval {\tt [omega\_min, omega\_max]} in which |
| 289 | * {\tt omega} is searched by |
| 290 | * {\tt omega\_min = fact\_omeg\_min * omega}, |
| 291 | * where {\tt omega} is the previous value of the |
| 292 | * angular velocity |
| 293 | * (typical value : {\tt fact\_omeg\_min = 0.5}) |
| 294 | * |
| 295 | * @param fact_omeg_max [input] : determines the higher bound of the |
| 296 | * interval {\tt [omega\_min, omega\_max]} in which |
| 297 | * {\tt omega} is searched by |
| 298 | * {\tt omega\_max = fact\_omeg\_max * omega}, |
| 299 | * where {\tt omega} is the previous value of the |
| 300 | * angular velocity. |
| 301 | * (typical value : {\tt fact\_omeg\_max = 1.5}) |
| 302 | * |
| 303 | */ |
| 304 | void orbit_omega(double fact_omeg_min, double fact_omeg_max) ; |
| 305 | |
| 306 | /** Sets the orbital angular velocity of the neutron star |
| 307 | * to some 2-PN analytical value |
| 308 | */ |
| 309 | void analytical_omega() ; |
| 310 | |
| 311 | /** Sets some analytical template for the shift vector (via the |
| 312 | * members {\tt w\_shift} and {\tt khi\_shift} of the neutron star |
| 313 | */ |
| 314 | void analytical_shift() ; |
| 315 | |
| 316 | void init_auto () ; |
| 317 | void affecte (const Bin_ns_bh&) ; |
| 318 | void pseudo_misner (int&, int, double, double, int, double) ; |
| 319 | double adm_systeme() const ; |
| 320 | double adm_systeme_volume() const ; |
| 321 | double komar_systeme() const ; |
| 322 | double moment_systeme_inf() const ; |
| 323 | double moment_systeme_hor() const ; |
| 324 | double smarr() const ; |
| 325 | Tbl linear_momentum_systeme_inf() const ; |
| 326 | double viriel() const ; |
| 327 | void coal (double, double, int, int, double, double, double, double, double, double, double, const int, int, double) ; |
| 328 | double distance_propre_axe_bh (const int nr = 65) const ; |
| 329 | double distance_propre_axe_ns (const int nr = 65) const ; |
| 330 | |
| 331 | }; |
| 332 | ostream& operator<<(ostream& , const Bin_ns_bh& ) ; |
| 333 | |
| 334 | } |
| 335 | #endif |