LORENE
star_rot_global.C
1 /*
2  * Methods for computing global quantities within the class Star_rot
3  *
4  * (see file star_rot.h for documentation)
5  */
6 
7 /*
8  * Copyright (c) 2010 Eric Gourgoulhon
9  *
10  * This file is part of LORENE.
11  *
12  * LORENE is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version.
16  *
17  * LORENE is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with LORENE; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25  *
26  */
27 
28 
29 
30 
31 /*
32  * $Id: star_rot_global.C,v 1.14 2026/02/05 14:23:25 j_novak Exp $
33  * $Log: star_rot_global.C,v $
34  * Revision 1.14 2026/02/05 14:23:25 j_novak
35  * New method surf_grav_euler().
36  *
37  * Revision 1.13 2026/01/20 08:35:28 j_novak
38  * New method radius_Morsink() to compute the physical radius along the definition of Morsink et al. (2007) in the oblate Schwarschild approximation.
39  *
40  * Revision 1.12 2026/01/19 13:04:23 j_novak
41  * Corrected the location of the surface in surf_gravity()
42  *
43  * Revision 1.11 2023/07/04 09:01:09 j_novak
44  * Changed the name r_pol_circ -> r_circ_merid to explicitly show the radius is a circumferential one, along a meridian.
45  *
46  * Revision 1.10 2023/07/03 14:32:31 j_novak
47  * Added method "r_pol_circ()", to compute polar circumferential radius, with a circumference along a meridian.
48  *
49  * Revision 1.9 2021/10/06 09:41:28 j_novak
50  * Corrected quadrupole computation from Friedman & Stergioulas book
51  *
52  * Revision 1.8 2017/04/13 09:59:34 m_bejger
53  * Bug fix (contraction using physical gamma metric in surf_grav - vector a)
54  *
55  * Revision 1.7 2017/04/11 10:46:55 m_bejger
56  * Star_rot::surf_grav() - surface gravity values along the theta direction
57  *
58  * Revision 1.6 2016/12/05 16:18:15 j_novak
59  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
60  *
61  * Revision 1.5 2015/05/19 09:30:56 j_novak
62  * New methods for computing the area of the star and its mean radius.
63  *
64  * Revision 1.4 2014/10/13 08:53:39 j_novak
65  * Lorene classes and functions now belong to the namespace Lorene.
66  *
67  * Revision 1.3 2014/10/06 15:13:17 j_novak
68  * Modified #include directives to use c++ syntax.
69  *
70  * Revision 1.2 2010/01/25 22:33:35 e_gourgoulhon
71  * Debugging...
72  *
73  * Revision 1.1 2010/01/25 18:15:52 e_gourgoulhon
74  * First version.
75  *
76  *
77  *
78  * $Header: /cvsroot/Lorene/C++/Source/Star/star_rot_global.C,v 1.14 2026/02/05 14:23:25 j_novak Exp $
79  *
80  */
81 
82 // Headers C
83 #include <cstdlib>
84 #include <cmath>
85 
86 // Headers Lorene
87 #include "star_rot.h"
88 #include "unites.h"
89 
90  //--------------------------//
91  // Stellar surface //
92  //--------------------------//
93 
94 namespace Lorene {
95  const Itbl& Star_rot::l_surf() const {
96 
97  if (p_l_surf == 0x0) { // a new computation is required
98 
99  assert(p_xi_surf == 0x0) ; // consistency check
100 
101  int np = mp.get_mg()->get_np(0) ;
102  int nt = mp.get_mg()->get_nt(0) ;
103 
104  p_l_surf = new Itbl(np, nt) ;
105  p_xi_surf = new Tbl(np, nt) ;
106 
107  double ent0 = 0 ; // definition of the surface
108  double precis = 1.e-15 ;
109  int nitermax = 100 ;
110  int niter ;
111 
112  (ent.get_spectral_va()).equipot(ent0, nzet, precis, nitermax, niter, *p_l_surf,
113  *p_xi_surf) ;
114 
115  }
116 
117  return *p_l_surf ;
118 
119  }
120 
121  //------------------------------//
122  // Baryon mass //
123  //------------------------------//
124 
125  double Star_rot::mass_b() const {
126 
127  if (p_mass_b == 0x0) { // a new computation is required
128 
129  if (relativistic) {
130 
131  Scalar dens = a_car * bbb * gam_euler * nbar ;
132 
133  p_mass_b = new double( dens.integrale() ) ;
134  }
135  else{ // Newtonian case
136  assert(nbar.get_etat() == ETATQCQ) ;
137 
138  p_mass_b = new double( nbar.integrale() ) ;
139 
140  }
141 
142  }
143  return *p_mass_b ;
144  }
145 
146 
147  //----------------------------//
148  // Gravitational mass //
149  //----------------------------//
150 
151  double Star_rot::mass_g() const {
152 
153  if (p_mass_g == 0x0) { // a new computation is required
154 
155  if (relativistic) {
156 
157  Scalar source = nn * (ener_euler + s_euler)
158  + 2 * bbb * (ener_euler + press)
159  * tnphi * uuu ;
160  source = a_car * bbb * source ;
161  source.std_spectral_base() ;
162 
163  p_mass_g = new double( source.integrale() ) ;
164  }
165  else{ // Newtonian case
166  p_mass_g = new double( mass_b() ) ; // in the Newtonian case
167  // M_g = M_b
168  }
169  }
170  return *p_mass_g ;
171 }
172 
173  //----------------------------//
174  // Angular momentum //
175  //----------------------------//
176 
177  double Star_rot::angu_mom() const {
178 
179  if (p_angu_mom == 0x0) { // a new computation is required
180 
181  Scalar dens = uuu ;
182 
183  dens.mult_r() ; // Multiplication by
184  dens.set_spectral_va() = (dens.get_spectral_va()).mult_st() ; // r sin(theta)
185 
186  if (relativistic) {
187  dens = a_car * b_car * (ener_euler + press) * dens ;
188  }
189  else { // Newtonian case
190  dens = nbar * dens ;
191  }
192 
193  p_angu_mom = new double( dens.integrale() ) ;
194  }
195  return *p_angu_mom ;
196  }
197 
198 
199  //----------------------------//
200  // T/W //
201  //----------------------------//
202 
203  double Star_rot::tsw() const {
204 
205  if (p_tsw == 0x0) { // a new computation is required
206 
207  double tcin = 0.5 * omega * angu_mom() ;
208 
209  if (relativistic) {
210 
211  Scalar dens = a_car * bbb * gam_euler * ener ;
212  double mass_p = dens.integrale() ;
213 
214  p_tsw = new double( tcin / ( mass_p + tcin - mass_g() ) ) ;
215 
216  }
217  else { // Newtonian case
218  Scalar dens = 0.5 * nbar * logn ;
219  double wgrav = dens.integrale() ;
220  p_tsw = new double( tcin / fabs(wgrav) ) ;
221  }
222  }
223  return *p_tsw ;
224 }
225 
226 
227  //----------------------------//
228  // GRV2 //
229  //----------------------------//
230 
231 double Star_rot::grv2() const {
232 
233  using namespace Unites ;
234  if (p_grv2 == 0x0) { // a new computation is required
235 
236  Scalar sou_m(mp) ;
237  if (relativistic) {
238  sou_m = 2 * qpig * a_car * (press + (ener_euler+press)
239  * uuu*uuu ) ;
240  }
241  else {
242  sou_m = 2 * qpig * (press + nbar * uuu*uuu ) ;
243  }
244 
245  Vector dlogn = logn.derive_cov( mp.flat_met_spher() ) ;
246  Scalar sou_q = 1.5 * ak_car
247  - dlogn(1)*dlogn(1) - dlogn(2)*dlogn(2) - dlogn(3)*dlogn(3) ;
248 
249  p_grv2 = new double( double(1) - lambda_grv2(sou_m, sou_q) ) ;
250 
251  }
252 
253  return *p_grv2 ;
254 
255 }
256 
257 
258  //----------------------------//
259  // GRV3 //
260  //----------------------------//
261 
262 double Star_rot::grv3(ostream* ost) const {
263 
264  using namespace Unites ;
265 
266  if (p_grv3 == 0x0) { // a new computation is required
267 
268  Scalar source(mp) ;
269 
270  // Gravitational term [cf. Eq. (43) of Gourgoulhon & Bonazzola
271  // ------------------ Class. Quantum Grav. 11, 443 (1994)]
272 
273  Vector dlogn = logn.derive_cov( mp.flat_met_spher() ) ;
274 
275  if (relativistic) {
276  Scalar alpha = dzeta - logn ;
277  Scalar bet = log( bbb ) ;
278  bet.std_spectral_base() ;
279 
280  Vector dalpha = alpha.derive_cov( mp.flat_met_spher() ) ;
281  Vector dbet = bet.derive_cov( mp.flat_met_spher() ) ;
282 
283  source = 0.75 * ak_car
284  - dlogn(1)*dlogn(1) - dlogn(2)*dlogn(2) - dlogn(3)*dlogn(3)
285  + 0.5 * ( dalpha(1)*dbet(1) + dalpha(2)*dbet(2) + dalpha(3)*dbet(3) ) ;
286 
287  Scalar aa = alpha - 0.5 * bet ;
288  Scalar daadt = aa.srdsdt() ; // 1/r d/dth
289 
290  // What follows is valid only for a mapping of class Map_radial :
291  const Map_radial* mpr = dynamic_cast<const Map_radial*>(&mp) ;
292  if (mpr == 0x0) {
293  cout << "Star_rot::grv3: the mapping does not belong"
294  << " to the class Map_radial !" << endl ;
295  abort() ;
296  }
297 
298  // Computation of 1/tan(theta) * 1/r daa/dtheta
299  if (daadt.get_etat() == ETATQCQ) {
300  Valeur& vdaadt = daadt.set_spectral_va() ;
301  vdaadt = vdaadt.ssint() ; // division by sin(theta)
302  vdaadt = vdaadt.mult_ct() ; // multiplication by cos(theta)
303  }
304 
305  Scalar temp = aa.dsdr() + daadt ;
306  temp = ( bbb - a_car/bbb ) * temp ;
307  temp.std_spectral_base() ;
308 
309  // Division by r
310  Valeur& vtemp = temp.set_spectral_va() ;
311  vtemp = vtemp.sx() ; // division by xi in the nucleus
312  // Id in the shells
313  // division by xi-1 in the ZEC
314  vtemp = (mpr->xsr) * vtemp ; // multiplication by xi/r in the nucleus
315  // by 1/r in the shells
316  // by r(xi-1) in the ZEC
317 
318  // In the ZEC, a multiplication by r has been performed instead
319  // of the division:
320  temp.set_dzpuis( temp.get_dzpuis() + 2 ) ;
321 
322  source = bbb * source + 0.5 * temp ;
323 
324  }
325  else{
326  source = - 0.5 * ( dlogn(1)*dlogn(1) + dlogn(2)*dlogn(2) + dlogn(3)*dlogn(3) ) ;
327  }
328 
329  source.std_spectral_base() ;
330 
331  double int_grav = source.integrale() ;
332 
333  // Matter term
334  // -----------
335 
336  if (relativistic) {
337  source = qpig * a_car * bbb * s_euler ;
338  }
339  else{
340  source = qpig * ( 3 * press + nbar * uuu * uuu ) ;
341  }
342 
343  source.std_spectral_base() ;
344 
345  double int_mat = source.integrale() ;
346 
347  // Virial error
348  // ------------
349  if (ost != 0x0) {
350  *ost << "Star_rot::grv3 : gravitational term : " << int_grav
351  << endl ;
352  *ost << "Star_rot::grv3 : matter term : " << int_mat
353  << endl ;
354  }
355 
356  p_grv3 = new double( (int_grav + int_mat) / int_mat ) ;
357 
358  }
359 
360  return *p_grv3 ;
361 
362 }
363 
364 
365  //----------------------------//
366  // R_circ //
367  //----------------------------//
368 
369 double Star_rot::r_circ() const {
370 
371  if (p_r_circ == 0x0) { // a new computation is required
372 
373  // Index of the point at phi=0, theta=pi/2 at the surface of the star:
374  const Mg3d* mg = mp.get_mg() ;
375  assert(mg->get_type_t() == SYM) ;
376  int l_b = nzet - 1 ;
377  int i_b = mg->get_nr(l_b) - 1 ;
378  int j_b = mg->get_nt(l_b) - 1 ;
379  int k_b = 0 ;
380 
381  p_r_circ = new double( bbb.val_grid_point(l_b, k_b, j_b, i_b) * ray_eq() ) ;
382 
383  }
384 
385  return *p_r_circ ;
386 
387 }
388 
389 double Star_rot::r_circ_merid() const {
390 
391  if (p_r_circ_merid == 0x0) { // a new computation is required
392  const Mg3d& mg = *(mp.get_mg()) ;
393  int np = mg.get_np(0) ;
394  int nt = mg.get_nt(0) ;
395  assert(np == 1) ; //Only valid for axisymmetric configurations
396 
397  const Map_radial* mp_rad = dynamic_cast<const Map_radial*>(&mp) ;
398  assert(mp_rad != 0x0) ;
399 
400  Valeur va_r(mg.get_angu()) ;
401  va_r.annule_hard() ;
402  Itbl lsurf = l_surf() ;
403  Tbl xisurf = xi_surf() ;
404  for (int k=0; k<np; k++) {
405  for (int j=0; j<nt; j++) {
406  int l_star = lsurf(k, j) ;
407  double xi_star = xisurf(k, j) ;
408  va_r.set(0, k, j, 0) = mp_rad->val_r_jk(l_star, xi_star, j, k) ;
409  }
410  }
411  va_r.std_base_scal() ;
412 
413  Valeur integ(mg.get_angu()) ;
414  Valeur dr = va_r.dsdt() ;
415  integ = sqrt(va_r*va_r + dr*dr) ;
417  int k = 0 ;
418  for (int j=0; j<nt; j++) {
419  integ.set(0, k, j, 0)
420  *= sqrt(a2.val_point_jk(lsurf(k, j), xisurf(k, j), j, k)) ;
421  }
422  integ.std_base_scal() ;
423  integ.coef() ;
424  double surftot = (*integ.c_cf)(0, k, 0, 0) ; // Only j=0 has a nonvanishing
425  // integral
426  p_r_circ_merid = new double(surftot ) ;
427 
428  }
429 
430  return *p_r_circ_merid ;
431 
432 }
433 
434  //----------------------------//
435  // Surface area //
436  //----------------------------//
437 
438  double Star_rot::area() const {
439 
440  if (p_area == 0x0) { // a new computation is required
441  const Mg3d& mg = *(mp.get_mg()) ;
442  int np = mg.get_np(0) ;
443  int nt = mg.get_nt(0) ;
444  assert(np == 1) ; //Only valid for axisymmetric configurations
445 
446  const Map_radial* mp_rad = dynamic_cast<const Map_radial*>(&mp) ;
447  assert(mp_rad != 0x0) ;
448 
449  Valeur va_r(mg.get_angu()) ;
450  va_r.annule_hard() ;
451  Itbl lsurf = l_surf() ;
452  Tbl xisurf = xi_surf() ;
453  for (int k=0; k<np; k++) {
454  for (int j=0; j<nt; j++) {
455  int l_star = lsurf(k, j) ;
456  double xi_star = xisurf(k, j) ;
457  va_r.set(0, k, j, 0) = mp_rad->val_r_jk(l_star, xi_star, j, k) ;
458  }
459  }
460  va_r.std_base_scal() ;
461 
462  Valeur integ(mg.get_angu()) ;
463  Valeur dr = va_r.dsdt() ;
464  integ = sqrt(va_r*va_r + dr*dr) ;
467  for (int k=0; k<np; k++) {
468  for (int j=0; j<nt; j++) {
469  integ.set(0, k, j, 0) *= sqrt(a2.val_point_jk(lsurf(k, j), xisurf(k, j), j, k))
470  * b.val_point_jk(lsurf(k, j), xisurf(k, j), j, k) * va_r(0, k, j, 0) ;
471  }
472  }
473  integ.std_base_scal() ;
474  Valeur integ2 = integ.mult_st() ;
475  double surftot = 0. ;
476  for (int j=0; j<nt; j++) {
477  surftot += (*integ2.c_cf)(0, 0, j, 0) / double(2*j+1) ;
478  }
479 
480  p_area = new double( 4*M_PI*surftot) ;
481 
482  }
483 
484  return *p_area ;
485 
486 }
487 
488  double Star_rot::mean_radius() const {
489 
490  return sqrt(area()/(4*M_PI)) ;
491 
492  }
493 
494  //----------------------------//
495  // Flattening //
496  //----------------------------//
497 
498 double Star_rot::aplat() const {
499 
500  if (p_aplat == 0x0) { // a new computation is required
501 
502  p_aplat = new double( ray_pole() / ray_eq() ) ;
503 
504  }
505 
506  return *p_aplat ;
507 
508 }
509 
510 
511  //----------------------------//
512  // Z_eq_f //
513  //----------------------------//
514 
515 double Star_rot::z_eqf() const {
516 
517  if (p_z_eqf == 0x0) { // a new computation is required
518 
519  // Index of the point at phi=0, theta=pi/2 at the surface of the star:
520  const Mg3d* mg = mp.get_mg() ;
521  assert(mg->get_type_t() == SYM) ;
522  int l_b = nzet - 1 ;
523  int i_b = mg->get_nr(l_b) - 1 ;
524  int j_b = mg->get_nt(l_b) - 1 ;
525  int k_b = 0 ;
526 
527  double u_eq = uuu.val_grid_point(l_b, k_b, j_b, i_b) ;
528  double n_eq = nn.val_grid_point(l_b, k_b, j_b, i_b) ;
529  double nphi_eq = nphi.val_grid_point(l_b, k_b, j_b, i_b) ;
530 
531  p_z_eqf = new double( sqrt((1.-u_eq)/(1.+u_eq))
532  / (n_eq + nphi_eq * r_circ() )
533  - 1. ) ;
534  }
535 
536  return *p_z_eqf ;
537 
538 }
539  //----------------------------//
540  // Z_eq_b //
541  //----------------------------//
542 
543 double Star_rot::z_eqb() const {
544 
545  if (p_z_eqb == 0x0) { // a new computation is required
546 
547  // Index of the point at phi=0, theta=pi/2 at the surface of the star:
548  const Mg3d* mg = mp.get_mg() ;
549  assert(mg->get_type_t() == SYM) ;
550  int l_b = nzet - 1 ;
551  int i_b = mg->get_nr(l_b) - 1 ;
552  int j_b = mg->get_nt(l_b) - 1 ;
553  int k_b = 0 ;
554 
555  double u_eq = uuu.val_grid_point(l_b, k_b, j_b, i_b) ;
556  double n_eq = nn.val_grid_point(l_b, k_b, j_b, i_b) ;
557  double nphi_eq = nphi.val_grid_point(l_b, k_b, j_b, i_b) ;
558 
559  p_z_eqb = new double( sqrt((1.+u_eq)/(1.-u_eq))
560  / (n_eq - nphi_eq * r_circ() )
561  - 1. ) ;
562 
563  }
564 
565  return *p_z_eqb ;
566 
567 }
568 
569 
570  //----------------------------//
571  // Z_pole //
572  //----------------------------//
573 
574 double Star_rot::z_pole() const {
575 
576  if (p_z_pole == 0x0) { // a new computation is required
577 
578  double n_pole = nn.val_point(ray_pole(), 0., 0.) ;
579 
580  p_z_pole = new double( 1. / n_pole - 1. ) ;
581 
582  }
583 
584  return *p_z_pole ;
585 
586 }
587 
588 
589  //----------------------------//
590  // Quadrupole moment //
591  // Uses Eq.(11) of Pappas & //
592  // Apostolatos, PRL 108 2012 //
593  //----------------------------//
594 
595 double Star_rot::mom_quad() const {
596 
597  using namespace Unites ;
598  if (p_mom_quad == 0x0) { // a new computation is required
599 
600  // Source for of the Poisson equation for nu
601  // -----------------------------------------
602 
603  Scalar source(mp) ;
604 
605  if (relativistic) {
606  Scalar bet = log(bbb) ;
607  bet.std_spectral_base() ;
608 
609  Vector dlogn = logn.derive_cov( mp.flat_met_spher() ) ;
610  Vector dlogn_bet = dlogn + bet.derive_cov( mp.flat_met_spher() ) ;
611 
612  source = qpig * a_car *( ener_euler + s_euler ) + ak_car
613  - dlogn(1)*dlogn_bet(1) - dlogn(2)*dlogn_bet(2) - dlogn(3)*dlogn_bet(3) ;
614  }
615  else {
616  source = qpig * nbar ;
617  }
618 
619  source.std_spectral_base() ;
620 
621  // Multiplication by -r^2 P_2(cos(theta))
622  // [cf Eq.(7) of Salgado et al. Astron. Astrophys. 291, 155 (1994) ]
623  // ------------------------------------------------------------------
624 
625  // Multiplication by r^2 :
626  // ----------------------
627  source.mult_r() ;
628  source.mult_r() ;
629  if (source.check_dzpuis(2)) {
630  source.inc_dzpuis(2) ;
631  }
632 
633  // Muliplication by cos^2(theta) :
634  // -----------------------------
635  Scalar temp = source ;
636 
637  // What follows is valid only for a mapping of class Map_radial :
638  assert( dynamic_cast<const Map_radial*>(&mp) != 0x0 ) ;
639 
640  if (temp.get_etat() == ETATQCQ) {
641  Valeur& vtemp = temp.set_spectral_va() ;
642  vtemp = vtemp.mult_ct() ; // multiplication by cos(theta)
643  vtemp = vtemp.mult_ct() ; // multiplication by cos(theta)
644  }
645 
646  // Muliplication by -P_2(cos(theta)) :
647  // ----------------------------------
648  source = 0.5 * source - 1.5 * temp ;
649 
650  // First part
651  // ------------
652 
653  p_mom_quad = new double( -source.integrale() / qpig ) ;
654 
655  // Correction terms from (3.37) of Friedman & Stergioulas' book
656  if (relativistic) {
657 
658  Scalar correct(mp) ;
659  correct = a_car * bbb * nn * press ;
660  correct.mult_rsint() ;
661  correct.std_spectral_base() ;
662 
663  double Bo = -32. * correct.integrale() / qpig ;
664 
665  *p_mom_quad -= 4./3. * (1./4. + Bo/(mass_g() * mass_g()))
666  * pow(mass_g(), 3) * ggrav * ggrav ;
667  }
668 
669  }
670 
671  return *p_mom_quad ;
672 
673 }
674 
675 
676  //----------------------------//
677  // Surface gravity //
678  //----------------------------//
679 
680 const Tbl& Star_rot::surf_grav() const {
681 
682  using namespace Unites ;
683  if (p_surf_grav == 0x0) { // a new computation is required
684 
685  const Mg3d* mg = mp.get_mg() ;
686  assert(mg->get_type_t() == SYM) ;
687  int nt = mg->get_nt(0) ; // number of theta points
688 
689  Scalar loggam = log(gam_euler) ;
690  loggam.std_spectral_base() ;
691 
693  - loggam.derive_cov( mp.flat_met_spher() );
694 
695  Scalar g_s = sqrt(contract( a, 0, a.up_down(gamma), 0 )) ;
696  g_s.std_spectral_base() ;
697 
698  p_surf_grav = new Tbl(nt) ;
700 
701  for(int j = 0; j < nt; j++) {
702  int l_b = l_surf()(0, j) ;
703  double xi_b = xi_surf()(0, j) ;
704  p_surf_grav->set(j) = g_s.get_spectral_va().val_point_jk(l_b, xi_b, j, 0) ;
705  }
706  }
707 
708  return *p_surf_grav ;
709 
710 }
711 
713 
714  using namespace Unites ;
715  if (p_surf_grav_euler == 0x0) { // a new computation is required
716 
717  const Mg3d* mg = mp.get_mg() ;
718  assert(mg->get_type_t() == SYM) ;
719  int nt = mg->get_nt(0) ; // number of theta points
720 
722 
723  Scalar g_s = sqrt(contract( a, 0, a.up_down(gamma), 0 )) ;
724  g_s.std_spectral_base() ;
725 
726  p_surf_grav_euler = new Tbl(nt) ;
728 
729  for(int j = 0; j < nt; j++) {
730  int l_b = l_surf()(0, j) ;
731  double xi_b = xi_surf()(0, j) ;
732  p_surf_grav_euler->set(j) = g_s.get_spectral_va().val_point_jk(l_b, xi_b, j, 0) ;
733  }
734  }
735 
736  return *p_surf_grav_euler ;
737 
738 }
739 
740  //----------------------------//
741  // Circular radius (\theta) //
742  //----------------------------//
743 
745 
746  using namespace Unites ;
747  if (p_radius_Morsink == 0x0) { // a new computation is required
748 
749  const Mg3d* mg = mp.get_mg() ;
750  assert(mg->get_type_t() == SYM) ;
751  int nt = mg->get_nt(0) ; // number of theta points
752 
753  p_radius_Morsink = new Tbl(nt) ;
755  const Map_radial* mp_rad = dynamic_cast<const Map_radial*>(&mp) ;
756 
757  for(int j = 0; j < nt; j++) {
758  int l_b = l_surf()(0, j) ;
759  double xi_b = xi_surf()(0, j) ;
761  = bbb.get_spectral_va().val_point_jk(l_b, xi_b, j, 0)
762  * mp_rad->val_r_jk(l_b, xi_b, j, 0) ;
763  }
764  }
765 
766  return *p_radius_Morsink ;
767 
768 }
769 
770 }
virtual double mass_g() const
Gravitational mass.
const Scalar & get_a_car() const
Returns the square of the metric factor A.
Definition: star_rot.h:343
double * p_mass_b
Baryon mass.
Definition: star.h:268
const Valeur & dsdt() const
Returns of *this.
Definition: valeur_dsdt.C:115
Cmp log(const Cmp &)
Neperian logarithm.
Definition: cmp_math.C:299
Mtbl_cf * c_cf
Coefficients of the spectral expansion of the function.
Definition: valeur.h:312
Scalar dzeta
Metric potential .
Definition: star_rot.h:152
virtual double mean_radius() const
Mean star radius from the area .
Scalar a_car
Square of the metric factor A.
Definition: star_rot.h:122
void mult_r()
Multiplication by r everywhere; dzpuis is not changed.
Map & mp
Mapping associated with the star.
Definition: star.h:180
static double lambda_grv2(const Scalar &sou_m, const Scalar &sou_q)
Computes the coefficient which ensures that the GRV2 virial identity is satisfied.
virtual double r_circ_merid() const
Crcumferential meridional radius.
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
Definition: grilles.h:481
Cmp sqrt(const Cmp &)
Square root.
Definition: cmp_math.C:223
double * p_r_circ
Circumferential radius (equator)
Definition: star_rot.h:254
Metric gamma
3-metric
Definition: star.h:235
bool relativistic
Indicator of relativity: true for a relativistic star, false for a Newtonian one. ...
Definition: star_rot.h:112
Scalar tnphi
Component of the shift vector.
Definition: star_rot.h:136
double * p_mom_quad
Quadrupole moment.
Definition: star_rot.h:261
Scalar bbb
Metric factor B.
Definition: star_rot.h:125
Lorene prototypes.
Definition: app_hor.h:67
Standard units of space, time and mass.
void annule_hard()
Sets the Valeur to zero in a hard way.
Definition: valeur.C:726
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
Definition: map.h:792
virtual double z_pole() const
Redshift factor at North pole.
double & set(int i)
Read/write of a particular element (index i) (1D case)
Definition: tbl.h:301
Tensor field of valence 0 (or component of a tensorial field).
Definition: scalar.h:399
virtual double grv2() const
Error on the virial identity GRV2.
double integrale() const
Computes the integral over all space of *this .
Definition: scalar_integ.C:67
virtual const Tbl & surf_grav_euler() const
Surface gravity for the Eulerian observer (table along the theta direction)
Tensor up_down(const Metric &gam) const
Computes a new tensor by raising or lowering all the indices of *this .
int get_type_t() const
Returns the type of sampling in the direction: SYM : : symmetry with respect to the equatorial pl...
Definition: grilles.h:504
Basic integer array class.
Definition: itbl.h:122
const Valeur & sx() const
Returns (r -sampling = RARE ) \ Id (r sampling = FIN ) \ (r -sampling = UNSURR ) ...
Definition: valeur_sx.C:113
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
Values and coefficients of a (real-value) function.
Definition: valeur.h:297
double omega
Rotation angular velocity ([f_unit] )
Definition: star_rot.h:119
Scalar nbar
Baryon density in the fluid frame.
Definition: star.h:192
int get_etat() const
Returns the logical state ETATNONDEF (undefined), ETATZERO (null) or ETATQCQ (ordinary).
Definition: scalar.h:566
Scalar ent
Log-enthalpy.
Definition: star.h:190
virtual const Tbl & surf_grav() const
Surface gravity (table along the theta direction)
Scalar s_euler
Trace of the stress scalar in the Eulerian frame.
Definition: star.h:201
Tensor field of valence 1.
Definition: vector.h:188
Tbl * p_radius_Morsink
Physical radius close to the definition of Morsink et al. (2007)
Definition: star_rot.h:274
void std_base_scal()
Sets the bases for spectral expansions (member base ) to the standard ones for a scalar.
Definition: valeur.C:827
virtual double area() const
Integrated surface area in .
virtual const Itbl & l_surf() const
Description of the stellar surface: returns a 2-D Itbl containing the values of the domain index l on...
void set_dzpuis(int)
Modifies the dzpuis flag.
Definition: scalar.C:814
const Tbl & xi_surf() const
Description of the stellar surface: returns a 2-D Tbl containing the values of the radial coordinate ...
Definition: star_global.C:92
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:649
Tbl * p_xi_surf
Description of the stellar surface: 2-D Tbl containing the values of the radial coordinate on the su...
Definition: star.h:266
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Definition: tbl.C:364
int nzet
Number of domains of *mp occupied by the star.
Definition: star.h:183
double * p_tsw
Ratio T/W.
Definition: star_rot.h:251
Scalar nphi
Metric coefficient .
Definition: star_rot.h:131
double * p_z_eqf
Forward redshift factor at equator.
Definition: star_rot.h:258
Scalar gam_euler
Lorentz factor between the fluid and Eulerian observers.
Definition: star.h:204
Scalar ener
Total energy density in the fluid frame.
Definition: star.h:193
double * p_grv2
Error on the virial identity GRV2.
Definition: star_rot.h:252
double * p_area
Integrated surface area.
Definition: star_rot.h:257
double * p_r_circ_merid
Circumferential radius (meridian)
Definition: star_rot.h:255
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...
Scalar press
Fluid pressure.
Definition: star.h:194
virtual double mass_b() const
Baryon mass.
const Valeur & ssint() const
Returns of *this.
Definition: valeur_ssint.C:115
const Mg3d * get_angu() const
Returns the pointer on the associated angular grid.
Definition: mg3d.C:609
virtual const Tbl & radius_Morsink() const
Physical radius following Morsink et al.
int get_dzpuis() const
Returns dzpuis.
Definition: scalar.h:569
virtual double mom_quad() const
Quadrupole moment.
virtual double angu_mom() const
Angular momentum.
double * p_z_pole
Redshift factor at North pole.
Definition: star_rot.h:260
Base class for pure radial mappings.
Definition: map.h:1606
const Valeur & mult_st() const
Returns applied to *this.
virtual double val_r_jk(int l, double xi, int j, int k) const =0
Returns the value of the radial coordinate r for a given and a given collocation point in in a give...
const Scalar & get_bbb() const
Returns the metric factor B.
Definition: star_rot.h:340
double * p_grv3
Error on the virial identity GRV3.
Definition: star_rot.h:253
Tbl * p_surf_grav_euler
Surface gravity for the Eulerian observer (along the theta direction)
Definition: star_rot.h:272
double val_point_jk(int l, double x, int j, int k) const
Computes the value of the field represented by *this at an arbitrary point in , but collocation point...
Definition: valeur.C:903
Coord xsr
in the nucleus; \ 1/R in the non-compactified shells; \ in the compactified outer domain...
Definition: map.h:1619
void mult_rsint()
Multiplication by everywhere; dzpuis is not changed.
virtual double r_circ() const
Circumferential equatorial radius.
double * p_angu_mom
Angular momentum.
Definition: star_rot.h:250
Cmp pow(const Cmp &, int)
Power .
Definition: cmp_math.C:351
Tenseur contract(const Tenseur &, int id1, int id2)
Self contraction of two indices of a Tenseur .
Scalar logn
Logarithm of the lapse N .
Definition: star.h:222
Scalar b_car
Square of the metric factor B.
Definition: star_rot.h:128
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
void std_base_scal()
Sets the spectral bases of the Valeur va to the standard ones for a scalar.
Definition: cmp.C:647
double ray_pole() const
Coordinate radius at [r_unit].
Definition: star_global.C:281
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
Definition: grilles.h:471
double * p_aplat
Flatening r_pole/r_eq.
Definition: star_rot.h:256
Multi-domain grid.
Definition: grilles.h:276
virtual double z_eqb() const
Backward redshift factor at equator.
virtual double grv3(ostream *ost=0x0) const
Error on the virial identity GRV3.
const Scalar & srdsdt() const
Returns of *this .
Definition: scalar_deriv.C:144
Scalar nn
Lapse function N .
Definition: star.h:225
Scalar uuu
Norm of u_euler.
Definition: star_rot.h:139
double ray_eq() const
Coordinate radius at , [r_unit].
Definition: star_global.C:111
const Scalar & dsdr() const
Returns of *this .
Definition: scalar_deriv.C:112
const Valeur & mult_ct() const
Returns applied to *this.
Basic array class.
Definition: tbl.h:164
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
Definition: grilles.h:476
Valeur & set_spectral_va()
Returns va (read/write version)
Definition: scalar.h:616
bool check_dzpuis(int dzi) const
Returns false if the last domain is compactified and *this is not zero in this domain and dzpuis is n...
Definition: scalar.C:879
Scalar ak_car
Scalar .
Definition: star_rot.h:204
virtual double aplat() const
Flatening r_pole/r_eq.
const Vector & derive_cov(const Metric &gam) const
Returns the gradient (1-form = covariant vector) of *this
Definition: scalar_deriv.C:389
Tbl * p_surf_grav
Surface gravity (along the theta direction)
Definition: star_rot.h:270
Scalar ener_euler
Total energy density in the Eulerian frame.
Definition: star.h:198
Itbl * p_l_surf
Description of the stellar surface: 2-D Itbl containing the values of the domain index l on the surfa...
Definition: star.h:260
double * p_mass_g
Gravitational mass.
Definition: star.h:269
const Metric_flat & flat_met_spher() const
Returns the flat metric associated with the spherical coordinates and with components expressed in th...
Definition: map.C:327
virtual double z_eqf() const
Forward redshift factor at equator.
virtual double tsw() const
Ratio T/W.
const Valeur & get_spectral_va() const
Returns va (read only version)
Definition: scalar.h:613
double * p_z_eqb
Backward redshift factor at equator.
Definition: star_rot.h:259