LORENE
map_radial_r_manip.C
1 /*
2  * Member functions of the class Map_radial for various r manipulations
3  * of the Scalar's.
4  */
5 
6 /*
7  * Copyright (c) 1999-2003 Eric Gourgoulhon
8  * Copyright (c) 2000-2001 Philippe Grandclement
9  * Copyright (c) 2001 Jerome Novak
10  *
11  * This file is part of LORENE.
12  *
13  * LORENE is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 2 of the License, or
16  * (at your option) any later version.
17  *
18  * LORENE is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with LORENE; if not, write to the Free Software
25  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26  *
27  */
28 
29 
30 
31 
32 /*
33  * $Id: map_radial_r_manip.C,v 1.13 2016/12/05 16:17:58 j_novak Exp $
34  * $Log: map_radial_r_manip.C,v $
35  * Revision 1.13 2016/12/05 16:17:58 j_novak
36  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
37  *
38  * Revision 1.12 2014/10/13 08:53:06 j_novak
39  * Lorene classes and functions now belong to the namespace Lorene.
40  *
41  * Revision 1.11 2005/05/25 16:11:04 j_novak
42  * Better handling of the case with no compactified domain.
43  *
44  * Revision 1.10 2004/10/11 15:09:03 j_novak
45  * The radial manipulation functions take Scalar as arguments, instead of Cmp.
46  * Added a conversion operator from Scalar to Cmp.
47  * The Cmp radial manipulation function make conversion to Scalar, call to the
48  * Map_radial version with a Scalar argument and back.
49  *
50  * Revision 1.9 2004/10/08 13:34:37 j_novak
51  * Scalar::div_r() does not need to pass through Cmp version anymore.
52  *
53  * Revision 1.8 2004/01/28 10:35:52 j_novak
54  * Added new methods mult_r() for Scalars. These do not change the dzpuis flag.
55  *
56  * Revision 1.7 2004/01/27 09:33:48 j_novak
57  * New method Map_radial::div_r_zec
58  *
59  * Revision 1.6 2003/11/04 23:00:16 e_gourgoulhon
60  * Method div_tant is now defined in file map_radial_th_manip.C.
61  *
62  * Revision 1.5 2003/10/27 09:02:19 j_novak
63  * Corrected a bug in the case of null CED
64  *
65  * Revision 1.4 2003/10/17 15:07:29 j_novak
66  * The order of operations in div_tant() has been changed.
67  *
68  * Revision 1.3 2003/10/15 10:41:49 e_gourgoulhon
69  * Added new method div_tant.
70  *
71  * Revision 1.2 2002/08/13 08:02:45 j_novak
72  * Handling of spherical vector/tensor components added in the classes
73  * Mg3d and Tenseur. Minor corrections for the class Metconf.
74  *
75  * Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon
76  * LORENE
77  *
78  * Revision 1.17 2001/10/29 15:34:35 novak
79  * Ajout de Map_radial::div_r
80  *
81  * Revision 1.16 2000/08/31 14:19:26 eric
82  * *** empty log message ***
83  *
84  * Revision 1.15 2000/08/31 13:04:05 eric
85  * Ajout de la fonction mult_rsint.
86  * Reecriture de div_rsint.
87  *
88  * Revision 1.14 2000/08/31 11:45:19 eric
89  * Suppression de assert (!((ci_ext.check_dzpuis(0)))) dans
90  * Map_radial::mult_r
91  *
92  * Revision 1.13 2000/07/20 14:21:27 eric
93  * Ajout de la fonction div_rsint.
94  *
95  * Revision 1.12 2000/05/22 15:12:27 phil
96  * *** empty log message ***
97  *
98  * Revision 1.11 2000/05/22 14:55:47 phil
99  * la fonction mult_r se contente de changer le dzpuis sans faire d'operation !
100  * /.
101  *
102  * Revision 1.10 2000/05/22 14:39:28 phil
103  * ajout de inc_dzpuis et dec_dzpuis
104  *
105  * Revision 1.9 2000/03/31 13:25:12 eric
106  * *** empty log message ***
107  *
108  * Revision 1.8 2000/03/31 13:11:08 eric
109  * Map_radial::mult_r : traitement ameliore dans la ZEC.
110  *
111  * Revision 1.7 1999/12/02 11:27:34 eric
112  * *** empty log message ***
113  *
114  * Revision 1.6 1999/12/02 11:04:05 eric
115  * Reorganisation complete de la routine mult_r.
116  * Appel de Valeur::mult_x().
117  *
118  * Revision 1.5 1999/11/30 16:26:26 eric
119  * *** empty log message ***
120  *
121  * Revision 1.4 1999/11/30 15:48:20 eric
122  * *** empty log message ***
123  *
124  * Revision 1.3 1999/11/30 15:31:06 eric
125  * *** empty log message ***
126  *
127  * Revision 1.2 1999/11/30 15:15:02 eric
128  * *** empty log message ***
129  *
130  * Revision 1.1 1999/11/30 14:22:50 eric
131  * Initial revision
132  *
133  *
134  * $Header: /cvsroot/Lorene/C++/Source/Map/map_radial_r_manip.C,v 1.13 2016/12/05 16:17:58 j_novak Exp $
135  *
136  */
137 
138 #include "cmp.h"
139 #include "tensor.h"
140 
141 
142  //---------------------------//
143  // mult_r //
144  //---------------------------//
145 
146 namespace Lorene {
147 void Map_radial::mult_r(Scalar& uu) const {
148 
149  // Verifications d'usage :
150  assert(uu.get_etat() != ETATNONDEF) ;
151 
152  // Nothing to do if the Scalar is null :
153  if (uu.get_etat() == ETATZERO) {
154  return ;
155  }
156 
157  assert((uu.get_etat() == ETATQCQ)||(uu.get_etat() == ETATUN)) ;
158 
159  uu.set_etat_qcq() ;
160 
161  int nz = mg->get_nzone() ;
162  int nzm1 = nz-1 ;
163 
164 
165  if (mg->get_type_r(nzm1) == UNSURR) { // Case with ZEC
166  // -------------
167 
168  // Decomposition inner domains / external domain :
169  // ----------------------------------------------
170 
171  Scalar uu_ext = uu ;
172  uu_ext.annule(0, nzm1-1) ;
173 
174  uu.annule_domain(nzm1) ;
175 
176  // Inner domains: multiplication by r :
177  // ----------------------------------
178  //Confort :
179  Valeur& val = uu.set_spectral_va() ;
180  assert(val.get_mg() == mg) ;
181 
182  val = val.mult_x() ; // Multiplication by xi in the nucleus
183  // Identity in the shells
184 
185  Base_val sauve_base = val.base ;
186  val = val / xsr ; // R/xi in the nucleus
187  // R in the shells
188  val.base = sauve_base ;
189 
190  // External domain
191  // ---------------
192 
193  Valeur& val_ext = uu_ext.set_spectral_va() ;
194  val_ext.sxm1_zec() ; // division par (x-1) dans l'espace des coefs.
195 
196  sauve_base = val_ext.base ;
197  val_ext = xsr * val_ext ;
198  val_ext.base = sauve_base ;
199 
200  // Recombination
201  // -------------
202 
203  uu = uu + uu_ext ;
204 
205  }
206  else{ // Case without ZEC
207  //-----------------
208  Valeur& val = uu.set_spectral_va() ;
209  val = val.mult_x() ; // Multiplication by xi in the nucleus
210  // Identity in the shells
211 
212  Base_val sauve_base = val.base ;
213  val = val / xsr ; // R/xi in the nucleus
214  // R in the shells
215  val.base = sauve_base ;
216  }
217 
218 
219 }
220 
221 
222 void Map_radial::mult_r(Cmp& ci) const {
223 
224  // Verifications d'usage :
225  assert(ci.get_etat() != ETATNONDEF) ;
226 
227  // Nothing to do if the Cmp is null :
228  if (ci.get_etat() == ETATZERO) {
229  return ;
230  }
231 
232  assert(ci.get_etat() == ETATQCQ) ;
233 
234  int nz = mg->get_nzone() ;
235  int nzm1 = nz-1 ;
236 
237 
238  if (mg->get_type_r(nzm1) == UNSURR) { // Case with ZEC
239  // -------------
240 
241  // Decomposition inner domains / external domain :
242  // ----------------------------------------------
243 
244  Cmp ci_ext = ci ;
245  ci_ext.annule(0, nzm1-1) ;
246 
247  ci.annule(nzm1) ;
248 
249  // Inner domains: multiplication by r :
250  // ----------------------------------
251  //Confort :
252  Valeur& val = ci.va ;
253  assert(val.get_mg() == mg) ;
254 
255  val = val.mult_x() ; // Multiplication by xi in the nucleus
256  // Identity in the shells
257 
258  Base_val sauve_base = val.base ;
259  val = val / xsr ; // R/xi in the nucleus
260  // R in the shells
261  val.base = sauve_base ;
262 
263  // External domain
264  // ---------------
265 
266  // On change juste le dzpuis !
267 
268  //## assert (!((ci_ext.check_dzpuis(0)))) ;
269  // On fait just dec_dzpuis ...
270  ci_ext.set_dzpuis (ci.get_dzpuis()-1) ;
271 
272  // Recombination
273  // -------------
274 
275  ci = ci + ci_ext ;
276 
277  }
278  else{ // Case without ZEC
279  //-----------------
280  Valeur& uu = ci.va ;
281  uu = uu.mult_x() ; // Multiplication by xi in the nucleus
282  // Identity in the shells
283 
284  Base_val sauve_base = uu.base ;
285  uu = uu / xsr ; // R/xi in the nucleus
286  // R in the shells
287  uu.base = sauve_base ;
288  }
289 
290 
291 }
292 
293 
294 
295  //---------------------------//
296  // mult_r_zec //
297  //---------------------------//
298 
300 
301  // Verifications d'usage :
302  assert(ci.get_etat() != ETATNONDEF) ;
303 
304  // Nothing to do if the Scalar is null :
305  if (ci.get_etat() == ETATZERO) {
306  return ;
307  }
308 
309  assert((ci.get_etat() == ETATQCQ)||(ci.get_etat() == ETATUN)) ;
310 
311  ci.set_etat_qcq() ;
312 
313  //Confort :
314  Valeur& uu = ci.set_spectral_va() ;
315  assert(uu.get_mg() == mg) ;
316 
317  int nz = mg->get_nzone() ;
318  int nzm1 = nz-1 ;
319 
320 
321  if (mg->get_type_r(nzm1) == UNSURR) { // Case with ZEC
322  // -------------
323 
324  // On stocke tout sauf la ZEC
325 
326  Valeur val = uu ;
327  val.annule(nzm1) ;
328 
329  // On ne travaile que sur la ZEC :
330 
331  Valeur val_ext = uu ;
332  val_ext.annule(0, nzm1-1) ;
333 
334  val_ext.sxm1_zec() ; // division par (x-1) dans l'espace des coefs.
335 
336  Base_val sauve_base = val_ext.base ;
337  val_ext = xsr * val_ext ;
338  val_ext.base = sauve_base ;
339 
340  // Et on reconstruit le resultat ...
341  uu = val + val_ext ;
342 
343  }
344  else{ // Case without ZEC
345  //-----------------
346 
347  return ;
348 
349  }
350 
351 
352 }
353 
354  //---------------------------//
355  // mult_rsint //
356  //---------------------------//
357 
359 
360  assert(ci.get_etat() != ETATNONDEF) ;
361 
362  if (ci.get_etat() == ETATZERO) {
363  return ; // Nothing to do if the Scalar is null
364  }
365 
366  assert((ci.get_etat() == ETATQCQ)||(ci.get_etat() == ETATUN)) ;
367 
368  ci.set_etat_qcq() ;
369 
370  Valeur& val = ci.set_spectral_va() ;
371  assert(val.get_mg() == mg) ;
372 
373  int nz = mg->get_nzone() ;
374  int nzm1 = nz-1 ;
375 
376  // 1/ Multiplication by sin(theta)
377  // -------------------------------
378 
379  val = val.mult_st() ; // Multiplication by sin(theta)
380 
381  // 2/ Multiplication by r
382  // ----------------------
383 
384  Scalar ci_ext(*this) ;
385 
386  if (mg->get_type_r(nzm1) == UNSURR) { // Case with ZEC
387  // -------------
388  // Decomposition inner domains / external domain :
389  // ----------------------------------------------
390 
391  ci_ext = ci ;
392  ci_ext.annule(0, nzm1-1) ;
393  ci.annule_domain(nzm1) ;
394 
395  // External domain
396  // ---------------
397  Valeur& val_ext = ci_ext.set_spectral_va() ;
398  assert(val_ext.get_mg() == mg) ;
399 
400  val_ext.sxm1_zec() ; // Division by (xi-1)
401 
402  Base_val sauve_base = val_ext.base ;
403  val_ext = val_ext * xsr ; // Multiplication by R(xi-1)
404  val_ext.base = sauve_base ;
405 
406  }
407  else{ // Case without ZEC
408  //-----------------
409 
410  ci_ext = 0 ;
411 
412  }
413 
414  // Inner domains:
415  // -------------
416  val = val.mult_x() ; // Multiplication by xi in the nucleus
417  // Identity in the shells
418 
419  Base_val sauve_base = val.base ;
420  val = val / xsr ; // Multiplication by R/xi in the nucleus
421  // R in the shells
422  val.base = sauve_base ;
423 
424  // Recombination
425  // -------------
426 
427  ci = ci + ci_ext ;
428 
429 }
430 
431 
432 
433  //---------------------------//
434  // div_rsint //
435  //---------------------------//
436 
437 void Map_radial::div_rsint(Scalar& ci) const {
438 
439  assert(ci.get_etat() != ETATNONDEF) ;
440 
441  if (ci.get_etat() == ETATZERO) {
442  return ; // Nothing to do if the Scalar is null
443  }
444 
445  assert((ci.get_etat() == ETATQCQ)||(ci.get_etat() == ETATUN)) ;
446 
447  ci.set_etat_qcq() ;
448 
449  Valeur& val = ci.set_spectral_va() ;
450  assert(val.get_mg() == mg) ;
451 
452  int nz = mg->get_nzone() ;
453  int nzm1 = nz-1 ;
454 
455  // 1/ Division by sin(theta)
456  // -------------------------
457 
458  val = val.ssint() ; // Division by sin(theta)
459 
460 
461  // 2/ Division by r
462  // ----------------
463 
464  Scalar ci_ext(*this) ;
465 
466  if (mg->get_type_r(nzm1) == UNSURR) { // Case with ZEC
467  // -------------
468 
469  // Decomposition inner domains / external domain :
470  // ----------------------------------------------
471 
472  ci_ext = ci ;
473  ci_ext.annule(0, nzm1-1) ;
474  ci.annule_domain(nzm1) ;
475 
476  // External domain
477  // ---------------
478  Valeur& val_ext = ci_ext.set_spectral_va() ;
479  assert(val_ext.get_mg() == mg) ;
480 
481  val_ext = val_ext.mult_x() ; // Multiplication by (xi-1)
482 
483  Base_val sauve_base = val_ext.base ;
484  val_ext = val_ext / xsr ; // Division by (xi-1)/R
485  val_ext.base = sauve_base ;
486 
487  }
488  else{ // Case without ZEC
489  //-----------------
490 
491  ci_ext = 0 ;
492 
493  }
494 
495  // Inner domains:
496  // -------------
497 
498  val = val.sx() ; // Division by xi in the nucleus
499  // Identity in the shells
500 
501  Base_val sauve_base = val.base ;
502  val = val * xsr ; // Multiplication by xi/R in the nucleus
503  // Multiplication by 1/R in the shells
504  val.base = sauve_base ;
505 
506  // Recombination
507  // -------------
508 
509  ci = ci + ci_ext ;
510 
511 }
512 
513  //---------------------------//
514  // div_r //
515  //---------------------------//
516 
517 void Map_radial::div_r(Scalar& ci) const {
518 
519  assert(ci.get_etat() != ETATNONDEF) ;
520 
521  if (ci.get_etat() == ETATZERO) {
522  return ; // Nothing to do if the Scalar is null
523  }
524 
525  assert((ci.get_etat() == ETATQCQ)||(ci.get_etat() == ETATUN)) ;
526 
527  ci.set_etat_qcq() ;
528 
529  Valeur& val = ci.set_spectral_va() ;
530  assert(val.get_mg() == mg) ;
531 
532  int nz = mg->get_nzone() ;
533  int nzm1 = nz-1 ;
534 
535  Scalar ci_ext(*this) ;
536 
537  if (mg->get_type_r(nzm1) == UNSURR) { // Case with ZEC
538  // -------------
539 
540  // Decomposition inner domains / external domain :
541  // ----------------------------------------------
542 
543  ci_ext = ci ;
544  ci_ext.annule(0, nzm1-1) ;
545  ci.annule_domain(nzm1) ;
546 
547  // External domain
548  // ---------------
549  Valeur& val_ext = ci_ext.set_spectral_va() ;
550  assert(val_ext.get_mg() == mg) ;
551 
552  val_ext = val_ext.mult_x() ; // Multiplication by (xi-1)
553 
554  Base_val sauve_base = val_ext.base ;
555  val_ext = val_ext / xsr ; // Division by (xi-1)/R
556  val_ext.base = sauve_base ;
557 
558  }
559  else{ // Case without ZEC
560  //-----------------
561 
562  ci_ext = 0 ;
563 
564  }
565 
566  // Inner domains:
567  // -------------
568 
569  val = val.sx() ; // Division by xi in the nucleus
570  // Identity in the shells
571 
572  Base_val sauve_base = val.base ;
573  val = val * xsr ; // Multiplication by xi/R in the nucleus
574  // Multiplication by 1/R in the shells
575  val.base = sauve_base ;
576 
577  // Recombination
578  // -------------
579 
580  ci = ci + ci_ext ;
581 
582 }
583 
584  //---------------------------//
585  // div_r_zec //
586  //---------------------------//
587 
588 void Map_radial::div_r_zec(Scalar& uu) const {
589 
590  // Verifications d'usage :
591  assert(uu.get_etat() != ETATNONDEF) ;
592 
593  // Nothing to do if the Scalar is null :
594  if (uu.get_etat() == ETATZERO) {
595  return ;
596  }
597 
598  assert((uu.get_etat() == ETATQCQ)||(uu.get_etat() == ETATUN)) ;
599 
600  uu.set_etat_qcq() ;
601 
602  //Confort :
603  const Valeur& vu = uu.get_spectral_va() ;
604  assert(vu.get_mg() == mg) ;
605 
606  int nz = mg->get_nzone() ;
607  int nzm1 = nz-1 ;
608 
609  if (mg->get_type_r(nzm1) == UNSURR) { // Case with ZEC
610  // -------------
611  // On stocke tout sauf la ZEC
612 
613  Valeur val = vu ;
614  val.annule(nzm1) ;
615 
616  // On ne travaile que sur la ZEC :
617 
618  Valeur val_ext = vu ;
619  val_ext.annule(0, nzm1-1) ;
620 
621  val_ext.mult_xm1_zec() ; // division par (x-1) dans l'espace des coefs.
622 
623  Base_val sauve_base = val_ext.base ;
624  val_ext = val_ext / xsr ;
625  val_ext.base = sauve_base ;
626 
627  // Et on reconstruit le resultat ...
628  uu.set_spectral_va() = val + val_ext ;
629 
630  }
631  else{ // Case without ZEC
632  //-----------------
633 
634  return ;
635 
636  }
637 
638 
639 }
640 
641 
642  //---------------------------//
643  // dec_dzpuis //
644  //---------------------------//
645 
647 
648  // Verifications d'usage :
649  assert(ci.get_etat() != ETATNONDEF) ;
650 
651  int nz = mg->get_nzone() ;
652  int nzm1 = nz-1 ;
653 
654  // Nothing to do if the Scalar is null or if there is no ZEC:
655  if (ci.get_etat() == ETATZERO) {
656  ci.set_dzpuis( ci.get_dzpuis() - 1 ) ;
657  return ;
658  }
659 
660  if (mg->get_type_r(nzm1) != UNSURR)
661  return ;
662 
663  assert((ci.get_etat() == ETATQCQ)||(ci.get_etat() == ETATUN)) ;
664 
665  ci.set_etat_qcq() ;
666 
667  Valeur& uu = ci.set_spectral_va() ;
668  assert(uu.get_mg() == mg) ;
669 
670 
671  // Decomposition inner domains / external domain :
672  // ----------------------------------------------
673  Valeur uu_ext = uu ;
674  uu_ext.annule(0, nzm1-1) ;
675 
676  uu.annule(nzm1) ;
677 
678  // Computation in the external domain (division by r)
679  // ----------------------------------
680 
681  uu_ext.mult_xm1_zec() ; // Multiplication by (xi-1) in the ZEC
682 
683  Base_val sauve_base = uu_ext.base ;
684  uu_ext = uu_ext / xsr ; // u^2/(xi-1) in the ZEC
685  uu_ext.base = sauve_base ;
686 
687  // Final result:
688  // ------------
689  uu = uu + uu_ext ;
690 
691  ci.set_dzpuis( ci.get_dzpuis() - 1 ) ;
692 
693 }
694 
695  //---------------------------//
696  // inc_dzpuis //
697  //---------------------------//
698 
700 
701  // Verifications d'usage :
702  assert(ci.get_etat() != ETATNONDEF) ;
703 
704  int nz = mg->get_nzone() ;
705  int nzm1 = nz-1 ;
706 
707  // Nothing to do if the Scalar is null or if there is no ZEC:
708  if (ci.get_etat() == ETATZERO) {
709  ci.set_dzpuis( ci.get_dzpuis() + 1 ) ;
710  return ;
711  }
712  if (mg->get_type_r(nzm1) != UNSURR) return ;
713 
714  assert((ci.get_etat() == ETATQCQ)||(ci.get_etat() == ETATUN)) ;
715 
716  ci.set_etat_qcq() ;
717 
718  Valeur& uu = ci.set_spectral_va() ;
719  assert(uu.get_mg() == mg) ;
720 
721 
722  // Decomposition inner domains / external domain :
723  // ----------------------------------------------
724  Valeur uu_ext = uu ;
725  uu_ext.annule(0, nzm1-1) ;
726 
727  uu.annule(nzm1) ;
728 
729  // Computation in the external domain (multiplication by r)
730  // ----------------------------------
731 
732  uu_ext.sxm1_zec() ; // Division by (xi-1) in the ZEC
733 
734  Base_val sauve_base = uu_ext.base ;
735  uu_ext = uu_ext * xsr ; // (xi-1)/u in the ZEC
736  uu_ext.base = sauve_base ;
737 
738  // Final result:
739  // ------------
740  uu = uu + uu_ext ;
741 
742  ci.set_dzpuis( ci.get_dzpuis() + 1 ) ;
743 
744 }
745 
746 
747  //---------------------------//
748  // dec2_dzpuis //
749  //---------------------------//
750 
752 
753  // Verifications d'usage :
754  assert(ci.get_etat() != ETATNONDEF) ;
755 
756  int nz = mg->get_nzone() ;
757  int nzm1 = nz-1 ;
758 
759  // Nothing to do if the Scalar is null or if there is no ZEC:
760  if (ci.get_etat() == ETATZERO) {
761  ci.set_dzpuis( ci.get_dzpuis() - 2 ) ;
762  return ;
763  }
764  if (mg->get_type_r(nzm1) != UNSURR) return ;
765 
766  assert((ci.get_etat() == ETATQCQ)||(ci.get_etat() == ETATUN)) ;
767 
768  ci.set_etat_qcq() ;
769 
770  Valeur& uu = ci.set_spectral_va() ;
771  assert(uu.get_mg() == mg) ;
772 
773 
774  // Decomposition inner domains / external domain :
775  // ----------------------------------------------
776  Valeur uu_ext = uu ;
777  uu_ext.annule(0, nzm1-1) ;
778 
779  uu.annule(nzm1) ;
780 
781  // Computation in the external domain (division by r^2)
782  // ----------------------------------
783 
784  uu_ext.mult2_xm1_zec() ; // Multiplication by (xi-1)^2 in the ZEC
785 
786  Base_val sauve_base = uu_ext.base ;
787  uu_ext = uu_ext / (xsr*xsr) ; // u^2/(xi-1)^2 in the ZEC
788  uu_ext.base = sauve_base ;
789 
790  // Final result:
791  // ------------
792  uu = uu + uu_ext ;
793 
794  ci.set_dzpuis( ci.get_dzpuis() - 2 ) ;
795 
796 }
797 
798  //---------------------------//
799  // inc2_dzpuis //
800  //---------------------------//
801 
803 
804  // Verifications d'usage :
805  assert(ci.get_etat() != ETATNONDEF) ;
806 
807  int nz = mg->get_nzone() ;
808  int nzm1 = nz-1 ;
809 
810  // Nothing to do if the Scalar is null or if there is no ZEC:
811  if (ci.get_etat() == ETATZERO) {
812  ci.set_dzpuis( ci.get_dzpuis() + 2 ) ;
813  return ;
814  }
815  if (mg->get_type_r(nzm1) != UNSURR) return ;
816 
817  assert((ci.get_etat() == ETATQCQ)||(ci.get_etat() == ETATUN)) ;
818 
819  ci.set_etat_qcq() ;
820 
821  Valeur& uu = ci.set_spectral_va() ;
822  assert(uu.get_mg() == mg) ;
823 
824 
825  // Decomposition inner domains / external domain :
826  // ----------------------------------------------
827  Valeur uu_ext = uu ;
828  uu_ext.annule(0, nzm1-1) ;
829 
830  uu.annule(nzm1) ;
831 
832  // Computation in the external domain (multiplication by r^2)
833  // ----------------------------------
834 
835  uu_ext.sxm1_zec() ; // Division by (xi-1) in the ZEC
836  uu_ext.sxm1_zec() ; // Division by (xi-1) in the ZEC
837 
838  Base_val sauve_base = uu_ext.base ;
839  uu_ext = uu_ext * (xsr*xsr) ; // (xi-1)^2/u^2 in the ZEC
840  uu_ext.base = sauve_base ;
841 
842  // Final result:
843  // ------------
844  uu = uu + uu_ext ;
845 
846  ci.set_dzpuis( ci.get_dzpuis() + 2 ) ;
847 
848 }
849 
850 }
void annule_domain(int l)
Sets the Tensor to zero in a given domain.
Definition: tensor.C:675
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Definition: cmp.h:446
void annule(int l)
Sets the Cmp to zero in a given domain.
Definition: cmp.C:351
virtual void annule(int l_min, int l_max)
Sets the Scalar to zero in several domains.
Definition: scalar.C:397
Lorene prototypes.
Definition: app_hor.h:67
int get_etat() const
Returns the logical state.
Definition: cmp.h:899
Tensor field of valence 0 (or component of a tensorial field).
Definition: scalar.h:393
virtual void dec_dzpuis(Scalar &) const
Decreases by 1 the value of dzpuis of a Scalar and changes accordingly its values in the compactified...
void mult_xm1_zec()
Applies the following operator to *this : \ Id (r sampling = RARE, FIN ) \ (r -sampling = UNSURR ) ...
const Valeur & sx() const
Returns (r -sampling = RARE ) \ Id (r sampling = FIN ) \ (r -sampling = UNSURR ) ...
Definition: valeur_sx.C:113
virtual void dec2_dzpuis(Scalar &) const
Decreases by 2 the value of dzpuis of a Scalar and changes accordingly its values in the compactifi...
Values and coefficients of a (real-value) function.
Definition: valeur.h:297
virtual void inc_dzpuis(Scalar &) const
Increases by 1 the value of dzpuis of a Scalar and changes accordingly its values in the compactifi...
int get_etat() const
Returns the logical state ETATNONDEF (undefined), ETATZERO (null) or ETATQCQ (ordinary).
Definition: scalar.h:560
void annule(int l)
Sets the Valeur to zero in a given domain.
Definition: valeur.C:747
virtual void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Definition: scalar.C:359
void set_dzpuis(int)
Modifies the dzpuis flag.
Definition: scalar.C:814
const Mg3d * get_mg() const
Returns the Mg3d on which the this is defined.
Definition: valeur.h:763
virtual void div_r(Scalar &) const
Division by r of a Scalar.
const Valeur & mult_x() const
Returns (r -sampling = RARE ) \ Id (r sampling = FIN ) \ (r -sampling = UNSURR ) ...
virtual void mult_r_zec(Scalar &) const
Multiplication by r (in the compactified external domain only) of a Scalar.
const Valeur & ssint() const
Returns of *this.
Definition: valeur_ssint.C:115
virtual void div_rsint(Scalar &) const
Division by of a Scalar.
Base_val base
Bases on which the spectral expansion is performed.
Definition: valeur.h:315
int get_dzpuis() const
Returns dzpuis.
Definition: scalar.h:563
int get_nzone() const
Returns the number of domains.
Definition: grilles.h:465
const Valeur & mult_st() const
Returns applied to *this.
Coord xsr
in the nucleus; \ 1/R in the non-compactified shells; \ in the compactified outer domain...
Definition: map.h:1570
virtual void mult_r(Scalar &uu) const
Multiplication by r of a Scalar, the dzpuis of uu is not changed.
const Mg3d * mg
Pointer on the multi-grid Mgd3 on which this is defined.
Definition: map.h:694
Bases of the spectral expansions.
Definition: base_val.h:325
virtual void div_r_zec(Scalar &) const
Division by r (in the compactified external domain only) of a Scalar.
int get_dzpuis() const
Returns dzpuis.
Definition: cmp.h:903
virtual void inc2_dzpuis(Scalar &) const
Increases by 2 the value of dzpuis of a Scalar and changes accordingly its values in the compactifi...
void set_dzpuis(int)
Set a value to dzpuis.
Definition: cmp.C:657
Valeur & set_spectral_va()
Returns va (read/write version)
Definition: scalar.h:610
virtual void mult_rsint(Scalar &) const
Multiplication by of a Scalar.
void sxm1_zec()
Applies the following operator to *this : \ Id (r sampling = RARE, FIN ) \ (r -sampling = UNSURR ) ...
int get_type_r(int l) const
Returns the type of sampling in the radial direction in domain no.
Definition: grilles.h:491
Valeur va
The numerical value of the Cmp.
Definition: cmp.h:464
const Valeur & get_spectral_va() const
Returns va (read only version)
Definition: scalar.h:607