81 const Param* par_bc)
const {
84 assert(mp_aff != 0x0) ;
93 assert(aaa.
get_etat() != ETATNONDEF) ;
96 bool ced = (mgrid.
get_type_r(nzm1) == UNSURR) ;
97 int n_shell = ced ? nz-2 : nzm1 ;
101 n_shell = (nz_bc < n_shell ? nz_bc : n_shell) ;
102 bool cedbc = (ced && (nz_bc == nzm1)) ;
105 assert(par_bc != 0x0) ;
109 int nt = mgrid.
get_nt(0) ;
110 int np = mgrid.
get_np(0) ;
138 int l_q, m_q, base_r ;
144 int nr = mgrid.
get_nr(lz) ;
149 for (
int k=0 ; k<np+1 ; k++) {
150 for (
int j=0 ; j<nt ; j++) {
153 if ( (nullite_plm(j, nt, k, np, base) == 1) && (l_q > 0)) {
157 for (
int lin=0; lin<nr; lin++)
158 for (
int col=0; col<nr; col++)
159 ope.
set(lin,col) = md(lin,col) + 2*ms(lin,col) ;
160 for (
int lin=0; lin<nr; lin++)
161 for (
int col=0; col<nr; col++)
162 ope.
set(lin,col+nr) = -l_q*(l_q+1)*ms(lin,col) ;
163 for (
int lin=0; lin<nr; lin++)
164 for (
int col=0; col<nr; col++)
165 ope.
set(lin+nr,col) = -ms(lin,col) ;
166 for (
int lin=0; lin<nr; lin++)
167 for (
int col=0; col<nr; col++)
168 ope.
set(lin+nr,col+nr) = md(lin,col) + ms(lin,col) ;
176 for (
int col=0 ; col<nr; col++) {
177 ope.
set(nr-1,col) = pari ;
178 ope.
set(nr-1,col+nr) = -pari ;
181 ope.
set(2*nr-1, nr) = 1;
184 for (
int col=0; col<2*nr; col++)
185 ope.
set(ind1+nr-2, col) = 0 ;
186 for (
int col=0; col<2*nr; col++) {
187 ope.
set(nr-1, col) = 0 ;
188 ope.
set(2*nr-1, col) = 0 ;
192 for (
int col=0; col<nr; col++) {
193 ope.
set(nr-1, col) = pari ;
194 ope.
set(2*nr-1, col+nr) = pari ;
199 ope.
set(nr-1, nr-1) = 1 ;
200 ope.
set(2*nr-1, 2*nr-1) = 1 ;
203 ope.
set(ind1+nr-2, ind1) = 1 ;
210 for (
int lin=0; lin<nr; lin++)
212 for (
int lin=0; lin<nr; lin++)
215 sec.
set(2*nr-1) = 0 ;
216 sec.
set(ind1+nr-2) = 0 ;
221 for (
int i=0; i<nr; i++) {
222 sol_part_vr.
set(lz, k, j, i) = sol(i) ;
223 sol_part_eta.
set(lz, k, j, i) = sol(i+nr) ;
226 sec.
set(ind1+nr-2) = 1 ;
230 for (
int i=0; i<nr; i++) {
231 sol_hom2_vr.
set(lz, k, j, i) = sol(i) ;
232 sol_hom2_eta.
set(lz, k, j, i) = sol(i+nr) ;
243 for (
int lz=1; lz <= n_shell; lz++) {
244 int nr = mgrid.
get_nr(lz) ;
245 assert(mgrid.
get_nt(lz) == nt) ;
246 assert(mgrid.
get_np(lz) == np) ;
248 double ech = mp_aff->
get_beta()[lz] / alpha ;
252 for (
int k=0 ; k<np+1 ; k++) {
253 for (
int j=0 ; j<nt ; j++) {
256 if ( (nullite_plm(j, nt, k, np, base) == 1) && (l_q > 0)) {
261 for (
int lin=0; lin<nr; lin++)
262 for (
int col=0; col<nr; col++)
263 ope.
set(lin,col) = mxd(lin,col) + ech*md(lin,col)
265 for (
int lin=0; lin<nr; lin++)
266 for (
int col=0; col<nr; col++)
267 ope.
set(lin,col+nr) = -l_q*(l_q+1)*mid(lin,col) ;
268 for (
int lin=0; lin<nr; lin++)
269 for (
int col=0; col<nr; col++)
270 ope.
set(lin+nr,col) = -mid(lin,col) ;
271 for (
int lin=0; lin<nr; lin++)
272 for (
int col=0; col<nr; col++)
273 ope.
set(lin+nr,col+nr) = mxd(lin,col) + ech*md(lin,col) + mid(lin,col) ;
277 for (
int col=0; col<2*nr; col++) {
278 ope.
set(ind0+nr-1, col) = 0 ;
279 ope.
set(ind1+nr-1, col) = 0 ;
281 ope.
set(ind0+nr-1, ind0) = 1 ;
282 ope.
set(ind1+nr-1, ind1) = 1 ;
288 for (
int lin=0; lin<nr; lin++)
290 for (
int lin=0; lin<nr; lin++)
293 sec.
set(ind0+nr-1) = 0 ;
294 sec.
set(ind1+nr-1) = 0 ;
296 for (
int i=0; i<nr; i++) {
297 sol_part_vr.
set(lz, k, j, i) = sol(i) ;
298 sol_part_eta.
set(lz, k, j, i) = sol(i+nr) ;
303 sec.
set(ind0+nr-1) = 1 ;
307 for (
int i=0; i<nr; i++) {
308 sol_hom1_vr.
set(lz, k, j, i) = sol(i) ;
309 sol_hom1_eta.
set(lz, k, j, i) = sol(i+nr) ;
311 sec.
set(ind0+nr-1) = 0 ;
312 sec.
set(ind1+nr-1) = 1 ;
317 for (
int i=0; i<nr; i++) {
318 sol_hom2_vr.
set(lz, k, j, i) = sol(i) ;
319 sol_hom2_eta.
set(lz, k, j, i) = sol(i+nr) ;
329 if (cedbc) {
int lz = nzm1 ;
330 int nr = mgrid.
get_nr(lz) ;
331 assert(mgrid.
get_nt(lz) == nt) ;
332 assert(mgrid.
get_np(lz) == np) ;
337 for (
int k=0 ; k<np+1 ; k++) {
338 for (
int j=0 ; j<nt ; j++) {
341 if ( (nullite_plm(j, nt, k, np, base) == 1) && (l_q > 0)) {
346 for (
int lin=0; lin<nr; lin++)
347 for (
int col=0; col<nr; col++)
348 ope.
set(lin,col) = - md(lin,col) + 2*ms(lin,col) ;
349 for (
int lin=0; lin<nr; lin++)
350 for (
int col=0; col<nr; col++)
351 ope.
set(lin,col+nr) = -l_q*(l_q+1)*ms(lin,col) ;
352 for (
int lin=0; lin<nr; lin++)
353 for (
int col=0; col<nr; col++)
354 ope.
set(lin+nr,col) = -ms(lin,col) ;
355 for (
int lin=0; lin<nr; lin++)
356 for (
int col=0; col<nr; col++)
357 ope.
set(lin+nr,col+nr) = -md(lin,col) + ms(lin,col) ;
362 for (
int col=0; col<2*nr; col++) {
363 ope.
set(ind0+nr-1, col) = 0 ;
364 ope.
set(ind1+nr-2, col) = 0 ;
365 ope.
set(ind1+nr-1, col) = 0 ;
367 for (
int col=0; col<nr; col++) {
368 ope.
set(ind0+nr-1, col+ind0) = 1 ;
369 ope.
set(ind1+nr-1, col+ind1) = 1 ;
371 ope.
set(ind1+nr-2, ind1+1) = 1 ;
377 for (
int lin=0; lin<nr; lin++)
379 for (
int lin=0; lin<nr; lin++)
382 sec.
set(ind0+nr-1) = 0 ;
383 sec.
set(ind1+nr-2) = 0 ;
384 sec.
set(ind1+nr-1) = 0 ;
387 for (
int i=0; i<nr; i++) {
388 sol_part_vr.
set(lz, k, j, i) = sol(i) ;
389 sol_part_eta.
set(lz, k, j, i) = sol(i+nr) ;
392 sec.
set(ind1+nr-2) = 1 ;
394 for (
int i=0; i<nr; i++) {
395 sol_hom1_vr.
set(lz, k, j, i) = sol(i) ;
396 sol_hom1_eta.
set(lz, k, j, i) = sol(i+nr) ;
403 int taille = 2*nz_bc + 1;
404 if (cedbc) taille-- ;
408 Tbl sec_membre(taille) ;
409 Matrice systeme(taille, taille) ;
410 int ligne ;
int colonne ;
413 double c_vr = (cedbc ? 0 : par_bc->
get_tbl_mod(0)(0) ) ;
414 double d_vr = (cedbc ? 0 : par_bc->
get_tbl_mod(0)(1) ) ;
415 double c_eta = (cedbc ? 0 : par_bc->
get_tbl_mod(0)(2) ) ;
416 double d_eta = (cedbc ? 0 : par_bc->
get_tbl_mod(0)(3) ) ;
420 Mtbl_cf dhom1_vr = sol_hom1_vr ;
421 Mtbl_cf dhom2_vr = sol_hom2_vr ;
422 Mtbl_cf dpart_vr = sol_part_vr ;
423 Mtbl_cf dhom1_eta = sol_hom1_eta ;
424 Mtbl_cf dhom2_eta = sol_hom2_eta ;
425 Mtbl_cf dpart_eta = sol_part_eta ;
438 for (
int k=0 ; k<np+1 ; k++)
439 for (
int j=0 ; j<nt ; j++) {
441 if ((nullite_plm(j, nt, k, np, base) == 1) && (l_q > 0)) {
450 double alpha = mp_aff->
get_alpha()[nz_bc] ;
451 systeme.
set(ligne, colonne) =
475 for (
int zone=1 ; zone<nz_bc ; zone++) {
480 systeme.
set(ligne, colonne) =
482 systeme.
set(ligne, colonne+1) =
488 systeme.
set(ligne, colonne) =
490 systeme.
set(ligne, colonne+1) =
497 systeme.
set(ligne, colonne) =
499 systeme.
set(ligne, colonne+1) =
505 systeme.
set(ligne, colonne) =
507 systeme.
set(ligne, colonne+1) =
516 nr = mgrid.
get_nr(nz_bc) ;
517 double alpha = mp_aff->
get_alpha()[nz_bc] ;
521 systeme.
set(ligne, colonne) =
523 if (!cedbc) systeme.
set(ligne, colonne+1) =
529 systeme.
set(ligne, colonne) =
531 if (!cedbc) systeme.
set(ligne, colonne+1) =
538 systeme.
set(ligne, colonne) =
543 systeme.
set(ligne, colonne+1) =
568 for (
int i=0 ; i<nr ; i++) {
569 mvr.
set(0, k, j, i) = sol_part_vr(0, k, j, i)
570 + facteur(conte)*sol_hom2_vr(0, k, j, i) ;
571 meta.
set(0, k, j, i) = sol_part_eta(0, k, j, i)
572 + facteur(conte)*sol_hom2_eta(0, k, j, i) ;
575 for (
int zone=1 ; zone<=n_shell ; zone++) {
577 for (
int i=0 ; i<nr ; i++) {
578 mvr.
set(zone, k, j, i) = sol_part_vr(zone, k, j, i)
579 + facteur(conte)*sol_hom1_vr(zone, k, j, i)
580 + facteur(conte+1)*sol_hom2_vr(zone, k, j, i) ;
582 meta.
set(zone, k, j, i) = sol_part_eta(zone, k, j, i)
583 + facteur(conte)*sol_hom1_eta(zone, k, j, i)
584 + facteur(conte+1)*sol_hom2_eta(zone, k, j, i) ;
590 for (
int i=0 ; i<nr ; i++) {
591 mvr.
set(nzm1, k, j, i) = sol_part_vr(nzm1, k, j, i)
592 + facteur(conte)*sol_hom1_vr(nzm1, k, j, i) ;
594 meta.
set(nzm1, k, j, i) = sol_part_eta(nzm1, k, j, i)
595 + facteur(conte)*sol_hom1_eta(nzm1, k, j, i) ;
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 annule_domain(int l)
Sets the Tensor to zero in a given domain.
Mtbl_cf * c_cf
Coefficients of the spectral expansion of the function.
const double * get_alpha() const
Returns the pointer on the array alpha.
void mult_r()
Multiplication by r everywhere; dzpuis is not changed.
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...
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.
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).
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).
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 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
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.
void sol_Dirac_A(const Scalar &aaa, Scalar &eta, Scalar &vr, const Param *par_bc=0x0) const
Solves a system of two-coupled first-order PDEs obtained from the divergence-free condition and the r...
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.
void annule_hard()
Sets the logical state to ETATQCQ (undefined state).
double & set(int j, int i)
Read/write of a particuliar element.
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 mult_x()
The basis is transformed as with a multiplication by .
Coefficients storage for the multi-domain spectral method.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
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.
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.
virtual const Matrice & get_matrice() const
Returns the matrix associated with the operator.
const Valeur & get_spectral_va() const
Returns va (read only version)