72 int nz =
mp->get_mg()->get_nzone() ;
84 const Map* mp_d = cm_d.
mp ;
97 int align_rel = (
mp->get_bvect_cart()).get_align()
98 * (mp_d->get_bvect_cart()).get_align() ;
113 cout <<
"Cmp::import_asymy : unexpected value of align_rel : "
114 << align_rel << endl ;
134 if (cm_d.
etat == ETATZERO) {
139 const Map* mp_d = cm_d.
mp ;
143 int align = (
mp->get_bvect_cart()).get_align() ;
145 assert( align * (mp_d->get_bvect_cart()).get_align() == -1 ) ;
147 assert(cm_d.
etat == ETATQCQ) ;
151 "Cmp::import_anti_asymy : the dzpuis of the Cmp to be imported"
152 <<
" must be zero !" << endl ;
157 const Mg3d* mg_a =
mp->get_mg() ;
162 assert(nzet <= nz_a) ;
174 va.set_etat_c_qcq() ;
176 va.c->set_etat_qcq() ;
182 double xx_a, yy_a, zz_a ;
184 xx_a = mp_d->get_ori_x() -
mp->get_ori_x() ;
185 yy_a = mp_d->get_ori_y() -
mp->get_ori_y() ;
188 xx_a =
mp->get_ori_x() - mp_d->get_ori_x() ;
189 yy_a =
mp->get_ori_y() - mp_d->get_ori_y() ;
191 zz_a =
mp->get_ori_z() - mp_d->get_ori_z() ;
197 if ( (
mp->r).c == 0x0 ) (
mp->r).fait() ;
198 if ( (
mp->tet).c == 0x0 ) (
mp->tet).fait() ;
199 if ( (
mp->phi).c == 0x0 ) (
mp->phi).fait() ;
200 if ( (
mp->x).c == 0x0 ) (
mp->x).fait() ;
201 if ( (
mp->y).c == 0x0 ) (
mp->y).fait() ;
202 if ( (
mp->z).c == 0x0 ) (
mp->z).fait() ;
204 const Mtbl* mr_a = (
mp->r).c ;
205 const Mtbl* mtet_a = (
mp->tet).c ;
206 const Mtbl* mphi_a = (
mp->phi).c ;
207 const Mtbl* mx_a = (
mp->x).c ;
208 const Mtbl* my_a = (
mp->y).c ;
209 const Mtbl* mz_a = (
mp->z).c ;
214 double precis = 1e-15 ;
223 for (
int l=0; l < nzet; l++) {
225 int nr = mg_a->
get_nr(l) ;
226 int nt = mg_a->
get_nt(l) ;
227 int np = mg_a->
get_np(l) ;
230 const double* pr_a = mr_a->
t[l]->
t ;
231 const double* ptet_a = mtet_a->
t[l]->
t ;
232 const double* pphi_a = mphi_a->
t[l]->
t ;
233 const double* px_a = mx_a->
t[l]->
t ;
234 const double* py_a = my_a->
t[l]->
t ;
235 const double* pz_a = mz_a->
t[l]->
t ;
239 double* ptx = (
va.c->t[l])->t ;
247 for (
int i=0; i<ntnr; i++) {
260 for (
int k=1 ; k<np/2 ; k++) {
261 for (
int j=0 ; j<nt ; j++) {
262 for (
int i=0 ; i<nr ; i++) {
265 double rd, tetd, phid ;
266 if (
r == __infinity) {
269 phid = *pphi_a + M_PI ;
270 if (phid < 0) phid += 2*M_PI ;
275 double xd = - *px_a + xx_a ;
276 double yd = - *py_a + yy_a ;
277 double zd = *pz_a + zz_a ;
280 double rhod2 = xd*xd + yd*yd ;
281 double rhod =
sqrt( rhod2 ) ;
282 rd =
sqrt(rhod2 + zd*zd) ;
283 tetd = atan2(rhod, zd) ;
284 phid = atan2(yd, xd) ;
285 if (phid < 0) phid += 2*M_PI ;
298 mp_d->val_lx(rd, tetd, phid, par_precis, ld, xxd) ;
317 for (
int i=0; i<ntnr; i++) {
333 for (
int k=np/2+1 ; k<np ; k++) {
337 double* ptx_symy = (
va.c->t[l])->t + (np-k)*nt*nr ;
340 for (
int j=0 ; j<nt ; j++) {
341 for (
int i=0 ; i<nr ; i++) {
342 *ptx = - (*ptx_symy) ;
377 if (cm_d.
etat == ETATZERO) {
382 const Map* mp_d = cm_d.
mp ;
386 int align = (
mp->get_bvect_cart()).get_align() ;
388 assert( align * (mp_d->get_bvect_cart()).get_align() == 1 ) ;
390 assert(cm_d.
etat == ETATQCQ) ;
394 "Cmp::import_align_asymy : the dzpuis of the Cmp to be imported"
395 <<
" must be zero !" << endl ;
400 const Mg3d* mg_a =
mp->get_mg() ;
404 assert(nzet <= nz_a) ;
416 va.set_etat_c_qcq() ;
418 va.c->set_etat_qcq() ;
424 double xx_a, yy_a, zz_a ;
426 xx_a =
mp->get_ori_x() - mp_d->get_ori_x() ;
427 yy_a =
mp->get_ori_y() - mp_d->get_ori_y() ;
430 xx_a = mp_d->get_ori_x() -
mp->get_ori_x() ;
431 yy_a = mp_d->get_ori_y() -
mp->get_ori_y() ;
433 zz_a =
mp->get_ori_z() - mp_d->get_ori_z() ;
439 if ( (
mp->r).c == 0x0 ) (
mp->r).fait() ;
440 if ( (
mp->tet).c == 0x0 ) (
mp->tet).fait() ;
441 if ( (
mp->phi).c == 0x0 ) (
mp->phi).fait() ;
442 if ( (
mp->x).c == 0x0 ) (
mp->x).fait() ;
443 if ( (
mp->y).c == 0x0 ) (
mp->y).fait() ;
444 if ( (
mp->z).c == 0x0 ) (
mp->z).fait() ;
446 const Mtbl* mr_a = (
mp->r).c ;
447 const Mtbl* mtet_a = (
mp->tet).c ;
448 const Mtbl* mphi_a = (
mp->phi).c ;
449 const Mtbl* mx_a = (
mp->x).c ;
450 const Mtbl* my_a = (
mp->y).c ;
451 const Mtbl* mz_a = (
mp->z).c ;
456 double precis = 1e-15 ;
465 for (
int l=0; l < nzet; l++) {
467 int nr = mg_a->
get_nr(l) ;
468 int nt = mg_a->
get_nt(l) ;
469 int np = mg_a->
get_np(l) ;
472 const double* pr_a = mr_a->
t[l]->
t ;
473 const double* ptet_a = mtet_a->
t[l]->
t ;
474 const double* pphi_a = mphi_a->
t[l]->
t ;
475 const double* px_a = mx_a->
t[l]->
t ;
476 const double* py_a = my_a->
t[l]->
t ;
477 const double* pz_a = mz_a->
t[l]->
t ;
481 double* ptx = (
va.c->t[l])->t ;
490 for (
int i=0; i<ntnr; i++) {
503 for (
int k=1 ; k<np/2 ; k++) {
504 for (
int j=0 ; j<nt ; j++) {
505 for (
int i=0 ; i<nr ; i++) {
508 double rd, tetd, phid ;
509 if (
r == __infinity) {
517 double xd = *px_a + xx_a ;
518 double yd = *py_a + yy_a ;
519 double zd = *pz_a + zz_a ;
522 double rhod2 = xd*xd + yd*yd ;
523 double rhod =
sqrt( rhod2 ) ;
524 rd =
sqrt(rhod2 + zd*zd) ;
525 tetd = atan2(rhod, zd) ;
526 phid = atan2(yd, xd) ;
527 if (phid < 0) phid += 2*M_PI ;
540 mp_d->val_lx(rd, tetd, phid, par_precis, ld, xxd) ;
560 for (
int i=0; i<ntnr; i++) {
576 for (
int k=np/2+1 ; k<np ; k++) {
580 double* ptx_symy = (
va.c->t[l])->t + (np-k)*nt*nr ;
583 for (
int j=0 ; j<nt ; j++) {
584 for (
int i=0 ; i<nr ; i++) {
585 *ptx = - (*ptx_symy) ;
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 set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
void import_anti_asymy(int nzet, const Cmp &ci)
Assignment to another Cmp defined on a different mapping, when the two mappings have anti-aligned Car...
void set_dzpuis(int)
Set a value to dzpuis.
void import_align_asymy(int nzet, const Cmp &ci)
Assignment to another Cmp defined on a different mapping, when the two mappings have aligned Cartesia...
void del_t()
Logical destructor.
void import_asymy(const Cmp &ci)
Assignment to another Cmp defined on a different mapping.
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
int get_type_p() const
Returns the type of sampling in the direction: SYM : : symmetry with respect to the transformatio...
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_asymy(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