67 void _sx_r_chebp(Tbl* ,
int& ) ;
68 void _sx_r_chebi(Tbl* ,
int& ) ;
73 assert(
etat != ETATNONDEF) ;
75 assert( mpaff != 0x0) ;
79 if (
etat == ETATZERO )
99 for (
int lz = 0; lz<nz; lz++)
100 assert( (mg->
get_nt(lz) == nt) && (mg->
get_np(lz) == np) ) ;
102 int nr, base_r,l_quant, m_quant;
108 Mtbl_cf sol_part(mg, base_resu) ;
109 Mtbl_cf sol_hom(mg, base_resu) ;
122 int nr0 = nr - dege ;
123 Tbl vect1(3, 1, nr) ;
124 Tbl vect2(3, 1, nr) ;
130 for (
int i=dege; i<nr; i++) {
133 vect1.
set(0,0,i) = 1. ; vect2.
set(0,0,i) = 1. ;
134 _dsdx_r_chebp(&vect1, base_pipo) ;
135 _sx_r_chebp(&vect2, base_pipo) ;
136 for (
int j=0; j<nr0; j++)
137 ope_even.
set(j,i-dege) = (vect1(0,0,j) + n_factor*vect2(0,0,j)) / alpha ;
142 for (
int i=0; i<nr0; i++) {
145 vect1.
set(0,0,i) = 1. ; vect2.
set(0,0,i) = 1. ;
146 _dsdx_r_chebi(&vect1, base_pipo) ;
147 _sx_r_chebi(&vect2, base_pipo) ;
148 for (
int j=0; j<nr0; j++)
149 ope_odd.
set(j,i) = (vect1(0,0,j) + n_factor*vect2(0,0,j)) / alpha ;
153 for (
int k=0 ; k<np+1 ; k++)
154 for (
int j=0 ; j<nt ; j++) {
159 ope_even : ope_odd ) ;
163 for (
int i=0 ; i<nr0 ; i++)
164 so->
set(i) = source(lz, k, j, i) ;
170 for (
int i=0 ; i<nr0 ; i++) {
172 resu.
set(lz, k, j, i+dege) = (*s_part)(i) ;
173 somme += ((i+dege)%2 == 0 ? 1 : -1)*(*s_part)(i) ;
176 resu.
set(lz,k,j,i) = (*s_part)(i) ;
179 for (
int i=nr0; i<nr; i++)
180 resu.
set(lz,k,j,i) = 0 ;
182 resu.
set(lz, k, j, 0) -= somme ;
192 int nz0 = (ced ? nz - 1 : nz) ;
193 for (lz=1 ; lz<nz0 ; lz++) {
197 double ech = beta / alpha ;
201 Matrice operateur = mxd + ech*mdx + n_factor*mid ;
204 s_hom =
new Tbl(solh(nr, n_factor-1, ech,
R_CHEB)) ;
206 for (
int k=0 ; k<np+1 ; k++)
207 for (
int j=0 ; j<nt ; j++) {
210 assert (base_r ==
R_CHEB) ;
217 for (
int i=0 ; i<nr ; i++)
218 tmp.
set(i) = source(lz, k, j, i) ;
219 for (
int i=0; i<nr; i++) so->
set(i) = beta*tmp(i) ;
220 multx_1d(nr, &tmp.t,
R_CHEB) ;
221 for (
int i=0; i<nr; i++) so->
set(i) += alpha*tmp(i) ;
226 for (
int i=0 ; i<nr ; i++) {
227 sol_part.
set(lz, k, j, i) = (*s_part)(i) ;
228 sol_hom.
set(lz, k, j, i) = (*s_hom)(1,i) ;
253 for (
int lin=0; lin<nr0; lin++)
254 for (
int col=dege; col<nr; col++)
255 operateur.
set(lin,col-dege) = (-mdx(lin,col)
256 + n_factor*msx(lin, col)) / alpha ;
258 for (
int lin=0; lin<nr0; lin++) {
259 for (
int col=dege; col<nr; col++)
260 operateur.
set(lin,col-dege) = (-mxdx(lin,col)
261 + n_factor*mid(lin, col)) ;
266 s_hom =
new Tbl(solh(nr, n_factor-1, 0.,
R_CHEBU)) ;
267 for (
int k=0 ; k<np+1 ; k++)
268 for (
int j=0 ; j<nt ; j++) {
275 for (
int i=0 ; i<nr0 ; i++)
276 so->
set(i) = source(nz-1, k, j, i) ;
281 for (
int i=0 ; i<nr0 ; i++) {
282 sol_part.
set(nz-1, k, j, i+dege) = (*s_part)(i) ;
283 somme += (*s_part)(i) ;
284 sol_hom.
set(nz-1, k, j, i) = (*s_hom)(i) ;
286 for (
int i=nr0; i<nr; i++)
287 sol_hom.
set(nz-1, k, j, i) = (*s_hom)(i) ;
289 sol_part.
set(nz-1, k, j, 0) = -somme ;
302 for (lz=1; lz<nz; lz++)
306 if (ced) echelles.
set(nz-2) = 1./
pow(-2., n_factor) ;
308 for (
int k=0 ; k<np+1 ; k++)
309 for (
int j=0 ; j<nt ; j++) {
310 for (lz=1; lz<nz; lz++) {
314 int nr_prec = mg->
get_nr(lz-1) ;
316 for (
int i=0; i<nr_prec; i++)
317 val1 += resu(lz-1, k, j, i) ;
318 for (
int i=0; i<nr; i++) {
319 valm1 += ( i%2 == 0 ? 1 : -1)*sol_part(lz, k, j, i) ;
320 valhom1 += ( i%2 == 0 ? 1 : -1)*sol_hom(lz, k, j, i) ;
322 double lambda = (val1 - valm1) * echelles(lz-1) ;
323 for (
int i=0; i<nr; i++)
324 resu.
set(lz, k, j, i) = sol_part(lz, k, j, i)
325 + lambda*sol_hom(lz, 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.
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 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...
virtual void set_etat_zero()
Sets the logical state to ETATZERO (zero).
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.
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).
Values and coefficients of a (real-value) function.
Class for the elementary differential operator (see the base class Diff ).
Scalar sol_divergence(int n) const
Resolution of a divergence-like equation.
virtual void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
const Mg3d * get_mg() const
Returns the Mg3d on which the Mtbl_cf is defined.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Class for the elementary differential operator Identity (see the base class Diff ).
friend Scalar pow(const Scalar &, int)
Power .
#define R_CHEBI
base de Cheb. impaire (rare) seulement
#define R_CHEBP
base de Cheb. paire (rare) seulement
const double * get_beta() const
Returns the pointer on the array beta.
int get_nzone() const
Returns the number of domains.
Valeur va
The numerical value of the Scalar.
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.
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 ).
int etat
The logical state ETATNONDEF (undefined), ETATZERO (null), ETATUN (one), or ETATQCQ (ordinary)...
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)
#define R_CHEBU
base de Chebychev ordinaire (fin), dev. en 1/r
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 annule_hard()
Sets the Tbl to zero in a hard way.
virtual const Matrice & get_matrice() const
Returns the matrix associated with the operator.
#define R_CHEB
base de Chebychev ordinaire (fin)