30char et_rot_lambda_grv2_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Etoile/et_rot_lambda_grv2.C,v 1.7 2014/10/13 08:52:58 j_novak Exp $" ;
84 cout <<
"Etoile_rot::lambda_grv2: the mapping of sou_m does not"
85 << endl <<
" belong to the class Map_radial !" << endl ;
89 assert( sou_q.
get_mp() == mprad ) ;
99 double theta0 = M_PI / 2 ;
104 for (
int l=0 ; l<nz ; l++) {
105 double rmax = mprad->
val_r(l,
double(1), theta0, phi0) ;
108 double rmin = mprad->
val_r(l,
double(0), theta0, phi0) ;
115 double rmin = mprad->
val_r(l,
double(-1), theta0, phi0) ;
116 mpaff.
set_alpha(
double(.5) * (rmax - rmin), l ) ;
117 mpaff.
set_beta(
double(.5) * (rmax + rmin), l) ;
122 double rmin = mprad->
val_r(l,
double(-1), theta0, phi0) ;
123 double umax = double(1) / rmin ;
124 double umin = double(1) / rmax ;
125 mpaff.
set_alpha(
double(.5) * (umin - umax), l) ;
126 mpaff.
set_beta(
double(.5) * (umin + umax), l) ;
131 cout <<
"Etoile_rot::lambda_grv2: unknown type_r ! " << endl ;
148 for (
int l=0; l<nz; l++) {
152 *(jac.
t[l]) = *(jac.
t[l]) / (a1*a1) ;
159 assert( jac.
t[l]->
get_etat() == ETATQCQ ) ;
160 double* tjac = jac.
t[l]->
t ;
162 for (
int k=0; k<mg->
get_np(l); k++) {
163 for (
int j=0; j<mg->
get_nt(l); j++) {
164 for (
int i=0; i<mg->
get_nr(l); i++) {
166 (a1 * (a1 * xi[i] + b1) ) ;
178 *(jac.
t[l]) = - *(jac.
t[l]) / (a1*a1) ;
183 cout <<
"Etoile_rot::lambda_grv2: unknown type_r ! " << endl ;
197 if ( sou_m.
get_etat() == ETATZERO ) {
203 s_m = *(sou_m.
va.
c) ;
207 if ( sou_q.
get_etat() == ETATZERO ) {
213 s_q = *(sou_q.
va.
c) ;
230 int* ndl =
new int[nz+4] ;
232 for (
int l=0; l<nz; l++) {
233 ndl[1+l] = mg->
get_nr(l) ;
242 for (
int l=0; l<nz ; l++) {
243 nrmax = ( ndl[1+l] > nrmax ) ? ndl[1+l] : nrmax ;
245 int ndr = nrmax + 5 ;
252 double* erre =
new double [nz*ndr] ;
254 for (
int l=0; l<nz; l++) {
257 for (
int i=0; i<ndl[1+l]; i++) {
259 erre[ ndr*l + i ] = a1 * xi + b1 ;
267 int ndrtp = ndr*ndt*ndp ;
268 int taille = ndrtp*nz ;
270 double* tsou_m =
new double[ taille ] ;
271 double* tsou_q =
new double[ taille ] ;
274 for (
int i=0; i<taille; i++) {
282 for (
int l=0; l<nz; l++) {
283 for (
int k=0; k<np1; k++) {
284 for (
int j=0; j<nt; j++) {
285 for (
int i=0; i<mg->
get_nr(l); i++) {
286 double xx = s_m(l, k, j, i) ;
287 tsou_m[ndrtp*l + ndrt*k + ndr*j + i] = xx ;
289 tsou_m[ndrtp*l + ndrt*k + ndr*(nt2-1-j) + i] = xx ;
298 for (
int l=0; l<nz; l++) {
299 for (
int k=0; k<np1; k++) {
300 for (
int j=0; j<nt; j++) {
301 for (
int i=0; i<mg->
get_nr(l); i++) {
302 double xx = s_q(l, k, j, i) ;
303 tsou_q[ndrtp*l + ndrt*k + ndr*j + i] = xx ;
305 tsou_q[ndrtp*l + ndrt*k + ndr*(nt2-1-j) + i] = xx ;
315 double int_m, int_q ;
316 F77_integrale2d(ndl, &ndr, &ndt, &ndp, erre, tsou_m, &int_m) ;
317 F77_integrale2d(ndl, &ndr, &ndt, &ndp, erre, tsou_q, &int_q) ;
331 if ( int_q !=
double(0) ) {
332 lambda = - int_m / int_q ;
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
int get_etat() const
Returns the logical state.
Valeur va
The numerical value of the Cmp
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...
const Map * get_mp() const
Returns the mapping.
static double lambda_grv2(const Cmp &sou_m, const Cmp &sou_q)
Computes the coefficient which ensures that the GRV2 virial identity is satisfied.
double * x
Array of values of at the nr collocation points.
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.
void set_alpha(double alpha0, int l)
Modifies the value of in domain no. l.
Base class for pure radial mappings.
Coord xsr
in the nucleus; \ 1/R in the non-compactified shells; \ in the compactified outer domain.
Coord dxdr
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
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.
const Grille3d * get_grille3d(int l) const
Returns a pointer on the 3D mono-grid for domain no. l.
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.
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.
int get_etat() const
Gives the logical state.
double * t
The array of double.
int get_etat() const
Returns the logical state.
Mtbl * c
Values of the function at the points of the multi-grid
void coef_i() const
Computes the physical value of *this.