30char binaire_global_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Binaire/binaire_global.C,v 1.7 2014/10/13 08:52:44 j_novak Exp $" ;
95 if (
star1.is_relativistic()) {
97 assert(
star2.is_relativistic() ) ;
101 for (
int i=0; i<=1; i++) {
103 const Cmp& a2 = (
et[i]->get_a_car())() ;
104 const Cmp& ee = (
et[i]->get_ener_euler())() ;
105 const Cmp& ak2_auto = (
et[i]->get_akcar_auto())() ;
106 const Cmp& ak2_comp = (
et[i]->get_akcar_comp())() ;
108 Cmp source =
pow(a2, 1.25) * ee
109 +
pow(a2, 0.25) * (ak2_auto + ak2_comp) / (4.*qpig) ;
144 if (
star1.is_relativistic()) {
146 assert(
star2.is_relativistic() ) ;
150 for (
int i=0; i<=1; i++) {
152 const Cmp& lapse = (
et[i]->get_nnn())() ;
153 const Cmp& a2 = (
et[i]->get_a_car())() ;
154 const Cmp& ee = (
et[i]->get_ener_euler())() ;
155 const Cmp& se = (
et[i]->get_s_euler())() ;
156 const Cmp& ak2_auto = (
et[i]->get_akcar_auto())() ;
157 const Cmp& ak2_comp = (
et[i]->get_akcar_comp())() ;
159 const Tenseur& dnu_auto =
et[i]->get_d_logn_auto() ;
160 const Tenseur& dnu_comp =
et[i]->get_d_logn_comp() ;
161 const Tenseur& dbe_auto =
et[i]->get_d_beta_auto() ;
162 const Tenseur& dbe_comp =
et[i]->get_d_beta_comp() ;
165 dbe_auto + dbe_comp) ;
167 dnu_auto + dnu_comp) ;
169 Cmp source = lapse * ( a2 * (ee + se)
170 + (ak2_auto + ak2_comp)/qpig
171 - dndb()/qpig + dndn()/qpig ) ;
206 for (
int i=0; i<=1; i++) {
208 const Map& mp =
et[i]->get_mp() ;
218 const Cmp& vx = (
et[i]->get_u_euler())(0) ;
219 const Cmp& vy = (
et[i]->get_u_euler())(1) ;
220 const Cmp& vz = (
et[i]->get_u_euler())(2) ;
224 if (
et[i]->is_relativistic() ) {
225 const Cmp& a2 = (
et[i]->get_a_car())() ;
226 const Cmp& ee = (
et[i]->get_ener_euler())() ;
227 const Cmp& pp = (
et[i]->get_press())() ;
228 rho =
pow(a2, 2.5) * (ee + pp) ;
231 rho = (
et[i]->get_nbar())() ;
235 Base_val** base = (
et[i]->get_mp()).get_mg()->std_base_vect_cart() ;
240 Cmp source = rho * ( yy * vz - zz * vy ) ;
242 (source.
va).set_base( *(base[2]) ) ;
251 source = rho * ( zz * vx - xx * vz ) ;
253 (source.
va).set_base( *(base[2]) ) ;
262 source = rho * ( xx * vy - yy * vx ) ;
295 if (
star1.is_relativistic()) {
298 assert(
star2.is_relativistic() ) ;
308 for (
int i=0; i<=1; i++) {
310 const Cmp e_int = (
et[i]->get_ener())()
311 - (
et[i]->get_nbar())() ;
313 const Cmp& rho = (
et[i]->get_nbar())() ;
316 const Tenseur& vit =
et[i]->get_u_euler() ;
321 const Cmp nu = (
et[i]->get_logn_auto())()
322 + (
et[i]->get_logn_comp())() ;
324 Cmp source = e_int + .5 * rho * vit2 + .5 * rho * nu ;
351 if (
star1.is_relativistic()) {
354 assert(
star2.is_relativistic() ) ;
366 double vir_grav = 0 ;
368 for (
int i=0; i<=1; i++) {
370 const Cmp& pp = (
et[i]->get_press())() ;
372 const Cmp& rho = (
et[i]->get_nbar())() ;
375 const Tenseur& vit =
et[i]->get_u_euler() ;
380 const Cmp nu = (
et[i]->get_logn_auto())()
381 + (
et[i]->get_logn_comp())() ;
383 Cmp source = 3*pp + rho * vit2 ;
387 source = .5 * rho * nu ;
393 *
p_virial = ( vir_mat + vir_grav ) / fabs(vir_grav) ;
416 if (
star1.is_relativistic()) {
419 assert(
star2.is_relativistic() ) ;
423 double vir_pres = 0. ;
424 double vir_extr = 0. ;
425 double vir_grav = 0. ;
427 for (
int i=0; i<=1; i++) {
429 const Cmp& a2 = (
et[i]->get_a_car())() ;
430 const Cmp& se = (
et[i]->get_s_euler())() ;
431 const Cmp& ak2_auto = (
et[i]->get_akcar_auto())() ;
432 const Cmp& ak2_comp = (
et[i]->get_akcar_comp())() ;
434 const Tenseur& dnu_auto =
et[i]->get_d_logn_auto() ;
435 const Tenseur& dnu_comp =
et[i]->get_d_logn_comp() ;
436 const Tenseur& dbe_auto =
et[i]->get_d_beta_auto() ;
437 const Tenseur& dbe_comp =
et[i]->get_d_beta_comp() ;
442 Cmp source = 2. * a2 * a1 * se ;
445 source = 1.5 * a1 * (ak2_auto + ak2_comp) / qpig ;
453 source = a1 * ( sprod1() - sprod2() - 2.*sprod3() )/qpig ;
489 if (
star1.is_relativistic()) {
492 assert(
star2.is_relativistic() ) ;
496 double vir_pres = 0. ;
497 double vir_extr = 0. ;
498 double vir_grav = 0. ;
500 for (
int i=0; i<=1; i++) {
502 const Cmp& lapse = (
et[i]->get_nnn())() ;
503 const Cmp& a2 = (
et[i]->get_a_car())() ;
504 const Cmp& se = (
et[i]->get_s_euler())() ;
505 const Cmp& ak2_auto = (
et[i]->get_akcar_auto())() ;
506 const Cmp& ak2_comp = (
et[i]->get_akcar_comp())() ;
508 const Tenseur& dnu_auto =
et[i]->get_d_logn_auto() ;
509 const Tenseur& dnu_comp =
et[i]->get_d_logn_comp() ;
510 const Tenseur& dbe_auto =
et[i]->get_d_beta_auto() ;
511 const Tenseur& dbe_comp =
et[i]->get_d_beta_comp() ;
516 Cmp source = 2. * lapse * a2 * a1 * se ;
519 source = 1.5 * lapse * a1 * (ak2_auto + ak2_comp) / qpig ;
525 source = lapse * a1 * sprod() / qpig ;
Bases of the spectral expansions.
Tbl * p_angu_mom
Total angular momentum of the system.
double * p_virial_gb
Virial theorem error by E.Gourgoulhon and S.Bonazzola.
double mass_adm() const
Total ADM mass.
double virial_gb() const
Estimates the relative error on the virial theorem calculated by E.Gourgoulhon and S....
Etoile_bin * et[2]
Array of the two stars (to perform loops on the stars): {\tt et[0]} contains the address of {\tt star...
const Tbl & angu_mom() const
Total angular momentum.
double * p_mass_adm
Total ADM mass of the system.
double * p_total_ener
Total energy of the system.
double * p_virial
Virial theorem error.
Etoile_bin star2
Second star of the system.
double mass_kom() const
Total Komar mass.
double * p_mass_kom
Total Komar mass of the system.
double virial() const
Estimates the relative error on the virial theorem (for a relativistic one, it returns $|1 - M_{\rm K...
double * p_virial_fus
Virial theorem error by J.L.Friedman, K.Uryu, and M.Shibata.
Etoile_bin star1
First star of the system.
double total_ener() const
Total energy (excluding the rest mass energy).
double virial_fus() const
Estimates the relative error on the virial theorem calculated by J.L.Friedman, K.Uryu,...
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Valeur va
The numerical value of the Cmp.
void std_base_scal()
Sets the spectral bases of the Valeur va to the standard ones for a scalar.
double integrale() const
Computes the integral over all space of *this .
Tensor handling *** DEPRECATED : use class Tensor instead ***.
Cmp sqrt(const Cmp &)
Square root.
Cmp pow(const Cmp &, int)
Power .
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...
Map(const Mg3d &)
Constructor from a multi-domain 3D grid.
Standard units of space, time and mass.