162#include "time_slice.h"
165#include "evolution.h"
167#include "graphique.h"
168#include "utilitaires.h"
185 Valeur psi_bound (
mp.get_mg()->get_angu() ) ;
187 int nnp =
mp.get_mg()->get_np(1) ;
188 int nnt =
mp.get_mg()->get_nt(1) ;
192 for (
int k=0 ; k<nnp ; k++)
193 for (
int j=0 ; j<nnt ; j++)
212 tmp = tmp /
beta()(1) ;
216 Valeur psi_bound (
mp.get_mg()->get_angu() ) ;
218 int nnp =
mp.get_mg()->get_np(1) ;
219 int nnt =
mp.get_mg()->get_nt(1) ;
223 for (
int k=0 ; k<nnp ; k++)
224 for (
int j=0 ; j<nnt ; j++)
253 Valeur psi_bound (
mp.get_mg()->get_angu() ) ;
255 int nnp =
mp.get_mg()->get_np(1) ;
256 int nnt =
mp.get_mg()->get_nt(1) ;
260 for (
int k=0 ; k<nnp ; k++)
261 for (
int j=0 ; j<nnt ; j++)
283 Valeur psi_bound (
mp.get_mg()->get_angu() ) ;
285 int nnp =
mp.get_mg()->get_np(1) ;
286 int nnt =
mp.get_mg()->get_nt(1) ;
290 for (
int k=0 ; k<nnp ; k++)
291 for (
int j=0 ; j<nnt ; j++)
302 int nnp =
mp.get_mg()->get_np(1) ;
303 int nnt =
mp.get_mg()->get_nt(1) ;
305 Valeur psi_bound (
mp.get_mg()->get_angu()) ;
315 for (
int k=0 ; k<nnp ; k++)
316 for (
int j=0 ; j<nnt ; j++)
348 tmp = (tmp + rho *
psi())/(1 + rho) ;
354 Valeur psi_bound (
mp.get_mg()->get_angu()) ;
358 int nnp =
mp.get_mg()->get_np(1) ;
359 int nnt =
mp.get_mg()->get_nt(1) ;
361 for (
int k=0 ; k<nnp ; k++)
362 for (
int j=0 ; j<nnt ; j++)
394 tmp = tmp / (kk_rr + rho) - 1;
397 cout <<
"k_kerr = " << k_kerr.
val_grid_point(1, 0, 0, 0) << endl ;
404 int nnp =
mp.get_mg()->get_np(1) ;
405 int nnt =
mp.get_mg()->get_nt(1) ;
407 Valeur nn_bound (
mp.get_mg()->get_angu()) ;
412 for (
int k=0 ; k<nnp ; k++)
413 for (
int j=0 ; j<nnt ; j++)
457 Scalar tmp =
psi() *
psi() * ( k_kerr + naass + 1.* traceK)
458 -
met_gamt.radial_vect()(2) * dnnn(2)
459 -
met_gamt.radial_vect()(3) * dnnn(3)
460 + ( rho - 1 ) *
met_gamt.radial_vect()(1) * dnnn(1) ;
463 tmp = tmp / (rho *
met_gamt.radial_vect()(1)) ;
469 cout <<
"kappa_pres = " << k_kerr.
val_grid_point(1, 0, 0, 0) << endl ;
470 cout <<
"kappa_hor = " << k_hor.
val_grid_point(1, 0, 0, 0) << endl ;
475 int nnp =
mp.get_mg()->get_np(1) ;
476 int nnt =
mp.get_mg()->get_nt(1) ;
478 Valeur nn_bound (
mp.get_mg()->get_angu()) ;
482 for (
int k=0 ; k<nnp ; k++)
483 for (
int j=0 ; j<nnt ; j++)
518 Vector hom = hom1 + hom2 ;
520 Scalar div_omega = 1.*
contract( qq_uu, 0, 1, (1.*hom1 + 1.*hom2).derive_cov(
gam()), 0, 1) ;
533 Ricci_conf = 2 / rr / rr ;
539 Ricci =
pow(
psi(), -4) * (Ricci_conf - 4*log_psi.
lapang())/rr /rr ;
544 Scalar theta_k = -1/(2*
nn()) * (
gam().radial_vect().divergence(
gam()) -
547 int nnp =
mp.get_mg()->get_np(1) ;
548 int nnt =
mp.get_mg()->get_nt(1) ;
561 Scalar source = div_omega +
contract( qq_uu, 0, 1, hom * hom , 0, 1) - 0.5 * Ricci - L_theta;
562 source = source / theta_k ;
565 nn().derive_cov(
gam()), 0))/(1+rho)
572 Valeur nn_bound (
mp.get_mg()->get_angu()) ;
577 for (
int k=0 ; k<nnp ; k++)
578 for (
int j=0 ; j<nnt ; j++)
598 tmp += cc * (rho -1)*
nn() ;
599 tmp = tmp / (rho*cc) ;
606 int nnp =
mp.get_mg()->get_np(1) ;
607 int nnt =
mp.get_mg()->get_nt(1) ;
609 Valeur nn_bound (
mp.get_mg()->get_angu()) ;
613 for (
int k=0 ; k<nnp ; k++)
614 for (
int j=0 ; j<nnt ; j++)
632 int nnp =
mp.get_mg()->get_np(1) ;
633 int nnt =
mp.get_mg()->get_nt(1) ;
635 Valeur nn_bound (
mp.get_mg()->get_angu()) ;
639 for (
int k=0 ; k<nnp ; k++)
640 for (
int j=0 ; j<nnt ; j++)
675 tmp = (tmp + rho *
nn())/(1 + rho) ;
679 int nnp =
mp.get_mg()->get_np(1) ;
680 int nnt =
mp.get_mg()->get_nt(1) ;
682 Valeur nn_bound (
mp.get_mg()->get_angu()) ;
686 for (
int k=0 ; k<nnp ; k++)
687 for (
int j=0 ; j<nnt ; j++)
698 int nnp =
mp.get_mg()->get_np(1) ;
699 int nnt =
mp.get_mg()->get_nt(1) ;
711 Scalar det_q = q_dd(2,2) * q_dd(3,3) - q_dd(2,3) * q_dd(3,2) ;
734 Scalar source1 = div_kqs ;
735 source1 *= square_q ;
766 Scalar theta_k = -1/(2*
nn()) * (
gam().radial_vect().divergence(
gam()) -
777 Scalar Ricci_conf = 2 / rr /rr ;
787 div_omega = L_theta -
contract(qqq, 0, 1, hom * hom, 0, 1) + 0.5 * Ricci
801 Scalar source3 = div_omega ;
802 source3 *= square_q ;
807 double corr_const =
mp.integrale_surface(source3,
radius + 1e-15)/(4. * M_PI) ;
808 cout <<
"Constant part of div_omega = " << corr_const <<endl ;
811 corr_div_omega = corr_const ;
815 source3 -= corr_div_omega ;
822 Scalar source = source1 + source2 + source3 ;
829 Scalar source_tmp = source ;
837 lapse = (
exp(logn)*cc) ;
845 err.open (
"err_laplBC.d", ofstream::app ) ;
854 Scalar err_lapl = div_omega_test - div_omega ;
859 for (
int k=0 ; k<nnp ; k++)
860 for (
int j=0 ; j<nnt ; j++){
867 err << mer <<
" " << max_err <<
" " << min_err << endl ;
881 Valeur nn_bound (
mp.get_mg()->get_angu()) ;
885 for (
int k=0 ; k<nnp ; k++)
886 for (
int j=0 ; j<nnt ; j++)
908 int nnp =
mp.get_mg()->get_np(1) ;
909 int nnt =
mp.get_mg()->get_nt(1) ;
911 Valeur bnd_beta_r (
mp.get_mg()->get_angu()) ;
915 for (
int k=0 ; k<nnp ; k++)
916 for (
int j=0 ; j<nnt ; j++)
920 for (
int l=0 ; l<(*
mp.get_mg()).get_nzone()-1 ; l++)
928 cout <<
"norme de lim_vr" << endl <<
norme(bnd_beta_r) << endl ;
929 cout <<
"bases" << endl << bnd_beta_r.
base << endl ;
949 int nnp =
mp.get_mg()->get_np(1) ;
950 int nnt =
mp.get_mg()->get_nt(1) ;
952 Valeur bnd_beta_theta (
mp.get_mg()->get_angu()) ;
954 bnd_beta_theta = 1. ;
956 for (
int k=0 ; k<nnp ; k++)
957 for (
int j=0 ; j<nnt ; j++)
963 for (
int l=0 ; l<(*
mp.get_mg()).get_nzone()-1 ; l++)
969 cout <<
"bases" << endl << bnd_beta_theta.
base << endl ;
972 return bnd_beta_theta ;
993 int nnp =
mp.get_mg()->get_np(1) ;
994 int nnt =
mp.get_mg()->get_nt(1) ;
996 Valeur bnd_beta_phi (
mp.get_mg()->get_angu()) ;
1000 for (
int k=0 ; k<nnp ; k++)
1001 for (
int j=0 ; j<nnt ; j++)
1004 for (
int l=0 ; l<(*
mp.get_mg()).get_nzone()-1 ; l++)
1009 for (
int l=0 ; l<(*
mp.get_mg()).get_nzone()-1 ; l++)
1017 return bnd_beta_phi ;
1027 double orientation =
mp.get_rot_phi() ;
1028 assert ((orientation == 0) || (orientation == M_PI)) ;
1029 int aligne = (orientation == 0) ? 1 : -1 ;
1031 int nnp =
mp.get_mg()->get_np(1) ;
1032 int nnt =
mp.get_mg()->get_nt(1) ;
1039 Valeur lim_x (
mp.get_mg()->get_angu()) ;
1043 Mtbl ya_mtbl (
mp.get_mg()) ;
1059 for (
int k=0 ; k<nnp ; k++)
1060 for (
int j=0 ; j<nnt ; j++)
1061 lim_x.
set(0, k, j, 0) = aligne * om * ya_mtbl(1, k, j, 0) * (1 +
1063 + tmp_vect(1).val_grid_point(1, k, j, 0) ;
1065 lim_x.
set_base(*(
mp.get_mg()->std_base_vect_cart()[0])) ;
1077 double orientation =
mp.get_rot_phi() ;
1078 assert ((orientation == 0) || (orientation == M_PI)) ;
1079 int aligne = (orientation == 0) ? 1 : -1 ;
1082 int nnp =
mp.get_mg()->get_np(1) ;
1083 int nnt =
mp.get_mg()->get_nt(1) ;
1090 Valeur lim_y (
mp.get_mg()->get_angu()) ;
1094 Mtbl xa_mtbl (
mp.get_mg()) ;
1110 for (
int k=0 ; k<nnp ; k++)
1111 for (
int j=0 ; j<nnt ; j++)
1112 lim_y.
set(0, k, j, 0) = - aligne * om * xa_mtbl(1, k, j, 0) *(1 +
1114 + tmp_vect(2).val_grid_point(1, k, j, 0) ;
1116 lim_y.
set_base(*(
mp.get_mg()->std_base_vect_cart()[1])) ;
1126 int nnp =
mp.get_mg()->get_np(1) ;
1127 int nnt =
mp.get_mg()->get_nt(1) ;
1134 Valeur lim_z (
mp.get_mg()->get_angu()) ;
1138 for (
int k=0 ; k<nnp ; k++)
1139 for (
int j=0 ; j<nnt ; j++)
1140 lim_z.
set(0, k, j, 0) = tmp_vect(3).val_grid_point(1, k, j, 0) ;
1142 lim_z.
set_base(*(
mp.get_mg()->std_base_vect_cart()[2])) ;
1149 Valeur lim_x (
mp.get_mg()->get_angu()) ;
1152 lim_x.
set_base(*(
mp.get_mg()->std_base_vect_cart()[0])) ;
1160 Valeur lim_z (
mp.get_mg()->get_angu()) ;
1163 lim_z.
set_base(*(
mp.get_mg()->std_base_vect_cart()[2])) ;
1193 tmp = tmp / (2 * s_tilde(1) ) ;
1197 Valeur b_tilde_bound (
mp.get_mg()->get_angu() ) ;
1199 int nnp =
mp.get_mg()->get_np(1) ;
1200 int nnt =
mp.get_mg()->get_nt(1) ;
1204 for (
int k=0 ; k<nnp ; k++)
1205 for (
int j=0 ; j<nnt ; j++)
1210 return b_tilde_bound ;
1230 tmp = tmp / hh_tilde ;
1237 Valeur b_tilde_bound (
mp.get_mg()->get_angu() ) ;
1239 int nnp =
mp.get_mg()->get_np(1) ;
1240 int nnt =
mp.get_mg()->get_nt(1) ;
1244 for (
int k=0 ; k<nnp ; k++)
1245 for (
int j=0 ; j<nnt ; j++)
1250 return b_tilde_bound ;
1293 double orientation =
mp.get_rot_phi() ;
1294 assert ((orientation == 0) || (orientation == M_PI)) ;
1295 int aligne = (orientation == 0) ? 1 : -1 ;
1297 Vector angular (
mp, CON,
mp.get_bvect_cart()) ;
1303 angular.
set(1) = - aligne * om * yya * (1 + dep_phi) ;
1304 angular.
set(2) = aligne * om * xxa * (1 + dep_phi) ;
1309 .
set_base(*(
mp.get_mg()->std_base_vect_cart()[0])) ;
1311 .
set_base(*(
mp.get_mg()->std_base_vect_cart()[1])) ;
1313 .
set_base(*(
mp.get_mg()->std_base_vect_cart()[2])) ;
1332 kss = - 0.15 /
nn() ;
1337 cout <<
"kappa_hor = " <<
kappa_hor() << endl ;
1366 - 3 *
nn() * kss + nn_KK + accel + div_VV ;
1368 b_tilde_new = b_tilde_new / (hh_tilde * rho) ;
1372 tmp_vect.
set(1) = b_tilde_new * s_tilde(1) + angular(1) ;
1373 tmp_vect.
set(2) = b_tilde_new * s_tilde(2) + angular(2) ;
1374 tmp_vect.
set(3) = b_tilde_new * s_tilde(3) + angular(3) ;
1498 int nnp =
mp.get_mg()->get_np(1) ;
1499 int nnt =
mp.get_mg()->get_nt(1) ;
1503 Valeur lim_x (
mp.get_mg()->get_angu()) ;
1509 for (
int k=0 ; k<nnp ; k++)
1510 for (
int j=0 ; j<nnt ; j++)
1513 lim_x.
set_base(*(
mp.get_mg()->std_base_vect_cart()[0])) ;
1526 int nnp =
mp.get_mg()->get_np(1) ;
1527 int nnt =
mp.get_mg()->get_nt(1) ;
1531 Valeur lim_y (
mp.get_mg()->get_angu()) ;
1537 for (
int k=0 ; k<nnp ; k++)
1538 for (
int j=0 ; j<nnt ; j++)
1541 lim_y.
set_base(*(
mp.get_mg()->std_base_vect_cart()[1])) ;
1552 int nnp =
mp.get_mg()->get_np(1) ;
1553 int nnt =
mp.get_mg()->get_nt(1) ;
1557 Valeur lim_z (
mp.get_mg()->get_angu()) ;
1563 for (
int k=0 ; k<nnp ; k++)
1564 for (
int j=0 ; j<nnt ; j++)
1567 lim_z.
set_base(*(
mp.get_mg()->std_base_vect_cart()[2])) ;
1577 int nnp =
mp.get_mg()->get_np(1) ;
1578 int nnt =
mp.get_mg()->get_nt(1) ;
1582 Valeur lim_x (
mp.get_mg()->get_angu()) ;
1588 for (
int k=0 ; k<nnp ; k++)
1589 for (
int j=0 ; j<nnt ; j++)
1592 lim_x.
set_base(*(
mp.get_mg()->std_base_vect_cart()[0])) ;
1604 int nnp =
mp.get_mg()->get_np(1) ;
1605 int nnt =
mp.get_mg()->get_nt(1) ;
1609 Valeur lim_y (
mp.get_mg()->get_angu()) ;
1615 for (
int k=0 ; k<nnp ; k++)
1616 for (
int j=0 ; j<nnt ; j++)
1619 lim_y.
set_base(*(
mp.get_mg()->std_base_vect_cart()[1])) ;
1630 int nnp =
mp.get_mg()->get_np(1) ;
1631 int nnt =
mp.get_mg()->get_nt(1) ;
1635 Valeur lim_z (
mp.get_mg()->get_angu()) ;
1641 for (
int k=0 ; k<nnp ; k++)
1642 for (
int j=0 ; j<nnt ; j++)
1645 lim_z.
set_base(*(
mp.get_mg()->std_base_vect_cart()[2])) ;
Bases of the spectral expansions.
int get_base_p(int l) const
Returns the expansion basis for functions in the domain of index l (e.g.
int get_base_r(int l) const
Returns the expansion basis for r ( ) functions in the domain of index l (e.g.
int get_base_t(int l) const
Returns the expansion basis for functions in the domain of index l (e.g.
const Valeur boundary_vv_z_bin(double om, int hole=0) const
Component z of boundary value of .
const Valeur boundary_vv_y(double om) const
Component y of boundary value of .
const Valeur boundary_psi_Dir_evol() const
Dirichlet boundary condition for (evolution).
const Valeur boundary_psi_Dir_spat() const
Dirichlet boundary condition for (spatial).
const Valeur boundary_nn_Neu_eff(double aa) const
Neumann boundary condition on nn (effectif) .
const Valeur boundary_vv_x(double om) const
Component x of boundary value of .
const Valeur boundary_beta_y(double om) const
Component y of boundary value of .
const Valeur boundary_psi_app_hor() const
Neumann boundary condition for (spatial).
const Valeur boundary_beta_x(double om) const
Component x of boundary value of .
Metric met_gamt
3 metric tilde
const Valeur boundary_nn_Neu_Cook() const
Neumann boundary condition for N using Cook's boundary condition.
const Valeur boundary_b_tilde_Neu() const
Neumann boundary condition for b_tilde.
const Scalar b_tilde() const
Radial component of the shift with respect to the conformal metric.
const Valeur beta_boost_x() const
Boundary value for a boost in x-direction.
const Valeur boundary_beta_r() const
Component r of boundary value of .
const Valeur boundary_vv_z(double om) const
Component z of boundary value of .
const Valeur boundary_vv_y_bin(double om, int hole=0) const
Component y of boundary value of .
const Valeur boundary_nn_Dir_lapl(int mer=1) const
Dirichlet boundary condition for N fixing the divergence of the connection form .
double boost_z
Boost velocity in z-direction.
const Valeur boundary_beta_theta() const
Component theta of boundary value of .
const Valeur beta_boost_z() const
Boundary value for a boost in z-direction.
const Valeur boundary_vv_x_bin(double om, int hole=0) const
Component x of boundary value of .
const Vector vv_bound_cart(double om) const
Vector for boundary conditions in cartesian.
double kappa_hor() const
Surface gravity.
const Valeur boundary_beta_z() const
Component z of boundary value of .
double radius
Radius of the horizon in LORENE's units.
virtual const Sym_tensor & aa_auto() const
Conformal representation of the traceless part of the extrinsic curvature: Returns the value at the ...
const Valeur boundary_nn_Dir_kk() const
Dirichlet boundary condition for N using the extrinsic curvature.
const Vector tradial_vect_hor() const
Vector radial normal tilde.
Map_af & mp
Affine mapping.
const Valeur boundary_psi_Neu_spat() const
Neumann boundary condition for (spatial).
const Valeur boundary_beta_phi(double om) const
Component phi of boundary value of .
const Vector radial_vect_hor() const
Vector radial normal.
const Valeur boundary_nn_Dir_eff(double aa) const
Dirichlet boundary condition for N (effectif) .
const Valeur boundary_nn_Dir(double aa) const
Dirichlet boundary condition .
const Valeur boundary_nn_Neu_kk(int nn=1) const
Neumann boundary condition for N using the extrinsic curvature.
double boost_x
Boost velocity in x-direction.
const Valeur boundary_psi_Dir() const
Dirichlet boundary condition for (spatial).
const Valeur boundary_b_tilde_Dir() const
Dirichlet boundary condition for b_tilde.
const Valeur boundary_psi_Neu_evol() const
Neumann boundary condition for (evolution).
const Vector vv_bound_cart_bin(double om, int hole=0) const
Vector for boundary conditions in cartesian for binary systems.
virtual const Vector & radial_vect() const
Returns the radial vector normal to a spherical slicing and pointing toward spatial infinity.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Tensor field of valence 0 (or component of a tensorial field).
const Scalar & lapang() const
Returns the angular Laplacian of *this , where .
const Vector & derive_cov(const Metric &gam) const
Returns the gradient (1-form = covariant vector) of *this.
Scalar poisson_angu(double lambda=0) const
Solves the (generalized) angular Poisson equation with *this as source.
virtual void std_spectral_base()
Sets the spectral bases of the Valeur va to the standard ones for a scalar field.
double val_grid_point(int l, int k, int j, int i) const
Returns the value of the field at a specified grid point.
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...
Valeur & set_spectral_va()
Returns va (read/write version).
const Valeur & get_spectral_va() const
Returns va (read only version).
void annule_hard()
Sets the Scalar to zero in a hard way.
void mult_rsint()
Multiplication by everywhere; dzpuis is not changed.
void set_dzpuis(int)
Modifies the dzpuis flag.
virtual void dec_dzpuis(int dec=1)
Decreases by dec units the value of dzpuis and changes accordingly the values of the Scalar in the co...
Class intended to describe valence-2 symmetric tensors.
virtual const Sym_tensor & k_dd() const
Extrinsic curvature tensor (covariant components ) at the current time step (jtime ).
virtual const Scalar & nn() const
Lapse function N at the current time step (jtime ).
virtual const Scalar & psi() const
Conformal factor relating the physical metric to the conformal one: .
virtual const Sym_tensor & gam_uu() const
Induced metric (contravariant components ) at the current time step (jtime ).
const Metric_flat & ff
Pointer on the flat metric with respect to which the conformal decomposition is performed.
virtual const Scalar & trk() const
Trace K of the extrinsic curvature at the current time step (jtime ).
virtual const Vector & beta() const
shift vector at the current time step (jtime )
const Metric & gam() const
Induced metric at the current time step (jtime ).
Values and coefficients of a (real-value) function.
const Base_val & get_base() const
Return the bases for spectral expansions (member base ).
void set_base(const Base_val &)
Sets the bases for spectral expansions (member base ).
Tbl & set(int l)
Read/write of the value in a given domain (configuration space).
void set_base_r(int l, int base_r)
Sets the expansion basis for r ( ) functions in a given domain.
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 set_base_t(int base_t)
Sets the expansion basis for functions in all domains.
void set_base_p(int base_p)
Sets the expansion basis for functions in all domains.
Tensor field of valence 1.
const Scalar & divergence(const Metric &) const
The divergence of this with respect to a Metric .
virtual void change_triad(const Base_vect &)
Sets a new vectorial basis (triad) of decomposition and modifies the components accordingly.
Scalar & set(int)
Read/write access to a component.
Cmp exp(const Cmp &)
Exponential.
Tbl norme(const Cmp &)
Sums of the absolute values of all the values of the Cmp in each domain.
Cmp pow(const Cmp &, int)
Power .
Cmp log(const Cmp &)
Neperian logarithm.
Tensor up_down(const Metric &gam) const
Computes a new tensor by raising or lowering all the indices of *this .
const Tensor & derive_con(const Metric &gam) const
Returns the "contravariant" derivative of this with respect to some metric , by raising the last inde...
Tensor down(int ind, const Metric &gam) const
Computes a new tensor by lowering an index of *this.
const Tensor & derive_cov(const Metric &gam) const
Returns the covariant derivative of this with respect to some metric .
Tenseur contract(const Tenseur &, int id1, int id2)
Self contraction of two indices of a Tenseur .