58#include "type_parite.h"
74 static int nt_courant = 0 ;
81 if (nt != nt_courant) {
92 for (
int i=0 ; i<nt ; i++)
93 for (
int j=0 ; j<nt ; j++)
96 double c_courant = 0 ;
97 for (
int j=0 ; j<nt ; j++) {
99 for (
int i=1 ; i<j ; i++)
101 ope.
set(j,j) = c_courant ;
102 c_courant -= 8*j + 2 ;
115 for (
int i=0 ; i<nt ; i++) {
116 for (
int j=0 ; j<nt ; j++)
120 for (
int j=0 ; j<nt ; j++)
121 inv->
set(j,i) = sortie(j) ;
128 for (
int k=0 ; k<so.
mg->
get_np(l) ; k++)
129 for (
int i=0 ; i<so.
mg->
get_nr(l) ; i++) {
133 for (
int j=0 ; j<nt ; j++)
134 coefs.
set(j) = (*so.
c_cf)(l,k,j,i) ;
137 for (
int j=0 ; j<nt ; j++)
142 for (
int j=0 ; j<nt ; j++)
143 for (
int jb=0 ; jb<nt ; jb++)
144 prod.
set(j) += (*inv)(j, jb) * coefs(jb) ;
148 for (
int j=0 ; j<nt ; j++)
149 for (
int jb=0 ; jb<nt ; jb++)
150 prod.
set(j) += (*passage)(j, jb) * coefs(jb) ;
153 for (
int j=0 ; j<nt ; j++)
154 so.
c_cf->
set(l,k,j,i) = prod(j) ;
171 cout <<
"Problem in rotate_propre_pair" << endl ;
185 cout <<
"Problem in rotate_propre_pair" << endl ;
203 static int nt_courant = 0 ;
204 static Matrice* passage = 0x0 ;
210 if (nt != nt_courant) {
221 for (
int i=0 ; i<nt ; i++)
222 for (
int j=0 ; j<nt ; j++)
225 double c_courant = 0 ;
226 for (
int j=0 ; j<nt ; j++) {
227 for (
int i=0 ; i<j ; i++)
228 ope.
set(i,j) = 2+4*j ;
229 ope.
set(j,j) = c_courant ;
230 c_courant -= 8*j + 6 ;
243 for (
int i=0 ; i<nt ; i++) {
244 for (
int j=0 ; j<nt ; j++)
248 for (
int j=0 ; j<nt ; j++)
249 inv->
set(j,i) = sortie(j) ;
257 for (
int k=0 ; k<so.
mg->
get_np(l) ; k++)
258 for (
int i=0 ; i<so.
mg->
get_nr(l) ; i++) {
262 for (
int j=0 ; j<nt ; j++)
263 coefs.
set(j) = (*so.
c_cf)(l,k,j,i) ;
266 for (
int j=0 ; j<nt ; j++)
271 for (
int j=0 ; j<nt ; j++)
272 for (
int jb=0 ; jb<nt ; jb++)
273 prod.
set(j) += (*inv)(j, jb) * coefs(jb) ;
277 for (
int j=0 ; j<nt ; j++)
278 for (
int jb=0 ; jb<nt ; jb++)
279 prod.
set(j) += (*passage)(j, jb) * coefs(jb) ;
282 for (
int j=0 ; j<nt ; j++)
283 so.
c_cf->
set(l,k,j,i) = prod(j) ;
300 cout <<
"Problem in rotate_propre_impair" << endl ;
314 cout <<
"Problem in rotate_propre_impair" << endl ;
328 int nz =
mg->get_nzone() ;
329 int base_tet =
base.get_base_t(0) ;
331 for (
int i=1 ; i<nz ; i++)
332 assert (base_tet ==
base.get_base_t(i)) ;
356 cout <<
"Unknown basis in Valeur::val_propre_1d" << endl ;
364 int nz =
mg->get_nzone() ;
365 int base_tet =
base.get_base_t(0) ;
367 for (
int i=1 ; i<nz ; i++)
368 assert (base_tet ==
base.get_base_t(i)) ;
392 cout <<
"Unknown basis in Valeur::val_propre_1d_i" << endl ;
Bases of the spectral expansions.
void set_base_t(int base_t)
Sets the expansion basis for functions in all domains.
int get_base_t(int l) const
Returns the expansion basis for functions in the domain of index l (e.g.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
double & set(int j, int i)
Read/write of a particuliar element.
Tbl inverse(const Tbl &sec_membre) const
Solves the linear system represented by the matrix.
void set_band(int up, int low) const
Calculate the band storage of *std.
void set_lu() const
Calculate the LU-representation, assuming the band-storage has been done.
Matrice vect_propre() const
Returns the eigenvectors of the matrix, calculated using LAPACK.
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
int get_nzone() const
Returns the number of domains.
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
Base_val base
Bases of the spectral expansions.
Tbl & set(int l)
Read/write of the Tbl containing the coefficients in a given domain.
Tbl ** t
Array (size nzone ) of pointers on the Tbl 's which contain the spectral coefficients in each domain.
int get_etat() const
Gives the logical state.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
double & set(int i)
Read/write of a particular element (index i) (1D case).
void set_etat_cf_qcq()
Sets the logical state to ETATQCQ (ordinary state) for values in the configuration space (Mtbl_cf c_c...
void val_propre_1d_i()
Inverse transformation of val_propre_1d.
Valeur(const Mg3d &mgrid)
Constructor.
friend void rotate_propre_pair(Valeur &, bool)
Friend fonction.
const Mg3d * mg
Multi-grid Mgd3 on which this is defined.
friend void rotate_propre_impair(Valeur &, bool)
Friend fonction.
Mtbl_cf * c_cf
Coefficients of the spectral expansion of the function.
void coef() const
Computes the coeffcients of *this.
Base_val base
Bases on which the spectral expansion is performed.
void val_propre_1d()
Set the basis to the eigenvalues of .
#define T_CL_COS_I
CL of odd cosines.
#define T_CL_SIN_I
CL of odd sines.
#define T_SIN_P
dev. sin seulement, harmoniques paires
#define T_CL_SIN_P
CL of even sines.
#define T_COS_P
dev. cos seulement, harmoniques paires
#define T_CL_COS_P
CL of even cosines.
#define T_SIN_I
dev. sin seulement, harmoniques impaires
#define T_COS_I
dev. cos seulement, harmoniques impaires