| 1 | /* |
| 2 | * Definition of Lorene classes Etoile |
| 3 | * Etoile_bin |
| 4 | * Etoile_rot |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | /* |
| 9 | * Copyright (c) 2000-2001 Eric Gourgoulhon |
| 10 | * Copyright (c) 2000-2001 Keisuke Taniguchi |
| 11 | * |
| 12 | * This file is part of LORENE. |
| 13 | * |
| 14 | * LORENE is free software; you can redistribute it and/or modify |
| 15 | * it under the terms of the GNU General Public License as published by |
| 16 | * the Free Software Foundation; either version 2 of the License, or |
| 17 | * (at your option) any later version. |
| 18 | * |
| 19 | * LORENE is distributed in the hope that it will be useful, |
| 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 | * GNU General Public License for more details. |
| 23 | * |
| 24 | * You should have received a copy of the GNU General Public License |
| 25 | * along with LORENE; if not, write to the Free Software |
| 26 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 27 | * |
| 28 | */ |
| 29 | |
| 30 | |
| 31 | #ifndef __ETOILE_H_ |
| 32 | #define __ETOILE_H_ |
| 33 | |
| 34 | /* |
| 35 | * $Id: etoile.h,v 1.35 2015/06/12 12:38:24 j_novak Exp $ |
| 36 | * $Log: etoile.h,v $ |
| 37 | * Revision 1.35 2015/06/12 12:38:24 j_novak |
| 38 | * Implementation of the corrected formula for the quadrupole momentum. |
| 39 | * |
| 40 | * Revision 1.34 2015/06/11 13:50:19 j_novak |
| 41 | * Minor corrections |
| 42 | * |
| 43 | * Revision 1.33 2015/06/10 14:36:39 a_sourie |
| 44 | * Corrected the formula for the computation of the quadrupole momentum. |
| 45 | * |
| 46 | * Revision 1.32 2014/10/13 08:52:34 j_novak |
| 47 | * Lorene classes and functions now belong to the namespace Lorene. |
| 48 | * |
| 49 | * Revision 1.31 2011/10/06 14:55:36 j_novak |
| 50 | * equation_of_state() is now virtual to be able to call to the magnetized |
| 51 | * Eos_mag. |
| 52 | * |
| 53 | * Revision 1.30 2010/02/02 21:05:49 e_gourgoulhon |
| 54 | * Etoile_bin:equilibrium : suppressed the argument method_khi added by |
| 55 | * mistake during previous commit. |
| 56 | * |
| 57 | * Revision 1.29 2010/02/02 13:34:12 e_gourgoulhon |
| 58 | * Marked DEPRECATED (in the documentation). |
| 59 | * |
| 60 | * Revision 1.28 2008/11/14 13:51:08 e_gourgoulhon |
| 61 | * Added the parameter ent_limit to Etoile::equilibrium_spher and |
| 62 | * Etoile_bin::equilibrium. |
| 63 | * |
| 64 | * Revision 1.27 2005/10/05 15:14:47 j_novak |
| 65 | * Added a Param* as parameter of Etoile_rot::equilibrium |
| 66 | * |
| 67 | * Revision 1.26 2005/08/29 15:10:12 p_grandclement |
| 68 | * Addition of things needed : |
| 69 | * 1) For BBH with different masses |
| 70 | * 2) Provisory files for the mixted binaries (Bh and NS) : THIS IS NOT |
| 71 | * WORKING YET !!! |
| 72 | * |
| 73 | * Revision 1.25 2005/01/18 22:35:51 k_taniguchi |
| 74 | * Delete a pointer for Etoile::ray_eq(int kk). |
| 75 | * |
| 76 | * Revision 1.24 2005/01/18 20:34:14 k_taniguchi |
| 77 | * Addition of Etoile::ray_eq(int kk). |
| 78 | * |
| 79 | * Revision 1.23 2005/01/17 20:39:32 k_taniguchi |
| 80 | * Addition of Etoile::ray_eq_3pis2(). |
| 81 | * |
| 82 | * Revision 1.22 2004/11/30 20:40:06 k_taniguchi |
| 83 | * Addition of the method for calculating a spherical star with falloff |
| 84 | * condition at the outer boundary. |
| 85 | * |
| 86 | * Revision 1.21 2004/05/10 10:18:33 f_limousin |
| 87 | * Change to avoid warning in the compilation of Lorene |
| 88 | * |
| 89 | * Revision 1.20 2004/05/07 12:37:12 f_limousin |
| 90 | * Add new member ssjm1_psi |
| 91 | * |
| 92 | * Revision 1.19 2004/04/08 16:42:31 f_limousin |
| 93 | * Add a function velocity_potential with argument ssjm1_psi for the |
| 94 | * case of strange stars. |
| 95 | * |
| 96 | * Revision 1.18 2004/03/22 13:12:41 j_novak |
| 97 | * Modification of comments to use doxygen instead of doc++ |
| 98 | * |
| 99 | * Revision 1.17 2003/10/24 12:24:41 k_taniguchi |
| 100 | * Suppress the methods of update metric for NS-BH |
| 101 | * |
| 102 | * Revision 1.16 2003/10/21 11:44:43 k_taniguchi |
| 103 | * Delete various things for the Bin_ns_bh project. |
| 104 | * They are moved to et_bin_nsbh.h. |
| 105 | * |
| 106 | * Revision 1.15 2003/10/20 14:50:04 k_taniguchi |
| 107 | * Addition of various things for the Bin_ns_bh project |
| 108 | * which are related with the part of the neutron star. |
| 109 | * |
| 110 | * Revision 1.14 2003/10/20 13:11:03 k_taniguchi |
| 111 | * Back to version 1.12 |
| 112 | * |
| 113 | * Revision 1.13 2003/10/20 12:15:55 k_taniguchi |
| 114 | * Addition of various things for the Bin_ns_bh project |
| 115 | * which are related with the part of the neutron star. |
| 116 | * |
| 117 | * Revision 1.12 2003/06/20 14:13:16 f_limousin |
| 118 | * Change to virtual the functions equilibrium_spher() and kinematics(). |
| 119 | * |
| 120 | * Revision 1.11 2003/02/13 16:40:24 p_grandclement |
| 121 | * Addition of various things for the Bin_ns_bh project, non of them being |
| 122 | * completely tested |
| 123 | * |
| 124 | * Revision 1.10 2003/02/04 16:20:35 f_limousin |
| 125 | * Change to virtual the routine extrinsic_curvature |
| 126 | * |
| 127 | * Revision 1.9 2003/01/31 16:57:12 p_grandclement |
| 128 | * addition of the member Cmp decouple used to compute the K_ij auto, once |
| 129 | * the K_ij total is known |
| 130 | * |
| 131 | * Revision 1.8 2002/12/19 14:48:00 e_gourgoulhon |
| 132 | * |
| 133 | * Class Etoile_bin: added the new functions: |
| 134 | * void update_metric(const Bhole& comp) |
| 135 | * void update_metric_der_comp(const Bhole& comp) |
| 136 | * to treat the case where the companion is a black hole |
| 137 | * |
| 138 | * Revision 1.7 2002/12/17 21:17:08 e_gourgoulhon |
| 139 | * Class Etoile_bin: suppression of the member p_companion |
| 140 | * as well as the associated functions set_companion |
| 141 | * and get_companion. |
| 142 | * |
| 143 | * Revision 1.6 2002/09/13 09:17:33 j_novak |
| 144 | * Modif. commentaires |
| 145 | * |
| 146 | * Revision 1.5 2002/06/17 14:05:16 j_novak |
| 147 | * friend functions are now also declared outside the class definition |
| 148 | * |
| 149 | * Revision 1.4 2002/04/05 09:09:36 j_novak |
| 150 | * The inversion of the EOS for 2-fluids polytrope has been modified. |
| 151 | * Some errors in the determination of the surface were corrected. |
| 152 | * |
| 153 | * Revision 1.3 2002/01/11 14:09:34 j_novak |
| 154 | * Added newtonian version for 2-fluid stars |
| 155 | * |
| 156 | * Revision 1.2 2001/12/06 15:11:43 jl_zdunik |
| 157 | * Introduction of the new function f_eq() in the class Etoile_rot |
| 158 | * |
| 159 | * Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon |
| 160 | * LORENE |
| 161 | * |
| 162 | * Revision 2.61 2001/10/25 08:32:57 eric |
| 163 | * Etoile_rot::display_poly passe de protected a public. |
| 164 | * |
| 165 | * Revision 2.60 2001/10/24 15:35:55 eric |
| 166 | * Classe Etoile_rot: ajout de la fonction display_poly. |
| 167 | * |
| 168 | * Revision 2.59 2001/10/16 14:48:00 eric |
| 169 | * La fonction Etoile_rot::get_omega() devient |
| 170 | * virtual Etoile_rot::get_omega_c() |
| 171 | * (retourne la valeur centrale de Omega). |
| 172 | * |
| 173 | * Revision 2.58 2001/10/11 09:24:00 eric |
| 174 | * La fonction Etoile_rot::equilibrium est desormais virtuelle. |
| 175 | * |
| 176 | * Revision 2.57 2001/08/06 15:39:04 keisuke |
| 177 | * Addition of a new argument to Etoile_bin::equilibrium and equil_regular. |
| 178 | * |
| 179 | * Revision 2.56 2001/06/25 12:52:33 eric |
| 180 | * Classe Etoile_bin : ajout du membre p_companion et des fonctions |
| 181 | * associees set_companion() et get_companion(). |
| 182 | * |
| 183 | * Revision 2.55 2001/06/13 14:11:55 eric |
| 184 | * Modif commentaires (mise en conformite Doc++ 3.4.7) |
| 185 | * |
| 186 | * Revision 2.54 2001/03/26 09:29:59 jlz |
| 187 | * Classe Etoile_rot: new members p_espec_isco and p_lspec_isco. |
| 188 | * |
| 189 | * Revision 2.53 2001/02/08 15:37:09 eric |
| 190 | * *** empty log message *** |
| 191 | * |
| 192 | * Revision 2.52 2001/02/08 15:12:42 eric |
| 193 | * Ajout de la fonction Etoile_rot::f_eccentric. |
| 194 | * |
| 195 | * Revision 2.51 2000/11/23 15:43:24 eric |
| 196 | * Ajout de l'argument ent_limit a Etoile_rot::equilibrium. |
| 197 | * |
| 198 | * Revision 2.50 2000/11/19 18:51:13 eric |
| 199 | * Etoile_rot: ajout de la fonction (static) lambda_grv2 |
| 200 | * |
| 201 | * Revision 2.49 2000/11/18 23:17:32 eric |
| 202 | * Ajout de l'argument ost a Etoile_rot::r_isco. |
| 203 | * |
| 204 | * Revision 2.48 2000/11/18 21:08:33 eric |
| 205 | * Classe Etoile_rot: ajout des fonctions r_isco() et f_isco() |
| 206 | * ainsi que des membres associes p_r_isco et p_f_isco. |
| 207 | * |
| 208 | * Revision 2.47 2000/11/10 15:15:38 eric |
| 209 | * Modif arguments Etoile_rot::equilibrium. |
| 210 | * |
| 211 | * Revision 2.46 2000/10/20 13:10:23 eric |
| 212 | * Etoile_rot::equilibrium: ajout de l'argument nzadapt. |
| 213 | * |
| 214 | * Revision 2.45 2000/10/17 15:59:14 eric |
| 215 | * Modif commentaires Etoile_rot::equilibrium |
| 216 | * |
| 217 | * Revision 2.44 2000/10/12 15:22:29 eric |
| 218 | * Modif commentaires Etoile_rot. |
| 219 | * |
| 220 | * Revision 2.43 2000/10/12 10:20:12 eric |
| 221 | * Ajout de la fonction Etoile_rot::fait_nphi(). |
| 222 | * |
| 223 | * Revision 2.42 2000/09/22 15:50:13 keisuke |
| 224 | * d_logn_auto_div devient desormais un membre de la classe Etoile |
| 225 | * et non plus de la classe derivee Etoile_bin. |
| 226 | * |
| 227 | * Revision 2.41 2000/09/18 16:14:37 eric |
| 228 | * Classe Etoile_rot: ajout du membre tkij et de la fonction |
| 229 | * extrinsic curvature(). |
| 230 | * |
| 231 | * Revision 2.40 2000/09/07 14:31:09 keisuke |
| 232 | * Ajout des membres logn_auto_regu et get_logn_auto_regu() a la classe Etoile. |
| 233 | * Ajout des membres d_logn_auto_regu et get_d_logn_auto_regu() |
| 234 | * a la classe Etoile_bin. |
| 235 | * |
| 236 | * Revision 2.39 2000/09/07 10:25:50 keisuke |
| 237 | * Ajout du membre get_logn_auto_div() a la classe Etoile. |
| 238 | * Ajout du membre get_d_logn_auto_div() a la classe Etoile_bin. |
| 239 | * |
| 240 | * Revision 2.38 2000/08/31 11:25:24 eric |
| 241 | * Classe Etoile_rot: ajout des membres tnphi et ak_car. |
| 242 | * |
| 243 | * Revision 2.37 2000/08/29 11:37:06 eric |
| 244 | * Ajout des membres k_div et logn_auto_div a la classe Etoile. |
| 245 | * Ajout du membre d_logn_auto_div a la classe Etoile_bin. |
| 246 | * |
| 247 | * Revision 2.36 2000/08/25 10:25:57 keisuke |
| 248 | * Ajout de Etoile_bin::equil_regular. |
| 249 | * |
| 250 | * Revision 2.35 2000/08/18 14:01:07 eric |
| 251 | * Modif commentaires. |
| 252 | * |
| 253 | * Revision 2.34 2000/08/17 12:38:30 eric |
| 254 | * Modifs classe Etoile_rot : ajout des membres nuf, nuq, ssjm1_nuf et ssjm1_nuq |
| 255 | * Modif arguments Etoile_rot::equilibrium. |
| 256 | * .\ |
| 257 | * |
| 258 | * Revision 2.33 2000/08/07 12:11:13 keisuke |
| 259 | * Ajout de Etoile::equil_spher_regular. |
| 260 | * |
| 261 | * Revision 2.32 2000/07/21 12:02:55 eric |
| 262 | * Suppression de Etoile_rot::relaxation. |
| 263 | * |
| 264 | * Revision 2.31 2000/07/20 15:32:28 eric |
| 265 | * *** empty log message *** |
| 266 | * |
| 267 | * Revision 2.30 2000/07/06 09:39:12 eric |
| 268 | * Ajout du membre p_xa_barycenter a Etoile_bin, ainsi que de la |
| 269 | * fonction associee xa_barycenter(). |
| 270 | * |
| 271 | * Revision 2.29 2000/05/25 13:47:38 eric |
| 272 | * Modif Etoile_bin::equilibrium: ajout de l'argument thres_adapt |
| 273 | * |
| 274 | * Revision 2.28 2000/03/22 16:41:45 eric |
| 275 | * Ajout de la sortie de nouvelles erreurs dans Etoile_bin::equilibrium. |
| 276 | * |
| 277 | * Revision 2.27 2000/03/22 12:54:44 eric |
| 278 | * Nouveau prototype d'Etoile_bin::velocity_potential : l'erreur est |
| 279 | * retournee en double. |
| 280 | * Nouveau prototype d'Etoile_bin::equilibrium : diff_ent est remplace |
| 281 | * par le Tbl diff. |
| 282 | * |
| 283 | * Revision 2.26 2000/03/15 11:04:15 eric |
| 284 | * Ajout des fonctions Etoile_bin::set_w_shift() et Etoile_bin::set_khi_shift() |
| 285 | * Amelioration des commentaires. |
| 286 | * |
| 287 | * Revision 2.25 2000/03/08 12:12:49 eric |
| 288 | * Ajout de la fonction Etoile_bin::is_irrotational(). |
| 289 | * |
| 290 | * Revision 2.24 2000/03/07 14:48:01 eric |
| 291 | * Ajout de la fonction Etoile_bin::extrinsic_curvature(). |
| 292 | * |
| 293 | * Revision 2.23 2000/02/21 13:57:57 eric |
| 294 | * classe Etoile_bin: suppression du membre psi: remplacement par psi0. |
| 295 | * |
| 296 | * Revision 2.22 2000/02/17 16:51:22 eric |
| 297 | * Ajout de l'argument diff_ent dans Etoile_bin::equilibrium. |
| 298 | * |
| 299 | * Revision 2.21 2000/02/17 15:29:38 eric |
| 300 | * Ajout de la fonction Etoile_bin::relaxation. |
| 301 | * |
| 302 | * Revision 2.20 2000/02/17 13:54:21 eric |
| 303 | * Ajout de la fonction Etoile_bin::velocity_potential. |
| 304 | * |
| 305 | * Revision 2.19 2000/02/16 15:05:14 eric |
| 306 | * Ajout des membres w_shift et khi_shift. |
| 307 | * (sauves dans les fichiers a la place de shift_auto). |
| 308 | * Ajout de la fonction Etoile_bin::fait_shift_auto. |
| 309 | * |
| 310 | * Revision 2.18 2000/02/16 13:47:02 eric |
| 311 | * Classe Etoile_bin: ajout des membres ssjm1_khi et ssjm1_wshift. |
| 312 | * |
| 313 | * Revision 2.17 2000/02/16 11:54:13 eric |
| 314 | * Classe Etoile_bin : ajout des membres ssjm1_logn et ssjm1_beta. |
| 315 | * |
| 316 | * Revision 2.16 2000/02/15 15:40:07 eric |
| 317 | * Ajout de Etoile_bin::equilibrium. |
| 318 | * |
| 319 | * Revision 2.15 2000/02/12 18:40:15 eric |
| 320 | * Modif commentaires. |
| 321 | * |
| 322 | * Revision 2.14 2000/02/12 14:44:26 eric |
| 323 | * Ajout des fonctions Etoile_bin::set_logn_comp et set_pot_centri. |
| 324 | * |
| 325 | * Revision 2.13 2000/02/10 20:22:25 eric |
| 326 | * Modif commentaires. |
| 327 | * |
| 328 | * Revision 2.12 2000/02/10 16:11:24 eric |
| 329 | * Classe Etoile_bin : ajout des accesseurs get_psi, etc... |
| 330 | * ajout de la fonction fait_d_psi |
| 331 | * |
| 332 | * Revision 2.11 2000/02/08 19:28:29 eric |
| 333 | * La fonction Etoile_bin::scal_prod est rebaptisee Etoile_bin::sprod |
| 334 | * |
| 335 | * Revision 2.10 2000/02/04 17:15:15 eric |
| 336 | * Classe Etoile_bin: ajout du membre ref_triad. |
| 337 | * |
| 338 | * Revision 2.9 2000/02/04 16:36:48 eric |
| 339 | * Ajout des fonctions update_metric* et kinematics. |
| 340 | * |
| 341 | * Revision 2.8 2000/02/02 10:12:37 eric |
| 342 | * Ajout des fonctions de lecture/ecriture mp, nzet, eos, etc... |
| 343 | * |
| 344 | * Revision 2.7 2000/02/01 15:59:43 eric |
| 345 | * Ajout de la fonction Etoile_bin::scal_prod. |
| 346 | * |
| 347 | * Revision 2.6 2000/01/31 15:56:45 eric |
| 348 | * Introduction de la classe derivee Etoile_bin. |
| 349 | * |
| 350 | * Revision 2.5 2000/01/28 17:17:45 eric |
| 351 | * Ajout des fonctions de calcul des quantites globales. |
| 352 | * |
| 353 | * Revision 2.4 2000/01/27 16:46:59 eric |
| 354 | * Ajout des fonctions get_ent(), etc.... |
| 355 | * |
| 356 | * Revision 2.3 2000/01/24 17:19:48 eric |
| 357 | * Modif commentaires. |
| 358 | * |
| 359 | * Revision 2.2 2000/01/24 17:13:04 eric |
| 360 | * Le mapping mp n'est plus constant. |
| 361 | * Ajout de la fonction equilibrium_spher. |
| 362 | * |
| 363 | * Revision 2.1 2000/01/24 13:37:19 eric |
| 364 | * *** empty log message *** |
| 365 | * |
| 366 | * Revision 2.0 2000/01/20 17:04:33 eric |
| 367 | * *** empty log message *** |
| 368 | * |
| 369 | * |
| 370 | * $Header: /cvsroot/Lorene/C++/Include/etoile.h,v 1.35 2015/06/12 12:38:24 j_novak Exp $ |
| 371 | * |
| 372 | */ |
| 373 | |
| 374 | // Headers Lorene |
| 375 | #include "tenseur.h" |
| 376 | namespace Lorene { |
| 377 | class Eos ; |
| 378 | class Bhole ; |
| 379 | |
| 380 | |
| 381 | //---------------------------// |
| 382 | // base class Etoile // |
| 383 | //---------------------------// |
| 384 | |
| 385 | /** |
| 386 | * Base class for stars *** DEPRECATED : use class \c Star instead ***. |
| 387 | \ingroup (star) |
| 388 | * |
| 389 | * An \c Etoile is constructed upon (i) a mapping |
| 390 | * (derived class of \c Map ), the center of which defines the center of the |
| 391 | * star, and (ii) an equation of state (derived class of \c Eos ). |
| 392 | * It contains tensor fields (class \c Tenseur ) which describle the |
| 393 | * hydrodynamical quantities as well as the gravitational field (spacetime |
| 394 | * metric). |
| 395 | * |
| 396 | * According to the 3+1 formalism, the spacetime metric is written |
| 397 | * \f[ \label{eetoilemetrique} |
| 398 | * ds^2 = - (N^2 - N_i N^i) dt^2 - 2 N_i \, dt\, dx^i |
| 399 | * + A^2 \, {\tilde h}_{ij} \, dx^i dx^j |
| 400 | * \f] |
| 401 | * where \f${\tilde h}_{ij}\f$ is a 3-metric, the exact form of which is specified |
| 402 | * in the derived classes of \c Etoile . The base class \c Etoile by |
| 403 | * itself provides only storage for the lapse function \e N (member \c nnn ), |
| 404 | * the shift vector \f$N^i\f$ (member \c shift ) and the conformal factor |
| 405 | * \f$A^2\f$ (member \c a_car ). |
| 406 | * |
| 407 | * The 3+1 formalism introduces two kinds of priviledged observers: the |
| 408 | * fluid comoving observer and the Eulerian observer, whose 4-velocity |
| 409 | * is the unit future directed normal to the \e t = const hypersurfaces. |
| 410 | * The hydrodynamical quantities measured by the fluid observer correspond |
| 411 | * to the members \c ent , \c nbar , \c ener , and \c press . |
| 412 | * The hydrodynamical quantities measured by the Eulerian observer correspond |
| 413 | * to the members \c ener_euler , \c s_euler , \c gam_euler , and |
| 414 | * \c u_euler . |
| 415 | * |
| 416 | * A star of class \c Etoile can be either relativistic or Newtonian, |
| 417 | * depending on the boolean indicator \c relativistic . For a Newtonian |
| 418 | * star, the metric coefficients \e N and \e A are set to 1, and \f$N^i\f$ is |
| 419 | * set to zero; the only relevant gravitational quantity in this case is |
| 420 | * \c logn_auto which represents the (regular part of) the |
| 421 | * Newtonian gravitational potential |
| 422 | * generated by the star. |
| 423 | */ |
| 424 | class Etoile { |
| 425 | |
| 426 | // Data : |
| 427 | // ----- |
| 428 | protected: |
| 429 | Map& mp ; ///< Mapping associated with the star |
| 430 | |
| 431 | /// Number of domains of \c *mp occupied by the star |
| 432 | int nzet ; |
| 433 | |
| 434 | /** Indicator of relativity: \c true for a relativistic star, |
| 435 | * \c false for a Newtonian one. |
| 436 | */ |
| 437 | bool relativistic ; |
| 438 | |
| 439 | /** \f$1/c^2\f$ : \c unsurc2=1 for a relativistic star, |
| 440 | * 0 for a Newtonian one. |
| 441 | */ |
| 442 | double unsurc2 ; |
| 443 | |
| 444 | /** Index of regularity of the gravitational potential \c logn_auto . |
| 445 | * If \c k_div=0 , \c logn_auto contains the total potential |
| 446 | * generated principaly by the star, otherwise it should be |
| 447 | * supplemented by \c logn_auto_div . |
| 448 | */ |
| 449 | int k_div ; |
| 450 | |
| 451 | const Eos& eos ; ///< Equation of state of the stellar matter |
| 452 | |
| 453 | // Fluid quantities with respect to the fluid frame |
| 454 | // ------------------------------------------------ |
| 455 | |
| 456 | /// Log-enthalpy (relativistic case) or specific enthalpy (Newtonian case) |
| 457 | Tenseur ent ; |
| 458 | |
| 459 | Tenseur nbar ; ///< Baryon density in the fluid frame |
| 460 | Tenseur ener ; ///< Total energy density in the fluid frame |
| 461 | Tenseur press ; ///< Fluid pressure |
| 462 | |
| 463 | // Fluid quantities with respect to the Eulerian frame |
| 464 | // --------------------------------------------------- |
| 465 | Tenseur ener_euler ; ///< Total energy density in the Eulerian frame |
| 466 | |
| 467 | /// Trace of the stress tensor in the Eulerian frame |
| 468 | Tenseur s_euler ; |
| 469 | |
| 470 | /// Lorentz factor between the fluid and Eulerian observers |
| 471 | Tenseur gam_euler ; |
| 472 | |
| 473 | /// Fluid 3-velocity with respect to the Eulerian observer |
| 474 | Tenseur u_euler ; |
| 475 | |
| 476 | // Metric potentials |
| 477 | // ----------------- |
| 478 | |
| 479 | /** Total of the logarithm of the part of the lapse \e N |
| 480 | * generated principaly by the star. In the Newtonian case, |
| 481 | * this is the Newtonian gravitational potential |
| 482 | * (in units of \f$c^2\f$). |
| 483 | */ |
| 484 | Tenseur logn_auto ; |
| 485 | |
| 486 | /** Regular part of the logarithm of the part of the lapse \e N |
| 487 | * generated principaly by the star. In the Newtonian case, |
| 488 | * this is the Newtonian gravitational potential |
| 489 | * (in units of \f$c^2\f$). |
| 490 | */ |
| 491 | Tenseur logn_auto_regu ; |
| 492 | |
| 493 | /** Divergent part (if \c k_div!=0 ) |
| 494 | * of the logarithm of the part of the lapse \e N |
| 495 | * generated principaly by the star. |
| 496 | */ |
| 497 | Tenseur logn_auto_div ; |
| 498 | |
| 499 | /** Gradient of \c logn_auto_div (if \c k_div!=0 ) |
| 500 | */ |
| 501 | Tenseur d_logn_auto_div ; |
| 502 | |
| 503 | /** Logarithm of the part of the product \e AN generated principaly by |
| 504 | * by the star |
| 505 | */ |
| 506 | Tenseur beta_auto ; |
| 507 | |
| 508 | /// Total lapse function |
| 509 | Tenseur nnn ; |
| 510 | |
| 511 | /// Total shift vector |
| 512 | Tenseur shift ; |
| 513 | |
| 514 | /// Total conformal factor \f$A^2\f$ |
| 515 | Tenseur a_car ; |
| 516 | |
| 517 | // Derived data : |
| 518 | // ------------ |
| 519 | protected: |
| 520 | /// Coordinate radius at \f$\phi=0\f$, \f$\theta=\pi/2\f$. |
| 521 | mutable double* p_ray_eq ; |
| 522 | |
| 523 | /// Coordinate radius at \f$\phi=\pi/2\f$, \f$\theta=\pi/2\f$. |
| 524 | mutable double* p_ray_eq_pis2 ; |
| 525 | |
| 526 | /// Coordinate radius at \f$\phi=\pi\f$, \f$\theta=\pi/2\f$. |
| 527 | mutable double* p_ray_eq_pi ; |
| 528 | |
| 529 | /// Coordinate radius at \f$\phi=3\pi/2\f$, \f$\theta=\pi/2\f$. |
| 530 | mutable double* p_ray_eq_3pis2 ; |
| 531 | |
| 532 | /// Coordinate radius at \f$\theta=0\f$. |
| 533 | mutable double* p_ray_pole ; |
| 534 | |
| 535 | /** Description of the stellar surface: 2-D \c Itbl containing the |
| 536 | * values of the domain index \e l on the surface at the |
| 537 | * collocation points in \f$(\theta', \phi')\f$ |
| 538 | */ |
| 539 | mutable Itbl* p_l_surf ; |
| 540 | |
| 541 | /** Description of the stellar surface: 2-D \c Tbl containing the |
| 542 | * values of the radial coordinate \f$\xi\f$ on the surface at the |
| 543 | * collocation points in \f$(\theta', \phi')\f$ |
| 544 | */ |
| 545 | mutable Tbl* p_xi_surf ; |
| 546 | |
| 547 | mutable double* p_mass_b ; ///< Baryon mass |
| 548 | mutable double* p_mass_g ; ///< Gravitational mass |
| 549 | |
| 550 | |
| 551 | // Constructors - Destructor |
| 552 | // ------------------------- |
| 553 | public: |
| 554 | |
| 555 | /** Standard constructor. |
| 556 | * |
| 557 | * @param mp_i Mapping on which the star will be defined |
| 558 | * @param nzet_i Number of domains occupied by the star |
| 559 | * @param relat should be \c true for a relativistic |
| 560 | * star, \c false for a Newtonian one |
| 561 | * @param eos_i Equation of state of the stellar matter |
| 562 | * |
| 563 | */ |
| 564 | Etoile(Map& mp_i, int nzet_i, bool relat, const Eos& eos_i) ; |
| 565 | |
| 566 | Etoile(const Etoile& ) ; ///< Copy constructor |
| 567 | |
| 568 | /** Constructor from a file (see \c sauve(FILE*) ). |
| 569 | * |
| 570 | * @param mp_i Mapping on which the star will be defined |
| 571 | * @param eos_i Equation of state of the stellar matter |
| 572 | * @param fich input file (must have been created by the function |
| 573 | * \c sauve ) |
| 574 | */ |
| 575 | Etoile(Map& mp_i, const Eos& eos_i, FILE* fich) ; |
| 576 | |
| 577 | virtual ~Etoile() ; ///< Destructor |
| 578 | |
| 579 | // Memory management |
| 580 | // ----------------- |
| 581 | protected: |
| 582 | /// Deletes all the derived quantities |
| 583 | virtual void del_deriv() const ; |
| 584 | |
| 585 | /// Sets to \c 0x0 all the pointers on derived quantities |
| 586 | virtual void set_der_0x0() const ; |
| 587 | |
| 588 | /** Sets to \c ETATNONDEF (undefined state) the hydrodynamical |
| 589 | * quantities relative to the Eulerian observer. |
| 590 | */ |
| 591 | virtual void del_hydro_euler() ; |
| 592 | |
| 593 | |
| 594 | // Mutators / assignment |
| 595 | // --------------------- |
| 596 | public: |
| 597 | /// Assignment to another \c Etoile |
| 598 | void operator=(const Etoile&) ; |
| 599 | |
| 600 | /// Read/write of the mapping |
| 601 | Map& set_mp() {return mp; } ; |
| 602 | |
| 603 | /// Assignment of the enthalpy field. |
| 604 | void set_enthalpy(const Cmp& ) ; |
| 605 | |
| 606 | /** Computes the proper baryon and energy density, as well as |
| 607 | * pressure from the enthalpy. |
| 608 | */ |
| 609 | virtual void equation_of_state() ; |
| 610 | |
| 611 | /** Computes the hydrodynamical quantities relative to the Eulerian |
| 612 | * observer from those in the fluid frame (\c nbar , \c ener |
| 613 | * and \c press ). |
| 614 | */ |
| 615 | virtual void hydro_euler() ; |
| 616 | |
| 617 | /** Computes a spherical static configuration. |
| 618 | * |
| 619 | * @param ent_c [input] central value of the enthalpy |
| 620 | * @param precis [input] threshold in the relative difference between |
| 621 | * the enthalpy fields of two consecutive steps |
| 622 | * to stop the iterative procedure |
| 623 | * (default value: 1.e-14) |
| 624 | * @param ent_limit [input] : array of enthalpy values to be set at the |
| 625 | * boundaries between |
| 626 | * the domains; if set to 0x0 (default), the |
| 627 | * initial values will be kept. |
| 628 | */ |
| 629 | virtual void equilibrium_spher(double ent_c, double precis = 1.e-14, |
| 630 | const Tbl* ent_limit = 0x0 ) ; |
| 631 | |
| 632 | /** Computes a spherical static configuration. |
| 633 | * The sources for Poisson equations are regularized |
| 634 | * by extracting analytical diverging parts. |
| 635 | * |
| 636 | * @param ent_c [input] central value of the enthalpy |
| 637 | * @param precis [input] threshold in the relative difference between |
| 638 | * the enthalpy fields of two consecutive steps |
| 639 | * to stop the iterative procedure |
| 640 | * (default value: 1.e-14) |
| 641 | */ |
| 642 | void equil_spher_regular(double ent_c, double precis = 1.e-14) ; |
| 643 | |
| 644 | /** Computes a spherical static configuration with the outer |
| 645 | * boundary condition at a finite radius |
| 646 | * |
| 647 | * @param ent_c [input] central value of the enthalpy |
| 648 | * @param precis [input] threshold in the relative difference between |
| 649 | * the enthalpy fields of two consecutive steps |
| 650 | * to stop the iterative procedure (default value: 1.e-14) |
| 651 | */ |
| 652 | virtual void equil_spher_falloff(double ent_c, |
| 653 | double precis = 1.e-14) ; |
| 654 | |
| 655 | // Accessors |
| 656 | // --------- |
| 657 | public: |
| 658 | /// Returns the mapping |
| 659 | const Map& get_mp() const {return mp; } ; |
| 660 | |
| 661 | /// Returns the number of domains occupied by the star |
| 662 | int get_nzet() const {return nzet; } ; |
| 663 | |
| 664 | /** Returns \c true for a relativistic star, \c false for |
| 665 | * a Newtonian one |
| 666 | */ |
| 667 | bool is_relativistic() const {return relativistic; } ; |
| 668 | |
| 669 | /// Returns the equation of state |
| 670 | const Eos& get_eos() const {return eos; } ; |
| 671 | |
| 672 | /// Returns the enthalpy field |
| 673 | const Tenseur& get_ent() const {return ent;} ; |
| 674 | |
| 675 | /// Returns the proper baryon density |
| 676 | const Tenseur& get_nbar() const {return nbar;} ; |
| 677 | |
| 678 | /// Returns the proper total energy density |
| 679 | const Tenseur& get_ener() const {return ener;} ; |
| 680 | |
| 681 | /// Returns the fluid pressure |
| 682 | const Tenseur& get_press() const {return press;} ; |
| 683 | |
| 684 | /// Returns the total energy density with respect to the Eulerian observer |
| 685 | const Tenseur& get_ener_euler() const {return ener_euler;} ; |
| 686 | |
| 687 | /// Returns the trace of the stress tensor in the Eulerian frame |
| 688 | const Tenseur& get_s_euler() const {return s_euler;} ; |
| 689 | |
| 690 | /// Returns the Lorentz factor between the fluid and Eulerian observers |
| 691 | const Tenseur& get_gam_euler() const {return gam_euler;} ; |
| 692 | |
| 693 | /// Returns the fluid 3-velocity with respect to the Eulerian observer |
| 694 | const Tenseur& get_u_euler() const {return u_euler;} ; |
| 695 | |
| 696 | /** Returns the logarithm of the part of the lapse \e N generated |
| 697 | * principaly by the star. |
| 698 | * In the Newtonian case, this is the Newtonian |
| 699 | * gravitational potential (in units of \f$c^2\f$). |
| 700 | */ |
| 701 | const Tenseur& get_logn_auto() const {return logn_auto;} ; |
| 702 | |
| 703 | /** Returns the regular part of the logarithm of the part of |
| 704 | * the lapse \e N generated principaly by the star. |
| 705 | * In the Newtonian case, this is the Newtonian |
| 706 | * gravitational potential (in units of \f$c^2\f$). |
| 707 | */ |
| 708 | const Tenseur& get_logn_auto_regu() const {return logn_auto_regu;} ; |
| 709 | |
| 710 | /** Returns the divergent part of the logarithm of the part of |
| 711 | * the lapse \e N generated principaly by the star. |
| 712 | * In the Newtonian case, this is the diverging part of |
| 713 | * the Newtonian gravitational potential (in units of \f$c^2\f$). |
| 714 | */ |
| 715 | const Tenseur& get_logn_auto_div() const {return logn_auto_div;} ; |
| 716 | |
| 717 | /** Returns the gradient of \c logn_auto_div |
| 718 | */ |
| 719 | const Tenseur& get_d_logn_auto_div() const {return d_logn_auto_div;} ; |
| 720 | |
| 721 | /** Returns the logarithm of the part of the product \e AN generated |
| 722 | * principaly by the star. |
| 723 | */ |
| 724 | const Tenseur& get_beta_auto() const {return beta_auto;} ; |
| 725 | |
| 726 | /// Returns the total lapse function \e N |
| 727 | const Tenseur& get_nnn() const {return nnn;} ; |
| 728 | |
| 729 | /// Returns the total shift vector \f$N^i\f$ |
| 730 | const Tenseur& get_shift() const {return shift;} ; |
| 731 | |
| 732 | /// Returns the total conformal factor \f$A^2\f$ |
| 733 | const Tenseur& get_a_car() const {return a_car;} ; |
| 734 | |
| 735 | // Outputs |
| 736 | // ------- |
| 737 | public: |
| 738 | virtual void sauve(FILE* ) const ; ///< Save in a file |
| 739 | |
| 740 | /// Display |
| 741 | friend ostream& operator<<(ostream& , const Etoile& ) ; |
| 742 | |
| 743 | protected: |
| 744 | /// Operator >> (virtual function called by the operator <<). |
| 745 | virtual ostream& operator>>(ostream& ) const ; |
| 746 | |
| 747 | // Global quantities |
| 748 | // ----------------- |
| 749 | public: |
| 750 | /// Coordinate radius at \f$\phi=0\f$, \f$\theta=\pi/2\f$ [r_unit]. |
| 751 | double ray_eq() const ; |
| 752 | |
| 753 | /// Coordinate radius at \f$\phi=\pi/2\f$, \f$\theta=\pi/2\f$ [r_unit]. |
| 754 | double ray_eq_pis2() const ; |
| 755 | |
| 756 | /// Coordinate radius at \f$\phi=\pi\f$, \f$\theta=\pi/2\f$ [r_unit]. |
| 757 | double ray_eq_pi() const ; |
| 758 | |
| 759 | /// Coordinate radius at \f$\phi=3\pi/2\f$, \f$\theta=\pi/2\f$ [r_unit]. |
| 760 | double ray_eq_3pis2() const ; |
| 761 | |
| 762 | /// Coordinate radius at \f$\theta=0\f$ [r_unit]. |
| 763 | double ray_pole() const ; |
| 764 | |
| 765 | /// Coordinate radius at \f$\phi=2k\pi/np\f$, \f$\theta=\pi/2\f$ [r_unit]. |
| 766 | double ray_eq(int kk) const ; |
| 767 | |
| 768 | /** Description of the stellar surface: returns a 2-D \c Itbl |
| 769 | * containing the |
| 770 | * values of the domain index \e l on the surface at the |
| 771 | * collocation points in \f$(\theta', \phi')\f$. |
| 772 | * The stellar surface is defined as the location where |
| 773 | * the enthalpy (member \c ent ) vanishes. |
| 774 | */ |
| 775 | virtual const Itbl& l_surf() const ; |
| 776 | |
| 777 | /** Description of the stellar surface: returns a 2-D \c Tbl |
| 778 | * containing the values of the radial coordinate \f$\xi\f$ |
| 779 | * on the surface at the |
| 780 | * collocation points in \f$(\theta', \phi')\f$. |
| 781 | * The stellar surface is defined as the location where |
| 782 | * the enthalpy (member \c ent ) vanishes. |
| 783 | */ |
| 784 | const Tbl& xi_surf() const ; |
| 785 | |
| 786 | /// Baryon mass |
| 787 | virtual double mass_b() const ; |
| 788 | |
| 789 | /// Gravitational mass |
| 790 | virtual double mass_g() const ; |
| 791 | |
| 792 | }; |
| 793 | ostream& operator<<(ostream& , const Etoile& ) ; |
| 794 | |
| 795 | |
| 796 | //---------------------------// |
| 797 | // class Etoile_bin // |
| 798 | //---------------------------// |
| 799 | |
| 800 | /** |
| 801 | * Class for stars in binary system. \ingroup (star) |
| 802 | * |
| 803 | * This class implements the formalism for corotating or irrotational |
| 804 | * systems presented in Bonazzola, Gourgoulhon \& Marck \a Phys. \a Rev. \a Lett. |
| 805 | * \b 82 , 892 (1999). In particular, the conformal 3-metric |
| 806 | * \f$\tilde h_{ij}\f$ introduced in Eq.~(\ref{eetoilemetrique}) is flat. |
| 807 | * |
| 808 | * An \c Etoile_bin can be construted in two states, represented by |
| 809 | * the \c bool member \c irrotational : (i) irrotational |
| 810 | * (i.e. the fluid motion is irrotational) or (ii) rigidly corotating |
| 811 | * with respect to the orbital motion (synchronized binary). |
| 812 | * |
| 813 | */ |
| 814 | class Etoile_bin : public Etoile { |
| 815 | |
| 816 | // Data : |
| 817 | // ----- |
| 818 | protected: |
| 819 | /** \c true for an irrotational star, \c false for a |
| 820 | * corotating one |
| 821 | */ |
| 822 | bool irrotational ; |
| 823 | |
| 824 | /** Reference triad ("absolute frame"), with |
| 825 | * respect to which the components of all the member \c Tenseur 's |
| 826 | * are defined, except for \c w_shift and \c ssjm1_wshift . |
| 827 | */ |
| 828 | const Base_vect& ref_triad ; |
| 829 | |
| 830 | /** Scalar potential \f$\Psi_0\f$ of the non-translational part of |
| 831 | * fluid 4-velocity (in the irrotational case) |
| 832 | */ |
| 833 | Tenseur psi0 ; |
| 834 | |
| 835 | /** Gradient of \f$\Psi\f$ (in the irrotational case) |
| 836 | * (Cartesian components with respect to \c ref_triad ) |
| 837 | */ |
| 838 | Tenseur d_psi ; |
| 839 | |
| 840 | /** Spatial projection of the fluid 3-velocity with respect to |
| 841 | * the co-orbiting observer. |
| 842 | * (Cartesian components with respect to \c ref_triad ) |
| 843 | */ |
| 844 | Tenseur wit_w ; |
| 845 | |
| 846 | /** Logarithm of the Lorentz factor between the fluid and |
| 847 | * the co-orbiting observer. |
| 848 | */ |
| 849 | Tenseur loggam ; |
| 850 | |
| 851 | /** Part of the lapse logarithm (gravitational potential at the |
| 852 | * Newtonian limit) generated principaly by the companion star. |
| 853 | */ |
| 854 | Tenseur logn_comp ; |
| 855 | |
| 856 | /** Gradient of \c logn_auto |
| 857 | * (Cartesian components with respect to \c ref_triad ) |
| 858 | */ |
| 859 | Tenseur d_logn_auto ; |
| 860 | |
| 861 | /** Gradient of \c logn_auto_regu |
| 862 | * (Cartesian components with respect to \c ref_triad ) |
| 863 | */ |
| 864 | Tenseur d_logn_auto_regu ; |
| 865 | |
| 866 | /** Gradient of \c logn_comp |
| 867 | * (Cartesian components with respect to \c ref_triad ) |
| 868 | */ |
| 869 | Tenseur d_logn_comp ; |
| 870 | |
| 871 | /** Part of the logarithm of \e AN generated principaly by the |
| 872 | * companion star. |
| 873 | */ |
| 874 | Tenseur beta_comp ; |
| 875 | |
| 876 | /** Gradient of \c beta_auto |
| 877 | * (Cartesian components with respect to \c ref_triad ) |
| 878 | */ |
| 879 | Tenseur d_beta_auto ; |
| 880 | |
| 881 | /** Gradient of \c beta_comp |
| 882 | * (Cartesian components with respect to \c ref_triad ) |
| 883 | */ |
| 884 | Tenseur d_beta_comp ; |
| 885 | |
| 886 | /** Part of the shift vector \f$N^i\f$ generated principaly by the star. |
| 887 | * (Cartesian components with respect to \c ref_triad ) |
| 888 | */ |
| 889 | Tenseur shift_auto ; |
| 890 | |
| 891 | /** Part of the shift vector \f$N^i\f$ generated principaly by the |
| 892 | * companion star. |
| 893 | * (Cartesian components with respect to \c ref_triad ) |
| 894 | */ |
| 895 | Tenseur shift_comp ; |
| 896 | |
| 897 | /** Vector \f$W^i\f$ used in the decomposition of \c shift_auto , |
| 898 | * following Shibata's prescription |
| 899 | * [\a Prog. \a Theor. \a Phys. \b 101, 1199 (1999)] : |
| 900 | * \f[ |
| 901 | * N^i = {7\over 8} W^i - {1\over 8} |
| 902 | * \left(\nabla^i\chi+\nabla^iW^kx_k\right) |
| 903 | * \f] |
| 904 | * NB: \c w_shift contains the components of \f$W^i\f$ |
| 905 | * with respect to the Cartesian triad associated with the |
| 906 | * mapping \c mp . |
| 907 | */ |
| 908 | Tenseur w_shift ; |
| 909 | |
| 910 | /** Scalar \f$\chi\f$ used in the decomposition of \c shift_auto , |
| 911 | * following Shibata's prescription |
| 912 | * [\a Prog. \a Theor. \a Phys. \b 101 , 1199 (1999)] : |
| 913 | * \f[ |
| 914 | * N^i = {7\over 8} W^i - {1\over 8} |
| 915 | * \left(\nabla^i\chi+\nabla^iW^kx_k\right) |
| 916 | * \f] |
| 917 | */ |
| 918 | Tenseur khi_shift ; |
| 919 | |
| 920 | /** Part of the extrinsic curvature tensor |
| 921 | * \f$\tilde K^{ij} = A^2 K^{ij}\f$ |
| 922 | * generated by \c shift_auto . |
| 923 | * (Cartesian components with respect to \c ref_triad ) |
| 924 | */ |
| 925 | Tenseur_sym tkij_auto ; |
| 926 | |
| 927 | /** Part of the extrinsic curvature tensor |
| 928 | * \f$\tilde K^{ij} = A^2 K^{ij}\f$ |
| 929 | * generated by \c shift_comp . |
| 930 | * (Cartesian components with respect to \c ref_triad ) |
| 931 | */ |
| 932 | Tenseur_sym tkij_comp ; |
| 933 | |
| 934 | /** Part of the scalar \f$A^2 K_{ij} K^{ij}\f$ |
| 935 | * generated by \c shift_auto , i.e. |
| 936 | * \f$A^2 K_{ij}^{\rm auto} K^{ij}_{\rm auto}\f$ |
| 937 | */ |
| 938 | Tenseur akcar_auto ; |
| 939 | |
| 940 | /** Part of the scalar \f$A^2 K_{ij} K^{ij}\f$ |
| 941 | * generated by \c shift_auto and \c shift_comp , i.e. |
| 942 | * \f$A^2 K_{ij}^{\rm auto} K^{ij}_{\rm comp}\f$ |
| 943 | */ |
| 944 | Tenseur akcar_comp ; |
| 945 | |
| 946 | /** 3-vector shift, divided by \e N , of the rotating coordinates, |
| 947 | * \f$B^i/N\f$. |
| 948 | * (Cartesian components with respect to \c ref_triad ) |
| 949 | */ |
| 950 | Tenseur bsn ; |
| 951 | |
| 952 | /// Centrifugal potential |
| 953 | Tenseur pot_centri ; |
| 954 | |
| 955 | /** Effective source at the previous step for the resolution of |
| 956 | * the Poisson equation for \c logn_auto by means of |
| 957 | * \c Map_et::poisson . |
| 958 | */ |
| 959 | Cmp ssjm1_logn ; |
| 960 | |
| 961 | /** Effective source at the previous step for the resolution of |
| 962 | * the Poisson equation for \c beta_auto by means of |
| 963 | * \c Map_et::poisson . |
| 964 | */ |
| 965 | Cmp ssjm1_beta ; |
| 966 | |
| 967 | /** Effective source at the previous step for the resolution of |
| 968 | * the Poisson equation for the scalar \f$\chi\f$ by means of |
| 969 | * \c Map_et::poisson . |
| 970 | * \f$\chi\f$ is an intermediate quantity for the resolution of the |
| 971 | * elliptic equation for the shift vector \f$N^i\f$ |
| 972 | */ |
| 973 | Cmp ssjm1_khi ; |
| 974 | |
| 975 | /** Effective source at the previous step for the resolution of |
| 976 | * the vector Poisson equation for \f$W^i\f$ by means of |
| 977 | * \c Map_et::poisson . |
| 978 | * \f$W^i\f$ is an intermediate quantity for the resolution of the |
| 979 | * elliptic equation for the shift vector \f$N^i\f$ |
| 980 | * (Components with respect to the Cartesian triad associated with |
| 981 | * the mapping \c mp ) |
| 982 | */ |
| 983 | Tenseur ssjm1_wshift ; |
| 984 | |
| 985 | /** Effective source at the previous step for the resolution of |
| 986 | * the Poisson equation for the scalar \f$\psi\f$ by means of |
| 987 | * \c Map_et::poisson_interne . |
| 988 | */ |
| 989 | Cmp ssjm1_psi ; |
| 990 | |
| 991 | /** |
| 992 | * Function used to construct the part of \f$K^{ij}\f$ generated by |
| 993 | * the star from the total \f$K^{ij}\f$. Only used for a binary system |
| 994 | * where the other member is a black hole. |
| 995 | * |
| 996 | * Mainly this \c Cmp is 1 around the hole and 0 around the companion |
| 997 | * and the sum of \c decouple for the hole and his companion is 1 |
| 998 | * everywhere. |
| 999 | */ |
| 1000 | Cmp decouple ; |
| 1001 | |
| 1002 | // Derived data : |
| 1003 | // ------------ |
| 1004 | protected: |
| 1005 | /// Absolute coordinate X of the barycenter of the baryon density |
| 1006 | mutable double* p_xa_barycenter ; |
| 1007 | |
| 1008 | |
| 1009 | // Constructors - Destructor |
| 1010 | // ------------------------- |
| 1011 | public: |
| 1012 | /** Standard constructor. |
| 1013 | * |
| 1014 | * @param mp_i Mapping on which the star will be defined |
| 1015 | * @param nzet_i Number of domains occupied by the star |
| 1016 | * @param relat should be \c true for a relativistic |
| 1017 | * star, \c false for a Newtonian one |
| 1018 | * @param eos_i Equation of state of the stellar matter |
| 1019 | * @param irrot should be \c true for an irrotational star, |
| 1020 | * \c false for a corotating one |
| 1021 | * @param ref_triad_i Reference triad ("absolute frame"), with |
| 1022 | * respect to which the components of all the member |
| 1023 | * \c Tenseur 's are defined, except for \c w_shift |
| 1024 | * and \c ssjm1_wshift whose components are defined |
| 1025 | * with respect to the mapping \c mp Cartesian triad. |
| 1026 | */ |
| 1027 | Etoile_bin(Map& mp_i, int nzet_i, bool relat, const Eos& eos_i, |
| 1028 | bool irrot, const Base_vect& ref_triad_i) ; |
| 1029 | |
| 1030 | |
| 1031 | Etoile_bin(const Etoile_bin& ) ; ///< Copy constructor |
| 1032 | |
| 1033 | /** Constructor from a file (see \c sauve(FILE*) ). |
| 1034 | * |
| 1035 | * @param mp_i Mapping on which the star will be defined |
| 1036 | * @param eos_i Equation of state of the stellar matter |
| 1037 | * @param ref_triad_i Reference triad ("absolute frame"), with |
| 1038 | * respect to which the components of all the member |
| 1039 | * \c Tenseur 's are defined, except for \c w_shift |
| 1040 | * and \c ssjm1_wshift whose components are defined |
| 1041 | * with respect to the mapping \c mp Cartesian triad. |
| 1042 | * @param fich input file (must have been created by the function |
| 1043 | * \c sauve ) |
| 1044 | */ |
| 1045 | Etoile_bin(Map& mp_i, const Eos& eos_i, const Base_vect& ref_triad_i, |
| 1046 | FILE* fich) ; |
| 1047 | |
| 1048 | virtual ~Etoile_bin() ; ///< Destructor |
| 1049 | |
| 1050 | |
| 1051 | // Memory management |
| 1052 | // ----------------- |
| 1053 | protected: |
| 1054 | /// Deletes all the derived quantities |
| 1055 | virtual void del_deriv() const ; |
| 1056 | |
| 1057 | /// Sets to \c 0x0 all the pointers on derived quantities |
| 1058 | virtual void set_der_0x0() const ; |
| 1059 | |
| 1060 | /** Sets to \c ETATNONDEF (undefined state) the hydrodynamical |
| 1061 | * quantities relative to the Eulerian observer. |
| 1062 | */ |
| 1063 | virtual void del_hydro_euler() ; |
| 1064 | |
| 1065 | |
| 1066 | // Mutators / assignment |
| 1067 | // --------------------- |
| 1068 | public: |
| 1069 | /// Assignment to another \c Etoile_bin |
| 1070 | void operator=(const Etoile_bin& ) ; |
| 1071 | |
| 1072 | /** Read/write the part of the lapse logarithm (gravitational potential |
| 1073 | * at the Newtonian limit) generated principaly by the companion star. |
| 1074 | */ |
| 1075 | Tenseur& set_logn_comp() ; |
| 1076 | |
| 1077 | /// Read/write the centrifugal potential |
| 1078 | Tenseur& set_pot_centri() ; |
| 1079 | |
| 1080 | /// Read/write of \c w_shift |
| 1081 | Tenseur& set_w_shift() ; |
| 1082 | |
| 1083 | /// Read/write of \c khi_shift |
| 1084 | Tenseur& set_khi_shift() ; |
| 1085 | |
| 1086 | // Accessors |
| 1087 | // --------- |
| 1088 | public: |
| 1089 | /** Returns \c true for an irrotational motion, \c false for |
| 1090 | * a corotating one. |
| 1091 | */ |
| 1092 | bool is_irrotational() const {return irrotational; } ; |
| 1093 | |
| 1094 | /// Returns the non-translational part of the velocity potential |
| 1095 | const Tenseur& get_psi0() const {return psi0;} ; |
| 1096 | |
| 1097 | /** Returns the gradient of the velocity potential |
| 1098 | * (Cartesian components with respect to \c ref_triad ) |
| 1099 | */ |
| 1100 | const Tenseur& get_d_psi() const {return d_psi;} ; |
| 1101 | |
| 1102 | /** Returns the spatial projection of the fluid 3-velocity with |
| 1103 | * respect to the co-orbiting observer. |
| 1104 | * (Cartesian components with respect to \c ref_triad ) |
| 1105 | */ |
| 1106 | const Tenseur& get_wit_w() const {return wit_w;} ; |
| 1107 | |
| 1108 | /** Returns the logarithm of the Lorentz factor between the fluid and |
| 1109 | * the co-orbiting observer. |
| 1110 | */ |
| 1111 | const Tenseur& get_loggam() const {return loggam;} ; |
| 1112 | |
| 1113 | /** Returns the part of the lapse logarithm (gravitational potential |
| 1114 | * at the Newtonian limit) generated principaly by the companion star. |
| 1115 | */ |
| 1116 | const Tenseur& get_logn_comp() const {return logn_comp;} ; |
| 1117 | |
| 1118 | /** Returns the gradient of \c logn_auto |
| 1119 | * (Cartesian components with respect to \c ref_triad ) |
| 1120 | */ |
| 1121 | const Tenseur& get_d_logn_auto() const {return d_logn_auto;} ; |
| 1122 | |
| 1123 | /** Returns the gradient of \c logn_auto_regu |
| 1124 | * (Cartesian components with respect to \c ref_triad ) |
| 1125 | */ |
| 1126 | const Tenseur& get_d_logn_auto_regu() const {return d_logn_auto_regu;} ; |
| 1127 | |
| 1128 | /** Returns the gradient of \c logn_comp |
| 1129 | * (Cartesian components with respect to \c ref_triad ) |
| 1130 | */ |
| 1131 | const Tenseur& get_d_logn_comp() const {return d_logn_comp;} ; |
| 1132 | |
| 1133 | /** Returns the part of the logarithm of \e AN generated principaly |
| 1134 | * by the companion star. |
| 1135 | */ |
| 1136 | const Tenseur& get_beta_comp() const {return beta_comp;} ; |
| 1137 | |
| 1138 | /** Returns the gradient of \c beta_auto |
| 1139 | * (Cartesian components with respect to \c ref_triad ) |
| 1140 | */ |
| 1141 | const Tenseur& get_d_beta_auto() const {return d_beta_auto;} ; |
| 1142 | |
| 1143 | /** Returns the gradient of \c beta_comp |
| 1144 | * (Cartesian components with respect to \c ref_triad ) |
| 1145 | */ |
| 1146 | const Tenseur& get_d_beta_comp() const {return d_beta_comp;} ; |
| 1147 | |
| 1148 | /** Returns the part of the shift vector \f$N^i\f$ generated principaly |
| 1149 | * by the star. |
| 1150 | * (Cartesian components with respect to \c ref_triad ) |
| 1151 | */ |
| 1152 | const Tenseur& get_shift_auto() const {return shift_auto;} ; |
| 1153 | |
| 1154 | /** Returns the part of the shift vector \f$N^i\f$ generated principaly |
| 1155 | * by the companion star. |
| 1156 | * (Cartesian components with respect to \c ref_triad ) |
| 1157 | */ |
| 1158 | const Tenseur& get_shift_comp() const {return shift_comp;} ; |
| 1159 | |
| 1160 | /** Returns the vector \f$W^i\f$ used in the decomposition of |
| 1161 | * \c shift_auto , |
| 1162 | * following Shibata's prescription |
| 1163 | * [\a Prog. \a Theor. \a Phys. \b 101 , 1199 (1999)] : |
| 1164 | * \f[ |
| 1165 | * N^i = {7\over 8} W^i - {1\over 8} |
| 1166 | * \left(\nabla^i\chi+\nabla^iW^kx_k\right) |
| 1167 | * \f] |
| 1168 | * NB: \c w_shift contains the components of \f$W^i\f$ |
| 1169 | * with respect to the Cartesian triad associated with the |
| 1170 | * mapping \c mp . |
| 1171 | */ |
| 1172 | const Tenseur& get_w_shift() const {return w_shift;} ; |
| 1173 | |
| 1174 | /** Returns the scalar \f$\chi\f$ used in the decomposition of |
| 1175 | * \c shift_auto |
| 1176 | * following Shibata's prescription |
| 1177 | * [\a Prog. \a Theor. \a Phys. \b 101 , 1199 (1999)] : |
| 1178 | * \f[ |
| 1179 | * N^i = {7\over 8} W^i - {1\over 8} |
| 1180 | * \left(\nabla^i\chi+\nabla^iW^kx_k\right) |
| 1181 | * \f] |
| 1182 | * NB: \c w_shift contains the components of \f$W^i\f$ |
| 1183 | * with respect to the Cartesian triad associated with the |
| 1184 | * mapping \c mp . |
| 1185 | */ |
| 1186 | const Tenseur& get_khi_shift() const {return khi_shift;} ; |
| 1187 | |
| 1188 | /** Returns the part of the extrinsic curvature tensor |
| 1189 | * \f$\tilde K^{ij} = A^2 K^{ij}\f$ generated by \c shift_auto . |
| 1190 | * (Cartesian components with respect to \c ref_triad ) |
| 1191 | */ |
| 1192 | const Tenseur_sym& get_tkij_auto() const {return tkij_auto;} ; |
| 1193 | |
| 1194 | /** Returns the part of the extrinsic curvature tensor |
| 1195 | * \f$\tilde K^{ij} = A^2 K^{ij}\f$ generated by \c shift_comp . |
| 1196 | * (Cartesian components with respect to \c ref_triad ) |
| 1197 | */ |
| 1198 | const Tenseur_sym& get_tkij_comp() const {return tkij_comp;} ; |
| 1199 | |
| 1200 | /** Returns the part of the scalar \f$A^2 K_{ij} K^{ij}\f$ |
| 1201 | * generated by \c shift_auto , i.e. |
| 1202 | * \f$A^2 K_{ij}^{\rm auto} K^{ij}_{\rm auto}\f$ |
| 1203 | */ |
| 1204 | const Tenseur& get_akcar_auto() const {return akcar_auto;} ; |
| 1205 | |
| 1206 | /** Returns the part of the scalar \f$A^2 K_{ij} K^{ij}\f$ |
| 1207 | * generated by \c shift_auto and \c shift_comp , i.e. |
| 1208 | * \f$A^2 K_{ij}^{\rm auto} K^{ij}_{\rm comp} \f$ |
| 1209 | */ |
| 1210 | const Tenseur& get_akcar_comp() const {return akcar_comp;} ; |
| 1211 | |
| 1212 | /** Returns the shift vector, divided by \e N , of the rotating |
| 1213 | * coordinates, \f$B^i/N\f$. |
| 1214 | * (Cartesian components with respect to \c ref_triad ) |
| 1215 | */ |
| 1216 | const Tenseur& get_bsn() const {return bsn;} ; |
| 1217 | |
| 1218 | /// Returns the centrifugal potential |
| 1219 | const Tenseur& get_pot_centri() const {return pot_centri;} ; |
| 1220 | /** |
| 1221 | * Returns the function used to construct \c tkij_auto |
| 1222 | from \c tkij_tot . |
| 1223 | */ |
| 1224 | const Cmp get_decouple() const {return decouple ;} |
| 1225 | |
| 1226 | // Outputs |
| 1227 | // ------- |
| 1228 | public: |
| 1229 | virtual void sauve(FILE* ) const ; ///< Save in a file |
| 1230 | |
| 1231 | protected: |
| 1232 | /// Operator >> (virtual function called by the operator <<). |
| 1233 | virtual ostream& operator>>(ostream& ) const ; |
| 1234 | |
| 1235 | // Global quantities |
| 1236 | // ----------------- |
| 1237 | public: |
| 1238 | /// Baryon mass |
| 1239 | virtual double mass_b() const ; |
| 1240 | |
| 1241 | /// Gravitational mass |
| 1242 | virtual double mass_g() const ; |
| 1243 | |
| 1244 | /** Absolute coordinate X of the barycenter of the baryon density, |
| 1245 | * defined according to the formula |
| 1246 | * \f[ |
| 1247 | * X_G := \int A^3 \Gamma_{\rm n} \, n \, X \, d^3x \ , |
| 1248 | * \f] |
| 1249 | * where \f$\Gamma_{\rm n}\f$ is the Lorentz factor between the fluid |
| 1250 | * and Eulerian observers. |
| 1251 | */ |
| 1252 | virtual double xa_barycenter() const ; |
| 1253 | |
| 1254 | |
| 1255 | // Computational routines |
| 1256 | // ---------------------- |
| 1257 | public: |
| 1258 | /** Performs the scalar product of two tensors by contracting |
| 1259 | * the last index of \c t1 with the first index of \c t2 . |
| 1260 | * Both indices are supposed to be contravariant, so that a |
| 1261 | * multiplication by \f$A^2\f$ is performed to lower one index. |
| 1262 | * For instance, for two vectors \f$V^i\f$ and \f$W^i\f$, this function |
| 1263 | * returns the scalar \f$h_{ij} V^i W^j = A^2 f_{ij} V^i W^j\f$. |
| 1264 | */ |
| 1265 | virtual Tenseur sprod(const Tenseur& t1, const Tenseur& t2) const ; |
| 1266 | |
| 1267 | /** Computes the hydrodynamical quantities relative to the Eulerian |
| 1268 | * observer from those in the fluid frame, as well as |
| 1269 | * \c wit_w and \c loggam . |
| 1270 | * |
| 1271 | * The calculation is performed starting from the quantities |
| 1272 | * \c ent , \c ener , \c press , \c a_car and \c bsn , |
| 1273 | * which are supposed to be up to date. |
| 1274 | * From these, the following fields are updated: |
| 1275 | * \c gam_euler , \c u_euler , \c ener_euler , \c s_euler , |
| 1276 | * \c wit_w and \c loggam . |
| 1277 | * |
| 1278 | */ |
| 1279 | virtual void hydro_euler() ; |
| 1280 | |
| 1281 | /** Computes metric coefficients from known potentials, |
| 1282 | * when the companion is another star. |
| 1283 | * |
| 1284 | * The calculation is performed starting from the quantities |
| 1285 | * \c logn_auto , \c beta_auto , \c shift_auto , |
| 1286 | * \c comp.logn_auto , \c comp.beta_auto , |
| 1287 | * \c comp.shift_auto |
| 1288 | * which are supposed to be up to date. |
| 1289 | * From these, the following fields are updated: |
| 1290 | * \c logn_comp , \c beta_comp , \c shift_comp , |
| 1291 | * \c nnn , \c a_car , \c shift , |
| 1292 | * \c d_logn_auto , \c d_beta_auto , \c tkij_auto , |
| 1293 | * \c akcar_auto . |
| 1294 | * |
| 1295 | * @param comp companion star. |
| 1296 | * |
| 1297 | */ |
| 1298 | void update_metric(const Etoile_bin& comp) ; |
| 1299 | |
| 1300 | /** Same as \c update_metric(const Etoile_bin\& \c ) but with |
| 1301 | * relaxation. |
| 1302 | * |
| 1303 | * @param comp companion star. |
| 1304 | * @param star_prev previous value of the star. |
| 1305 | * @param relax relaxation parameter. |
| 1306 | */ |
| 1307 | void update_metric(const Etoile_bin& comp, const Etoile_bin& star_prev, |
| 1308 | double relax) ; |
| 1309 | |
| 1310 | /** Computes the derivative of metric functions related to the |
| 1311 | * companion star. |
| 1312 | * |
| 1313 | * The calculation is performed starting from the quantities |
| 1314 | * \c comp.d_logn_auto , \c comp.d_beta_auto , |
| 1315 | * \c comp.tkij_auto |
| 1316 | * which are supposed to be up to date. |
| 1317 | * From these, the following fields are updated: |
| 1318 | * \c d_logn_comp , \c d_beta_comp , \c tkij_comp , |
| 1319 | * \c akcar_comp . |
| 1320 | * |
| 1321 | * @param comp companion star. |
| 1322 | * |
| 1323 | */ |
| 1324 | void update_metric_der_comp(const Etoile_bin& comp) ; |
| 1325 | |
| 1326 | /** Computes the quantities \c bsn and \c pot_centri . |
| 1327 | * |
| 1328 | * The calculation is performed starting from the quantities |
| 1329 | * \c nnn , \c shift , \c a_car , |
| 1330 | * which are supposed to be up to date. |
| 1331 | * |
| 1332 | * @param omega angular velocity with respect to an asymptotically |
| 1333 | * inertial observer |
| 1334 | * @param x_axe absolute X coordinate of the rotation axis |
| 1335 | */ |
| 1336 | virtual void kinematics(double omega, double x_axe) ; |
| 1337 | |
| 1338 | /** Computes the gradient of the total velocity potential \f$\psi\f$. |
| 1339 | * |
| 1340 | */ |
| 1341 | void fait_d_psi() ; |
| 1342 | |
| 1343 | /** Computes \c shift_auto from \c w_shift and \c khi_shift |
| 1344 | * according to Shibata's prescription |
| 1345 | * [\a Prog. \a Theor. \a Phys. \b 101 , 1199 (1999)] : |
| 1346 | * \f[ |
| 1347 | * N^i = {7\over 8} W^i - {1\over 8} |
| 1348 | * \left(\nabla^i\chi+\nabla^iW^kx_k\right) |
| 1349 | * \f] |
| 1350 | */ |
| 1351 | void fait_shift_auto() ; |
| 1352 | |
| 1353 | /** Computes \c tkij_auto and \c akcar_auto from |
| 1354 | * \c shift_auto , \c nnn and \c a_car . |
| 1355 | */ |
| 1356 | virtual void extrinsic_curvature() ; |
| 1357 | |
| 1358 | /** Computes an equilibrium configuration. |
| 1359 | * |
| 1360 | * The values of \c logn_comp , \c beta_comp , \c pot_centri |
| 1361 | * are held fixed during the iteration. |
| 1362 | * |
| 1363 | * @param ent_c [input] Central enthalpy |
| 1364 | * @param mermax [input] Maximum number of steps |
| 1365 | * @param mermax_poisson [input] Maximum number of steps in |
| 1366 | * Map_et::poisson |
| 1367 | * @param relax_poisson [input] Relaxation factor in Map_et::poisson |
| 1368 | * @param mermax_potvit [input] Maximum number of steps in |
| 1369 | * Map_radial::poisson_compact |
| 1370 | * @param relax_potvit [input] Relaxation factor in |
| 1371 | * Map_radial::poisson_compact |
| 1372 | * @param thres_adapt [input] Threshold on dH/dr for the adaptation |
| 1373 | * of the mapping |
| 1374 | * @param fact [input] 1-D \c Tbl for the input |
| 1375 | * of some factors : |
| 1376 | * \li \c fact(0) : A resizing factor for the first shell |
| 1377 | * @param diff [output] 1-D \c Tbl for the storage of some |
| 1378 | * error indicators : |
| 1379 | * \li \c diff(0) : Relative change in the enthalpy field |
| 1380 | * between two successive steps |
| 1381 | * \li \c diff(1) : Relative error returned by the routine |
| 1382 | * \c Etoile_bin::velocity_potential |
| 1383 | * \li \c diff(2) : Relative error in the resolution of the |
| 1384 | * Poisson equation for \c logn_auto |
| 1385 | * \li \c diff(3) : Relative error in the resolution of the |
| 1386 | * Poisson equation for \c beta_auto |
| 1387 | * \li \c diff(4) : Relative error in the resolution of the |
| 1388 | * equation for \c shift_auto (x comp.) |
| 1389 | * \li \c diff(5) : Relative error in the resolution of the |
| 1390 | * equation for \c shift_auto (y comp.) |
| 1391 | * \li \c diff(6) : Relative error in the resolution of the |
| 1392 | * equation for \c shift_auto (z comp.) |
| 1393 | * @param ent_limit [input] : array of enthalpy values to be set at |
| 1394 | * the boundaries between |
| 1395 | * the domains; if set to 0x0 (default), |
| 1396 | * the initial values will be kept. |
| 1397 | */ |
| 1398 | void equilibrium(double ent_c, |
| 1399 | int mermax, int mermax_poisson, |
| 1400 | double relax_poisson, int mermax_potvit, |
| 1401 | double relax_potvit, double thres_adapt, |
| 1402 | const Tbl& fact, Tbl& diff, const Tbl* ent_limit = 0x0) ; |
| 1403 | |
| 1404 | /** Computes an equilibrium configuration by regularizing |
| 1405 | * the diverging source. |
| 1406 | * |
| 1407 | * The values of \c logn_comp , \c beta_comp , \c pot_centri |
| 1408 | * are held fixed during the iteration. |
| 1409 | * |
| 1410 | * @param ent_c [input] Central enthalpy |
| 1411 | * @param ent_limit is the table of enthalpy values on the domain borders |
| 1412 | * |
| 1413 | * @param mermax [input] Maximum number of steps |
| 1414 | * @param mermax_poisson [input] Maximum number of steps in |
| 1415 | * Map_et::poisson |
| 1416 | * @param relax_poisson [input] Relaxation factor in Map_et::poisson |
| 1417 | * @param mermax_potvit [input] Maximum number of steps in |
| 1418 | * Map_radial::poisson_compact |
| 1419 | * @param relax_potvit [input] Relaxation factor in |
| 1420 | * Map_radial::poisson_compact |
| 1421 | * @param thres_adapt [input] Threshold on dH/dr for the adaptation |
| 1422 | * of the mapping |
| 1423 | * @param fact [input] 1-D \c Tbl for the input |
| 1424 | * of some factors : |
| 1425 | * \li \c fact(0) : A resizing factor for the first shell |
| 1426 | * @param diff [output] 1-D \c Tbl for the storage of some |
| 1427 | * error indicators : |
| 1428 | * \li \c diff(0) : Relative change in the enthalpy field |
| 1429 | * between two successive steps |
| 1430 | * \li \c diff(1) : Relative error returned by the routine |
| 1431 | * \c Etoile_bin::velocity_potential |
| 1432 | * \li \c diff(2) : Relative error in the resolution of the |
| 1433 | * Poisson equation for \c logn_auto |
| 1434 | * \li \c diff(3) : Relative error in the resolution of the |
| 1435 | * Poisson equation for \c beta_auto |
| 1436 | * \li \c diff(4) : Relative error in the resolution of the |
| 1437 | * equation for \c shift_auto (x comp.) |
| 1438 | * \li \c diff(5) : Relative error in the resolution of the |
| 1439 | * equation for \c shift_auto (y comp.) |
| 1440 | * \li \c diff(6) : Relative error in the resolution of the |
| 1441 | * equation for \c shift_auto (z comp.) |
| 1442 | */ |
| 1443 | void equil_regular(double ent_c, int mermax, int mermax_poisson, |
| 1444 | double relax_poisson, int mermax_potvit, |
| 1445 | double relax_potvit, double thres_adapt, |
| 1446 | const Tbl& fact, Tbl& diff) ; |
| 1447 | |
| 1448 | /** Computes the non-translational part of the velocity scalar potential |
| 1449 | * \f$\psi0\f$ by solving the continuity equation. |
| 1450 | * |
| 1451 | * @param mermax [input] Maximum number of steps in the iteration |
| 1452 | * @param precis [input] Required precision: the iteration will |
| 1453 | * be stopped when the relative difference |
| 1454 | * on \f$\psi0\f$ between two successive steps |
| 1455 | * is lower than \c precis . |
| 1456 | * @param relax [input] Relaxation factor. |
| 1457 | * |
| 1458 | * @return Relative error of the resolution obtained by comparing |
| 1459 | * the operator acting on the solution with the source. |
| 1460 | */ |
| 1461 | double velocity_potential(int mermax, double precis, double relax) ; |
| 1462 | |
| 1463 | /** Performs a relaxation on \c ent , \c logn_auto , \c beta_auto |
| 1464 | * and \c shift_auto . |
| 1465 | * @param star_prev [input] star at the previous step. |
| 1466 | * @param relax_ent [input] Relaxation factor for \c ent |
| 1467 | * @param relax_met [input] Relaxation factor for \c logn_auto , |
| 1468 | * \c beta_auto , \c shift_auto , |
| 1469 | * only if \c (mer \% fmer_met == 0) . |
| 1470 | * @param mer [input] Step number |
| 1471 | * @param fmer_met [input] Step interval between metric updates |
| 1472 | */ |
| 1473 | void relaxation(const Etoile_bin& star_prev, double relax_ent, |
| 1474 | double relax_met, int mer, int fmer_met) ; |
| 1475 | |
| 1476 | friend class Bin_ns_bh ; ///< Friend class Bin_ns_bh |
| 1477 | }; |
| 1478 | |
| 1479 | |
| 1480 | |
| 1481 | //---------------------------// |
| 1482 | // class Etoile_rot // |
| 1483 | //---------------------------// |
| 1484 | |
| 1485 | /** |
| 1486 | * Class for isolated rotating stars *** DEPRECATED : use class \c Star_rot instead ***. \ingroup (star) |
| 1487 | * |
| 1488 | * The metric is |
| 1489 | * \f[ |
| 1490 | * ds^2 = - N^2 dt^2 + A^2 (dr^2 + r^2 d\theta^2) |
| 1491 | * + B^2 r^2 \sin^2\theta (d\varphi - N^\varphi dt)^2 |
| 1492 | * \f] |
| 1493 | * |
| 1494 | * |
| 1495 | */ |
| 1496 | class Etoile_rot : public Etoile { |
| 1497 | |
| 1498 | // Data : |
| 1499 | // ----- |
| 1500 | protected: |
| 1501 | double omega ; ///< Rotation angular velocity (\c [f_unit] ) |
| 1502 | |
| 1503 | /// Metric factor \e B |
| 1504 | Tenseur bbb ; |
| 1505 | |
| 1506 | /// Square of the metric factor \e B |
| 1507 | Tenseur b_car ; |
| 1508 | |
| 1509 | /// Metric coefficient \f$N^\varphi\f$ |
| 1510 | Tenseur nphi ; |
| 1511 | |
| 1512 | /** Component \f$\tilde N^\varphi = N^\varphi r\sin\theta\f$ of the |
| 1513 | * shift vector |
| 1514 | */ |
| 1515 | Tenseur tnphi ; |
| 1516 | |
| 1517 | /// Norm of \c u_euler |
| 1518 | Tenseur uuu ; |
| 1519 | |
| 1520 | /// Metric potential \f$\nu = \ln N\f$ = \c logn_auto |
| 1521 | Tenseur& logn ; |
| 1522 | |
| 1523 | /** Part of the Metric potential \f$\nu = \ln N\f$ = \c logn |
| 1524 | * generated by the matter terms |
| 1525 | */ |
| 1526 | Tenseur nuf ; |
| 1527 | |
| 1528 | /** Part of the Metric potential \f$\nu = \ln N\f$ = \c logn |
| 1529 | * generated by the quadratic terms |
| 1530 | */ |
| 1531 | Tenseur nuq ; |
| 1532 | |
| 1533 | /// Metric potential \f$\zeta = \ln(AN)\f$ = \c beta_auto |
| 1534 | Tenseur& dzeta ; |
| 1535 | |
| 1536 | /// Metric potential \f$\tilde G = (NB-1) r\sin\theta\f$ |
| 1537 | Tenseur tggg ; |
| 1538 | |
| 1539 | /** Vector \f$W^i\f$ used in the decomposition of \c shift , |
| 1540 | * following Shibata's prescription |
| 1541 | * [\a Prog. \a Theor. \a Phys. \b 101 , 1199 (1999)] : |
| 1542 | * \f[ |
| 1543 | * N^i = {7\over 8} W^i - {1\over 8} |
| 1544 | * \left(\nabla^i\chi+\nabla^iW^kx_k\right) |
| 1545 | * \f] |
| 1546 | * NB: \c w_shift contains the components of \f$W^i\f$ |
| 1547 | * with respect to the Cartesian triad associated with the |
| 1548 | * mapping \c mp . |
| 1549 | */ |
| 1550 | Tenseur w_shift ; |
| 1551 | |
| 1552 | /** Scalar \f$\chi\f$ used in the decomposition of \c shift , |
| 1553 | * following Shibata's prescription |
| 1554 | * [\a Prog. \a Theor. \a Phys. \b 101 , 1199 (1999)] : |
| 1555 | * \f[ |
| 1556 | * N^i = {7\over 8} W^i - {1\over 8} |
| 1557 | * \left(\nabla^i\chi+\nabla^iW^kx_k\right) |
| 1558 | * \f] |
| 1559 | */ |
| 1560 | Tenseur khi_shift ; |
| 1561 | |
| 1562 | /** Tensor \f${\tilde K_{ij}}\f$ related to the extrinsic curvature |
| 1563 | * tensor by \f${\tilde K_{ij}} = B^{-2} K_{ij}\f$. |
| 1564 | * \c tkij contains the Cartesian components of |
| 1565 | * \f${\tilde K_{ij}}\f$. |
| 1566 | */ |
| 1567 | Tenseur_sym tkij ; |
| 1568 | |
| 1569 | /** Scalar \f$A^2 K_{ij} K^{ij}\f$. |
| 1570 | * For axisymmetric stars, this quantity is related to the |
| 1571 | * derivatives of \f$N^\varphi\f$ by |
| 1572 | * \f[ |
| 1573 | * A^2 K_{ij} K^{ij} = {B^2 \over 2 N^2} \, r^2\sin^2\theta \, |
| 1574 | * \left[ \left( {\partial N^\varphi \over \partial r} \right) ^2 |
| 1575 | * + {1\over r^2} \left( {\partial N^\varphi \over |
| 1576 | * \partial \theta} \right) ^2 \right] \ . |
| 1577 | * \f] |
| 1578 | * In particular it is related to the quantities \f$k_1\f$ and \f$k_2\f$ |
| 1579 | * introduced by Eqs.~(3.7) and (3.8) of |
| 1580 | * Bonazzola et al. \a Astron. \a Astrophys. \b 278 , 421 (1993) |
| 1581 | * by |
| 1582 | * \f[ |
| 1583 | * A^2 K_{ij} K^{ij} = 2 A^2 (k_1^2 + k_2^2) \ . |
| 1584 | * \f] |
| 1585 | */ |
| 1586 | Tenseur ak_car ; |
| 1587 | |
| 1588 | /** Effective source at the previous step for the resolution of |
| 1589 | * the Poisson equation for \c nuf by means of |
| 1590 | * \c Map_et::poisson . |
| 1591 | */ |
| 1592 | Cmp ssjm1_nuf ; |
| 1593 | |
| 1594 | /** Effective source at the previous step for the resolution of |
| 1595 | * the Poisson equation for \c nuq by means of |
| 1596 | * \c Map_et::poisson . |
| 1597 | */ |
| 1598 | Cmp ssjm1_nuq ; |
| 1599 | |
| 1600 | /** Effective source at the previous step for the resolution of |
| 1601 | * the Poisson equation for \c dzeta . |
| 1602 | */ |
| 1603 | Cmp ssjm1_dzeta ; |
| 1604 | |
| 1605 | /** Effective source at the previous step for the resolution of |
| 1606 | * the Poisson equation for \c tggg . |
| 1607 | */ |
| 1608 | Cmp ssjm1_tggg ; |
| 1609 | |
| 1610 | /** Effective source at the previous step for the resolution of |
| 1611 | * the Poisson equation for the scalar \f$\chi\f$ by means of |
| 1612 | * \c Map_et::poisson . |
| 1613 | * \f$\chi\f$ is an intermediate quantity for the resolution of the |
| 1614 | * elliptic equation for the shift vector \f$N^i\f$ |
| 1615 | */ |
| 1616 | Cmp ssjm1_khi ; |
| 1617 | |
| 1618 | /** Effective source at the previous step for the resolution of |
| 1619 | * the vector Poisson equation for \f$W^i\f$. |
| 1620 | * \f$W^i\f$ is an intermediate quantity for the resolution of the |
| 1621 | * elliptic equation for the shift vector \f$N^i\f$ |
| 1622 | * (Components with respect to the Cartesian triad associated with |
| 1623 | * the mapping \c mp ) |
| 1624 | */ |
| 1625 | Tenseur ssjm1_wshift ; |
| 1626 | |
| 1627 | // Derived data : |
| 1628 | // ------------ |
| 1629 | protected: |
| 1630 | |
| 1631 | mutable double* p_angu_mom ; ///< Angular momentum |
| 1632 | mutable double* p_tsw ; ///< Ratio T/W |
| 1633 | mutable double* p_grv2 ; ///< Error on the virial identity GRV2 |
| 1634 | mutable double* p_grv3 ; ///< Error on the virial identity GRV3 |
| 1635 | mutable double* p_r_circ ; ///< Circumferential radius |
| 1636 | mutable double* p_area ; ///< Surface area |
| 1637 | mutable double* p_aplat ; ///< Flatening r_pole/r_eq |
| 1638 | mutable double* p_z_eqf ; ///< Forward redshift factor at equator |
| 1639 | mutable double* p_z_eqb ; ///< Backward redshift factor at equator |
| 1640 | mutable double* p_z_pole ; ///< Redshift factor at North pole |
| 1641 | mutable double* p_mom_quad ; ///< Quadrupole moment |
| 1642 | mutable double* p_mom_quad_old ; ///< Part of the quadrupole moment |
| 1643 | mutable double* p_mom_quad_Bo ; ///< Part of the quadrupole moment |
| 1644 | mutable double* p_r_isco ; ///< Circumferential radius of the ISCO |
| 1645 | mutable double* p_f_isco ; ///< Orbital frequency of the ISCO |
| 1646 | /// Specific energy of a particle on the ISCO |
| 1647 | mutable double* p_espec_isco ; |
| 1648 | /// Specific angular momentum of a particle on the ISCO |
| 1649 | mutable double* p_lspec_isco ; |
| 1650 | mutable double* p_f_eq ; ///< Orbital frequency at the equator |
| 1651 | |
| 1652 | |
| 1653 | |
| 1654 | // Constructors - Destructor |
| 1655 | // ------------------------- |
| 1656 | public: |
| 1657 | /** Standard constructor. |
| 1658 | * |
| 1659 | * @param mp_i Mapping on which the star will be defined |
| 1660 | * @param nzet_i Number of domains occupied by the star |
| 1661 | * @param relat should be \c true for a relativistic |
| 1662 | * star, \c false for a Newtonian one |
| 1663 | * @param eos_i Equation of state of the stellar matter |
| 1664 | */ |
| 1665 | Etoile_rot(Map& mp_i, int nzet_i, bool relat, const Eos& eos_i) ; |
| 1666 | |
| 1667 | |
| 1668 | Etoile_rot(const Etoile_rot& ) ; ///< Copy constructor |
| 1669 | |
| 1670 | /** Constructor from a file (see \c sauve(FILE*) ). |
| 1671 | * |
| 1672 | * @param mp_i Mapping on which the star will be defined |
| 1673 | * @param eos_i Equation of state of the stellar matter |
| 1674 | * @param fich input file (must have been created by the function |
| 1675 | * \c sauve ) |
| 1676 | */ |
| 1677 | Etoile_rot(Map& mp_i, const Eos& eos_i, FILE* fich) ; |
| 1678 | |
| 1679 | virtual ~Etoile_rot() ; ///< Destructor |
| 1680 | |
| 1681 | |
| 1682 | // Memory management |
| 1683 | // ----------------- |
| 1684 | protected: |
| 1685 | /// Deletes all the derived quantities |
| 1686 | virtual void del_deriv() const ; |
| 1687 | |
| 1688 | /// Sets to \c 0x0 all the pointers on derived quantities |
| 1689 | virtual void set_der_0x0() const ; |
| 1690 | |
| 1691 | /** Sets to \c ETATNONDEF (undefined state) the hydrodynamical |
| 1692 | * quantities relative to the Eulerian observer. |
| 1693 | */ |
| 1694 | virtual void del_hydro_euler() ; |
| 1695 | |
| 1696 | |
| 1697 | // Mutators / assignment |
| 1698 | // --------------------- |
| 1699 | public: |
| 1700 | /// Assignment to another \c Etoile_rot |
| 1701 | void operator=(const Etoile_rot& ) ; |
| 1702 | |
| 1703 | // Accessors |
| 1704 | // --------- |
| 1705 | public: |
| 1706 | /** Returns the central value of the rotation angular velocity |
| 1707 | * (\c [f_unit] ) |
| 1708 | */ |
| 1709 | virtual double get_omega_c() const ; |
| 1710 | |
| 1711 | /// Returns the metric factor \e B |
| 1712 | const Tenseur& get_bbb() const {return bbb;} ; |
| 1713 | |
| 1714 | /// Returns the square of the metric factor \e B |
| 1715 | const Tenseur& get_b_car() const {return b_car;} ; |
| 1716 | |
| 1717 | /// Returns the metric coefficient \f$N^\varphi\f$ |
| 1718 | const Tenseur& get_nphi() const {return nphi;} ; |
| 1719 | |
| 1720 | /** Returns the component \f$\tilde N^\varphi = N^\varphi r\sin\theta\f$ |
| 1721 | * of the shift vector |
| 1722 | */ |
| 1723 | const Tenseur& get_tnphi() const {return tnphi;} ; |
| 1724 | |
| 1725 | /// Returns the norm of \c u_euler |
| 1726 | const Tenseur& get_uuu() const {return uuu;} ; |
| 1727 | |
| 1728 | /// Returns the metric potential \f$\nu = \ln N\f$ = \c logn_auto |
| 1729 | const Tenseur& get_logn() const {return logn;} ; |
| 1730 | |
| 1731 | /** Returns the part of the Metric potential \f$\nu = \ln N\f$ = \c logn |
| 1732 | * generated by the matter terms |
| 1733 | */ |
| 1734 | const Tenseur& get_nuf() const {return nuf;} ; |
| 1735 | |
| 1736 | /** Returns the Part of the Metric potential \f$\nu = \ln N\f$ = \c logn |
| 1737 | * generated by the quadratic terms |
| 1738 | */ |
| 1739 | const Tenseur& get_nuq() const {return nuq;} ; |
| 1740 | |
| 1741 | /// Returns the Metric potential \f$\zeta = \ln(AN)\f$ = \c beta_auto |
| 1742 | const Tenseur& get_dzeta() const {return dzeta;} ; |
| 1743 | |
| 1744 | /// Returns the Metric potential \f$\tilde G = (NB-1) r\sin\theta\f$ |
| 1745 | const Tenseur& get_tggg() const {return tggg;} ; |
| 1746 | |
| 1747 | /** Returns the vector \f$W^i\f$ used in the decomposition of |
| 1748 | * \c shift , |
| 1749 | * following Shibata's prescription |
| 1750 | * [\a Prog. \a Theor. \a Phys. \b 101 , 1199 (1999)] : |
| 1751 | * \f[ |
| 1752 | * N^i = {7\over 8} W^i - {1\over 8} |
| 1753 | * \left(\nabla^i\chi+\nabla^iW^kx_k\right) |
| 1754 | * \f] |
| 1755 | * NB: \c w_shift contains the components of \f$W^i\f$ |
| 1756 | * with respect to the Cartesian triad associated with the |
| 1757 | * mapping \c mp . |
| 1758 | */ |
| 1759 | const Tenseur& get_w_shift() const {return w_shift;} ; |
| 1760 | |
| 1761 | /** Returns the scalar \f$\chi\f$ used in the decomposition of |
| 1762 | * \c shift |
| 1763 | * following Shibata's prescription |
| 1764 | * [\a Prog. \a Theor. \a Phys. \b 101 , 1199 (1999)] : |
| 1765 | * \f[ |
| 1766 | * N^i = {7\over 8} W^i - {1\over 8} |
| 1767 | * \left(\nabla^i\chi+\nabla^iW^kx_k\right) |
| 1768 | * \f] |
| 1769 | * NB: \c w_shift contains the components of \f$W^i\f$ |
| 1770 | * with respect to the Cartesian triad associated with the |
| 1771 | * mapping \c mp . |
| 1772 | */ |
| 1773 | const Tenseur& get_khi_shift() const {return khi_shift;} ; |
| 1774 | |
| 1775 | /** Returns the tensor \f${\tilde K_{ij}}\f$ related to the extrinsic |
| 1776 | * curvature tensor by \f${\tilde K_{ij}} = B^{-2} K_{ij}\f$. |
| 1777 | * \c tkij contains the Cartesian components of |
| 1778 | * \f${\tilde K_{ij}}\f$. |
| 1779 | */ |
| 1780 | const Tenseur_sym& get_tkij() const {return tkij;} ; |
| 1781 | |
| 1782 | /** Returns the scalar \f$A^2 K_{ij} K^{ij}\f$. |
| 1783 | * For axisymmetric stars, this quantity is related to the |
| 1784 | * derivatives of \f$N^\varphi\f$ by |
| 1785 | * \f[ |
| 1786 | * A^2 K_{ij} K^{ij} = {B^2 \over 2 N^2} \, r^2\sin^2\theta \, |
| 1787 | * \left[ \left( {\partial N^\varphi \over \partial r} \right) ^2 |
| 1788 | * + {1\over r^2} \left( {\partial N^\varphi \over |
| 1789 | * \partial \theta} \right) ^2 \right] \ . |
| 1790 | * \f] |
| 1791 | * In particular it is related to the quantities \f$k_1\f$ and \f$k_2\f$ |
| 1792 | * introduced by Eqs.~(3.7) and (3.8) of |
| 1793 | * Bonazzola et al. \a Astron. \a Astrophys. \b 278 , 421 (1993) |
| 1794 | * by |
| 1795 | * \f[ |
| 1796 | * A^2 K_{ij} K^{ij} = 2 A^2 (k_1^2 + k_2^2) \ . |
| 1797 | * \f] |
| 1798 | */ |
| 1799 | const Tenseur& get_ak_car() const {return ak_car;} ; |
| 1800 | |
| 1801 | // Outputs |
| 1802 | // ------- |
| 1803 | public: |
| 1804 | virtual void sauve(FILE* ) const ; ///< Save in a file |
| 1805 | |
| 1806 | /// Display in polytropic units |
| 1807 | virtual void display_poly(ostream& ) const ; |
| 1808 | |
| 1809 | protected: |
| 1810 | /// Operator >> (virtual function called by the operator <<). |
| 1811 | virtual ostream& operator>>(ostream& ) const ; |
| 1812 | |
| 1813 | /// Printing of some informations, excluding all global quantities |
| 1814 | virtual void partial_display(ostream& ) const ; |
| 1815 | |
| 1816 | // Global quantities |
| 1817 | // ----------------- |
| 1818 | public: |
| 1819 | |
| 1820 | /** Description of the stellar surface: returns a 2-D \c Itbl |
| 1821 | * containing the |
| 1822 | * values of the domain index \e l on the surface at the |
| 1823 | * collocation points in \f$(\theta', \phi')\f$. |
| 1824 | * The stellar surface is defined as the location where |
| 1825 | * the enthalpy (member \c ent ) vanishes. |
| 1826 | */ |
| 1827 | virtual const Itbl& l_surf() const ; |
| 1828 | |
| 1829 | virtual double mass_b() const ; ///< Baryon mass |
| 1830 | virtual double mass_g() const ; ///< Gravitational mass |
| 1831 | virtual double angu_mom() const ; ///< Angular momentum |
| 1832 | virtual double tsw() const ; ///< Ratio T/W |
| 1833 | |
| 1834 | /** Error on the virial identity GRV2. |
| 1835 | * This indicator is only valid for relativistic computations. |
| 1836 | */ |
| 1837 | virtual double grv2() const ; |
| 1838 | |
| 1839 | /** Error on the virial identity GRV3. |
| 1840 | * The error is computed as the integral defined |
| 1841 | * by Eq. (43) of [Gourgoulhon and Bonazzola, |
| 1842 | * \a Class. \a Quantum \a Grav. \b 11, 443 (1994)] divided by |
| 1843 | * the integral of the matter terms. |
| 1844 | * |
| 1845 | * @param ost output stream to give details of the computation; |
| 1846 | * if set to 0x0 [default value], no details will be |
| 1847 | * given. |
| 1848 | * |
| 1849 | */ |
| 1850 | virtual double grv3(ostream* ost = 0x0) const ; |
| 1851 | |
| 1852 | virtual double r_circ() const ; ///< Circumferential radius |
| 1853 | virtual double area() const ; ///< Surface area |
| 1854 | virtual double mean_radius() const ; ///< Mean radius |
| 1855 | virtual double aplat() const ; ///< Flatening r_pole/r_eq |
| 1856 | virtual double z_eqf() const ; ///< Forward redshift factor at equator |
| 1857 | virtual double z_eqb() const ; ///< Backward redshift factor at equator |
| 1858 | virtual double z_pole() const ; ///< Redshift factor at North pole |
| 1859 | |
| 1860 | /** Quadrupole moment. |
| 1861 | * The quadrupole moment \e Q is defined according to Eq. (11) of |
| 1862 | * [Pappas and Apostolatos, \a Physical \a Review \a Letters |
| 1863 | * \b 108, 231104 (2012)]. This is a corrected version of the quadrupole |
| 1864 | * moment defined by [Salgado, Bonazzola, Gourgoulhon and Haensel, |
| 1865 | * \a Astron. \a Astrophys. \b 291 , 155 (1994)]. Following this |
| 1866 | * definition, \f$Q = {\bar Q } - 4/3 (1/4 + b) M^3 \f$, where |
| 1867 | * \f${\bar Q }\f$ is defined as the negative of the (wrong) quadrupole |
| 1868 | * moment defined in Eq. (7) of [Salgado, Bonazzola, Gourgoulhon and |
| 1869 | * Haensel, \a Astron. \a Astrophys. \b 291 , 155 (1994)], \e b is |
| 1870 | * defined by Eq. (3.37) of [Friedman and Stergioulas, \a Rotating |
| 1871 | * \a Relativistic \a Stars, Cambridge Monograph on mathematical |
| 1872 | * physics] and \e M is the gravitational mass of the star. |
| 1873 | */ |
| 1874 | virtual double mom_quad() const ; |
| 1875 | |
| 1876 | /** Part of the quadrupole moment. |
| 1877 | * This term \f${\bar Q }\f$ is defined by Laarakkers and Poisson, |
| 1878 | * \a Astrophys. \a J. \b 512 , 282 (1999). Note that \f${\bar Q }\f$ |
| 1879 | * is the negative of the (wrong) quadrupole moment defined in Eq. (7) of |
| 1880 | * [Salgado, Bonazzola, Gourgoulhon and Haensel, \a Astron. \a Astrophys. |
| 1881 | * \b 291 , 155 (1994)]. |
| 1882 | */ |
| 1883 | virtual double mom_quad_old() const ; |
| 1884 | |
| 1885 | /** Part of the quadrupole moment. |
| 1886 | * \f$B_o\f$ is defined as \f$bM^2\f$, where \e b is given by |
| 1887 | * Eq. (3.37) of [Friedman and Stergioulas, \a Rotating \a |
| 1888 | * Relativistic \a Stars, Cambridge Monograph on mathematical |
| 1889 | * physics] and \e M is the the gravitational mass of the star. |
| 1890 | */ |
| 1891 | virtual double mom_quad_Bo() const ; |
| 1892 | |
| 1893 | /** Circumferential radius of the innermost stable circular orbit (ISCO). |
| 1894 | * |
| 1895 | * @param ost output stream to give details of the computation; |
| 1896 | * if set to 0x0 [default value], no details will be |
| 1897 | * given. |
| 1898 | */ |
| 1899 | virtual double r_isco(ostream* ost = 0x0) const ; |
| 1900 | |
| 1901 | /// Orbital frequency at the innermost stable circular orbit (ISCO). |
| 1902 | virtual double f_isco() const ; |
| 1903 | |
| 1904 | /// Energy of a particle on the ISCO |
| 1905 | virtual double espec_isco() const ; |
| 1906 | |
| 1907 | /// Angular momentum of a particle on the ISCO |
| 1908 | virtual double lspec_isco() const ; |
| 1909 | |
| 1910 | |
| 1911 | /** Computation of frequency of eccentric orbits. |
| 1912 | * |
| 1913 | * @param ecc eccentricity of the orbit |
| 1914 | * @param periasrt periastron of the orbit |
| 1915 | * @param ost output stream to give details of the computation; |
| 1916 | * if set to 0x0 [default value], no details will be |
| 1917 | * given. |
| 1918 | * |
| 1919 | * @return orbital frequency |
| 1920 | */ |
| 1921 | virtual double f_eccentric(double ecc, double periast, |
| 1922 | ostream* ost = 0x0) const ; |
| 1923 | |
| 1924 | /// Orbital frequency at the equator. |
| 1925 | virtual double f_eq() const ; |
| 1926 | |
| 1927 | |
| 1928 | // Computational routines |
| 1929 | // ---------------------- |
| 1930 | public: |
| 1931 | /** Computes the hydrodynamical quantities relative to the Eulerian |
| 1932 | * observer from those in the fluid frame. |
| 1933 | * |
| 1934 | * The calculation is performed starting from the quantities |
| 1935 | * \c ent , \c ener , \c press , and \c a_car , |
| 1936 | * which are supposed to be up to date. |
| 1937 | * From these, the following fields are updated: |
| 1938 | * \c gam_euler , \c u_euler , \c ener_euler , \c s_euler . |
| 1939 | * |
| 1940 | */ |
| 1941 | virtual void hydro_euler() ; |
| 1942 | |
| 1943 | /** Computes metric coefficients from known potentials. |
| 1944 | * |
| 1945 | * The calculation is performed starting from the quantities |
| 1946 | * \c logn , \c dzeta , \c tggg and \c shift , |
| 1947 | * which are supposed to be up to date. |
| 1948 | * From these, the following fields are updated: |
| 1949 | * \c nnn , \c a_car , \c bbb and \c b_car . |
| 1950 | * |
| 1951 | */ |
| 1952 | void update_metric() ; |
| 1953 | |
| 1954 | /** Computes \c shift from \c w_shift and \c khi_shift |
| 1955 | * according to Shibata's prescription |
| 1956 | * [\a Prog. \a Theor. \a Phys. \b 101 , 1199 (1999)] : |
| 1957 | * \f[ |
| 1958 | * N^i = {7\over 8} W^i - {1\over 8} |
| 1959 | * \left(\nabla^i\chi+\nabla^iW^kx_k\right) |
| 1960 | * \f] |
| 1961 | */ |
| 1962 | void fait_shift() ; |
| 1963 | |
| 1964 | /** Computes \c tnphi and \c nphi from the Cartesian |
| 1965 | * components of the shift, stored in \c shift . |
| 1966 | */ |
| 1967 | void fait_nphi() ; |
| 1968 | |
| 1969 | /** Computes \c tkij and \c ak_car from |
| 1970 | * \c shift , \c nnn and \c b_car . |
| 1971 | */ |
| 1972 | void extrinsic_curvature() ; |
| 1973 | |
| 1974 | /** Computes the coefficient \f$\lambda\f$ which ensures that the |
| 1975 | * GRV2 virial identity is satisfied. |
| 1976 | * \f$\lambda\f$ is the coefficient by which one must multiply |
| 1977 | * the quadratic source term \f$\sigma_q\f$ of the 2-D Poisson equation |
| 1978 | * \f[ |
| 1979 | * \Delta_2 u = \sigma_m + \sigma_q |
| 1980 | * \f] |
| 1981 | * in order that the total source does not contain any monopolar term, |
| 1982 | * i.e. in order that |
| 1983 | * \f[ |
| 1984 | * \int_0^{2\pi} \int_0^{+\infty} \sigma(r, \theta) |
| 1985 | * \, r \, dr \, d\theta = 0 \ , |
| 1986 | * \f] |
| 1987 | * where \f$\sigma = \sigma_m + \sigma_q\f$. |
| 1988 | * \f$\lambda\f$ is computed according to the formula |
| 1989 | * \f[ |
| 1990 | * \lambda = - { \int_0^{2\pi} \int_0^{+\infty} \sigma_m(r, \theta) |
| 1991 | * \, r \, dr \, d\theta \over |
| 1992 | * \int_0^{2\pi} \int_0^{+\infty} \sigma_q(r, \theta) |
| 1993 | * \, r \, dr \, d\theta } \ . |
| 1994 | * \f] |
| 1995 | * Then, by construction, the new source |
| 1996 | * \f$\sigma' = \sigma_m + \lambda \sigma_q\f$ has a vanishing monopolar |
| 1997 | * term. |
| 1998 | * |
| 1999 | * @param sou_m [input] matter source term \f$\sigma_m\f$ |
| 2000 | * @param sou_q [input] quadratic source term \f$\sigma_q\f$ |
| 2001 | * @return value of \f$\lambda\f$ |
| 2002 | */ |
| 2003 | static double lambda_grv2(const Cmp& sou_m, const Cmp& sou_q) ; |
| 2004 | |
| 2005 | /** Computes an equilibrium configuration. |
| 2006 | * |
| 2007 | * @param ent_c [input] Central enthalpy |
| 2008 | * @param omega0 [input] Requested angular velocity |
| 2009 | * (if \c fact_omega=1. ) |
| 2010 | * @param fact_omega [input] 1.01 = search for the Keplerian frequency, |
| 2011 | * 1. = otherwise. |
| 2012 | * @param nzadapt [input] Number of (inner) domains where the mapping |
| 2013 | * adaptation to an iso-enthalpy surface |
| 2014 | * should be performed |
| 2015 | * @param ent_limit [input] 1-D \c Tbl of dimension \c nzet which |
| 2016 | * defines the enthalpy at the outer boundary |
| 2017 | * of each domain |
| 2018 | * @param icontrol [input] Set of integer parameters (stored as a |
| 2019 | * 1-D \c Itbl of size 8) to control the |
| 2020 | * iteration: |
| 2021 | * \li \c icontrol(0) = mer_max : maximum number of steps |
| 2022 | * \li \c icontrol(1) = mer_rot : step at which the rotation is |
| 2023 | * switched on |
| 2024 | * \li \c icontrol(2) = mer_change_omega : step at which the rotation |
| 2025 | * velocity is changed to reach the final one |
| 2026 | * \li \c icontrol(3) = mer_fix_omega : step at which the final |
| 2027 | * rotation velocity must have been reached |
| 2028 | * \li \c icontrol(4) = mer_mass : the absolute value of |
| 2029 | * \c mer_mass is the step from which the |
| 2030 | * baryon mass is forced to converge, |
| 2031 | * by varying the central enthalpy |
| 2032 | * (\c mer_mass>0 ) or the angular |
| 2033 | * velocity (\c mer_mass<0 ) |
| 2034 | * \li \c icontrol(5) = mermax_poisson : maximum number of steps in |
| 2035 | * \c Map_et::poisson |
| 2036 | * \li \c icontrol(6) = mer_triax : step at which the 3-D |
| 2037 | * perturbation is switched on |
| 2038 | * \li \c icontrol(7) = delta_mer_kep : number of steps |
| 2039 | * after \c mer_fix_omega when \c omega |
| 2040 | * starts to be increased by \c fact_omega |
| 2041 | * to search for the Keplerian velocity |
| 2042 | * |
| 2043 | * @param control [input] Set of parameters (stored as a |
| 2044 | * 1-D \c Tbl of size 7) to control the |
| 2045 | * iteration: |
| 2046 | * \li \c control(0) = precis : threshold on the enthalpy relative |
| 2047 | * change for ending the computation |
| 2048 | * \li \c control(1) = omega_ini : initial angular velocity, |
| 2049 | * switched on only if \c mer_rot<0 , |
| 2050 | * otherwise 0 is used |
| 2051 | * \li \c control(2) = relax : relaxation factor in the main |
| 2052 | * iteration |
| 2053 | * \li \c control(3) = relax_poisson : relaxation factor in |
| 2054 | * \c Map_et::poisson |
| 2055 | * \li \c control(4) = thres_adapt : threshold on dH/dr for |
| 2056 | * freezing the adaptation of the mapping |
| 2057 | * \li \c control(5) = ampli_triax : relative amplitude of |
| 2058 | * the 3-D perturbation |
| 2059 | * \li \c control(6) = precis_adapt : precision for |
| 2060 | * \c Map_et::adapt |
| 2061 | * |
| 2062 | * @param mbar_wanted [input] Requested baryon mass (effective only |
| 2063 | * if \c mer_mass > \c mer_max ) |
| 2064 | * @param aexp_mass [input] Exponent for the increase factor of the |
| 2065 | * central enthalpy to converge to the |
| 2066 | * requested baryon mass |
| 2067 | * @param diff [output] 1-D \c Tbl of size 7 for the storage of |
| 2068 | * some error indicators : |
| 2069 | * \li \c diff(0) : Relative change in the enthalpy field |
| 2070 | * between two successive steps |
| 2071 | * \li \c diff(1) : Relative error in the resolution of the |
| 2072 | * Poisson equation for \c nuf |
| 2073 | * \li \c diff(2) : Relative error in the resolution of the |
| 2074 | * Poisson equation for \c nuq |
| 2075 | * \li \c diff(3) : Relative error in the resolution of the |
| 2076 | * Poisson equation for \c dzeta |
| 2077 | * \li \c diff(4) : Relative error in the resolution of the |
| 2078 | * Poisson equation for \c tggg |
| 2079 | * \li \c diff(5) : Relative error in the resolution of the |
| 2080 | * equation for \c shift (x comp.) |
| 2081 | * \li \c diff(6) : Relative error in the resolution of the |
| 2082 | * equation for \c shift (y comp.) |
| 2083 | */ |
| 2084 | virtual void equilibrium(double ent_c, double omega0, double fact_omega, |
| 2085 | int nzadapt, const Tbl& ent_limit, |
| 2086 | const Itbl& icontrol, const Tbl& control, |
| 2087 | double mbar_wanted, double aexp_mass, |
| 2088 | Tbl& diff, Param* = 0x0) ; |
| 2089 | |
| 2090 | |
| 2091 | }; |
| 2092 | |
| 2093 | |
| 2094 | |
| 2095 | |
| 2096 | } |
| 2097 | #endif |