75 assert(mp_aff != 0x0) ;
81 if (
etat == ETATZERO) {
82 if (mu.get_etat() == ETATZERO)
90 bool ced = (mgrid.
get_type_r(nzm1) == UNSURR) ;
92 int domain_bc = par_bc.
get_int(0) ;
93 bool bc_ced = ((ced) && (domain_bc == nzm1)) ;
95 int n_conditions = par_bc.
get_int(1) ;
96 assert ((n_conditions==1)||(n_conditions==2)) ;
97 bool derivative = (n_conditions == 2) ;
98 int dl = 0 ;
int l_min = 0 ;
int excised_i =0;
106 bool isexcised = (excised_i==1);
108 int nt = mgrid.
get_nt(0) ;
109 int np = mgrid.
get_np(0) ;
118 if (mu.get_etat() == ETATZERO)
120 int system01_size =0;
122 if (isexcised ==
false){
130 for (
int lz=1; lz<=domain_bc; lz++) {
131 system01_size += n_conditions ;
132 system_size += n_conditions ;
134 assert (
etat != ETATNONDEF) ;
136 bool need_matrices = true ;
139 need_matrices =
false ;
141 Matrice system_l0(system01_size, system01_size) ;
142 Matrice system_l1(system01_size, system01_size) ;
143 Matrice system_even(system_size, system_size) ;
144 Matrice system_odd(system_size, system_size) ;
151 int index = 0 ;
int index01 = 0 ;
154 if (isexcised ==
false){
155 system_even.
set(index, index) = 1. ;
156 system_even.
set(index, index + 1) = -1. ;
157 system_odd.
set(index, index) = -(2.*nr - 5.)/alpha ;
158 system_odd.
set(index, index+1) = (2.*nr - 3.)/alpha ;
160 if (domain_bc == 0) {
161 system_l0.
set(index01, index01) = c_val + c_der*4.*(nr-1)*(nr-1)/alpha ;
162 system_l1.
set(index01, index01) = c_val + c_der*(2*nr-3)*(2*nr-3)/alpha ;
164 system_even.
set(index, index-1) = c_val + c_der*4.*(nr-2)*(nr-2)/alpha ;
165 system_even.
set(index, index) = c_val + c_der*4.*(nr-1)*(nr-1)/alpha ;
166 system_odd.
set(index, index-1) = c_val + c_der*(2*nr-5)*(2*nr-5)/alpha ;
167 system_odd.
set(index, index) = c_val + c_der*(2*nr-3)*(2*nr-3)/alpha ;
171 system_l0.
set(index01, index01) = 1. ;
172 system_l1.
set(index01, index01) = 1. ;
173 system_even.
set(index, index-1) = 1. ;
174 system_even.
set(index, index) = 1. ;
175 system_odd.
set(index, index-1) = 1. ;
176 system_odd.
set(index, index) = 1. ;
178 system_l0.
set(index01+1, index01) = 4*(nr-1)*(nr-1)/alpha ;
179 system_l1.
set(index01+1, index01) = (2*nr-3)*(2*nr-3)/alpha ;
180 system_even.
set(index+1, index-1) = 4*(nr-2)*(nr-2)/alpha ;
181 system_even.
set(index+1, index) = 4*(nr-1)*(nr-1)/alpha ;
182 system_odd.
set(index+1, index-1) = (2*nr-5)*(2*nr-5)/alpha ;
183 system_odd.
set(index+1, index) = (2*nr-3)*(2*nr-3)/alpha ;
190 if ((1 == domain_bc)&&(bc_ced))
191 alpha = -0.25/alpha ;
192 system_l0.
set(index01, index01+1) = 1. ;
193 system_l0.
set(index01, index01+2) = -1. ;
194 system_l1.
set(index01, index01+1) = 1. ;
195 system_l1.
set(index01, index01+2) = -1. ;
197 system_even.
set(index, index+1) = 1. ;
198 system_even.
set(index, index+2) = -1. ;
199 system_odd.
set(index, index+1) = 1. ;
200 system_odd.
set(index, index+2) = -1. ;
203 system_l0.
set(index01, index01) = -(nr-2)*(nr-2)/alpha ;
204 system_l0.
set(index01, index01+1) = (nr-1)*(nr-1)/alpha ;
205 system_l1.
set(index01, index01) = -(nr-2)*(nr-2)/alpha ;
206 system_l1.
set(index01, index01+1) = (nr-1)*(nr-1)/alpha ;
208 system_even.
set(index, index) = -(nr-2)*(nr-2)/alpha ;
209 system_even.
set(index, index+1) = (nr-1)*(nr-1)/alpha ;
210 system_odd.
set(index, index) = -(nr-2)*(nr-2)/alpha ;
211 system_odd.
set(index, index+1) = (nr-1)*(nr-1)/alpha ;
215 if (1 == domain_bc) {
216 system_l0.
set(index01, index01-1) = c_val + c_der*(nr-2)*(nr-2)/alpha ;
217 system_l0.
set(index01, index01) = c_val + c_der*(nr-1)*(nr-1)/alpha ;
218 system_l1.
set(index01, index01-1) = c_val + c_der*(nr-2)*(nr-2)/alpha ;
219 system_l1.
set(index01, index01) = c_val + c_der*(nr-1)*(nr-1)/alpha ;
221 system_even.
set(index, index-1) = c_val + c_der*(nr-2)*(nr-2)/alpha ;
222 system_even.
set(index, index) = c_val + c_der*(nr-1)*(nr-1)/alpha ;
223 system_odd.
set(index, index-1) = c_val + c_der*(nr-2)*(nr-2)/alpha ;
224 system_odd.
set(index, index) = c_val + c_der*(nr-1)*(nr-1)/alpha ;
228 system_l0.
set(index01, index01-1) = 1. ;
229 system_l0.
set(index01, index01) = 1. ;
230 system_l1.
set(index01, index01-1) = 1. ;
231 system_l1.
set(index01, index01) = 1. ;
232 system_even.
set(index, index-1) = 1. ;
233 system_even.
set(index, index) = 1. ;
234 system_odd.
set(index, index-1) = 1. ;
235 system_odd.
set(index, index) = 1. ;
237 system_l0.
set(index01+1, index01-1) = (nr-2)*(nr-2)/alpha ;
238 system_l0.
set(index01+1, index01) = (nr-1)*(nr-1)/alpha ;
239 system_l1.
set(index01+1, index01-1) = (nr-2)*(nr-2)/alpha ;
240 system_l1.
set(index01+1, index01) = (nr-1)*(nr-1)/alpha ;
241 system_even.
set(index+1, index-1) = (nr-2)*(nr-2)/alpha ;
242 system_even.
set(index+1, index) = (nr-1)*(nr-1)/alpha ;
243 system_odd.
set(index+1, index-1) = (nr-2)*(nr-2)/alpha ;
244 system_odd.
set(index+1, index) = (nr-1)*(nr-1)/alpha ;
252 if ((1 == domain_bc)&&(bc_ced))
253 alpha = -0.25/alpha ;
254 if (1 == domain_bc) {
255 system_l0.
set(index01, index01) = c_val + c_der*(nr-1)*(nr-1)/alpha ;
256 system_l1.
set(index01, index01) = c_val + c_der*(nr-1)*(nr-1)/alpha ;
258 system_even.
set(index, index) = c_val + c_der*(nr-1)*(nr-1)/alpha ;
259 system_odd.
set(index, index) = c_val + c_der*(nr-1)*(nr-1)/alpha ;
263 system_l0.
set(index01, index01) = 1. ;
264 system_l1.
set(index01, index01) = 1. ;
265 system_even.
set(index, index) = 1. ;
266 system_odd.
set(index, index) = 1. ;
268 system_l0.
set(index01+1, index01) = (nr-1)*(nr-1)/alpha ;
269 system_l1.
set(index01+1, index01) = (nr-1)*(nr-1)/alpha ;
270 system_even.
set(index+1, index) = (nr-1)*(nr-1)/alpha ;
271 system_odd.
set(index+1, index) = (nr-1)*(nr-1)/alpha ;
276 for (
int lz=2; lz<=domain_bc; lz++) {
279 if ((lz == domain_bc)&&(bc_ced))
280 alpha = -0.25/alpha ;
281 system_l0.
set(index01, index01+1) = 1. ;
282 system_l0.
set(index01, index01+2) = -1. ;
283 system_l1.
set(index01, index01+1) = 1. ;
284 system_l1.
set(index01, index01+2) = -1. ;
286 system_even.
set(index, index+1) = 1. ;
287 system_even.
set(index, index+2) = -1. ;
288 system_odd.
set(index, index+1) = 1. ;
289 system_odd.
set(index, index+2) = -1. ;
292 system_l0.
set(index01, index01) = -(nr-2)*(nr-2)/alpha ;
293 system_l0.
set(index01, index01+1) = (nr-1)*(nr-1)/alpha ;
294 system_l1.
set(index01, index01) = -(nr-2)*(nr-2)/alpha ;
295 system_l1.
set(index01, index01+1) = (nr-1)*(nr-1)/alpha ;
297 system_even.
set(index, index) = -(nr-2)*(nr-2)/alpha ;
298 system_even.
set(index, index+1) = (nr-1)*(nr-1)/alpha ;
299 system_odd.
set(index, index) = -(nr-2)*(nr-2)/alpha ;
300 system_odd.
set(index, index+1) = (nr-1)*(nr-1)/alpha ;
304 if (lz == domain_bc) {
305 system_l0.
set(index01, index01-1) = c_val + c_der*(nr-2)*(nr-2)/alpha ;
306 system_l0.
set(index01, index01) = c_val + c_der*(nr-1)*(nr-1)/alpha ;
307 system_l1.
set(index01, index01-1) = c_val + c_der*(nr-2)*(nr-2)/alpha ;
308 system_l1.
set(index01, index01) = c_val + c_der*(nr-1)*(nr-1)/alpha ;
310 system_even.
set(index, index-1) = c_val + c_der*(nr-2)*(nr-2)/alpha ;
311 system_even.
set(index, index) = c_val + c_der*(nr-1)*(nr-1)/alpha ;
312 system_odd.
set(index, index-1) = c_val + c_der*(nr-2)*(nr-2)/alpha ;
313 system_odd.
set(index, index) = c_val + c_der*(nr-1)*(nr-1)/alpha ;
317 system_l0.
set(index01, index01-1) = 1. ;
318 system_l0.
set(index01, index01) = 1. ;
319 system_l1.
set(index01, index01-1) = 1. ;
320 system_l1.
set(index01, index01) = 1. ;
321 system_even.
set(index, index-1) = 1. ;
322 system_even.
set(index, index) = 1. ;
323 system_odd.
set(index, index-1) = 1. ;
324 system_odd.
set(index, index) = 1. ;
326 system_l0.
set(index01+1, index01-1) = (nr-2)*(nr-2)/alpha ;
327 system_l0.
set(index01+1, index01) = (nr-1)*(nr-1)/alpha ;
328 system_l1.
set(index01+1, index01-1) = (nr-2)*(nr-2)/alpha ;
329 system_l1.
set(index01+1, index01) = (nr-1)*(nr-1)/alpha ;
330 system_even.
set(index+1, index-1) = (nr-2)*(nr-2)/alpha ;
331 system_even.
set(index+1, index) = (nr-1)*(nr-1)/alpha ;
332 system_odd.
set(index+1, index-1) = (nr-2)*(nr-2)/alpha ;
333 system_odd.
set(index+1, index) = (nr-1)*(nr-1)/alpha ;
338 assert(index01 == system01_size) ;
339 assert(index == system_size) ;
344 if (par_mat != 0x0) {
358 const Matrice& sys_even = (need_matrices ? system_even :
360 const Matrice& sys_odd = (need_matrices ? system_odd :
371 int m_q, l_q, base_r ;
372 for (
int k=0; k<np+2; k++) {
373 for (
int j=0; j<nt; j++) {
375 if ((nullite_plm(j, nt, k, np, base) == 1)&&(l_q >= l_min)) {
377 int sys_size = (l_q < 2 ? system01_size : system_size) ;
378 int nl = (l_q < 2 ? 1 : 2) ;
383 int nr = mgrid.
get_nr(0) ;
386 if (isexcised==
false){
389 double val_c = 0.; pari = 1 ;
390 for (
int i=0; i<nr-nl; i++) {
391 val_c += pari*coef(0, k, j, i) ;
394 rhs.
set(index) = val_c ;
398 double der_c = 0.; pari = 1 ;
399 for (
int i=0; i<nr-nl-1; i++) {
400 der_c += pari*(2*i+1)*coef(0, k, j, i) ;
403 rhs.
set(index) = der_c / alpha ;
408 for (
int i=0; i<nr-nl; i++) {
409 val_b += coef(0, k, j, i) ;
410 der_b += 4*i*i*coef(0, k, j, i) ;
415 for (
int i=0; i<nr-nl-1; i++) {
416 val_b += coef(0, k, j, i) ;
417 der_b += (2*i+1)*(2*i+1)*coef(0, k, j, i) ;
421 rhs.
set(index) = mu(k,j) - c_val*val_b - c_der*der_b/alpha ;
425 rhs.
set(index) = -val_b ;
427 rhs.
set(index+1) = -der_b/alpha ;
431 if ((1 == domain_bc)&&(bc_ced))
432 alpha = -0.25/alpha ;
434 int nr_lim = nr - n_conditions ;
435 val_b = 0 ; pari = 1 ;
436 for (
int i=0; i<nr_lim; i++) {
437 val_b += pari*coef(1, k, j, i) ;
440 rhs.
set(index) += val_b ;
443 der_b = 0 ; pari = -1 ;
444 for (
int i=0; i<nr_lim; i++) {
445 der_b += pari*i*i*coef(1, k, j, i) ;
448 rhs.
set(index) += der_b/alpha ;
452 for (
int i=0; i<nr_lim; i++)
453 val_b += coef(1, k, j, i) ;
455 for (
int i=0; i<nr_lim; i++) {
456 der_b += i*i*coef(1, k, j, i) ;
459 rhs.
set(index) = mu(k,j) - c_val*val_b - c_der*der_b/alpha ;
463 rhs.
set(index) = -val_b ;
464 if (derivative) rhs.
set(index+1) = -der_b / alpha ;
470 if ((1 == domain_bc)&&(bc_ced))
471 alpha = -0.25/alpha ;
473 int nr_lim = nr - 1 ;
475 for (
int i=0; i<nr_lim; i++)
476 val_b += coef(1, k, j, i) ;
478 for (
int i=0; i<nr_lim; i++) {
479 der_b += i*i*coef(1, k, j, i) ;
482 rhs.
set(index) = mu(k,j) - c_val*val_b - c_der*der_b/alpha ;
486 rhs.
set(index) = -val_b ;
487 if (derivative) rhs.
set(index+1) = -der_b / alpha ;
493 for (
int lz=2; lz<=domain_bc; lz++) {
495 if ((lz == domain_bc)&&(bc_ced))
496 alpha = -0.25/alpha ;
498 int nr_lim = nr - n_conditions ;
499 val_b = 0 ; pari = 1 ;
500 for (
int i=0; i<nr_lim; i++) {
501 val_b += pari*coef(lz, k, j, i) ;
504 rhs.
set(index) += val_b ;
507 der_b = 0 ; pari = -1 ;
508 for (
int i=0; i<nr_lim; i++) {
509 der_b += pari*i*i*coef(lz, k, j, i) ;
512 rhs.
set(index) += der_b/alpha ;
516 for (
int i=0; i<nr_lim; i++)
517 val_b += coef(lz, k, j, i) ;
519 for (
int i=0; i<nr_lim; i++) {
520 der_b += i*i*coef(lz, k, j, i) ;
523 rhs.
set(index) = mu(k,j) - c_val*val_b - c_der*der_b/alpha ;
527 rhs.
set(index) = -val_b ;
528 if (derivative) rhs.
set(index+1) = -der_b / alpha ;
541 solut = (l_q%2 == 0 ? sys_even.
inverse(rhs) :
545 int dec = (base_r ==
R_CHEBP ? 0 : 1) ;
547 if (isexcised==
false){
549 coef.
set(0, k, j, nr-2-dec) = solut(index) ;
552 coef.
set(0, k, j, nr-1-dec) = solut(index) ;
555 coef.
set(0, k, j, nr-1) = 0 ;
559 for (nl=1; nl<=n_conditions; nl++) {
560 int ii = n_conditions - nl + 1 ;
561 coef.
set(1, k, j, nr-ii) = solut(index) ;
567 coef.
set(1,k,j,nr-1)=solut(index);
570 for (
int lz=2; lz<=domain_bc; lz++) {
572 for (nl=1; nl<=n_conditions; nl++) {
573 int ii = n_conditions - nl + 1 ;
574 coef.
set(lz, k, j, nr-ii) = solut(index) ;
580 for (
int lz=0; lz<=domain_bc; lz++)
581 for (
int i=0; i<mgrid.
get_nr(lz); i++)
582 coef.
set(lz, k, j, i) = 0 ;
591 assert(mp_star != 0x0) ;
597 if (
etat == ETATZERO) {
598 if (mu.get_etat() == ETATZERO)
606 bool ced = (mgrid.
get_type_r(nzm1) == UNSURR) ;
608 int domain_bc = par_bc.
get_int(0) ;
609 bool bc_ced = ((ced) && (domain_bc == nzm1)) ;
611 int n_conditions = par_bc.
get_int(1) ;
612 assert ((n_conditions==1)||(n_conditions==2)) ;
613 bool derivative = (n_conditions == 2) ;
614 int dl = 0 ;
int l_min = 0 ;
int excised_i =0;
622 bool isexcised = (excised_i==1);
624 int nt = mgrid.
get_nt(0) ;
625 int np = mgrid.
get_np(0) ;
634 if (mu.get_etat() == ETATZERO)
636 int system01_size =0;
638 if (isexcised ==
false){
646 for (
int lz=1; lz<=domain_bc; lz++) {
647 system01_size += n_conditions ;
648 system_size += n_conditions ;
650 assert (
etat != ETATNONDEF) ;
652 bool need_matrices = true ;
655 need_matrices =
false ;
666 Mg3d mg_01(npp2, system01_size, system01_size, nt, SYM, SYM) ;
Mg3d mgmg(npp2, system_size, system_size, nt, SYM, SYM) ;
670 Valeur system_even(mgmg) ;
683 for (
int k=0; k<np; k++)
684 for (
int j=0; j<nt; j++){
685 int index = 0 ;
int index01 = 0 ;
686 if (isexcised ==
false){
687 system_even.
set(k,j,index, index) = 1. ;
688 system_even.
set(k,j,index, index + 1) = -1. ;
689 system_odd.
set(k,j,index, index) = -(2.*nr - 5.)/alpha(0,k,j,0) ;
690 system_odd.
set(k,j,index, index+1) = (2.*nr - 3.)/alpha(0,k,j,0) ;
692 if (domain_bc == 0) {
693 system_l0.
set(k,j,index01, index01) = c_val + c_der*4.*(nr-1)*(nr-1)/alpha(0,k,j,0) ;
694 system_l1.
set(k,j,index01, index01) = c_val + c_der*(2*nr-3)*(2*nr-3)/alpha(0,k,j,0) ;
696 system_even.
set(k,j,index, index-1) = c_val + c_der*4.*(nr-2)*(nr-2)/alpha(0,k,j,0) ;
697 system_even.
set(k,j,index, index) = c_val + c_der*4.*(nr-1)*(nr-1)/alpha(0,k,j,0) ;
698 system_odd.
set(k,j,index, index-1) = c_val + c_der*(2*nr-5)*(2*nr-5)/alpha(0,k,j,0) ;
699 system_odd.
set(k,j,index, index) = c_val + c_der*(2*nr-3)*(2*nr-3)/alpha(0,k,j,0) ;
703 system_l0.
set(k,j,index01, index01) = 1. ;
704 system_l1.
set(k,j,index01, index01) = 1. ;
705 system_even.
set(k,j,index, index-1) = 1. ;
706 system_even.
set(k,j,index, index) = 1. ;
707 system_odd.
set(k,j,index, index-1) = 1. ;
708 system_odd.
set(k,j,index, index) = 1. ;
710 system_l0.
set(k,j,index01+1, index01) = 4*(nr-1)*(nr-1)/alpha(0,k,j,0) ;
711 system_l1.
set(k,j,index01+1, index01) = (2*nr-3)*(2*nr-3)/alpha(0,k,j,0) ;
712 system_even.
set(k,j,index+1, index-1) = 4*(nr-2)*(nr-2)/alpha(0,k,j,0) ;
713 system_even.
set(k,j,index+1, index) = 4*(nr-1)*(nr-1)/alpha(0,k,j,0) ;
714 system_odd.
set(k,j,index+1, index-1) = (2*nr-5)*(2*nr-5)/alpha(0,k,j,0) ;
715 system_odd.
set(k,j,index+1, index) = (2*nr-3)*(2*nr-3)/alpha(0,k,j,0) ;
724 system_l0.
set(k,j,index01, index01+1) = 1. ;
725 system_l0.
set(k,j,index01, index01+2) = -1. ;
726 system_l1.
set(k,j,index01, index01+1) = 1. ;
727 system_l1.
set(k,j,index01, index01+2) = -1. ;
729 system_even.
set(k,j,index, index+1) = 1. ;
730 system_even.
set(k,j,index, index+2) = -1. ;
731 system_odd.
set(k,j,index, index+1) = 1. ;
732 system_odd.
set(k,j,index, index+2) = -1. ;
735 system_l0.
set(k,j,index01, index01) = -(nr-2)*(nr-2)/alpha(1,k,j,0) ;
736 system_l0.
set(k,j,index01, index01+1) = (nr-1)*(nr-1)/alpha(1,k,j,0) ;
737 system_l1.
set(k,j,index01, index01) = -(nr-2)*(nr-2)/alpha(1,k,j,0) ;
738 system_l1.
set(k,j,index01, index01+1) = (nr-1)*(nr-1)/alpha(1,k,j,0) ;
740 system_even.
set(k,j,index, index) = -(nr-2)*(nr-2)/alpha(1,k,j,0) ;
741 system_even.
set(k,j,index, index+1) = (nr-1)*(nr-1)/alpha(1,k,j,0) ;
742 system_odd.
set(k,j,index, index) = -(nr-2)*(nr-2)/alpha(1,k,j,0) ;
743 system_odd.
set(k,j,index, index+1) = (nr-1)*(nr-1)/alpha(1,k,j,0) ;
747 if (1 == domain_bc) {
748 system_l0.
set(k,j,index01, index01-1) = c_val + c_der*(nr-2)*(nr-2)/alpha(1,k,j,0) ;
749 system_l0.
set(k,j,index01, index01) = c_val + c_der*(nr-1)*(nr-1)/alpha(1,k,j,0) ;
750 system_l1.
set(k,j,index01, index01-1) = c_val + c_der*(nr-2)*(nr-2)/alpha(1,k,j,0) ;
751 system_l1.
set(k,j,index01, index01) = c_val + c_der*(nr-1)*(nr-1)/alpha(1,k,j,0) ;
753 system_even.
set(k,j,index, index-1) = c_val + c_der*(nr-2)*(nr-2)/alpha(1,k,j,0) ;
754 system_even.
set(k,j,index, index) = c_val + c_der*(nr-1)*(nr-1)/alpha(1,k,j,0) ;
755 system_odd.
set(k,j,index, index-1) = c_val + c_der*(nr-2)*(nr-2)/alpha(1,k,j,0) ;
756 system_odd.
set(k,j,index, index) = c_val + c_der*(nr-1)*(nr-1)/alpha(1,k,j,0) ;
760 system_l0.
set(k,j,index01, index01-1) = 1. ;
761 system_l0.
set(k,j,index01, index01) = 1. ;
762 system_l1.
set(k,j,index01, index01-1) = 1. ;
763 system_l1.
set(k,j,index01, index01) = 1. ;
764 system_even.
set(k,j,index, index-1) = 1. ;
765 system_even.
set(k,j,index, index) = 1. ;
766 system_odd.
set(k,j,index, index-1) = 1. ;
767 system_odd.
set(k,j,index, index) = 1. ;
769 system_l0.
set(k,j,index01+1, index01-1) = (nr-2)*(nr-2)/alpha(1,k,j,0) ;
770 system_l0.
set(k,j,index01+1, index01) = (nr-1)*(nr-1)/alpha(1,k,j,0) ;
771 system_l1.
set(k,j,index01+1, index01-1) = (nr-2)*(nr-2)/alpha(1,k,j,0) ;
772 system_l1.
set(k,j,index01+1, index01) = (nr-1)*(nr-1)/alpha(1,k,j,0) ;
773 system_even.
set(k,j,index+1, index-1) = (nr-2)*(nr-2)/alpha(1,k,j,0) ;
774 system_even.
set(k,j,index+1, index) = (nr-1)*(nr-1)/alpha(1,k,j,0) ;
775 system_odd.
set(k,j,index+1, index-1) = (nr-2)*(nr-2)/alpha(1,k,j,0) ;
776 system_odd.
set(k,j,index+1, index) = (nr-1)*(nr-1)/alpha(1,k,j,0) ;
786 if (1 == domain_bc) {
787 system_l0.
set(k,j,index01, index01) = c_val + c_der*(nr-1)*(nr-1)/alpha(1,k,j,0) ;
788 system_l1.
set(k,j,index01, index01) = c_val + c_der*(nr-1)*(nr-1)/alpha(1,k,j,0) ;
790 system_even.
set(k,j,index, index) = c_val + c_der*(nr-1)*(nr-1)/alpha(1,k,j,0) ;
791 system_odd.
set(k,j,index, index) = c_val + c_der*(nr-1)*(nr-1)/alpha(1,k,j,0) ;
795 system_l0.
set(k,j,index01, index01) = 1. ;
796 system_l1.
set(k,j,index01, index01) = 1. ;
797 system_even.
set(k,j,index, index) = 1. ;
798 system_odd.
set(k,j,index, index) = 1. ;
800 system_l0.
set(k,j,index01+1, index01) = (nr-1)*(nr-1)/alpha(1,k,j,0) ;
801 system_l1.
set(k,j,index01+1, index01) = (nr-1)*(nr-1)/alpha(1,k,j,0) ;
802 system_even.
set(k,j,index+1, index) = (nr-1)*(nr-1)/alpha(1,k,j,0) ;
803 system_odd.
set(k,j,index+1, index) = (nr-1)*(nr-1)/alpha(1,k,j,0) ;
808 for (
int lz=2; lz<=domain_bc; lz++) {
813 system_l0.
set(k,j,index01, index01+1) = 1. ;
814 system_l0.
set(k,j,index01, index01+2) = -1. ;
815 system_l1.
set(k,j,index01, index01+1) = 1. ;
816 system_l1.
set(k,j,index01, index01+2) = -1. ;
818 system_even.
set(k,j,index, index+1) = 1. ;
819 system_even.
set(k,j,index, index+2) = -1. ;
820 system_odd.
set(k,j,index, index+1) = 1. ;
821 system_odd.
set(k,j,index, index+2) = -1. ;
824 system_l0.
set(k,j,index01, index01) = -(nr-2)*(nr-2)/alpha(lz,k,j,0) ;
825 system_l0.
set(k,j,index01, index01+1) = (nr-1)*(nr-1)/alpha(lz,k,j,0) ;
826 system_l1.
set(k,j,index01, index01) = -(nr-2)*(nr-2)/alpha(lz,k,j,0) ;
827 system_l1.
set(k,j,index01, index01+1) = (nr-1)*(nr-1)/alpha(lz,k,j,0) ;
829 system_even.
set(k,j,index, index) = -(nr-2)*(nr-2)/alpha(lz,k,j,0) ;
830 system_even.
set(k,j,index, index+1) = (nr-1)*(nr-1)/alpha(lz,k,j,0) ;
831 system_odd.
set(k,j,index, index) = -(nr-2)*(nr-2)/alpha(lz,k,j,0) ;
832 system_odd.
set(k,j,index, index+1) = (nr-1)*(nr-1)/alpha(lz,k,j,0) ;
836 if (lz == domain_bc) {
837 system_l0.
set(k,j,index01, index01-1) = c_val + c_der*(nr-2)*(nr-2)/alpha(lz,k,j,0) ;
838 system_l0.
set(k,j,index01, index01) = c_val + c_der*(nr-1)*(nr-1)/alpha(lz,k,j,0) ;
839 system_l1.
set(k,j,index01, index01-1) = c_val + c_der*(nr-2)*(nr-2)/alpha(lz,k,j,0) ;
840 system_l1.
set(k,j,index01, index01) = c_val + c_der*(nr-1)*(nr-1)/alpha(lz,k,j,0) ;
842 system_even.
set(k,j,index, index-1) = c_val + c_der*(nr-2)*(nr-2)/alpha(lz,k,j,0) ;
843 system_even.
set(k,j,index, index) = c_val + c_der*(nr-1)*(nr-1)/alpha(lz,k,j,0) ;
844 system_odd.
set(k,j,index, index-1) = c_val + c_der*(nr-2)*(nr-2)/alpha(lz,k,j,0) ;
845 system_odd.
set(k,j,index, index) = c_val + c_der*(nr-1)*(nr-1)/alpha(lz,k,j,0) ;
849 system_l0.
set(k,j,index01, index01-1) = 1. ;
850 system_l0.
set(k,j,index01, index01) = 1. ;
851 system_l1.
set(k,j,index01, index01-1) = 1. ;
852 system_l1.
set(k,j,index01, index01) = 1. ;
853 system_even.
set(k,j,index, index-1) = 1. ;
854 system_even.
set(k,j,index, index) = 1. ;
855 system_odd.
set(k,j,index, index-1) = 1. ;
856 system_odd.
set(k,j,index, index) = 1. ;
858 system_l0.
set(k,j,index01+1, index01-1) = (nr-2)*(nr-2)/alpha(lz,k,j,0) ;
859 system_l0.
set(k,j,index01+1, index01) = (nr-1)*(nr-1)/alpha(lz,k,j,0) ;
860 system_l1.
set(k,j,index01+1, index01-1) = (nr-2)*(nr-2)/alpha(lz,k,j,0) ;
861 system_l1.
set(k,j,index01+1, index01) = (nr-1)*(nr-1)/alpha(lz,k,j,0) ;
862 system_even.
set(k,j,index+1, index-1) = (nr-2)*(nr-2)/alpha(lz,k,j,0) ;
863 system_even.
set(k,j,index+1, index) = (nr-1)*(nr-1)/alpha(lz,k,j,0) ;
864 system_odd.
set(k,j,index+1, index-1) = (nr-2)*(nr-2)/alpha(lz,k,j,0) ;
865 system_odd.
set(k,j,index+1, index) = (nr-1)*(nr-1)/alpha(lz,k,j,0) ;
870 assert(index01 == system01_size) ;
871 assert(index == system_size) ;
889 const Valeur& sys_l0 = system_l0 ;
890 const Valeur& sys_l1 = system_l1 ;
891 const Valeur& sys_even = system_even ;
893 const Valeur& sys_odd = system_odd ;
899 Mtbl_cf& coef = *
va.
c_cf ; cout <<
"COEF : " << coef << endl;
904 int m_q, l_q, base_r ;
905 for (
int k=0; k<np+2; k++) {
906 for (
int j=0; j<nt; j++) {
908 if ((nullite_plm(j, nt, k, np, base) == 1)&&(l_q >= l_min)) {
910 int sys_size = (l_q < 2 ? system01_size : system_size) ;
911 int nl = (l_q < 2 ? 1 : 2) ;
916 int nr = mgrid.
get_nr(0) ;
919 if (isexcised==
false){
922 double val_c = 0.; pari = 1 ;
923 for (
int i=0; i<nr-nl; i++) {
924 val_c += pari*coef(0, k, j, i) ;
927 rhs.
set(k,j,index) = val_c ;
931 double der_c = 0.; pari = 1 ;
932 for (
int i=0; i<nr-nl-1; i++) {
933 der_c += pari*(2*i+1)*coef(0, k, j, i) ;
936 rhs.
set(k,j,index) = der_c / alpha(0, k, j, 0) ;
941 for (
int i=0; i<nr-nl; i++) {
942 val_b += coef(0, k, j, i) ;
943 der_b += 4*i*i*coef(0, k, j, i) ;
948 for (
int i=0; i<nr-nl-1; i++) {
949 val_b += coef(0, k, j, i) ;
950 der_b += (2*i+1)*(2*i+1)*coef(0, k, j, i) ;
954 rhs.
set(k,j,index) = mu(k,j) - c_val*val_b - c_der*der_b/alpha(0, k, j, 0) ;
958 rhs.
set(k,j,index) = -val_b ;
960 rhs.
set(k,j,index+1) = -der_b/alpha(0, k, j, 0) ;
967 int nr_lim = nr - n_conditions ;
968 val_b = 0 ; pari = 1 ;
969 for (
int i=0; i<nr_lim; i++) {
970 val_b += pari*coef(1, k, j, i) ;
973 rhs.
set(k,j,index) += val_b ;
976 der_b = 0 ; pari = -1 ;
977 for (
int i=0; i<nr_lim; i++) {
978 der_b += pari*i*i*coef(1, k, j, i) ;
981 rhs.
set(k,j,index) += der_b/alpha(1,k,j,0) ;
985 for (
int i=0; i<nr_lim; i++)
986 val_b += coef(1, k, j, i) ;
988 for (
int i=0; i<nr_lim; i++) {
989 der_b += i*i*coef(1, k, j, i) ;
992 rhs.
set(k,j,index) = mu(k,j) - c_val*val_b - c_der*der_b/alpha(1,k,j,0) ;
996 rhs.
set(k,j,index) = -val_b ;
997 if (derivative) rhs.
set(k,j,index+1) = -der_b / alpha(1,k,j,0) ;
1006 int nr_lim = nr - 1 ;
1008 for (
int i=0; i<nr_lim; i++)
1009 val_b += coef(1, k, j, i) ;
1011 for (
int i=0; i<nr_lim; i++) {
1012 der_b += i*i*coef(1, k, j, i) ;
1015 rhs.
set(k,j,index) = mu(k,j) - c_val*val_b - c_der*der_b/alpha(1,k,j,0) ;
1019 rhs.
set(k,j,index) = -val_b ;
1020 if (derivative) rhs.
set(k,j,index+1) = -der_b / alpha(1,k,j,0) ;
1026 for (
int lz=2; lz<=domain_bc; lz++) {
1031 int nr_lim = nr - n_conditions ;
1032 val_b = 0 ; pari = 1 ;
1033 for (
int i=0; i<nr_lim; i++) {
1034 val_b += pari*coef(lz, k, j, i) ;
1037 rhs.
set(k,j,index) += val_b ;
1040 der_b = 0 ; pari = -1 ;
1041 for (
int i=0; i<nr_lim; i++) {
1042 der_b += pari*i*i*coef(lz, k, j, i) ;
1045 rhs.
set(k,j,index) += der_b/alpha(lz, k, j, 0) ;
1049 for (
int i=0; i<nr_lim; i++)
1050 val_b += coef(lz, k, j, i) ;
1052 for (
int i=0; i<nr_lim; i++) {
1053 der_b += i*i*coef(lz, k, j, i) ;
1055 if (domain_bc==lz) {
1056 rhs.
set(k,j,index) = mu(k,j) - c_val*val_b - c_der*der_b/alpha(lz, k, j, 0) ;
1060 rhs.
set(k,j,index) = -val_b ;
1061 if (derivative) rhs.
set(k,j,index+1) = -der_b / alpha(lz, k, j, 0) ;
1064 Tbl solut(sys_size);
1070 for (
int ind1=0; ind1<sys_size; ind1++){
1071 rhs_tmp.
set(ind1) = rhs(k,j,ind1) ;
1072 for (
int ind2=0; ind2<sys_size; ind2++)
1073 sys_l0_tmp.
set(ind1,ind2) = sys_l0(k,j,ind1,ind2) ;
1076 solut = sys_l0_tmp.
inverse(rhs_tmp) ;
1081 for (
int ind1=0; ind1<sys_size; ind1++){
1082 rhs_tmp.
set(ind1) = rhs(k,j,ind1) ;
1083 for (
int ind2=0; ind2<sys_size; ind2++)
1084 sys_l1_tmp.
set(ind1,ind2) = sys_l1(k,j,ind1,ind2) ;
1087 solut = sys_l1_tmp.
inverse(rhs_tmp) ;
1094 for (
int ind1=0; ind1<sys_size; ind1++){
1095 rhs_tmp.
set(ind1) = rhs(k,j,ind1) ;
1096 for (
int ind2=0; ind2<sys_size; ind2++)
1097 sys_even_tmp.
set(ind1,ind2) = sys_even(k,j,ind1,ind2) ;
1100 solut = sys_even_tmp.
inverse(rhs_tmp) ;
1104 for (
int ind1=0; ind1<sys_size; ind1++){
1105 rhs_tmp.
set(ind1) = rhs(k,j,ind1) ;
1106 for (
int ind2=0; ind2<sys_size; ind2++)
1107 sys_odd_tmp.
set(ind1,ind2) = sys_odd(k,j,ind1,ind2) ;
1110 solut = sys_odd_tmp.
inverse(rhs_tmp) ;
1115 int dec = (base_r ==
R_CHEBP ? 0 : 1) ;
1117 if (isexcised==
false){
1119 coef.
set(0, k, j, nr-2-dec) = solut(index) ;
1122 coef.
set(0, k, j, nr-1-dec) = solut(index) ;
1125 coef.
set(0, k, j, nr-1) = 0 ;
1126 if (domain_bc > 0) {
1129 for (nl=1; nl<=n_conditions; nl++) {
1130 int ii = n_conditions - nl + 1 ;
1131 coef.
set(1, k, j, nr-ii) = solut(index) ;
1137 coef.
set(1,k,j,nr-1)=solut(index);
1140 for (
int lz=2; lz<=domain_bc; lz++) {
1142 for (nl=1; nl<=n_conditions; nl++) {
1143 int ii = n_conditions - nl + 1 ;
1144 coef.
set(lz, k, j, nr-ii) = solut(index) ;
1150 for (
int lz=0; lz<=domain_bc; lz++)
1151 for (
int i=0; i<mgrid.
get_nr(lz); i++)
1152 coef.
set(lz, k, j, i) = 0 ;
const Base_val & get_spectral_base() const
Returns the spectral bases of the Valeur va.
Mtbl_cf * c_cf
Coefficients of the spectral expansion of the function.
double & get_double_mod(int position=0) const
Returns the reference of a stored modifiable double .
const double * get_alpha() const
Returns the pointer on the array alpha.
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
void coef() const
Computes the coeffcients of *this.
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.
void annule_hard()
Sets the Valeur to zero in a hard way.
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
double & set(int i)
Read/write of a particular element (index i) (1D case)
void add_matrice_mod(Matrice &ti, int position=0)
Adds the address of a new modifiable Matrice to the list.
void match_tau(Param &par_bc, Param *par_mat=0x0)
Method for matching accross domains and imposing boundary condition.
Values and coefficients of a (real-value) function.
void annule_hard()
Sets the Scalar to zero in a hard way.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
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_CHEBI
base de Cheb. impaire (rare) seulement
#define R_CHEBP
base de Cheb. paire (rare) seulement
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_n_double_mod() const
Returns the number of stored modifiable double 's addresses.
int get_nzone() const
Returns the number of domains.
Valeur va
The numerical value of the Scalar.
void annule_hard()
Sets the logical state to ETATQCQ (undefined state).
const Valeur & get_alpha() const
Returns the reference on the Tbl alpha.
double & set(int j, int i)
Read/write of a particuliar element.
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.
int etat
The logical state ETATNONDEF (undefined), ETATZERO (null), ETATUN (one), or ETATQCQ (ordinary)...
Coefficients storage for the multi-domain spectral method.
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.
int get_type_r(int l) const
Returns the type of sampling in the radial direction in domain no.
void match_tau_star(Param &par_bc, Param *par_mat=0x0)
Method for matching accross domains and imposing boundary condition.
const Map *const mp
Mapping on which the numerical values at the grid points are defined.
void annule_hard()
Sets the Tbl to zero in a hard way.
Tbl & set(int l)
Read/write of the value in a given domain (configuration space).