89 #include "type_parite.h" 94 void theta_funct_pas_prevu(
int,
double*) ;
95 void theta_funct_cos(
int,
double*) ;
96 void theta_funct_sin(
int,
double*) ;
97 void theta_funct_cos_p(
int,
double*) ;
98 void theta_funct_cos_i(
int,
double*) ;
99 void theta_funct_sin_p(
int,
double*) ;
100 void theta_funct_sin_i(
int,
double*) ;
101 void theta_funct_cossin_cp(
int,
double*) ;
102 void theta_funct_cossin_ci(
int,
double*) ;
103 void theta_funct_cossin_sp(
int,
double*) ;
104 void theta_funct_cossin_si(
int,
double*) ;
105 void theta_funct_cossin_c(
int,
double*) ;
106 void theta_funct_cossin_s(
int,
double*) ;
114 const int nmax = 20 ;
115 static int nb_done = 0 ;
116 static int base_t_done[nmax] ;
117 static int nt_done[nmax] ;
118 static Tbl* tab[nmax] ;
120 static void(*vbasecol[
MAX_BASE])(int,
double*) ;
123 static int premier_appel = 1 ;
127 if (premier_appel == 1) {
132 vbasecol[i] = theta_funct_pas_prevu ;
172 for (
int i=0; i<nb_done; i++) {
173 if ( (base_t_done[i] == base_t) && (nt_done[i] == nt) ) {
181 if ( nb_done >= nmax ) {
182 cout <<
"Base_val::theta_functions : nb_done >= nmax ! " << endl ;
188 tab[index] =
new Tbl( dim2[base_t], nt, nt ) ;
189 (tab[index])->set_etat_qcq() ;
191 vbasecol[base_t](nt, (tab[index])->t ) ;
193 base_t_done[index] = base_t ;
194 nt_done[index] = nt ;
200 return *(tab[index]) ;
213 void theta_funct_pas_prevu(
int,
double*) {
215 cout <<
"Base_val::theta_functions : theta basis not implemented !" 225 void theta_funct_cos(
int nt,
double* ff) {
227 double xx = ( nt > 1 ? M_PI / double(nt-1) : 0.) ;
229 for (
int i = 0; i < nt ; i++ ) {
230 for (
int j = 0; j < nt ; j++ ) {
231 double theta = xx*j ;
232 ff[nt*i+ j] =
cos(i * theta);
242 void theta_funct_sin(
int nt,
double* ff) {
244 double xx = ( nt > 1 ? M_PI / double(nt-1) : 0.) ;
246 for (
int i = 0; i < nt ; i++ ) {
247 for (
int j = 0; j < nt ; j++ ) {
248 double theta = xx*j ;
249 ff[nt*i+ j] =
sin(i * theta);
259 void theta_funct_cos_p(
int nt,
double* ff) {
261 double xx = ( nt > 1 ? M_PI / double(2*(nt-1)) : 0.) ;
263 for (
int i = 0; i < nt ; i++ ) {
264 for (
int j = 0; j < nt ; j++ ) {
265 double theta = xx*j ;
266 ff[nt*i+ j] =
cos(2*i * theta);
276 void theta_funct_cos_i(
int nt,
double* ff) {
278 double xx = ( nt > 1 ? M_PI / double(2*(nt-1)) : 0.) ;
280 for (
int i = 0; i < nt ; i++ ) {
281 for (
int j = 0; j < nt ; j++ ) {
282 double theta = xx*j ;
283 ff[nt*i+ j] =
cos((2*i+1) * theta);
293 void theta_funct_sin_p(
int nt,
double* ff) {
295 double xx = ( nt > 1 ? M_PI / double(2*(nt-1)) : 0.) ;
297 for (
int i = 0; i < nt ; i++ ) {
298 for (
int j = 0; j < nt ; j++ ) {
299 double theta = xx*j ;
300 ff[nt*i+ j] =
sin(2*i * theta);
310 void theta_funct_sin_i(
int nt,
double* ff) {
312 double xx = ( nt > 1 ? M_PI / double(2*(nt-1)) : 0.) ;
314 for (
int i = 0; i < nt ; i++ ) {
315 for (
int j = 0; j < nt ; j++ ) {
316 double theta = xx*j ;
317 ff[nt*i+ j] =
sin((2*i+1) * theta);
327 void theta_funct_cossin_cp(
int nt,
double* ff) {
331 double xx = ( nt > 1 ? M_PI / double(2*(nt-1)) : 0.) ;
335 for (
int i = 0; i < nt ; i++ ) {
336 for (
int j = 0; j < nt ; j++ ) {
337 double theta = xx*j ;
338 ff[nt*i+ j] =
cos(2*i * theta);
345 for (
int i = 0; i < nt-1 ; i++ ) {
346 for (
int j = 0; j < nt ; j++ ) {
347 double theta = xx*j ;
348 ff[nt2+nt*i+ j] =
sin((2*i+1) * theta);
352 for (
int j = 0; j < nt ; j++ ) {
353 ff[nt2+nt*(nt-1) + j] = 0 ;
363 void theta_funct_cossin_ci(
int nt,
double* ff) {
367 double xx = ( nt > 1 ? M_PI / double(2*(nt-1)) : 0.) ;
371 for (
int i = 0; i < nt ; i++ ) {
372 for (
int j = 0; j < nt ; j++ ) {
373 double theta = xx*j ;
374 ff[nt*i+ j] =
cos((2*i+1) * theta);
381 for (
int i = 0; i < nt-1 ; i++ ) {
382 for (
int j = 0; j < nt ; j++ ) {
383 double theta = xx*j ;
384 ff[nt2+nt*i+ j] =
sin(2*i * theta);
388 for (
int j = 0; j < nt ; j++ ) {
389 ff[nt2+nt*(nt-1) + j] = 0 ;
400 void theta_funct_cossin_sp(
int nt,
double* ff) {
404 double xx = ( nt > 1 ? M_PI / double(2*(nt-1)) : 0.) ;
408 for (
int i = 0; i < nt ; i++ ) {
409 for (
int j = 0; j < nt ; j++ ) {
410 double theta = xx*j ;
411 ff[nt*i+ j] =
sin(2*i * theta);
418 for (
int i = 0; i < nt-1 ; i++ ) {
419 for (
int j = 0; j < nt ; j++ ) {
420 double theta = xx*j ;
421 ff[nt2+nt*i+ j] =
cos((2*i+1) * theta);
425 for (
int j = 0; j < nt ; j++ ) {
426 ff[nt2+nt*(nt-1) + j] = 0 ;
436 void theta_funct_cossin_si(
int nt,
double* ff) {
440 double xx = ( nt > 1 ? M_PI / double(2*(nt-1)) : 0.) ;
444 for (
int i = 0; i < nt ; i++ ) {
445 for (
int j = 0; j < nt ; j++ ) {
446 double theta = xx*j ;
447 ff[nt*i+ j] =
sin((2*i+1) * theta);
454 for (
int i = 0; i < nt-1 ; i++ ) {
455 for (
int j = 0; j < nt ; j++ ) {
456 double theta = xx*j ;
457 ff[nt2+nt*i+ j] =
cos(2*i * theta);
461 for (
int j = 0; j < nt ; j++ ) {
462 ff[nt2+nt*(nt-1) + j] = 0 ;
472 void theta_funct_cossin_c(
int nt,
double* ff) {
476 double xx = ( nt > 1 ? M_PI / double(nt-1) : 0.) ;
480 for (
int i = 0; i < nt ; i++ ) {
481 for (
int j = 0; j < nt ; j++ ) {
482 double theta = xx*j ;
483 ff[nt*i+ j] =
cos(i * theta);
490 for (
int i = 0; i < nt-1 ; i++ ) {
491 for (
int j = 0; j < nt ; j++ ) {
492 double theta = xx*j ;
493 ff[nt2+nt*i+ j] =
sin(i * theta);
497 for (
int j = 0; j < nt ; j++ ) {
498 ff[nt2+nt*(nt-1) + j] = 0 ;
508 void theta_funct_cossin_s(
int nt,
double* ff) {
512 double xx = ( nt > 1 ? M_PI / double(nt-1) : 0.) ;
516 for (
int i = 0; i < nt-1 ; i++ ) {
517 for (
int j = 0; j < nt ; j++ ) {
518 double theta = xx*j ;
519 ff[nt*i+ j] =
sin(i * theta);
523 for (
int j = 0; j < nt ; j++ ) {
524 ff[nt*(nt-1) + j] = 0 ;
530 for (
int i = 0; i < nt ; i++ ) {
531 for (
int j = 0; j < nt ; j++ ) {
532 double theta = xx*j ;
533 ff[nt2+nt*i+ j] =
cos(i * theta);
#define TRA_T
Translation en Theta, used for a bitwise shift (in hex)
#define T_COS
dev. cos seulement
#define T_COSSIN_SP
sin pair-cos impair alternes, sin pour m=0
Cmp cos(const Cmp &)
Cosine.
#define T_SIN
dev. sin seulement
#define T_COS_I
dev. cos seulement, harmoniques impaires
#define T_COS_P
dev. cos seulement, harmoniques paires
#define MSQ_T
Extraction de l'info sur Theta.
#define T_COSSIN_C
dev. cos-sin alternes, cos pour m=0
int * b
Array (size: nzone ) of the spectral basis in each domain.
#define T_SIN_P
dev. sin seulement, harmoniques paires
#define T_COSSIN_SI
sin impair-cos pair alternes, sin pour m=0
const Tbl & theta_functions(int l, int nt) const
Values of the theta basis functions at the theta collocation points.
#define T_COSSIN_CI
cos impair-sin pair alternes, cos pour m=0
Cmp sin(const Cmp &)
Sine.
#define T_COSSIN_CP
cos pair-sin impair alternes, cos pour m=0
#define MAX_BASE
Nombre max. de bases differentes.
#define T_SIN_I
dev. sin seulement, harmoniques impaires
#define T_COSSIN_S
dev. cos-sin alternes, sin pour m=0