78 assert(mp_aff != 0x0) ;
84 if (
etat == ETATZERO) {
85 if (mu.get_etat() == ETATZERO)
93 bool ced = (mgrid.
get_type_r(nzm1) == UNSURR) ;
95 int domain_bc = par_bc.
get_int(0) ;
96 bool bc_ced = ((ced) && (domain_bc == nzm1)) ;
98 int n_conditions = par_bc.
get_int(1) ;
99 assert ((n_conditions==1)||(n_conditions==2)) ;
100 bool derivative = (n_conditions == 2) ;
101 int dl = 0 ;
int l_min = 0 ;
int excised_i =0;
109 bool isexcised = (excised_i==1);
111 int nt = mgrid.
get_nt(0) ;
112 int np = mgrid.
get_np(0) ;
121 if (mu.get_etat() == ETATZERO)
123 int system01_size =0;
125 if (isexcised ==
false){
133 for (
int lz=1; lz<=domain_bc; lz++) {
134 system01_size += n_conditions ;
135 system_size += n_conditions ;
137 assert (
etat != ETATNONDEF) ;
139 bool need_matrices = true ;
142 need_matrices =
false ;
144 Matrice system_l0(system01_size, system01_size) ;
145 Matrice system_l1(system01_size, system01_size) ;
146 Matrice system_even(system_size, system_size) ;
147 Matrice system_odd(system_size, system_size) ;
154 int index = 0 ;
int index01 = 0 ;
157 if (isexcised ==
false){
158 system_even.
set(index, index) = 1. ;
159 system_even.
set(index, index + 1) = -1. ;
160 system_odd.
set(index, index) = -(2.*nr - 5.)/alpha ;
161 system_odd.
set(index, index+1) = (2.*nr - 3.)/alpha ;
163 if (domain_bc == 0) {
164 system_l0.
set(index01, index01) = c_val + c_der*4.*(nr-1)*(nr-1)/alpha ;
165 system_l1.
set(index01, index01) = c_val + c_der*(2*nr-3)*(2*nr-3)/alpha ;
167 system_even.
set(index, index-1) = c_val + c_der*4.*(nr-2)*(nr-2)/alpha ;
168 system_even.
set(index, index) = c_val + c_der*4.*(nr-1)*(nr-1)/alpha ;
169 system_odd.
set(index, index-1) = c_val + c_der*(2*nr-5)*(2*nr-5)/alpha ;
170 system_odd.
set(index, index) = c_val + c_der*(2*nr-3)*(2*nr-3)/alpha ;
174 system_l0.
set(index01, index01) = 1. ;
175 system_l1.
set(index01, index01) = 1. ;
176 system_even.
set(index, index-1) = 1. ;
177 system_even.
set(index, index) = 1. ;
178 system_odd.
set(index, index-1) = 1. ;
179 system_odd.
set(index, index) = 1. ;
181 system_l0.
set(index01+1, index01) = 4*(nr-1)*(nr-1)/alpha ;
182 system_l1.
set(index01+1, index01) = (2*nr-3)*(2*nr-3)/alpha ;
183 system_even.
set(index+1, index-1) = 4*(nr-2)*(nr-2)/alpha ;
184 system_even.
set(index+1, index) = 4*(nr-1)*(nr-1)/alpha ;
185 system_odd.
set(index+1, index-1) = (2*nr-5)*(2*nr-5)/alpha ;
186 system_odd.
set(index+1, index) = (2*nr-3)*(2*nr-3)/alpha ;
193 if ((1 == domain_bc)&&(bc_ced))
194 alpha = -0.25/alpha ;
195 system_l0.
set(index01, index01+1) = 1. ;
196 system_l0.
set(index01, index01+2) = -1. ;
197 system_l1.
set(index01, index01+1) = 1. ;
198 system_l1.
set(index01, index01+2) = -1. ;
200 system_even.
set(index, index+1) = 1. ;
201 system_even.
set(index, index+2) = -1. ;
202 system_odd.
set(index, index+1) = 1. ;
203 system_odd.
set(index, index+2) = -1. ;
206 system_l0.
set(index01, index01) = -(nr-2)*(nr-2)/alpha ;
207 system_l0.
set(index01, index01+1) = (nr-1)*(nr-1)/alpha ;
208 system_l1.
set(index01, index01) = -(nr-2)*(nr-2)/alpha ;
209 system_l1.
set(index01, index01+1) = (nr-1)*(nr-1)/alpha ;
211 system_even.
set(index, index) = -(nr-2)*(nr-2)/alpha ;
212 system_even.
set(index, index+1) = (nr-1)*(nr-1)/alpha ;
213 system_odd.
set(index, index) = -(nr-2)*(nr-2)/alpha ;
214 system_odd.
set(index, index+1) = (nr-1)*(nr-1)/alpha ;
218 if (1 == domain_bc) {
219 system_l0.
set(index01, index01-1) = c_val + c_der*(nr-2)*(nr-2)/alpha ;
220 system_l0.
set(index01, index01) = c_val + c_der*(nr-1)*(nr-1)/alpha ;
221 system_l1.
set(index01, index01-1) = c_val + c_der*(nr-2)*(nr-2)/alpha ;
222 system_l1.
set(index01, index01) = c_val + c_der*(nr-1)*(nr-1)/alpha ;
224 system_even.
set(index, index-1) = c_val + c_der*(nr-2)*(nr-2)/alpha ;
225 system_even.
set(index, index) = c_val + c_der*(nr-1)*(nr-1)/alpha ;
226 system_odd.
set(index, index-1) = c_val + c_der*(nr-2)*(nr-2)/alpha ;
227 system_odd.
set(index, index) = c_val + c_der*(nr-1)*(nr-1)/alpha ;
231 system_l0.
set(index01, index01-1) = 1. ;
232 system_l0.
set(index01, index01) = 1. ;
233 system_l1.
set(index01, index01-1) = 1. ;
234 system_l1.
set(index01, index01) = 1. ;
235 system_even.
set(index, index-1) = 1. ;
236 system_even.
set(index, index) = 1. ;
237 system_odd.
set(index, index-1) = 1. ;
238 system_odd.
set(index, index) = 1. ;
240 system_l0.
set(index01+1, index01-1) = (nr-2)*(nr-2)/alpha ;
241 system_l0.
set(index01+1, index01) = (nr-1)*(nr-1)/alpha ;
242 system_l1.
set(index01+1, index01-1) = (nr-2)*(nr-2)/alpha ;
243 system_l1.
set(index01+1, index01) = (nr-1)*(nr-1)/alpha ;
244 system_even.
set(index+1, index-1) = (nr-2)*(nr-2)/alpha ;
245 system_even.
set(index+1, index) = (nr-1)*(nr-1)/alpha ;
246 system_odd.
set(index+1, index-1) = (nr-2)*(nr-2)/alpha ;
247 system_odd.
set(index+1, index) = (nr-1)*(nr-1)/alpha ;
255 if ((1 == domain_bc)&&(bc_ced))
256 alpha = -0.25/alpha ;
257 if (1 == domain_bc) {
258 system_l0.
set(index01, index01) = c_val + c_der*(nr-1)*(nr-1)/alpha ;
259 system_l1.
set(index01, index01) = c_val + c_der*(nr-1)*(nr-1)/alpha ;
261 system_even.
set(index, index) = c_val + c_der*(nr-1)*(nr-1)/alpha ;
262 system_odd.
set(index, index) = c_val + c_der*(nr-1)*(nr-1)/alpha ;
266 system_l0.
set(index01, index01) = 1. ;
267 system_l1.
set(index01, index01) = 1. ;
268 system_even.
set(index, index) = 1. ;
269 system_odd.
set(index, index) = 1. ;
271 system_l0.
set(index01+1, index01) = (nr-1)*(nr-1)/alpha ;
272 system_l1.
set(index01+1, index01) = (nr-1)*(nr-1)/alpha ;
273 system_even.
set(index+1, index) = (nr-1)*(nr-1)/alpha ;
274 system_odd.
set(index+1, index) = (nr-1)*(nr-1)/alpha ;
279 for (
int lz=2; lz<=domain_bc; lz++) {
282 if ((lz == domain_bc)&&(bc_ced))
283 alpha = -0.25/alpha ;
284 system_l0.
set(index01, index01+1) = 1. ;
285 system_l0.
set(index01, index01+2) = -1. ;
286 system_l1.
set(index01, index01+1) = 1. ;
287 system_l1.
set(index01, index01+2) = -1. ;
289 system_even.
set(index, index+1) = 1. ;
290 system_even.
set(index, index+2) = -1. ;
291 system_odd.
set(index, index+1) = 1. ;
292 system_odd.
set(index, index+2) = -1. ;
295 system_l0.
set(index01, index01) = -(nr-2)*(nr-2)/alpha ;
296 system_l0.
set(index01, index01+1) = (nr-1)*(nr-1)/alpha ;
297 system_l1.
set(index01, index01) = -(nr-2)*(nr-2)/alpha ;
298 system_l1.
set(index01, index01+1) = (nr-1)*(nr-1)/alpha ;
300 system_even.
set(index, index) = -(nr-2)*(nr-2)/alpha ;
301 system_even.
set(index, index+1) = (nr-1)*(nr-1)/alpha ;
302 system_odd.
set(index, index) = -(nr-2)*(nr-2)/alpha ;
303 system_odd.
set(index, index+1) = (nr-1)*(nr-1)/alpha ;
307 if (lz == domain_bc) {
308 system_l0.
set(index01, index01-1) = c_val + c_der*(nr-2)*(nr-2)/alpha ;
309 system_l0.
set(index01, index01) = c_val + c_der*(nr-1)*(nr-1)/alpha ;
310 system_l1.
set(index01, index01-1) = c_val + c_der*(nr-2)*(nr-2)/alpha ;
311 system_l1.
set(index01, index01) = c_val + c_der*(nr-1)*(nr-1)/alpha ;
313 system_even.
set(index, index-1) = c_val + c_der*(nr-2)*(nr-2)/alpha ;
314 system_even.
set(index, index) = c_val + c_der*(nr-1)*(nr-1)/alpha ;
315 system_odd.
set(index, index-1) = c_val + c_der*(nr-2)*(nr-2)/alpha ;
316 system_odd.
set(index, index) = c_val + c_der*(nr-1)*(nr-1)/alpha ;
320 system_l0.
set(index01, index01-1) = 1. ;
321 system_l0.
set(index01, index01) = 1. ;
322 system_l1.
set(index01, index01-1) = 1. ;
323 system_l1.
set(index01, index01) = 1. ;
324 system_even.
set(index, index-1) = 1. ;
325 system_even.
set(index, index) = 1. ;
326 system_odd.
set(index, index-1) = 1. ;
327 system_odd.
set(index, index) = 1. ;
329 system_l0.
set(index01+1, index01-1) = (nr-2)*(nr-2)/alpha ;
330 system_l0.
set(index01+1, index01) = (nr-1)*(nr-1)/alpha ;
331 system_l1.
set(index01+1, index01-1) = (nr-2)*(nr-2)/alpha ;
332 system_l1.
set(index01+1, index01) = (nr-1)*(nr-1)/alpha ;
333 system_even.
set(index+1, index-1) = (nr-2)*(nr-2)/alpha ;
334 system_even.
set(index+1, index) = (nr-1)*(nr-1)/alpha ;
335 system_odd.
set(index+1, index-1) = (nr-2)*(nr-2)/alpha ;
336 system_odd.
set(index+1, index) = (nr-1)*(nr-1)/alpha ;
341 assert(index01 == system01_size) ;
342 assert(index == system_size) ;
347 if (par_mat != 0x0) {
361 const Matrice& sys_even = (need_matrices ? system_even :
363 const Matrice& sys_odd = (need_matrices ? system_odd :
374 int m_q, l_q, base_r ;
375 for (
int k=0; k<np+2; k++) {
376 for (
int j=0; j<nt; j++) {
378 if ((nullite_plm(j, nt, k, np, base) == 1)&&(l_q >= l_min)) {
380 int sys_size = (l_q < 2 ? system01_size : system_size) ;
381 int nl = (l_q < 2 ? 1 : 2) ;
386 int nr = mgrid.
get_nr(0) ;
389 if (isexcised==
false){
392 double val_c = 0.; pari = 1 ;
393 for (
int i=0; i<nr-nl; i++) {
394 val_c += pari*coef(0, k, j, i) ;
397 rhs.
set(index) = val_c ;
401 double der_c = 0.; pari = 1 ;
402 for (
int i=0; i<nr-nl-1; i++) {
403 der_c += pari*(2*i+1)*coef(0, k, j, i) ;
406 rhs.
set(index) = der_c / alpha ;
411 for (
int i=0; i<nr-nl; i++) {
412 val_b += coef(0, k, j, i) ;
413 der_b += 4*i*i*coef(0, k, j, i) ;
418 for (
int i=0; i<nr-nl-1; i++) {
419 val_b += coef(0, k, j, i) ;
420 der_b += (2*i+1)*(2*i+1)*coef(0, k, j, i) ;
424 rhs.
set(index) = mu(k,j) - c_val*val_b - c_der*der_b/alpha ;
428 rhs.
set(index) = -val_b ;
430 rhs.
set(index+1) = -der_b/alpha ;
434 if ((1 == domain_bc)&&(bc_ced))
435 alpha = -0.25/alpha ;
437 int nr_lim = nr - n_conditions ;
438 val_b = 0 ; pari = 1 ;
439 for (
int i=0; i<nr_lim; i++) {
440 val_b += pari*coef(1, k, j, i) ;
443 rhs.
set(index) += val_b ;
446 der_b = 0 ; pari = -1 ;
447 for (
int i=0; i<nr_lim; i++) {
448 der_b += pari*i*i*coef(1, k, j, i) ;
451 rhs.
set(index) += der_b/alpha ;
455 for (
int i=0; i<nr_lim; i++)
456 val_b += coef(1, k, j, i) ;
458 for (
int i=0; i<nr_lim; i++) {
459 der_b += i*i*coef(1, k, j, i) ;
462 rhs.
set(index) = mu(k,j) - c_val*val_b - c_der*der_b/alpha ;
466 rhs.
set(index) = -val_b ;
467 if (derivative) rhs.
set(index+1) = -der_b / alpha ;
473 if ((1 == domain_bc)&&(bc_ced))
474 alpha = -0.25/alpha ;
476 int nr_lim = nr - 1 ;
478 for (
int i=0; i<nr_lim; i++)
479 val_b += coef(1, k, j, i) ;
481 for (
int i=0; i<nr_lim; i++) {
482 der_b += i*i*coef(1, k, j, i) ;
485 rhs.
set(index) = mu(k,j) - c_val*val_b - c_der*der_b/alpha ;
489 rhs.
set(index) = -val_b ;
490 if (derivative) rhs.
set(index+1) = -der_b / alpha ;
496 for (
int lz=2; lz<=domain_bc; lz++) {
498 if ((lz == domain_bc)&&(bc_ced))
499 alpha = -0.25/alpha ;
501 int nr_lim = nr - n_conditions ;
502 val_b = 0 ; pari = 1 ;
503 for (
int i=0; i<nr_lim; i++) {
504 val_b += pari*coef(lz, k, j, i) ;
507 rhs.
set(index) += val_b ;
510 der_b = 0 ; pari = -1 ;
511 for (
int i=0; i<nr_lim; i++) {
512 der_b += pari*i*i*coef(lz, k, j, i) ;
515 rhs.
set(index) += der_b/alpha ;
519 for (
int i=0; i<nr_lim; i++)
520 val_b += coef(lz, k, j, i) ;
522 for (
int i=0; i<nr_lim; i++) {
523 der_b += i*i*coef(lz, k, j, i) ;
526 rhs.
set(index) = mu(k,j) - c_val*val_b - c_der*der_b/alpha ;
530 rhs.
set(index) = -val_b ;
531 if (derivative) rhs.
set(index+1) = -der_b / alpha ;
544 solut = (l_q%2 == 0 ? sys_even.
inverse(rhs) :
548 int dec = (base_r ==
R_CHEBP ? 0 : 1) ;
550 if (isexcised==
false){
552 coef.
set(0, k, j, nr-2-dec) = solut(index) ;
555 coef.
set(0, k, j, nr-1-dec) = solut(index) ;
558 coef.
set(0, k, j, nr-1) = 0 ;
562 for (nl=1; nl<=n_conditions; nl++) {
563 int ii = n_conditions - nl + 1 ;
564 coef.
set(1, k, j, nr-ii) = solut(index) ;
570 coef.
set(1,k,j,nr-1)=solut(index);
573 for (
int lz=2; lz<=domain_bc; lz++) {
575 for (nl=1; nl<=n_conditions; nl++) {
576 int ii = n_conditions - nl + 1 ;
577 coef.
set(lz, k, j, nr-ii) = solut(index) ;
583 for (
int lz=0; lz<=domain_bc; lz++)
584 for (
int i=0; i<mgrid.
get_nr(lz); i++)
585 coef.
set(lz, k, j, i) = 0 ;
594 assert(mp_star != 0x0) ;
600 if (
etat == ETATZERO) {
601 if (mu.get_etat() == ETATZERO)
609 bool ced = (mgrid.
get_type_r(nzm1) == UNSURR) ;
611 int domain_bc = par_bc.
get_int(0) ;
612 bool bc_ced = ((ced) && (domain_bc == nzm1)) ;
614 int n_conditions = par_bc.
get_int(1) ;
615 assert ((n_conditions==1)||(n_conditions==2)) ;
616 bool derivative = (n_conditions == 2) ;
617 int dl = 0 ;
int l_min = 0 ;
int excised_i =0;
625 bool isexcised = (excised_i==1);
627 int nt = mgrid.
get_nt(0) ;
628 int np = mgrid.
get_np(0) ;
637 if (mu.get_etat() == ETATZERO)
639 int system01_size =0;
641 if (isexcised ==
false){
649 for (
int lz=1; lz<=domain_bc; lz++) {
650 system01_size += n_conditions ;
651 system_size += n_conditions ;
653 assert (
etat != ETATNONDEF) ;
655 bool need_matrices = true ;
658 need_matrices =
false ;
661 Mg3d mg_01(npp2, system01_size, system01_size, nt, SYM, SYM) ;
Mg3d mgmg(npp2, system_size, system_size, nt, SYM, SYM) ;
665 Valeur system_even(mgmg) ;
678 for (
int k=0; k<np; k++)
679 for (
int j=0; j<nt; j++){
680 int index = 0 ;
int index01 = 0 ;
681 if (isexcised ==
false){
682 system_even.
set(k,j,index, index) = 1. ;
683 system_even.
set(k,j,index, index + 1) = -1. ;
684 system_odd.
set(k,j,index, index) = -(2.*nr - 5.)/alpha(0,k,j,0) ;
685 system_odd.
set(k,j,index, index+1) = (2.*nr - 3.)/alpha(0,k,j,0) ;
687 if (domain_bc == 0) {
688 system_l0.
set(k,j,index01, index01) = c_val + c_der*4.*(nr-1)*(nr-1)/alpha(0,k,j,0) ;
689 system_l1.
set(k,j,index01, index01) = c_val + c_der*(2*nr-3)*(2*nr-3)/alpha(0,k,j,0) ;
691 system_even.
set(k,j,index, index-1) = c_val + c_der*4.*(nr-2)*(nr-2)/alpha(0,k,j,0) ;
692 system_even.
set(k,j,index, index) = c_val + c_der*4.*(nr-1)*(nr-1)/alpha(0,k,j,0) ;
693 system_odd.
set(k,j,index, index-1) = c_val + c_der*(2*nr-5)*(2*nr-5)/alpha(0,k,j,0) ;
694 system_odd.
set(k,j,index, index) = c_val + c_der*(2*nr-3)*(2*nr-3)/alpha(0,k,j,0) ;
698 system_l0.
set(k,j,index01, index01) = 1. ;
699 system_l1.
set(k,j,index01, index01) = 1. ;
700 system_even.
set(k,j,index, index-1) = 1. ;
701 system_even.
set(k,j,index, index) = 1. ;
702 system_odd.
set(k,j,index, index-1) = 1. ;
703 system_odd.
set(k,j,index, index) = 1. ;
705 system_l0.
set(k,j,index01+1, index01) = 4*(nr-1)*(nr-1)/alpha(0,k,j,0) ;
706 system_l1.
set(k,j,index01+1, index01) = (2*nr-3)*(2*nr-3)/alpha(0,k,j,0) ;
707 system_even.
set(k,j,index+1, index-1) = 4*(nr-2)*(nr-2)/alpha(0,k,j,0) ;
708 system_even.
set(k,j,index+1, index) = 4*(nr-1)*(nr-1)/alpha(0,k,j,0) ;
709 system_odd.
set(k,j,index+1, index-1) = (2*nr-5)*(2*nr-5)/alpha(0,k,j,0) ;
710 system_odd.
set(k,j,index+1, index) = (2*nr-3)*(2*nr-3)/alpha(0,k,j,0) ;
719 system_l0.
set(k,j,index01, index01+1) = 1. ;
720 system_l0.
set(k,j,index01, index01+2) = -1. ;
721 system_l1.
set(k,j,index01, index01+1) = 1. ;
722 system_l1.
set(k,j,index01, index01+2) = -1. ;
724 system_even.
set(k,j,index, index+1) = 1. ;
725 system_even.
set(k,j,index, index+2) = -1. ;
726 system_odd.
set(k,j,index, index+1) = 1. ;
727 system_odd.
set(k,j,index, index+2) = -1. ;
730 system_l0.
set(k,j,index01, index01) = -(nr-2)*(nr-2)/alpha(1,k,j,0) ;
731 system_l0.
set(k,j,index01, index01+1) = (nr-1)*(nr-1)/alpha(1,k,j,0) ;
732 system_l1.
set(k,j,index01, index01) = -(nr-2)*(nr-2)/alpha(1,k,j,0) ;
733 system_l1.
set(k,j,index01, index01+1) = (nr-1)*(nr-1)/alpha(1,k,j,0) ;
735 system_even.
set(k,j,index, index) = -(nr-2)*(nr-2)/alpha(1,k,j,0) ;
736 system_even.
set(k,j,index, index+1) = (nr-1)*(nr-1)/alpha(1,k,j,0) ;
737 system_odd.
set(k,j,index, index) = -(nr-2)*(nr-2)/alpha(1,k,j,0) ;
738 system_odd.
set(k,j,index, index+1) = (nr-1)*(nr-1)/alpha(1,k,j,0) ;
742 if (1 == domain_bc) {
743 system_l0.
set(k,j,index01, index01-1) = c_val + c_der*(nr-2)*(nr-2)/alpha(1,k,j,0) ;
744 system_l0.
set(k,j,index01, index01) = c_val + c_der*(nr-1)*(nr-1)/alpha(1,k,j,0) ;
745 system_l1.
set(k,j,index01, index01-1) = c_val + c_der*(nr-2)*(nr-2)/alpha(1,k,j,0) ;
746 system_l1.
set(k,j,index01, index01) = c_val + c_der*(nr-1)*(nr-1)/alpha(1,k,j,0) ;
748 system_even.
set(k,j,index, index-1) = c_val + c_der*(nr-2)*(nr-2)/alpha(1,k,j,0) ;
749 system_even.
set(k,j,index, index) = c_val + c_der*(nr-1)*(nr-1)/alpha(1,k,j,0) ;
750 system_odd.
set(k,j,index, index-1) = c_val + c_der*(nr-2)*(nr-2)/alpha(1,k,j,0) ;
751 system_odd.
set(k,j,index, index) = c_val + c_der*(nr-1)*(nr-1)/alpha(1,k,j,0) ;
755 system_l0.
set(k,j,index01, index01-1) = 1. ;
756 system_l0.
set(k,j,index01, index01) = 1. ;
757 system_l1.
set(k,j,index01, index01-1) = 1. ;
758 system_l1.
set(k,j,index01, index01) = 1. ;
759 system_even.
set(k,j,index, index-1) = 1. ;
760 system_even.
set(k,j,index, index) = 1. ;
761 system_odd.
set(k,j,index, index-1) = 1. ;
762 system_odd.
set(k,j,index, index) = 1. ;
764 system_l0.
set(k,j,index01+1, index01-1) = (nr-2)*(nr-2)/alpha(1,k,j,0) ;
765 system_l0.
set(k,j,index01+1, index01) = (nr-1)*(nr-1)/alpha(1,k,j,0) ;
766 system_l1.
set(k,j,index01+1, index01-1) = (nr-2)*(nr-2)/alpha(1,k,j,0) ;
767 system_l1.
set(k,j,index01+1, index01) = (nr-1)*(nr-1)/alpha(1,k,j,0) ;
768 system_even.
set(k,j,index+1, index-1) = (nr-2)*(nr-2)/alpha(1,k,j,0) ;
769 system_even.
set(k,j,index+1, index) = (nr-1)*(nr-1)/alpha(1,k,j,0) ;
770 system_odd.
set(k,j,index+1, index-1) = (nr-2)*(nr-2)/alpha(1,k,j,0) ;
771 system_odd.
set(k,j,index+1, index) = (nr-1)*(nr-1)/alpha(1,k,j,0) ;
781 if (1 == domain_bc) {
782 system_l0.
set(k,j,index01, index01) = c_val + c_der*(nr-1)*(nr-1)/alpha(1,k,j,0) ;
783 system_l1.
set(k,j,index01, index01) = c_val + c_der*(nr-1)*(nr-1)/alpha(1,k,j,0) ;
785 system_even.
set(k,j,index, index) = c_val + c_der*(nr-1)*(nr-1)/alpha(1,k,j,0) ;
786 system_odd.
set(k,j,index, index) = c_val + c_der*(nr-1)*(nr-1)/alpha(1,k,j,0) ;
790 system_l0.
set(k,j,index01, index01) = 1. ;
791 system_l1.
set(k,j,index01, index01) = 1. ;
792 system_even.
set(k,j,index, index) = 1. ;
793 system_odd.
set(k,j,index, index) = 1. ;
795 system_l0.
set(k,j,index01+1, index01) = (nr-1)*(nr-1)/alpha(1,k,j,0) ;
796 system_l1.
set(k,j,index01+1, index01) = (nr-1)*(nr-1)/alpha(1,k,j,0) ;
797 system_even.
set(k,j,index+1, index) = (nr-1)*(nr-1)/alpha(1,k,j,0) ;
798 system_odd.
set(k,j,index+1, index) = (nr-1)*(nr-1)/alpha(1,k,j,0) ;
803 for (
int lz=2; lz<=domain_bc; lz++) {
808 system_l0.
set(k,j,index01, index01+1) = 1. ;
809 system_l0.
set(k,j,index01, index01+2) = -1. ;
810 system_l1.
set(k,j,index01, index01+1) = 1. ;
811 system_l1.
set(k,j,index01, index01+2) = -1. ;
813 system_even.
set(k,j,index, index+1) = 1. ;
814 system_even.
set(k,j,index, index+2) = -1. ;
815 system_odd.
set(k,j,index, index+1) = 1. ;
816 system_odd.
set(k,j,index, index+2) = -1. ;
819 system_l0.
set(k,j,index01, index01) = -(nr-2)*(nr-2)/alpha(lz,k,j,0) ;
820 system_l0.
set(k,j,index01, index01+1) = (nr-1)*(nr-1)/alpha(lz,k,j,0) ;
821 system_l1.
set(k,j,index01, index01) = -(nr-2)*(nr-2)/alpha(lz,k,j,0) ;
822 system_l1.
set(k,j,index01, index01+1) = (nr-1)*(nr-1)/alpha(lz,k,j,0) ;
824 system_even.
set(k,j,index, index) = -(nr-2)*(nr-2)/alpha(lz,k,j,0) ;
825 system_even.
set(k,j,index, index+1) = (nr-1)*(nr-1)/alpha(lz,k,j,0) ;
826 system_odd.
set(k,j,index, index) = -(nr-2)*(nr-2)/alpha(lz,k,j,0) ;
827 system_odd.
set(k,j,index, index+1) = (nr-1)*(nr-1)/alpha(lz,k,j,0) ;
831 if (lz == domain_bc) {
832 system_l0.
set(k,j,index01, index01-1) = c_val + c_der*(nr-2)*(nr-2)/alpha(lz,k,j,0) ;
833 system_l0.
set(k,j,index01, index01) = c_val + c_der*(nr-1)*(nr-1)/alpha(lz,k,j,0) ;
834 system_l1.
set(k,j,index01, index01-1) = c_val + c_der*(nr-2)*(nr-2)/alpha(lz,k,j,0) ;
835 system_l1.
set(k,j,index01, index01) = c_val + c_der*(nr-1)*(nr-1)/alpha(lz,k,j,0) ;
837 system_even.
set(k,j,index, index-1) = c_val + c_der*(nr-2)*(nr-2)/alpha(lz,k,j,0) ;
838 system_even.
set(k,j,index, index) = c_val + c_der*(nr-1)*(nr-1)/alpha(lz,k,j,0) ;
839 system_odd.
set(k,j,index, index-1) = c_val + c_der*(nr-2)*(nr-2)/alpha(lz,k,j,0) ;
840 system_odd.
set(k,j,index, index) = c_val + c_der*(nr-1)*(nr-1)/alpha(lz,k,j,0) ;
844 system_l0.
set(k,j,index01, index01-1) = 1. ;
845 system_l0.
set(k,j,index01, index01) = 1. ;
846 system_l1.
set(k,j,index01, index01-1) = 1. ;
847 system_l1.
set(k,j,index01, index01) = 1. ;
848 system_even.
set(k,j,index, index-1) = 1. ;
849 system_even.
set(k,j,index, index) = 1. ;
850 system_odd.
set(k,j,index, index-1) = 1. ;
851 system_odd.
set(k,j,index, index) = 1. ;
853 system_l0.
set(k,j,index01+1, index01-1) = (nr-2)*(nr-2)/alpha(lz,k,j,0) ;
854 system_l0.
set(k,j,index01+1, index01) = (nr-1)*(nr-1)/alpha(lz,k,j,0) ;
855 system_l1.
set(k,j,index01+1, index01-1) = (nr-2)*(nr-2)/alpha(lz,k,j,0) ;
856 system_l1.
set(k,j,index01+1, index01) = (nr-1)*(nr-1)/alpha(lz,k,j,0) ;
857 system_even.
set(k,j,index+1, index-1) = (nr-2)*(nr-2)/alpha(lz,k,j,0) ;
858 system_even.
set(k,j,index+1, index) = (nr-1)*(nr-1)/alpha(lz,k,j,0) ;
859 system_odd.
set(k,j,index+1, index-1) = (nr-2)*(nr-2)/alpha(lz,k,j,0) ;
860 system_odd.
set(k,j,index+1, index) = (nr-1)*(nr-1)/alpha(lz,k,j,0) ;
865 assert(index01 == system01_size) ;
866 assert(index == system_size) ;
884 const Valeur& sys_l0 = system_l0 ;
885 const Valeur& sys_l1 = system_l1 ;
886 const Valeur& sys_even = system_even ;
888 const Valeur& sys_odd = system_odd ;
894 Mtbl_cf& coef = *
va.
c_cf ; cout <<
"COEF : " << coef << endl;
899 int m_q, l_q, base_r ;
900 for (
int k=0; k<np+2; k++) {
901 for (
int j=0; j<nt; j++) {
903 if ((nullite_plm(j, nt, k, np, base) == 1)&&(l_q >= l_min)) {
905 int sys_size = (l_q < 2 ? system01_size : system_size) ;
906 int nl = (l_q < 2 ? 1 : 2) ;
911 int nr = mgrid.
get_nr(0) ;
914 if (isexcised==
false){
917 double val_c = 0.; pari = 1 ;
918 for (
int i=0; i<nr-nl; i++) {
919 val_c += pari*coef(0, k, j, i) ;
922 rhs.
set(k,j,index) = val_c ;
926 double der_c = 0.; pari = 1 ;
927 for (
int i=0; i<nr-nl-1; i++) {
928 der_c += pari*(2*i+1)*coef(0, k, j, i) ;
931 rhs.
set(k,j,index) = der_c / alpha(0, k, j, 0) ;
936 for (
int i=0; i<nr-nl; i++) {
937 val_b += coef(0, k, j, i) ;
938 der_b += 4*i*i*coef(0, k, j, i) ;
943 for (
int i=0; i<nr-nl-1; i++) {
944 val_b += coef(0, k, j, i) ;
945 der_b += (2*i+1)*(2*i+1)*coef(0, k, j, i) ;
949 rhs.
set(k,j,index) = mu(k,j) - c_val*val_b - c_der*der_b/alpha(0, k, j, 0) ;
953 rhs.
set(k,j,index) = -val_b ;
955 rhs.
set(k,j,index+1) = -der_b/alpha(0, k, j, 0) ;
962 int nr_lim = nr - n_conditions ;
963 val_b = 0 ; pari = 1 ;
964 for (
int i=0; i<nr_lim; i++) {
965 val_b += pari*coef(1, k, j, i) ;
968 rhs.
set(k,j,index) += val_b ;
971 der_b = 0 ; pari = -1 ;
972 for (
int i=0; i<nr_lim; i++) {
973 der_b += pari*i*i*coef(1, k, j, i) ;
976 rhs.
set(k,j,index) += der_b/alpha(1,k,j,0) ;
980 for (
int i=0; i<nr_lim; i++)
981 val_b += coef(1, k, j, i) ;
983 for (
int i=0; i<nr_lim; i++) {
984 der_b += i*i*coef(1, k, j, i) ;
987 rhs.
set(k,j,index) = mu(k,j) - c_val*val_b - c_der*der_b/alpha(1,k,j,0) ;
991 rhs.
set(k,j,index) = -val_b ;
992 if (derivative) rhs.
set(k,j,index+1) = -der_b / alpha(1,k,j,0) ;
1001 int nr_lim = nr - 1 ;
1003 for (
int i=0; i<nr_lim; i++)
1004 val_b += coef(1, k, j, i) ;
1006 for (
int i=0; i<nr_lim; i++) {
1007 der_b += i*i*coef(1, k, j, i) ;
1010 rhs.
set(k,j,index) = mu(k,j) - c_val*val_b - c_der*der_b/alpha(1,k,j,0) ;
1014 rhs.
set(k,j,index) = -val_b ;
1015 if (derivative) rhs.
set(k,j,index+1) = -der_b / alpha(1,k,j,0) ;
1021 for (
int lz=2; lz<=domain_bc; lz++) {
1026 int nr_lim = nr - n_conditions ;
1027 val_b = 0 ; pari = 1 ;
1028 for (
int i=0; i<nr_lim; i++) {
1029 val_b += pari*coef(lz, k, j, i) ;
1032 rhs.
set(k,j,index) += val_b ;
1035 der_b = 0 ; pari = -1 ;
1036 for (
int i=0; i<nr_lim; i++) {
1037 der_b += pari*i*i*coef(lz, k, j, i) ;
1040 rhs.
set(k,j,index) += der_b/alpha(lz, k, j, 0) ;
1044 for (
int i=0; i<nr_lim; i++)
1045 val_b += coef(lz, k, j, i) ;
1047 for (
int i=0; i<nr_lim; i++) {
1048 der_b += i*i*coef(lz, k, j, i) ;
1050 if (domain_bc==lz) {
1051 rhs.
set(k,j,index) = mu(k,j) - c_val*val_b - c_der*der_b/alpha(lz, k, j, 0) ;
1055 rhs.
set(k,j,index) = -val_b ;
1056 if (derivative) rhs.
set(k,j,index+1) = -der_b / alpha(lz, k, j, 0) ;
1059 Tbl solut(sys_size);
1065 for (
int ind1=0; ind1<sys_size; ind1++){
1066 rhs_tmp.
set(ind1) = rhs(k,j,ind1) ;
1067 for (
int ind2=0; ind2<sys_size; ind2++)
1068 sys_l0_tmp.
set(ind1,ind2) = sys_l0(k,j,ind1,ind2) ;
1071 solut = sys_l0_tmp.
inverse(rhs_tmp) ;
1076 for (
int ind1=0; ind1<sys_size; ind1++){
1077 rhs_tmp.
set(ind1) = rhs(k,j,ind1) ;
1078 for (
int ind2=0; ind2<sys_size; ind2++)
1079 sys_l1_tmp.
set(ind1,ind2) = sys_l1(k,j,ind1,ind2) ;
1082 solut = sys_l1_tmp.
inverse(rhs_tmp) ;
1089 for (
int ind1=0; ind1<sys_size; ind1++){
1090 rhs_tmp.
set(ind1) = rhs(k,j,ind1) ;
1091 for (
int ind2=0; ind2<sys_size; ind2++)
1092 sys_even_tmp.
set(ind1,ind2) = sys_even(k,j,ind1,ind2) ;
1095 solut = sys_even_tmp.
inverse(rhs_tmp) ;
1099 for (
int ind1=0; ind1<sys_size; ind1++){
1100 rhs_tmp.
set(ind1) = rhs(k,j,ind1) ;
1101 for (
int ind2=0; ind2<sys_size; ind2++)
1102 sys_odd_tmp.
set(ind1,ind2) = sys_odd(k,j,ind1,ind2) ;
1105 solut = sys_odd_tmp.
inverse(rhs_tmp) ;
1110 int dec = (base_r ==
R_CHEBP ? 0 : 1) ;
1112 if (isexcised==
false){
1114 coef.
set(0, k, j, nr-2-dec) = solut(index) ;
1117 coef.
set(0, k, j, nr-1-dec) = solut(index) ;
1120 coef.
set(0, k, j, nr-1) = 0 ;
1121 if (domain_bc > 0) {
1124 for (nl=1; nl<=n_conditions; nl++) {
1125 int ii = n_conditions - nl + 1 ;
1126 coef.
set(1, k, j, nr-ii) = solut(index) ;
1132 coef.
set(1,k,j,nr-1)=solut(index);
1135 for (
int lz=2; lz<=domain_bc; lz++) {
1137 for (nl=1; nl<=n_conditions; nl++) {
1138 int ii = n_conditions - nl + 1 ;
1139 coef.
set(lz, k, j, nr-ii) = solut(index) ;
1145 for (
int lz=0; lz<=domain_bc; lz++)
1146 for (
int i=0; i<mgrid.
get_nr(lz); i++)
1147 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).