29char cmp_import_symy_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Cmp/cmp_import_symy.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_symy : 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_symy : the dzpuis of the Cmp to be imported"
149 <<
" must be zero !" << endl ;
158 assert(nzet <= nz_a) ;
178 double xx_a, yy_a, zz_a ;
193 if ( (
mp->
r).c == 0x0 ) (
mp->
r).fait() ;
196 if ( (
mp->
x).c == 0x0 ) (
mp->
x).fait() ;
197 if ( (
mp->
y).c == 0x0 ) (
mp->
y).fait() ;
198 if ( (
mp->
z).c == 0x0 ) (
mp->
z).fait() ;
210 double precis = 1e-15 ;
219 for (
int l=0; l < nzet; l++) {
221 int nr = mg_a->
get_nr(l) ;
222 int nt = mg_a->
get_nt(l) ;
223 int np = mg_a->
get_np(l) ;
226 const double* pr_a = mr_a->
t[l]->
t ;
227 const double* ptet_a = mtet_a->
t[l]->
t ;
228 const double* pphi_a = mphi_a->
t[l]->
t ;
229 const double* px_a = mx_a->
t[l]->
t ;
230 const double* py_a = my_a->
t[l]->
t ;
231 const double* pz_a = mz_a->
t[l]->
t ;
235 double* ptx = (
va.
c->
t[l])->t ;
242 for (
int k=0 ; k<np/2+1 ; k++) {
243 for (
int j=0 ; j<nt ; j++) {
244 for (
int i=0 ; i<nr ; i++) {
247 double rd, tetd, phid ;
248 if (r == __infinity) {
251 phid = *pphi_a + M_PI ;
252 if (phid < 0) phid += 2*M_PI ;
257 double xd = - *px_a + xx_a ;
258 double yd = - *py_a + yy_a ;
259 double zd = *pz_a + zz_a ;
262 double rhod2 = xd*xd + yd*yd ;
263 double rhod =
sqrt( rhod2 ) ;
264 rd =
sqrt(rhod2 + zd*zd) ;
265 tetd = atan2(rhod, zd) ;
266 phid = atan2(yd, xd) ;
267 if (phid < 0) phid += 2*M_PI ;
280 mp_d->
val_lx(rd, tetd, phid, par_precis, ld, xxd) ;
301 for (
int k=np/2+1 ; k<np ; k++) {
305 double* ptx_symy = (
va.
c->
t[l])->t + (np-k)*nt*nr ;
308 for (
int j=0 ; j<nt ; j++) {
309 for (
int i=0 ; i<nr ; i++) {
345 if (cm_d.
etat == ETATZERO) {
350 const Map* mp_d = cm_d.
mp ;
358 assert(cm_d.
etat == ETATQCQ) ;
362 "Cmp::import_align_symy : the dzpuis of the Cmp to be imported"
363 <<
" must be zero !" << endl ;
372 assert(nzet <= nz_a) ;
392 double xx_a, yy_a, zz_a ;
407 if ( (
mp->
r).c == 0x0 ) (
mp->
r).fait() ;
410 if ( (
mp->
x).c == 0x0 ) (
mp->
x).fait() ;
411 if ( (
mp->
y).c == 0x0 ) (
mp->
y).fait() ;
412 if ( (
mp->
z).c == 0x0 ) (
mp->
z).fait() ;
424 double precis = 1e-15 ;
433 for (
int l=0; l < nzet; l++) {
435 int nr = mg_a->
get_nr(l) ;
436 int nt = mg_a->
get_nt(l) ;
437 int np = mg_a->
get_np(l) ;
440 const double* pr_a = mr_a->
t[l]->
t ;
441 const double* ptet_a = mtet_a->
t[l]->
t ;
442 const double* pphi_a = mphi_a->
t[l]->
t ;
443 const double* px_a = mx_a->
t[l]->
t ;
444 const double* py_a = my_a->
t[l]->
t ;
445 const double* pz_a = mz_a->
t[l]->
t ;
449 double* ptx = (
va.
c->
t[l])->t ;
457 for (
int k=0 ; k<np/2+1 ; k++) {
458 for (
int j=0 ; j<nt ; j++) {
459 for (
int i=0 ; i<nr ; i++) {
462 double rd, tetd, phid ;
463 if (r == __infinity) {
471 double xd = *px_a + xx_a ;
472 double yd = *py_a + yy_a ;
473 double zd = *pz_a + zz_a ;
476 double rhod2 = xd*xd + yd*yd ;
477 double rhod =
sqrt( rhod2 ) ;
478 rd =
sqrt(rhod2 + zd*zd) ;
479 tetd = atan2(rhod, zd) ;
480 phid = atan2(yd, xd) ;
481 if (phid < 0) phid += 2*M_PI ;
494 mp_d->
val_lx(rd, tetd, phid, par_precis, ld, xxd) ;
516 for (
int k=np/2+1 ; k<np ; k++) {
520 double* ptx_symy = (
va.
c->
t[l])->t + (np-k)*nt*nr ;
523 for (
int j=0 ; j<nt ; j++) {
524 for (
int i=0 ; i<nr ; i++) {
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
const Map * mp
Reference 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...
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_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 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.