LORENE
bin_ns_bh_anashift.C
1/*
2 * Method of class Bin_ns_bh to set some analytical form
3 * to the shift vector of the neutron star
4 *
5 * (see file bin_ns_bh.h for documentation).
6 *
7 */
8
9/*
10 * Copyright (c) 2004 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 version 2
16 * as published by the Free Software Foundation.
17 *
18 * LORENE is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with LORENE; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 *
27 */
28
29char bin_ns_bh_anashift_C[] = "$Header: /cvsroot/Lorene/C++/Source/Bin_ns_bh/bin_ns_bh_anashift.C,v 1.4 2014/10/13 08:52:43 j_novak Exp $" ;
30
31/*
32 * $Id: bin_ns_bh_anashift.C,v 1.4 2014/10/13 08:52:43 j_novak Exp $
33 * $Log: bin_ns_bh_anashift.C,v $
34 * Revision 1.4 2014/10/13 08:52:43 j_novak
35 * Lorene classes and functions now belong to the namespace Lorene.
36 *
37 * Revision 1.3 2014/10/06 15:13:01 j_novak
38 * Modified #include directives to use c++ syntax.
39 *
40 * Revision 1.2 2005/11/30 11:09:06 p_grandclement
41 * Changes for the Bin_ns_bh project
42 *
43 * Revision 1.1 2004/06/09 06:28:21 k_taniguchi
44 * First revision.
45 *
46 *
47 * $Header: /cvsroot/Lorene/C++/Source/Bin_ns_bh/bin_ns_bh_anashift.C,v 1.4 2014/10/13 08:52:43 j_novak Exp $
48 *
49 */
50
51// C headers
52#include <cmath>
53
54// Lorene headers
55#include "bin_ns_bh.h"
56#include "unites.h"
57
58namespace Lorene {
60
61 // NS-BH binary systems should be relativistic
62 // -------------------------------------------
63 if ( !star.is_relativistic() ) {
64 abort() ;
65 }
66
67 using namespace Unites ;
68
69 // Radius of the neutron star
70 double a0 = star.ray_eq() ;
71
72 // Mass ratio
73 double p_mass = star.mass_g() / (hole.masse_adm_seul()/ggrav) ;
74
75 // G M Omega R / (1+p)
76 double www = ggrav * star.mass_g() * omega
77 * separation() / (1. + p_mass) ;
78
79 const Map& mp = star.get_mp() ;
80 Cmp tmp(mp) ;
81 Cmp tmp_ext(mp) ;
82 int nzet = star.get_nzet() ;
83 int nzm1 = mp.get_mg()->get_nzone() - 1 ;
84
85 //-------------------
86 // Irrotational case
87 //-------------------
88 // Since this formula is only an initial guess, we use it
89 // also for the corotating case.
90
91 // Computation of w_shift
92 // ----------------------
94
95 // X component
96 // -----------
97 star.set_w_shift().set(0) = 0. ;
98
99 // Y component
100 // -----------
101
102 // For the incompressible case :
103 tmp = -6. * www / a0 * ( 1. - (mp.r)*(mp.r) / (3.*a0*a0) ) ;
104
105 tmp.annule(nzet, nzm1) ;
106 tmp_ext = -4. * www / mp.r ;
107 tmp_ext.annule(0, nzet-1) ;
108
109 star.set_w_shift().set(1) = - tmp - tmp_ext ;
110
111 // Z component
112 // -----------
113 star.set_w_shift().set(2) = 0. ;
114
115 // Sets the standard spectral bases for Cartesian components
117
118 // Computation of khi_shift
119 //-------------------------
120
121 tmp = 2. * www / a0 * (mp.y) * ( 1. - 3.*(mp.r)*(mp.r) / (5.*a0*a0) ) ;
122 tmp.annule(nzet, nzm1) ;
123 tmp_ext = 0.8 * www * a0 * a0 * (mp.sint) * (mp.sinp) / ((mp.r)*(mp.r)) ;
124 tmp_ext.annule(0, nzet-1) ;
125
126 star.set_khi_shift() = - tmp - tmp_ext ;
127
128 // Sets the standard spectral bases for a scalar field
130
131}
132}
double masse_adm_seul() const
Calculates the ADM mass of the black hole using : .
Et_bin_nsbh star
The neutron star.
Definition bin_ns_bh.h:128
Bhole hole
The black hole.
Definition bin_ns_bh.h:131
double separation() const
Return the separation.
Definition bin_ns_bh.C:235
void analytical_shift()
Sets some analytical template for the shift vector (via the members {\tt w_shift} and {\tt khi_shift}...
double omega
Angular velocity with respect to an asymptotically inertial observer.
Definition bin_ns_bh.h:136
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Definition cmp.h:446
void annule(int l)
Sets the Cmp to zero in a given domain.
Definition cmp.C:348
Tenseur & set_w_shift()
Read/write of w_shift.
Definition etoile_bin.C:538
virtual double mass_g() const
Gravitational mass.
Tenseur & set_khi_shift()
Read/write of khi_shift.
Definition etoile_bin.C:545
int get_nzet() const
Returns the number of domains occupied by the star.
Definition etoile.h:662
double ray_eq() const
Coordinate radius at , [r_unit].
const Map & get_mp() const
Returns the mapping.
Definition etoile.h:659
bool is_relativistic() const
Returns true for a relativistic star, false for a Newtonian one.
Definition etoile.h:667
Base class for coordinate mappings.
Definition map.h:670
Coord y
y coordinate centered on the grid
Definition map.h:727
Coord sint
Definition map.h:721
Coord r
r coordinate centered on the grid
Definition map.h:718
Coord sinp
Definition map.h:723
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
Definition map.h:765
int get_nzone() const
Returns the number of domains.
Definition grilles.h:448
Cmp & set()
Read/write for a scalar (see also operator=(const Cmp&) ).
Definition tenseur.C:824
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Definition tenseur.C:636
void set_std_base()
Set the standard spectal basis of decomposition for each component.
Definition tenseur.C:1170
Lorene prototypes.
Definition app_hor.h:64
Standard units of space, time and mass.