85#include "utilitaires.h"
86#include "et_bin_nsbh.h"
94 assert ((relax>0) && (relax<=1)) ;
96 cout <<
"Resolution LAPSE" << endl ;
105 for (
int i=0 ; i<3 ; i++) {
106 work.
set() = auxi(i, i) ;
115 +psiq*
n_tot()*kk()) ;
122 Valeur limite (
mp.get_mg()->get_angu()) ;
123 limite = -0.5 + lim_nn ;
124 int np =
mp.get_mg()->get_np(1) ;
125 int nt =
mp.get_mg()->get_nt(1) ;
126 for (
int k=0 ; k<np ; k++)
127 for (
int j=0 ; j<nt ; j++)
128 limite.
set(0,k,j,0) -=
n_comp() (1, k, j, 0) ;
134 assert(bound_nn == 1);
136 Valeur limite (
mp.get_mg()->get_angu()) ;
138 int np =
mp.get_mg()->get_np(1) ;
139 int nt =
mp.get_mg()->get_nt(1) ;
140 for (
int k=0 ; k<np ; k++)
141 for (
int j=0 ; j<nt ; j++)
149 soluce = soluce + 0.5 ;
151 n_auto.set() = relax*soluce + (1-relax)*lapse_old ;
158 assert ((relax>0) && (relax<=1)) ;
160 cout <<
"Resolution PSI" << endl ;
168 for (
int i=0 ; i<3 ; i++) {
169 work.
set() = auxi(i, i) ;
176 Cmp source (-psic*kk()/8.) ;
180 Valeur limite (
mp.get_mg()->get_angu()) ;
184 int np =
mp.get_mg()->get_np(1) ;
185 int nt =
mp.get_mg()->get_nt(1) ;
187 double* vec_s =
new double[3] ;
188 Mtbl tet_mtbl (
mp.get_mg()) ;
190 Mtbl phi_mtbl (
mp.get_mg()) ;
193 for (
int k=0 ; k<np ; k++)
194 for (
int j=0 ; j<nt ; j++) {
196 double tet = tet_mtbl(1,k,j,0) ;
197 double phi = phi_mtbl(1,k,j,0) ;
203 for (
int m=0 ; m<3 ; m++)
204 for (
int n=0 ; n<3 ; n++)
205 part_ss += vec_s[m]*vec_s[n]*
tkij_tot(m,n)(1,k,j,0) ;
210 psi_comp().dsdr()(1, k, j, 0) - part_ss ;
217 soluce = soluce + 1./2. ;
219 psi_auto.set() = relax*soluce + (1-relax)*psi_old ;
226 double precision,
double relax,
227 int bound_nn,
double lim_nn) {
229 assert (precision > 0) ;
230 assert ((relax>0) && (relax<=1)) ;
232 cout <<
"resolution SHIFT" << endl ;
243 for (
int i=0 ; i<3 ; i++)
244 if (source(i).get_etat() == ETATQCQ)
247 for (
int i=0 ; i<3 ; i++)
254 for (
int i=0 ; i<3 ; i++)
259 int np =
mp.get_mg()->get_np(1) ;
260 int nt =
mp.get_mg()->get_nt(1) ;
262 Mtbl x_mtbl (
mp.get_mg()) ;
264 Mtbl y_mtbl (
mp.get_mg()) ;
269 double air, theta,
phi, xabs, yabs, zabs ;
277 Mtbl tet_mtbl (
mp.get_mg()) ;
279 Mtbl phi_mtbl (
mp.get_mg()) ;
283 Base_val** bases =
mp.get_mg()->std_base_vect_cart() ;
285 Valeur lim_x (
mp.get_mg()->get_angu()) ;
287 Valeur lim_y (
mp.get_mg()->get_angu()) ;
289 Valeur lim_z (
mp.get_mg()->get_angu()) ;
292 for (
int k=0 ; k<np ; k++)
293 for (
int j=0 ; j<nt ; j++) {
295 double tet = tet_mtbl(1,k,j,0) ;
296 double phy = phi_mtbl(1,k,j,0) ;
298 xabs = Xabs (1, k, j, 0) ;
299 yabs = Yabs (1, k, j, 0) ;
300 zabs = Zabs (1, k, j, 0) ;
302 ns.
get_mp().convert_absolute (xabs, yabs, zabs, air, theta,
phi) ;
304 lim_x.
set(0, k, j, 0) =
omega*Yabs(0, 0, 0, 0) +
309 lim_x.
base = *bases[0] ;
312 lim_y.
set(0, k, j, 0) = -
omega*Xabs(0, 0, 0, 0) -
318 lim_z.
set(0, k, j, 0) = -
323 lim_x.
base = *bases[0] ;
324 lim_y.
base = *bases[1] ;
325 lim_z.
base = *bases[2] ;
328 for (
int i=0 ; i<3 ; i++)
333 poisson_vect_frontiere(1./3., source,
shift_auto, lim_x, lim_y,
334 lim_z, 0, precision, 20) ;
338 for (
int i=0; i<3; i++)
344 if (bound_nn == 0 && lim_nn == 0)
353 double precision,
double relax,
354 int bound_nn,
double lim_nn) {
369void 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...
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.
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).
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...
Coord phi
coordinate centered on the grid
Coord tet
coordinate centered on the grid