LORENE
star_bin_xcts.C
1  /*
2  * Methods for the class Star_bin_xcts
3  * (see file star.h for documentation)
4  */
5 
6 /*
7  * Copyright (c) 2010 Michal Bejger
8  *
9  * This file is part of LORENE.
10  *
11  * LORENE is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License version 2
13  * as published by the Free Software Foundation.
14  *
15  * LORENE is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with LORENE; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23  *
24  */
25 
26 
27 
28 /*
29  * $Id: star_bin_xcts.C,v 1.10 2016/12/05 16:18:15 j_novak Exp $
30  * $Log: star_bin_xcts.C,v $
31  * Revision 1.10 2016/12/05 16:18:15 j_novak
32  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
33  *
34  * Revision 1.9 2014/10/13 08:53:39 j_novak
35  * Lorene classes and functions now belong to the namespace Lorene.
36  *
37  * Revision 1.8 2010/12/09 10:45:26 m_bejger
38  * Added psi4 in the constructor, removed fait_decouple
39  *
40  * Revision 1.7 2010/10/28 13:50:27 m_bejger
41  * Added mass-shedding estimation to Star_bin_xcts::operator>>
42  *
43  * Revision 1.6 2010/10/26 20:18:34 m_bejger
44  * Correction to stdin output
45  *
46  * Revision 1.5 2010/10/26 19:57:02 m_bejger
47  * Various cleanups
48  *
49  * Revision 1.4 2010/06/17 15:06:25 m_bejger
50  * N, Psi output corrected
51  *
52  * Revision 1.3 2010/06/15 08:18:19 m_bejger
53  * Method set_chi_comp() added
54  *
55  * Revision 1.2 2010/06/04 19:59:56 m_bejger
56  * Corrected definitions of lapse and Psi4
57  *
58  * Revision 1.1 2010/05/04 07:51:05 m_bejger
59  * Initial version
60  *
61  * $Header: /cvsroot/Lorene/C++/Source/Star/star_bin_xcts.C,v 1.10 2016/12/05 16:18:15 j_novak Exp $
62  *
63  */
64 
65 // Headers C
66 #include "math.h"
67 
68 // Headers Lorene
69 #include "etoile.h"
70 #include "star.h"
71 #include "eos.h"
72 #include "unites.h"
73 
74 // Local prototype
75 namespace Lorene {
76 Cmp raccord_c1(const Cmp& uu, int l1) ;
77 
78  //--------------//
79  // Constructors //
80  //--------------//
81 
82 // Standard constructor
83 // --------------------
85  int nzet_i,
86  const Eos& eos_i,
87  bool irrot)
88  : Star(mpi, nzet_i, eos_i),
89  irrotational(irrot),
90  psi0(mpi),
91  d_psi(mpi, COV, mpi.get_bvect_cart()),
92  wit_w(mpi, CON, mpi.get_bvect_cart()),
93  loggam(mpi),
94  bsn(mpi, CON, mpi.get_bvect_cart()),
95  pot_centri(mpi),
96  chi_auto(mpi),
97  chi_comp(mpi),
98  Psi_auto(mpi),
99  Psi_comp(mpi),
100  Psi(mpi),
101  chi(mpi),
102  psi4(mpi),
103  w_beta(mpi, CON, mpi.get_bvect_cart()),
104  khi(mpi),
105  dcov_Psi(mpi, COV, mpi.get_bvect_cart()),
106  dcov_chi(mpi, COV, mpi.get_bvect_cart()),
107  flat(mpi, mpi.get_bvect_cart()),
108  beta_auto(mpi, CON, mpi.get_bvect_cart()),
109  beta_comp(mpi, CON, mpi.get_bvect_cart()),
110  haij_auto(mpi, CON, mpi.get_bvect_cart()),
111  haij_comp(mpi, CON, mpi.get_bvect_cart()),
112  hacar_auto(mpi),
113  hacar_comp(mpi),
114  ssjm1_chi(mpi),
115  ssjm1_psi(mpi),
116  ssjm1_khi(mpi),
117  ssjm1_wbeta(mpi, CON, mpi.get_bvect_cart()) {
118 
119  // Pointers of derived quantities initialized to zero :
120  set_der_0x0() ;
121 
122  // Quantities defined on a spherical triad in star.C are put on
123  // a cartesian one
127  Metric temp_met (mp.flat_met_cart()) ;
128  gamma = temp_met ;
129 
130  // Initialization of all quantities :
131  psi0 = 0 ;
132  d_psi.set_etat_zero() ;
133  wit_w.set_etat_zero() ;
134  loggam = 0 ;
135  bsn.set_etat_zero() ;
136  pot_centri = 0 ;
137 
138  Psi_auto = 0 ;
139  Psi_comp = 0 ;
140 
143  chi_auto = 0 ;
144  chi_comp = 0 ;
145 
146  Psi = 1. ;
147  chi = 1. ;
148 
150  khi = 0 ;
151 
154 
157  hacar_auto = 0 ;
158  hacar_comp = 0 ;
159  ssjm1_psi = 0 ;
160  ssjm1_chi = 0 ;
161  ssjm1_khi = 0 ;
163 
164 }
165 
166 // Copy constructor
167 // ----------------
169  : Star(star),
170  irrotational(star.irrotational),
171  psi0(star.psi0),
172  d_psi(star.d_psi),
173  wit_w(star.wit_w),
174  loggam(star.loggam),
175  bsn(star.bsn),
176  pot_centri(star.pot_centri),
177  chi_auto(star.chi_auto),
178  chi_comp(star.chi_comp),
179  Psi_auto(star.Psi_auto),
180  Psi_comp(star.Psi_comp),
181  Psi(star.Psi),
182  chi(star.chi),
183  psi4(star.psi4),
184  w_beta(star.w_beta),
185  khi(star.khi),
186  dcov_Psi(star.dcov_Psi),
187  dcov_chi(star.dcov_chi),
188  flat(star.flat),
189  beta_auto(star.beta_auto),
190  beta_comp(star.beta_comp),
191  haij_auto(star.haij_auto),
192  haij_comp(star.haij_comp),
193  hacar_auto(star.hacar_auto),
194  hacar_comp(star.hacar_comp),
195  ssjm1_chi(star.ssjm1_chi),
196  ssjm1_psi(star.ssjm1_psi),
197  ssjm1_khi(star.ssjm1_khi),
198  ssjm1_wbeta(star.ssjm1_wbeta) {
199 
200  set_der_0x0() ;
201 
202 }
203 
204 // Constructor from a file
205 // -----------------------
207  const Eos& eos_i,
208  FILE* fich)
209  : Star(mpi, eos_i, fich),
210  psi0(mpi),
211  d_psi(mpi, COV, mpi.get_bvect_cart()),
212  wit_w(mpi, CON, mpi.get_bvect_cart()),
213  loggam(mpi),
214  bsn(mpi, CON, mpi.get_bvect_cart()),
215  pot_centri(mpi),
216  chi_auto(mpi, *(mpi.get_mg()), fich),
217  chi_comp(mpi),
218  Psi_auto(mpi, *(mpi.get_mg()), fich),
219  Psi_comp(mpi),
220  Psi(mpi),
221  chi(mpi),
222  psi4(mpi),
223  w_beta(mpi, mpi.get_bvect_cart(), fich),
224  khi(mpi, *(mpi.get_mg()), fich),
225  dcov_Psi(mpi, COV, mpi.get_bvect_cart()),
226  dcov_chi(mpi, COV, mpi.get_bvect_cart()),
227  flat(mpi, mpi.get_bvect_cart()),
228  beta_auto(mpi, mpi.get_bvect_cart(), fich),
229  beta_comp(mpi, CON, mpi.get_bvect_cart()),
230  haij_auto(mpi, CON, mpi.get_bvect_cart()),
231  haij_comp(mpi, CON, mpi.get_bvect_cart()),
232  hacar_auto(mpi),
233  hacar_comp(mpi),
234  ssjm1_chi(mpi, *(mpi.get_mg()), fich),
235  ssjm1_psi(mpi, *(mpi.get_mg()), fich),
236  ssjm1_khi(mpi, *(mpi.get_mg()), fich),
237  ssjm1_wbeta(mpi, mpi.get_bvect_cart(), fich) {
238 
239  // Star parameters
240  // -----------------
241 
242  // irrotational is read in the file:
243  bool status = fread(&irrotational, sizeof(bool), 1, fich) ;
244  if(!status)
245  cout << "Star_bin_xcts::Constructor from a file: Problem with reading ! " << endl ;
246 
247  // Read of the saved fields:
248  // ------------------------
249 
250  if (irrotational) {
251  Scalar psi0_file(mp, *(mp.get_mg()), fich) ;
252  psi0 = psi0_file ;
253 
254  Scalar gam_euler_file(mp, *(mp.get_mg()), fich) ;
255  gam_euler = gam_euler_file ;
256  }
257 
258  // Quantities defined on a spherical triad in star.C are put on
259  // a cartesian one
260 
264  Metric temp_met (mp.flat_met_cart()) ;
265  gamma = temp_met ;
266 
267  // All other fields are initialized to initial values :
268  // ----------------------------------------------------
269 
270  d_psi.set_etat_zero() ;
271  wit_w.set_etat_zero() ;
272  loggam = 0 ;
273  bsn.set_etat_zero() ;
274  pot_centri = 0 ;
275  Psi_comp = 0 ;
278  chi_comp = 0 ;
280  khi = 0 ;
284  hacar_auto = 0 ;
285  hacar_comp = 0 ;
286 
287  // Pointers of derived quantities initialized to zero
288  // --------------------------------------------------
289  set_der_0x0() ;
290 
291 }
292 
293  //------------//
294  // Destructor //
295  //------------//
296 
298 
299  del_deriv() ;
300 
301 }
302 
303  //----------------------------------//
304  // Management of derived quantities //
305  //----------------------------------//
306 
308 
309  Star::del_deriv() ;
310 
311  if (p_xa_barycenter != 0x0) delete p_xa_barycenter ;
312 
313  set_der_0x0() ;
314 }
315 
317 
319 
320  p_xa_barycenter = 0x0 ;
321 
322 }
323 
325 
327 
328  del_deriv() ;
329 
330 }
331 
332 
333  //--------------//
334  // Assignment //
335  //--------------//
336 
337 // Assignment to another Star_bin_xcts
338 // --------------------------------
340 
341  // Assignment of quantities common to the derived classes of Star
342  Star::operator=(star) ;
343 
344  // Assignement of proper quantities of class Star_bin_xcts
345  irrotational = star.irrotational ;
346  psi0 = star.psi0 ;
347  d_psi = star.d_psi ;
348  wit_w = star.wit_w ;
349  loggam = star.loggam ;
350  bsn = star.bsn ;
351  pot_centri = star.pot_centri ;
352  Psi_auto = star.Psi_auto ;
353  Psi_comp = star.Psi_comp ;
354  chi_auto = star.chi_auto ;
355  chi_comp = star.chi_comp ;
356  Psi = star.Psi ;
357  chi = star.chi ;
358  psi4 = star.psi4 ;
359  w_beta = star.w_beta ;
360  khi = star.khi ;
361  dcov_Psi = star.dcov_Psi ;
362  dcov_chi = star.dcov_chi ;
363  flat = star.flat ;
364  beta_auto = star.beta_auto ;
365  beta_comp = star.beta_comp ;
366  haij_auto = star.haij_auto ;
367  haij_comp = star.haij_comp ;
368  hacar_auto = star.hacar_auto ;
369  hacar_comp = star.hacar_comp ;
370  ssjm1_psi = star.ssjm1_psi ;
371  ssjm1_chi = star.ssjm1_chi ;
372  ssjm1_khi = star.ssjm1_khi ;
373  ssjm1_wbeta = star.ssjm1_wbeta ;
374 
375  del_deriv() ; // Deletes all derived quantities
376 
377 }
378 
380 
381  del_deriv() ; // sets to 0x0 all the derived quantities
382  return pot_centri ;
383 
384 }
385 
387 
388  del_deriv() ; // sets to 0x0 all the derived quantities
389  return Psi_comp ;
390 
391 }
392 
394 
395  del_deriv() ; // sets to 0x0 all the derived quantities
396  return Psi_auto ;
397 
398 }
399 
401 
402  del_deriv() ; // sets to 0x0 all the derived quantities
403  return chi_comp ;
404 
405 }
406 
408 
409  del_deriv() ; // sets to 0x0 all the derived quantities
410  return chi_auto ;
411 
412 }
413 
415 
416  del_deriv() ; // sets to 0x0 all the derived quantities
417  return beta_auto ;
418 
419 }
420 
422 
423  del_deriv() ; // sets to 0x0 all the derived quantities
424  return beta ;
425 
426 }
427 
428 
429  //--------------//
430  // Outputs //
431  //--------------//
432 
433 // Save in a file
434 // --------------
435 void Star_bin_xcts::sauve(FILE* fich) const {
436 
437  Star::sauve(fich) ;
438 
439  chi_auto.sauve(fich) ;
440  Psi_auto.sauve(fich) ;
441 
442  w_beta.sauve(fich) ;
443  khi.sauve(fich) ;
444 
445  beta_auto.sauve(fich) ;
446 
447  ssjm1_chi.sauve(fich) ;
448  ssjm1_psi.sauve(fich) ;
449  ssjm1_khi.sauve(fich) ;
450  ssjm1_wbeta.sauve(fich) ;
451 
452  fwrite(&irrotational, sizeof(bool), 1, fich) ;
453 
454  if (irrotational) {
455 
456  psi0.sauve(fich) ;
457  gam_euler.sauve(fich) ; // required to construct d_psi from psi0
458 
459  }
460 
461 }
462 
463 // Printing
464 // --------
465 
466 ostream& Star_bin_xcts::operator>>(ostream& ost) const {
467 
468  using namespace Unites ;
469 
470 // Star::operator>>(ost) ;
471 
472  ost << endl ;
473 
474  ost << "Number of domains occupied by the star : " << nzet << endl ;
475 
476  ost << "Equation of state : " << endl ;
477  ost << eos << endl ;
478 
479  ost << endl << "Central enthalpy : " << ent.val_grid_point(0,0,0,0) << " c^2" << endl ;
480  ost << "Central proper baryon density : " << nbar.val_grid_point(0,0,0,0)
481  << " x 0.1 fm^-3" << endl ;
482  ost << "Central proper energy density : " << ener.val_grid_point(0,0,0,0)
483  << " rho_nuc c^2" << endl ;
484  ost << "Central pressure : " << press.val_grid_point(0,0,0,0)
485  << " rho_nuc c^2" << endl ;
486 
487  ost << endl ;
488 
489  Scalar psi4_local = pow(Psi_auto + Psi_comp + 1., 4.) ;
490  psi4_local.std_spectral_base() ;
491 
492  ost << "Central lapse N : " << nn.val_grid_point(0,0,0,0) << endl ;
493  ost << "Central value of Psi^4 : " << psi4_local.val_grid_point(0,0,0,0) << endl ;
494 
495  ost << endl
496  << "Coordinate equatorial radius (phi=0) a1 = "
497  << ray_eq()/km << " km" << endl ;
498  ost << "Coordinate equatorial radius (phi=pi/2) a2 = "
499  << ray_eq_pis2()/km << " km" << endl ;
500  ost << "Coordinate equatorial radius (phi=pi): "
501  << ray_eq_pi()/km << " km" << endl ;
502  ost << "Coordinate polar radius a3 = "
503  << ray_pole()/km << " km" << endl ;
504  ost << "Axis ratio a2/a1 = " << ray_eq_pis2() / ray_eq()
505  << " a3/a1 = " << ray_pole() / ray_eq() << endl ;
506 
507  double dent_eq = ent.dsdr().val_point(ray_eq(),M_PI/2.,0.) ;
508  double dent_pole = ent.dsdr().val_point(ray_pole(),0.,0.) ;
509  double mass_shedd_chi = fabs( dent_eq / dent_pole ) ;
510 
511  ost << "Mass-shedding estimator = " << mass_shedd_chi << endl ;
512 
513  ost << endl << "Baryon mass : " << mass_b() / msol << " M_sol" << endl ;
514  ost << "Gravitational mass : " << mass_g() / msol << " M_sol" << endl ;
515 
516 
517 
518  ost << endl ;
519  ost << "Star in a binary system" << endl ;
520  ost << "-----------------------" << endl ;
521 
522  if (irrotational) {
523  ost << "irrotational configuration" << endl ;
524  }
525  else {
526  ost << "corotating configuration" << endl ;
527  }
528 
529  ost << "Absolute abscidia of the stellar center: " <<
530  mp.get_ori_x() / km << " km" << endl ;
531 
532  ost << "Absolute abscidia of the barycenter of the baryon density : " <<
533  xa_barycenter() / km << " km" << endl ;
534 
535  double r_0 = 0.5 * ( ray_eq() + ray_eq_pi() ) ;
536  double d_ns = fabs( mp.get_ori_x() ) + ray_eq_pi() - r_0 ;
537  double d_tilde = 2 * d_ns / r_0 ;
538 
539  ost << "d_tilde : " << d_tilde << endl ;
540 
541  ost << "Central value of gam_euler : "
542  << gam_euler.val_grid_point(0, 0, 0, 0) << endl ;
543 
544  ost << "Central u_euler (U^r, U^t, U^p) [c] : "
545  << u_euler(1).val_grid_point(0, 0, 0, 0) << " "
546  << u_euler(2).val_grid_point(0, 0, 0, 0) << " "
547  << u_euler(3).val_grid_point(0, 0, 0, 0) << endl ;
548 
549  if (irrotational) {
550  ost << "Central d_psi (r, t, p) [c] : "
551  << d_psi(1).val_grid_point(0, 0, 0, 0) << " "
552  << d_psi(2).val_grid_point(0, 0, 0, 0) << " "
553  << d_psi(3).val_grid_point(0, 0, 0, 0) << endl ;
554 
555  ost << "Central vel. / co-orb. (W^r, W^t, W^p) [c] : "
556  << wit_w(1).val_grid_point(0, 0, 0, 0) << " "
557  << wit_w(2).val_grid_point(0, 0, 0, 0) << " "
558  << wit_w(3).val_grid_point(0, 0, 0, 0) << endl ;
559 
560  ost << "Max vel. / co-orb. (W^r, W^t, W^p) [c] : "
561  << max(max(wit_w(1))) << " "
562  << max(max(wit_w(2))) << " "
563  << max(max(wit_w(3))) << endl ;
564 
565  ost << "Min vel. / co-orb. (W^r, W^t, W^p) [c] : "
566  << min(min(wit_w(1))) << " "
567  << min(min(wit_w(2))) << " "
568  << min(min(wit_w(3))) << endl ;
569 
570  double r_surf = mp.val_r(0,1.,M_PI/4,M_PI/4) ;
571 
572  ost << "Velocity at (r_surf,pi/4,pi/4) / co-orb. [c] : "
573  << wit_w(1).val_point(r_surf,M_PI/4,M_PI/4) << " "
574  << wit_w(2).val_point(r_surf,M_PI/4,M_PI/4) << " "
575  << wit_w(3).val_point(r_surf,M_PI/4,M_PI/4) << endl ;
576 
577  ost << "Central value of loggam : "
578  << loggam.val_grid_point(0, 0, 0, 0) << endl ;
579  }
580 
581  ost << "Central value of Psi auto, comp : "
582  << Psi_auto.val_grid_point(0, 0, 0, 0) << " "
583  << Psi_comp.val_grid_point(0, 0, 0, 0) << endl ;
584 
585  ost << "Central value of beta (N^r, N^t, N^p) [c] : "
586  << beta(1).val_grid_point(0, 0, 0, 0) << " "
587  << beta(2).val_grid_point(0, 0, 0, 0) << " "
588  << beta(3).val_grid_point(0, 0, 0, 0) << endl ;
589 
590  ost << " ... beta_auto part of it [c] : "
591  << beta_auto(1).val_grid_point(0, 0, 0, 0) << " "
592  << beta_auto(2).val_grid_point(0, 0, 0, 0) << " "
593  << beta_auto(3).val_grid_point(0, 0, 0, 0) << endl ;
594 
595  ost << endl << "Central value of (B^r, B^t, B^p)/N [c] : "
596  << bsn(1).val_grid_point(0, 0, 0, 0) << " "
597  << bsn(2).val_grid_point(0, 0, 0, 0) << " "
598  << bsn(3).val_grid_point(0, 0, 0, 0) << endl ;
599 
600 
601  ost << endl << "Central \\hat{A}^{ij} [c/km] : " << endl ;
602  ost << " \\hat{A}^{xx} auto, comp : "
603  << haij_auto(1, 1).val_grid_point(0, 0, 0, 0) * km << " "
604  << haij_comp(1, 1).val_grid_point(0, 0, 0, 0) * km << endl ;
605  ost << " A^{xy} auto, comp : "
606  << haij_auto(1, 2).val_grid_point(0, 0, 0, 0) * km << " "
607  << haij_comp(1, 2).val_grid_point(0, 0, 0, 0) * km << endl ;
608  ost << " A^{xz} auto, comp : "
609  << haij_auto(1, 3).val_grid_point(0, 0, 0, 0) * km << " "
610  << haij_comp(1, 3).val_grid_point(0, 0, 0, 0) * km << endl ;
611  ost << " A^{yy} auto, comp : "
612  << haij_auto(2, 2).val_grid_point(0, 0, 0, 0) * km << " "
613  << haij_comp(2, 2).val_grid_point(0, 0, 0, 0) * km << endl ;
614  ost << " A^{yz} auto, comp : "
615  << haij_auto(2, 3).val_grid_point(0, 0, 0, 0) * km << " "
616  << haij_comp(2, 3).val_grid_point(0, 0, 0, 0) * km << endl ;
617  ost << " A^{zz} auto, comp : "
618  << haij_auto(3, 3).val_grid_point(0, 0, 0, 0) * km << " "
619  << haij_comp(3, 3).val_grid_point(0, 0, 0, 0) * km << endl ;
620 
621  ost << endl << "Central \\hat{A}_{ij}\\hat{A}^{ij} [c^2/km^2] : "
622  << endl ;
623  ost << " \\hat{A}_{ij}\\hat{A}^{ij} auto, comp : "
624  << hacar_auto.val_grid_point(0, 0, 0, 0) * km*km << " "
625  << hacar_comp.val_grid_point(0, 0, 0, 0) * km*km << endl ;
626 
627  return ost ;
628 }
629 
630  //-------------------------//
631  // Computational routines //
632  //-------------------------//
633 
635 
636  if (!irrotational) {
638  return ;
639  }
640 
641  // Specific relativistic enthalpy ---> hhh
642  //----------------------------------
643 
644  Scalar hhh = exp(ent) ; // = 1 at the Newtonian limit
645 
646  // Computation of W^i = - h Gamma_n B^i/N
647  //----------------------------------------------
648 
649  Vector www = hhh * gam_euler * bsn * psi4 ;
650 
651  // Constant value of W^i at the center of the star
652  //-------------------------------------------------
653 
654  Vector v_orb(mp, COV, mp.get_bvect_cart()) ;
655 
656  for (int i=1; i<=3; i++)
657  v_orb.set(i) = www(i).val_grid_point(0, 0, 0, 0) ;
658 
659  // Gradient of psi
660  //----------------
661 
662  Vector d_psi0 = psi0.derive_cov(flat) ;
663 
664  d_psi0.change_triad( mp.get_bvect_cart() ) ;
665  d_psi0.std_spectral_base() ;
666 
667  d_psi = d_psi0 + v_orb ;
668 
669  for (int i=1; i<=3; i++) {
670  if (d_psi(i).get_etat() == ETATZERO)
671  d_psi.set(i).annule_hard() ;
672  }
673 
674  // C^1 continuation of d_psi outside the star
675  // (to ensure a smooth enthalpy field accross the stellar surface)
676  // ----------------------------------------------------------------
677 
678  int nzm1 = mp.get_mg()->get_nzone() - 1 ;
679  d_psi.annule(nzet, nzm1) ;
680 
681  for (int i=1; i<=3; i++) {
682  Cmp d_psi_i (d_psi(i)) ;
683  d_psi_i.va.set_base( d_psi0(i).get_spectral_va().base ) ;
684  d_psi_i = raccord_c1(d_psi_i, nzet) ;
685  d_psi.set(i) = d_psi_i ;
686  }
687 
689 
690 }
691 
693  double relax_ent,
694  double relax_met,
695  int mer,
696  int fmer_met) {
697 
698  double relax_ent_jm1 = 1. - relax_ent ;
699  double relax_met_jm1 = 1. - relax_met ;
700 
701  ent = relax_ent * ent + relax_ent_jm1 * star_jm1.ent ;
702 
703  if ( (mer != 0) && (mer % fmer_met == 0)) {
704 
705  Psi_auto = relax_met * Psi_auto
706  + relax_met_jm1 * star_jm1.Psi_auto ;
707 
708  chi_auto = relax_met * chi_auto
709  + relax_met_jm1 * star_jm1.chi_auto ;
710 
711  beta_auto = relax_met * beta_auto
712  + relax_met_jm1 * star_jm1.beta_auto ;
713 
714  }
715 
716  del_deriv() ;
717 
719 
720 }
721 }
Scalar chi
Total function .
Definition: star.h:1155
Metric for tensor calculation.
Definition: metric.h:90
Vector bsn
3-vector shift, divided by N, of the rotating coordinates, .
Definition: star.h:1126
virtual void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
Definition: star.C:319
Vector dcov_chi
Covariant derivative of the function .
Definition: star.h:1174
virtual ~Star_bin_xcts()
Destructor.
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Definition: cmp.h:446
Cmp exp(const Cmp &)
Exponential.
Definition: cmp_math.C:273
Vector wit_w
Spatial projection of the fluid 3-velocity with respect to the co-orbiting observer.
Definition: star.h:1115
Map & mp
Mapping associated with the star.
Definition: star.h:180
void operator=(const Star_bin_xcts &)
Assignment to another Star_bin_xcts.
Metric gamma
3-metric
Definition: star.h:235
Lorene prototypes.
Definition: app_hor.h:67
Scalar & set_Psi_auto()
Read/write the conformal factor .
const Eos & eos
Equation of state of the stellar matter.
Definition: star.h:185
Standard units of space, time and mass.
Equation of state base class.
Definition: eos.h:209
Sym_tensor stress_euler
Spatial part of the stress-energy tensor with respect to the Eulerian observer.
Definition: star.h:212
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
Definition: map.h:777
Tensor field of valence 0 (or component of a tensorial field).
Definition: scalar.h:393
virtual void set_etat_nondef()
Sets the logical state of all components to ETATNONDEF (undefined state).
Definition: tensor.C:498
Base class for coordinate mappings.
Definition: map.h:682
double get_ori_x() const
Returns the x coordinate of the origin.
Definition: map.h:780
Vector & set_beta()
Read/write of .
Star_bin_xcts(Map &mp_i, int nzet_i, const Eos &eos_i, bool irrot)
Standard constructor.
Definition: star_bin_xcts.C:84
bool irrotational
true for an irrotational star, false for a corotating one
Definition: star.h:1099
virtual ostream & operator>>(ostream &) const
Operator >> (virtual function called by the operator <<).
Vector dcov_Psi
Covariant derivative of the conformal factor .
Definition: star.h:1171
virtual void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
virtual void std_spectral_base()
Sets the spectral bases of the Valeur va to the standard ones for a scalar field. ...
Definition: scalar.C:790
virtual void sauve(FILE *) const
Save in a binary file.
Definition: tensor.C:915
Scalar & set_chi_comp()
Read/write the conformal factor .
Class for stars in binary system in eXtended Conformal Thin Sandwich formulation. ...
Definition: star.h:1091
Scalar nbar
Baryon density in the fluid frame.
Definition: star.h:192
virtual void change_triad(const Base_vect &)
Sets a new vectorial basis (triad) of decomposition and modifies the components accordingly.
Scalar ent
Log-enthalpy.
Definition: star.h:190
Base class for stars.
Definition: star.h:175
Tbl min(const Cmp &)
Minimum values of a Cmp in each domain.
Definition: cmp_math.C:461
Vector beta
Shift vector.
Definition: star.h:228
Tensor field of valence 1.
Definition: vector.h:188
Sym_tensor haij_auto
Part of the extrinsic curvature tensor generated by beta_auto.
Definition: star.h:1193
void set_base(const Base_val &)
Sets the bases for spectral expansions (member base )
Definition: valeur.C:813
const Metric_flat & flat_met_cart() const
Returns the flat metric associated with the Cartesian coordinates and with components expressed in th...
Definition: map.C:334
Scalar ssjm1_chi
Effective source at the previous step for the resolution of the Poisson equation for ...
Definition: star.h:1216
double val_grid_point(int l, int k, int j, int i) const
Returns the value of the field at a specified grid point.
Definition: scalar.h:643
virtual void std_spectral_base()
Sets the standard spectal bases of decomposition for each component.
Definition: vector.C:322
Vector & set_beta_auto()
Read/write of .
void annule_hard()
Sets the Scalar to zero in a hard way.
Definition: scalar.C:386
void operator=(const Star &)
Assignment to another Star.
Definition: star.C:354
int nzet
Number of domains of *mp occupied by the star.
Definition: star.h:183
virtual void sauve(FILE *) const
Save in a file.
Scalar gam_euler
Lorentz factor between the fluid and Eulerian observers.
Definition: star.h:204
virtual void sauve(FILE *) const
Save in a file.
Definition: scalar.C:692
virtual double val_r(int l, double xi, double theta, double pphi) const =0
Returns the value of the radial coordinate r for a given in a given domain.
Scalar loggam
Logarithm of the Lorentz factor between the fluid and the co-orbiting observer.
Definition: star.h:1120
Scalar ener
Total energy density in the fluid frame.
Definition: star.h:193
Scalar pot_centri
Centrifugal potential.
Definition: star.h:1129
Sym_tensor haij_comp
Part of the extrinsic curvature tensor generated by beta_comp.
Definition: star.h:1199
Vector ssjm1_wbeta
Effective source at the previous step for wbeta of the vector Poisson equation for wbeta (needed for ...
Definition: star.h:1234
Scalar Psi_auto
Scalar field generated principally by the star.
Definition: star.h:1144
Vector d_psi
Gradient of (in the irrotational case) (Spherical components with respect to the mapping of the star...
Definition: star.h:1109
Scalar press
Fluid pressure.
Definition: star.h:194
Vector w_beta
Solution for the vector part of the vector Poisson equation for .
Definition: star.h:1163
Scalar chi_comp
Scalar field generated principally by the companion star.
Definition: star.h:1139
double ray_eq_pis2() const
Coordinate radius at , [r_unit].
Definition: star_global.C:141
Scalar & set_chi_auto()
Read/write the conformal factor .
Vector beta_comp
Part of the shift vector generated principally by the star (Spherical components with respect to the ...
Definition: star.h:1187
virtual double mass_g() const
Gravitational mass.
int get_nzone() const
Returns the number of domains.
Definition: grilles.h:465
Tbl max(const Cmp &)
Maximum values of a Cmp in each domain.
Definition: cmp_math.C:438
Vector u_euler
Fluid 3-velocity with respect to the Eulerian observer.
Definition: star.h:207
double ray_eq_pi() const
Coordinate radius at , [r_unit].
Definition: star_global.C:189
Cmp pow(const Cmp &, int)
Power .
Definition: cmp_math.C:351
Scalar chi_auto
Scalar field generated principally by the star.
Definition: star.h:1134
Scalar ssjm1_khi
Effective source at the previous step for the resolution of the Poisson equation for khi...
Definition: star.h:1227
double val_point(double r, double theta, double phi) const
Computes the value of the field at an arbitrary point , by means of the spectral expansion.
Definition: scalar.C:896
Scalar psi4
Conformal factor .
Definition: star.h:1158
Scalar psi0
Scalar potential of the non-translational part of fluid 4-velocity (in the irrotational case) ...
Definition: star.h:1104
double ray_pole() const
Coordinate radius at [r_unit].
Definition: star_global.C:281
Metric_flat flat
Flat metric defined on the mapping (Spherical components with respect to the mapping of the star) ...
Definition: star.h:1177
Scalar Psi
Total conformal factor .
Definition: star.h:1152
Scalar & set_pot_centri()
Read/write the centrifugal potential.
Scalar hacar_auto
Part of the scalar generated by beta_auto, i.e.
Definition: star.h:1205
virtual void del_deriv() const
Deletes all the derived quantities.
Definition: star.C:301
virtual void del_hydro_euler()
Sets to ETATNONDEF (undefined state) the hydrodynamical quantities relative to the Eulerian observer...
Definition: star.C:333
const Base_vect_cart & get_bvect_cart() const
Returns the Cartesian basis associated with the coordinates (x,y,z) of the mapping, i.e.
Definition: map.h:803
Scalar nn
Lapse function N .
Definition: star.h:225
Vector beta_auto
Part of the shift vector generated principally by the star (Spherical components with respect to the ...
Definition: star.h:1182
double * p_xa_barycenter
Absolute coordinate X of the barycenter of the baryon density.
Definition: star.h:1240
virtual void del_hydro_euler()
Sets to ETATNONDEF (undefined state) the hydrodynamical quantities relative to the Eulerian observer...
void fait_d_psi()
Computes the gradient of the total velocity potential .
double ray_eq() const
Coordinate radius at , [r_unit].
Definition: star_global.C:111
virtual double xa_barycenter() const
Absolute coordinate X of the barycenter of the baryon density,.
const Scalar & dsdr() const
Returns of *this .
Definition: scalar_deriv.C:113
virtual void del_deriv() const
Deletes all the derived quantities.
Scalar Psi_comp
Scalar field generated principally by the companion star.
Definition: star.h:1149
virtual double mass_b() const
Baryon mass.
virtual void change_triad(const Base_vect &new_triad)
Sets a new vectorial basis (triad) of decomposition and modifies the components accordingly.
Scalar hacar_comp
Part of the scalar generated by beta_auto and beta_comp, i.e.
Definition: star.h:1211
virtual void sauve(FILE *) const
Save in a file.
Definition: star.C:400
virtual void set_etat_zero()
Sets the logical state of all components to ETATZERO (zero state).
Definition: tensor.C:506
Scalar & set(int)
Read/write access to a component.
Definition: vector.C:302
void equation_of_state()
Computes the proper baryon and energy density, as well as pressure from the enthalpy.
Definition: star.C:465
const Vector & derive_cov(const Metric &gam) const
Returns the gradient (1-form = covariant vector) of *this
Definition: scalar_deriv.C:390
virtual void annule(int l_min, int l_max)
Sets the Tensor to zero in several domains.
Definition: tensor.C:680
Scalar khi
Solution for the scalar part of the vector Poisson equation for .
Definition: star.h:1168
Scalar ssjm1_psi
Effective source at the previous step for the resolution of the Poisson equation for ...
Definition: star.h:1221
Valeur va
The numerical value of the Cmp.
Definition: cmp.h:464
Scalar & set_Psi_comp()
Read/write the conformal factor .
void relaxation(const Star_bin_xcts &star_prev, double relax_ent, double relax_met, int mer, int fmer_met)
Performs a relaxation on ent, Psi_auto, chi_auto and beta_auto.