29char hole_bhns_equilibrium_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Hole_bhns/hole_bhns_equilibrium.C,v 1.4 2014/10/13 08:53:00 j_novak Exp $" ;
65#include "utilitaires.h"
70 int filter_r,
int filter_r_s,
int filter_p_s,
71 double x_rot,
double y_rot,
double precis,
72 double omega_orb,
double resize_bh,
73 const Tbl& fact_resize,
Tbl& diff) {
82 const Mg3d* mg =
mp.get_mg() ;
88 double rr_in_1 =
mp.val_r(1, -1., M_PI/2, 0.) ;
212 double rr_out_nm3 =
mp.val_r(nz-3, 1., M_PI/2., 0.) ;
213 mp.resize(nz-3, rr_in_1/rr_out_nm3 * fact_resize(1)) ;
216 double rr_out_nm4 =
mp.val_r(nz-4, 1., M_PI/2., 0.) ;
217 mp.resize(nz-4, rr_in_1/rr_out_nm4 * fact_resize(0)) ;
222 double rr_out_nm2 =
mp.val_r(nz-2, 1., M_PI/2., 0.) ;
223 mp.resize(nz-2, 2. * rr_in_1 * fact_resize(1) / rr_out_nm2) ;
228 double rr_out_1 =
mp.val_r(1, 1., M_PI/2., 0.) ;
229 mp.resize(1, rr_in_1/rr_out_1 * resize_bh) ;
234 double rr_out_nm4_new =
mp.val_r(nz-4, 1., M_PI/2., 0.) ;
236 for (
int i=1; i<nz-5; i++) {
238 double rr_out_i =
mp.val_r(i, 1., M_PI/2., 0.) ;
240 double rr_mid = rr_out_i
241 + (rr_out_nm4_new - rr_out_i) /
double(nz - 4 - i) ;
243 double rr_2timesi = 2. * rr_out_i ;
245 if (rr_2timesi < rr_mid) {
247 double rr_out_ip1 =
mp.val_r(i+1, 1., M_PI/2., 0.) ;
248 mp.resize(i+1, rr_2timesi / rr_out_ip1) ;
253 double rr_out_ip1 =
mp.val_r(i+1, 1., M_PI/2., 0.) ;
254 mp.resize(i+1, rr_mid / rr_out_ip1) ;
280 double& diff_lapconf = diff.
set(0) ;
281 double& diff_confo = diff.
set(1) ;
282 double& diff_shift_x = diff.
set(2) ;
283 double& diff_shift_y = diff.
set(3) ;
284 double& diff_shift_z = diff.
set(4) ;
295 Vector source_shift(
mp, CON,
mp.get_bvect_cart()) ;
300 double mass = ggrav *
mass_bh ;
320 ll.
set(1) = st % cp ;
321 ll.
set(2) = st % sp ;
325 Vector dlappsi(
mp, COV,
mp.get_bvect_cart()) ;
326 for (
int i=1; i<=3; i++) {
338 for (
int mer_bh=0; mer_bh<mermax_bh; mer_bh++) {
340 cout <<
"--------------------------------------------------" << endl ;
341 cout <<
"step: " << mer_bh << endl ;
342 cout <<
"diff_lapconf = " << diff_lapconf << endl ;
343 cout <<
"diff_confo = " << diff_confo << endl ;
344 cout <<
"diff_shift : x = " << diff_shift_x
345 <<
" y = " << diff_shift_y <<
" z = " << diff_shift_z << endl ;
349 cout <<
"!!!!! WARNING: Not yet available !!!!!" << endl ;
363 cc = 2. * (
sqrt(13.) - 1.) / 3. ;
375 cout <<
"!!!!! WARNING: Not yet prepared !!!!!" << endl ;
381 cout <<
"!!!!! WARNING: Not yet prepared !!!!!" << endl ;
392 lapbh_iso =
sqrt(1. - 2.*mass/r_are/rr
393 + cc*cc*
pow(mass/r_are/rr,4.)) ;
399 psibh_iso =
sqrt(r_are) ;
405 dlapbh_iso = mass/r_are/rr - 2.*cc*cc*
pow(mass/r_are/rr,4.) ;
434 tmpl3 = 5.25 * cc * cc *
pow(mass,4.) * lapbh_iso
443 source_lapconf = tmpl1 + tmpl2 + tmpl3 ;
455 if (source_lapconf.
get_etat() != ETATZERO) {
456 source_lapconf.
filtre(filter_r) ;
495 Scalar tmpc2 = 0.75 * cc * cc *
pow(mass,4.)
514 source_confo = tmpc1 + tmpc2 + tmpc3 ;
526 if (source_confo.
get_etat() != ETATZERO) {
527 source_confo.
filtre(filter_r) ;
531 bc_conf =
bc_confo(omega_orb, x_rot, y_rot) ;
555 Vector dlapconf(
mp, COV,
mp.get_bvect_cart()) ;
556 for (
int i=1; i<=3; i++) {
570 for (
int i=1; i<=3; i++) {
576 for (
int i=1; i<=3; i++) {
577 tmps2.
set(i) = 2. * psibh_iso
578 * (dlapbh_iso + 0.5*(lapbh_iso - 1.)
585 for (
int i=1; i<=3; i++) {
588 for (
int i=1; i<=3; i++) {
589 (tmps2.
set(i)).inc_dzpuis(2) ;
594 for (
int i=1; i<=3; i++) {
595 tmps3.
set(i) = 2. * cc * mass * mass * lapbh_iso
596 * (dlappsi(i) - 3.*ll(i)*(ll(1)%dlappsi(1)
603 for (
int i=1; i<=3; i++) {
606 for (
int i=1; i<=3; i++) {
607 (tmps3.
set(i)).inc_dzpuis(2) ;
610 Vector tmps4 = 4. * cc * mass * mass
611 * (dlapbh_iso * (1. - psibh_iso*lapbh_iso/
lapconf_tot)
612 + 0.5 * lapbh_iso * (lapbh_iso - 1.)
615 * ll / rr /
pow(r_are*rr,3.) ;
618 for (
int i=1; i<=3; i++) {
621 for (
int i=1; i<=3; i++) {
622 (tmps4.
set(i)).inc_dzpuis(4) ;
625 Vector dlappsi_comp(
mp, COV,
mp.get_bvect_cart()) ;
626 for (
int i=1; i<=3; i++) {
639 for (
int i=1; i<=3; i++) {
643 source_shift = tmps1 + tmps2 + tmps3 + tmps4 + tmps5 ;
647 for (
int i=1; i<=3; i++) {
651 if (filter_r_s != 0) {
652 for (
int i=1; i<=3; i++) {
653 if (source_shift(i).get_etat() != ETATZERO)
658 if (filter_p_s != 0) {
659 for (
int i=1; i<=3; i++) {
660 if (source_shift(i).get_etat() != ETATZERO) {
682 Tenseur source_p(
mp, 1, CON,
mp.get_bvect_cart()) ;
684 for (
int i=0; i<3; i++) {
685 source_p.
set(i) =
Cmp(source_shift(i+1)) ;
691 for (
int i=0; i<3; i++) {
700 poisson_vect_frontiere(1./3., source_p, resu_p,
701 bc_shif_x, bc_shif_y, bc_shif_z,
704 for (
int i=1; i<=3; i++) {
710 for (
int i=1; i<=3; i++) {
717 for (
int i=1; i<=3; i++) {
730 tdiff_lapconf.
set(0) = 0. ;
731 cout <<
"Relative difference in the lapconf function : " << endl ;
732 for (
int l=0; l<nz; l++) {
733 cout << tdiff_lapconf(l) <<
" " ;
737 diff_lapconf = tdiff_lapconf(1) ;
738 for (
int l=2; l<nz; l++) {
739 diff_lapconf += tdiff_lapconf(l) ;
744 tdiff_confo.
set(0) = 0. ;
745 cout <<
"Relative difference in the conformal factor : " << endl ;
746 for (
int l=0; l<nz; l++) {
747 cout << tdiff_confo(l) <<
" " ;
751 diff_confo = tdiff_confo(1) ;
752 for (
int l=2; l<nz; l++) {
753 diff_confo += tdiff_confo(l) ;
758 tdiff_shift_x.
set(0) = 0. ;
759 cout <<
"Relative difference in the shift vector (x) : " << endl ;
760 for (
int l=0; l<nz; l++) {
761 cout << tdiff_shift_x(l) <<
" " ;
765 diff_shift_x = tdiff_shift_x(1) ;
766 for (
int l=2; l<nz; l++) {
767 diff_shift_x += tdiff_shift_x(l) ;
772 tdiff_shift_y.
set(0) = 0. ;
773 cout <<
"Relative difference in the shift vector (y) : " << endl ;
774 for (
int l=0; l<nz; l++) {
775 cout << tdiff_shift_y(l) <<
" " ;
779 diff_shift_y = tdiff_shift_y(1) ;
780 for (
int l=2; l<nz; l++) {
781 diff_shift_y += tdiff_shift_y(l) ;
786 tdiff_shift_z.
set(0) = 0. ;
787 cout <<
"Relative difference in the shift vector (z) : " << endl ;
788 for (
int l=0; l<nz; l++) {
789 cout << tdiff_shift_z(l) <<
" " ;
793 diff_shift_z = tdiff_shift_z(1) ;
794 for (
int l=2; l<nz; l++) {
795 diff_shift_z += tdiff_shift_z(l) ;
const Valeur bc_confo() const
Boundary condition on the apparent horizon of the black hole for the conformal factor: 2-D Valeur.
const Scalar r_coord(bool neumann, bool first) const
Expresses the areal radial coordinate by that in spatially isotropic coordinates.
Map & mp
Mapping associated with the black hole.
bool kerrschild
true for a Kerr-Schild background, false for a conformally flat background
double mass_bh
Gravitational mass of BH.
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Scalar confo_auto
Conformal factor generated by the black hole.
Scalar lapconf_auto
Lapconf function generated by the black hole.
Sym_tensor taij_comp
Part of the extrinsic curvature tensor generated by the companion star.
void equilibrium_bhns(int mer, int mermax_bh, int filter_r, int filter_r_s, int filter_p_s, double x_rot, double y_rot, double precis, double omega_orb, double resize_bh, const Tbl &fact_resize, Tbl &diff)
Computes a black-hole part in a black hole-neutron star binary by giving boundary conditions on the a...
Scalar confo_auto_bh
Part of the conformal factor from the analytic background.
const Valeur bc_lapconf() const
Boundary condition on the apparent horizon of the black hole for the lapconf function: 2-D Valeur.
Sym_tensor taij_tot_rs
Part of the extrinsic curvature tensor from the numerical computation.
Scalar taij_quad_auto
Part of the scalar from the black hole.
const Valeur bc_shift_x(double ome_orb, double y_rot) const
Boundary condition on the apparent horizon of the black hole for the shift vector of the \fx\f direct...
Vector shift_auto_rs
Part of the shift vector from the numerical computation.
const Valeur bc_shift_y(double ome_orb, double x_rot) const
Boundary condition on the apparent horizon of the black hole for the shift vector of the \fy\f direct...
bool bc_lapconf_fs
true for the first type BC for the lapconf function, false for the second type BH
Scalar confo_auto_rs
Part of the conformal factor from the numerical computation.
const Valeur bc_shift_z() const
Boundary condition on the apparent horizon of the black hole for the shift vector of the \fz\f direct...
Vector d_lapconf_comp
Derivative of the lapconf function generated by the companion star.
Vector shift_auto_bh
Part of the shift vector from the analytic background.
Scalar confo_comp
Conformal factor generated by the companion star.
Scalar lapconf_comp
Lapconf function generated by the companion star.
Scalar lapconf_auto_bh
Part of the lapconf function from the analytic background.
Vector shift_auto
Shift vector generated by the black hole.
Scalar lapconf_auto_rs
Part of the lapconf function from the numerical computation.
Vector d_confo_comp
Derivative of the conformal factor generated by the companion star.
Scalar taij_quad_comp
Part of the scalar from the companion star.
bool bc_lapconf_nd
true for the Neumann type BC for the lapconf function, false for the Dirichlet type BH
Scalar lapconf_tot
Total lapconf function.
Scalar confo_tot
Total conformal factor.
Sym_tensor taij_auto_rs
Part of the extrinsic curvature tensor numericalty computed for the black hole.
const Mg3d * get_angu() const
Returns the pointer on the associated angular grid.
int get_nzone() const
Returns the number of domains.
Tensor field of valence 0 (or component of a tensorial field).
Scalar poisson_neumann(const Valeur &, int) const
Idem as Scalar::poisson_dirichlet , the boundary condition being on the radial derivative of the solu...
void raccord(int n)
Performs the matching of the nucleus with respect to the first shell.
void filtre(int n)
Sets the n lasts coefficients in r to 0 in the external domain.
virtual void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
virtual void std_spectral_base()
Sets the spectral bases of the Valeur va to the standard ones for a scalar field.
virtual void inc_dzpuis(int inc=1)
Increases by inc units the value of dzpuis and changes accordingly the values of the Scalar in the co...
int get_etat() const
Returns the logical state ETATNONDEF (undefined), ETATZERO (null) or ETATQCQ (ordinary).
void filtre_phi(int n, int zone)
Sets the n lasts coefficients in to 0 in the domain zone .
Scalar poisson_dirichlet(const Valeur &limite, int num) const
Is identicall to Scalar::poisson() .
double & set(int i)
Read/write of a particular element (index i) (1D case).
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).
Values and coefficients of a (real-value) function.
Tensor field of valence 1.
virtual void std_spectral_base()
Sets the standard spectal bases of decomposition for each component.
Scalar & set(int)
Read/write access to a component.
Cmp sqrt(const Cmp &)
Square root.
Tbl diffrel(const Cmp &a, const Cmp &b)
Relative difference between two Cmp (norme version).
Cmp pow(const Cmp &, int)
Power .
void annule_domain(int l)
Sets the Tensor to zero in a given domain.
virtual void set_etat_qcq()
Sets the logical state of all components to ETATQCQ (ordinary state).
Tenseur contract(const Tenseur &, int id1, int id2)
Self contraction of two indices of a Tenseur .
Standard units of space, time and mass.