| 1 | /* |
| 2 | * Definition of Lorene class Star_rot |
| 3 | * |
| 4 | */ |
| 5 | |
| 6 | /* |
| 7 | * Copyright (c) 2010 Eric Gourgoulhon |
| 8 | * |
| 9 | * This file is part of LORENE. |
| 10 | * |
| 11 | * LORENE is free software; you can redistribute it and/or modify |
| 12 | * it under the terms of the GNU General Public License as published by |
| 13 | * the Free Software Foundation; either version 2 of the License, or |
| 14 | * (at your option) any later version. |
| 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 | |
| 28 | #ifndef __STAR_ROT_H_ |
| 29 | #define __STAR_ROT_H_ |
| 30 | |
| 31 | /* |
| 32 | * $Id: star_rot.h,v 1.6 2015/05/19 09:30:55 j_novak Exp $ |
| 33 | * $Log: star_rot.h,v $ |
| 34 | * Revision 1.6 2015/05/19 09:30:55 j_novak |
| 35 | * New methods for computing the area of the star and its mean radius. |
| 36 | * |
| 37 | * Revision 1.5 2014/10/13 08:52:36 j_novak |
| 38 | * Lorene classes and functions now belong to the namespace Lorene. |
| 39 | * |
| 40 | * Revision 1.4 2010/02/08 10:56:30 j_novak |
| 41 | * Added a few things missing for the reading from resulting file. |
| 42 | * |
| 43 | * Revision 1.3 2010/02/02 13:35:00 e_gourgoulhon |
| 44 | * Remove the "under construction" mark. |
| 45 | * |
| 46 | * Revision 1.2 2010/01/25 18:14:05 e_gourgoulhon |
| 47 | * Added member unsurc2 |
| 48 | * Added method is_relativistic() |
| 49 | * Suppressed method f_eccentric |
| 50 | * |
| 51 | * Revision 1.1 2010/01/24 16:07:45 e_gourgoulhon |
| 52 | * New class Star_rot. |
| 53 | * |
| 54 | * |
| 55 | * $Header: /cvsroot/Lorene/C++/Include/star_rot.h,v 1.6 2015/05/19 09:30:55 j_novak Exp $ |
| 56 | * |
| 57 | */ |
| 58 | |
| 59 | // Headers Lorene |
| 60 | #include "star.h" |
| 61 | |
| 62 | namespace Lorene { |
| 63 | class Eos ; |
| 64 | |
| 65 | //--------------------------// |
| 66 | // class Star_rot // |
| 67 | //--------------------------// |
| 68 | |
| 69 | /** |
| 70 | * Class for isolated rotating stars. \ingroup (star) |
| 71 | * |
| 72 | * The metric is |
| 73 | * \f[ |
| 74 | * ds^2 = - N^2 dt^2 + A^2 (dr^2 + r^2 d\theta^2) |
| 75 | * + B^2 r^2 \sin^2\theta (d\varphi - N^\varphi dt)^2 |
| 76 | * \f] |
| 77 | * |
| 78 | * A star of class \c Star_rot can be either relativistic or Newtonian, |
| 79 | * depending on the boolean indicator \c relativistic . For a Newtonian |
| 80 | * star, the metric coefficients \e N, \e A, and \e B are set to 1, and \f$N^\varphi\f$ is |
| 81 | * set to zero; the only relevant gravitational quantity in this case is |
| 82 | * \c logn which represents the Newtonian gravitational potential generated by the star. |
| 83 | * |
| 84 | * \version $Id: star_rot.h,v 1.6 2015/05/19 09:30:55 j_novak Exp $ |
| 85 | */ |
| 86 | class Star_rot : public Star { |
| 87 | |
| 88 | // Data : |
| 89 | // ----- |
| 90 | protected: |
| 91 | /** Indicator of relativity: \c true for a relativistic star, |
| 92 | * \c false for a Newtonian one. |
| 93 | */ |
| 94 | bool relativistic ; |
| 95 | |
| 96 | /** \f$1/c^2\f$ : \c unsurc2=1 for a relativistic star, |
| 97 | * 0 for a Newtonian one. |
| 98 | */ |
| 99 | double unsurc2 ; |
| 100 | |
| 101 | double omega ; ///< Rotation angular velocity (\c [f_unit] ) |
| 102 | |
| 103 | /// Square of the metric factor \e A |
| 104 | Scalar a_car ; |
| 105 | |
| 106 | /// Metric factor \e B |
| 107 | Scalar bbb ; |
| 108 | |
| 109 | /// Square of the metric factor \e B |
| 110 | Scalar b_car ; |
| 111 | |
| 112 | /// Metric coefficient \f$N^\varphi\f$ |
| 113 | Scalar nphi ; |
| 114 | |
| 115 | /** Component \f$\tilde N^\varphi = N^\varphi r\sin\theta\f$ of the |
| 116 | * shift vector |
| 117 | */ |
| 118 | Scalar tnphi ; |
| 119 | |
| 120 | /// Norm of \c u_euler |
| 121 | Scalar uuu ; |
| 122 | |
| 123 | /** Part of the Metric potential \f$\nu = \ln N\f$ = \c logn |
| 124 | * generated by the matter terms |
| 125 | */ |
| 126 | Scalar nuf ; |
| 127 | |
| 128 | /** Part of the Metric potential \f$\nu = \ln N\f$ = \c logn |
| 129 | * generated by the quadratic terms |
| 130 | */ |
| 131 | Scalar nuq ; |
| 132 | |
| 133 | /// Metric potential \f$\zeta = \ln(AN)\f$ |
| 134 | Scalar dzeta ; |
| 135 | |
| 136 | /// Metric potential \f$\tilde G = (NB-1) r\sin\theta\f$ |
| 137 | Scalar tggg ; |
| 138 | |
| 139 | /** Vector \f$W^i\f$ used in the decomposition of \c shift , |
| 140 | * following Shibata's prescription |
| 141 | * [\a Prog. \a Theor. \a Phys. \b 101 , 1199 (1999)] : |
| 142 | * \f[ |
| 143 | * N^i = {7\over 8} W^i - {1\over 8} |
| 144 | * \left(\nabla^i\chi+\nabla^iW^kx_k\right) |
| 145 | * \f] |
| 146 | * NB: \c w_shift contains the components of \f$W^i\f$ |
| 147 | * with respect to the Cartesian triad associated with the |
| 148 | * mapping \c mp . |
| 149 | */ |
| 150 | Vector w_shift ; |
| 151 | |
| 152 | /** Scalar \f$\chi\f$ used in the decomposition of \c shift , |
| 153 | * following Shibata's prescription |
| 154 | * [\a Prog. \a Theor. \a Phys. \b 101 , 1199 (1999)] : |
| 155 | * \f[ |
| 156 | * N^i = {7\over 8} W^i - {1\over 8} |
| 157 | * \left(\nabla^i\chi+\nabla^iW^kx_k\right) |
| 158 | * \f] |
| 159 | */ |
| 160 | Scalar khi_shift ; |
| 161 | |
| 162 | /** Tensor \f${\tilde K_{ij}}\f$ related to the extrinsic curvature |
| 163 | * tensor by \f${\tilde K_{ij}} = B^{-2} K_{ij}\f$. |
| 164 | * \c tkij contains the Cartesian components of |
| 165 | * \f${\tilde K_{ij}}\f$. |
| 166 | */ |
| 167 | Sym_tensor tkij ; |
| 168 | |
| 169 | /** Scalar \f$A^2 K_{ij} K^{ij}\f$. |
| 170 | * For axisymmetric stars, this quantity is related to the |
| 171 | * derivatives of \f$N^\varphi\f$ by |
| 172 | * \f[ |
| 173 | * A^2 K_{ij} K^{ij} = {B^2 \over 2 N^2} \, r^2\sin^2\theta \, |
| 174 | * \left[ \left( {\partial N^\varphi \over \partial r} \right) ^2 |
| 175 | * + {1\over r^2} \left( {\partial N^\varphi \over |
| 176 | * \partial \theta} \right) ^2 \right] \ . |
| 177 | * \f] |
| 178 | * In particular it is related to the quantities \f$k_1\f$ and \f$k_2\f$ |
| 179 | * introduced by Eqs.~(3.7) and (3.8) of |
| 180 | * Bonazzola et al. \a Astron. \a Astrophys. \b 278 , 421 (1993) |
| 181 | * by |
| 182 | * \f[ |
| 183 | * A^2 K_{ij} K^{ij} = 2 A^2 (k_1^2 + k_2^2) \ . |
| 184 | * \f] |
| 185 | */ |
| 186 | Scalar ak_car ; |
| 187 | |
| 188 | /** Effective source at the previous step for the resolution of |
| 189 | * the Poisson equation for \c nuf by means of |
| 190 | * \c Map_et::poisson . |
| 191 | */ |
| 192 | Scalar ssjm1_nuf ; |
| 193 | |
| 194 | /** Effective source at the previous step for the resolution of |
| 195 | * the Poisson equation for \c nuq by means of |
| 196 | * \c Map_et::poisson . |
| 197 | */ |
| 198 | Scalar ssjm1_nuq ; |
| 199 | |
| 200 | /** Effective source at the previous step for the resolution of |
| 201 | * the Poisson equation for \c dzeta . |
| 202 | */ |
| 203 | Scalar ssjm1_dzeta ; |
| 204 | |
| 205 | /** Effective source at the previous step for the resolution of |
| 206 | * the Poisson equation for \c tggg . |
| 207 | */ |
| 208 | Scalar ssjm1_tggg ; |
| 209 | |
| 210 | /** Effective source at the previous step for the resolution of |
| 211 | * the Poisson equation for the scalar \f$\chi\f$ by means of |
| 212 | * \c Map_et::poisson . |
| 213 | * \f$\chi\f$ is an intermediate quantity for the resolution of the |
| 214 | * elliptic equation for the shift vector \f$N^i\f$ |
| 215 | */ |
| 216 | Scalar ssjm1_khi ; |
| 217 | |
| 218 | /** Effective source at the previous step for the resolution of |
| 219 | * the vector Poisson equation for \f$W^i\f$. |
| 220 | * \f$W^i\f$ is an intermediate quantity for the resolution of the |
| 221 | * elliptic equation for the shift vector \f$N^i\f$ |
| 222 | * (Components with respect to the Cartesian triad associated with |
| 223 | * the mapping \c mp ) |
| 224 | */ |
| 225 | Vector ssjm1_wshift ; |
| 226 | |
| 227 | |
| 228 | // Derived data : |
| 229 | // ------------ |
| 230 | protected: |
| 231 | |
| 232 | mutable double* p_angu_mom ; ///< Angular momentum |
| 233 | mutable double* p_tsw ; ///< Ratio T/W |
| 234 | mutable double* p_grv2 ; ///< Error on the virial identity GRV2 |
| 235 | mutable double* p_grv3 ; ///< Error on the virial identity GRV3 |
| 236 | mutable double* p_r_circ ; ///< Circumferential radius |
| 237 | mutable double* p_aplat ; ///< Flatening r_pole/r_eq |
| 238 | mutable double* p_area ; ///< Integrated surface area |
| 239 | mutable double* p_z_eqf ; ///< Forward redshift factor at equator |
| 240 | mutable double* p_z_eqb ; ///< Backward redshift factor at equator |
| 241 | mutable double* p_z_pole ; ///< Redshift factor at North pole |
| 242 | mutable double* p_mom_quad ; ///< Quadrupole moment |
| 243 | mutable double* p_r_isco ; ///< Circumferential radius of the ISCO |
| 244 | mutable double* p_f_isco ; ///< Orbital frequency of the ISCO |
| 245 | /// Specific energy of a particle on the ISCO |
| 246 | mutable double* p_espec_isco ; |
| 247 | /// Specific angular momentum of a particle on the ISCO |
| 248 | mutable double* p_lspec_isco ; |
| 249 | mutable double* p_f_eq ; ///< Orbital frequency at the equator |
| 250 | |
| 251 | |
| 252 | |
| 253 | // Constructors - Destructor |
| 254 | // ------------------------- |
| 255 | public: |
| 256 | /** Standard constructor. |
| 257 | * |
| 258 | * @param mp_i Mapping on which the star is contructed |
| 259 | * @param nzet_i Number of domains occupied by the star |
| 260 | * @param relat \c true for a relativistic |
| 261 | * star, \c false for a Newtonian one |
| 262 | * @param eos_i Equation of state of the stellar matter |
| 263 | */ |
| 264 | Star_rot(Map& mp_i, int nzet_i, bool relat, const Eos& eos_i) ; |
| 265 | |
| 266 | |
| 267 | Star_rot(const Star_rot& ) ; ///< Copy constructor |
| 268 | |
| 269 | /** Constructor from a file (see \c sauve(FILE*) ). |
| 270 | * |
| 271 | * @param mp_i Mapping on which the star is constructed |
| 272 | * @param eos_i Equation of state of the stellar matter |
| 273 | * @param fich input file (must have been created by the function |
| 274 | * \c Star_rot::sauve ) |
| 275 | */ |
| 276 | Star_rot(Map& mp_i, const Eos& eos_i, FILE* fich) ; |
| 277 | |
| 278 | virtual ~Star_rot() ; ///< Destructor |
| 279 | |
| 280 | |
| 281 | // Memory management |
| 282 | // ----------------- |
| 283 | protected: |
| 284 | /// Deletes all the derived quantities |
| 285 | virtual void del_deriv() const ; |
| 286 | |
| 287 | /// Sets to \c 0x0 all the pointers on derived quantities |
| 288 | virtual void set_der_0x0() const ; |
| 289 | |
| 290 | /** Sets to \c ETATNONDEF (undefined state) the hydrodynamical |
| 291 | * quantities relative to the Eulerian observer. |
| 292 | */ |
| 293 | virtual void del_hydro_euler() ; |
| 294 | |
| 295 | |
| 296 | // Mutators / assignment |
| 297 | // --------------------- |
| 298 | public: |
| 299 | /// Assignment to another \c Star_rot |
| 300 | void operator=(const Star_rot& ) ; |
| 301 | |
| 302 | // Accessors |
| 303 | // --------- |
| 304 | public: |
| 305 | /** Returns \c true for a relativistic star, \c false for |
| 306 | * a Newtonian one |
| 307 | */ |
| 308 | bool is_relativistic() const {return relativistic; } ; |
| 309 | |
| 310 | /** Returns the central value of the rotation angular velocity |
| 311 | * (\c [f_unit] ) |
| 312 | */ |
| 313 | virtual double get_omega_c() const ; |
| 314 | |
| 315 | /// Returns the metric factor \e B |
| 316 | const Scalar& get_bbb() const {return bbb;} ; |
| 317 | |
| 318 | /// Returns the square of the metric factor \e A |
| 319 | const Scalar& get_a_car() const {return a_car;} ; |
| 320 | |
| 321 | /// Returns the square of the metric factor \e B |
| 322 | const Scalar& get_b_car() const {return b_car;} ; |
| 323 | |
| 324 | /// Returns the metric coefficient \f$N^\varphi\f$ |
| 325 | const Scalar& get_nphi() const {return nphi;} ; |
| 326 | |
| 327 | /** Returns the component \f$\tilde N^\varphi = N^\varphi r\sin\theta\f$ |
| 328 | * of the shift vector |
| 329 | */ |
| 330 | const Scalar& get_tnphi() const {return tnphi;} ; |
| 331 | |
| 332 | /// Returns the norm of \c u_euler |
| 333 | const Scalar& get_uuu() const {return uuu;} ; |
| 334 | |
| 335 | /** Returns the part of the Metric potential \f$\nu = \ln N\f$ = \c logn |
| 336 | * generated by the matter terms |
| 337 | */ |
| 338 | const Scalar& get_nuf() const {return nuf;} ; |
| 339 | |
| 340 | /** Returns the Part of the Metric potential \f$\nu = \ln N\f$ = \c logn |
| 341 | * generated by the quadratic terms |
| 342 | */ |
| 343 | const Scalar& get_nuq() const {return nuq;} ; |
| 344 | |
| 345 | /// Returns the Metric potential \f$\zeta = \ln(AN)\f$ |
| 346 | const Scalar& get_dzeta() const {return dzeta;} ; |
| 347 | |
| 348 | /// Returns the Metric potential \f$\tilde G = (NB-1) r\sin\theta\f$ |
| 349 | const Scalar& get_tggg() const {return tggg;} ; |
| 350 | |
| 351 | /** Returns the vector \f$W^i\f$ used in the decomposition of |
| 352 | * \c shift , |
| 353 | * following Shibata's prescription |
| 354 | * [\a Prog. \a Theor. \a Phys. \b 101 , 1199 (1999)] : |
| 355 | * \f[ |
| 356 | * N^i = {7\over 8} W^i - {1\over 8} |
| 357 | * \left(\nabla^i\chi+\nabla^iW^kx_k\right) |
| 358 | * \f] |
| 359 | * NB: \c w_shift contains the components of \f$W^i\f$ |
| 360 | * with respect to the Cartesian triad associated with the |
| 361 | * mapping \c mp . |
| 362 | */ |
| 363 | const Vector& get_w_shift() const {return w_shift;} ; |
| 364 | |
| 365 | /** Returns the scalar \f$\chi\f$ used in the decomposition of |
| 366 | * \c shift |
| 367 | * following Shibata's prescription |
| 368 | * [\a Prog. \a Theor. \a Phys. \b 101 , 1199 (1999)] : |
| 369 | * \f[ |
| 370 | * N^i = {7\over 8} W^i - {1\over 8} |
| 371 | * \left(\nabla^i\chi+\nabla^iW^kx_k\right) |
| 372 | * \f] |
| 373 | * NB: \c w_shift contains the components of \f$W^i\f$ |
| 374 | * with respect to the Cartesian triad associated with the |
| 375 | * mapping \c mp . |
| 376 | */ |
| 377 | const Scalar& get_khi_shift() const {return khi_shift;} ; |
| 378 | |
| 379 | /** Returns the tensor \f${\tilde K_{ij}}\f$ related to the extrinsic |
| 380 | * curvature tensor by \f${\tilde K_{ij}} = B^{-2} K_{ij}\f$. |
| 381 | * \c tkij contains the Cartesian components of |
| 382 | * \f${\tilde K_{ij}}\f$. |
| 383 | */ |
| 384 | const Sym_tensor& get_tkij() const {return tkij;} ; |
| 385 | |
| 386 | /** Returns the scalar \f$A^2 K_{ij} K^{ij}\f$. |
| 387 | * For axisymmetric stars, this quantity is related to the |
| 388 | * derivatives of \f$N^\varphi\f$ by |
| 389 | * \f[ |
| 390 | * A^2 K_{ij} K^{ij} = {B^2 \over 2 N^2} \, r^2\sin^2\theta \, |
| 391 | * \left[ \left( {\partial N^\varphi \over \partial r} \right) ^2 |
| 392 | * + {1\over r^2} \left( {\partial N^\varphi \over |
| 393 | * \partial \theta} \right) ^2 \right] \ . |
| 394 | * \f] |
| 395 | * In particular it is related to the quantities \f$k_1\f$ and \f$k_2\f$ |
| 396 | * introduced by Eqs. (3.7) and (3.8) of |
| 397 | * Bonazzola et al. \a Astron. \a Astrophys. \b 278 , 421 (1993) |
| 398 | * by |
| 399 | * \f[ |
| 400 | * A^2 K_{ij} K^{ij} = 2 A^2 (k_1^2 + k_2^2) \ . |
| 401 | * \f] |
| 402 | */ |
| 403 | const Scalar& get_ak_car() const {return ak_car;} ; |
| 404 | |
| 405 | // Outputs |
| 406 | // ------- |
| 407 | public: |
| 408 | virtual void sauve(FILE* ) const ; ///< Save in a file |
| 409 | |
| 410 | /// Display in polytropic units |
| 411 | virtual void display_poly(ostream& ) const ; |
| 412 | |
| 413 | protected: |
| 414 | /// Operator >> (virtual function called by the operator <<). |
| 415 | virtual ostream& operator>>(ostream& ) const ; |
| 416 | |
| 417 | /// Printing of some informations, excluding all global quantities |
| 418 | virtual void partial_display(ostream& ) const ; |
| 419 | |
| 420 | // Global quantities |
| 421 | // ----------------- |
| 422 | public: |
| 423 | |
| 424 | /** Description of the stellar surface: returns a 2-D \c Itbl |
| 425 | * containing the |
| 426 | * values of the domain index \e l on the surface at the |
| 427 | * collocation points in \f$(\theta', \phi')\f$. |
| 428 | * The stellar surface is defined as the location where |
| 429 | * the enthalpy (member \c ent ) vanishes. |
| 430 | */ |
| 431 | virtual const Itbl& l_surf() const ; |
| 432 | |
| 433 | virtual double mass_b() const ; ///< Baryon mass |
| 434 | virtual double mass_g() const ; ///< Gravitational mass |
| 435 | virtual double angu_mom() const ; ///< Angular momentum |
| 436 | virtual double tsw() const ; ///< Ratio T/W |
| 437 | |
| 438 | /** Error on the virial identity GRV2. |
| 439 | * This indicator is only valid for relativistic computations. |
| 440 | */ |
| 441 | virtual double grv2() const ; |
| 442 | |
| 443 | /** Error on the virial identity GRV3. |
| 444 | * The error is computed as the integral defined |
| 445 | * by Eq. (43) of [Gourgoulhon and Bonazzola, |
| 446 | * \a Class. \a Quantum \a Grav. \b 11, 443 (1994)] divided by |
| 447 | * the integral of the matter terms. |
| 448 | * |
| 449 | * @param ost output stream to give details of the computation; |
| 450 | * if set to 0x0 [default value], no details will be |
| 451 | * given. |
| 452 | * |
| 453 | */ |
| 454 | virtual double grv3(ostream* ost = 0x0) const ; |
| 455 | |
| 456 | virtual double r_circ() const ; ///< Circumferential radius |
| 457 | virtual double aplat() const ; ///< Flatening r_pole/r_eq |
| 458 | virtual double area() const ; ///< Integrated surface area in \f${\rm km}^2\f$ |
| 459 | /// Mean star radius from the area \f$ r_{\rm mean} = \sqrt{\mathcal{A}} / 4\pi\f$ |
| 460 | virtual double mean_radius() const ; |
| 461 | virtual double z_eqf() const ; ///< Forward redshift factor at equator |
| 462 | virtual double z_eqb() const ; ///< Backward redshift factor at equator |
| 463 | virtual double z_pole() const ; ///< Redshift factor at North pole |
| 464 | |
| 465 | /** Quadrupole moment. |
| 466 | * The quadrupole moment \e Q is defined according to Eq. (7) of |
| 467 | * [Salgado, Bonazzola, Gourgoulhon and Haensel, \a Astron. \a Astrophys. |
| 468 | * \b 291 , 155 (1994)]. At the Newtonian limit it is related to |
| 469 | * the component \f${\bar I}_{zz}\f$ of the MTW (1973) reduced quadrupole |
| 470 | * moment \f${\bar I}_{ij}\f$ by: \f$Q = -3/2 {\bar I}_{zz}\f$. |
| 471 | * Note that \e Q is the negative of the quadrupole moment defined |
| 472 | * by Laarakkers and Poisson, \a Astrophys. \a J. \b 512 , 282 (1999). |
| 473 | */ |
| 474 | virtual double mom_quad() const ; |
| 475 | |
| 476 | /** Circumferential radius of the innermost stable circular orbit (ISCO). |
| 477 | * |
| 478 | * @param ost output stream to give details of the computation; |
| 479 | * if set to 0x0 [default value], no details will be |
| 480 | * given. |
| 481 | */ |
| 482 | virtual double r_isco(ostream* ost = 0x0) const ; |
| 483 | |
| 484 | /// Orbital frequency at the innermost stable circular orbit (ISCO). |
| 485 | virtual double f_isco() const ; |
| 486 | |
| 487 | /// Energy of a particle on the ISCO |
| 488 | virtual double espec_isco() const ; |
| 489 | |
| 490 | /// Angular momentum of a particle on the ISCO |
| 491 | virtual double lspec_isco() const ; |
| 492 | |
| 493 | /// Orbital frequency at the equator. |
| 494 | virtual double f_eq() const ; |
| 495 | |
| 496 | |
| 497 | // Computational routines |
| 498 | // ---------------------- |
| 499 | public: |
| 500 | /** Computes the hydrodynamical quantities relative to the Eulerian |
| 501 | * observer from those in the fluid frame. |
| 502 | * |
| 503 | * The calculation is performed starting from the quantities |
| 504 | * \c ent , \c ener , \c press , and \c a_car , |
| 505 | * which are supposed to be up to date. |
| 506 | * From these, the following fields are updated: |
| 507 | * \c gam_euler , \c u_euler , \c ener_euler , \c s_euler . |
| 508 | * |
| 509 | */ |
| 510 | virtual void hydro_euler() ; |
| 511 | |
| 512 | /** Computes metric coefficients from known potentials. |
| 513 | * |
| 514 | * The calculation is performed starting from the quantities |
| 515 | * \c logn , \c dzeta , \c tggg and \c shift , |
| 516 | * which are supposed to be up to date. |
| 517 | * From these, the following fields are updated: |
| 518 | * \c nnn , \c a_car , \c bbb and \c b_car, as well as |
| 519 | * the 3-metric \c gamma. |
| 520 | * |
| 521 | */ |
| 522 | void update_metric() ; |
| 523 | |
| 524 | /** Computes \c shift from \c w_shift and \c khi_shift |
| 525 | * according to Shibata's prescription |
| 526 | * [\a Prog. \a Theor. \a Phys. \b 101 , 1199 (1999)] : |
| 527 | * \f[ |
| 528 | * N^i = {7\over 8} W^i - {1\over 8} |
| 529 | * \left(\nabla^i\chi+\nabla^iW^kx_k\right) |
| 530 | * \f] |
| 531 | */ |
| 532 | void fait_shift() ; |
| 533 | |
| 534 | /** Computes \c tnphi and \c nphi from the Cartesian |
| 535 | * components of the shift, stored in \c shift . |
| 536 | */ |
| 537 | void fait_nphi() ; |
| 538 | |
| 539 | /** Computes \c tkij and \c ak_car from |
| 540 | * \c shift , \c nnn and \c b_car . |
| 541 | */ |
| 542 | void extrinsic_curvature() ; |
| 543 | |
| 544 | /** Computes the coefficient \f$\lambda\f$ which ensures that the |
| 545 | * GRV2 virial identity is satisfied. |
| 546 | * \f$\lambda\f$ is the coefficient by which one must multiply |
| 547 | * the quadratic source term \f$\sigma_q\f$ of the 2-D Poisson equation |
| 548 | * \f[ |
| 549 | * \Delta_2 u = \sigma_m + \sigma_q |
| 550 | * \f] |
| 551 | * in order that the total source does not contain any monopolar term, |
| 552 | * i.e. in order that |
| 553 | * \f[ |
| 554 | * \int_0^{2\pi} \int_0^{+\infty} \sigma(r, \theta) |
| 555 | * \, r \, dr \, d\theta = 0 \ , |
| 556 | * \f] |
| 557 | * where \f$\sigma = \sigma_m + \sigma_q\f$. |
| 558 | * \f$\lambda\f$ is computed according to the formula |
| 559 | * \f[ |
| 560 | * \lambda = - { \int_0^{2\pi} \int_0^{+\infty} \sigma_m(r, \theta) |
| 561 | * \, r \, dr \, d\theta \over |
| 562 | * \int_0^{2\pi} \int_0^{+\infty} \sigma_q(r, \theta) |
| 563 | * \, r \, dr \, d\theta } \ . |
| 564 | * \f] |
| 565 | * Then, by construction, the new source |
| 566 | * \f$\sigma' = \sigma_m + \lambda \sigma_q\f$ has a vanishing monopolar |
| 567 | * term. |
| 568 | * |
| 569 | * @param sou_m [input] matter source term \f$\sigma_m\f$ |
| 570 | * @param sou_q [input] quadratic source term \f$\sigma_q\f$ |
| 571 | * @return value of \f$\lambda\f$ |
| 572 | */ |
| 573 | static double lambda_grv2(const Scalar& sou_m, const Scalar& sou_q) ; |
| 574 | |
| 575 | /** Computes an equilibrium configuration. |
| 576 | * |
| 577 | * @param ent_c [input] Central enthalpy |
| 578 | * @param omega0 [input] Requested angular velocity |
| 579 | * (if \c fact_omega=1. ) |
| 580 | * @param fact_omega [input] 1.01 = search for the Keplerian frequency, |
| 581 | * 1. = otherwise. |
| 582 | * @param nzadapt [input] Number of (inner) domains where the mapping |
| 583 | * adaptation to an iso-enthalpy surface |
| 584 | * should be performed |
| 585 | * @param ent_limit [input] 1-D \c Tbl of dimension \c nzet which |
| 586 | * defines the enthalpy at the outer boundary |
| 587 | * of each domain |
| 588 | * @param icontrol [input] Set of integer parameters (stored as a |
| 589 | * 1-D \c Itbl of size 8) to control the |
| 590 | * iteration: |
| 591 | * \li \c icontrol(0) = mer_max : maximum number of steps |
| 592 | * \li \c icontrol(1) = mer_rot : step at which the rotation is |
| 593 | * switched on |
| 594 | * \li \c icontrol(2) = mer_change_omega : step at which the rotation |
| 595 | * velocity is changed to reach the final one |
| 596 | * \li \c icontrol(3) = mer_fix_omega : step at which the final |
| 597 | * rotation velocity must have been reached |
| 598 | * \li \c icontrol(4) = mer_mass : the absolute value of |
| 599 | * \c mer_mass is the step from which the |
| 600 | * baryon mass is forced to converge, |
| 601 | * by varying the central enthalpy |
| 602 | * (\c mer_mass>0 ) or the angular |
| 603 | * velocity (\c mer_mass<0 ) |
| 604 | * \li \c icontrol(5) = mermax_poisson : maximum number of steps in |
| 605 | * \c Map_et::poisson |
| 606 | * \li \c icontrol(6) = mer_triax : step at which the 3-D |
| 607 | * perturbation is switched on |
| 608 | * \li \c icontrol(7) = delta_mer_kep : number of steps |
| 609 | * after \c mer_fix_omega when \c omega |
| 610 | * starts to be increased by \c fact_omega |
| 611 | * to search for the Keplerian velocity |
| 612 | * |
| 613 | * @param control [input] Set of parameters (stored as a |
| 614 | * 1-D \c Tbl of size 7) to control the |
| 615 | * iteration: |
| 616 | * \li \c control(0) = precis : threshold on the enthalpy relative |
| 617 | * change for ending the computation |
| 618 | * \li \c control(1) = omega_ini : initial angular velocity, |
| 619 | * switched on only if \c mer_rot<0 , |
| 620 | * otherwise 0 is used |
| 621 | * \li \c control(2) = relax : relaxation factor in the main |
| 622 | * iteration |
| 623 | * \li \c control(3) = relax_poisson : relaxation factor in |
| 624 | * \c Map_et::poisson |
| 625 | * \li \c control(4) = thres_adapt : threshold on dH/dr for |
| 626 | * freezing the adaptation of the mapping |
| 627 | * \li \c control(5) = ampli_triax : relative amplitude of |
| 628 | * the 3-D perturbation |
| 629 | * \li \c control(6) = precis_adapt : precision for |
| 630 | * \c Map_et::adapt |
| 631 | * |
| 632 | * @param mbar_wanted [input] Requested baryon mass (effective only |
| 633 | * if \c mer_mass > \c mer_max ) |
| 634 | * @param aexp_mass [input] Exponent for the increase factor of the |
| 635 | * central enthalpy to converge to the |
| 636 | * requested baryon mass |
| 637 | * @param diff [output] 1-D \c Tbl of size 7 for the storage of |
| 638 | * some error indicators : |
| 639 | * \li \c diff(0) : Relative change in the enthalpy field |
| 640 | * between two successive steps |
| 641 | * \li \c diff(1) : Relative error in the resolution of the |
| 642 | * Poisson equation for \c nuf |
| 643 | * \li \c diff(2) : Relative error in the resolution of the |
| 644 | * Poisson equation for \c nuq |
| 645 | * \li \c diff(3) : Relative error in the resolution of the |
| 646 | * Poisson equation for \c dzeta |
| 647 | * \li \c diff(4) : Relative error in the resolution of the |
| 648 | * Poisson equation for \c tggg |
| 649 | * \li \c diff(5) : Relative error in the resolution of the |
| 650 | * equation for \c shift (x comp.) |
| 651 | * \li \c diff(6) : Relative error in the resolution of the |
| 652 | * equation for \c shift (y comp.) |
| 653 | */ |
| 654 | virtual void equilibrium(double ent_c, double omega0, double fact_omega, |
| 655 | int nzadapt, const Tbl& ent_limit, |
| 656 | const Itbl& icontrol, const Tbl& control, |
| 657 | double mbar_wanted, double aexp_mass, |
| 658 | Tbl& diff, Param* = 0x0) ; |
| 659 | |
| 660 | |
| 661 | }; |
| 662 | |
| 663 | } |
| 664 | #endif |