77 int nz =
mp->get_mg()->get_nzone() ;
102 int align_rel = (
mp->get_bvect_cart()).get_align()
103 * (mp_d->get_bvect_cart()).get_align() ;
118 cout <<
"Scalar::import_symy : unexpected value of align_rel : "
119 << align_rel << endl ;
152 int align = (
mp->get_bvect_cart()).get_align() ;
154 assert( align * (mp_d->get_bvect_cart()).get_align() == -1 ) ;
156 assert(cm_d.
get_etat() == ETATQCQ) ;
160 "Scalar::import_anti_symy : the dzpuis of the Scalar to be imported"
161 <<
" must be zero !" << endl ;
166 const Mg3d* mg_a =
mp->get_mg() ;
170 assert(nzet <= nz_a) ;
182 va.set_etat_c_qcq() ;
184 va.c->set_etat_qcq() ;
190 double xx_a, yy_a, zz_a ;
192 xx_a = mp_d->get_ori_x() -
mp->get_ori_x() ;
193 yy_a = mp_d->get_ori_y() -
mp->get_ori_y() ;
196 xx_a =
mp->get_ori_x() - mp_d->get_ori_x() ;
197 yy_a =
mp->get_ori_y() - mp_d->get_ori_y() ;
199 zz_a =
mp->get_ori_z() - mp_d->get_ori_z() ;
205 if ( (
mp->r).c == 0x0 ) (
mp->r).fait() ;
206 if ( (
mp->tet).c == 0x0 ) (
mp->tet).fait() ;
207 if ( (
mp->phi).c == 0x0 ) (
mp->phi).fait() ;
208 if ( (
mp->x).c == 0x0 ) (
mp->x).fait() ;
209 if ( (
mp->y).c == 0x0 ) (
mp->y).fait() ;
210 if ( (
mp->z).c == 0x0 ) (
mp->z).fait() ;
212 const Mtbl* mr_a = (
mp->r).c ;
213 const Mtbl* mtet_a = (
mp->tet).c ;
214 const Mtbl* mphi_a = (
mp->phi).c ;
215 const Mtbl* mx_a = (
mp->x).c ;
216 const Mtbl* my_a = (
mp->y).c ;
217 const Mtbl* mz_a = (
mp->z).c ;
222 double precis = 1e-15 ;
231 for (
int l=0; l < nzet; l++) {
233 int nr = mg_a->
get_nr(l) ;
234 int nt = mg_a->
get_nt(l) ;
235 int np = mg_a->
get_np(l) ;
238 const double* pr_a = mr_a->
t[l]->
t ;
239 const double* ptet_a = mtet_a->
t[l]->
t ;
240 const double* pphi_a = mphi_a->
t[l]->
t ;
241 const double* px_a = mx_a->
t[l]->
t ;
242 const double* py_a = my_a->
t[l]->
t ;
243 const double* pz_a = mz_a->
t[l]->
t ;
247 double* ptx = (
va.c->t[l])->t ;
254 for (
int k=0 ; k<np/2+1 ; k++) {
255 for (
int j=0 ; j<nt ; j++) {
256 for (
int i=0 ; i<nr ; i++) {
259 double rd, tetd, phid ;
260 if (
r == __infinity) {
263 phid = *pphi_a + M_PI ;
264 if (phid < 0) phid += 2*M_PI ;
269 double xd = - *px_a + xx_a ;
270 double yd = - *py_a + yy_a ;
271 double zd = *pz_a + zz_a ;
274 double rhod2 = xd*xd + yd*yd ;
275 double rhod =
sqrt( rhod2 ) ;
276 rd =
sqrt(rhod2 + zd*zd) ;
277 tetd = atan2(rhod, zd) ;
278 phid = atan2(yd, xd) ;
279 if (phid < 0) phid += 2*M_PI ;
292 mp_d->val_lx(rd, tetd, phid, par_precis, ld, xxd) ;
313 for (
int k=np/2+1 ; k<np ; k++) {
317 double* ptx_symy = (
va.c->t[l])->t + (np-k)*nt*nr ;
320 for (
int j=0 ; j<nt ; j++) {
321 for (
int i=0 ; i<nr ; i++) {
370 int align = (
mp->get_bvect_cart()).get_align() ;
372 assert( align * (mp_d->get_bvect_cart()).get_align() == 1 ) ;
374 assert(cm_d.
get_etat() == ETATQCQ) ;
378 "Scalar::import_align_symy : the dzpuis of the Scalar to be imported"
379 <<
" must be zero !" << endl ;
384 const Mg3d* mg_a =
mp->get_mg() ;
388 assert(nzet <= nz_a) ;
400 va.set_etat_c_qcq() ;
402 va.c->set_etat_qcq() ;
408 double xx_a, yy_a, zz_a ;
410 xx_a =
mp->get_ori_x() - mp_d->get_ori_x() ;
411 yy_a =
mp->get_ori_y() - mp_d->get_ori_y() ;
414 xx_a = mp_d->get_ori_x() -
mp->get_ori_x() ;
415 yy_a = mp_d->get_ori_y() -
mp->get_ori_y() ;
417 zz_a =
mp->get_ori_z() - mp_d->get_ori_z() ;
423 if ( (
mp->r).c == 0x0 ) (
mp->r).fait() ;
424 if ( (
mp->tet).c == 0x0 ) (
mp->tet).fait() ;
425 if ( (
mp->phi).c == 0x0 ) (
mp->phi).fait() ;
426 if ( (
mp->x).c == 0x0 ) (
mp->x).fait() ;
427 if ( (
mp->y).c == 0x0 ) (
mp->y).fait() ;
428 if ( (
mp->z).c == 0x0 ) (
mp->z).fait() ;
430 const Mtbl* mr_a = (
mp->r).c ;
431 const Mtbl* mtet_a = (
mp->tet).c ;
432 const Mtbl* mphi_a = (
mp->phi).c ;
433 const Mtbl* mx_a = (
mp->x).c ;
434 const Mtbl* my_a = (
mp->y).c ;
435 const Mtbl* mz_a = (
mp->z).c ;
440 double precis = 1e-15 ;
449 for (
int l=0; l < nzet; l++) {
451 int nr = mg_a->
get_nr(l) ;
452 int nt = mg_a->
get_nt(l) ;
453 int np = mg_a->
get_np(l) ;
456 const double* pr_a = mr_a->
t[l]->
t ;
457 const double* ptet_a = mtet_a->
t[l]->
t ;
458 const double* pphi_a = mphi_a->
t[l]->
t ;
459 const double* px_a = mx_a->
t[l]->
t ;
460 const double* py_a = my_a->
t[l]->
t ;
461 const double* pz_a = mz_a->
t[l]->
t ;
465 double* ptx = (
va.c->t[l])->t ;
473 for (
int k=0 ; k<np/2+1 ; k++) {
474 for (
int j=0 ; j<nt ; j++) {
475 for (
int i=0 ; i<nr ; i++) {
478 double rd, tetd, phid ;
479 if (
r == __infinity) {
487 double xd = *px_a + xx_a ;
488 double yd = *py_a + yy_a ;
489 double zd = *pz_a + zz_a ;
492 double rhod2 = xd*xd + yd*yd ;
493 double rhod =
sqrt( rhod2 ) ;
494 rd =
sqrt(rhod2 + zd*zd) ;
495 tetd = atan2(rhod, zd) ;
496 phid = atan2(yd, xd) ;
497 if (phid < 0) phid += 2*M_PI ;
510 mp_d->val_lx(rd, tetd, phid, par_precis, ld, xxd) ;
532 for (
int k=np/2+1 ; k<np ; k++) {
536 double* ptx_symy = (
va.c->t[l])->t + (np-k)*nt*nr ;
539 for (
int j=0 ; j<nt ; j++) {
540 for (
int i=0 ; i<nr ; i++) {
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.
void set_etat_one()
Sets the logical state to ETATUN (one).
int get_dzpuis() const
Returns dzpuis.
virtual void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
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.
Scalar(const Map &mpi)
Constructor from mapping.
const Valeur & get_spectral_va() const
Returns va (read only version).
void del_t()
Logical destructor.
int get_etat() const
Returns the logical state ETATNONDEF (undefined), ETATZERO (null) or ETATQCQ (ordinary).
void set_dzpuis(int)
Modifies the dzpuis flag.
void import_align_symy(int nzet, const Scalar &ci)
Assignment to another Scalar defined on a different mapping, when the two mappings have aligned Carte...
Valeur va
The numerical value of the Scalar.
friend Scalar sqrt(const Scalar &)
Square root.
void import_anti_symy(int nzet, const Scalar &ci)
Assignment to another Scalar defined on a different mapping, when the two mappings have anti-aligned ...
void import_symy(const Scalar &ci)
Assignment to another Scalar defined on a different mapping.
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.
const Map & get_mp() const
Returns the mapping.
const Map *const mp
Mapping on which the numerical values at the grid points are defined.
Map(const Mg3d &)
Constructor from a multi-domain 3D grid.
Coord r
r coordinate centered on the grid