27char star_bin_equilibrium_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Star/star_bin_equilibrium.C,v 1.29 2014/10/13 08:53:38 j_novak Exp $" ;
135#include "graphique.h"
136#include "utilitaires.h"
298 for (
int i=0;
i<3;
i++) {
397 cout <<
"-----------------------------------------------" <<
endl ;
451 cout <<
"k_b, j_b, alpha_r: " <<
k_b <<
" " <<
j_b <<
" "
492 cout <<
"******* FROZEN MAPPING *********" <<
endl ;
530 for (
int dd=4;
dd<=nz-2;
dd++) {
537 cout <<
"too small number of domains" <<
endl ;
563 cout <<
"Max. abs(enthalpy) at the boundary between domains nzet-1"
564 <<
" and nzet : " <<
endl ;
690 cout <<
"moyenne de la source 1 pour logn_auto" <<
endl ;
692 cout <<
"moyenne de la source 2 pour logn_auto" <<
endl ;
694 cout <<
"moyenne de la source 3 pour logn_auto" <<
endl ;
696 cout <<
"moyenne de la source 4 pour logn_auto" <<
endl ;
698 cout <<
"moyenne de la source 5 pour logn_auto" <<
endl ;
700 cout <<
"moyenne de la source pour logn_auto" <<
endl ;
716 "Relative error in the resolution of the equation for logn_auto : "
718 for (
int l=0;
l<nz;
l++) {
756 cout <<
"moyenne de la source 1 pour lnq_auto" <<
endl ;
758 cout <<
"moyenne de la source 2 pour lnq_auto" <<
endl ;
760 cout <<
"moyenne de la source 3 pour lnq_auto" <<
endl ;
762 cout <<
"moyenne de la source 4 pour lnq_auto" <<
endl ;
764 cout <<
"moyenne de la source 5 pour lnq_auto" <<
endl ;
766 cout <<
"moyenne de la source 6 pour lnq_auto" <<
endl ;
768 cout <<
"moyenne de la source 7 pour lnq_auto" <<
endl ;
770 cout <<
"moyenne de la source 8 pour lnq_auto" <<
endl ;
772 cout <<
"moyenne de la source pour lnq_auto" <<
endl ;
789 "Relative error in the resolution of the equation for lnq : "
791 for (
int l=0;
l<nz;
l++) {
837 cout <<
"moyenne de la source 1 pour beta_auto" <<
endl ;
841 cout <<
"moyenne de la source 2 pour beta_auto" <<
endl ;
845 cout <<
"moyenne de la source 3 pour beta_auto" <<
endl ;
849 cout <<
"moyenne de la source 4 pour beta_auto" <<
endl ;
853 cout <<
"moyenne de la source 5 pour beta_auto" <<
endl ;
857 cout <<
"moyenne de la source 6 pour beta_auto" <<
endl ;
861 cout <<
"moyenne de la source 7 pour beta_auto" <<
endl ;
865 cout <<
"moyenne de la source pour beta_auto" <<
endl ;
875 for (
int i=1;
i<=3;
i++) {
876 if (source_beta(
i).get_etat() != ETATZERO)
880 for (
int i=1;
i<=3;
i++) {
881 if(source_beta(
i).dz_nonzero()) {
882 assert( source_beta(
i).get_dzpuis() == 4 ) ;
885 (source_beta.
set(
i)).set_dzpuis(4) ;
893 for (
int i=0;
i<3;
i++) {
899 for (
int i=0;
i<3 ;
i++){
909 for (
int i=0;
i<3 ;
i++)
918 for (
int i=1;
i<=3;
i++)
922 for (
int i=0;
i<3;
i++){
946 "Relative error in the resolution of the equation for beta_auto : "
948 cout <<
"x component : " ;
949 for (
int l=0;
l<nz;
l++) {
953 cout <<
"y component : " ;
954 for (
int l=0;
l<nz;
l++) {
958 cout <<
"z component : " ;
959 for (
int l=0;
l<nz;
l++) {
1016 for (
int ii=0;
ii<nz-1;
ii++)
1017 ff.set_domain(
ii) = 1. ;
1018 ff.set_outer_boundary(nz-1, 0) ;
1019 ff.std_spectral_base() ;
1061 omdsdp.set(3).annule_hard() ;
1066 omdsdp.set(3).annule_hard() ;
1069 omdsdp.set(1).set_outer_boundary(nz-1, 0) ;
1070 omdsdp.set(2).set_outer_boundary(nz-1, 0) ;
1071 omdsdp.std_spectral_base() ;
1169 for(
int i=1;
i<=3;
i++)
1170 for(
int j=1;
j<=
i;
j++) {
1189 (
i,
j))/(nr*nt*np) <<
endl ;
1247 cout <<
"Relative error in the resolution of the equation for "
1248 <<
"h11_auto : " <<
endl ;
1249 for (
int l=0;
l<nz;
l++) {
1265 "Relative error in the resolution of the equation for "
1266 <<
"h21_auto : " <<
endl ;
1267 for (
int l=0;
l<nz;
l++) {
1283 "Relative error in the resolution of the equation for "
1284 <<
"h31_auto : " <<
endl ;
1285 for (
int l=0;
l<nz;
l++) {
1301 "Relative error in the resolution of the equation for "
1302 <<
"h22_auto : " <<
endl ;
1303 for (
int l=0;
l<nz;
l++) {
1319 "Relative error in the resolution of the equation for "
1320 <<
"h32_auto : " <<
endl ;
1321 for (
int l=0;
l<nz;
l++) {
1337 "Relative error in the resolution of the equation for "
1338 <<
"h33_auto : " <<
endl ;
1339 for (
int l=0;
l<nz;
l++) {
1348 cout <<
"Tenseur hij auto in cartesian coordinates" <<
endl ;
1349 for (
int i=1;
i<=3;
i++)
1350 for (
int j=1;
j<=
i;
j++) {
1351 cout <<
" Comp. " <<
i <<
" " <<
j <<
" : " ;
1352 for (
int l=0;
l<nz;
l++){
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Time evolution with partial storage (*** under development ***).
Basic integer array class.
Radial mapping of rather general form.
const Base_vect_cart & get_bvect_cart() const
Returns the Cartesian basis associated with the coordinates (x,y,z) of the mapping,...
Coord ya
Absolute y coordinate.
virtual void resize(int l, double lambda)=0
Rescales the outer boundary of one domain.
Coord r
r coordinate centered on the grid
virtual void reevaluate_symy(const Map *mp_prev, int nzet, Cmp &uu) const =0
Recomputes the values of a Cmp at the collocation points after a change in the mapping.
virtual void adapt(const Cmp &ent, const Param &par, int nbr=0)=0
Adaptation of the mapping to a given scalar field.
Coord za
Absolute z coordinate.
double get_ori_x() const
Returns the x coordinate of the origin.
double get_rot_phi() const
Returns the angle between the x –axis and X –axis.
Coord xa
Absolute x coordinate.
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.
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
virtual const Sym_tensor & con() const
Read-only access to the contravariant representation.
virtual const Sym_tensor & con() const
Read-only access to the contravariant representation.
virtual const Sym_tensor & cov() const
Read-only access to the covariant representation.
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
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.
Tensor field of valence 0 (or component of a tensorial field).
const Vector & derive_cov(const Metric &gam) const
Returns the gradient (1-form = covariant vector) of *this
void filtre(int n)
Sets the n lasts coefficients in r to 0 in the external domain.
const Scalar & laplacian(int ced_mult_r=4) const
Returns the Laplacian 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 .
Valeur & set_spectral_va()
Returns va (read/write version)
Scalar loggam
Logarithm of the Lorentz factor between the fluid and the co-orbiting observer.
Scalar lnq_auto
Scalar field generated principally by the star.
Scalar ssjm1_khi
Effective source at the previous step for the resolution of the Poisson equation for khi.
Vector dcon_logn
Contravariant derivative of the total logarithm of the lapse.
Vector dcon_phi
Contravariant derivative of the logarithm of the conformal factor.
double velocity_potential(int mermax, double precis, double relax)
Computes the non-translational part of the velocity scalar potential by solving the continuity equat...
Scalar ssjm1_h11
Effective source at the previous step for the resolution of the Poisson equation for h00_auto.
Scalar ssjm1_logn
Effective source at the previous step for the resolution of the Poisson equation for logn_auto.
Vector dcov_logn
Covariant derivative of the total logarithm of the lapse.
Scalar logn_auto
Part of the lapse logarithm (gravitational potential at the Newtonian limit) generated principally by...
bool irrotational
true for an irrotational star, false for a corotating one
Scalar kcar_comp
Part of the scalar generated by beta_auto and beta_comp, i.e.
Scalar logn_comp
Part of the lapse logarithm (gravitational potential at the Newtonian limit) generated principally by...
Scalar ssjm1_h21
Effective source at the previous step for the resolution of the Poisson equation for h10_auto.
virtual void hydro_euler()
Computes the hydrodynamical quantities relative to the Eulerian observer from those in the fluid fram...
Sym_tensor tkij_comp
Part of the extrinsic curvature tensor generated by beta_comp.
Scalar ssjm1_h33
Effective source at the previous step for the resolution of the Poisson equation for h22_auto.
Scalar kcar_auto
Part of the scalar generated by beta_auto, i.e.
Vector beta_auto
Part of the shift vector generated principally by the star (Spherical components with respect to the ...
Sym_tensor hij
Total deviation of the inverse conformal metric from the inverse flat metric.
Sym_tensor hij_auto
Deviation of the inverse conformal metric from the inverse flat metric generated principally by the ...
Scalar psi4
Conformal factor .
Scalar ssjm1_h31
Effective source at the previous step for the resolution of the Poisson equation for h20_auto.
Sym_tensor tkij_auto
Part of the extrinsic curvature tensor generated by beta_auto.
Vector dcov_phi
Covariant derivative of the logarithm of the conformal factor.
Metric_flat flat
Flat metric defined on the mapping (Spherical components with respect to the mapping of the star) .
Scalar ssjm1_h22
Effective source at the previous step for the resolution of the Poisson equation for h11_auto.
Scalar ssjm1_h32
Effective source at the previous step for the resolution of the Poisson equation for h21_auto.
void equilibrium(double ent_c, int mermax, int mermax_potvit, int mermax_poisson, double relax_poisson, double relax_potvit, double thres_adapt, Tbl &diff, double om)
Computes an equilibrium configuration.
Metric gtilde
Conformal metric .
Scalar pot_centri
Centrifugal potential.
Scalar ssjm1_lnq
Effective source at the previous step for the resolution of the Poisson equation for lnq_auto.
bool conf_flat
true if the 3-metric is conformally flat, false for a more general metric.
Scalar logn
Logarithm of the lapse N .
Scalar nn
Lapse function N .
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.
double ray_eq() const
Coordinate radius at , [r_unit].
Scalar s_euler
Trace of the stress scalar in the Eulerian frame.
Sym_tensor stress_euler
Spatial part of the stress-energy tensor with respect to the Eulerian observer.
Scalar press
Fluid pressure.
double ray_eq_pi() const
Coordinate radius at , [r_unit].
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.
double ray_pole() const
Coordinate radius at [r_unit].
Class intended to describe valence-2 symmetric tensors.
Sym_tensor derive_lie(const Vector &v) const
Computes the Lie derivative of this with respect to some vector field v.
const Vector & divergence(const Metric &) const
Returns the divergence of this with respect to a Metric .
Tensor handling *** DEPRECATED : use class Tensor instead ***.
void smooth(int nzet, Valeur &uuva) const
Changes the function *this as a smooth one when there exists a discontinuity between the nucleus and ...
Tensor field of valence 1.
const Scalar & divergence(const Metric &) const
The divergence of this with respect to a Metric .
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.
Tbl max(const Cmp &)
Maximum values of a Cmp in each domain.
Cmp pow(const Cmp &, int)
Power .
Cmp abs(const Cmp &)
Absolute value.
const Tensor_sym & derive_cov(const Metric &gam) const
Returns the covariant derivative of this with respect to some metric .
virtual void dec_dzpuis(int dec=1)
Decreases by dec units the value of dzpuis and changes accordingly the values in the compactified ext...
const Tensor & derive_con(const Metric &gam) const
Returns the "contravariant" derivative of this with respect to some metric , by raising the last inde...
const Tensor_sym & derive_con(const Metric &gam) const
Returns the "contravariant" derivative of this with respect to some metric , by raising the last inde...
const Tensor & derive_cov(const Metric &gam) const
Returns the covariant derivative of this with respect to some metric .
Scalar & set(const Itbl &ind)
Returns the value of a component (read/write version).
Tenseur contract(const Tenseur &, int id1, int id2)
Self contraction of two indices of a Tenseur .
Standard units of space, time and mass.