78 int nz =
mp->get_mg()->get_nzone() ;
90 const Map* mp_d = cm_d.
mp ;
103 int align_rel = (
mp->get_bvect_cart()).get_align()
104 * (mp_d->get_bvect_cart()).get_align() ;
124 cout <<
"Cmp::import : unexpected value of align_rel : "
125 << align_rel << endl ;
141 const Map* mp_d = cm_d.
mp ;
154 if (cm_d.
etat == ETATZERO) {
162 assert(cm_d.
etat != ETATNONDEF) ;
166 "Cmp::import : the dzpuis of the Cmp to be imported must be zero !"
172 const Mg3d* mg_a =
mp->get_mg() ;
174 assert(nzet <= nz_a) ;
179 assert(cm_d.
etat == ETATQCQ) ;
190 va.set_etat_c_qcq() ;
192 va.c->set_etat_qcq() ;
197 double xo_d = mp_d->get_ori_x() ;
198 double yo_d = mp_d->get_ori_y() ;
199 double zo_d = mp_d->get_ori_z() ;
202 double rot_phi_d = mp_d->get_rot_phi() ;
205 double rot_phi_a =
mp->get_rot_phi() ;
210 if ( (
mp->r).c == 0x0 ) (
mp->r).fait() ;
211 if ( (
mp->tet).c == 0x0 ) (
mp->tet).fait() ;
212 if ( (
mp->phi).c == 0x0 ) (
mp->phi).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() ;
217 const Mtbl* mr_a = (
mp->r).c ;
218 const Mtbl* mtet_a = (
mp->tet).c ;
219 const Mtbl* mphi_a = (
mp->phi).c ;
220 const Mtbl* mxa_a = (
mp->xa).c ;
221 const Mtbl* mya_a = (
mp->ya).c ;
222 const Mtbl* mza_a = (
mp->za).c ;
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) ;
343 if (cm_d.
etat == ETATZERO) {
348 const Map* mp_d = cm_d.
mp ;
352 int align = (
mp->get_bvect_cart()).get_align() ;
354 assert( align * (mp_d->get_bvect_cart()).get_align() == -1 ) ;
356 assert(cm_d.
etat == ETATQCQ) ;
360 "Cmp::import : the dzpuis of the Cmp to be imported must be zero !"
366 const Mg3d* mg_a =
mp->get_mg() ;
368 assert(nzet <= nz_a) ;
380 va.set_etat_c_qcq() ;
382 va.c->set_etat_qcq() ;
388 double xx_a, yy_a, zz_a ;
390 xx_a = mp_d->get_ori_x() -
mp->get_ori_x() ;
391 yy_a = mp_d->get_ori_y() -
mp->get_ori_y() ;
394 xx_a =
mp->get_ori_x() - mp_d->get_ori_x() ;
395 yy_a =
mp->get_ori_y() - mp_d->get_ori_y() ;
397 zz_a =
mp->get_ori_z() - mp_d->get_ori_z() ;
403 if ( (
mp->r).c == 0x0 ) (
mp->r).fait() ;
404 if ( (
mp->tet).c == 0x0 ) (
mp->tet).fait() ;
405 if ( (
mp->phi).c == 0x0 ) (
mp->phi).fait() ;
406 if ( (
mp->x).c == 0x0 ) (
mp->x).fait() ;
407 if ( (
mp->y).c == 0x0 ) (
mp->y).fait() ;
408 if ( (
mp->z).c == 0x0 ) (
mp->z).fait() ;
410 const Mtbl* mr_a = (
mp->r).c ;
411 const Mtbl* mtet_a = (
mp->tet).c ;
412 const Mtbl* mphi_a = (
mp->phi).c ;
413 const Mtbl* mx_a = (
mp->x).c ;
414 const Mtbl* my_a = (
mp->y).c ;
415 const Mtbl* mz_a = (
mp->z).c ;
420 double precis = 1e-15 ;
429 for (
int l=0; l < nzet; l++) {
431 int nr = mg_a->
get_nr(l) ;
432 int nt = mg_a->
get_nt(l) ;
433 int np = mg_a->
get_np(l) ;
436 const double* pr_a = mr_a->
t[l]->
t ;
437 const double* ptet_a = mtet_a->
t[l]->
t ;
438 const double* pphi_a = mphi_a->
t[l]->
t ;
439 const double* px_a = mx_a->
t[l]->
t ;
440 const double* py_a = my_a->
t[l]->
t ;
441 const double* pz_a = mz_a->
t[l]->
t ;
445 double* ptx = (
va.c->t[l])->t ;
450 for (
int k=0 ; k<np ; k++) {
451 for (
int j=0 ; j<nt ; j++) {
452 for (
int i=0 ; i<nr ; i++) {
455 double rd, tetd, phid ;
456 if (
r == __infinity) {
459 phid = *pphi_a + M_PI ;
460 if (phid < 0) phid += 2*M_PI ;
465 double xd = - *px_a + xx_a ;
466 double yd = - *py_a + yy_a ;
467 double zd = *pz_a + zz_a ;
470 double rhod2 = xd*xd + yd*yd ;
471 double rhod =
sqrt( rhod2 ) ;
472 rd =
sqrt(rhod2 + zd*zd) ;
473 tetd = atan2(rhod, zd) ;
474 phid = atan2(yd, xd) ;
475 if (phid < 0) phid += 2*M_PI ;
488 mp_d->val_lx(rd, tetd, phid, par_precis, ld, xxd) ;
535 if (cm_d.
etat == ETATZERO) {
540 const Map* mp_d = cm_d.
mp ;
544 int align = (
mp->get_bvect_cart()).get_align() ;
546 assert( align * (mp_d->get_bvect_cart()).get_align() == 1 ) ;
548 assert(cm_d.
etat == ETATQCQ) ;
552 "Cmp::import : the dzpuis of the Cmp to be imported must be zero !"
558 const Mg3d* mg_a =
mp->get_mg() ;
560 assert(nzet <= nz_a) ;
572 va.set_etat_c_qcq() ;
574 va.c->set_etat_qcq() ;
580 double xx_a, yy_a, zz_a ;
582 xx_a =
mp->get_ori_x() - mp_d->get_ori_x() ;
583 yy_a =
mp->get_ori_y() - mp_d->get_ori_y() ;
586 xx_a = mp_d->get_ori_x() -
mp->get_ori_x() ;
587 yy_a = mp_d->get_ori_y() -
mp->get_ori_y() ;
589 zz_a =
mp->get_ori_z() - mp_d->get_ori_z() ;
595 if ( (
mp->r).c == 0x0 ) (
mp->r).fait() ;
596 if ( (
mp->tet).c == 0x0 ) (
mp->tet).fait() ;
597 if ( (
mp->phi).c == 0x0 ) (
mp->phi).fait() ;
598 if ( (
mp->x).c == 0x0 ) (
mp->x).fait() ;
599 if ( (
mp->y).c == 0x0 ) (
mp->y).fait() ;
600 if ( (
mp->z).c == 0x0 ) (
mp->z).fait() ;
602 const Mtbl* mr_a = (
mp->r).c ;
603 const Mtbl* mtet_a = (
mp->tet).c ;
604 const Mtbl* mphi_a = (
mp->phi).c ;
605 const Mtbl* mx_a = (
mp->x).c ;
606 const Mtbl* my_a = (
mp->y).c ;
607 const Mtbl* mz_a = (
mp->z).c ;
612 double precis = 1e-15 ;
621 for (
int l=0; l < nzet; l++) {
623 int nr = mg_a->
get_nr(l) ;
624 int nt = mg_a->
get_nt(l) ;
625 int np = mg_a->
get_np(l) ;
628 const double* pr_a = mr_a->
t[l]->
t ;
629 const double* ptet_a = mtet_a->
t[l]->
t ;
630 const double* pphi_a = mphi_a->
t[l]->
t ;
631 const double* px_a = mx_a->
t[l]->
t ;
632 const double* py_a = my_a->
t[l]->
t ;
633 const double* pz_a = mz_a->
t[l]->
t ;
637 double* ptx = (
va.c->t[l])->t ;
642 for (
int k=0 ; k<np ; k++) {
643 for (
int j=0 ; j<nt ; j++) {
644 for (
int i=0 ; i<nr ; i++) {
647 double rd, tetd, phid ;
648 if (
r == __infinity) {
656 double xd = *px_a + xx_a ;
657 double yd = *py_a + yy_a ;
658 double zd = *pz_a + zz_a ;
661 double rhod2 = xd*xd + yd*yd ;
662 double rhod =
sqrt( rhod2 ) ;
663 rd =
sqrt(rhod2 + zd*zd) ;
664 tetd = atan2(rhod, zd) ;
665 phid = atan2(yd, xd) ;
666 if (phid < 0) phid += 2*M_PI ;
679 mp_d->val_lx(rd, tetd, phid, par_precis, ld, xxd) ;
void import(const Cmp &ci)
Assignment to another Cmp defined on a different mapping.
const Map * mp
Reference mapping.
Cmp(const Map &map)
Constructor from mapping.
int dzpuis
Power of r by which the quantity represented by this must be divided in the external compactified z...
Valeur va
The numerical value of the Cmp.
int etat
Logical state (ETATNONDEF , ETATQCQ or ETATZERO ).
void annule(int l)
Sets the Cmp to zero in a given domain.
void import_anti(int nzet, const Cmp &ci)
Assignment to another Cmp defined on a different mapping, when the two mappings have anti-aligned Car...
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
void set_dzpuis(int)
Set a value to dzpuis.
void import_align(int nzet, const Cmp &ci)
Assignment to another Cmp defined on a different mapping, when the two mappings have aligned Cartesia...
void import_gal(int nzet, const Cmp &ci)
Assignment to another Cmp defined on a different mapping, when the two mappings do not have a particu...
void del_t()
Logical destructor.
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.
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 ...
Tbl ** t
Array (size nzone ) of pointers on the Tbl 's.
void add_double(const double &x, int position=0)
Adds the the address of a new double to the list.
void add_int_mod(int &n, int position=0)
Adds the address of a new modifiable int to the list.
void add_int(const int &n, int position=0)
Adds the address of a new int to the list.
double * t
The array of double.
Values and coefficients of a (real-value) function.
Mtbl_cf * c_cf
Coefficients of the spectral expansion of the function.
void coef() const
Computes the coeffcients of *this.
Cmp sqrt(const Cmp &)
Square root.
Map(const Mg3d &)
Constructor from a multi-domain 3D grid.
Coord r
r coordinate centered on the grid