30 char star_rot_lambda_grv2_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Star/star_rot_lambda_grv2.C,v 1.4 2014/10/13 08:53:39 j_novak Exp $" ;
59 #include "proto_f77.h" 67 cout <<
"Star_rot::lambda_grv2: the mapping of sou_m does not" 68 << endl <<
" belong to the class Map_radial !" << endl ;
72 assert( &sou_q.
get_mp() == mprad ) ;
82 double theta0 = M_PI / 2 ;
87 for (
int l=0 ; l<nz ; l++) {
88 double rmax = mprad->
val_r(l,
double(1), theta0, phi0) ;
91 double rmin = mprad->
val_r(l,
double(0), theta0, phi0) ;
98 double rmin = mprad->
val_r(l,
double(-1), theta0, phi0) ;
99 mpaff.
set_alpha(
double(.5) * (rmax - rmin), l ) ;
100 mpaff.
set_beta(
double(.5) * (rmax + rmin), l) ;
106 double rmin = mprad->
val_r(l,
double(-1), theta0, phi0) ;
107 double umax = double(1) / rmin ;
108 double umin = double(1) / rmax ;
109 mpaff.
set_alpha(
double(.5) * (umin - umax), l) ;
110 mpaff.
set_beta(
double(.5) * (umin + umax), l) ;
115 cout <<
"Star_rot::lambda_grv2: unknown type_r ! " << endl ;
132 for (
int l=0; l<nz; l++) {
136 *(jac.
t[l]) = *(jac.
t[l]) / (a1*a1) ;
143 assert( jac.
t[l]->
get_etat() == ETATQCQ ) ;
144 double* tjac = jac.
t[l]->
t ;
146 for (
int k=0; k<mg->
get_np(l); k++) {
147 for (
int j=0; j<mg->
get_nt(l); j++) {
148 for (
int i=0; i<mg->
get_nr(l); i++) {
150 (a1 * (a1 * xi[i] + b1) ) ;
162 *(jac.
t[l]) = - *(jac.
t[l]) / (a1*a1) ;
167 cout <<
"Star_rot::lambda_grv2: unknown type_r ! " << endl ;
181 if ( sou_m.
get_etat() == ETATZERO ) {
191 if ( sou_q.
get_etat() == ETATZERO ) {
214 int* ndl =
new int[nz+4] ;
216 for (
int l=0; l<nz; l++) {
217 ndl[1+l] = mg->
get_nr(l) ;
226 for (
int l=0; l<nz ; l++) {
227 nrmax = ( ndl[1+l] > nrmax ) ? ndl[1+l] : nrmax ;
229 int ndr = nrmax + 5 ;
236 double* erre =
new double [nz*ndr] ;
238 for (
int l=0; l<nz; l++) {
241 for (
int i=0; i<ndl[1+l]; i++) {
243 erre[ ndr*l + i ] = a1 * xi + b1 ;
251 int ndrtp = ndr*ndt*ndp ;
252 int taille = ndrtp*nz ;
254 double* tsou_m =
new double[ taille ] ;
255 double* tsou_q =
new double[ taille ] ;
258 for (
int i=0; i<taille; i++) {
266 for (
int l=0; l<nz; l++) {
267 for (
int k=0; k<np1; k++) {
268 for (
int j=0; j<nt; j++) {
269 for (
int i=0; i<mg->
get_nr(l); i++) {
270 double xx = s_m(l, k, j, i) ;
271 tsou_m[ndrtp*l + ndrt*k + ndr*j + i] = xx ;
273 tsou_m[ndrtp*l + ndrt*k + ndr*(nt2-1-j) + i] = xx ;
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_q(l, k, j, i) ;
287 tsou_q[ndrtp*l + ndrt*k + ndr*j + i] = xx ;
289 tsou_q[ndrtp*l + ndrt*k + ndr*(nt2-1-j) + i] = xx ;
299 double int_m, int_q ;
300 F77_integrale2d(ndl, &ndr, &ndt, &ndp, erre, tsou_m, &int_m) ;
301 F77_integrale2d(ndl, &ndr, &ndt, &ndp, erre, tsou_q, &int_q) ;
315 if ( int_q !=
double(0) ) {
316 lambda = - int_m / int_q ;
const Grille3d * get_grille3d(int l) const
Returns a pointer on the 3D mono-grid for domain no. l.
const double * get_alpha() const
Returns the pointer on the array alpha.
static double lambda_grv2(const Scalar &sou_m, const Scalar &sou_q)
Computes the coefficient which ensures that the GRV2 virial identity is satisfied.
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.
Tensor field of valence 0 (or component of a tensorial field).
void coef_i() const
Computes the physical value of *this.
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.
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.
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.
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.
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 Map & get_mp() const
Returns the mapping.
const Valeur & get_spectral_va() const
Returns va (read only version)