23 char solh_helmholtz_plusC[] =
"$Header $" ;
56 #include <gsl/gsl_sf_bessel.h> 60 #include "type_parite.h" 66 Tbl _solh_helmholtz_plus_pas_prevu (
int,
int,
double,
double,
double) {
68 cout <<
"Homogeneous solution not implemented in hemlholtz_plus : "<< endl ;
81 Tbl _solh_helmholtz_plus_r_cheb (
int n,
int lq,
double alpha,
double beta,
88 double* coloc =
new double[n] ;
90 int * deg =
new int[3] ;
96 for (
int i=0 ; i<n ; i++){
97 double air = alpha*(-
cos(M_PI*i/(n-1))) + beta ;
98 coloc[i] = -gsl_sf_bessel_jl(lq, masse*air) ;
101 cfrcheb(deg, deg, coloc, deg, coloc) ;
102 for (
int i=0 ; i<n ;i++)
103 res.set(0,i) = coloc[i] ;
106 for (
int i=0 ; i<n ; i++){
107 double air = alpha*(-
cos(M_PI*i/(n-1))) + beta ;
108 coloc[i] = -gsl_sf_bessel_yl (lq, masse*air) ;
111 cfrcheb(deg, deg, coloc, deg, coloc) ;
112 for (
int i=0 ; i<n ;i++)
113 res.set(1,i) = coloc[i] ;
125 Tbl _solh_helmholtz_plus_r_chebp (
int n,
int lq,
double alpha,
double,
132 double* coloc =
new double[n] ;
134 int * deg =
new int[3] ;
140 for (
int i=0 ; i<n ; i++){
141 double air = alpha*
sin(M_PI*i/2/(n-1)) ;
142 coloc[i] = -gsl_sf_bessel_jl(lq, masse*air) ;
145 cfrchebp(deg, deg, coloc, deg, coloc) ;
146 for (
int i=0 ; i<n ;i++)
147 res.set(i) = coloc[i] ;
160 Tbl solh_helmholtz_plus (
int n,
int lq,
double alpha,
double beta,
161 double masse,
int base_r) {
164 static Tbl (*solh_helmholtz_plus[
MAX_BASE])(int, int, double, double, double) ;
171 solh_helmholtz_plus[i] = _solh_helmholtz_plus_pas_prevu ;
174 solh_helmholtz_plus[
R_CHEB >>
TRA_R] = _solh_helmholtz_plus_r_cheb ;
175 solh_helmholtz_plus[
R_CHEBP >>
TRA_R] = _solh_helmholtz_plus_r_chebp ;
178 Tbl res(solh_helmholtz_plus[base_r](n, lq, alpha, beta, masse)) ;
Cmp cos(const Cmp &)
Cosine.
#define TRA_R
Translation en R, used for a bitwise shift (in hex)
#define R_CHEBP
base de Cheb. paire (rare) seulement
Cmp sin(const Cmp &)
Sine.
#define MAX_BASE
Nombre max. de bases differentes.
#define R_CHEB
base de Chebychev ordinaire (fin)