LORENE
cmp_import.C
1 /*
2  * Member function of the Cmp class for initiating a Cmp from a Cmp defined
3  * on another mapping.
4  */
5 
6 /*
7  * Copyright (c) 1999-2001 Eric Gourgoulhon
8  *
9  * This file is part of LORENE.
10  *
11  * LORENE is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * LORENE is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with LORENE; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24  *
25  */
26 
27 
28 
29 
30 /*
31  * $Id: cmp_import.C,v 1.4 2016/12/05 16:17:48 j_novak Exp $
32  * $Log: cmp_import.C,v $
33  * Revision 1.4 2016/12/05 16:17:48 j_novak
34  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
35  *
36  * Revision 1.3 2014/10/13 08:52:47 j_novak
37  * Lorene classes and functions now belong to the namespace Lorene.
38  *
39  * Revision 1.2 2014/10/06 15:13:03 j_novak
40  * Modified #include directives to use c++ syntax.
41  *
42  * Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon
43  * LORENE
44  *
45  * Revision 1.4 2000/02/28 16:46:42 eric
46  * Version entierement refondue: utilisation de align.
47  *
48  * Revision 1.3 2000/02/07 12:32:39 eric
49  * L'appel d'annule n'est effectue que si nzet < nz_a.
50  *
51  * Revision 1.2 1999/12/16 14:33:04 eric
52  * L'argument precis de Map::val_lax est desormais un Param et non plus
53  * un Tbl.
54  *
55  * Revision 1.1 1999/12/08 12:38:51 eric
56  * Initial revision
57  *
58  *
59  * $Header: /cvsroot/Lorene/C++/Source/Cmp/cmp_import.C,v 1.4 2016/12/05 16:17:48 j_novak Exp $
60  *
61  */
62 
63 // Headers C
64 #include <cmath>
65 
66 // Headers Lorene
67 #include "cmp.h"
68 #include "param.h"
69 #include "nbr_spx.h"
70 
71  //-------------------------------//
72  // Importation in all domains //
73  //-------------------------------//
74 
75 namespace Lorene {
76 void Cmp::import(const Cmp& ci) {
77 
78  int nz = mp->get_mg()->get_nzone() ;
79 
80  import(nz, ci) ;
81 
82 }
83 
84  //--------------------------------------//
85  // Importation in inner domains only //
86  //--------------------------------------//
87 
88 void Cmp::import(int nzet, const Cmp& cm_d) {
89 
90  const Map* mp_d = cm_d.mp ; // Departure mapping
91 
92  // Trivial case : mappings identical !
93  // -----------------------------------
94 
95  if (mp_d == mp) {
96  *this = cm_d ;
97  return ;
98  }
99 
100  // Relative orientation of the two mappings
101  // ----------------------------------------
102 
103  int align_rel = (mp->get_bvect_cart()).get_align()
104  * (mp_d->get_bvect_cart()).get_align() ;
105 
106  switch (align_rel) {
107 
108  case 1 : { // the two mappings have aligned Cartesian axis
109  import_align(nzet, cm_d) ;
110  break ;
111  }
112 
113  case -1 : { // the two mappings have anti-aligned Cartesian axis
114  import_anti(nzet, cm_d) ;
115  break ;
116  }
117 
118  case 0 : { // general case
119  import_gal(nzet, cm_d) ;
120  break ;
121  }
122 
123  default : {
124  cout << "Cmp::import : unexpected value of align_rel : "
125  << align_rel << endl ;
126  abort() ;
127  break ;
128  }
129 
130  }
131 
132 }
133 
134  //--------------------------------------//
135  // General case (axis not aligned) //
136  //--------------------------------------//
137 
138 
139 void Cmp::import_gal(int nzet, const Cmp& cm_d) {
140 
141  const Map* mp_d = cm_d.mp ; // Departure mapping
142 
143  // Trivial case : mappings identical !
144  // -----------------------------------
145 
146  if (mp_d == mp) {
147  *this = cm_d ;
148  return ;
149  }
150 
151  // Another trivial case : null Cmp
152  // -------------------------------
153 
154  if (cm_d.etat == ETATZERO) {
155  set_etat_zero() ;
156  return ;
157  }
158 
159  // Protections
160  // -----------
161 
162  assert(cm_d.etat != ETATNONDEF) ;
163 
164  if (cm_d.dzpuis != 0) {
165  cout <<
166  "Cmp::import : the dzpuis of the Cmp to be imported must be zero !"
167  << endl ;
168  abort() ;
169  }
170 
171 
172  const Mg3d* mg_a = mp->get_mg() ;
173  int nz_a = mg_a->get_nzone() ;
174  assert(nzet <= nz_a) ;
175 
176 
177  // General case :
178  // -------------
179  assert(cm_d.etat == ETATQCQ) ;
180  const Valeur& va_d = cm_d.va ;
181  va_d.coef() ; // The coefficients are required
182 
183 
184  // Preparations for storing the result in *this
185  // --------------------------------------------
186  del_t() ; // delete all previously computed derived quantities
187 
188  set_etat_qcq() ; // Set the state to ETATQCQ
189 
190  va.set_etat_c_qcq() ; // Allocates the memory for the Mtbl va.c
191  // if it does not exist already
192  va.c->set_etat_qcq() ; // Allocates the memory for the Tbl's in each
193  // domain if they do not exist already
194 
195 
196  // Absolute coordinates of the origin of the Departure mapping
197  double xo_d = mp_d->get_ori_x() ;
198  double yo_d = mp_d->get_ori_y() ;
199  double zo_d = mp_d->get_ori_z() ;
200 
201  // Orientation relative to the Absolute frame of the Departure mapping
202  double rot_phi_d = mp_d->get_rot_phi() ;
203 
204  // Orientation relative to the Absolute frame of the Arrival mapping
205  double rot_phi_a = mp->get_rot_phi() ;
206 
207  // r, theta, phi, X, Y and Z on the Arrival mapping
208  // update of the corresponding Coord's if necessary
209 
210  if ( (mp->r).c == 0x0 ) (mp->r).fait() ;
211  if ( (mp->tet).c == 0x0 ) (mp->tet).fait() ;
212  if ( (mp->phi).c == 0x0 ) (mp->phi).fait() ;
213  if ( (mp->xa).c == 0x0 ) (mp->xa).fait() ;
214  if ( (mp->ya).c == 0x0 ) (mp->ya).fait() ;
215  if ( (mp->za).c == 0x0 ) (mp->za).fait() ;
216 
217  const Mtbl* mr_a = (mp->r).c ;
218  const Mtbl* mtet_a = (mp->tet).c ;
219  const Mtbl* mphi_a = (mp->phi).c ;
220  const Mtbl* mxa_a = (mp->xa).c ;
221  const Mtbl* mya_a = (mp->ya).c ;
222  const Mtbl* mza_a = (mp->za).c ;
223 
224  Param par_precis ; // Required precision in the method Map::val_lx
225  int nitermax = 100 ; // Maximum number of iteration in the secant method
226  int niter ;
227  double precis = 1e-15 ; // Absolute precision in the secant method
228  par_precis.add_int(nitermax) ;
229  par_precis.add_int_mod(niter) ;
230  par_precis.add_double(precis) ;
231 
232 
233  // Loop of the Arrival domains where the computation is to be performed
234  // --------------------------------------------------------------------
235 
236  for (int l=0; l < nzet; l++) {
237 
238  int nr = mg_a->get_nr(l) ;
239  int nt = mg_a->get_nt(l) ;
240  int np = mg_a->get_np(l) ;
241 
242 
243  const double* pr_a = mr_a->t[l]->t ; // Pointer on the values of r
244  const double* ptet_a = mtet_a->t[l]->t ; // Pointer on the values of theta
245  const double* pphi_a = mphi_a->t[l]->t ; // Pointer on the values of phi
246  const double* pxa_a = mxa_a->t[l]->t ; // Pointer on the values of X
247  const double* pya_a = mya_a->t[l]->t ; // Pointer on the values of Y
248  const double* pza_a = mza_a->t[l]->t ; // Pointer on the values of Z
249 
250  (va.c->t[l])->set_etat_qcq() ; // Allocates the array of double to
251  // store the result
252  double* ptx = (va.c->t[l])->t ; // Pointer on the allocated array
253 
254 
255  // Loop on all the grid points in the considered arrival domain:
256 
257  for (int k=0 ; k<np ; k++) {
258  for (int j=0 ; j<nt ; j++) {
259  for (int i=0 ; i<nr ; i++) {
260 
261  double r = *pr_a ;
262  double rd, tetd, phid ;
263  if (r == __infinity) {
264  rd = r ;
265  tetd = *ptet_a ;
266  phid = *pphi_a + rot_phi_a - rot_phi_d ;
267  if (phid < 0) phid += 2*M_PI ;
268  }
269  else {
270  // Coordinates in a Cartesian frame centered on
271  // the Departure mapping and whose axes are
272  // parallel to those of the Absolue Frame
273  double xd = *pxa_a - xo_d ;
274  double yd = *pya_a - yo_d ;
275  double zd = *pza_a - zo_d ;
276 
277  // Spherical coordinates on the Departure mapping
278  double rhod2 = xd*xd + yd*yd ;
279  double rhod = sqrt( rhod2 ) ;
280  rd = sqrt(rhod2 + zd*zd) ;
281  tetd = atan2(rhod, zd) ;
282  phid = atan2(yd, xd) - rot_phi_d ; // (rotation)
283  if (phid < 0) phid += 2*M_PI ;
284  }
285 
286 
287  // NB: to increase the efficiency, the method Cmp::val_point
288  // is not invoked; the method Mtbl_cf::val_point is
289  // called directly instead.
290 
291  // Value of the grid coordinates (l,xi) corresponding to
292  // (rd,tetd,phid) :
293 
294  int ld ; // domain index
295  double xxd ; // radial coordinate xi in [0,1] or [-1,1]
296  mp_d->val_lx(rd, tetd, phid, par_precis, ld, xxd) ;
297 
298  // Value of the Departure Cmp at the obtained point:
299  *ptx = va_d.c_cf->val_point(ld, xxd, tetd, phid) ;
300 
301  // Next point :
302  ptx++ ;
303  pr_a++ ;
304  ptet_a++ ;
305  pphi_a++ ;
306  pxa_a++ ;
307  pya_a++ ;
308  pza_a++ ;
309 
310  }
311  }
312  }
313 
314 
315  } // End of the loop on the Arrival domains
316 
317  // In the remaining domains, *this is set to zero:
318  // ----------------------------------------------
319 
320  if (nzet < nz_a) {
321  annule(nzet, nz_a - 1) ;
322  }
323 
324  // Treatment of dzpuis
325  // -------------------
326 
327 
328  set_dzpuis(0) ;
329 
330 }
331 
332 
333  //-----------------------------------------//
334  // Case of Cartesian axis anti-aligned //
335  //-----------------------------------------//
336 
337 
338 void Cmp::import_anti(int nzet, const Cmp& cm_d) {
339 
340  // Trivial case : null Cmp
341  // ------------------------
342 
343  if (cm_d.etat == ETATZERO) {
344  set_etat_zero() ;
345  return ;
346  }
347 
348  const Map* mp_d = cm_d.mp ; // Departure mapping
349 
350  // Protections
351  // -----------
352  int align = (mp->get_bvect_cart()).get_align() ;
353 
354  assert( align * (mp_d->get_bvect_cart()).get_align() == -1 ) ;
355 
356  assert(cm_d.etat == ETATQCQ) ;
357 
358  if (cm_d.dzpuis != 0) {
359  cout <<
360  "Cmp::import : the dzpuis of the Cmp to be imported must be zero !"
361  << endl ;
362  abort() ;
363  }
364 
365 
366  const Mg3d* mg_a = mp->get_mg() ;
367  int nz_a = mg_a->get_nzone() ;
368  assert(nzet <= nz_a) ;
369 
370  const Valeur& va_d = cm_d.va ;
371  va_d.coef() ; // The coefficients are required
372 
373 
374  // Preparations for storing the result in *this
375  // --------------------------------------------
376  del_t() ; // delete all previously computed derived quantities
377 
378  set_etat_qcq() ; // Set the state to ETATQCQ
379 
380  va.set_etat_c_qcq() ; // Allocates the memory for the Mtbl va.c
381  // if it does not exist already
382  va.c->set_etat_qcq() ; // Allocates the memory for the Tbl's in each
383  // domain if they do not exist already
384 
385 
386  // Departure (x,y,z) coordinates of the origin of the Arrival mapping :
387 
388  double xx_a, yy_a, zz_a ;
389  if (align == 1) {
390  xx_a = mp_d->get_ori_x() - mp->get_ori_x() ;
391  yy_a = mp_d->get_ori_y() - mp->get_ori_y() ;
392  }
393  else {
394  xx_a = mp->get_ori_x() - mp_d->get_ori_x() ;
395  yy_a = mp->get_ori_y() - mp_d->get_ori_y() ;
396  }
397  zz_a = mp->get_ori_z() - mp_d->get_ori_z() ;
398 
399 
400  // r, theta, phi, x, y and z on the Arrival mapping
401  // update of the corresponding Coord's if necessary
402 
403  if ( (mp->r).c == 0x0 ) (mp->r).fait() ;
404  if ( (mp->tet).c == 0x0 ) (mp->tet).fait() ;
405  if ( (mp->phi).c == 0x0 ) (mp->phi).fait() ;
406  if ( (mp->x).c == 0x0 ) (mp->x).fait() ;
407  if ( (mp->y).c == 0x0 ) (mp->y).fait() ;
408  if ( (mp->z).c == 0x0 ) (mp->z).fait() ;
409 
410  const Mtbl* mr_a = (mp->r).c ;
411  const Mtbl* mtet_a = (mp->tet).c ;
412  const Mtbl* mphi_a = (mp->phi).c ;
413  const Mtbl* mx_a = (mp->x).c ;
414  const Mtbl* my_a = (mp->y).c ;
415  const Mtbl* mz_a = (mp->z).c ;
416 
417  Param par_precis ; // Required precision in the method Map::val_lx
418  int nitermax = 100 ; // Maximum number of iteration in the secant method
419  int niter ;
420  double precis = 1e-15 ; // Absolute precision in the secant method
421  par_precis.add_int(nitermax) ;
422  par_precis.add_int_mod(niter) ;
423  par_precis.add_double(precis) ;
424 
425 
426  // Loop of the Arrival domains where the computation is to be performed
427  // --------------------------------------------------------------------
428 
429  for (int l=0; l < nzet; l++) {
430 
431  int nr = mg_a->get_nr(l) ;
432  int nt = mg_a->get_nt(l) ;
433  int np = mg_a->get_np(l) ;
434 
435 
436  const double* pr_a = mr_a->t[l]->t ; // Pointer on the values of r
437  const double* ptet_a = mtet_a->t[l]->t ; // Pointer on the values of theta
438  const double* pphi_a = mphi_a->t[l]->t ; // Pointer on the values of phi
439  const double* px_a = mx_a->t[l]->t ; // Pointer on the values of X
440  const double* py_a = my_a->t[l]->t ; // Pointer on the values of Y
441  const double* pz_a = mz_a->t[l]->t ; // Pointer on the values of Z
442 
443  (va.c->t[l])->set_etat_qcq() ; // Allocates the array of double to
444  // store the result
445  double* ptx = (va.c->t[l])->t ; // Pointer on the allocated array
446 
447 
448  // Loop on all the grid points in the considered arrival domain:
449 
450  for (int k=0 ; k<np ; k++) {
451  for (int j=0 ; j<nt ; j++) {
452  for (int i=0 ; i<nr ; i++) {
453 
454  double r = *pr_a ;
455  double rd, tetd, phid ;
456  if (r == __infinity) {
457  rd = r ;
458  tetd = *ptet_a ;
459  phid = *pphi_a + M_PI ;
460  if (phid < 0) phid += 2*M_PI ;
461  }
462  else {
463 
464  // Cartesian coordinates on the Departure mapping
465  double xd = - *px_a + xx_a ;
466  double yd = - *py_a + yy_a ;
467  double zd = *pz_a + zz_a ;
468 
469  // Spherical coordinates on the Departure mapping
470  double rhod2 = xd*xd + yd*yd ;
471  double rhod = sqrt( rhod2 ) ;
472  rd = sqrt(rhod2 + zd*zd) ;
473  tetd = atan2(rhod, zd) ;
474  phid = atan2(yd, xd) ;
475  if (phid < 0) phid += 2*M_PI ;
476  }
477 
478 
479  // NB: to increase the efficiency, the method Cmp::val_point
480  // is not invoked; the method Mtbl_cf::val_point is
481  // called directly instead.
482 
483  // Value of the grid coordinates (l,xi) corresponding to
484  // (rd,tetd,phid) :
485 
486  int ld ; // domain index
487  double xxd ; // radial coordinate xi in [0,1] or [-1,1]
488  mp_d->val_lx(rd, tetd, phid, par_precis, ld, xxd) ;
489 
490  // Value of the Departure Cmp at the obtained point:
491  *ptx = va_d.c_cf->val_point(ld, xxd, tetd, phid) ;
492 
493  // Next point :
494  ptx++ ;
495  pr_a++ ;
496  ptet_a++ ;
497  pphi_a++ ;
498  px_a++ ;
499  py_a++ ;
500  pz_a++ ;
501 
502  }
503  }
504  }
505 
506 
507  } // End of the loop on the Arrival domains
508 
509  // In the remaining domains, *this is set to zero:
510  // ----------------------------------------------
511 
512  if (nzet < nz_a) {
513  annule(nzet, nz_a - 1) ;
514  }
515 
516  // Treatment of dzpuis
517  // -------------------
518 
519 
520  set_dzpuis(0) ;
521 
522 }
523 
524 
525  //-------------------------------------//
526  // Case of aligned Cartesian axis //
527  //-------------------------------------//
528 
529 
530 void Cmp::import_align(int nzet, const Cmp& cm_d) {
531 
532  // Trivial case : null Cmp
533  // ------------------------
534 
535  if (cm_d.etat == ETATZERO) {
536  set_etat_zero() ;
537  return ;
538  }
539 
540  const Map* mp_d = cm_d.mp ; // Departure mapping
541 
542  // Protections
543  // -----------
544  int align = (mp->get_bvect_cart()).get_align() ;
545 
546  assert( align * (mp_d->get_bvect_cart()).get_align() == 1 ) ;
547 
548  assert(cm_d.etat == ETATQCQ) ;
549 
550  if (cm_d.dzpuis != 0) {
551  cout <<
552  "Cmp::import : the dzpuis of the Cmp to be imported must be zero !"
553  << endl ;
554  abort() ;
555  }
556 
557 
558  const Mg3d* mg_a = mp->get_mg() ;
559  int nz_a = mg_a->get_nzone() ;
560  assert(nzet <= nz_a) ;
561 
562  const Valeur& va_d = cm_d.va ;
563  va_d.coef() ; // The coefficients are required
564 
565 
566  // Preparations for storing the result in *this
567  // --------------------------------------------
568  del_t() ; // delete all previously computed derived quantities
569 
570  set_etat_qcq() ; // Set the state to ETATQCQ
571 
572  va.set_etat_c_qcq() ; // Allocates the memory for the Mtbl va.c
573  // if it does not exist already
574  va.c->set_etat_qcq() ; // Allocates the memory for the Tbl's in each
575  // domain if they do not exist already
576 
577 
578  // Departure (x,y,z) coordinates of the origin of the Arrival mapping :
579 
580  double xx_a, yy_a, zz_a ;
581  if (align == 1) {
582  xx_a = mp->get_ori_x() - mp_d->get_ori_x() ;
583  yy_a = mp->get_ori_y() - mp_d->get_ori_y() ;
584  }
585  else {
586  xx_a = mp_d->get_ori_x() - mp->get_ori_x() ;
587  yy_a = mp_d->get_ori_y() - mp->get_ori_y() ;
588  }
589  zz_a = mp->get_ori_z() - mp_d->get_ori_z() ;
590 
591 
592  // r, theta, phi, x, y and z on the Arrival mapping
593  // update of the corresponding Coord's if necessary
594 
595  if ( (mp->r).c == 0x0 ) (mp->r).fait() ;
596  if ( (mp->tet).c == 0x0 ) (mp->tet).fait() ;
597  if ( (mp->phi).c == 0x0 ) (mp->phi).fait() ;
598  if ( (mp->x).c == 0x0 ) (mp->x).fait() ;
599  if ( (mp->y).c == 0x0 ) (mp->y).fait() ;
600  if ( (mp->z).c == 0x0 ) (mp->z).fait() ;
601 
602  const Mtbl* mr_a = (mp->r).c ;
603  const Mtbl* mtet_a = (mp->tet).c ;
604  const Mtbl* mphi_a = (mp->phi).c ;
605  const Mtbl* mx_a = (mp->x).c ;
606  const Mtbl* my_a = (mp->y).c ;
607  const Mtbl* mz_a = (mp->z).c ;
608 
609  Param par_precis ; // Required precision in the method Map::val_lx
610  int nitermax = 100 ; // Maximum number of iteration in the secant method
611  int niter ;
612  double precis = 1e-15 ; // Absolute precision in the secant method
613  par_precis.add_int(nitermax) ;
614  par_precis.add_int_mod(niter) ;
615  par_precis.add_double(precis) ;
616 
617 
618  // Loop of the Arrival domains where the computation is to be performed
619  // --------------------------------------------------------------------
620 
621  for (int l=0; l < nzet; l++) {
622 
623  int nr = mg_a->get_nr(l) ;
624  int nt = mg_a->get_nt(l) ;
625  int np = mg_a->get_np(l) ;
626 
627 
628  const double* pr_a = mr_a->t[l]->t ; // Pointer on the values of r
629  const double* ptet_a = mtet_a->t[l]->t ; // Pointer on the values of theta
630  const double* pphi_a = mphi_a->t[l]->t ; // Pointer on the values of phi
631  const double* px_a = mx_a->t[l]->t ; // Pointer on the values of X
632  const double* py_a = my_a->t[l]->t ; // Pointer on the values of Y
633  const double* pz_a = mz_a->t[l]->t ; // Pointer on the values of Z
634 
635  (va.c->t[l])->set_etat_qcq() ; // Allocates the array of double to
636  // store the result
637  double* ptx = (va.c->t[l])->t ; // Pointer on the allocated array
638 
639 
640  // Loop on all the grid points in the considered arrival domain:
641 
642  for (int k=0 ; k<np ; k++) {
643  for (int j=0 ; j<nt ; j++) {
644  for (int i=0 ; i<nr ; i++) {
645 
646  double r = *pr_a ;
647  double rd, tetd, phid ;
648  if (r == __infinity) {
649  rd = r ;
650  tetd = *ptet_a ;
651  phid = *pphi_a ;
652  }
653  else {
654 
655  // Cartesian coordinates on the Departure mapping
656  double xd = *px_a + xx_a ;
657  double yd = *py_a + yy_a ;
658  double zd = *pz_a + zz_a ;
659 
660  // Spherical coordinates on the Departure mapping
661  double rhod2 = xd*xd + yd*yd ;
662  double rhod = sqrt( rhod2 ) ;
663  rd = sqrt(rhod2 + zd*zd) ;
664  tetd = atan2(rhod, zd) ;
665  phid = atan2(yd, xd) ;
666  if (phid < 0) phid += 2*M_PI ;
667  }
668 
669 
670  // NB: to increase the efficiency, the method Cmp::val_point
671  // is not invoked; the method Mtbl_cf::val_point is
672  // called directly instead.
673 
674  // Value of the grid coordinates (l,xi) corresponding to
675  // (rd,tetd,phid) :
676 
677  int ld ; // domain index
678  double xxd ; // radial coordinate xi in [0,1] or [-1,1]
679  mp_d->val_lx(rd, tetd, phid, par_precis, ld, xxd) ;
680 
681  // Value of the Departure Cmp at the obtained point:
682  *ptx = va_d.c_cf->val_point(ld, xxd, tetd, phid) ;
683 
684  // Next point :
685  ptx++ ;
686  pr_a++ ;
687  ptet_a++ ;
688  pphi_a++ ;
689  px_a++ ;
690  py_a++ ;
691  pz_a++ ;
692 
693  }
694  }
695  }
696 
697 
698  } // End of the loop on the Arrival domains
699 
700  // In the remaining domains, *this is set to zero:
701  // ----------------------------------------------
702 
703  if (nzet < nz_a) {
704  annule(nzet, nz_a - 1) ;
705  }
706 
707  // Treatment of dzpuis
708  // -------------------
709 
710 
711  set_dzpuis(0) ;
712 
713 }
714 }
Coord xa
Absolute x coordinate.
Definition: map.h:742
void del_t()
Logical destructor.
Definition: cmp.C:262
Mtbl_cf * c_cf
Coefficients of the spectral expansion of the function.
Definition: valeur.h:312
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Definition: cmp.h:446
void add_int(const int &n, int position=0)
Adds the address of a new int to the list.
Definition: param.C:249
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
Definition: grilles.h:479
void coef() const
Computes the coeffcients of *this.
Definition: valeur_coef.C:151
Cmp sqrt(const Cmp &)
Square root.
Definition: cmp_math.C:223
void import_align(int nzet, const Cmp &ci)
Assignment to another Cmp defined on a different mapping, when the two mappings have aligned Cartesia...
Definition: cmp_import.C:530
void annule(int l)
Sets the Cmp to zero in a given domain.
Definition: cmp.C:351
Multi-domain array.
Definition: mtbl.h:118
double get_ori_y() const
Returns the y coordinate of the origin.
Definition: map.h:782
Lorene prototypes.
Definition: app_hor.h:67
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
Definition: map.h:777
void import_anti(int nzet, const Cmp &ci)
Assignment to another Cmp defined on a different mapping, when the two mappings have anti-aligned Car...
Definition: cmp_import.C:338
int etat
Logical state (ETATNONDEF , ETATQCQ or ETATZERO ).
Definition: cmp.h:454
Base class for coordinate mappings.
Definition: map.h:682
double get_ori_x() const
Returns the x coordinate of the origin.
Definition: map.h:780
Values and coefficients of a (real-value) function.
Definition: valeur.h:297
double get_rot_phi() const
Returns the angle between the x –axis and X –axis.
Definition: map.h:787
Coord tet
coordinate centered on the grid
Definition: map.h:731
Coord phi
coordinate centered on the grid
Definition: map.h:732
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
Definition: cmp.C:292
int dzpuis
Power of r by which the quantity represented by this must be divided in the external compactified zo...
Definition: cmp.h:461
double * t
The array of double.
Definition: tbl.h:176
void import_gal(int nzet, const Cmp &ci)
Assignment to another Cmp defined on a different mapping, when the two mappings do not have a particu...
Definition: cmp_import.C:139
Mtbl * c
Values of the function at the points of the multi-grid.
Definition: valeur.h:309
Parameter storage.
Definition: param.h:125
int get_nzone() const
Returns the number of domains.
Definition: grilles.h:465
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Definition: cmp.C:307
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Definition: mtbl.C:302
double val_point(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 ...
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
Definition: grilles.h:469
Coord ya
Absolute y coordinate.
Definition: map.h:743
Multi-domain grid.
Definition: grilles.h:279
const Map * mp
Reference mapping.
Definition: cmp.h:451
const Base_vect_cart & get_bvect_cart() const
Returns the Cartesian basis associated with the coordinates (x,y,z) of the mapping, i.e.
Definition: map.h:803
Coord y
y coordinate centered on the grid
Definition: map.h:739
Coord za
Absolute z coordinate.
Definition: map.h:744
void add_double(const double &x, int position=0)
Adds the the address of a new double to the list.
Definition: param.C:318
Coord x
x coordinate centered on the grid
Definition: map.h:738
void set_etat_c_qcq()
Sets the logical state to ETATQCQ (ordinary state) for values in the configuration space (Mtbl c )...
Definition: valeur.C:704
double get_ori_z() const
Returns the z coordinate of the origin.
Definition: map.h:784
void set_dzpuis(int)
Set a value to dzpuis.
Definition: cmp.C:657
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
Definition: grilles.h:474
void import(const Cmp &ci)
Assignment to another Cmp defined on a different mapping.
Definition: cmp_import.C:76
Tbl ** t
Array (size nzone ) of pointers on the Tbl &#39;s.
Definition: mtbl.h:132
Coord z
z coordinate centered on the grid
Definition: map.h:740
Valeur va
The numerical value of the Cmp.
Definition: cmp.h:464
void add_int_mod(int &n, int position=0)
Adds the address of a new modifiable int to the list.
Definition: param.C:388
Coord r
r coordinate centered on the grid
Definition: map.h:730
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...