LORENE
map_et_deriv.C
1 /*
2  * Computations of Cmp partial derivatives for a Map_et mapping
3  */
4 
5 /*
6  * Copyright (c) 1999-2003 Eric Gourgoulhon
7  *
8  * This file is part of LORENE.
9  *
10  * LORENE is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * LORENE is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with LORENE; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23  *
24  */
25 
26 
27 char map_et_deriv_C[] = "$Header: /cvsroot/Lorene/C++/Source/Map/map_et_deriv.C,v 1.10 2014/10/13 08:53:03 j_novak Exp $" ;
28 
29 /*
30  * $Id: map_et_deriv.C,v 1.10 2014/10/13 08:53:03 j_novak Exp $
31  * $Log: map_et_deriv.C,v $
32  * Revision 1.10 2014/10/13 08:53:03 j_novak
33  * Lorene classes and functions now belong to the namespace Lorene.
34  *
35  * Revision 1.9 2012/01/17 10:33:33 j_penner
36  * added a derivative with respect to the computational coordinate xi
37  *
38  * Revision 1.8 2004/06/22 08:49:58 p_grandclement
39  * Addition of everything needed for using the logarithmic mapping
40  *
41  * Revision 1.7 2004/05/07 13:19:24 j_novak
42  * Prevention of warnings
43  *
44  * Revision 1.6 2004/04/08 17:16:07 f_limousin
45  * Add comments
46  *
47  * Revision 1.5 2004/04/08 16:39:23 f_limousin
48  * Add the case dzpuis different of 0 for methods dsdr, srdsdt, srstdsdp
49  * for Scalar's.
50  *
51  * Revision 1.4 2004/01/26 16:16:17 j_novak
52  * Methods of gradient for Scalar s. The input can have any dzpuis.
53  *
54  * Revision 1.3 2003/10/20 19:45:53 e_gourgoulhon
55  * check_dzpuis in dsdt and stdsdp.
56  *
57  * Revision 1.2 2003/10/15 10:37:43 e_gourgoulhon
58  * Added new methods dsdt and stdsdp.
59  *
60  * Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon
61  * LORENE
62  *
63  * Revision 1.3 2000/02/25 09:01:28 eric
64  * Remplacement de ci.get_dzpuis() == 0 par ci.check_dzpuis(0).
65  * Suppression de l'affectation des dzpuis Mtbl/Mtnl_cf a la fin car
66  * c'est fait par Cmp::set_dzpuis.
67  *
68  * Revision 1.2 2000/01/26 13:09:52 eric
69  * Reprototypage complet des routines de derivation:
70  * le resultat est desormais suppose alloue a l'exterieur de la routine
71  * et est passe en argument (Cmp& resu), si bien que le prototypage
72  * complet devient:
73  * void DERIV(const Cmp& ci, Cmp& resu) const
74  *
75  * Revision 1.1 1999/12/17 12:59:29 eric
76  * Initial revision
77  *
78  *
79  * $Header: /cvsroot/Lorene/C++/Source/Map/map_et_deriv.C,v 1.10 2014/10/13 08:53:03 j_novak Exp $
80  *
81  */
82 
83 
84 // Header Lorene
85 #include "map.h"
86 #include "cmp.h"
87 #include "tensor.h"
88 
89  //-----------------------//
90  // d/d\xi //
91  //-----------------------//
92 
93 
94 namespace Lorene {
95 void Map_et::dsdxi(const Cmp& ci, Cmp& resu) const {
96 
97  assert (ci.get_etat() != ETATNONDEF) ;
98  assert (ci.get_mp()->get_mg() == mg) ;
99 
100  if (ci.get_etat() == ETATZERO) {
101  resu.set_etat_zero() ;
102  }
103  else {
104  assert( ci.get_etat() == ETATQCQ ) ;
105  assert( ci.check_dzpuis(0) ) ;
106 
107  (ci.va).coef() ; // (ci.va).c_cf is up to date
108 
109  resu = (ci.va).dsdx() ; // dsdx == d/d\xi
110 
111  (resu.va).base = (ci.va).dsdx().base ; // same basis as d/dxi
112 
113  int nz = mg->get_nzone() ;
114  if (mg->get_type_r(nz-1) == UNSURR) {
115  resu.set_dzpuis(2) ; // r^2 d/dr has been computed in the
116  // external domain
117  }
118 
119  }
120 
121 }
122 
123 void Map_et::dsdxi(const Scalar& uu, Scalar& resu) const {
124 
125  assert (uu.get_etat() != ETATNONDEF) ;
126  assert (uu.get_mp().get_mg() == mg) ;
127 
128  if (uu.get_etat() == ETATZERO) {
129  resu.set_etat_zero() ;
130  }
131  else {
132  assert( uu.get_etat() == ETATQCQ ) ;
133 
134  const Valeur& uuva = uu.get_spectral_va() ;
135 
136  uuva.coef() ; // (uu.va).c_cf is up to date
137 
138  int nz = mg->get_nzone() ;
139  int nzm1 = nz - 1 ;
140 
141  if ( uu.get_dzpuis() == 0 ) {
142  resu = uuva.dsdx() ; // dsdxi = d/d\xi
143 
144  if (mg->get_type_r(nzm1) == UNSURR) {
145  resu.set_dzpuis(2) ; // r^2 d/dr has been computed in the
146  // external domain
147  }
148  }
149  else {
150  assert(mg->get_type_r(nzm1) == UNSURR) ;
151 
152  int dzp = uu.get_dzpuis() ;
153 
154  resu = uuva.dsdx() ;
155  resu.annule_domain(nzm1) ; // zero in the CED
156 
157  // Special treatment in the CED
158  Valeur tmp_ced = uuva.dsdx() ;
159  Base_val sauve_base( tmp_ced.get_base() ) ;
160  tmp_ced = tmp_ced ;
161  tmp_ced.set_base(sauve_base) ; // The above operation does not
162  //change the basis
163  tmp_ced = tmp_ced.mult_x() ; // xi, Id, (xi-1)
164  tmp_ced = tmp_ced / xsr ; // xi/R, 1/R, (xi-1)/U
165 
166  tmp_ced.annule(0, nz-2) ; // only non zero in the CED
167  tmp_ced.set(nzm1) -= dzp * uuva(nzm1) ;
168 
169  // Recombination shells + CED :
170  resu.set_spectral_va() += tmp_ced ;
171 
172  resu.set_dzpuis(dzp+1) ;
173 
174  }
175 
176  resu.set_spectral_base( uuva.dsdx().get_base() ) ; // same basis as d/dxi
177 
178  }
179 
180 }
181 
182  //---------------------//
183  // d/dr //
184  //---------------------//
185 
186 
187 void Map_et::dsdr(const Cmp& ci, Cmp& resu) const {
188 
189  assert (ci.get_etat() != ETATNONDEF) ;
190  assert (ci.get_mp()->get_mg() == mg) ;
191 
192  if (ci.get_etat() == ETATZERO) {
193  resu.set_etat_zero() ;
194  }
195  else {
196  assert( ci.get_etat() == ETATQCQ ) ;
197  assert( ci.check_dzpuis(0) ) ;
198 
199  (ci.va).coef() ; // (ci.va).c_cf is up to date
200 
201  resu = (ci.va).dsdx() * dxdr ; // dxi/dR, - dxi/dU (ZEC)
202 
203  (resu.va).base = (ci.va).dsdx().base ; // same basis as d/dxi
204 
205  int nz = mg->get_nzone() ;
206  if (mg->get_type_r(nz-1) == UNSURR) {
207  resu.set_dzpuis(2) ; // r^2 d/dr has been computed in the
208  // external domain
209  }
210 
211  }
212 
213 }
214 
215 void Map_et::dsdr(const Scalar& uu, Scalar& resu) const {
216 
217  assert (uu.get_etat() != ETATNONDEF) ;
218  assert (uu.get_mp().get_mg() == mg) ;
219 
220  if (uu.get_etat() == ETATZERO) {
221  resu.set_etat_zero() ;
222  }
223  else {
224  assert( uu.get_etat() == ETATQCQ ) ;
225 
226  const Valeur& uuva = uu.get_spectral_va() ;
227 
228  uuva.coef() ; // (uu.va).c_cf is up to date
229 
230  int nz = mg->get_nzone() ;
231  int nzm1 = nz - 1 ;
232 
233  if ( uu.get_dzpuis() == 0 ) {
234  resu = uuva.dsdx() * dxdr ; // dxdr = dxi/dR, - dxi/dU (ZEC)
235 
236  if (mg->get_type_r(nzm1) == UNSURR) {
237  resu.set_dzpuis(2) ; // r^2 d/dr has been computed in the
238  // external domain
239  }
240  }
241  else {
242  assert(mg->get_type_r(nzm1) == UNSURR) ;
243 
244  int dzp = uu.get_dzpuis() ;
245 
246  resu = uuva.dsdx() * dxdr ;
247  resu.annule_domain(nzm1) ; // zero in the CED
248 
249  // Special treatment in the CED
250  Valeur tmp_ced = uuva.dsdx() ;
251  Base_val sauve_base( tmp_ced.get_base() ) ;
252  tmp_ced = tmp_ced * dxdr ;
253  tmp_ced.set_base(sauve_base) ; // The above operation does not
254  //change the basis
255  tmp_ced = tmp_ced.mult_x() ; // xi, Id, (xi-1)
256  tmp_ced = tmp_ced / xsr ; // xi/R, 1/R, (xi-1)/U
257 
258  tmp_ced.annule(0, nz-2) ; // only non zero in the CED
259  tmp_ced.set(nzm1) -= dzp * uuva(nzm1) ;
260 
261  // Recombination shells + CED :
262  resu.set_spectral_va() += tmp_ced ;
263 
264  resu.set_dzpuis(dzp+1) ;
265 
266  }
267 
268  resu.set_spectral_base( uuva.dsdx().get_base() ) ; // same basis as d/dxi
269 
270  }
271 
272 }
273 
274 void Map_et::dsdradial(const Scalar& uu, Scalar& resu) const {
275 
276  assert (uu.get_etat() != ETATNONDEF) ;
277  assert (uu.get_mp().get_mg() == mg) ;
278 
279  if (uu.get_etat() == ETATZERO) {
280  resu.set_etat_zero() ;
281  }
282  else {
283  assert( uu.get_etat() == ETATQCQ ) ;
284 
285  const Valeur& uuva = uu.get_spectral_va() ;
286 
287  uuva.coef() ; // (uu.va).c_cf is up to date
288 
289  int nz = mg->get_nzone() ;
290  int nzm1 = nz - 1 ;
291 
292  if ( uu.get_dzpuis() == 0 ) {
293  resu = uuva.dsdx() * dxdr ; // dxdr = dxi/dR, - dxi/dU (ZEC)
294 
295  if (mg->get_type_r(nzm1) == UNSURR) {
296  resu.set_dzpuis(2) ; // r^2 d/dr has been computed in the
297  // external domain
298  }
299  }
300  else {
301  assert(mg->get_type_r(nzm1) == UNSURR) ;
302 
303  int dzp = uu.get_dzpuis() ;
304 
305  resu = uuva.dsdx() * dxdr ;
306  resu.annule_domain(nzm1) ; // zero in the CED
307 
308  // Special treatment in the CED
309  Valeur tmp_ced = uuva.dsdx() ;
310  Base_val sauve_base( tmp_ced.get_base() ) ;
311  tmp_ced = tmp_ced * dxdr ;
312  tmp_ced.set_base(sauve_base) ; // The above operation does not
313  //change the basis
314  tmp_ced = tmp_ced.mult_x() ; // xi, Id, (xi-1)
315  tmp_ced = tmp_ced / xsr ; // xi/R, 1/R, (xi-1)/U
316 
317  tmp_ced.annule(0, nz-2) ; // only non zero in the CED
318  tmp_ced.set(nzm1) -= dzp * uuva(nzm1) ;
319 
320  // Recombination shells + CED :
321  resu.set_spectral_va() += tmp_ced ;
322 
323  resu.set_dzpuis(dzp+1) ;
324 
325  }
326 
327  resu.set_spectral_base( uuva.dsdx().get_base() ) ; // same basis as d/dxi
328 
329  }
330 
331 }
332 
333  //------------------------//
334  // 1/r d/dtheta //
335  //------------------------//
336 
337 void Map_et::srdsdt(const Cmp& ci, Cmp& resu) const {
338 
339  assert (ci.get_etat() != ETATNONDEF) ;
340  assert (ci.get_mp()->get_mg() == mg) ;
341 
342  if (ci.get_etat() == ETATZERO) {
343  resu.set_etat_zero() ;
344  }
345  else {
346 
347  assert( ci.get_etat() == ETATQCQ ) ;
348  assert( ci.check_dzpuis(0) ) ;
349 
350  (ci.va).coef() ; // (ci.va).c_cf is up to date
351 
352  // Computation of 1/R df/dtheta' ---> srdfdt
353  // ----------------------------
354  Valeur srdfdt = ci.va ;
355 
356  srdfdt = srdfdt.dsdt() ; // d/dtheta'
357  srdfdt = srdfdt.sx() ; // 1/xi, Id, 1/(xi-1)
358 
359  Base_val sauve_base( srdfdt.base ) ;
360 
361  srdfdt = srdfdt * xsr ; // xi/R, 1/R, (xi-1)/U
362 
363  srdfdt.base = sauve_base ; // The above operation does not change the basis
364 
365  // Computation of 1/(dR/dx) 1/R dR/dtheta' df/dx ----> adfdx
366  // ----------------------------------------------
367 
368  Valeur adfdx = ci.va ;
369 
370  adfdx = adfdx.dsdx() ; // df/dx
371 
372  sauve_base = adfdx.base ;
373  adfdx = adfdx * dxdr * srdrdt ; // 1/(dR/dx) 1/R dR/dtheta' df/dx
374  adfdx.base = sauve_base ;
375 
376  // Final result
377  // ------------
378 
379  resu = srdfdt - adfdx ;
380 
381  int nz = mg->get_nzone() ;
382  if (mg->get_type_r(nz-1) == UNSURR) {
383  resu.set_dzpuis(2) ; // r d/dtheta has been computed in
384  // the external domain
385  }
386 
387  }
388 
389 }
390 
391 void Map_et::srdsdt(const Scalar& uu, Scalar& resu) const {
392 
393  assert (uu.get_etat() != ETATNONDEF) ;
394  assert (uu.get_mp().get_mg() == mg) ;
395 
396  if (uu.get_etat() == ETATZERO) {
397  resu.set_etat_zero() ;
398  }
399  else {
400 
401  assert( uu.get_etat() == ETATQCQ ) ;
402 
403  const Valeur& uuva = uu.get_spectral_va() ;
404  uuva.coef() ; // (uu.va).c_cf is up to date
405 
406  int nz = mg->get_nzone() ;
407  int nzm1 = nz - 1 ;
408 
409  // Computation of 1/R df/dtheta' ---> srdfdt
410  // ----------------------------
411  Valeur srdfdt = uuva ;
412 
413  srdfdt = srdfdt.dsdt() ; // d/dtheta'
414 
415  srdfdt = srdfdt.sx() ; // 1/xi, Id, 1/(xi-1)
416 
417  Base_val sauve_base( srdfdt.base ) ;
418 
419  srdfdt = srdfdt * xsr ; // xi/R, 1/R, (xi-1)/U
420 
421  srdfdt.base = sauve_base ; // The above operation does not change the basis
422  // Computation of 1/(dR/dx) 1/R dR/dtheta' df/dx ----> adfdx
423  // ----------------------------------------------
424 
425  Valeur adfdx = uuva ;
426 
427  adfdx = adfdx.dsdx() ; // df/dx
428 
429  sauve_base = adfdx.base ;
430  adfdx = adfdx * dxdr * srdrdt ; // 1/(dR/dx) 1/R dR/dtheta' df/dx
431  adfdx.base = sauve_base ;
432 
433  if (uu.get_dzpuis() == 0) {
434 
435  // Final result
436  // ------------
437 
438  resu = srdfdt - adfdx ;
439 
440  //s int nz = mg->get_nzone() ;
441  if (mg->get_type_r(nz-1) == UNSURR) {
442  resu.set_dzpuis(2) ; // r^2 (1/r d/dtheta) has been computed in
443  // the external domain
444  }
445 
446  }
447 
448  else {
449  assert(mg->get_type_r(nzm1) == UNSURR) ;
450 
451  int dzp = uu.get_dzpuis() ;
452 
453  Valeur tmp = srdfdt - adfdx ;
454  tmp.annule(nzm1) ;
455 
456  // Special treatment in the CED
457  //-----------------------------
458 
459  Valeur tmp_ced = - adfdx ;
460 
461  tmp_ced.annule(0, nz-2) ; // only non zero in the CED
462 
463  tmp_ced = tmp_ced.mult_x() ; // xi, Id, (xi-1)
464  //s Base_val sauve_base( tmp_ced.get_base() ) ;
465  tmp_ced = tmp_ced / xsr ; // xi/R, 1/R, (xi-1)/U
466 
467  tmp_ced = tmp_ced + uuva.dsdt() ;
468  tmp_ced.annule(0, nz-2) ; // only non zero in the CED
469 
470  // Recombination shells + CED :
471  resu = tmp + tmp_ced ;
472 
473  resu.set_dzpuis(dzp+1) ;
474  }
475 
476  }
477 
478 }
479 
480 
481  //------------------------------------//
482  // 1/(r sin(theta)) d/dphi //
483  //------------------------------------//
484 
485 void Map_et::srstdsdp(const Cmp& ci, Cmp& resu) const {
486 
487  assert (ci.get_etat() != ETATNONDEF) ;
488  assert (ci.get_mp()->get_mg() == mg) ;
489 
490  if (ci.get_etat() == ETATZERO) {
491  resu.set_etat_zero() ;
492  }
493  else {
494 
495  assert( ci.get_etat() == ETATQCQ) ;
496  assert( ci.check_dzpuis(0) ) ;
497 
498  (ci.va).coef() ; // (ci.va).c_cf is up to date
499 
500  // Computation of 1/(R sin(theta')) df/dphi' ---> srstdfdp
501  // -----------------------------------------
502 
503  Valeur srstdfdp = ci.va ;
504 
505  srstdfdp = srstdfdp.dsdp() ; // d/dphi
506  srstdfdp = srstdfdp.ssint() ; // 1/sin(theta)
507  srstdfdp = srstdfdp.sx() ; // 1/xi, Id, 1/(xi-1)
508 
509  Base_val sauve_base( srstdfdp.base ) ;
510 
511  srstdfdp = srstdfdp * xsr ; // xi/R, 1/R, (xi-1)/U
512 
513  srstdfdp.base = sauve_base ; // The above operation does not change the basis
514 
515  // Computation of 1/(dR/dx) 1/(R sin(theta') dR/dphi' df/dx --> bdfdx
516  // --------------------------------------------------------
517  Valeur bdfdx = ci.va ;
518 
519  bdfdx = bdfdx.dsdx() ; // df/dx
520 
521  sauve_base = bdfdx.base ;
522  bdfdx = bdfdx * dxdr * srstdrdp ;
523  bdfdx.base = sauve_base ;
524 
525  // Final result
526  // ------------
527 
528  resu = srstdfdp - bdfdx ;
529 
530  int nz = mg->get_nzone() ;
531  if (mg->get_type_r(nz-1) == UNSURR) {
532  resu.set_dzpuis(2) ; // r/sin(theta) d/dphi has been
533  // computed in the external domain
534  }
535 
536  }
537 
538 }
539 
540 void Map_et::srstdsdp(const Scalar& uu, Scalar& resu) const {
541 
542  assert (uu.get_etat() != ETATNONDEF) ;
543  assert (uu.get_mp().get_mg() == mg) ;
544 
545  if (uu.get_etat() == ETATZERO) {
546  resu.set_etat_zero() ;
547  }
548  else {
549 
550  assert( uu.get_etat() == ETATQCQ ) ;
551 
552  const Valeur& uuva = uu.get_spectral_va() ;
553  uuva.coef() ; // (uu.va).c_cf is up to date
554 
555  int nz = mg->get_nzone() ;
556  int nzm1 = nz - 1 ;
557 
558  // Computation of 1/(R sin(theta')) df/dphi' ---> srstdfdp
559  // -----------------------------------------
560 
561  Valeur srstdfdp = uuva ;
562 
563  srstdfdp = srstdfdp.dsdp() ; // d/dphi
564  srstdfdp = srstdfdp.ssint() ; // 1/sin(theta)
565  srstdfdp = srstdfdp.sx() ; // 1/xi, Id, 1/(xi-1)
566 
567  Base_val sauve_base( srstdfdp.base ) ;
568 
569  srstdfdp = srstdfdp * xsr ; // xi/R, 1/R, (xi-1)/U
570 
571  srstdfdp.base = sauve_base ; // The above operation does not change the basis
572 
573  // Computation of 1/(dR/dx) 1/(R sin(theta') dR/dphi' df/dx --> bdfdx
574  // --------------------------------------------------------
575  Valeur bdfdx = uuva ;
576 
577  bdfdx = bdfdx.dsdx() ; // df/dx
578 
579  sauve_base = bdfdx.base ;
580  bdfdx = bdfdx * dxdr * srstdrdp ;
581  bdfdx.base = sauve_base ;
582 
583 
584  if (uu.get_dzpuis() == 0) {
585 
586  //Final result
587 
588  resu = srstdfdp - bdfdx ;
589 
590 
591  if (mg->get_type_r(nz-1) == UNSURR) {
592  resu.set_dzpuis(2) ; // r d/dtheta has been computed in
593  // the external domain
594  }
595  }
596 
597  else {
598  assert(mg->get_type_r(nzm1) == UNSURR) ;
599 
600  int dzp = uu.get_dzpuis() ;
601 
602  Valeur tmp = srstdfdp - bdfdx ;
603  tmp.annule(nzm1) ;
604 
605  // Special treatment in the CED
606 
607  Valeur tmp_ced = - bdfdx ;
608  tmp_ced.annule(0, nz-2) ; // only non zero in the CED
609 
610  tmp_ced = tmp_ced.mult_x() ; // xi, Id, (xi-1)
611  //s Base_val sauve_base( tmp_ced.get_base() ) ;
612  tmp_ced = tmp_ced / xsr ; // xi/R, 1/R, (xi-1)/U
613 
614  tmp_ced = tmp_ced + uuva.dsdp().ssint() ;
615  tmp_ced.annule(0, nz-2) ; // only non zero in the CED
616 
617  // Recombination shells + CED :
618  resu = tmp + tmp_ced ;
619 
620  resu.set_dzpuis(dzp+1) ;
621  }
622  }
623 }
624 
625  //------------------------//
626  // d/dtheta //
627  //------------------------//
628 
629 void Map_et::dsdt(const Scalar& ci, Scalar& resu) const {
630 
631  assert (ci.get_etat() != ETATNONDEF) ;
632  assert (ci.get_mp().get_mg() == mg) ;
633 
634  if (ci.get_etat() == ETATZERO) {
635  resu.set_etat_zero() ;
636  }
637  else {
638 
639  // The relations are true for all dzpuis
640  // assert( ci.check_dzpuis(0) ) ;
641  assert( ci.get_etat() == ETATQCQ ) ;
642 
643 
644  // Computation of df/dtheta' ---> dfdt
645  // ----------------------------
646 
647  const Valeur& dfdt = ci.get_spectral_va().dsdt() ;
648 
649 
650  // Computation of 1/(dR/dxi) dR/dtheta' df/dx ----> adfdx
651  // -------------------------------------------
652 
653  Valeur adfdx = ci.get_spectral_va().dsdx() ; // df/dx
654 
655  Base_val sauve_base = adfdx.get_base() ;
656 
657  adfdx = adfdx * dxdr * drdt ; // df/dx / (dR/dx) * dR/dtheta'
658 
659  adfdx.set_base( sauve_base ) ;
660 
661  // Final result
662  // ------------
663 
664  resu = dfdt - adfdx ;
665 
666  }
667 
668 }
669 
670  //---------------------------------//
671  // 1/sin(theta) d/dphi //
672  //---------------------------------//
673 
674 void Map_et::stdsdp(const Scalar& ci, Scalar& resu) const {
675 
676  assert (ci.get_etat() != ETATNONDEF) ;
677  assert (ci.get_mp().get_mg() == mg) ;
678 
679  if (ci.get_etat() == ETATZERO) {
680  resu.set_etat_zero() ;
681  }
682  else {
683 
684  assert( ci.get_etat() == ETATQCQ ) ;
685  // The relations are true for all dzpuis
686  // assert( ci.check_dzpuis(0) ) ;
687 
688  // Computation of 1/sin(theta) df/dphi' ---> stdfdp
689  // ----------------------------
690 
691  const Valeur& stdfdp = ci.get_spectral_va().stdsdp() ;
692 
693 
694  // Computation of 1/(dR/dxi) 1/sin(theta) dR/dphi' df/dx ----> adfdx
695  // -------------------------------------------
696 
697  Valeur adfdx = ci.get_spectral_va().dsdx() ; // df/dx
698 
699  Base_val sauve_base = adfdx.get_base() ;
700 
701  adfdx = adfdx * dxdr * stdrdp ; // df/dx / (dR/dx) * 1/sin(th) dR/dphi'
702 
703  adfdx.set_base( sauve_base ) ;
704 
705  // Final result
706  // ------------
707 
708  resu = stdfdp - adfdx ;
709 
710  }
711 
712 }
713 
714 
715 
716 }
Bases of the spectral expansions.
Definition: base_val.h:322
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Definition: cmp.h:446
int get_etat() const
Returns the logical state.
Definition: cmp.h:899
Valeur va
The numerical value of the Cmp
Definition: cmp.h:464
const Map * get_mp() const
Returns the mapping.
Definition: cmp.h:901
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
Definition: cmp.C:289
void set_dzpuis(int)
Set a value to dzpuis.
Definition: cmp.C:654
bool check_dzpuis(int dzi) const
Returns false if the last domain is compactified and *this is not zero in this domain and dzpuis is n...
Definition: cmp.C:715
const Cmp & dsdx() const
Returns of *this , where .
Definition: cmp_deriv.C:148
virtual void dsdr(const Cmp &ci, Cmp &resu) const
Computes of a Cmp.
Definition: map_et_deriv.C:187
virtual void srstdsdp(const Cmp &ci, Cmp &resu) const
Computes of a Cmp.
Definition: map_et_deriv.C:485
virtual void dsdradial(const Scalar &uu, Scalar &resu) const
Computes of a Scalar if the description is affine and if it is logarithmic.
Definition: map_et_deriv.C:274
virtual void stdsdp(const Scalar &uu, Scalar &resu) const
Computes of a Scalar.
Definition: map_et_deriv.C:674
virtual void dsdt(const Scalar &uu, Scalar &resu) const
Computes of a Scalar.
Definition: map_et_deriv.C:629
virtual void srdsdt(const Cmp &ci, Cmp &resu) const
Computes of a Cmp.
Definition: map_et_deriv.C:337
virtual void dsdxi(const Cmp &ci, Cmp &resu) const
Computes of a Cmp.
Definition: map_et_deriv.C:95
Coord srstdrdp
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
Definition: map.h:1592
Coord drdt
in the nucleus and in the non-compactified shells; \ in the compactified external domain (CED).
Definition: map.h:1568
Coord srdrdt
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
Definition: map.h:1584
Coord xsr
in the nucleus; \ 1/R in the non-compactified shells; \ in the compactified outer domain.
Definition: map.h:1549
Coord dxdr
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
Definition: map.h:1560
Coord stdrdp
in the nucleus and in the non-compactified shells; \ in the compactified external domain (CED).
Definition: map.h:1576
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
Definition: map.h:765
const Mg3d * mg
Pointer on the multi-grid Mgd3 on which this is defined
Definition: map.h:676
int get_nzone() const
Returns the number of domains.
Definition: grilles.h:448
int get_type_r(int l) const
Returns the type of sampling in the radial direction in domain no.
Definition: grilles.h:474
Tensor field of valence 0 (or component of a tensorial field).
Definition: scalar.h:387
int get_dzpuis() const
Returns dzpuis.
Definition: scalar.h:557
virtual void set_etat_zero()
Sets the logical state to ETATZERO (zero).
Definition: scalar.C:324
int get_etat() const
Returns the logical state ETATNONDEF (undefined), ETATZERO (null) or ETATQCQ (ordinary).
Definition: scalar.h:554
void set_dzpuis(int)
Modifies the dzpuis flag.
Definition: scalar.C:808
const Valeur & get_spectral_va() const
Returns va (read only version)
Definition: scalar.h:601
Valeur & set_spectral_va()
Returns va (read/write version)
Definition: scalar.h:604
void set_spectral_base(const Base_val &)
Sets the spectral bases of the Valeur va
Definition: scalar.C:797
Values and coefficients of a (real-value) function.
Definition: valeur.h:287
const Valeur & dsdp() const
Returns of *this.
Definition: valeur_dsdp.C:98
const Valeur & sx() const
Returns (r -sampling = RARE ) \ Id (r sampling = FIN ) \ (r -sampling = UNSURR )
Definition: valeur_sx.C:110
const Valeur & stdsdp() const
Returns of *this.
Definition: valeur_stdsdp.C:60
void set_base(const Base_val &)
Sets the bases for spectral expansions (member base )
Definition: valeur.C:810
const Valeur & dsdt() const
Returns of *this.
Definition: valeur_dsdt.C:112
void annule(int l)
Sets the Valeur to zero in a given domain.
Definition: valeur.C:744
const Valeur & dsdx() const
Returns of *this.
Definition: valeur_dsdx.C:111
const Valeur & mult_x() const
Returns (r -sampling = RARE ) \ Id (r sampling = FIN ) \ (r -sampling = UNSURR )
const Valeur & ssint() const
Returns of *this.
Definition: valeur_ssint.C:112
void coef() const
Computes the coeffcients of *this.
Definition: valeur_coef.C:148
const Base_val & get_base() const
Return the bases for spectral expansions (member base )
Definition: valeur.h:480
Base_val base
Bases on which the spectral expansion is performed.
Definition: valeur.h:305
Tbl & set(int l)
Read/write of the value in a given domain (configuration space).
Definition: valeur.h:363
const Map & get_mp() const
Returns the mapping.
Definition: tensor.h:861
void annule_domain(int l)
Sets the Tensor to zero in a given domain.
Definition: tensor.C:666
Lorene prototypes.
Definition: app_hor.h:64