67 #include "utilitaires.h" 70 #include "param_elliptic.h" 73 #include "sym_tensor.h" 89 assert(mp_aff != 0x0) ;
111 assert(aaa.
get_etat() != ETATNONDEF) ;
114 bool ced = (mgrid.
get_type_r(nzm1) == UNSURR) ;
115 int n_shell = ced ? nz-2 : nzm1 ;
119 n_shell = (nz_bc < n_shell ? nz_bc : n_shell) ;
120 bool cedbc = (ced && (nz_bc == nzm1)) ;
123 assert(par_bc != 0x0) ;
127 int nt = mgrid.
get_nt(0) ;
128 int np = mgrid.
get_np(0) ;
156 int l_q, m_q, base_r ;
165 int nr = mgrid.
get_nr(lz) ;
170 for (
int k=0 ; k<np+1 ; k++) {
171 for (
int j=0 ; j<nt ; j++) {
174 if ( (nullite_plm(j, nt, k, np, base) == 1) && (l_q > 1)) {
179 for (
int i=0; i<nr; i++) {
180 sol_part_mu.
set(lz, k, j, i) = 0 ;
181 sol_part_x.
set(lz, k, j, i) = 0 ;
183 for (
int i=0; i<nr; i++) {
184 sol_hom2_mu.
set(lz, k, j, i) = 0 ;
185 sol_hom2_x.
set(lz, k, j, i) = 0 ;
195 for (
int lz=1; lz <= n_shell; lz++) {
196 int nr = mgrid.
get_nr(lz) ;
197 assert(mgrid.
get_nt(lz) == nt) ;
198 assert(mgrid.
get_np(lz) == np) ;
200 double ech = mp_aff->
get_beta()[lz] / alpha ;
204 for (
int k=0 ; k<np+1 ; k++) {
205 for (
int j=0 ; j<nt ; j++) {
208 if ( (nullite_plm(j, nt, k, np, base) == 1) && (l_q > 1)) {
213 for (
int lin=0; lin<nr; lin++)
214 for (
int col=0; col<nr; col++)
215 ope.
set(lin,col) = mxd(lin,col) + ech*md(lin,col)
217 for (
int lin=0; lin<nr; lin++)
218 for (
int col=0; col<nr; col++)
219 ope.
set(lin,col+nr) = (2-l_q*(l_q+1))*mid(lin,col) ;
220 for (
int lin=0; lin<nr; lin++)
221 for (
int col=0; col<nr; col++)
222 ope.
set(lin+nr,col) = -mid(lin,col) ;
223 for (
int lin=0; lin<nr; lin++)
224 for (
int col=0; col<nr; col++)
225 ope.
set(lin+nr,col+nr) = mxd(lin,col) + ech*md(lin,col) ;
229 for (
int col=0; col<2*nr; col++) {
230 ope.
set(ind0+nr-1, col) = 0 ;
231 ope.
set(ind1+nr-1, col) = 0 ;
233 ope.
set(ind0+nr-1, ind0) = 1 ;
234 ope.
set(ind1+nr-1, ind1) = 1 ;
240 for (
int lin=0; lin<nr; lin++)
242 for (
int lin=0; lin<nr; lin++)
245 sec.
set(ind0+nr-1) = 0 ;
246 sec.
set(ind1+nr-1) = 0 ;
248 for (
int i=0; i<nr; i++) {
249 sol_part_mu.
set(lz, k, j, i) = sol(i) ;
250 sol_part_x.
set(lz, k, j, i) = sol(i+nr) ;
253 sec.
set(ind0+nr-1) = 1 ;
255 for (
int i=0; i<nr; i++) {
256 sol_hom1_mu.
set(lz, k, j, i) = sol(i) ;
257 sol_hom1_x.
set(lz, k, j, i) = sol(i+nr) ;
259 sec.
set(ind0+nr-1) = 0 ;
260 sec.
set(ind1+nr-1) = 1 ;
262 for (
int i=0; i<nr; i++) {
263 sol_hom2_mu.
set(lz, k, j, i) = sol(i) ;
264 sol_hom2_x.
set(lz, k, j, i) = sol(i+nr) ;
274 if (cedbc) {
int lz = nzm1 ;
275 int nr = mgrid.
get_nr(lz) ;
276 assert(mgrid.
get_nt(lz) == nt) ;
277 assert(mgrid.
get_np(lz) == np) ;
282 for (
int k=0 ; k<np+1 ; k++) {
283 for (
int j=0 ; j<nt ; j++) {
286 if ( (nullite_plm(j, nt, k, np, base) == 1) && (l_q > 1)) {
290 for (
int lin=0; lin<nr; lin++)
291 for (
int col=0; col<nr; col++)
292 ope.
set(lin,col) = - md(lin,col) + 3*ms(lin,col) ;
293 for (
int lin=0; lin<nr; lin++)
294 for (
int col=0; col<nr; col++)
295 ope.
set(lin,col+nr) = (2-l_q*(l_q+1))*ms(lin,col) ;
296 for (
int lin=0; lin<nr; lin++)
297 for (
int col=0; col<nr; col++)
298 ope.
set(lin+nr,col) = -ms(lin,col) ;
299 for (
int lin=0; lin<nr; lin++)
300 for (
int col=0; col<nr; col++)
301 ope.
set(lin+nr,col+nr) = -md(lin,col) ;
306 for (
int col=0; col<2*nr; col++) {
307 ope.
set(ind0+nr-1, col) = 0 ;
308 ope.
set(ind1+nr-2, col) = 0 ;
309 ope.
set(ind1+nr-1, col) = 0 ;
311 for (
int col=0; col<nr; col++) {
312 ope.
set(ind0+nr-1, col+ind0) = 1 ;
313 ope.
set(ind1+nr-1, col+ind1) = 1 ;
315 ope.
set(ind1+nr-2, ind1+1) = 1 ;
321 for (
int lin=0; lin<nr; lin++)
323 for (
int lin=0; lin<nr; lin++)
326 sec.
set(ind0+nr-1) = 0 ;
327 sec.
set(ind1+nr-2) = 0 ;
328 sec.
set(ind1+nr-1) = 0 ;
330 for (
int i=0; i<nr; i++) {
331 sol_part_mu.
set(lz, k, j, i) = sol(i) ;
332 sol_part_x.
set(lz, k, j, i) = sol(i+nr) ;
335 sec.
set(ind1+nr-2) = 1 ;
337 for (
int i=0; i<nr; i++) {
338 sol_hom1_mu.
set(lz, k, j, i) = sol(i) ;
339 sol_hom1_x.
set(lz, k, j, i) = sol(i+nr) ;
349 int taille = 2*nz_bc ;
350 if (cedbc) taille-- ;
354 Tbl sec_membre(taille) ;
355 Matrice systeme(taille, taille) ;
356 int ligne ;
int colonne ;
359 double c_mu = (cedbc ? 0 : par_bc->
get_tbl_mod(0)(0) ) ;
360 double d_mu = (cedbc ? 0 : par_bc->
get_tbl_mod(0)(1) ) ;
361 double c_x = (cedbc ? 0 : par_bc->
get_tbl_mod(0)(2) ) ;
362 double d_x = (cedbc ? 0 : par_bc->
get_tbl_mod(0)(3) ) ;
363 Mtbl_cf dhom1_mu = sol_hom1_mu ;
364 Mtbl_cf dhom2_mu = sol_hom2_mu ;
365 Mtbl_cf dpart_mu = sol_part_mu ;
381 for (
int k=0 ; k<np+1 ; k++)
382 for (
int j=0 ; j<nt ; j++) {
384 if ((nullite_plm(j, nt, k, np, base) == 1) && (l_q > 1)) {
392 int nr = mgrid.
get_nr(1) ;
430 systeme.
set(ligne, colonne) =
432 systeme.
set(ligne, colonne+1) =
438 systeme.
set(ligne, colonne) =
440 systeme.
set(ligne, colonne+1) =
448 for (
int zone=2 ; zone<nz_bc ; zone++) {
453 systeme.
set(ligne, colonne) =
455 systeme.
set(ligne, colonne+1) =
461 systeme.
set(ligne, colonne) =
463 systeme.
set(ligne, colonne+1) =
470 systeme.
set(ligne, colonne) =
472 systeme.
set(ligne, colonne+1) =
478 systeme.
set(ligne, colonne) =
480 systeme.
set(ligne, colonne+1) =
489 nr = mgrid.
get_nr(nz_bc) ;
490 double alpha = mp_aff->
get_alpha()[nz_bc] ;
494 systeme.
set(ligne, colonne) =
496 if (!cedbc) systeme.
set(ligne, colonne+1) =
502 systeme.
set(ligne, colonne) =
504 if (!cedbc) systeme.
set(ligne, colonne+1) =
512 systeme.
set(ligne, colonne) =
517 systeme.
set(ligne, colonne+1) =
546 for (
int i=0 ; i<nr ; i++) {
547 mmu.
set(0, k, j, i) = 0 ;
548 mw.
set(0, k, j, i) = 0 ;
551 for (
int i=0 ; i<nr ; i++) {
552 mmu.
set(1, k, j, i) = sol_part_mu(1, k, j, i)
553 + facteur(conte)*sol_hom1_mu(1, k, j, i)
554 + facteur(conte+1)*sol_hom2_mu(1, k, j, i);
555 mw.
set(1, k, j, i) = sol_part_x(1, k, j, i)
556 + facteur(conte)*sol_hom1_x(1, k, j, i)
557 + facteur(conte+1)*sol_hom2_x(1,k,j,i);
560 for (
int zone=2 ; zone<=n_shell ; zone++) {
562 for (
int i=0 ; i<nr ; i++) {
563 mmu.
set(zone, k, j, i) = sol_part_mu(zone, k, j, i)
564 + facteur(conte)*sol_hom1_mu(zone, k, j, i)
565 + facteur(conte+1)*sol_hom2_mu(zone, k, j, i) ;
567 mw.
set(zone, k, j, i) = sol_part_x(zone, k, j, i)
568 + facteur(conte)*sol_hom1_x(zone, k, j, i)
569 + facteur(conte+1)*sol_hom2_x(zone, k, j, i) ;
575 for (
int i=0 ; i<nr ; i++) {
576 mmu.
set(nzm1, k, j, i) = sol_part_mu(nzm1, k, j, i)
577 + facteur(conte)*sol_hom1_mu(nzm1, k, j, i) ;
579 mw.
set(nzm1, k, j, i) = sol_part_x(nzm1, k, j, i)
580 + facteur(conte)*sol_hom1_x(nzm1, k, j, i) ;
610 assert(mp_aff != 0x0) ;
617 bool ced = (mgrid.
get_type_r(nzm1) == UNSURR) ;
618 int n_shell = ced ? nz-2 : nzm1 ;
623 n_shell = (nz_bc < n_shell ? nz_bc : n_shell) ;
624 bool cedbc = (ced && (nz_bc == nzm1)) ;
627 assert(par_bc != 0x0) ;
631 int nt = mgrid.
get_nt(0) ;
632 int np = mgrid.
get_np(0) ;
634 int l_q, m_q, base_r;
684 assert (bbt.
get_etat() != ETATNONDEF) ;
685 assert (hh.
get_etat() != ETATNONDEF) ;
692 source.set_spectral_va().ylm() ;
694 bool bnull = (bbt.
get_etat() == ETATZERO) ;
699 hoverr.set_spectral_va().ylm() ;
707 bool hnull = (hh.
get_etat() == ETATZERO) ;
714 bool need_calculation = true ;
715 if (par_mat != 0x0) {
716 bool param_new = false ;
721 if (par_mat->
get_int_mod(0) < nz_bc) param_new =
true ;
722 if (par_mat->
get_int_mod(1) != lmax) param_new =
true ;
728 for (
int l=1; l<= n_shell; l++) {
731 mp_aff->
get_alpha()[l]) > 2.e-15) param_new = true ;
744 int* nz_bc_new =
new int(nz_bc) ;
746 int* lmax_new =
new int(lmax) ;
748 int* type_t_new =
new int(mgrid.
get_type_t()) ;
750 int* type_p_new =
new int(mgrid.
get_type_p()) ;
755 for (
int l=0; l<nz; l++)
757 Tbl* palpha =
new Tbl(nz) ;
761 for (
int l=1; l<nzm1; l++)
765 else need_calculation = false ;
781 sol_Dirac_l01_bound(hh2, hrr, tilde_eta, bound_hrr, bound_eta, par_mat) ;
797 Itbl mat_done(lmax) ;
807 int nr = mgrid.
get_nr(lz) ;
811 if (need_calculation && (par_mat != 0x0)) mat_done.
annule_hard() ;
813 for (
int k=0 ; k<np+1 ; k++) {
814 for (
int j=0 ; j<nt ; j++) {
817 if ( (nullite_plm(j, nt, k, np, base) == 1) && (l_q > 1)) {
818 if (need_calculation) {
823 for (
int lin=0; lin<nr; lin++)
824 for (
int col=0; col<nr; col++)
825 ope.
set(lin,col) = md(lin,col) + 3*ms(lin,col) ;
826 for (
int lin=0; lin<nr; lin++)
827 for (
int col=0; col<nr; col++)
828 ope.
set(lin,col+nr) = -l_q*(l_q+1)*ms(lin,col) ;
829 for (
int lin=0; lin<nr; lin++)
830 for (
int col=0; col<nr; col++)
831 ope.
set(lin,col+2*nr) = 0 ;
832 for (
int lin=0; lin<nr; lin++)
833 for (
int col=0; col<nr; col++)
834 ope.
set(lin+nr,col) = -0.5*ms(lin,col) ;
835 for (
int lin=0; lin<nr; lin++)
836 for (
int col=0; col<nr; col++)
837 ope.
set(lin+nr,col+nr) = md(lin,col) + 3*ms(lin,col) ;
838 for (
int lin=0; lin<nr; lin++)
839 for (
int col=0; col<nr; col++)
840 ope.
set(lin+nr,col+2*nr) = (2. - l_q*(l_q+1))*ms(lin,col) ;
841 for (
int lin=0; lin<nr; lin++)
842 for (
int col=0; col<nr; col++)
843 ope.
set(lin+2*nr,col) = -0.5*md(lin,col)/double(l_q+1)
844 - 0.5*double(l_q+4)/double(l_q+1)*ms(lin,col) ;
845 for (
int lin=0; lin<nr; lin++)
846 for (
int col=0; col<nr; col++)
847 ope.
set(lin+2*nr,col+nr) = -2*ms(lin,col) ;
848 for (
int lin=0; lin<nr; lin++)
849 for (
int col=0; col<nr; col++)
850 ope.
set(lin+2*nr,col+2*nr) = (l_q+2)*md(lin,col)
851 + l_q*(l_q+2)*ms(lin,col) ;
854 for (
int col=0; col<3*nr; col++)
855 if (l_q>2) ope.
set(ind2+nr-2, col) = 0 ;
856 for (
int col=0; col<3*nr; col++) {
857 ope.
set(nr-1, col) = 0 ;
858 ope.
set(2*nr-1, col) = 0 ;
859 ope.
set(3*nr-1, col) = 0 ;
863 for (
int col=0; col<nr; col++) {
864 ope.
set(nr-1, col) = pari ;
865 ope.
set(2*nr-1, col+nr) = pari ;
866 ope.
set(3*nr-1, col+2*nr) = pari ;
871 ope.
set(nr-1, nr-1) = 1 ;
872 ope.
set(2*nr-1, 2*nr-1) = 1 ;
873 ope.
set(3*nr-1, 3*nr-1) = 1 ;
876 ope.
set(ind2+nr-2, ind2) = 1 ;
879 if ((par_mat != 0x0) && (mat_done(l_q) == 0)) {
882 mat_done.
set(l_q) = 1 ;
886 const Matrice& oper = (par_mat == 0x0 ? ope :
891 for (
int lin=0; lin<2*nr; lin++)
893 for (
int lin=0; lin<nr; lin++)
894 sec.
set(2*nr+lin) = (*source.get_spectral_va().c_cf)
898 for (
int lin=0; lin<nr; lin++)
899 sec.
set(lin) = (*hoverr.get_spectral_va().c_cf)(lz, k, j, lin) ;
900 for (
int lin=0; lin<nr; lin++)
901 sec.
set(lin+nr) = -0.5*(*hoverr.get_spectral_va().c_cf)
904 for (
int lin=0; lin<nr; lin++)
905 sec.
set(2*nr+lin)= -0.5/double(l_q+1)*(
907 + (l_q+2)*(*hoverr.get_spectral_va().c_cf)(lz, k, j, lin) ) ;
910 for (
int lin=0; lin<nr; lin++)
911 sec.
set(2*nr+lin) = -0.5/double(l_q+1)*(
913 + (l_q+2)*(*hoverr.get_spectral_va().c_cf)(lz, k, j, lin) )
914 + (*source.get_spectral_va().c_cf)(lz, k, j, lin) ;
917 if (l_q>2) sec.
set(ind2+nr-2) = 0 ;
918 sec.
set(3*nr-1) = 0 ;
920 for (
int i=0; i<nr; i++) {
921 sol_part_hrr.
set(lz, k, j, i) = sol(i) ;
922 sol_part_eta.
set(lz, k, j, i) = sol(i+nr) ;
923 sol_part_w.
set(lz, k, j, i) = sol(i+2*nr) ;
927 sec.
set(ind2+nr-2) = 1 ;
936 for (
int i=0; i<nr; i++) {
937 sol_hom3_hrr.
set(lz, k, j, i) = sol(i) ;
938 sol_hom3_eta.
set(lz, k, j, i) = sol(i+nr) ;
939 sol_hom3_w.
set(lz, k, j, i) = sol(i+2*nr) ;
951 for (
int lz=1; lz<= n_shell; lz++) {
952 if (need_calculation && (par_mat != 0x0)) mat_done.
annule_hard() ;
953 int nr = mgrid.
get_nr(lz) ;
958 double ech = mp_aff->
get_beta()[lz] / alpha ;
961 for (
int k=0 ; k<np+1 ; k++) {
962 for (
int j=0 ; j<nt ; j++) {
965 if ( (nullite_plm(j, nt, k, np, base) == 1) && (l_q > 1)) {
966 if (need_calculation) {
972 for (
int lin=0; lin<nr; lin++)
973 for (
int col=0; col<nr; col++)
974 ope.
set(lin,col) = mxd(lin,col) + ech*md(lin,col)
976 for (
int lin=0; lin<nr; lin++)
977 for (
int col=0; col<nr; col++)
978 ope.
set(lin,col+nr) = -l_q*(l_q+1)*mid(lin,col) ;
979 for (
int lin=0; lin<nr; lin++)
980 for (
int col=0; col<nr; col++)
981 ope.
set(lin,col+2*nr) = 0 ;
982 for (
int lin=0; lin<nr; lin++)
983 for (
int col=0; col<nr; col++)
984 ope.
set(lin+nr,col) = -0.5*mid(lin,col) ;
985 for (
int lin=0; lin<nr; lin++)
986 for (
int col=0; col<nr; col++)
987 ope.
set(lin+nr,col+nr) = mxd(lin,col) + ech*md(lin,col)
989 for (
int lin=0; lin<nr; lin++)
990 for (
int col=0; col<nr; col++)
991 ope.
set(lin+nr,col+2*nr) = (2. - l_q*(l_q+1))*mid(lin,col) ;
992 for (
int lin=0; lin<nr; lin++)
993 for (
int col=0; col<nr; col++)
994 ope.
set(lin+2*nr,col) =
995 -0.5/double(l_q+1)*(mxd(lin,col) + ech*md(lin,col)
996 + double(l_q+4)*mid(lin,col)) ;
997 for (
int lin=0; lin<nr; lin++)
998 for (
int col=0; col<nr; col++)
999 ope.
set(lin+2*nr,col+nr) = -2*mid(lin,col) ;
1000 for (
int lin=0; lin<nr; lin++)
1001 for (
int col=0; col<nr; col++)
1002 ope.
set(lin+2*nr,col+2*nr) =
1003 double(l_q+2)*(mxd(lin,col) + ech*md(lin,col)
1004 + l_q*mid(lin,col)) ;
1005 for (
int col=0; col<3*nr; col++) {
1006 ope.
set(ind0+nr-1, col) = 0 ;
1007 ope.
set(ind1+nr-1, col) = 0 ;
1008 ope.
set(ind2+nr-1, col) = 0 ;
1010 ope.
set(ind0+nr-1, ind0) = 1 ;
1011 ope.
set(ind1+nr-1, ind1) = 1 ;
1012 ope.
set(ind2+nr-1, ind2) = 1 ;
1015 if ((par_mat != 0x0) && (mat_done(l_q) == 0)) {
1018 mat_done.
set(l_q) = 1 ;
1021 const Matrice& oper = (par_mat == 0x0 ? ope :
1026 for (
int lin=0; lin<2*nr; lin++)
1028 for (
int lin=0; lin<nr; lin++)
1033 for (
int lin=0; lin<nr; lin++)
1035 for (
int lin=0; lin<nr; lin++)
1039 for (
int lin=0; lin<nr; lin++)
1040 sec.
set(2*nr+lin) = -0.5/double(l_q+1)*(
1045 for (
int lin=0; lin<nr; lin++)
1046 sec.
set(2*nr+lin) = -0.5/double(l_q+1)*(
1052 sec.
set(ind0+nr-1) = 0 ;
1053 sec.
set(ind1+nr-1) = 0 ;
1054 sec.
set(ind2+nr-1) = 0 ;
1056 for (
int i=0; i<nr; i++) {
1057 sol_part_hrr.
set(lz, k, j, i) = sol(i) ;
1058 sol_part_eta.
set(lz, k, j, i) = sol(i+nr) ;
1059 sol_part_w.
set(lz, k, j, i) = sol(i+2*nr) ;
1062 sec.
set(ind0+nr-1) = 1 ;
1064 for (
int i=0; i<nr; i++) {
1065 sol_hom1_hrr.
set(lz, k, j, i) = sol(i) ;
1066 sol_hom1_eta.
set(lz, k, j, i) = sol(i+nr) ;
1067 sol_hom1_w.
set(lz, k, j, i) = sol(i+2*nr) ;
1069 sec.
set(ind0+nr-1) = 0 ;
1070 sec.
set(ind1+nr-1) = 1 ;
1072 for (
int i=0; i<nr; i++) {
1073 sol_hom2_hrr.
set(lz, k, j, i) = sol(i) ;
1074 sol_hom2_eta.
set(lz, k, j, i) = sol(i+nr) ;
1075 sol_hom2_w.
set(lz, k, j, i) = sol(i+2*nr) ;
1077 sec.
set(ind1+nr-1) = 0 ;
1078 sec.
set(ind2+nr-1) = 1 ;
1080 for (
int i=0; i<nr; i++) {
1081 sol_hom3_hrr.
set(lz, k, j, i) = sol(i) ;
1082 sol_hom3_eta.
set(lz, k, j, i) = sol(i+nr) ;
1083 sol_hom3_w.
set(lz, k, j, i) = sol(i+2*nr) ;
1093 if (cedbc) {
int lz = nzm1 ;
1094 if (need_calculation && (par_mat != 0x0)) mat_done.
annule_hard() ;
1095 int nr = mgrid.
get_nr(lz) ;
1099 double alpha = mp_aff->
get_alpha()[lz] ;
1102 for (
int k=0 ; k<np+1 ; k++) {
1103 for (
int j=0 ; j<nt ; j++) {
1106 if ( (nullite_plm(j, nt, k, np, base) == 1) && (l_q > 1)) {
1107 if (need_calculation) {
1112 for (
int lin=0; lin<nr; lin++)
1113 for (
int col=0; col<nr; col++)
1114 ope.
set(lin,col) = - md(lin,col) + 3*ms(lin,col) ;
1115 for (
int lin=0; lin<nr; lin++)
1116 for (
int col=0; col<nr; col++)
1117 ope.
set(lin,col+nr) = -l_q*(l_q+1)*ms(lin,col) ;
1118 for (
int lin=0; lin<nr; lin++)
1119 for (
int col=0; col<nr; col++)
1120 ope.
set(lin,col+2*nr) = 0 ;
1121 for (
int lin=0; lin<nr; lin++)
1122 for (
int col=0; col<nr; col++)
1123 ope.
set(lin+nr,col) = -0.5*ms(lin,col) ;
1124 for (
int lin=0; lin<nr; lin++)
1125 for (
int col=0; col<nr; col++)
1126 ope.
set(lin+nr,col+nr) = -md(lin,col) + 3*ms(lin,col) ;
1127 for (
int lin=0; lin<nr; lin++)
1128 for (
int col=0; col<nr; col++)
1129 ope.
set(lin+nr,col+2*nr) = (2. - l_q*(l_q+1))*ms(lin,col) ;
1130 for (
int lin=0; lin<nr; lin++)
1131 for (
int col=0; col<nr; col++)
1132 ope.
set(lin+2*nr,col) = 0.5*md(lin,col)/double(l_q+1)
1133 - 0.5*double(l_q+4)/double(l_q+1)*ms(lin,col) ;
1134 for (
int lin=0; lin<nr; lin++)
1135 for (
int col=0; col<nr; col++)
1136 ope.
set(lin+2*nr,col+nr) = -2*ms(lin,col) ;
1137 for (
int lin=0; lin<nr; lin++)
1138 for (
int col=0; col<nr; col++)
1139 ope.
set(lin+2*nr,col+2*nr) = -(l_q+2)*md(lin,col)
1140 + l_q*(l_q+2)*ms(lin,col) ;
1142 for (
int col=0; col<3*nr; col++) {
1143 ope.
set(ind0+nr-2, col) = 0 ;
1144 ope.
set(ind0+nr-1, col) = 0 ;
1145 ope.
set(ind1+nr-2, col) = 0 ;
1146 ope.
set(ind1+nr-1, col) = 0 ;
1147 ope.
set(ind2+nr-1, col) = 0 ;
1149 for (
int col=0; col<nr; col++) {
1150 ope.
set(ind0+nr-1, col+ind0) = 1 ;
1151 ope.
set(ind1+nr-1, col+ind1) = 1 ;
1152 ope.
set(ind2+nr-1, col+ind2) = 1 ;
1154 ope.
set(ind0+nr-2, ind0+1) = 1 ;
1155 ope.
set(ind1+nr-2, ind1+2) = 1 ;
1158 if ((par_mat != 0x0) && (mat_done(l_q) == 0)) {
1161 mat_done.
set(l_q) = 1 ;
1164 const Matrice& oper = (par_mat == 0x0 ? ope :
1170 for (
int lin=0; lin<2*nr; lin++)
1172 for (
int lin=0; lin<nr; lin++)
1173 sec.
set(2*nr+lin) = (*source.get_spectral_va().c_cf)
1177 for (
int lin=0; lin<nr; lin++)
1178 sec.
set(lin) = (*hoverr.get_spectral_va().c_cf)(lz, k, j, lin) ;
1179 for (
int lin=0; lin<nr; lin++)
1180 sec.
set(lin+nr) = -0.5*(*hoverr.get_spectral_va().c_cf)
1183 for (
int lin=0; lin<nr; lin++)
1184 sec.
set(2*nr+lin) = -0.5/double(l_q+1)*(
1186 + (l_q+2)*(*hoverr.get_spectral_va().c_cf)(lz, k, j, lin) ) ;
1189 for (
int lin=0; lin<nr; lin++)
1190 sec.
set(2*nr+lin) = -0.5/double(l_q+1)*(
1192 + (l_q+2)*(*hoverr.get_spectral_va().c_cf)(lz, k, j, lin) )
1193 + (*source.get_spectral_va().c_cf)(lz, k, j, lin) ;
1196 sec.
set(ind0+nr-2) = 0 ;
1197 sec.
set(ind0+nr-1) = 0 ;
1198 sec.
set(ind1+nr-1) = 0 ;
1199 sec.
set(ind1+nr-2) = 0 ;
1200 sec.
set(ind2+nr-1) = 0 ;
1202 for (
int i=0; i<nr; i++) {
1203 sol_part_hrr.
set(lz, k, j, i) = sol(i) ;
1204 sol_part_eta.
set(lz, k, j, i) = sol(i+nr) ;
1205 sol_part_w.
set(lz, k, j, i) = sol(i+2*nr) ;
1208 sec.
set(ind0+nr-2) = 1 ;
1210 for (
int i=0; i<nr; i++) {
1211 sol_hom1_hrr.
set(lz, k, j, i) = sol(i) ;
1212 sol_hom1_eta.
set(lz, k, j, i) = sol(i+nr) ;
1213 sol_hom1_w.
set(lz, k, j, i) = sol(i+2*nr) ;
1215 sec.
set(ind0+nr-2) = 0 ;
1216 sec.
set(ind1+nr-2) = 1 ;
1218 for (
int i=0; i<nr; i++) {
1219 sol_hom2_hrr.
set(lz, k, j, i) = sol(i) ;
1220 sol_hom2_eta.
set(lz, k, j, i) = sol(i+nr) ;
1221 sol_hom2_w.
set(lz, k, j, i) = sol(i+2*nr) ;
1232 int taille = 3*nz_bc ;
1233 if (cedbc) taille-- ;
1237 Tbl sec_membre(taille) ;
1238 Matrice systeme(taille, taille) ;
1239 int ligne ;
int colonne ;
1242 double chrr = (cedbc ? 0 : par_bc->
get_tbl_mod()(4) ) ;
1243 double dhrr = (cedbc ? 0 : par_bc->
get_tbl_mod()(5) ) ;
1244 double ceta = (cedbc ? 0 : par_bc->
get_tbl_mod()(6) ) ;
1245 double deta = (cedbc ? 0 : par_bc->
get_tbl_mod()(7) ) ;
1246 double cw = (cedbc ? 0 : par_bc->
get_tbl_mod()(8) ) ;
1247 double dw = (cedbc ? 0 : par_bc->
get_tbl_mod()(9) ) ;
1248 Mtbl_cf dhom1_hrr = sol_hom1_hrr ;
1249 Mtbl_cf dhom2_hrr = sol_hom2_hrr ;
1250 Mtbl_cf dhom3_hrr = sol_hom3_hrr ;
1251 Mtbl_cf dpart_hrr = sol_part_hrr ;
1252 Mtbl_cf dhom1_eta = sol_hom1_eta ;
1253 Mtbl_cf dhom2_eta = sol_hom2_eta ;
1254 Mtbl_cf dhom3_eta = sol_hom3_eta ;
1255 Mtbl_cf dpart_eta = sol_part_eta ;
1256 Mtbl_cf dhom1_w = sol_hom1_w ;
1257 Mtbl_cf dhom2_w = sol_hom2_w ;
1258 Mtbl_cf dhom3_w = sol_hom3_w ;
1259 Mtbl_cf dpart_w = sol_part_w ;
1267 Mtbl_cf d2hom1_hrr = dhom1_hrr ;
1268 Mtbl_cf d2hom2_hrr = dhom2_hrr ;
1269 Mtbl_cf d2hom3_hrr = dhom3_hrr;
1270 Mtbl_cf d2part_hrr = dpart_hrr ;
1271 d2hom1_hrr.
dsdx(); d2hom2_hrr.
dsdx(); d2hom3_hrr.
dsdx(); d2part_hrr.
dsdx();
1279 for (
int k=0 ; k<np+1 ; k++)
1280 for (
int j=0 ; j<nt ; j++) {
1282 if ((nullite_plm(j, nt, k, np, base) == 1) && (l_q > 1)) {
1290 int nr = mgrid.
get_nr(1);
1291 double alpha2 = mp_aff->
get_alpha()[1] ;
1310 sec_membre.
set(ligne) += blob2;
1331 systeme.
set(ligne, colonne) =
1333 systeme.
set(ligne, colonne+1) =
1335 systeme.
set(ligne, colonne+2) =
1341 systeme.
set(ligne, colonne) =
1343 systeme.
set(ligne, colonne+1) =
1345 systeme.
set(ligne, colonne+2) =
1351 systeme.
set(ligne, colonne) =
1353 systeme.
set(ligne, colonne+1) =
1355 systeme.
set(ligne, colonne+2) =
1364 for (
int zone=2 ; zone<nz_bc ; zone++) {
1365 nr = mgrid.
get_nr(zone) ;
1369 systeme.
set(ligne, colonne) =
1371 systeme.
set(ligne, colonne+1) =
1373 systeme.
set(ligne, colonne+2) =
1379 systeme.
set(ligne, colonne) =
1381 systeme.
set(ligne, colonne+1) =
1383 systeme.
set(ligne, colonne+2) =
1389 systeme.
set(ligne, colonne) =
1391 systeme.
set(ligne, colonne+1) =
1393 systeme.
set(ligne, colonne+2) =
1400 systeme.
set(ligne, colonne) =
1402 systeme.
set(ligne, colonne+1) =
1404 systeme.
set(ligne, colonne+2) =
1410 systeme.
set(ligne, colonne) =
1412 systeme.
set(ligne, colonne+1) =
1414 systeme.
set(ligne, colonne+2) =
1420 systeme.
set(ligne, colonne) =
1422 systeme.
set(ligne, colonne+1) =
1424 systeme.
set(ligne, colonne+2) =
1433 nr = mgrid.
get_nr(nz_bc) ;
1434 double alpha = mp_aff->
get_alpha()[nz_bc] ;
1438 systeme.
set(ligne, colonne) =
1440 systeme.
set(ligne, colonne+1) =
1442 if (!cedbc) systeme.
set(ligne, colonne+2) =
1448 systeme.
set(ligne, colonne) =
1450 systeme.
set(ligne, colonne+1) =
1452 if (!cedbc) systeme.
set(ligne, colonne+2) =
1458 systeme.
set(ligne, colonne) =
1460 systeme.
set(ligne, colonne+1) =
1462 if (!cedbc) systeme.
set(ligne, colonne+2) =
1469 systeme.
set(ligne, colonne) =
1476 systeme.
set(ligne, colonne+1) =
1483 systeme.
set(ligne, colonne+2) =
1517 for (
int i=0 ; i<nr ; i++) {
1518 mhrr.
set(0, k, j, i) = 0 ;
1519 meta.
set(0, k, j, i) = 0 ;
1520 mw.
set(0, k, j, i) = 0 ;
1522 for (
int zone=1 ; zone<=n_shell ; zone++) {
1523 nr = mgrid.
get_nr(zone) ;
1524 for (
int i=0 ; i<nr ; i++) {
1525 mhrr.
set(zone, k, j, i) = sol_part_hrr(zone, k, j, i)
1526 + facteur(conte)*sol_hom1_hrr(zone, k, j, i)
1527 + facteur(conte+1)*sol_hom2_hrr(zone, k, j, i)
1528 + facteur(conte+2)*sol_hom3_hrr(zone, k, j, i) ;
1530 meta.
set(zone, k, j, i) = sol_part_eta(zone, k, j, i)
1531 + facteur(conte)*sol_hom1_eta(zone, k, j, i)
1532 + facteur(conte+1)*sol_hom2_eta(zone, k, j, i)
1533 + facteur(conte+2)*sol_hom3_eta(zone, k, j, i) ;
1535 mw.
set(zone, k, j, i) = sol_part_w(zone, k, j, i)
1536 + facteur(conte)*sol_hom1_w(zone, k, j, i)
1537 + facteur(conte+1)*sol_hom2_w(zone, k, j, i)
1538 + facteur(conte+2)*sol_hom3_w(zone, k, j, i) ;
1543 nr = mgrid.
get_nr(nzm1) ;
1544 for (
int i=0 ; i<nr ; i++) {
1545 mhrr.
set(nzm1, k, j, i) = sol_part_hrr(nzm1, k, j, i)
1546 + facteur(conte)*sol_hom1_hrr(nzm1, k, j, i)
1547 + facteur(conte+1)*sol_hom2_hrr(nzm1, k, j, i) ;
1549 meta.
set(nzm1, k, j, i) = sol_part_eta(nzm1, k, j, i)
1550 + facteur(conte)*sol_hom1_eta(nzm1, k, j, i)
1551 + facteur(conte+1)*sol_hom2_eta(nzm1, k, j, i) ;
1553 mw.
set(nzm1, k, j, i) = sol_part_w(nzm1, k, j, i)
1554 + facteur(conte)*sol_hom1_w(nzm1, k, j, i)
1555 + facteur(conte+1)*sol_hom2_w(nzm1, k, j, i) ;
1595 assert(mp_aff != 0x0) ;
1608 int nt = mgrid.
get_nt(0) ;
1609 int np = mgrid.
get_np(0) ;
1611 Scalar source = hh ;
1613 Scalar source_coq = hh ;
1615 source_coq.set_spectral_va().ylm() ;
1616 Base_val base = source.get_spectral_base() ;
1618 int lmax = base.give_lmax(mgrid, 0) + 1;
1625 Mtbl_cf sol_part_hrr(mgrid, base) ; sol_part_hrr.annule_hard() ;
1626 Mtbl_cf sol_part_eta(mgrid, base) ; sol_part_eta.annule_hard() ;
1627 Mtbl_cf sol_hom1_hrr(mgrid, base) ; sol_hom1_hrr.annule_hard() ;
1628 Mtbl_cf sol_hom1_eta(mgrid, base) ; sol_hom1_eta.annule_hard() ;
1629 Mtbl_cf sol_hom2_hrr(mgrid, base) ; sol_hom2_hrr.annule_hard() ;
1630 Mtbl_cf sol_hom2_eta(mgrid, base) ; sol_hom2_eta.annule_hard() ;
1632 bool need_calculation = true ;
1637 int l_q, m_q, base_r ;
1638 Itbl mat_done(lmax) ;
1644 int nr = mgrid.
get_nr(lz) ;
1645 double alpha = mp_aff->
get_alpha()[lz] ;
1646 Matrice ope(2*nr, 2*nr) ;
1647 if (need_calculation && (par_mat != 0x0)) mat_done.annule_hard() ;
1649 for (
int k=0 ; k<np+1 ; k++) {
1650 for (
int j=0 ; j<nt ; j++) {
1652 base.give_quant_numbers(lz, k, j, m_q, l_q, base_r) ;
1653 if ( (nullite_plm(j, nt, k, np, base) == 1) && (l_q < 2)) {
1654 if (need_calculation) {
1655 ope.set_etat_qcq() ;
1656 Diff_dsdx od(base_r, nr) ;
const Matrice& md = od.get_matrice() ;
1657 Diff_sx os(base_r, nr) ;
const Matrice& ms = os.get_matrice() ;
1659 for (
int lin=0; lin<nr; lin++)
1660 for (
int col=0; col<nr; col++)
1661 ope.set(lin,col) = md(lin,col) + 3*ms(lin,col) ;
1662 for (
int lin=0; lin<nr; lin++)
1663 for (
int col=0; col<nr; col++)
1664 ope.set(lin,col+nr) = -l_q*(l_q+1)*ms(lin,col) ;
1665 for (
int lin=0; lin<nr; lin++)
1666 for (
int col=0; col<nr; col++)
1667 ope.set(lin+nr,col) = -0.5*ms(lin,col) ;
1668 for (
int lin=0; lin<nr; lin++)
1669 for (
int col=0; col<nr; col++)
1670 ope.set(lin+nr,col+nr) = md(lin,col) + 3*ms(lin, col);
1673 for (
int col=0; col<2*nr; col++) {
1674 ope.set(nr-1, col) = 0 ;
1675 ope.set(2*nr-1, col) = 0 ;
1679 for (
int col=0; col<nr; col++) {
1680 ope.set(nr-1, col) = pari ;
1681 ope.set(2*nr-1, col+nr) = pari ;
1686 ope.set(nr-1, nr-1) = 1 ;
1687 ope.set(2*nr-1, 2*nr-1) = 1 ;
1691 if ((par_mat != 0x0) && (mat_done(l_q) == 0)) {
1692 Matrice* pope =
new Matrice(ope) ;
1694 mat_done.set(l_q) = 1 ;
1698 const Matrice& oper = (par_mat == 0x0 ? ope :
1701 sec.set_etat_qcq() ;
1702 for (
int lin=0; lin<nr; lin++)
1703 sec.set(lin) = (*source.get_spectral_va().c_cf)(lz, k, j, lin) ;
1704 for (
int lin=0; lin<nr; lin++)
1705 sec.set(nr+lin) = -0.5*(*source.get_spectral_va().c_cf)
1711 for (
int col=0; col<nr; col++) {
1713 (*source_coq.get_spectral_va().c_cf)(lz, k, j, col) ;
1716 sec.set(nr-1) = h0 / 3. ;
1718 sec.set(2*nr-1) = 0 ;
1719 Tbl sol = oper.inverse(sec) ;
1720 for (
int i=0; i<nr; i++) {
1721 sol_part_hrr.set(lz, k, j, i) = sol(i) ;
1722 sol_part_eta.set(lz, k, j, i) = sol(i+nr) ;
1734 for (
int lz=1; lz<nz-1; lz++) {
1735 if (need_calculation && (par_mat != 0x0)) mat_done.annule_hard() ;
1736 int nr = mgrid.
get_nr(lz) ;
1739 assert(mgrid.
get_nt(lz) == nt) ;
1740 assert(mgrid.
get_np(lz) == np) ;
1741 double alpha = mp_aff->
get_alpha()[lz] ;
1742 double ech = mp_aff->
get_beta()[lz] / alpha ;
1743 Matrice ope(2*nr, 2*nr) ;
1745 for (
int k=0 ; k<np+1 ; k++) {
1746 for (
int j=0 ; j<nt ; j++) {
1748 base.give_quant_numbers(lz, k, j, m_q, l_q, base_r) ;
1749 if ( (nullite_plm(j, nt, k, np, base) == 1) && (l_q < 2)) {
1750 if (need_calculation) {
1751 ope.set_etat_qcq() ;
1752 Diff_xdsdx oxd(base_r, nr) ;
const Matrice& mxd = oxd.get_matrice() ;
1753 Diff_dsdx od(base_r, nr) ;
const Matrice& md = od.get_matrice() ;
1754 Diff_id oid(base_r, nr) ;
const Matrice& mid = oid.get_matrice() ;
1756 for (
int lin=0; lin<nr; lin++)
1757 for (
int col=0; col<nr; col++)
1758 ope.set(lin,col) = mxd(lin,col) + ech*md(lin,col)
1760 for (
int lin=0; lin<nr; lin++)
1761 for (
int col=0; col<nr; col++)
1762 ope.set(lin,col+nr) = -l_q*(l_q+1)*mid(lin,col) ;
1763 for (
int lin=0; lin<nr; lin++)
1764 for (
int col=0; col<nr; col++)
1765 ope.set(lin+nr,col) = -0.5*mid(lin,col) ;
1766 for (
int lin=0; lin<nr; lin++)
1767 for (
int col=0; col<nr; col++)
1768 ope.set(lin+nr,col+nr) = mxd(lin,col) + ech*md(lin,col)
1771 for (
int col=0; col<2*nr; col++) {
1772 ope.set(ind0+nr-1, col) = 0 ;
1773 ope.set(ind1+nr-1, col) = 0 ;
1775 ope.set(ind0+nr-1, ind0) = 1 ;
1776 ope.set(ind1+nr-1, ind1) = 1 ;
1779 if ((par_mat != 0x0) && (mat_done(l_q) == 0)) {
1780 Matrice* pope =
new Matrice(ope) ;
1782 mat_done.set(l_q) = 1 ;
1785 const Matrice& oper = (par_mat == 0x0 ? ope :
1788 sec.set_etat_qcq() ;
1789 for (
int lin=0; lin<nr; lin++)
1790 sec.set(lin) = (*source_coq.get_spectral_va().c_cf)
1792 for (
int lin=0; lin<nr; lin++)
1793 sec.set(nr+lin) = -0.5*(*source_coq.get_spectral_va().c_cf)
1795 sec.set(ind0+nr-1) = 0 ;
1796 sec.set(ind1+nr-1) = 0 ;
1797 Tbl sol = oper.inverse(sec) ;
1799 for (
int i=0; i<nr; i++) {
1800 sol_part_hrr.set(lz, k, j, i) = sol(i) ;
1801 sol_part_eta.set(lz, k, j, i) = sol(i+nr) ;
1804 sec.set(ind0+nr-1) = 1 ;
1805 sol = oper.inverse(sec) ;
1806 for (
int i=0; i<nr; i++) {
1807 sol_hom1_hrr.set(lz, k, j, i) = sol(i) ;
1808 sol_hom1_eta.set(lz, k, j, i) = sol(i+nr) ;
1810 sec.set(ind0+nr-1) = 0 ;
1811 sec.set(ind1+nr-1) = 1 ;
1812 sol = oper.inverse(sec) ;
1813 for (
int i=0; i<nr; i++) {
1814 sol_hom2_hrr.set(lz, k, j, i) = sol(i) ;
1815 sol_hom2_eta.set(lz, k, j, i) = sol(i+nr) ;
1826 if (need_calculation && (par_mat != 0x0)) mat_done.annule_hard() ;
1827 int nr = mgrid.
get_nr(lz) ;
1830 assert(mgrid.
get_nt(lz) == nt) ;
1831 assert(mgrid.
get_np(lz) == np) ;
1832 double alpha = mp_aff->
get_alpha()[lz] ;
1833 Matrice ope(2*nr, 2*nr) ;
1835 for (
int k=0 ; k<np+1 ; k++) {
1836 for (
int j=0 ; j<nt ; j++) {
1838 base.give_quant_numbers(lz, k, j, m_q, l_q, base_r) ;
1839 if ( (nullite_plm(j, nt, k, np, base) == 1) && (l_q < 2)) {
1840 if (need_calculation) {
1841 ope.set_etat_qcq() ;
1842 Diff_dsdx od(base_r, nr) ;
const Matrice& md = od.get_matrice() ;
1843 Diff_sx os(base_r, nr) ;
const Matrice& ms = os.get_matrice() ;
1845 for (
int lin=0; lin<nr; lin++)
1846 for (
int col=0; col<nr; col++)
1847 ope.set(lin,col) = - md(lin,col) + 3*ms(lin,col) ;
1848 for (
int lin=0; lin<nr; lin++)
1849 for (
int col=0; col<nr; col++)
1850 ope.set(lin,col+nr) = -l_q*(l_q+1)*ms(lin,col) ;
1851 for (
int lin=0; lin<nr; lin++)
1852 for (
int col=0; col<nr; col++)
1853 ope.set(lin+nr,col) = -0.5*ms(lin,col) ;
1854 for (
int lin=0; lin<nr; lin++)
1855 for (
int col=0; col<nr; col++)
1856 ope.set(lin+nr,col+nr) = -md(lin,col) + 3*ms(lin, col) ;
1859 for (
int col=0; col<2*nr; col++) {
1860 ope.set(ind0+nr-2, col) = 0 ;
1861 ope.set(ind0+nr-1, col) = 0 ;
1862 ope.set(ind1+nr-2, col) = 0 ;
1863 ope.set(ind1+nr-1, col) = 0 ;
1865 for (
int col=0; col<nr; col++) {
1866 ope.set(ind0+nr-1, col+ind0) = 1 ;
1867 ope.set(ind1+nr-1, col+ind1) = 1 ;
1869 ope.set(ind0+nr-2, ind0+1) = 1 ;
1870 ope.set(ind1+nr-2, ind1+1) = 1 ;
1873 if ((par_mat != 0x0) && (mat_done(l_q) == 0)) {
1874 Matrice* pope =
new Matrice(ope) ;
1876 mat_done.set(l_q) = 1 ;
1879 const Matrice& oper = (par_mat == 0x0 ? ope :
1882 sec.set_etat_qcq() ;
1883 for (
int lin=0; lin<nr; lin++)
1884 sec.set(lin) = (*source.get_spectral_va().c_cf)
1886 for (
int lin=0; lin<nr; lin++)
1887 sec.set(nr+lin) = -0.5*(*source.get_spectral_va().c_cf)
1889 sec.set(ind0+nr-2) = 0 ;
1890 sec.set(ind0+nr-1) = 0 ;
1891 sec.set(ind1+nr-2) = 0 ;
1892 sec.set(ind1+nr-1) = 0 ;
1893 Tbl sol = oper.inverse(sec) ;
1894 for (
int i=0; i<nr; i++) {
1895 sol_part_hrr.set(lz, k, j, i) = sol(i) ;
1896 sol_part_eta.set(lz, k, j, i) = sol(i+nr) ;
1899 sec.set(ind0+nr-2) = 1 ;
1900 sol = oper.inverse(sec) ;
1901 for (
int i=0; i<nr; i++) {
1902 sol_hom1_hrr.set(lz, k, j, i) = sol(i) ;
1903 sol_hom1_eta.set(lz, k, j, i) = sol(i+nr) ;
1905 sec.set(ind0+nr-2) = 0 ;
1906 sec.set(ind1+nr-2) = 1 ;
1907 sol = oper.inverse(sec) ;
1908 for (
int i=0; i<nr; i++) {
1909 sol_hom2_hrr.set(lz, k, j, i) = sol(i) ;
1910 sol_hom2_eta.set(lz, k, j, i) = sol(i+nr) ;
1919 Mtbl_cf dhom1_hrr = sol_hom1_hrr ;
1920 Mtbl_cf dhom2_hrr = sol_hom2_hrr ;
1921 Mtbl_cf dpart_hrr = sol_part_hrr ;
1922 Mtbl_cf dhom1_eta = sol_hom1_eta ;
1923 Mtbl_cf dhom2_eta = sol_hom2_eta ;
1924 Mtbl_cf dpart_eta = sol_part_eta ;
1926 dhom1_hrr.dsdx() ; dhom1_eta.dsdx() ;
1927 dhom2_hrr.dsdx() ; dhom2_eta.dsdx() ;
1928 dpart_hrr.dsdx() ; dpart_eta.dsdx() ;
1932 int taille = 2*(nz-1) ;
1936 Tbl sec_membre(taille) ;
1937 Matrice systeme(taille, taille) ;
1938 int ligne ;
int colonne ;
1942 for (
int k=0 ; k<np+1 ; k++)
1943 for (
int j=0 ; j<nt ; j++) {
1944 base.give_quant_numbers(0, k, j, m_q, l_q, base_r) ;
1945 if ((nullite_plm(j, nt, k, np, base) == 1) && (l_q < 2)) {
1948 systeme.annule_hard() ;
1949 sec_membre.annule_hard() ;
1956 sec_membre.set(ligne) = 0.;
1959 sec_membre.set(ligne) = 0.;
1964 double alpha2 = mp_aff->
get_alpha()[1] ;
1971 systeme.set(ligne, colonne) = - (4. - double(l_q*(l_q+1.)))*sol_hom1_hrr.val_in_bound_jk(1,j,k) - 2.*dhom1_hrr.val_in_bound_jk(1,j,k)/alpha2;
1973 systeme.set(ligne, colonne +1) = - (4. - double(l_q*(l_q+1.)))*sol_hom2_hrr.val_in_bound_jk(1,j,k) - 2.*dhom2_hrr.val_in_bound_jk(1,j,k)/alpha2;
1975 sec_membre.set(ligne) = (4. - double(l_q*(l_q+1.)))*sol_part_hrr.val_in_bound_jk(1,j,k) + 2.*dpart_hrr.val_in_bound_jk(1,j,k)/alpha2 - blob;
1981 systeme.set(ligne, colonne) = - ( 2.*dhom1_eta.val_in_bound_jk(1,j,k)/alpha2 + (2.-double(l_q*(l_q+1.)))*sol_hom1_eta.val_in_bound_jk(1,j,k) + 2.*sol_hom1_hrr.val_in_bound_jk(1,j,k));
1983 systeme.set(ligne, colonne +1) = - ( 2.*dhom2_eta.val_in_bound_jk(1,j,k)/alpha2 + (2.-double(l_q*(l_q+1.)))*sol_hom2_eta.val_in_bound_jk(1,j,k) + 2.*sol_hom2_hrr.val_in_bound_jk(1,j,k));
1985 sec_membre.set(ligne) = 2.*dpart_eta.val_in_bound_jk(1,j,k)/alpha2 + (2.-double(l_q*(l_q+1.)))*sol_part_eta.val_in_bound_jk(1,j,k) + 2.*sol_part_hrr.val_in_bound_jk(1,j,k) - blob2;
1990 systeme.set(ligne, colonne) =
1991 sol_hom1_hrr.val_out_bound_jk(1, j, k) ;
1992 systeme.set(ligne, colonne+1) =
1993 sol_hom2_hrr.val_out_bound_jk(1, j, k) ;
1995 sec_membre.set(ligne) -= sol_part_hrr.val_out_bound_jk(1, j, k) ;
1998 systeme.set(ligne, colonne) =
1999 sol_hom1_eta.val_out_bound_jk(1, j, k) ;
2000 systeme.set(ligne, colonne+1) =
2001 sol_hom2_eta.val_out_bound_jk(1, j, k) ;
2003 sec_membre.set(ligne) -= sol_part_eta.val_out_bound_jk(1, j, k) ;
2009 for (
int zone=2 ; zone<nz-1 ; zone++) {
2010 nr = mgrid.
get_nr(zone) ;
2014 systeme.set(ligne, colonne) =
2015 - sol_hom1_hrr.val_in_bound_jk(zone, j, k) ;
2016 systeme.set(ligne, colonne+1) =
2017 - sol_hom2_hrr.val_in_bound_jk(zone, j, k) ;
2019 sec_membre.set(ligne) += sol_part_hrr.val_in_bound_jk(zone, j, k) ;
2022 systeme.set(ligne, colonne) =
2023 - sol_hom1_eta.val_in_bound_jk(zone, j, k) ;
2024 systeme.set(ligne, colonne+1) =
2025 - sol_hom2_eta.val_in_bound_jk(zone, j, k) ;
2027 sec_membre.set(ligne) += sol_part_eta.val_in_bound_jk(zone, j, k) ;
2031 systeme.set(ligne, colonne) =
2032 sol_hom1_hrr.val_out_bound_jk(zone, j, k) ;
2033 systeme.set(ligne, colonne+1) =
2034 sol_hom2_hrr.val_out_bound_jk(zone, j, k) ;
2036 sec_membre.set(ligne) -= sol_part_hrr.val_out_bound_jk(zone, j, k) ;
2039 systeme.set(ligne, colonne) =
2040 sol_hom1_eta.val_out_bound_jk(zone, j, k) ;
2041 systeme.set(ligne, colonne+1) =
2042 sol_hom2_eta.val_out_bound_jk(zone, j, k) ;
2044 sec_membre.set(ligne) -= sol_part_eta.val_out_bound_jk(zone, j, k) ;
2050 nr = mgrid.
get_nr(nz-1) ;
2054 systeme.set(ligne, colonne) =
2055 - sol_hom1_hrr.val_in_bound_jk(nz-1, j, k) ;
2056 systeme.set(ligne, colonne+1) =
2057 - sol_hom2_hrr.val_in_bound_jk(nz-1, j, k) ;
2059 sec_membre.set(ligne) += sol_part_hrr.val_in_bound_jk(nz-1, j, k) ;
2062 systeme.set(ligne, colonne) =
2063 - sol_hom1_eta.val_in_bound_jk(nz-1, j, k) ;
2064 systeme.set(ligne, colonne+1) =
2065 - sol_hom2_eta.val_in_bound_jk(nz-1, j, k) ;
2067 sec_membre.set(ligne) += sol_part_eta.val_in_bound_jk(nz-1, j, k) ;
2073 Tbl facteur = systeme.inverse(sec_membre) ;
2079 for (
int i=0 ; i<nr ; i++) {
2080 mhrr.set(0, k, j, i) = sol_part_hrr(0, k, j, i) ;
2081 meta.set(0, k, j, i) = sol_part_eta(0, k, j, i) ;
2083 for (
int zone=1 ; zone<nz-1 ; zone++) {
2084 nr = mgrid.
get_nr(zone) ;
2085 for (
int i=0 ; i<nr ; i++) {
2086 mhrr.set(zone, k, j, i) = sol_part_hrr(zone, k, j, i)
2087 + facteur(conte)*sol_hom1_hrr(zone, k, j, i)
2088 + facteur(conte+1)*sol_hom2_hrr(zone, k, j, i) ;
2090 meta.set(zone, k, j, i) = sol_part_eta(zone, k, j, i)
2091 + facteur(conte)*sol_hom1_eta(zone, k, j, i)
2092 + facteur(conte+1)*sol_hom2_eta(zone, k, j, i) ;
2096 nr = mgrid.
get_nr(nz-1) ;
2097 for (
int i=0 ; i<nr ; i++) {
2098 mhrr.set(nz-1, k, j, i) = sol_part_hrr(nz-1, k, j, i)
2099 + facteur(conte)*sol_hom1_hrr(nz-1, k, j, i)
2100 + facteur(conte+1)*sol_hom2_hrr(nz-1, k, j, i) ;
2102 meta.set(nz-1, k, j, i) = sol_part_eta(nz-1, k, j, i)
2103 + facteur(conte)*sol_hom1_eta(nz-1, k, j, i)
2104 + facteur(conte+1)*sol_hom2_eta(nz-1, k, j, i) ;
int get_type_p() const
Returns the type of sampling in the direction: SYM : : symmetry with respect to the transformatio...
const Base_val & get_spectral_base() const
Returns the spectral bases of the Valeur va.
virtual const Matrice & get_matrice() const
Returns the matrix associated with the operator.
void add_tbl_mod(Tbl &ti, int position=0)
Adds the address of a new modifiable Tbl to the list.
void annule_domain(int l)
Sets the Tensor to zero in a given domain.
void annule_l(int l_min, int l_max, bool ylm_output=false)
Sets all the multipolar components between l_min and l_max to zero.
Mtbl_cf * c_cf
Coefficients of the spectral expansion of the function.
const double * get_alpha() const
Returns the pointer on the array alpha.
int & set(int i)
Read/write of a particular element (index i ) (1D case)
void mult_r()
Multiplication by r everywhere; dzpuis is not changed.
int give_lmax(const Mg3d &mgrid, int lz) const
Returns the highest multipole for a given grid.
void ylm_i()
Inverse of ylm()
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
void set_etat_cf_qcq()
Sets the logical state to ETATQCQ (ordinary state) for values in the configuration space (Mtbl_cf c_c...
int get_n_matrice_mod() const
Returns the number of modifiable Matrice 's addresses in the list.
void give_quant_numbers(int, int, int, int &, int &, int &) const
Computes the various quantum numbers and 1d radial base.
void set_lu() const
Calculate the LU-representation, assuming the band-storage has been done.
Tbl & set(int l)
Read/write of the Tbl containing the coefficients in a given domain.
Tbl inverse(const Tbl &sec_membre) const
Solves the linear system represented by the matrix.
void ylm()
Computes the coefficients of *this.
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
void annule_hard()
Sets the Itbl to zero in a hard way.
double & set(int i)
Read/write of a particular element (index i) (1D case)
virtual const Matrice & get_matrice() const
Returns the matrix associated with the operator.
Tensor field of valence 0 (or component of a tensorial field).
void add_matrice_mod(Matrice &ti, int position=0)
Adds the address of a new modifiable Matrice to the list.
int get_type_t() const
Returns the type of sampling in the direction: SYM : : symmetry with respect to the equatorial pl...
Basic integer array class.
Class for the elementary differential operator (see the base class Diff ).
int get_etat() const
Returns the logical state ETATNONDEF (undefined), ETATZERO (null) or ETATQCQ (ordinary).
virtual void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
void clean_all()
Deletes all the objects stored as modifiables, i.e.
double val_out_bound_jk(int l, int j, int k) const
Computes the angular coefficient of index j,k of the field represented by *this at by means of the s...
void add_itbl_mod(Itbl &ti, int position=0)
Adds the address of a new modifiable Itbl to the list.
void annule_hard()
Sets the Scalar to zero in a hard way.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Class for the elementary differential operator Identity (see the base class Diff ).
double val_in_bound_jk(int l, int j, int k) const
Computes the angular coefficient of index j,k of the field represented by *this at by means of the s...
int get_n_int() const
Returns the number of stored int 's addresses.
const int & get_int(int position=0) const
Returns the reference of a int stored in the list.
#define R_CHEBP
base de Cheb. paire (rare) seulement
int get_n_itbl_mod() const
Returns the number of modifiable Itbl 's addresses in the list.
void sol_Dirac_BC3(const Scalar &bb, const Scalar &hh, Scalar &hrr, Scalar &tilde_eta, Scalar &ww, Scalar bound_hrr, Scalar bound_eta, Param *par_bc, Param *par_mat)
Same resolution as sol_Dirac_Abound, but here the boundary conditions are the degenerate elliptic con...
const double * get_beta() const
Returns the pointer on the array beta.
Mtbl * c
Values of the function at the points of the multi-grid.
Tbl & get_tbl_mod(int position=0) const
Returns the reference of a modifiable Tbl stored in the list.
int get_nzone() const
Returns the number of domains.
int & get_int_mod(int position=0) const
Returns the reference of a modifiable int stored in the list.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Itbl & get_itbl_mod(int position=0) const
Returns the reference of a stored modifiable Itbl .
void annule_hard()
Sets the logical state to ETATQCQ (undefined state).
int get_n_int_mod() const
Returns the number of modifiable int 's addresses in the list.
double & set(int j, int i)
Read/write of a particuliar element.
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
void set_spectral_base(const Base_val &)
Sets the spectral bases of the Valeur va
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
int get_n_tbl_mod() const
Returns the number of modifiable Tbl 's addresses in the list.
Bases of the spectral expansions.
void annule_hard()
Sets the Mtbl_cf to zero in a hard way.
Class for the elementary differential operator (see the base class Diff ).
void sol_Dirac_A2(const Scalar &aaa, Scalar &tilde_mu, Scalar &x_new, Scalar bound_mu, const Param *par_bc)
Same resolution as sol_Dirac_Abound, but here the boundary conditions are the degenerate elliptic con...
void mult_x()
The basis is transformed as with a multiplication by .
Coefficients storage for the multi-domain spectral method.
const Scalar & dsdr() const
Returns of *this .
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Matrice & get_matrice_mod(int position=0) const
Returns the reference of a modifiable Matrice stored in the list.
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
Valeur & set_spectral_va()
Returns va (read/write version)
virtual const Matrice & get_matrice() const
Returns the matrix associated with the operator.
Class for the elementary differential operator division by (see the base class Diff )...
int get_type_r(int l) const
Returns the type of sampling in the radial direction in domain no.
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...
const Map *const mp
Mapping on which the numerical values at the grid points are defined.
void div_r_dzpuis(int ced_mult_r)
Division by r everywhere but with the output flag dzpuis set to ced_mult_r .
void annule_hard()
Sets the Tbl to zero in a hard way.
virtual const Matrice & get_matrice() const
Returns the matrix associated with the operator.
void mult_r_dzpuis(int ced_mult_r)
Multiplication by r everywhere but with the output flag dzpuis set to ced_mult_r ...
void add_int_mod(int &n, int position=0)
Adds the address of a new modifiable int to the list.
const Valeur & get_spectral_va() const
Returns va (read only version)