LORENE
et_bin_nsbh_axe.C
1/*
2 * Copyright (c) 2005 Philippe Grandclément
3 *
4 * This file is part of LORENE.
5 *
6 * LORENE is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * LORENE is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with LORENE; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 */
21
22
23char et_bin_nsbh_axe_C[] = "$Header: /cvsroot/Lorene/C++/Source/Etoile/et_bin_nsbh_axe.C,v 1.5 2014/10/13 08:52:56 j_novak Exp $" ;
24
25/*
26 * $Id: et_bin_nsbh_axe.C,v 1.5 2014/10/13 08:52:56 j_novak Exp $
27 * $Log: et_bin_nsbh_axe.C,v $
28 * Revision 1.5 2014/10/13 08:52:56 j_novak
29 * Lorene classes and functions now belong to the namespace Lorene.
30 *
31 * Revision 1.4 2014/10/06 15:13:08 j_novak
32 * Modified #include directives to use c++ syntax.
33 *
34 * Revision 1.3 2005/08/31 09:53:58 m_saijo
35 * Delete unnecessary words around headers
36 *
37 * Revision 1.2 2005/08/31 09:13:45 p_grandclement
38 * add math.h
39 *
40 * Revision 1.1 2005/08/29 15:10:16 p_grandclement
41 * Addition of things needed :
42 * 1) For BBH with different masses
43 * 2) Provisory files for the mixted binaries (Bh and NS) : THIS IS NOT
44 * WORKING YET !!!
45 *
46 *
47 * $Header: /cvsroot/Lorene/C++/Source/Etoile/et_bin_nsbh_axe.C,v 1.5 2014/10/13 08:52:56 j_novak Exp $
48 *
49 */
50
51// C Headers
52#include <cmath>
53
54// Headers Lorene
55#include "et_bin_nsbh.h"
56#include "graphique.h"
57
58namespace Lorene {
59double Et_bin_nsbh::compute_axe(double omega) const {
60
61 // On récupère les trucs qui vont servir :
62 Cmp dx_mu (nnn().dsdx() / nnn());
63 Cmp dx_loggam (loggam().dsdx()) ;
64 double part_dx = dx_mu(0,0,0,0) + dx_loggam(0,0,0,0) ;
65
66 Cmp xabs (mp) ;
67 xabs = mp.xa ;
68
69 // Derivee_square
70 Cmp C_cmp (-pow(confpsi(), 4)/nnn()/nnn()*omega*omega) ;
71 C_cmp.std_base_scal() ;
72 double dC = C_cmp.dsdx()(0,0,0,0) ;
73
74 // Derive single
75 Cmp B_cmp (2*pow(confpsi(), 4)/nnn()/nnn()*shift(1)*omega) ;
76 B_cmp.std_base_scal() ;
77 double dB = B_cmp.dsdx()(0,0,0,0) ;
78
79 // Derive const
80 Cmp A_cmp = 1-pow(confpsi(), 4)/nnn()/nnn()*(shift(0)*shift(0) + shift(1)*shift(1) + shift(2)*shift(2)) ;
81 A_cmp.std_base_scal() ;
82 double dA = A_cmp.dsdx()(0,0,0,0) ;
83
84 // coefficients de G
85 double A = A_cmp (0,0,0,0) ;
86 double B = B_cmp (0,0,0,0) ;
87 double C = C_cmp (0,0,0,0) ;
88
89 // Les coefficients du polynome :
90 double a_coef = dC + 2*C*part_dx ;
91 double b_coef = dB + 2*C + 2*B*part_dx ;
92 double c_coef = dA + B + 2*A*part_dx;
93
94 cout << a_coef << " " << b_coef << " " << c_coef << endl ;
95
96 double determinant = b_coef*b_coef - 4*a_coef*c_coef ;
97
98 if (determinant <0) {
99 cout << "No solution for Xabs found in Et_bin_nsbh_compute_axe !" << endl ;
100 abort() ;
101 }
102
103 double sol_un = (-b_coef - sqrt(determinant))/2/a_coef ;
104 double sol_deux = (-b_coef + sqrt(determinant))/2/a_coef ;
105
106 bool signe_un = (sol_un >0) ? true : false ;
107 bool signe_deux = (sol_deux >0) ? true : false ;
108
109 double res ;
110
111 if (signe_un == signe_deux) {
112 cout << "To many solutions in Et_bin_nsbh_compute_axe !" << endl ;
113 abort() ;
114 }
115 else {
116 res = (signe_un) ? sol_un : sol_deux ;
117 }
118
119 return res ;
120}
121}
Tenseur confpsi
Total conformal factor $\Psi$.
Tenseur loggam
Logarithm of the Lorentz factor between the fluid and the co-orbiting observer.
Definition etoile.h:849
Tenseur nnn
Total lapse function.
Definition etoile.h:509
Map & mp
Mapping associated with the star.
Definition etoile.h:429
Tenseur shift
Total shift vector.
Definition etoile.h:512
Coord xa
Absolute x coordinate.
Definition map.h:730
Cmp sqrt(const Cmp &)
Square root.
Definition cmp_math.C:220
Cmp pow(const Cmp &, int)
Power .
Definition cmp_math.C:348
Lorene prototypes.
Definition app_hor.h:64