| 1 | /* |
| 2 | * Definition of Lorene class Spheroid |
| 3 | * |
| 4 | */ |
| 5 | |
| 6 | /* |
| 7 | * Copyright (c) 2006 Nicolas Vasset, Jerome Novak & Jose-Luis Jaramillo |
| 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 version 2 |
| 13 | * as published by the Free Software Foundation. |
| 14 | * |
| 15 | * LORENE is distributed in the hope that it will be useful, |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | * GNU General Public License for more details. |
| 19 | * |
| 20 | * You should have received a copy of the GNU General Public License |
| 21 | * along with LORENE; if not, write to the Free Software |
| 22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 23 | * |
| 24 | */ |
| 25 | |
| 26 | #ifndef __SPHEROID_H_ |
| 27 | #define __SPHEROID_H_ |
| 28 | |
| 29 | /* |
| 30 | * $Id: spheroid.h,v 1.13 2014/10/13 08:52:36 j_novak Exp $ |
| 31 | * $Log: spheroid.h,v $ |
| 32 | * Revision 1.13 2014/10/13 08:52:36 j_novak |
| 33 | * Lorene classes and functions now belong to the namespace Lorene. |
| 34 | * |
| 35 | * Revision 1.12 2008/12/10 13:53:56 jl_jaramillo |
| 36 | * versions developed at Meudon in Novemver 2008 |
| 37 | * |
| 38 | * Revision 1.11 2008/11/12 15:18:32 n_vasset |
| 39 | * New definition for the computation of Ricci scalar (instead of Ricci |
| 40 | * tensor previously) |
| 41 | * |
| 42 | * Revision 1.10 2008/07/09 08:48:23 n_vasset |
| 43 | * protected member zeta added. |
| 44 | * |
| 45 | * Revision 1.9 2008/06/04 12:31:56 n_vasset |
| 46 | * new functions multipole_mass and multipole_angu. |
| 47 | * |
| 48 | * Revision 1.8 2008/06/03 14:32:23 n_vasset |
| 49 | * dzpuis corrections (provisory). New function mass implemented. |
| 50 | * |
| 51 | * Revision 1.7 2006/09/07 08:39:43 j_novak |
| 52 | * Minor changes. |
| 53 | * |
| 54 | * Revision 1.6 2006/07/03 10:12:51 n_vasset |
| 55 | * adding of flag isphere |
| 56 | * |
| 57 | * Revision 1.5 2006/06/13 08:07:55 n_vasset |
| 58 | * Addition of 2 members |
| 59 | * |
| 60 | * Revision 1.4 2006/06/08 09:50:49 n_vasset |
| 61 | * corrected version for coordinates transformation |
| 62 | * |
| 63 | * Revision 1.3 2006/06/07 14:32:24 n_vasset |
| 64 | * modified constructor for 3d projector (Sym_tensor to Tensor) |
| 65 | * |
| 66 | * Revision 1.2 2006/05/26 13:25:42 j_novak |
| 67 | * Removed a 'const' |
| 68 | * |
| 69 | * Revision 1.1 2006/05/26 13:20:42 j_novak |
| 70 | * New class spheroid. |
| 71 | * |
| 72 | * |
| 73 | * |
| 74 | * $Header: /cvsroot/Lorene/C++/Include/spheroid.h,v 1.13 2014/10/13 08:52:36 j_novak Exp $ |
| 75 | * |
| 76 | */ |
| 77 | #include "metric.h" |
| 78 | |
| 79 | namespace Lorene { |
| 80 | /** |
| 81 | * Spheroidal 2-surfaces embedded in a time-slice of the 3+1 formalism.\ingroup (star) |
| 82 | * |
| 83 | */ |
| 84 | class Spheroid { |
| 85 | |
| 86 | |
| 87 | // Data : |
| 88 | // ----- |
| 89 | protected: |
| 90 | ///The location of the 2-surface as \e r = \c h_surf\f$(\theta, \varphi)\f$ |
| 91 | Scalar h_surf ; |
| 92 | |
| 93 | /** The jacobian of the adaptation of coordinates |
| 94 | (contravariant/covariant representation)*/ |
| 95 | |
| 96 | Tensor jac2d ; |
| 97 | |
| 98 | /** The 3-d projector on the 2-surface (contravariant-covariant form). |
| 99 | **/ |
| 100 | Tensor proj ; |
| 101 | |
| 102 | /** The 3-d covariant degenerated 2-metric on the surface*/ |
| 103 | |
| 104 | Sym_tensor qq ; |
| 105 | |
| 106 | /** The adapted normal vector field to spheroid in the 3-slice */ |
| 107 | |
| 108 | Vector ss ; |
| 109 | |
| 110 | /** The conformal Killing vector field on the 2-surface |
| 111 | (set to by default to the axial vector associated with coordinate \f$ \varphi \f$) */ |
| 112 | |
| 113 | Vector ephi; |
| 114 | |
| 115 | Metric qab ; /// Induced metric on the 2-surface \f$ q_{ab} \f$ |
| 116 | |
| 117 | Scalar ricci; /// The ricci scalar on the 2-surface |
| 118 | |
| 119 | /** Extrinsic curvature of the 2-surface in the 3-slice. |
| 120 | * \f$ H_{ab} \f$ (covariant representation) |
| 121 | */ |
| 122 | Sym_tensor hh ; |
| 123 | |
| 124 | Scalar trk ; ///< Trace \e K of the extrinsic curvature of the 3-slice |
| 125 | |
| 126 | /** Normal-tangent component of the extrinsic curvature of the 3-slice. |
| 127 | * \f$ L_a \f$ (covariant representation) |
| 128 | */ |
| 129 | Vector ll ; |
| 130 | |
| 131 | /** Tangent components of the extrinsic curvature of the 3-slice. |
| 132 | * \f$ J_{ab} \f$ (covariant representation) |
| 133 | */ |
| 134 | Sym_tensor jj ; |
| 135 | |
| 136 | /** Normalization function for the outgoing null vector \b l. |
| 137 | */ |
| 138 | Scalar fff; |
| 139 | |
| 140 | /** Normalization function for the ingoing null vector \b k. |
| 141 | */ |
| 142 | |
| 143 | Scalar ggg; |
| 144 | |
| 145 | /*** */ |
| 146 | |
| 147 | Scalar zeta; |
| 148 | |
| 149 | /** Flag to know whether the horizon is geometrically round or distorted*/ |
| 150 | |
| 151 | bool issphere ; |
| 152 | |
| 153 | |
| 154 | // Derived data : |
| 155 | // ------------ |
| 156 | protected: |
| 157 | mutable Scalar* p_sqrt_q ; ///< Surface element \f$\sqrt{\det q_{ab}} \f$ |
| 158 | mutable double* p_area ; ///< The area of the 2-surface |
| 159 | mutable double* p_angu_mom ; ///< The angular momentum |
| 160 | mutable double* p_mass ; ///< Mass defined from angular momentum |
| 161 | mutable double* p_multipole_mass ;///< Mass multipole for the spheroid. |
| 162 | mutable double* p_multipole_angu ;///< Angular momentum multipole for the spheroid. |
| 163 | mutable double* p_epsilon_A_minus_one ; /// Refined Penrose parameter, difference wrt one. |
| 164 | mutable double* p_epsilon_P_minus_one ; /// Classical Penrose parameter, difference wrt one. |
| 165 | mutable Scalar* p_theta_plus ; ///< Null outgoing expansion |
| 166 | mutable Scalar* p_theta_minus ; ///< Null ingoing expansion |
| 167 | mutable Sym_tensor* p_shear ; ///< The shear tensor |
| 168 | mutable Tensor* p_delta ; /// The delta tensorial fields linked to Christoffel symbols |
| 169 | |
| 170 | |
| 171 | |
| 172 | // Constructors - Destructor |
| 173 | // ------------------------- |
| 174 | public: |
| 175 | /** Standard constructor. |
| 176 | * The input mapping must be defined on a mono-domain angular grid |
| 177 | * (see \c Mg3d::get_angu_mono_domain() for details). |
| 178 | */ |
| 179 | Spheroid(const Map_af& map, double radius) ; |
| 180 | /** Constructor of a spheroid embedded in a 3-slice (\c Time_slice ) of 3+1 |
| 181 | * formalism. |
| 182 | * This is done from the \c Time_slice data. |
| 183 | * @param h_in : the location of the surface \e r = h_in (WARNING:must be |
| 184 | defined on a mono-domain angular grid) |
| 185 | * @param gamij : the 3-metric on the 3-slice |
| 186 | * @param Kij : the extrinsic curvature of the 3-slice |
| 187 | * (covariant representation) |
| 188 | */ |
| 189 | Spheroid(const Scalar& h_in, const Metric& gamij, const Sym_tensor& Kij) ; |
| 190 | Spheroid(const Spheroid& ) ; ///< Copy constructor |
| 191 | |
| 192 | /// Constructor from a file (see \c sauve(FILE*) ) |
| 193 | Spheroid(FILE* ) ; |
| 194 | |
| 195 | virtual ~Spheroid() ; ///< Destructor |
| 196 | |
| 197 | |
| 198 | // Memory management |
| 199 | // ----------------- |
| 200 | protected: |
| 201 | /// Deletes all the derived quantities |
| 202 | virtual void del_deriv() const ; |
| 203 | |
| 204 | /// Sets to \c 0x0 all the pointers on derived quantities |
| 205 | void set_der_0x0() const ; |
| 206 | |
| 207 | |
| 208 | // Mutators / assignment |
| 209 | // --------------------- |
| 210 | public: |
| 211 | /// Assignment to another Spheroid |
| 212 | void operator=(const Spheroid&) ; |
| 213 | |
| 214 | |
| 215 | /// Assigns the conformal Killing vector field to phi. |
| 216 | void set_ephi(const Scalar&) ; |
| 217 | |
| 218 | |
| 219 | // Accessors |
| 220 | // --------- |
| 221 | public: |
| 222 | /// Returns the field \c h_surf |
| 223 | const Scalar& get_hsurf() const {return h_surf ; } ; |
| 224 | |
| 225 | /// Returns the metric \f$ q_{ab} \f$ |
| 226 | const Metric& get_qab() const {return qab ; } ; |
| 227 | |
| 228 | /// Returns the 2-ricci scalar \f$ R = q^{ab}R_{ab} \f$ |
| 229 | const Scalar& get_ricci() const {return ricci ; } ; |
| 230 | |
| 231 | /// Returns the symmetric tensor \f$ H_{ab} \f$ |
| 232 | const Sym_tensor& get_hh() const {return hh ; } ; |
| 233 | |
| 234 | /// returns the 3-d degenerate 2-metric \f$ Q_{ab}\f$ |
| 235 | const Sym_tensor& get_qq() const {return qq ; } ; |
| 236 | |
| 237 | /// returns the 3-d projector on 2-surface \f$ Pi \f$ |
| 238 | const Tensor& get_proj() const {return proj ; } ; |
| 239 | |
| 240 | /// returns the 2-d jacobian of coordinate transformation \f$ J \f$ |
| 241 | const Tensor& get_jac2d() const {return jac2d ; } ; |
| 242 | |
| 243 | /// Returns the trace \c K on the 2-surface |
| 244 | const Scalar& get_trk() const {return trk; } ; |
| 245 | |
| 246 | /// Returns the vector \f$ L_a \f$ |
| 247 | const Vector& get_ll() const {return ll;} ; |
| 248 | |
| 249 | /// Returns the vector \f$ S_a \f$ |
| 250 | const Vector& get_ss() const {return ss;} ; |
| 251 | |
| 252 | /// Returns the conformal Killing symmetry vector on the 2-surface |
| 253 | const Vector& get_ephi() const {return ephi;}; |
| 254 | |
| 255 | ///Returns the symmetric tensor \f$ J_{ab} \f$ |
| 256 | const Sym_tensor& get_jj() const {return jj;} ; |
| 257 | |
| 258 | ///Returns the normalization scalar \c F |
| 259 | const Scalar& get_fff() const {return fff;} ; |
| 260 | |
| 261 | ///Returns the normalization scalar \c G |
| 262 | const Scalar& get_ggg() const {return ggg;} ; |
| 263 | |
| 264 | /// Returns the flag saying whether or not the horizon is geometrically round |
| 265 | bool get_issphere() const{return issphere;}; |
| 266 | |
| 267 | /// Sets the field \c h_surf |
| 268 | Scalar& set_hsurf() {del_deriv() ; return h_surf ; } ; |
| 269 | |
| 270 | /// Sets the modified metric (non degenerated) \f$ q_{ab} \f$ |
| 271 | Metric& set_qab() {del_deriv() ; return qab ; } ; |
| 272 | |
| 273 | /// Sets the 2-Ricci scalar \f$ R = q^{ab}R_{ab} \f$ |
| 274 | Scalar& set_ricci() {del_deriv() ; return ricci ; } ; |
| 275 | |
| 276 | /// Sets the degenerated metric \f$ Q_{ab} \f$ |
| 277 | Sym_tensor& set_qq() {del_deriv() ; return qq ; } ; |
| 278 | |
| 279 | /// Sets the projector \f$ Pi \f$ |
| 280 | Tensor& set_proj() {del_deriv() ; return proj ; } ; |
| 281 | |
| 282 | /// Sets the symmetric tensor \f$ H_{ab} \f$ |
| 283 | Sym_tensor& set_hh() {del_deriv() ; return hh ; } ; |
| 284 | |
| 285 | /// Sets the trace \c K on the 2-surface |
| 286 | Scalar& set_trk() {del_deriv() ; return trk; } ; |
| 287 | |
| 288 | /// Sets the vector \f$ L_a \f$ |
| 289 | Vector& set_ll() {del_deriv() ; return ll;} ; |
| 290 | |
| 291 | /// Sets the vector \f$ s_a \f$ |
| 292 | Vector& set_ss() {del_deriv() ; return ss;} ; |
| 293 | |
| 294 | ///Sets the symmetric tensor \f$ J_{ab} \f$ |
| 295 | Sym_tensor& set_jj() {del_deriv() ; return jj;} ; |
| 296 | |
| 297 | ///Sets the normalization factor \c F |
| 298 | Scalar& set_fff() {del_deriv() ; return fff;} ; |
| 299 | |
| 300 | ///Sets the normalization factor \c G |
| 301 | Scalar& set_ggg() {del_deriv() ; return ggg;} ; |
| 302 | |
| 303 | /// Sets the boolean linked to geometrical shape of the horizon |
| 304 | bool set_issphere() {del_deriv() ; return issphere; }; |
| 305 | |
| 306 | /// Updates from the 3-slice data |
| 307 | void update_from_tslice(const Metric& gamij, const Sym_tensor& Kij) ; |
| 308 | |
| 309 | // Computational functions |
| 310 | // ----------------------- |
| 311 | public: |
| 312 | |
| 313 | /// Computes the normal vector field to the 2-surface |
| 314 | // Vector compute_normal(const Metric& gamij) ; |
| 315 | |
| 316 | /// Computes the square root of the determinant of \f$ q_{ab} \f$. |
| 317 | const Scalar& sqrt_q() const ; |
| 318 | |
| 319 | /** Computes the area of the 2-surface. |
| 320 | * This is defined as \f[ |
| 321 | * {\cal A} = \int h^2 \sqrt{\det q_{ab}} \sin \theta {\rm d}\theta |
| 322 | * {\rm d}\varphi \f] */ |
| 323 | double area() const ; |
| 324 | |
| 325 | /** Computes the angular momentum with respect to a divergence-free vector field |
| 326 | * tangent to the 2-surface. |
| 327 | * This is defined as \f[ |
| 328 | * {\cal J} = \int h^2 L_i \phi^i \sqrt{\det q_{ab}} \sin \theta {\rm d}\theta |
| 329 | * {\rm d}\varphi \f] |
| 330 | * @param phi : the divergence-free vector field \f$ \phi \f$ |
| 331 | */ |
| 332 | double angu_mom() const ; |
| 333 | |
| 334 | /** Computes the mass as defined from the calculus of angular momentum, |
| 335 | * done with respect to a divergence free tangent vector field \f$ phi \f$. |
| 336 | * Spheroid has to be a real sphere (flag issphere true), of constant radius \f[R_{s} \f]. |
| 337 | * defined as \f[ M = \frac{1}{2 R_{s}} \sqrt{R_{s}^{4} + 4{\cal J}^{2}} \f] |
| 338 | */ |
| 339 | |
| 340 | double mass() const; |
| 341 | |
| 342 | /** Computes the mass multipole of a given order for the spheroid, |
| 343 | * assumed to be spherical. |
| 344 | * WARNING: For technical reasons, only even orders are supported by the code. |
| 345 | */ |
| 346 | |
| 347 | double multipole_mass(const int order) const; |
| 348 | |
| 349 | |
| 350 | /** Computes the angular multipole of a given order for the spheroid, |
| 351 | * assumed to be spherical. \f$ phi \f$ is a divergence free tangent vector field. |
| 352 | * WARNING:order has to be strictly higher than zero (no topological defects here...), and an odd number for technical reasons. |
| 353 | */ |
| 354 | |
| 355 | double multipole_angu(const int order) const; |
| 356 | |
| 357 | |
| 358 | |
| 359 | /// Computation of the refined Penrose parameter for axisymmetric spacetimes, and its difference wrt one. |
| 360 | double epsilon_A_minus_one() const; |
| 361 | |
| 362 | /** Computation of the classical Penrose parameter, and its difference wrt one. |
| 363 | * To use in replacement of epsilon_A_minus_one when the computed spacetime is not axisymmetric. |
| 364 | */ |
| 365 | double epsilon_P_minus_one() const; |
| 366 | |
| 367 | /// Computes the outgoing null expansion \f$ \theta_+ \f$. |
| 368 | const Scalar& theta_plus() const ; |
| 369 | |
| 370 | /// Computes the ingoing null expansion \f$ \theta_- \f$. |
| 371 | const Scalar& theta_minus() const ; |
| 372 | |
| 373 | /// Computes the shear of the 2-surface \f$ \sigma_{ab} \f$. |
| 374 | const Sym_tensor& shear () const ; |
| 375 | |
| 376 | /// Computes the round covariant derivative on the spheroid |
| 377 | |
| 378 | Tensor derive_cov2dflat(const Tensor& uu) const ; |
| 379 | |
| 380 | ///Computes the delta coefficients for covariant derivative |
| 381 | |
| 382 | const Tensor& delta() const; |
| 383 | |
| 384 | /// Computes the total covariant derivative on the spheroid |
| 385 | |
| 386 | Tensor derive_cov2d(const Tensor& uu) const ; |
| 387 | |
| 388 | // Outputs |
| 389 | // ------- |
| 390 | public: |
| 391 | virtual void sauve(FILE *) const ; ///< Save in a file |
| 392 | |
| 393 | /// Display |
| 394 | friend ostream& operator<<(ostream& , const Spheroid& ) ; |
| 395 | |
| 396 | }; |
| 397 | |
| 398 | ostream& operator<<(ostream& , const Spheroid& ) ; |
| 399 | |
| 400 | //------------------ |
| 401 | // Class App_hor |
| 402 | //------------------ |
| 403 | |
| 404 | /** |
| 405 | * Class describing an apparent horizon. It is derived from the class \c Spheroid, |
| 406 | * with the property that the outgoing null expansion \f$ \theta_+ = 0\f$. |
| 407 | */ |
| 408 | class App_hor : public Spheroid { |
| 409 | |
| 410 | // Constructors - Destructor |
| 411 | // ------------------------- |
| 412 | public: |
| 413 | App_hor(const Mg3d& grid_angu, double radius) ; ///< Standard constructor |
| 414 | /** Constructor of an apparent horizon embedded in a 3-slice (\c Time_slice ) |
| 415 | * of 3+1 formalism. |
| 416 | * This is done from the \c Time_slice data. |
| 417 | * @param h_in : the location of the surface \e r = h_in |
| 418 | * @param gamij : the 3-metric on the 3-slice |
| 419 | * @param Kij : the extrinsic curvature of the 3-slice |
| 420 | * (covariant representation) |
| 421 | */ |
| 422 | App_hor(const Scalar& h_in, const Metric& gamij, const Sym_tensor& Kij) ; |
| 423 | App_hor(const App_hor& ) ; ///< Copy constructor |
| 424 | |
| 425 | /// Constructor from a file (see \c sauve(FILE*) ) |
| 426 | App_hor(FILE* ) ; |
| 427 | |
| 428 | virtual ~App_hor() ; ///< Destructor |
| 429 | |
| 430 | // Mutators / assignment |
| 431 | // --------------------- |
| 432 | public: |
| 433 | /// Assignment to another App_hor |
| 434 | void operator=(const App_hor&) ; |
| 435 | |
| 436 | bool check_expansion(double thres = 1.e-7) const ; |
| 437 | |
| 438 | /// Lie derivative of shear tensor with respect to the evolution vector field. |
| 439 | const Sym_tensor& lie_derive_shear(const Scalar& bb, const Scalar& lapse) ; |
| 440 | |
| 441 | /** Lie derivative of the null outgoing expansion rate with respect to the |
| 442 | * evolution vector field. |
| 443 | */ |
| 444 | const Sym_tensor& lie_derive_theta_plus(const Scalar& bb, const Scalar& lapse); |
| 445 | |
| 446 | /** Lie derivative of the null ingoing expansion rate with respect to the |
| 447 | * evolution vector field. |
| 448 | */ |
| 449 | const Sym_tensor& lie_derive_theta_minus(const Scalar& bb, const Scalar& lapse); |
| 450 | |
| 451 | /// Lie derivative of 2-metric with respect to the evolution vector field. |
| 452 | const Sym_tensor& lie_derive_q_ab(const Scalar& bb, const Scalar& lapse) ; |
| 453 | |
| 454 | /** non-affinity (or surface gravity) with respect to the outgoing null vector |
| 455 | * field |
| 456 | */ |
| 457 | const Scalar& l_non_affinity(const Scalar& bb, const Scalar& lapse) ; |
| 458 | |
| 459 | } ; |
| 460 | |
| 461 | |
| 462 | } |
| 463 | #endif |