| 1 | /* |
| 2 | * Definition of Lorene class App_hor |
| 3 | * |
| 4 | */ |
| 5 | |
| 6 | /* |
| 7 | * Copyright (c) 2005 Lap-Ming Lin & Jerome Novak |
| 8 | * |
| 9 | * |
| 10 | * This file is part of LORENE. |
| 11 | * |
| 12 | * LORENE is free software; you can redistribute it and/or modify |
| 13 | * it under the terms of the GNU General Public License version 2 |
| 14 | * as published by the Free Software Foundation. |
| 15 | * |
| 16 | * LORENE is distributed in the hope that it will be useful, |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 | * GNU General Public License for more details. |
| 20 | * |
| 21 | * You should have received a copy of the GNU General Public License |
| 22 | * along with LORENE; if not, write to the Free Software |
| 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 24 | * |
| 25 | */ |
| 26 | |
| 27 | #ifndef __APP_HOR_H_ |
| 28 | #define __APP_HOR_H_ |
| 29 | |
| 30 | /* |
| 31 | * $Id: app_hor.h,v 1.6 2014/10/13 08:52:31 j_novak Exp $ |
| 32 | * $Log: app_hor.h,v $ |
| 33 | * Revision 1.6 2014/10/13 08:52:31 j_novak |
| 34 | * Lorene classes and functions now belong to the namespace Lorene. |
| 35 | * |
| 36 | * Revision 1.5 2012/01/02 13:52:57 j_novak |
| 37 | * New parameter 'verbose' to get less output if needed. |
| 38 | * |
| 39 | * Revision 1.4 2005/12/09 09:35:59 lm_lin |
| 40 | * |
| 41 | * Minor fix in the documentation. |
| 42 | * |
| 43 | * Revision 1.3 2005/12/07 11:11:30 lm_lin |
| 44 | * |
| 45 | * Add option to turn off screen output during iterations. |
| 46 | * |
| 47 | * Revision 1.2 2005/11/17 14:19:49 lm_lin |
| 48 | * |
| 49 | * Check the expansion function evaluated on the apparent horizon after the |
| 50 | * iteration of the 2-surface converges. |
| 51 | * |
| 52 | * Revision 1.1 2005/10/13 08:51:14 j_novak |
| 53 | * New stuff for apparent horizon finder. For the moment, there is only an |
| 54 | * external function. A class should come soon... |
| 55 | * |
| 56 | * $Header: /cvsroot/Lorene/C++/Include/app_hor.h,v 1.6 2014/10/13 08:52:31 j_novak Exp $ |
| 57 | * |
| 58 | */ |
| 59 | |
| 60 | |
| 61 | // Headers Lorene |
| 62 | #include "metric.h" |
| 63 | |
| 64 | namespace Lorene { |
| 65 | /** |
| 66 | * Class for apparent horizon (under heavy development) |
| 67 | * |
| 68 | */ |
| 69 | |
| 70 | // Function (Apparent horizon finder) |
| 71 | //----------------------------------------------- |
| 72 | |
| 73 | /** |
| 74 | * Apparent horizon finder. \ingroup (star) |
| 75 | * |
| 76 | * Find the apparent horizon (AH) on a spatial slice for given |
| 77 | * 3-metric \f$\gamma_{ij}\f$ and extrinsic curvature \f$K_{ij}\f$. |
| 78 | * Method: We solve the apparent-horizon equation |
| 79 | * \f$\Theta=0\f$ (where \f$\Theta\f$ is the expansion function |
| 80 | * of the outgoing null geodesic) as a generalized angular Poisson |
| 81 | * equation (\f$\Delta_{\theta\phi}u+\lambda u=\sigma\f$) in the form: |
| 82 | * |
| 83 | * \f[ |
| 84 | * \Delta_{\theta\phi}h - 2h = \Psi^4 |DF| h^2\Theta + |
| 85 | * \Delta_{\theta\phi}h - 2h |
| 86 | * \f] |
| 87 | * |
| 88 | * where \f$h=h(\theta,\phi)\f$ (\c h) is the 2-surface of the AH, |
| 89 | * \f$\Psi\f$ is the conformal factor, and |
| 90 | * \f$|DF|:= (\gamma^{ij}D_iFD_jF)^{1/2} \f$ (where \f$F\f$ is the |
| 91 | * level set function \f$ F:=r-h(\theta,\phi) \f$ and \f$D_i\f$ is the |
| 92 | * covariant derivative w.r.t. \f$\gamma_{ij}\f$). |
| 93 | * We solve the above equation iteratively with the right hand side |
| 94 | * of the equation as a source term. |
| 95 | * |
| 96 | * @param gamma : [input] the 3-metric \f$\gamma_{ij}\f$ w.r.t. which |
| 97 | * the AH is to be found. |
| 98 | * @param k_dd_in : [input] the extrinsic curvature \f$K_{ij}\f$. |
| 99 | * @param Valeur h : [output] the 2-surface of the apparent horizon |
| 100 | * @param Scalar ex_fcn : [output] the expansion function defined from |
| 101 | * the level set function \f$F:= r - h(\theta,\phi)\f$ |
| 102 | * @param a_axis : [input] the initial guess for \f$h\f$ is a triaxial |
| 103 | * ellipsoidal surface with a_axis the axis along the x-axis of |
| 104 | * the Cartesian grid |
| 105 | * @param b_axis : [input] axis along the y-axis (cf a_axis) |
| 106 | * @param c_axis : [input] axis along the z-axis (cf a_axis) |
| 107 | * @param bool print : [input] screen printout during iterations? (default: false) |
| 108 | * @param precis : [input] threshold in the relative difference between |
| 109 | * the 2-surface \f$h\f$ of two consecutive steps to stop |
| 110 | * the iterative procedure (default value: 1.e-8) |
| 111 | * @param precis_exp : [input] maximum error of the expansion function evaluated on |
| 112 | * the 2-surface \f$h\f$ (should be zero by definition) after the iteration |
| 113 | * is stopped (default value: 1.e-6) |
| 114 | * @param it_max : [input] maximum number of steps (default value: 200) |
| 115 | * @param it_relax : [input] step at which relaxation is switched on |
| 116 | * (default value: 200) |
| 117 | * @param relax_fac : [input] relaxation factor (default value: |
| 118 | * 1 for no relaxation) |
| 119 | * @return bool ah_flag : a flag to indicate whether an apparent horizon is found |
| 120 | */ |
| 121 | bool ah_finder(const Metric& gamma, const Sym_tensor& k_dd_in, Valeur& h, Scalar& ex_fcn, |
| 122 | double a_axis, double b_axis, double c_axis, bool verbose = true, |
| 123 | bool print = false, double precis = 1.e-8, double precis_exp = 1.e-6, |
| 124 | int it_max = 200, int it_relax = 200, double relax_fac = 1.) ; |
| 125 | |
| 126 | } |
| 127 | #endif |