119 cout <<
"Scalar::import : unexpected value of align_rel : " 120 << align_rel << endl ;
162 assert(cm_d.
get_etat() != ETATNONDEF) ;
166 "Scalar::import : the dzpuis of the Scalar to be imported must be zero !" 174 assert(nzet <= nz_a) ;
179 assert(cm_d.
get_etat() == ETATQCQ) ;
210 if ( (
mp->
r).c == 0x0 ) (
mp->
r).fait() ;
213 if ( (
mp->
xa).c == 0x0 ) (
mp->
xa).fait() ;
214 if ( (
mp->
ya).c == 0x0 ) (
mp->
ya).fait() ;
215 if ( (
mp->
za).c == 0x0 ) (
mp->
za).fait() ;
227 double precis = 1e-15 ;
236 for (
int l=0; l < nzet; l++) {
238 int nr = mg_a->
get_nr(l) ;
239 int nt = mg_a->
get_nt(l) ;
240 int np = mg_a->
get_np(l) ;
243 const double* pr_a = mr_a->
t[l]->
t ;
244 const double* ptet_a = mtet_a->
t[l]->
t ;
245 const double* pphi_a = mphi_a->
t[l]->
t ;
246 const double* pxa_a = mxa_a->
t[l]->
t ;
247 const double* pya_a = mya_a->
t[l]->
t ;
248 const double* pza_a = mza_a->
t[l]->
t ;
252 double* ptx = (
va.
c->
t[l])->t ;
257 for (
int k=0 ; k<np ; k++) {
258 for (
int j=0 ; j<nt ; j++) {
259 for (
int i=0 ; i<nr ; i++) {
262 double rd, tetd, phid ;
263 if (r == __infinity) {
266 phid = *pphi_a + rot_phi_a - rot_phi_d ;
267 if (phid < 0) phid += 2*M_PI ;
273 double xd = *pxa_a - xo_d ;
274 double yd = *pya_a - yo_d ;
275 double zd = *pza_a - zo_d ;
278 double rhod2 = xd*xd + yd*yd ;
279 double rhod =
sqrt( rhod2 ) ;
280 rd =
sqrt(rhod2 + zd*zd) ;
281 tetd = atan2(rhod, zd) ;
282 phid = atan2(yd, xd) - rot_phi_d ;
283 if (phid < 0) phid += 2*M_PI ;
296 mp_d->
val_lx(rd, tetd, phid, par_precis, ld, xxd) ;
299 *ptx = va_d.c_cf->val_point(ld, xxd, tetd, phid) ;
361 assert(cm_d.
get_etat() == ETATQCQ) ;
365 "Scalar::import : the dzpuis of the Scalar to be imported must be zero !" 373 assert(nzet <= nz_a) ;
393 double xx_a, yy_a, zz_a ;
408 if ( (
mp->
r).c == 0x0 ) (
mp->
r).fait() ;
411 if ( (
mp->
x).c == 0x0 ) (
mp->
x).fait() ;
412 if ( (
mp->
y).c == 0x0 ) (
mp->
y).fait() ;
413 if ( (
mp->
z).c == 0x0 ) (
mp->
z).fait() ;
425 double precis = 1e-15 ;
434 for (
int l=0; l < nzet; l++) {
436 int nr = mg_a->
get_nr(l) ;
437 int nt = mg_a->
get_nt(l) ;
438 int np = mg_a->
get_np(l) ;
441 const double* pr_a = mr_a->
t[l]->
t ;
442 const double* ptet_a = mtet_a->
t[l]->
t ;
443 const double* pphi_a = mphi_a->
t[l]->
t ;
444 const double* px_a = mx_a->
t[l]->
t ;
445 const double* py_a = my_a->
t[l]->
t ;
446 const double* pz_a = mz_a->
t[l]->
t ;
450 double* ptx = (
va.
c->
t[l])->t ;
455 for (
int k=0 ; k<np ; k++) {
456 for (
int j=0 ; j<nt ; j++) {
457 for (
int i=0 ; i<nr ; i++) {
460 double rd, tetd, phid ;
461 if (r == __infinity) {
464 phid = *pphi_a + M_PI ;
465 if (phid < 0) phid += 2*M_PI ;
470 double xd = - *px_a + xx_a ;
471 double yd = - *py_a + yy_a ;
472 double zd = *pz_a + zz_a ;
475 double rhod2 = xd*xd + yd*yd ;
476 double rhod =
sqrt( rhod2 ) ;
477 rd =
sqrt(rhod2 + zd*zd) ;
478 tetd = atan2(rhod, zd) ;
479 phid = atan2(yd, xd) ;
480 if (phid < 0) phid += 2*M_PI ;
493 mp_d->
val_lx(rd, tetd, phid, par_precis, ld, xxd) ;
557 assert(cm_d.
get_etat() == ETATQCQ) ;
561 "Scalar::import : the dzpuis of the Scalar to be imported must be zero !" 569 assert(nzet <= nz_a) ;
589 double xx_a, yy_a, zz_a ;
604 if ( (
mp->
r).c == 0x0 ) (
mp->
r).fait() ;
607 if ( (
mp->
x).c == 0x0 ) (
mp->
x).fait() ;
608 if ( (
mp->
y).c == 0x0 ) (
mp->
y).fait() ;
609 if ( (
mp->
z).c == 0x0 ) (
mp->
z).fait() ;
621 double precis = 1e-15 ;
630 for (
int l=0; l < nzet; l++) {
632 int nr = mg_a->
get_nr(l) ;
633 int nt = mg_a->
get_nt(l) ;
634 int np = mg_a->
get_np(l) ;
637 const double* pr_a = mr_a->
t[l]->
t ;
638 const double* ptet_a = mtet_a->
t[l]->
t ;
639 const double* pphi_a = mphi_a->
t[l]->
t ;
640 const double* px_a = mx_a->
t[l]->
t ;
641 const double* py_a = my_a->
t[l]->
t ;
642 const double* pz_a = mz_a->
t[l]->
t ;
646 double* ptx = (
va.
c->
t[l])->t ;
651 for (
int k=0 ; k<np ; k++) {
652 for (
int j=0 ; j<nt ; j++) {
653 for (
int i=0 ; i<nr ; i++) {
656 double rd, tetd, phid ;
657 if (r == __infinity) {
665 double xd = *px_a + xx_a ;
666 double yd = *py_a + yy_a ;
667 double zd = *pz_a + zz_a ;
670 double rhod2 = xd*xd + yd*yd ;
671 double rhod =
sqrt( rhod2 ) ;
672 rd =
sqrt(rhod2 + zd*zd) ;
673 tetd = atan2(rhod, zd) ;
674 phid = atan2(yd, xd) ;
675 if (phid < 0) phid += 2*M_PI ;
688 mp_d->
val_lx(rd, tetd, phid, par_precis, ld, xxd) ;
Coord xa
Absolute x coordinate.
Mtbl_cf * c_cf
Coefficients of the spectral expansion of the function.
void add_int(const int &n, int position=0)
Adds the address of a new int to the list.
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
void coef() const
Computes the coeffcients of *this.
virtual void set_etat_zero()
Sets the logical state to ETATZERO (zero).
virtual void annule(int l_min, int l_max)
Sets the Scalar to zero in several domains.
double get_ori_y() const
Returns the y coordinate of the origin.
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).
Base class for coordinate mappings.
double get_ori_x() const
Returns the x coordinate of the origin.
void import_gal(int nzet, const Scalar &ci)
Assignment to another Scalar defined on a different mapping, when the two mappings do not have a part...
Values and coefficients of a (real-value) function.
int get_etat() const
Returns the logical state ETATNONDEF (undefined), ETATZERO (null) or ETATQCQ (ordinary).
double get_rot_phi() const
Returns the angle between the x –axis and X –axis.
virtual void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
friend Scalar sqrt(const Scalar &)
Square root.
Coord tet
coordinate centered on the grid
void set_dzpuis(int)
Modifies the dzpuis flag.
Coord phi
coordinate centered on the grid
void import_anti(int nzet, const Scalar &ci)
Assignment to another Scalar defined on a different mapping, when the two mappings have anti-aligned ...
int get_dzpuis() const
Returns dzpuis.
double * t
The array of double.
Mtbl * c
Values of the function at the points of the multi-grid.
void set_etat_one()
Sets the logical state to ETATUN (one).
int get_nzone() const
Returns the number of domains.
Valeur va
The numerical value of the Scalar.
void del_t()
Logical destructor.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
void import_align(int nzet, const Scalar &ci)
Assignment to another Scalar defined on a different mapping, when the two mappings have aligned Carte...
double val_point(int l, double x, double theta, double phi) const
Computes the value of the field represented by *this at an arbitrary point, by means of the spectral ...
void import(const Scalar &ci)
Assignment to another Scalar defined on a different mapping.
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
Coord ya
Absolute y coordinate.
const Base_vect_cart & get_bvect_cart() const
Returns the Cartesian basis associated with the coordinates (x,y,z) of the mapping, i.e.
Coord y
y coordinate centered on the grid
Coord za
Absolute z coordinate.
void add_double(const double &x, int position=0)
Adds the the address of a new double to the list.
Coord x
x coordinate centered on the grid
void set_etat_c_qcq()
Sets the logical state to ETATQCQ (ordinary state) for values in the configuration space (Mtbl c )...
double get_ori_z() const
Returns the z coordinate of the origin.
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
const Map *const mp
Mapping on which the numerical values at the grid points are defined.
Tbl ** t
Array (size nzone ) of pointers on the Tbl 's.
const Map & get_mp() const
Returns the mapping.
Coord z
z coordinate centered on the grid
void add_int_mod(int &n, int position=0)
Adds the address of a new modifiable int to the list.
const Valeur & get_spectral_va() const
Returns va (read only version)
Coord r
r coordinate centered on the grid
virtual void val_lx(double rr, double theta, double pphi, int &l, double &xi) const =0
Computes the domain index l and the value of corresponding to a point given by its physical coordina...