30 char scalar_import_asymy_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Tensor/Scalar/scalar_import_asymy.C,v 1.5 2014/10/13 08:53:46 j_novak Exp $" ;
115 cout <<
"Scalar::import_asymy : unexpected value of align_rel : "
116 << align_rel << endl ;
153 assert(cm_d.
get_etat() == ETATQCQ) ;
157 "Scalar::import_anti_asymy : the dzpuis of the Scalar to be imported"
158 <<
" must be zero !" << endl ;
168 assert(nzet <= nz_a) ;
188 double xx_a, yy_a, zz_a ;
203 if ( (
mp->
r).c == 0x0 ) (
mp->
r).fait() ;
206 if ( (
mp->
x).c == 0x0 ) (
mp->
x).fait() ;
207 if ( (
mp->
y).c == 0x0 ) (
mp->
y).fait() ;
208 if ( (
mp->
z).c == 0x0 ) (
mp->
z).fait() ;
220 double precis = 1e-15 ;
229 for (
int l=0; l < nzet; l++) {
231 int nr = mg_a->
get_nr(l) ;
232 int nt = mg_a->
get_nt(l) ;
233 int np = mg_a->
get_np(l) ;
236 const double* pr_a = mr_a->
t[l]->
t ;
237 const double* ptet_a = mtet_a->
t[l]->
t ;
238 const double* pphi_a = mphi_a->
t[l]->
t ;
239 const double* px_a = mx_a->
t[l]->
t ;
240 const double* py_a = my_a->
t[l]->
t ;
241 const double* pz_a = mz_a->
t[l]->
t ;
245 double* ptx = (
va.
c->
t[l])->t ;
253 for (
int i=0; i<ntnr; i++) {
266 for (
int k=1 ; k<np/2 ; k++) {
267 for (
int j=0 ; j<nt ; j++) {
268 for (
int i=0 ; i<nr ; i++) {
271 double rd, tetd, phid ;
272 if (r == __infinity) {
275 phid = *pphi_a + M_PI ;
276 if (phid < 0) phid += 2*M_PI ;
281 double xd = - *px_a + xx_a ;
282 double yd = - *py_a + yy_a ;
283 double zd = *pz_a + zz_a ;
286 double rhod2 = xd*xd + yd*yd ;
287 double rhod =
sqrt( rhod2 ) ;
288 rd =
sqrt(rhod2 + zd*zd) ;
289 tetd = atan2(rhod, zd) ;
290 phid = atan2(yd, xd) ;
291 if (phid < 0) phid += 2*M_PI ;
304 mp_d->
val_lx(rd, tetd, phid, par_precis, ld, xxd) ;
323 for (
int i=0; i<ntnr; i++) {
339 for (
int k=np/2+1 ; k<np ; k++) {
343 double* ptx_symy = (
va.
c->
t[l])->t + (np-k)*nt*nr ;
346 for (
int j=0 ; j<nt ; j++) {
347 for (
int i=0 ; i<nr ; i++) {
348 *ptx = - (*ptx_symy) ;
400 assert(cm_d.
get_etat() == ETATQCQ) ;
404 "Scalar::import_align_asymy : the dzpuis of the Scalar to be imported"
405 <<
" must be zero !" << endl ;
414 assert(nzet <= nz_a) ;
434 double xx_a, yy_a, zz_a ;
449 if ( (
mp->
r).c == 0x0 ) (
mp->
r).fait() ;
452 if ( (
mp->
x).c == 0x0 ) (
mp->
x).fait() ;
453 if ( (
mp->
y).c == 0x0 ) (
mp->
y).fait() ;
454 if ( (
mp->
z).c == 0x0 ) (
mp->
z).fait() ;
466 double precis = 1e-15 ;
475 for (
int l=0; l < nzet; l++) {
477 int nr = mg_a->
get_nr(l) ;
478 int nt = mg_a->
get_nt(l) ;
479 int np = mg_a->
get_np(l) ;
482 const double* pr_a = mr_a->
t[l]->
t ;
483 const double* ptet_a = mtet_a->
t[l]->
t ;
484 const double* pphi_a = mphi_a->
t[l]->
t ;
485 const double* px_a = mx_a->
t[l]->
t ;
486 const double* py_a = my_a->
t[l]->
t ;
487 const double* pz_a = mz_a->
t[l]->
t ;
491 double* ptx = (
va.
c->
t[l])->t ;
500 for (
int i=0; i<ntnr; i++) {
513 for (
int k=1 ; k<np/2 ; k++) {
514 for (
int j=0 ; j<nt ; j++) {
515 for (
int i=0 ; i<nr ; i++) {
518 double rd, tetd, phid ;
519 if (r == __infinity) {
527 double xd = *px_a + xx_a ;
528 double yd = *py_a + yy_a ;
529 double zd = *pz_a + zz_a ;
532 double rhod2 = xd*xd + yd*yd ;
533 double rhod =
sqrt( rhod2 ) ;
534 rd =
sqrt(rhod2 + zd*zd) ;
535 tetd = atan2(rhod, zd) ;
536 phid = atan2(yd, xd) ;
537 if (phid < 0) phid += 2*M_PI ;
550 mp_d->
val_lx(rd, tetd, phid, par_precis, ld, xxd) ;
570 for (
int i=0; i<ntnr; i++) {
586 for (
int k=np/2+1 ; k<np ; k++) {
590 double* ptx_symy = (
va.
c->
t[l])->t + (np-k)*nt*nr ;
593 for (
int j=0 ; j<nt ; j++) {
594 for (
int i=0 ; i<nr ; i++) {
595 *ptx = - (*ptx_symy) ;
Coord z
z coordinate centered on the grid
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
double get_ori_x() const
Returns the x coordinate of the origin.
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 ).
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...
void set_etat_one()
Sets the logical state to ETATUN (one).
Valeur va
The numerical value of the Scalar
Mtbl_cf * c_cf
Coefficients of the spectral expansion of the function.
void add_double(const double &x, int position=0)
Adds the the address of a new double to the list.
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
double get_ori_y() const
Returns the y coordinate of the origin.
Coord r
r coordinate centered on the grid
void import_asymy(const Scalar &ci)
Assignment to another Scalar defined on a different mapping.
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 import_anti_asymy(int nzet, const Scalar &ci)
Assignment to another Scalar defined on a different mapping, when the two mappings have anti-aligned ...
Tensor field of valence 0 (or component of a tensorial field).
const Map & get_mp() const
Returns the mapping.
Mtbl * c
Values of the function at the points of the multi-grid
void coef() const
Computes the coeffcients of *this.
double * t
The array of double.
const Valeur & get_spectral_va() const
Returns va (read only version)
void import_align_asymy(int nzet, const Scalar &ci)
Assignment to another Scalar defined on a different mapping, when the two mappings have aligned Carte...
const Map *const mp
Mapping on which the numerical values at the grid points are defined.
int get_nzone() const
Returns the number of domains.
Coord tet
coordinate centered on the grid
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
friend Scalar sqrt(const Scalar &)
Square root.
void add_int_mod(int &n, int position=0)
Adds the address of a new modifiable int to the list.
virtual void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
const Base_vect_cart & get_bvect_cart() const
Returns the Cartesian basis associated with the coordinates (x,y,z) of the mapping,...
Coord phi
coordinate centered on the grid
virtual void annule(int l_min, int l_max)
Sets the Scalar to zero in several domains.
virtual void set_etat_zero()
Sets the logical state to ETATZERO (zero).
void set_dzpuis(int)
Modifies the dzpuis flag.
int get_type_p() const
Returns the type of sampling in the direction: SYM : : symmetry with respect to the transformatio...
Coord x
x coordinate centered on the grid
int get_etat() const
Returns the logical state ETATNONDEF (undefined), ETATZERO (null) or ETATQCQ (ordinary).
double get_ori_z() const
Returns the z coordinate of the origin.
Tbl ** t
Array (size nzone ) of pointers on the Tbl 's.
int get_dzpuis() const
Returns dzpuis.
Coord y
y coordinate centered on the grid
Base class for coordinate mappings.
void add_int(const int &n, int position=0)
Adds the address of a new int to the list.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
void del_t()
Logical destructor.