30 char star_equil_spher_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Star/star_equil_spher.C,v 1.15 2014/10/13 08:53:39 j_novak Exp $" ;
90 #include "graphique.h"
97 const Tbl* pent_limit){
111 int i_b = mg->
get_nr(l_b) - 1 ;
112 int j_b = mg->
get_nt(l_b) - 1 ;
154 double diff_ent = 1 ;
161 for(
int mer=0 ; (diff_ent > precis) && (mer<mermax) ; mer++ ) {
165 cout <<
"-----------------------------------------------" << endl ;
166 cout <<
"step: " << mer << endl ;
167 cout <<
"alpha_r: " << alpha_r << endl ;
168 cout <<
"diff_ent = " << diff_ent << endl ;
181 Cmp source_logn_mat (source) ;
182 Cmp logn_mat_cmp (logn_mat) ;
185 mpaff.
poisson(source_logn_mat, par_nul, logn_mat_cmp) ;
187 logn_mat = logn_mat_cmp ;
195 mpaff.
dsdr(lnq, dlnq) ;
197 source = - dlogn * dlnq ;
199 Cmp source_logn_quad (source) ;
200 Cmp logn_quad_cmp (logn_quad) ;
203 mpaff.
poisson(source_logn_quad, par_nul, logn_quad_cmp) ;
205 logn_quad = logn_quad_cmp ;
218 double nu_quad0_b = logn_quad.
val_grid_point(l_b, k_b, j_b, i_b) ;
221 double alpha_r2 = ( ent_c - ent_b - nu_quad0_b + nu_quad0_c )
222 / ( qpig*(nu_mat0_b - nu_mat0_c) ) ;
224 alpha_r =
sqrt(alpha_r2) ;
235 logn_mat = alpha_r2*qpig * logn_mat ;
236 logn = logn_mat + logn_quad ;
256 int nz_search =
nzet + 1 ;
264 double precis_adapt = 1.e-14 ;
266 double reg_map = 1. ;
268 par_adapt.
add_int(nitermax, 0) ;
270 par_adapt.
add_int(nzadapt, 1) ;
273 par_adapt.
add_int(nz_search, 2) ;
275 par_adapt.
add_int(adapt_flag, 3) ;
296 if (pent_limit != 0x0) ent_limit = *pent_limit ;
298 par_adapt.
add_tbl(ent_limit, 0) ;
301 double* bornes =
new double[nz+1] ;
304 for(
int l=0; l<nz; l++) {
309 bornes[nz] = __infinity ;
318 double alphal, betal ;
320 for(
int l=0; l<nz; l++) {
360 mpaff.
dsdr(lnq, dlnq) ;
362 source = 3 * qpig * a_car *
press ;
364 source = source - 0.5 * ( dlnq * dlnq + dlogn * dlogn ) ;
367 Cmp source_lnq (source) ;
368 Cmp lnq_cmp (logn_quad) ;
371 mpaff.
poisson(source_lnq, par_nul, lnq_cmp) ;
382 a_car = qq * qq / (
nn *
nn ) ;
414 a_car = qq * qq / (
nn *
nn ) ;
419 for (
int i=1; i<=3; i++){
420 gamma_cov.
set(i,i) = a_car ;
436 <<
"Characteristics of the star obtained by Etoile::equilibrium_spher : "
438 <<
"-----------------------------------------------------------------"
441 double ray =
mp.
val_r(l_b, 1., M_PI/2., 0) ;
442 cout <<
"Coordinate radius : " << ray / km <<
" km" << endl ;
446 double compact = qpig/(4.*M_PI) *
mass_g() / rcirc ;
448 cout <<
"Circumferential radius R : " << rcirc/km <<
" km" << endl ;
449 cout <<
"Baryon mass : " <<
mass_b()/msol <<
" Mo" << endl ;
450 cout <<
"Gravitational mass M : " <<
mass_g()/msol <<
" Mo" << endl ;
451 cout <<
"Compacity parameter GM/(c^2 R) : " << compact << endl ;
476 double grv3 = ( vir_mat + vir_grav ) / vir_mat ;
478 cout <<
"Virial theorem GRV3 : " << endl ;
479 cout <<
" 3P term : " << vir_mat << endl ;
480 cout <<
" grav. term : " << vir_grav << endl ;
481 cout <<
" relative error : " << grv3 << endl ;
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
const double * get_beta() const
Returns the pointer on the array beta.
const double * get_alpha() const
Returns the pointer on the array alpha.
void set_beta(double beta0, int l)
Modifies the value of in domain no. l.
virtual void homothetie(double lambda)
Sets a new radial scale.
virtual void poisson(const Cmp &source, Param &par, Cmp &uu) const
Computes the solution of a scalar Poisson equation.
virtual void dsdr(const Cmp &ci, Cmp &resu) const
Computes of a Cmp.
void set_alpha(double alpha0, int l)
Modifies the value of in domain no. l.
Radial mapping of rather general form.
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)
virtual void adapt(const Cmp &ent, const Param &par, int nbr_filtre=0)
Adaptation of the mapping to a given scalar field.
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
const Base_vect_cart & get_bvect_cart() const
Returns the Cartesian basis associated with the coordinates (x,y,z) of the mapping,...
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.
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
int get_nzone() const
Returns the number of domains.
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
void add_double(const double &x, int position=0)
Adds the the address of a new double to the list.
void add_int_mod(int &n, int position=0)
Adds the address of a new modifiable int to the list.
void add_int(const int &n, int position=0)
Adds the address of a new int to the list.
void add_tbl(const Tbl &ti, int position=0)
Adds the address of a new Tbl to the list.
Tensor field of valence 0 (or component of a tensorial field).
double integrale() const
Computes the integral over all space of *this .
virtual void std_spectral_base()
Sets the spectral bases of the Valeur va to the standard ones for a scalar field.
double val_grid_point(int l, int k, int j, int i) const
Returns the value of the field at a specified grid point.
const Scalar & dsdr() const
Returns of *this .
virtual void annule(int l_min, int l_max)
Sets the Scalar to zero in several domains.
void set_dzpuis(int)
Modifies the dzpuis flag.
Scalar ener
Total energy density in the fluid frame.
virtual double mass_g() const =0
Gravitational mass.
Scalar logn
Logarithm of the lapse N .
Scalar nn
Lapse function N .
virtual void equilibrium_spher(double ent_c, double precis=1.e-14, const Tbl *pent_limit=0x0)
Computes a spherical static configuration.
Scalar ener_euler
Total energy density in the Eulerian frame.
void equation_of_state()
Computes the proper baryon and energy density, as well as pressure from the enthalpy.
Scalar gam_euler
Lorentz factor between the fluid and Eulerian observers.
Scalar s_euler
Trace of the stress scalar in the Eulerian frame.
Scalar press
Fluid pressure.
Vector u_euler
Fluid 3-velocity with respect to the Eulerian observer.
Map & mp
Mapping associated with the star.
int nzet
Number of domains of *mp occupied by the star.
virtual double mass_b() const =0
Baryon mass.
Class intended to describe valence-2 symmetric tensors.
Scalar & set(int)
Read/write access to a component.
Cmp sqrt(const Cmp &)
Square root.
Cmp exp(const Cmp &)
Exponential.
Tbl diffrel(const Cmp &a, const Cmp &b)
Relative difference between two Cmp (norme version).
Tbl norme(const Cmp &)
Sums of the absolute values of all the values of the Cmp in each domain.
virtual void set_etat_zero()
Sets the logical state of all components to ETATZERO (zero state).
Scalar & set(const Itbl &ind)
Returns the value of a component (read/write version).
Standard units of space, time and mass.