60 #include "proto_f77.h" 86 p_mass_g =
new double( source.integrale() ) ;
110 dens.set_spectral_va() = (dens.get_spectral_va()).mult_st() ;
136 - dlogn(1)*dlogn(1) - dlogn(2)*dlogn(2) - dlogn(3)*dlogn(3) ;
172 - dlogn(1)*dlogn(1) - dlogn(2)*dlogn(2) - dlogn(3)*dlogn(3)
173 + 0.5 * ( dalpha(1)*dbet(1) + dalpha(2)*dbet(2) + dalpha(3)*dbet(3) ) ;
175 Scalar aa = alpha - 0.5 * bet ;
181 cout <<
"Star_rot::grv3: the mapping does not belong" 182 <<
" to the class Map_radial !" << endl ;
189 vdaadt = vdaadt.
ssint() ;
202 vtemp = (mpr->
xsr) * vtemp ;
210 source =
bbb * source + 0.5 * temp ;
226 source = qpig *
a_car *
bbb * s_euler ;
235 *ost <<
"Star_rot::grv3 : gravitational term : " << int_grav
237 *ost <<
"Star_rot::grv3 : matter term : " << int_mat
241 p_grv3 =
new double( (int_grav + int_mat) / int_mat ) ;
277 - dlogn(1)*dlogn_bet(1) - dlogn(2)*dlogn_bet(2) - dlogn(3)*dlogn_bet(3) ;
298 assert( dynamic_cast<const Map_radial*>(&
mp) != 0x0 ) ;
308 source = 0.5 * source - 1.5 * temp ;
329 cout <<
"Star_rot::lambda_grv2: the mapping of sou_m does not" 330 << endl <<
" belong to the class Map_radial !" << endl ;
334 assert( &sou_q.
get_mp() == mprad ) ;
344 double theta0 = M_PI / 2 ;
349 for (
int l=0 ; l<nz ; l++) {
350 double rmax = mprad->
val_r(l,
double(1), theta0, phi0) ;
353 double rmin = mprad->
val_r(l,
double(0), theta0, phi0) ;
360 double rmin = mprad->
val_r(l,
double(-1), theta0, phi0) ;
361 mpaff.
set_alpha(
double(.5) * (rmax - rmin), l ) ;
362 mpaff.
set_beta(
double(.5) * (rmax + rmin), l) ;
367 double rmin = mprad->
val_r(l,
double(-1), theta0, phi0) ;
368 double umax = double(1) / rmin ;
369 double umin = double(1) / rmax ;
370 mpaff.
set_alpha(
double(.5) * (umin - umax), l) ;
371 mpaff.
set_beta(
double(.5) * (umin + umax), l) ;
376 cout <<
"Star_rot::lambda_grv2: unknown type_r ! " << endl ;
393 for (
int l=0; l<nz; l++) {
397 *(jac.
t[l]) = *(jac.
t[l]) / (a1*a1) ;
404 assert( jac.
t[l]->
get_etat() == ETATQCQ ) ;
405 double* tjac = jac.
t[l]->
t ;
407 for (
int k=0; k<mg->
get_np(l); k++) {
408 for (
int j=0; j<mg->
get_nt(l); j++) {
409 for (
int i=0; i<mg->
get_nr(l); i++) {
411 (a1 * (a1 * xi[i] + b1) ) ;
422 *(jac.
t[l]) = - *(jac.
t[l]) / (a1*a1) ;
427 cout <<
"Star_rot::lambda_grv2: unknown type_r ! " << endl ;
441 if ( sou_m.
get_etat() == ETATZERO ) {
451 if ( sou_q.
get_etat() == ETATZERO ) {
474 int* ndl =
new int[nz+4] ;
476 for (
int l=0; l<nz; l++) {
477 ndl[1+l] = mg->
get_nr(l) ;
486 for (
int l=0; l<nz ; l++) {
487 nrmax = ( ndl[1+l] > nrmax ) ? ndl[1+l] : nrmax ;
489 int ndr = nrmax + 5 ;
496 double* erre =
new double [nz*ndr] ;
498 for (
int l=0; l<nz; l++) {
501 for (
int i=0; i<ndl[1+l]; i++) {
503 erre[ ndr*l + i ] = a1 * xi + b1 ;
511 int ndrtp = ndr*ndt*ndp ;
512 int taille = ndrtp*nz ;
514 double* tsou_m =
new double[ taille ] ;
515 double* tsou_q =
new double[ taille ] ;
518 for (
int i=0; i<taille; i++) {
526 for (
int l=0; l<nz; l++) {
527 for (
int k=0; k<np1; k++) {
528 for (
int j=0; j<nt; j++) {
529 for (
int i=0; i<mg->
get_nr(l); i++) {
530 double xx = s_m(l, k, j, i) ;
531 tsou_m[ndrtp*l + ndrt*k + ndr*j + i] = xx ;
533 tsou_m[ndrtp*l + ndrt*k + ndr*(nt2-1-j) + i] = xx ;
542 for (
int l=0; l<nz; l++) {
543 for (
int k=0; k<np1; k++) {
544 for (
int j=0; j<nt; j++) {
545 for (
int i=0; i<mg->
get_nr(l); i++) {
546 double xx = s_q(l, k, j, i) ;
547 tsou_q[ndrtp*l + ndrt*k + ndr*j + i] = xx ;
549 tsou_q[ndrtp*l + ndrt*k + ndr*(nt2-1-j) + i] = xx ;
559 double int_m, int_q ;
560 F77_integrale2d(ndl, &ndr, &ndt, &ndp, erre, tsou_m, &int_m) ;
561 F77_integrale2d(ndl, &ndr, &ndt, &ndp, erre, tsou_q, &int_q) ;
575 if ( int_q !=
double(0) ) {
576 lambda = - int_m / int_q ;
Scalar logn
Logarithm of the lapse N .
const Grille3d * get_grille3d(int l) const
Returns a pointer on the 3D mono-grid for domain no. l.
Cmp log(const Cmp &)
Neperian logarithm.
Vector mom_euler
Total 3-momentum density in the Eulerian frame.
const double * get_alpha() const
Returns the pointer on the array alpha.
void mult_r()
Multiplication by r everywhere; dzpuis is not changed.
Scalar tnphi
Component of the shift vector.
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
const Base_vect_spher & get_bvect_spher() const
Returns the orthonormal vectorial basis associated with the coordinates of the mapping.
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).
void coef_i() const
Computes the physical value of *this.
virtual double mass_g() const
Gravitational mass.
double integrale() const
Computes the integral over all space of *this .
virtual double mom_quad() const
Quadrupole moment.
const Valeur & sx() const
Returns (r -sampling = RARE ) \ Id (r sampling = FIN ) \ (r -sampling = UNSURR ) ...
virtual void std_spectral_base()
Sets the spectral bases of the Valeur va to the standard ones for a scalar field. ...
Values and coefficients of a (real-value) function.
int get_etat() const
Gives the logical state.
int get_etat() const
Returns the logical state ETATNONDEF (undefined), ETATZERO (null) or ETATQCQ (ordinary).
double * x
Array of values of at the nr collocation points.
Tensor field of valence 1.
virtual double grv3(ostream *ost=0x0) const
Error on the virial identity GRV3.
Scalar a_car
Square of the metric factor A.
double * p_grv2
Error on the virial identity GRV2.
void set_dzpuis(int)
Modifies the dzpuis flag.
Scalar b_car
Square of the metric factor B.
void set_beta(double beta0, int l)
Modifies the value of in domain no. l.
int get_etat() const
Returns the logical state.
double * p_angu_mom
Angular momentum.
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 Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.
Scalar bbb
Metric factor B.
virtual void inc_dzpuis(int inc=1)
Increases by inc units the value of dzpuis and changes accordingly the values of the Scalar in the co...
static double lambda_grv2(const Scalar &sou_m, const Scalar &sou_q)
Computes the coefficient which ensures that the GRV2 virial identity is satisfied.
const Valeur & ssint() const
Returns of *this.
Coord dxdr
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
int get_dzpuis() const
Returns dzpuis.
double * t
The array of double.
const double * get_beta() const
Returns the pointer on the array beta.
Mtbl * c
Values of the function at the points of the multi-grid.
Base class for pure radial mappings.
int get_nzone() const
Returns the number of domains.
void set_alpha(double alpha0, int l)
Modifies the value of in domain no. l.
Coord xsr
in the nucleus; \ 1/R in the non-compactified shells; \ in the compactified outer domain...
Scalar dzeta
Metric potential .
double * p_grv3
Error on the virial identity GRV3.
double * p_mass_g
Gravitational mass (ADM mass as a volume integral)
double * p_mom_quad
Quadrupole moment.
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
const Scalar & srdsdt() const
Returns of *this .
Scalar ener_euler
Total energy density E in the Eulerian frame.
Scalar nn
Lapse function N .
const Scalar & dsdr() const
Returns of *this .
const Valeur & mult_ct() const
Returns applied to *this.
virtual double grv2() const
Error on the virial identity GRV2.
virtual double angu_mom() const
Angular momentum.
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
Valeur & set_spectral_va()
Returns va (read/write version)
int get_type_r(int l) const
Returns the type of sampling in the radial direction in domain no.
bool check_dzpuis(int dzi) const
Returns false if the last domain is compactified and *this is not zero in this domain and dzpuis is n...
Tbl ** t
Array (size nzone ) of pointers on the Tbl 's.
const Vector & derive_cov(const Metric &gam) const
Returns the gradient (1-form = covariant vector) of *this
const Map & get_mp() const
Returns the mapping.
const Metric_flat & flat_met_spher() const
Returns the flat metric associated with the spherical coordinates and with components expressed in th...
const Valeur & get_spectral_va() const
Returns va (read only version)
Tensor trace(int ind1, int ind2) const
Trace on two different type indices.
Map & mp
Mapping describing the coordinate system (r,theta,phi)
Sym_tensor stress_euler
Stress tensor with respect to the Eulerian observer.