LORENE
star_rot.h
1 /*
2  * Definition of Lorene class Star_rot
3  *
4  */
5 
6 /*
7  * Copyright (c) 2010 Eric Gourgoulhon
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 as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * LORENE is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with LORENE; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24  *
25  */
26 
27 
28 #ifndef __STAR_ROT_H_
29 #define __STAR_ROT_H_
30 
31 /*
32  * $Id: star_rot.h,v 1.6 2015/05/19 09:30:55 j_novak Exp $
33  * $Log: star_rot.h,v $
34  * Revision 1.6 2015/05/19 09:30:55 j_novak
35  * New methods for computing the area of the star and its mean radius.
36  *
37  * Revision 1.5 2014/10/13 08:52:36 j_novak
38  * Lorene classes and functions now belong to the namespace Lorene.
39  *
40  * Revision 1.4 2010/02/08 10:56:30 j_novak
41  * Added a few things missing for the reading from resulting file.
42  *
43  * Revision 1.3 2010/02/02 13:35:00 e_gourgoulhon
44  * Remove the "under construction" mark.
45  *
46  * Revision 1.2 2010/01/25 18:14:05 e_gourgoulhon
47  * Added member unsurc2
48  * Added method is_relativistic()
49  * Suppressed method f_eccentric
50  *
51  * Revision 1.1 2010/01/24 16:07:45 e_gourgoulhon
52  * New class Star_rot.
53  *
54  *
55  * $Header: /cvsroot/Lorene/C++/Include/star_rot.h,v 1.6 2015/05/19 09:30:55 j_novak Exp $
56  *
57  */
58 
59 // Headers Lorene
60 #include "star.h"
61 
62 namespace Lorene {
63 class Eos ;
64 
65  //--------------------------//
66  // class Star_rot //
67  //--------------------------//
68 
86 class Star_rot : public Star {
87 
88  // Data :
89  // -----
90  protected:
94  bool relativistic ;
95 
99  double unsurc2 ;
100 
101  double omega ;
102 
105 
108 
111 
114 
119 
122 
127 
132 
135 
138 
151 
161 
168 
187 
193 
199 
204 
209 
217 
226 
227 
228  // Derived data :
229  // ------------
230  protected:
231 
232  mutable double* p_angu_mom ;
233  mutable double* p_tsw ;
234  mutable double* p_grv2 ;
235  mutable double* p_grv3 ;
236  mutable double* p_r_circ ;
237  mutable double* p_aplat ;
238  mutable double* p_area ;
239  mutable double* p_z_eqf ;
240  mutable double* p_z_eqb ;
241  mutable double* p_z_pole ;
242  mutable double* p_mom_quad ;
243  mutable double* p_r_isco ;
244  mutable double* p_f_isco ;
245  mutable double* p_espec_isco ;
248  mutable double* p_lspec_isco ;
249  mutable double* p_f_eq ;
250 
251 
252 
253  // Constructors - Destructor
254  // -------------------------
255  public:
264  Star_rot(Map& mp_i, int nzet_i, bool relat, const Eos& eos_i) ;
265 
266 
267  Star_rot(const Star_rot& ) ;
268 
276  Star_rot(Map& mp_i, const Eos& eos_i, FILE* fich) ;
277 
278  virtual ~Star_rot() ;
279 
280 
281  // Memory management
282  // -----------------
283  protected:
285  virtual void del_deriv() const ;
286 
288  virtual void set_der_0x0() const ;
289 
293  virtual void del_hydro_euler() ;
294 
295 
296  // Mutators / assignment
297  // ---------------------
298  public:
300  void operator=(const Star_rot& ) ;
301 
302  // Accessors
303  // ---------
304  public:
308  bool is_relativistic() const {return relativistic; } ;
309 
313  virtual double get_omega_c() const ;
314 
316  const Scalar& get_bbb() const {return bbb;} ;
317 
319  const Scalar& get_a_car() const {return a_car;} ;
320 
322  const Scalar& get_b_car() const {return b_car;} ;
323 
325  const Scalar& get_nphi() const {return nphi;} ;
326 
330  const Scalar& get_tnphi() const {return tnphi;} ;
331 
333  const Scalar& get_uuu() const {return uuu;} ;
334 
338  const Scalar& get_nuf() const {return nuf;} ;
339 
343  const Scalar& get_nuq() const {return nuq;} ;
344 
346  const Scalar& get_dzeta() const {return dzeta;} ;
347 
349  const Scalar& get_tggg() const {return tggg;} ;
350 
363  const Vector& get_w_shift() const {return w_shift;} ;
364 
377  const Scalar& get_khi_shift() const {return khi_shift;} ;
378 
384  const Sym_tensor& get_tkij() const {return tkij;} ;
385 
403  const Scalar& get_ak_car() const {return ak_car;} ;
404 
405  // Outputs
406  // -------
407  public:
408  virtual void sauve(FILE* ) const ;
409 
411  virtual void display_poly(ostream& ) const ;
412 
413  protected:
415  virtual ostream& operator>>(ostream& ) const ;
416 
418  virtual void partial_display(ostream& ) const ;
419 
420  // Global quantities
421  // -----------------
422  public:
423 
431  virtual const Itbl& l_surf() const ;
432 
433  virtual double mass_b() const ;
434  virtual double mass_g() const ;
435  virtual double angu_mom() const ;
436  virtual double tsw() const ;
437 
441  virtual double grv2() const ;
442 
454  virtual double grv3(ostream* ost = 0x0) const ;
455 
456  virtual double r_circ() const ;
457  virtual double aplat() const ;
458  virtual double area() const ;
459  virtual double mean_radius() const ;
461  virtual double z_eqf() const ;
462  virtual double z_eqb() const ;
463  virtual double z_pole() const ;
464 
474  virtual double mom_quad() const ;
475 
482  virtual double r_isco(ostream* ost = 0x0) const ;
483 
485  virtual double f_isco() const ;
486 
488  virtual double espec_isco() const ;
489 
491  virtual double lspec_isco() const ;
492 
494  virtual double f_eq() const ;
495 
496 
497  // Computational routines
498  // ----------------------
499  public:
510  virtual void hydro_euler() ;
511 
522  void update_metric() ;
523 
532  void fait_shift() ;
533 
537  void fait_nphi() ;
538 
542  void extrinsic_curvature() ;
543 
573  static double lambda_grv2(const Scalar& sou_m, const Scalar& sou_q) ;
574 
654  virtual void equilibrium(double ent_c, double omega0, double fact_omega,
655  int nzadapt, const Tbl& ent_limit,
656  const Itbl& icontrol, const Tbl& control,
657  double mbar_wanted, double aexp_mass,
658  Tbl& diff, Param* = 0x0) ;
659 
660 
661 };
662 
663 }
664 #endif
virtual void equilibrium(double ent_c, double omega0, double fact_omega, int nzadapt, const Tbl &ent_limit, const Itbl &icontrol, const Tbl &control, double mbar_wanted, double aexp_mass, Tbl &diff, Param *=0x0)
Computes an equilibrium configuration.
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:319
Vector ssjm1_wshift
Effective source at the previous step for the resolution of the vector Poisson equation for ...
Definition: star_rot.h:225
Scalar dzeta
Metric potential .
Definition: star_rot.h:134
virtual double mean_radius() const
Mean star radius from the area .
Scalar ssjm1_dzeta
Effective source at the previous step for the resolution of the Poisson equation for dzeta ...
Definition: star_rot.h:203
Scalar a_car
Square of the metric factor A.
Definition: star_rot.h:104
virtual double lspec_isco() const
Angular momentum of a particle on the ISCO.
static double lambda_grv2(const Scalar &sou_m, const Scalar &sou_q)
Computes the coefficient which ensures that the GRV2 virial identity is satisfied.
double * p_lspec_isco
Specific angular momentum of a particle on the ISCO.
Definition: star_rot.h:248
double * p_r_isco
Circumferential radius of the ISCO.
Definition: star_rot.h:243
Scalar nuf
Part of the Metric potential = logn generated by the matter terms.
Definition: star_rot.h:126
double * p_f_eq
Orbital frequency at the equator.
Definition: star_rot.h:249
double * p_r_circ
Circumferential radius.
Definition: star_rot.h:236
Scalar khi_shift
Scalar used in the decomposition of shift , following Shibata's prescription [Prog.
Definition: star_rot.h:160
bool relativistic
Indicator of relativity: true for a relativistic star, false for a Newtonian one. ...
Definition: star_rot.h:94
Scalar tnphi
Component of the shift vector.
Definition: star_rot.h:118
double * p_mom_quad
Quadrupole moment.
Definition: star_rot.h:242
virtual double f_eq() const
Orbital frequency at the equator.
Scalar bbb
Metric factor B.
Definition: star_rot.h:107
Lorene prototypes.
Definition: app_hor.h:64
Equation of state base class.
Definition: eos.h:190
virtual double z_pole() const
Redshift factor at North pole.
double * p_f_isco
Orbital frequency of the ISCO.
Definition: star_rot.h:244
Tensor field of valence 0 (or component of a tensorial field).
Definition: scalar.h:387
virtual double grv2() const
Error on the virial identity GRV2.
Base class for coordinate mappings.
Definition: map.h:670
void extrinsic_curvature()
Computes tkij and ak_car from shift , nnn and b_car .
virtual void hydro_euler()
Computes the hydrodynamical quantities relative to the Eulerian observer from those in the fluid fram...
virtual double get_omega_c() const
Returns the central value of the rotation angular velocity ([f_unit] )
Definition: star_rot.C:640
virtual void del_deriv() const
Deletes all the derived quantities.
Definition: star_rot.C:297
Basic integer array class.
Definition: itbl.h:122
void update_metric()
Computes metric coefficients from known potentials.
Scalar nuq
Part of the Metric potential = logn generated by the quadratic terms.
Definition: star_rot.h:131
double omega
Rotation angular velocity ([f_unit] )
Definition: star_rot.h:101
Base class for stars.
Definition: star.h:175
Tensor field of valence 1.
Definition: vector.h:188
bool is_relativistic() const
Returns true for a relativistic star, false for a Newtonian one.
Definition: star_rot.h:308
virtual double area() const
Integrated surface area in .
Class for isolated rotating stars.
Definition: star_rot.h:86
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...
Scalar ssjm1_tggg
Effective source at the previous step for the resolution of the Poisson equation for tggg ...
Definition: star_rot.h:208
const Vector & get_w_shift() const
Returns the vector used in the decomposition of shift , following Shibata's prescription [Prog...
Definition: star_rot.h:363
virtual void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
Definition: star_rot.C:322
void operator=(const Star_rot &)
Assignment to another Star_rot.
Definition: star_rot.C:359
virtual ostream & operator>>(ostream &) const
Operator >> (virtual function called by the operator <<).
Definition: star_rot.C:428
virtual ~Star_rot()
Destructor.
Definition: star_rot.C:287
virtual double r_isco(ostream *ost=0x0) const
Circumferential radius of the innermost stable circular orbit (ISCO).
Definition: star_rot_isco.C:71
double unsurc2
: unsurc2=1 for a relativistic star, 0 for a Newtonian one.
Definition: star_rot.h:99
double * p_tsw
Ratio T/W.
Definition: star_rot.h:233
Scalar nphi
Metric coefficient .
Definition: star_rot.h:113
virtual double espec_isco() const
Energy of a particle on the ISCO.
const Scalar & get_ak_car() const
Returns the scalar .
Definition: star_rot.h:403
double * p_z_eqf
Forward redshift factor at equator.
Definition: star_rot.h:239
const Scalar & get_khi_shift() const
Returns the scalar used in the decomposition of shift following Shibata&#39;s prescription [Prog...
Definition: star_rot.h:377
double * p_grv2
Error on the virial identity GRV2.
Definition: star_rot.h:234
double * p_area
Integrated surface area.
Definition: star_rot.h:238
virtual double mass_b() const
Baryon mass.
double * p_espec_isco
Specific energy of a particle on the ISCO.
Definition: star_rot.h:246
virtual void del_hydro_euler()
Sets to ETATNONDEF (undefined state) the hydrodynamical quantities relative to the Eulerian observer...
Definition: star_rot.C:345
virtual double f_isco() const
Orbital frequency at the innermost stable circular orbit (ISCO).
virtual double mom_quad() const
Quadrupole moment.
Scalar ssjm1_nuq
Effective source at the previous step for the resolution of the Poisson equation for nuq by means of ...
Definition: star_rot.h:198
virtual double angu_mom() const
Angular momentum.
double * p_z_pole
Redshift factor at North pole.
Definition: star_rot.h:241
Parameter storage.
Definition: param.h:125
virtual void display_poly(ostream &) const
Display in polytropic units.
Definition: star_rot.C:649
Star_rot(Map &mp_i, int nzet_i, bool relat, const Eos &eos_i)
Standard constructor.
Definition: star_rot.C:86
const Scalar & get_bbb() const
Returns the metric factor B.
Definition: star_rot.h:316
double * p_grv3
Error on the virial identity GRV3.
Definition: star_rot.h:235
const Scalar & get_dzeta() const
Returns the Metric potential .
Definition: star_rot.h:346
Sym_tensor tkij
Tensor related to the extrinsic curvature tensor by .
Definition: star_rot.h:167
const Sym_tensor & get_tkij() const
Returns the tensor related to the extrinsic curvature tensor by .
Definition: star_rot.h:384
virtual double r_circ() const
Circumferential radius.
double * p_angu_mom
Angular momentum.
Definition: star_rot.h:232
Scalar b_car
Square of the metric factor B.
Definition: star_rot.h:110
const Scalar & get_tnphi() const
Returns the component of the shift vector.
Definition: star_rot.h:330
const Scalar & get_nuq() const
Returns the Part of the Metric potential = logn generated by the quadratic terms.
Definition: star_rot.h:343
const Scalar & get_nuf() const
Returns the part of the Metric potential = logn generated by the matter terms.
Definition: star_rot.h:338
double * p_aplat
Flatening r_pole/r_eq.
Definition: star_rot.h:237
virtual double z_eqb() const
Backward redshift factor at equator.
virtual void partial_display(ostream &) const
Printing of some informations, excluding all global quantities.
Definition: star_rot.C:590
virtual double grv3(ostream *ost=0x0) const
Error on the virial identity GRV3.
Scalar ssjm1_khi
Effective source at the previous step for the resolution of the Poisson equation for the scalar by m...
Definition: star_rot.h:216
Scalar uuu
Norm of u_euler.
Definition: star_rot.h:121
const Scalar & get_nphi() const
Returns the metric coefficient .
Definition: star_rot.h:325
Scalar ssjm1_nuf
Effective source at the previous step for the resolution of the Poisson equation for nuf by means of ...
Definition: star_rot.h:192
virtual void sauve(FILE *) const
Save in a file.
Definition: star_rot.C:401
Basic array class.
Definition: tbl.h:161
const Scalar & get_uuu() const
Returns the norm of u_euler.
Definition: star_rot.h:333
Scalar tggg
Metric potential .
Definition: star_rot.h:137
const Scalar & get_b_car() const
Returns the square of the metric factor B.
Definition: star_rot.h:322
void fait_nphi()
Computes tnphi and nphi from the Cartesian components of the shift, stored in shift ...
Definition: star_rot.C:748
Scalar ak_car
Scalar .
Definition: star_rot.h:186
virtual double aplat() const
Flatening r_pole/r_eq.
Vector w_shift
Vector used in the decomposition of shift , following Shibata&#39;s prescription [Prog.
Definition: star_rot.h:150
const Scalar & get_tggg() const
Returns the Metric potential .
Definition: star_rot.h:349
virtual double z_eqf() const
Forward redshift factor at equator.
Class intended to describe valence-2 symmetric tensors.
Definition: sym_tensor.h:223
void fait_shift()
Computes shift from w_shift and khi_shift according to Shibata&#39;s prescription [Prog.
Definition: star_rot.C:703
virtual double tsw() const
Ratio T/W.
double * p_z_eqb
Backward redshift factor at equator.
Definition: star_rot.h:240