79 #include "proto_f77.h" 87 cout <<
"Etoile_rot::lambda_grv2: the mapping of sou_m does not" 88 << endl <<
" belong to the class Map_radial !" << endl ;
92 assert( sou_q.
get_mp() == mprad ) ;
102 double theta0 = M_PI / 2 ;
107 for (
int l=0 ; l<nz ; l++) {
108 double rmax = mprad->
val_r(l,
double(1), theta0, phi0) ;
111 double rmin = mprad->
val_r(l,
double(0), theta0, phi0) ;
118 double rmin = mprad->
val_r(l,
double(-1), theta0, phi0) ;
119 mpaff.
set_alpha(
double(.5) * (rmax - rmin), l ) ;
120 mpaff.
set_beta(
double(.5) * (rmax + rmin), l) ;
125 double rmin = mprad->
val_r(l,
double(-1), theta0, phi0) ;
126 double umax = double(1) / rmin ;
127 double umin = double(1) / rmax ;
128 mpaff.
set_alpha(
double(.5) * (umin - umax), l) ;
129 mpaff.
set_beta(
double(.5) * (umin + umax), l) ;
134 cout <<
"Etoile_rot::lambda_grv2: unknown type_r ! " << endl ;
151 for (
int l=0; l<nz; l++) {
155 *(jac.
t[l]) = *(jac.
t[l]) / (a1*a1) ;
162 assert( jac.
t[l]->
get_etat() == ETATQCQ ) ;
163 double* tjac = jac.
t[l]->
t ;
165 for (
int k=0; k<mg->
get_np(l); k++) {
166 for (
int j=0; j<mg->
get_nt(l); j++) {
167 for (
int i=0; i<mg->
get_nr(l); i++) {
169 (a1 * (a1 * xi[i] + b1) ) ;
181 *(jac.
t[l]) = - *(jac.
t[l]) / (a1*a1) ;
186 cout <<
"Etoile_rot::lambda_grv2: unknown type_r ! " << endl ;
200 if ( sou_m.
get_etat() == ETATZERO ) {
206 s_m = *(sou_m.
va.
c) ;
210 if ( sou_q.
get_etat() == ETATZERO ) {
216 s_q = *(sou_q.
va.
c) ;
233 int* ndl =
new int[nz+4] ;
235 for (
int l=0; l<nz; l++) {
236 ndl[1+l] = mg->
get_nr(l) ;
245 for (
int l=0; l<nz ; l++) {
246 nrmax = ( ndl[1+l] > nrmax ) ? ndl[1+l] : nrmax ;
248 int ndr = nrmax + 5 ;
255 double* erre =
new double [nz*ndr] ;
257 for (
int l=0; l<nz; l++) {
260 for (
int i=0; i<ndl[1+l]; i++) {
262 erre[ ndr*l + i ] = a1 * xi + b1 ;
270 int ndrtp = ndr*ndt*ndp ;
271 int taille = ndrtp*nz ;
273 double* tsou_m =
new double[ taille ] ;
274 double* tsou_q =
new double[ taille ] ;
277 for (
int i=0; i<taille; i++) {
285 for (
int l=0; l<nz; l++) {
286 for (
int k=0; k<np1; k++) {
287 for (
int j=0; j<nt; j++) {
288 for (
int i=0; i<mg->
get_nr(l); i++) {
289 double xx = s_m(l, k, j, i) ;
290 tsou_m[ndrtp*l + ndrt*k + ndr*j + i] = xx ;
292 tsou_m[ndrtp*l + ndrt*k + ndr*(nt2-1-j) + i] = xx ;
301 for (
int l=0; l<nz; l++) {
302 for (
int k=0; k<np1; k++) {
303 for (
int j=0; j<nt; j++) {
304 for (
int i=0; i<mg->
get_nr(l); i++) {
305 double xx = s_q(l, k, j, i) ;
306 tsou_q[ndrtp*l + ndrt*k + ndr*j + i] = xx ;
308 tsou_q[ndrtp*l + ndrt*k + ndr*(nt2-1-j) + i] = xx ;
318 double int_m, int_q ;
319 F77_integrale2d(ndl, &ndr, &ndt, &ndp, erre, tsou_m, &int_m) ;
320 F77_integrale2d(ndl, &ndr, &ndt, &ndp, erre, tsou_q, &int_q) ;
334 if ( int_q !=
double(0) ) {
335 lambda = - int_m / int_q ;
const Map * get_mp() const
Returns the mapping.
const Grille3d * get_grille3d(int l) const
Returns a pointer on the 3D mono-grid for domain no. l.
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
const double * get_alpha() const
Returns the pointer on the array alpha.
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
int get_etat() const
Returns the logical state.
void coef_i() const
Computes the physical value of *this.
int get_etat() const
Gives the logical state.
double * x
Array of values of at the nr collocation points.
void set_beta(double beta0, int l)
Modifies the value of in domain no. l.
int get_etat() const
Returns the logical state.
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.
Coord dxdr
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
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.
static double lambda_grv2(const Cmp &sou_m, const Cmp &sou_q)
Computes the coefficient which ensures that the GRV2 virial identity is satisfied.
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...
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
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...
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
int get_type_r(int l) const
Returns the type of sampling in the radial direction in domain no.
Tbl ** t
Array (size nzone ) of pointers on the Tbl 's.
Valeur va
The numerical value of the Cmp.