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_symy : 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_symy : the dzpuis of the Cmp to be imported"
152 <<
" must be zero !" << endl ;
157 const Mg3d* mg_a =
mp->get_mg() ;
161 assert(nzet <= nz_a) ;
173 va.set_etat_c_qcq() ;
175 va.c->set_etat_qcq() ;
181 double xx_a, yy_a, zz_a ;
183 xx_a = mp_d->get_ori_x() -
mp->get_ori_x() ;
184 yy_a = mp_d->get_ori_y() -
mp->get_ori_y() ;
187 xx_a =
mp->get_ori_x() - mp_d->get_ori_x() ;
188 yy_a =
mp->get_ori_y() - mp_d->get_ori_y() ;
190 zz_a =
mp->get_ori_z() - mp_d->get_ori_z() ;
196 if ( (
mp->r).c == 0x0 ) (
mp->r).fait() ;
197 if ( (
mp->tet).c == 0x0 ) (
mp->tet).fait() ;
198 if ( (
mp->phi).c == 0x0 ) (
mp->phi).fait() ;
199 if ( (
mp->x).c == 0x0 ) (
mp->x).fait() ;
200 if ( (
mp->y).c == 0x0 ) (
mp->y).fait() ;
201 if ( (
mp->z).c == 0x0 ) (
mp->z).fait() ;
203 const Mtbl* mr_a = (
mp->r).c ;
204 const Mtbl* mtet_a = (
mp->tet).c ;
205 const Mtbl* mphi_a = (
mp->phi).c ;
206 const Mtbl* mx_a = (
mp->x).c ;
207 const Mtbl* my_a = (
mp->y).c ;
208 const Mtbl* mz_a = (
mp->z).c ;
213 double precis = 1e-15 ;
222 for (
int l=0; l < nzet; l++) {
224 int nr = mg_a->
get_nr(l) ;
225 int nt = mg_a->
get_nt(l) ;
226 int np = mg_a->
get_np(l) ;
229 const double* pr_a = mr_a->
t[l]->
t ;
230 const double* ptet_a = mtet_a->
t[l]->
t ;
231 const double* pphi_a = mphi_a->
t[l]->
t ;
232 const double* px_a = mx_a->
t[l]->
t ;
233 const double* py_a = my_a->
t[l]->
t ;
234 const double* pz_a = mz_a->
t[l]->
t ;
238 double* ptx = (
va.c->t[l])->t ;
245 for (
int k=0 ; k<np/2+1 ; k++) {
246 for (
int j=0 ; j<nt ; j++) {
247 for (
int i=0 ; i<nr ; i++) {
250 double rd, tetd, phid ;
251 if (
r == __infinity) {
254 phid = *pphi_a + M_PI ;
255 if (phid < 0) phid += 2*M_PI ;
260 double xd = - *px_a + xx_a ;
261 double yd = - *py_a + yy_a ;
262 double zd = *pz_a + zz_a ;
265 double rhod2 = xd*xd + yd*yd ;
266 double rhod =
sqrt( rhod2 ) ;
267 rd =
sqrt(rhod2 + zd*zd) ;
268 tetd = atan2(rhod, zd) ;
269 phid = atan2(yd, xd) ;
270 if (phid < 0) phid += 2*M_PI ;
283 mp_d->val_lx(rd, tetd, phid, par_precis, ld, xxd) ;
304 for (
int k=np/2+1 ; k<np ; k++) {
308 double* ptx_symy = (
va.c->t[l])->t + (np-k)*nt*nr ;
311 for (
int j=0 ; j<nt ; j++) {
312 for (
int i=0 ; i<nr ; i++) {
348 if (cm_d.
etat == ETATZERO) {
353 const Map* mp_d = cm_d.
mp ;
357 int align = (
mp->get_bvect_cart()).get_align() ;
359 assert( align * (mp_d->get_bvect_cart()).get_align() == 1 ) ;
361 assert(cm_d.
etat == ETATQCQ) ;
365 "Cmp::import_align_symy : the dzpuis of the Cmp to be imported"
366 <<
" must be zero !" << endl ;
371 const Mg3d* mg_a =
mp->get_mg() ;
375 assert(nzet <= nz_a) ;
387 va.set_etat_c_qcq() ;
389 va.c->set_etat_qcq() ;
395 double xx_a, yy_a, zz_a ;
397 xx_a =
mp->get_ori_x() - mp_d->get_ori_x() ;
398 yy_a =
mp->get_ori_y() - mp_d->get_ori_y() ;
401 xx_a = mp_d->get_ori_x() -
mp->get_ori_x() ;
402 yy_a = mp_d->get_ori_y() -
mp->get_ori_y() ;
404 zz_a =
mp->get_ori_z() - mp_d->get_ori_z() ;
410 if ( (
mp->r).c == 0x0 ) (
mp->r).fait() ;
411 if ( (
mp->tet).c == 0x0 ) (
mp->tet).fait() ;
412 if ( (
mp->phi).c == 0x0 ) (
mp->phi).fait() ;
413 if ( (
mp->x).c == 0x0 ) (
mp->x).fait() ;
414 if ( (
mp->y).c == 0x0 ) (
mp->y).fait() ;
415 if ( (
mp->z).c == 0x0 ) (
mp->z).fait() ;
417 const Mtbl* mr_a = (
mp->r).c ;
418 const Mtbl* mtet_a = (
mp->tet).c ;
419 const Mtbl* mphi_a = (
mp->phi).c ;
420 const Mtbl* mx_a = (
mp->x).c ;
421 const Mtbl* my_a = (
mp->y).c ;
422 const Mtbl* mz_a = (
mp->z).c ;
427 double precis = 1e-15 ;
436 for (
int l=0; l < nzet; l++) {
438 int nr = mg_a->
get_nr(l) ;
439 int nt = mg_a->
get_nt(l) ;
440 int np = mg_a->
get_np(l) ;
443 const double* pr_a = mr_a->
t[l]->
t ;
444 const double* ptet_a = mtet_a->
t[l]->
t ;
445 const double* pphi_a = mphi_a->
t[l]->
t ;
446 const double* px_a = mx_a->
t[l]->
t ;
447 const double* py_a = my_a->
t[l]->
t ;
448 const double* pz_a = mz_a->
t[l]->
t ;
452 double* ptx = (
va.c->t[l])->t ;
460 for (
int k=0 ; k<np/2+1 ; k++) {
461 for (
int j=0 ; j<nt ; j++) {
462 for (
int i=0 ; i<nr ; i++) {
465 double rd, tetd, phid ;
466 if (
r == __infinity) {
474 double xd = *px_a + xx_a ;
475 double yd = *py_a + yy_a ;
476 double zd = *pz_a + zz_a ;
479 double rhod2 = xd*xd + yd*yd ;
480 double rhod =
sqrt( rhod2 ) ;
481 rd =
sqrt(rhod2 + zd*zd) ;
482 tetd = atan2(rhod, zd) ;
483 phid = atan2(yd, xd) ;
484 if (phid < 0) phid += 2*M_PI ;
497 mp_d->val_lx(rd, tetd, phid, par_precis, ld, xxd) ;
519 for (
int k=np/2+1 ; k<np ; k++) {
523 double* ptx_symy = (
va.c->t[l])->t + (np-k)*nt*nr ;
526 for (
int j=0 ; j<nt ; j++) {
527 for (
int i=0 ; i<nr ; i++) {
const Map * mp
Reference mapping.
Cmp(const Map &map)
Constructor from mapping.
void import_align_symy(int nzet, const Cmp &ci)
Assignment to another Cmp defined on a different mapping, when the two mappings have aligned Cartesia...
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 set_dzpuis(int)
Set a value to dzpuis.
void import_symy(const Cmp &ci)
Assignment to another Cmp defined on a different mapping.
void del_t()
Logical destructor.
void import_anti_symy(int nzet, const Cmp &ci)
Assignment to another Cmp defined on a different mapping, when the two mappings have anti-aligned Car...
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_symy(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