71 int cnp (
int n,
int p) {
79 for (
int conte=n ; conte >n-p ; conte --)
83 for (
int conte = 1 ; conte<p+1 ; conte++)
86 return int(fact_un/fact_deux) ;
100 int base_r, m_quant, l_quant ;
111 cout <<
"Le mapping doit etre affine" << endl ;
117 double beta = map->
get_beta()[zone] ;
120 double new_alpha = -alpha/(beta*beta-alpha*alpha) ;
121 double new_beta = beta/(beta*beta-alpha*alpha) ;
124 double alpha_zec = map->
get_alpha()[zone+1] ;
132 tksi.
set(0, 0) =
sqrt(
double(2)) ;
133 for (
int i=1 ; i<nbre ; i++)
138 tksi.
set(1, 1) =
sqrt(
double(2)) ;
139 for (
int i=2 ; i<nbre ; i++)
143 for (
int lig=2 ; lig<nbre ; lig++) {
144 tksi.
set(lig, 0) = -tksi(lig-2, 0) ;
145 for (
int col=1 ; col<nbre ; col++)
146 tksi.
set(lig, col) = 2*tksi(lig-1, col-1)-tksi(lig-2, col) ;
153 for (
int lig=0 ; lig<nbre ; lig++) {
154 for (
int col=0 ; col<=lig ; col++)
155 ksiu.
set(lig, col) = cnp(lig, col)*
156 pow(-new_beta/new_alpha, lig-col) ;
157 for (
int col = lig+1 ; col<nbre ; col++)
158 ksiu.
set(lig, col) = 0 ;
165 for (
int lig=0 ; lig<nbre ; lig++)
166 for (
int col=0 ; col<nbre ; col++) {
168 for (
int m=0 ; m<nbre ; m++)
169 somme += tksi(lig, m)*ksiu(m, col) ;
170 tu.
set(lig, col) = somme ;
174 Tbl coef_u (nbre+lmax, nr) ;
176 int* dege =
new int [3] ;
177 dege[0] = 1 ; dege[1] = 1 ; dege[2] = nr ;
178 double* ti =
new double [nr] ;
180 for (
int puiss=0 ; puiss<nbre+lmax ; puiss++) {
181 for (
int i=0 ; i<nr ; i++)
182 ti[i] =
pow(-
cos(M_PI*i/(nr-1))-1, puiss) ;
183 cfrcheb (dege, dege, ti, dege, ti) ;
184 for (
int i=0 ; i<nr ; i++)
185 coef_u.
set(puiss, i) = ti[i] ;
190 double *coloc =
new double[nbre] ;
191 double *auxi =
new double [1] ;
193 Tbl coef_zec (np+2, nt, nr) ;
198 for (
int k=0 ; k<np+2 ; k++)
199 for (
int j=0 ; j<nt ; j++)
200 if (nullite_plm (j, nt, k, np, base_devel)==1) {
201 donne_lm (zone+2, zone+1, j, k, base_devel, m_quant,
203 if (l_quant <= lmax) {
208 for (
int i=0 ; i<nbre ; i++) {
209 ksi = -
cos(M_PI*i/(nbre-1)) ;
210 air = 1./(new_alpha*ksi+new_beta) ;
211 ksi = (air-beta)/alpha ;
212 for (
int m=0 ; m<nr ; m++)
213 ti[m] = (*
va.
c_cf)(zone, k, j, m) ;
214 som_r_cheb (ti, nr, 1, 1, ksi, auxi) ;
216 pow (-new_alpha*
cos(M_PI*i/(nbre-1))+new_beta, power+l_quant);
219 cfrcheb (dege, dege, coloc, dege, coloc) ;
221 Tbl expansion (nbre) ;
223 for (
int i=0 ; i<nbre ; i++) {
225 for (
int m=0 ; m<nbre ; m++)
226 somme += coloc[m]*tu(m, i) ;
227 expansion.
set(i) = somme ;
230 for (
int i=0 ; i<nr ; i++) {
232 for (
int m=0 ; m<nbre ; m++)
233 somme += coef_u(m+l_quant, i)*expansion(m)*
234 pow(alpha_zec, m+l_quant)/
236 coef_zec.
set(k, j, i) = somme ;
245 for (
int k=0 ; k<np+2 ; k++)
246 for (
int j=0 ; j<nt ; j++)
247 for (
int i=0 ; i<nr ; i++)
248 va.
c_cf->
set(zone+1, k, j, i) = coef_zec(k, j, i) ;
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...
void coef() const
Computes the coeffcients of *this.
Cmp sqrt(const Cmp &)
Square root.
Tbl & set(int l)
Read/write of the Tbl containing the coefficients in a given domain.
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)
void raccord_externe(int puis, int nbre, int lmax)
Matching of the external domain with the outermost shell.
Cmp cos(const Cmp &)
Cosine.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Base_val base
Bases on which the spectral expansion is performed.
const double * get_beta() const
Returns the pointer on the array beta.
int get_nzone() const
Returns the number of domains.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Cmp pow(const Cmp &, int)
Power .
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.
Bases of the spectral expansions.
const Map * mp
Reference mapping.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
void set_dzpuis(int)
Set a value to dzpuis.
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
void annule_hard()
Sets the Tbl to zero in a hard way.
Valeur va
The numerical value of the Cmp.
Tbl ** t
Array (size nzone ) of pointers on the Tbl 's which contain the spectral coefficients in each domain...