23char bhole_with_ns_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Bhole/bhole_with_ns.C,v 1.12 2014/10/13 08:52:40 j_novak Exp $" ;
82#include "utilitaires.h"
83#include "et_bin_nsbh.h"
91 assert ((relax>0) && (relax<=1)) ;
93 cout <<
"Resolution LAPSE" << endl ;
102 for (
int i=0 ; i<3 ; i++) {
103 work.
set() = auxi(i, i) ;
112 +psiq*
n_tot()*kk()) ;
120 limite = -0.5 + lim_nn ;
123 for (
int k=0 ; k<np ; k++)
124 for (
int j=0 ; j<nt ; j++)
125 limite.
set(0,k,j,0) -=
n_comp() (1, k, j, 0) ;
131 assert(bound_nn == 1);
137 for (
int k=0 ; k<np ; k++)
138 for (
int j=0 ; j<nt ; j++)
146 soluce = soluce + 0.5 ;
148 n_auto.
set() = relax*soluce + (1-relax)*lapse_old ;
155 assert ((relax>0) && (relax<=1)) ;
157 cout <<
"Resolution PSI" << endl ;
165 for (
int i=0 ; i<3 ; i++) {
166 work.
set() = auxi(i, i) ;
173 Cmp source (-psic*kk()/8.) ;
184 double* vec_s =
new double[3] ;
190 for (
int k=0 ; k<np ; k++)
191 for (
int j=0 ; j<nt ; j++) {
193 double tet = tet_mtbl(1,k,j,0) ;
194 double phi = phi_mtbl(1,k,j,0) ;
195 vec_s[0] =
cos(phi)*
sin(tet) ;
196 vec_s[1] =
sin(phi)*
sin(tet) ;
197 vec_s[2] =
cos(tet) ;
200 for (
int m=0 ; m<3 ; m++)
201 for (
int n=0 ; n<3 ; n++)
202 part_ss += vec_s[m]*vec_s[n]*
tkij_tot(m,n)(1,k,j,0) ;
207 psi_comp().dsdr()(1, k, j, 0) - part_ss ;
214 soluce = soluce + 1./2. ;
216 psi_auto.
set() = relax*soluce + (1-relax)*psi_old ;
223 double precision,
double relax,
224 int bound_nn,
double lim_nn) {
226 assert (precision > 0) ;
227 assert ((relax>0) && (relax<=1)) ;
229 cout <<
"resolution SHIFT" << endl ;
240 for (
int i=0 ; i<3 ; i++)
241 if (source(i).get_etat() == ETATQCQ)
244 for (
int i=0 ; i<3 ; i++)
251 for (
int i=0 ; i<3 ; i++)
266 double air, theta, phi, xabs, yabs, zabs ;
289 for (
int k=0 ; k<np ; k++)
290 for (
int j=0 ; j<nt ; j++) {
292 double tet = tet_mtbl(1,k,j,0) ;
293 double phy = phi_mtbl(1,k,j,0) ;
295 xabs = Xabs (1, k, j, 0) ;
296 yabs = Yabs (1, k, j, 0) ;
297 zabs = Zabs (1, k, j, 0) ;
301 lim_x.
set(0, k, j, 0) =
omega*Yabs(0, 0, 0, 0) +
306 lim_x.
base = *bases[0] ;
309 lim_y.
set(0, k, j, 0) = -
omega*Xabs(0, 0, 0, 0) -
315 lim_z.
set(0, k, j, 0) = -
320 lim_x.
base = *bases[0] ;
321 lim_y.
base = *bases[1] ;
322 lim_z.
base = *bases[2] ;
325 for (
int i=0 ; i<3 ; i++)
330 poisson_vect_frontiere(1./3., source,
shift_auto, lim_x, lim_y,
331 lim_z, 0, precision, 20) ;
335 for (
int i=0; i<3; i++)
341 if (bound_nn == 0 && lim_nn == 0)
350 double precision,
double relax,
351 int bound_nn,
double lim_nn) {
366void Bhole::update_metric (
const Et_bin_nsbh& comp) {
Bases of the spectral expansions.
Tenseur psi_auto
Part of generated by the hole.
Tenseur shift_auto
Part of generated by the hole.
double omega_local
local angular velocity
Tenseur psi_comp
Part of generated by the companion hole.
Tenseur_sym tkij_auto
Auto .
double omega
Angular velocity in LORENE's units.
double regul
Intensity of the correction on the shift vector.
Tenseur grad_n_tot
Total gradient of N .
Tenseur n_auto
Part of N generated by the hole.
double rayon
Radius of the horizon in LORENE's units.
void solve_psi_with_ns(double relax)
Solves the equation for ~:
Tenseur n_comp
Part of N generated by the companion hole.
Map_af & mp
Affine mapping.
Tenseur_sym taij_tot
Total , which must be zero on the horizon of the regularisation on the shift has been done.
void solve_lapse_with_ns(double relax, int bound_nn, double lim_nn)
Solves the equation for N ~:
void fait_psi_comp(const Bhole &comp)
Imports the part of due to the companion hole comp .
Tenseur_sym tkij_tot
Total .
void solve_shift_with_ns(const Et_bin_nsbh &ns, double precis, double relax, int bound_nn, double lim_nn)
Solves the equation for ~:
void fait_n_comp(const Bhole &comp)
Imports the part of N due to the companion hole comp .
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
void std_base_scal()
Sets the spectral bases of the Valeur va to the standard ones for a scalar.
Cmp poisson_dirichlet(const Valeur &limite, int num) const
Is identicall to Cmp::poisson() .
void filtre(int n)
Sets the n lasts coefficients in r to 0 in the external domain.
Cmp poisson_neumann(const Valeur &, int) const
Idem as Cmp::poisson_dirichlet , the boundary condition being on the radial derivative of the solutio...
void raccord(int n)
Performs the matching of the nucleus with respect to the first shell.
Class for a star in a NS-BH binary system.
const Tenseur & get_shift_auto() const
Returns the part of the shift vector generated principaly by the star.
const Map & get_mp() const
Returns the mapping.
Coord y
y coordinate centered on the grid
Coord ya
Absolute y coordinate.
void convert_absolute(double xx, double yy, double zz, double &rr, double &theta, double &pphi) const
Determines the coordinates corresponding to given absolute Cartesian coordinates (X,...
Coord za
Absolute z coordinate.
Coord tet
coordinate centered on the grid
Coord x
x coordinate centered on the grid
Coord phi
coordinate centered on the grid
Coord xa
Absolute x coordinate.
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
const Mg3d * get_angu() const
Returns the pointer on the associated angular grid.
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
Base_val ** std_base_vect_cart() const
Returns the standard spectral bases for the Cartesian components of a vector.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Tensor handling *** DEPRECATED : use class Tensor instead ***.
Cmp & set()
Read/write for a scalar (see also operator=(const Cmp&) ).
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
const Tenseur & gradient() const
Returns the gradient of *this (Cartesian coordinates)
void set_std_base()
Set the standard spectal basis of decomposition for each component.
void set_etat_zero()
Sets the logical state to ETATZERO (zero state).
int get_etat() const
Returns the logical state.
Values and coefficients of a (real-value) function.
Tbl & set(int l)
Read/write of the value in a given domain (configuration space).
Base_val base
Bases on which the spectral expansion is performed.
void std_base_scal()
Sets the bases for spectral expansions (member base ) to the standard ones for a scalar.
void annule_hard()
Sets the Valeur to zero in a hard way.
Cmp sin(const Cmp &)
Sine.
Cmp pow(const Cmp &, int)
Power .
Cmp cos(const Cmp &)
Cosine.
Tenseur flat_scalar_prod(const Tenseur &t1, const Tenseur &t2)
Scalar product of two Tenseur when the metric is : performs the contraction of the last index of t1 w...