96 #include "graphique.h" 115 int i_b = mg->
get_nr(l_b) - 1 ;
116 int j_b = mg->
get_nt(l_b) - 1 ;
158 double diff_ent = 1 ;
165 for(
int mer=0 ; (diff_ent > precis) && (mer<mermax) ; mer++ ) {
169 cout <<
"-----------------------------------------------" << endl ;
170 cout <<
"step: " << mer << endl ;
171 cout <<
"alpha_r: " << alpha_r << endl ;
172 cout <<
"diff_ent = " << diff_ent << endl ;
185 Cmp source_logn_mat (source) ;
186 Cmp logn_mat_cmp (logn_mat) ;
189 mpaff.
poisson(source_logn_mat, par_nul, logn_mat_cmp) ;
191 logn_mat = logn_mat_cmp ;
199 mpaff.
dsdr(lnq, dlnq) ;
201 source = - dlogn * dlnq ;
203 Cmp source_logn_quad (source) ;
204 Cmp logn_quad_cmp (logn_quad) ;
207 mpaff.
poisson(source_logn_quad, par_nul, logn_quad_cmp) ;
209 logn_quad = logn_quad_cmp ;
222 double nu_quad0_b = logn_quad.
val_grid_point(l_b, k_b, j_b, i_b) ;
225 double alpha_r2 = ( ent_c - ent_b - nu_quad0_b + nu_quad0_c )
226 / ( qpig*(nu_mat0_b - nu_mat0_c) ) ;
228 alpha_r =
sqrt(alpha_r2) ;
239 logn_mat = alpha_r2*qpig * logn_mat ;
240 logn = logn_mat + logn_quad ;
260 int nz_search =
nzet + 1 ;
268 double precis_adapt = 1.e-14 ;
270 double reg_map = 1. ;
272 par_adapt.
add_int(nitermax, 0) ;
274 par_adapt.
add_int(nzadapt, 1) ;
277 par_adapt.
add_int(nz_search, 2) ;
279 par_adapt.
add_int(adapt_flag, 3) ;
300 if (pent_limit != 0x0) ent_limit = *pent_limit ;
302 par_adapt.
add_tbl(ent_limit, 0) ;
305 double* bornes =
new double[nz+1] ;
308 for(
int l=0; l<nz; l++) {
313 bornes[nz] = __infinity ;
322 double alphal, betal ;
324 for(
int l=0; l<nz; l++) {
364 mpaff.
dsdr(lnq, dlnq) ;
366 source = 3 * qpig * a_car *
press ;
368 source = source - 0.5 * ( dlnq * dlnq + dlogn * dlogn ) ;
371 Cmp source_lnq (source) ;
372 Cmp lnq_cmp (logn_quad) ;
375 mpaff.
poisson(source_lnq, par_nul, lnq_cmp) ;
387 a_car = qq * qq / (
nn *
nn ) ;
420 a_car = qq * qq / (
nn *
nn ) ;
425 for (
int i=1; i<=3; i++){
426 gamma_cov.set(i,i) = a_car ;
439 if ( p_star_rot != 0x0) {
440 p_star_rot->
a_car = a_car ;
441 p_star_rot->
bbb = qq /
nn ;
442 p_star_rot->
b_car = p_star_rot->
bbb * p_star_rot->
bbb ;
443 p_star_rot->
dzeta = lnq ;
450 <<
"Characteristics of the star obtained by Etoile::equilibrium_spher : " 452 <<
"-----------------------------------------------------------------" 455 double ray =
mp.
val_r(l_b, 1., M_PI/2., 0) ;
456 cout <<
"Coordinate radius : " << ray / km <<
" km" << endl ;
460 double compact = qpig/(4.*M_PI) *
mass_g() / rcirc ;
462 cout <<
"Circumferential radius R : " << rcirc/km <<
" km" << endl ;
463 cout <<
"Baryon mass : " <<
mass_b()/msol <<
" Mo" << endl ;
464 cout <<
"Gravitational mass M : " <<
mass_g()/msol <<
" Mo" << endl ;
465 cout <<
"Compacity parameter GM/(c^2 R) : " << compact << endl ;
490 double grv3 = ( vir_mat + vir_grav ) / vir_mat ;
492 cout <<
"Virial theorem GRV3 : " << endl ;
493 cout <<
" 3P term : " << vir_mat << endl ;
494 cout <<
" grav. term : " << vir_grav << endl ;
495 cout <<
" relative error : " << grv3 << endl ;
Scalar dzeta
Metric potential .
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Cmp exp(const Cmp &)
Exponential.
const double * get_alpha() const
Returns the pointer on the array alpha.
Scalar a_car
Square of the metric factor A.
Radial mapping of rather general form.
void add_int(const int &n, int position=0)
Adds the address of a new int to the list.
const double * get_alpha() const
Returns a pointer on the array alpha (values of in each domain)
Map & mp
Mapping associated with the star.
const double * get_beta() const
Returns a pointer on the array beta (values of in each domain)
Cmp sqrt(const Cmp &)
Square root.
virtual void annule(int l_min, int l_max)
Sets the Scalar to zero in several domains.
virtual void homothetie(double lambda)
Sets a new radial scale.
Scalar bbb
Metric factor B.
Standard units of space, time and mass.
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
Tensor field of valence 0 (or component of a tensorial field).
double integrale() const
Computes the integral over all space of *this .
virtual void equilibrium_spher(double ent_c, double precis=1.e-14, const Tbl *pent_limit=0x0)
Computes a spherical static configuration.
virtual void std_spectral_base()
Sets the spectral bases of the Valeur va to the standard ones for a scalar field. ...
Scalar s_euler
Trace of the stress scalar in the Eulerian frame.
Tbl diffrel(const Cmp &a, const Cmp &b)
Relative difference between two Cmp (norme version).
Class for isolated rotating stars.
void set_dzpuis(int)
Modifies the dzpuis flag.
double val_grid_point(int l, int k, int j, int i) const
Returns the value of the field at a specified grid point.
void set_beta(double beta0, int l)
Modifies the value of in domain no. l.
int nzet
Number of domains of *mp occupied by the star.
Scalar gam_euler
Lorentz factor between the fluid and Eulerian observers.
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 ener
Total energy density in the fluid frame.
Tbl norme(const Cmp &)
Sums of the absolute values of all the values of the Cmp in each domain.
virtual void poisson(const Cmp &source, Param &par, Cmp &uu) const
Computes the solution of a scalar Poisson equation.
Scalar press
Fluid pressure.
const double * get_beta() const
Returns the pointer on the array beta.
void add_tbl(const Tbl &ti, int position=0)
Adds the address of a new Tbl to the list.
int get_nzone() const
Returns the number of domains.
void set_alpha(double alpha0, int l)
Modifies the value of in domain no. l.
Vector u_euler
Fluid 3-velocity with respect to the Eulerian observer.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Scalar logn
Logarithm of the lapse N .
Scalar b_car
Square of the metric factor B.
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
virtual void adapt(const Cmp &ent, const Param &par, int nbr_filtre=0)
Adaptation of the mapping to a given scalar field.
const Base_vect_cart & get_bvect_cart() const
Returns the Cartesian basis associated with the coordinates (x,y,z) of the mapping, i.e.
Scalar nn
Lapse function N .
void add_double(const double &x, int position=0)
Adds the the address of a new double to the list.
const Scalar & dsdr() const
Returns of *this .
virtual double mass_b() const =0
Baryon mass.
virtual void set_etat_zero()
Sets the logical state of all components to ETATZERO (zero state).
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
Scalar & set(int)
Read/write access to a component.
void equation_of_state()
Computes the proper baryon and energy density, as well as pressure from the enthalpy.
Scalar ener_euler
Total energy density in the Eulerian frame.
virtual void dsdr(const Cmp &ci, Cmp &resu) const
Computes of a Cmp.
virtual double mass_g() const =0
Gravitational mass.
Class intended to describe valence-2 symmetric tensors.
void add_int_mod(int &n, int position=0)
Adds the address of a new modifiable int to the list.