99 #include "graphique.h" 118 int i_b = mg->
get_nr(l_b) - 1 ;
119 int j_b = mg->
get_nt(l_b) - 1 ;
161 double diff_ent = 1 ;
168 for(
int mer=0 ; (diff_ent > precis) && (mer<mermax) ; mer++ ) {
172 cout <<
"-----------------------------------------------" << endl ;
173 cout <<
"step: " << mer << endl ;
174 cout <<
"alpha_r: " << alpha_r << endl ;
175 cout <<
"diff_ent = " << diff_ent << endl ;
188 Cmp source_logn_mat (source) ;
189 Cmp logn_mat_cmp (logn_mat) ;
192 mpaff.
poisson(source_logn_mat, par_nul, logn_mat_cmp) ;
194 logn_mat = logn_mat_cmp ;
202 mpaff.
dsdr(lnq, dlnq) ;
204 source = - dlogn * dlnq ;
206 Cmp source_logn_quad (source) ;
207 Cmp logn_quad_cmp (logn_quad) ;
210 mpaff.
poisson(source_logn_quad, par_nul, logn_quad_cmp) ;
212 logn_quad = logn_quad_cmp ;
225 double nu_quad0_b = logn_quad.
val_grid_point(l_b, k_b, j_b, i_b) ;
228 double alpha_r2 = ( ent_c - ent_b - nu_quad0_b + nu_quad0_c )
229 / ( qpig*(nu_mat0_b - nu_mat0_c) ) ;
231 alpha_r =
sqrt(alpha_r2) ;
242 logn_mat = alpha_r2*qpig * logn_mat ;
243 logn = logn_mat + logn_quad ;
263 int nz_search =
nzet + 1 ;
271 double precis_adapt = 1.e-14 ;
273 double reg_map = 1. ;
275 par_adapt.
add_int(nitermax, 0) ;
277 par_adapt.
add_int(nzadapt, 1) ;
280 par_adapt.
add_int(nz_search, 2) ;
282 par_adapt.
add_int(adapt_flag, 3) ;
303 if (pent_limit != 0x0) ent_limit = *pent_limit ;
305 par_adapt.
add_tbl(ent_limit, 0) ;
308 double* bornes =
new double[nz+1] ;
311 for(
int l=0; l<nz; l++) {
316 bornes[nz] = __infinity ;
325 double alphal, betal ;
327 for(
int l=0; l<nz; l++) {
367 mpaff.
dsdr(lnq, dlnq) ;
369 source = 3 * qpig * a_car *
press ;
371 source = source - 0.5 * ( dlnq * dlnq + dlogn * dlogn ) ;
374 Cmp source_lnq (source) ;
375 Cmp lnq_cmp (logn_quad) ;
378 mpaff.
poisson(source_lnq, par_nul, lnq_cmp) ;
390 a_car = qq * qq / (
nn *
nn ) ;
423 a_car = qq * qq / (
nn *
nn ) ;
428 for (
int i=1; i<=3; i++){
429 gamma_cov.set(i,i) = a_car ;
453 <<
"Characteristics of the star obtained by Etoile::equilibrium_spher : " 455 <<
"-----------------------------------------------------------------" 458 double ray =
mp.
val_r(l_b, 1., M_PI/2., 0) ;
459 cout <<
"Coordinate radius : " << ray / km <<
" km" << endl ;
463 double compact = qpig/(4.*M_PI) *
mass_g() / rcirc ;
465 cout <<
"Circumferential radius R : " << rcirc/km <<
" km" << endl ;
466 cout <<
"Baryon mass : " <<
mass_b()/msol <<
" Mo" << endl ;
467 cout <<
"Gravitational mass M : " <<
mass_g()/msol <<
" Mo" << endl ;
468 cout <<
"Compacity parameter GM/(c^2 R) : " << compact << endl ;
493 double grv3 = ( vir_mat + vir_grav ) / vir_mat ;
495 cout <<
"Virial theorem GRV3 : " << endl ;
496 cout <<
" 3P term : " << vir_mat << endl ;
497 cout <<
" grav. term : " << vir_grav << endl ;
498 cout <<
" relative error : " << grv3 << endl ;
virtual double mass_b() const =0
Baryon mass.
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.
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)
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.
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).
Scalar ener_euler
Total energy density in the Eulerian frame.
double integrale() const
Computes the integral over all space of *this .
void equation_of_state()
Computes the proper baryon and energy density, as well as pressure from the enthalpy.
virtual void std_spectral_base()
Sets the spectral bases of the Valeur va to the standard ones for a scalar field. ...
Scalar nn
Lapse function N .
Tbl diffrel(const Cmp &a, const Cmp &b)
Relative difference between two Cmp (norme version).
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.
Scalar logn
Logarithm of the lapse N .
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.
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.
Tbl norme(const Cmp &)
Sums of the absolute values of all the values of the Cmp in each domain.
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.
Scalar gam_euler
Lorentz factor between the fluid and Eulerian observers.
Scalar ener
Total energy density in the fluid frame.
Map & mp
Mapping associated with the star.
virtual void poisson(const Cmp &source, Param &par, Cmp &uu, bool verbose=true) const
Computes the solution of a scalar Poisson equation (Cmp version).
void set_alpha(double alpha0, int l)
Modifies the value of in domain no. l.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
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.
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 .
Scalar s_euler
Trace of the stress scalar in the Eulerian frame.
virtual double mass_g() const =0
Gravitational 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.
Scalar press
Fluid pressure.
virtual void equilibrium_spher(double ent_c, double precis=1.e-14, const Tbl *pent_limit=0x0)
Computes a spherical static configuration.
virtual void dsdr(const Cmp &ci, Cmp &resu) const
Computes of a Cmp.
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.
Vector u_euler
Fluid 3-velocity with respect to the Eulerian observer.