30char et_rot_diff_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Etoile/et_rot_diff.C,v 1.4 2014/10/13 08:52:57 j_novak Exp $" ;
69#include "et_rot_diff.h"
72#include "utilitaires.h"
83 double (*frot_i)(
double,
const Tbl&),
84 double (*primfrot_i)(
double,
const Tbl&),
85 const Tbl& par_frot_i)
110 primfrot(et.primfrot),
111 par_frot(et.par_frot),
112 omega_field(et.omega_field),
113 omega_min(et.omega_min),
114 omega_max(et.omega_max),
115 prim_field(et.prim_field)
122 double (*frot_i)(
double,
const Tbl&),
123 double (*primfrot_i)(
double,
const Tbl&) )
126 primfrot(primfrot_i),
203 ost <<
"Differentially rotating star" << endl ;
204 ost <<
"-----------------------------" << endl ;
206 ost << endl <<
"Parameters of F(Omega) : " << endl ;
209 ost <<
"Min, Max of Omega/(2pi) : " <<
omega_min / (2*M_PI) * f_unit
210 <<
" Hz, " <<
omega_max / (2*M_PI) * f_unit <<
" Hz" << endl ;
211 int lsurf =
nzet - 1;
214 ost <<
"Central, equatorial value of Omega: "
215 <<
omega_field()(0, 0, 0, 0) * f_unit <<
" rad/s, "
218 ost <<
"Central, equatorial value of Omega/(2 Pi): "
219 <<
omega_field()(0, 0, 0, 0) * f_unit / (2*M_PI) <<
" Hz, "
226 ost <<
"Max prop. bar. dens. : " << nbar_max
227 <<
" x 0.1 fm^-3 = " << nbar_max /
nbar()(0, 0, 0, 0) <<
" central"
229 ost <<
"Max prop. ener. dens. (e_max) : " << ener_max
230 <<
" rho_nuc c^2 = " << ener_max /
ener()(0, 0, 0, 0) <<
" central"
232 ost <<
"Max pressure : " << press_max
233 <<
" rho_nuc c^2 = " << press_max /
press()(0, 0, 0, 0) <<
" central"
237 double len_rho = 1. /
sqrt( ggrav * ener_max ) ;
238 ost << endl <<
"Value of A = par_frot(1) in units of e_max^{1/2} : " <<
241 ost <<
"Value of A / r_eq : " <<
244 ost <<
"r_p/r_eq : " <<
aplat() << endl ;
245 ost <<
"KEH l^2 = (c/G^2)^{2/3} J^2 e_max^{1/3} M_B^{-10/3} : " <<
248 /
pow(ggrav, 1.3333333333333333) << endl ;
250 ost <<
"M e_max^{1/2} : " << ggrav *
mass_g() / len_rho << endl ;
252 ost <<
"r_eq e_max^{1/2} : " <<
ray_eq() / len_rho << endl ;
254 ost <<
"T/W : " <<
tsw() << endl ;
256 ost <<
"Omega_c / e_max^{1/2} : " <<
get_omega_c() * len_rho << endl ;
276 if (p_eos_poly != 0x0) {
278 double kappa = p_eos_poly->
get_kap() ;
279 double gamma = p_eos_poly->
get_gam() ; ;
282 double kap_ns2 =
pow( kappa, 0.5 /(gamma-1) ) ;
285 double r_poly = kap_ns2 /
sqrt(ggrav) ;
288 double t_poly = r_poly ;
291 double rho_poly = 1. / (ggrav * r_poly * r_poly) ;
294 ost <<
" n_max : " <<
max(
max(
nbar() ) ) / rho_poly << endl ;
295 ost <<
" e_max : " <<
max(
max(
ener() ) ) / rho_poly << endl ;
296 ost <<
" P_min : " << 2.*M_PI /
omega_max / t_poly << endl ;
297 ost <<
" P_max : " << 2.*M_PI /
omega_min / t_poly << endl ;
299 int lsurf =
nzet - 1;
302 ost <<
" P_eq : " << 2.*M_PI /
Polytropic equation of state (relativistic case).
double get_gam() const
Returns the adiabatic index (cf. Eq. (3))
double get_kap() const
Returns the pressure coefficient (cf.
Equation of state base class.
Class for differentially rotating stars.
double omega_min
Minimum value of .
Tenseur prim_field
Field .
virtual void display_poly(ostream &) const
Display in polytropic units.
double omega_max
Maximum value of .
virtual double tsw() const
Ratio T/W.
Tenseur omega_field
Field .
void fait_prim_field()
Computes the member prim_field from omga_field .
Et_rot_diff(Map &mp_i, int nzet_i, bool relat, const Eos &eos_i, double(*frot_i)(double, const Tbl &), double(*primfrot_i)(double, const Tbl &), const Tbl &par_frot_i)
Standard constructor.
virtual void sauve(FILE *) const
Save in a file.
virtual ~Et_rot_diff()
Destructor.
Tbl par_frot
Parameters of the function .
double(* primfrot)(double, const Tbl &)
Primitive of the function , which vanishes at the stellar center.
double prim_funct_omega(double omeg) const
Evaluates the primitive of , where F is the function defining the rotation profile.
void operator=(const Et_rot_diff &)
Assignment to another Et_rot_diff.
virtual double get_omega_c() const
Returns the central value of the rotation angular velocity ([f_unit] )
double funct_omega(double omeg) const
Evaluates , where F is the function defining the rotation profile.
virtual ostream & operator>>(ostream &) const
Operator >> (virtual function called by the operator <<).
double(* frot)(double, const Tbl &)
Function defining the rotation profile.
Class for isolated rotating stars *** DEPRECATED : use class Star_rot instead ***.
double omega
Rotation angular velocity ([f_unit] )
void operator=(const Etoile_rot &)
Assignment to another Etoile_rot.
virtual ostream & operator>>(ostream &) const
Operator >> (virtual function called by the operator <<).
virtual double mass_g() const
Gravitational mass.
virtual double aplat() const
Flatening r_pole/r_eq.
virtual double mass_b() const
Baryon mass.
virtual double angu_mom() const
Angular momentum.
virtual void display_poly(ostream &) const
Display in polytropic units.
virtual void sauve(FILE *) const
Save in a file.
int nzet
Number of domains of *mp occupied by the star.
double ray_eq() const
Coordinate radius at , [r_unit].
Tenseur nbar
Baryon density in the fluid frame.
const Eos & eos
Equation of state of the stellar matter.
Map & mp
Mapping associated with the star.
Tenseur ener
Total energy density in the fluid frame.
Tenseur press
Fluid pressure.
Base class for coordinate mappings.
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
void sauve(FILE *) const
Save in a file.
Tensor handling *** DEPRECATED : use class Tensor instead ***.
void sauve(FILE *) const
Save in a file.
Cmp sqrt(const Cmp &)
Square root.
Tbl max(const Cmp &)
Maximum values of a Cmp in each domain.
Cmp pow(const Cmp &, int)
Power .
int fread_be(int *aa, int size, int nb, FILE *fich)
Reads integer(s) from a binary file according to the big endian convention.
int fwrite_be(const int *aa, int size, int nb, FILE *fich)
Writes integer(s) into a binary file according to the big endian convention.
Standard units of space, time and mass.