29char cmp_import_asymy_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Cmp/cmp_import_asymy.C,v 1.3 2014/10/13 08:52:47 j_novak Exp $" ;
81 const Map* mp_d = cm_d.
mp ;
110 cout <<
"Cmp::import_asymy : unexpected value of align_rel : "
111 << align_rel << endl ;
131 if (cm_d.
etat == ETATZERO) {
136 const Map* mp_d = cm_d.
mp ;
144 assert(cm_d.
etat == ETATQCQ) ;
148 "Cmp::import_anti_asymy : the dzpuis of the Cmp to be imported"
149 <<
" must be zero !" << endl ;
159 assert(nzet <= nz_a) ;
179 double xx_a, yy_a, zz_a ;
194 if ( (
mp->
r).c == 0x0 ) (
mp->
r).fait() ;
197 if ( (
mp->
x).c == 0x0 ) (
mp->
x).fait() ;
198 if ( (
mp->
y).c == 0x0 ) (
mp->
y).fait() ;
199 if ( (
mp->
z).c == 0x0 ) (
mp->
z).fait() ;
211 double precis = 1e-15 ;
220 for (
int l=0; l < nzet; l++) {
222 int nr = mg_a->
get_nr(l) ;
223 int nt = mg_a->
get_nt(l) ;
224 int np = mg_a->
get_np(l) ;
227 const double* pr_a = mr_a->
t[l]->
t ;
228 const double* ptet_a = mtet_a->
t[l]->
t ;
229 const double* pphi_a = mphi_a->
t[l]->
t ;
230 const double* px_a = mx_a->
t[l]->
t ;
231 const double* py_a = my_a->
t[l]->
t ;
232 const double* pz_a = mz_a->
t[l]->
t ;
236 double* ptx = (
va.
c->
t[l])->t ;
244 for (
int i=0; i<ntnr; i++) {
257 for (
int k=1 ; k<np/2 ; 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 + M_PI ;
267 if (phid < 0) phid += 2*M_PI ;
272 double xd = - *px_a + xx_a ;
273 double yd = - *py_a + yy_a ;
274 double zd = *pz_a + zz_a ;
277 double rhod2 = xd*xd + yd*yd ;
278 double rhod =
sqrt( rhod2 ) ;
279 rd =
sqrt(rhod2 + zd*zd) ;
280 tetd = atan2(rhod, zd) ;
281 phid = atan2(yd, xd) ;
282 if (phid < 0) phid += 2*M_PI ;
295 mp_d->
val_lx(rd, tetd, phid, par_precis, ld, xxd) ;
314 for (
int i=0; i<ntnr; i++) {
330 for (
int k=np/2+1 ; k<np ; k++) {
334 double* ptx_symy = (
va.
c->
t[l])->t + (np-k)*nt*nr ;
337 for (
int j=0 ; j<nt ; j++) {
338 for (
int i=0 ; i<nr ; i++) {
339 *ptx = - (*ptx_symy) ;
374 if (cm_d.
etat == ETATZERO) {
379 const Map* mp_d = cm_d.
mp ;
387 assert(cm_d.
etat == ETATQCQ) ;
391 "Cmp::import_align_asymy : the dzpuis of the Cmp to be imported"
392 <<
" must be zero !" << endl ;
401 assert(nzet <= nz_a) ;
421 double xx_a, yy_a, zz_a ;
436 if ( (
mp->
r).c == 0x0 ) (
mp->
r).fait() ;
439 if ( (
mp->
x).c == 0x0 ) (
mp->
x).fait() ;
440 if ( (
mp->
y).c == 0x0 ) (
mp->
y).fait() ;
441 if ( (
mp->
z).c == 0x0 ) (
mp->
z).fait() ;
453 double precis = 1e-15 ;
462 for (
int l=0; l < nzet; l++) {
464 int nr = mg_a->
get_nr(l) ;
465 int nt = mg_a->
get_nt(l) ;
466 int np = mg_a->
get_np(l) ;
469 const double* pr_a = mr_a->
t[l]->
t ;
470 const double* ptet_a = mtet_a->
t[l]->
t ;
471 const double* pphi_a = mphi_a->
t[l]->
t ;
472 const double* px_a = mx_a->
t[l]->
t ;
473 const double* py_a = my_a->
t[l]->
t ;
474 const double* pz_a = mz_a->
t[l]->
t ;
478 double* ptx = (
va.
c->
t[l])->t ;
487 for (
int i=0; i<ntnr; i++) {
500 for (
int k=1 ; k<np/2 ; k++) {
501 for (
int j=0 ; j<nt ; j++) {
502 for (
int i=0 ; i<nr ; i++) {
505 double rd, tetd, phid ;
506 if (r == __infinity) {
514 double xd = *px_a + xx_a ;
515 double yd = *py_a + yy_a ;
516 double zd = *pz_a + zz_a ;
519 double rhod2 = xd*xd + yd*yd ;
520 double rhod =
sqrt( rhod2 ) ;
521 rd =
sqrt(rhod2 + zd*zd) ;
522 tetd = atan2(rhod, zd) ;
523 phid = atan2(yd, xd) ;
524 if (phid < 0) phid += 2*M_PI ;
537 mp_d->
val_lx(rd, tetd, phid, par_precis, ld, xxd) ;
557 for (
int i=0; i<ntnr; i++) {
573 for (
int k=np/2+1 ; k<np ; k++) {
577 double* ptx_symy = (
va.
c->
t[l])->t + (np-k)*nt*nr ;
580 for (
int j=0 ; j<nt ; j++) {
581 for (
int i=0 ; i<nr ; i++) {
582 *ptx = - (*ptx_symy) ;
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
const Map * mp
Reference 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.
Base class for coordinate mappings.
double get_ori_z() const
Returns the z coordinate of the origin.
const Base_vect_cart & get_bvect_cart() const
Returns the Cartesian basis associated with the coordinates (x,y,z) of the mapping,...
Coord y
y coordinate centered on the grid
Coord r
r coordinate centered on the grid
double get_ori_y() const
Returns the y coordinate of the origin.
Coord tet
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...
Coord z
z coordinate centered on the grid
double get_ori_x() const
Returns the x coordinate of the origin.
Coord x
x coordinate centered on the grid
Coord phi
coordinate centered on the grid
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
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 set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
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.
void set_etat_c_qcq()
Sets the logical state to ETATQCQ (ordinary state) for values in the configuration space (Mtbl c ).
Mtbl * c
Values of the function at the points of the multi-grid
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.