84 const Map* mp_d = cm_d.
mp ;
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 ;
147 assert(cm_d.
etat == ETATQCQ) ;
151 "Cmp::import_anti_asymy : the dzpuis of the Cmp to be imported" 152 <<
" must be zero !" << endl ;
162 assert(nzet <= nz_a) ;
182 double xx_a, yy_a, zz_a ;
197 if ( (
mp->
r).c == 0x0 ) (
mp->
r).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() ;
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 ;
390 assert(cm_d.
etat == ETATQCQ) ;
394 "Cmp::import_align_asymy : the dzpuis of the Cmp to be imported" 395 <<
" must be zero !" << endl ;
404 assert(nzet <= nz_a) ;
424 double xx_a, yy_a, zz_a ;
439 if ( (
mp->
r).c == 0x0 ) (
mp->
r).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() ;
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) ;
int get_type_p() const
Returns the type of sampling in the direction: SYM : : symmetry with respect to the transformatio...
void del_t()
Logical destructor.
Mtbl_cf * c_cf
Coefficients of the spectral expansion of the function.
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...
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
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.
Cmp sqrt(const Cmp &)
Square root.
void annule(int l)
Sets the Cmp to zero in a given domain.
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.
int etat
Logical state (ETATNONDEF , ETATQCQ or ETATZERO ).
Base class for coordinate mappings.
double get_ori_x() const
Returns the x coordinate of the origin.
Values and coefficients of a (real-value) function.
Coord tet
coordinate centered on the grid
Coord phi
coordinate centered on the grid
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
int dzpuis
Power of r by which the quantity represented by this must be divided in the external compactified zo...
double * t
The array of double.
Mtbl * c
Values of the function at the points of the multi-grid.
int get_nzone() const
Returns the number of domains.
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 set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
const Map * mp
Reference mapping.
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
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.
void set_dzpuis(int)
Set a value to dzpuis.
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
Tbl ** t
Array (size nzone ) of pointers on the Tbl 's.
void import_asymy(const Cmp &ci)
Assignment to another Cmp defined on a different mapping.
Coord z
z coordinate centered on the grid
Valeur va
The numerical value of the Cmp.
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 ...
void add_int_mod(int &n, int position=0)
Adds the address of a new modifiable int to the list.
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...