23 char solh_helmholtz_minusC[] =
"$Header $" ;
69 #include <gsl/gsl_sf_bessel.h> 73 #include "type_parite.h" 80 Tbl _solh_helmholtz_minus_pas_prevu (
int,
int,
double,
double,
double) {
82 cout <<
"Homogeneous solution not implemented in hemlholtz_minus : "<< endl ;
95 Tbl _solh_helmholtz_minus_r_cheb (
int n,
int lq,
double alpha,
double beta,
102 double* coloc =
new double[n] ;
104 int * deg =
new int[3] ;
110 for (
int i=0 ; i<n ; i++){
111 double air = alpha*(-
cos(M_PI*i/(n-1))) + beta ;
112 coloc[i] = gsl_sf_bessel_il_scaled (lq, masse*air)/
exp(-masse*air) ;
115 cfrcheb(deg, deg, coloc, deg, coloc) ;
116 for (
int i=0 ; i<n ;i++)
117 res.set(0,i) = coloc[i] ;
120 for (
int i=0 ; i<n ; i++){
121 double air = alpha*(-
cos(M_PI*i/(n-1))) + beta ;
122 coloc[i] = gsl_sf_bessel_kl_scaled (lq, masse*air) /
exp(masse*air) ;
125 cfrcheb(deg, deg, coloc, deg, coloc) ;
126 for (
int i=0 ; i<n ;i++)
127 res.set(1,i) = coloc[i] ;
137 Tbl _solh_helmholtz_minus_r_chebp (
int n,
int lq,
double alpha,
double,
144 double* coloc =
new double[n] ;
146 int * deg =
new int[3] ;
152 for (
int i=0 ; i<n ; i++){
153 double air = alpha*(
sin(M_PI*i/2./(n-1))) ;
154 coloc[i] = gsl_sf_bessel_il_scaled (lq, masse*air)/
exp(-masse*air) ;
157 cfrchebp(deg, deg, coloc, deg, coloc) ;
158 for (
int i=0 ; i<n ;i++)
159 res.set(i) = coloc[i] ;
169 Tbl _solh_helmholtz_minus_r_chebi (
int n,
int lq,
double alpha,
double,
176 double* coloc =
new double[n] ;
178 int * deg =
new int[3] ;
184 for (
int i=0 ; i<n ; i++){
185 double air = alpha*(
sin(M_PI*i/2./(n-1))) ;
186 coloc[i] = gsl_sf_bessel_il_scaled (lq, masse*air)/
exp(-masse*air) ;
189 cfrchebi(deg, deg, coloc, deg, coloc) ;
190 for (
int i=0 ; i<n ;i++)
191 res.set(i) = coloc[i] ;
202 Tbl _solh_helmholtz_minus_r_chebu (
int n,
int lq,
203 double alpha,
double,
double masse) {
209 double* coloc =
new double[n] ;
211 int * deg =
new int[3] ;
216 for (
int i=0 ; i<n-1 ; i++){
217 double air = 1./(alpha*(-1-
cos(M_PI*i/(n-1)))) ;
218 coloc[i] = gsl_sf_bessel_kl_scaled (lq, masse*air) /
exp(masse*air) ;
222 cfrcheb(deg, deg, coloc, deg, coloc) ;
223 for (
int i=0 ; i<n ;i++)
224 res.set(i) = coloc[i] ;
237 Tbl solh_helmholtz_minus (
int n,
int lq,
double alpha,
double beta,
238 double masse,
int base_r) {
241 static Tbl (*solh_helmholtz_minus[
MAX_BASE])(int, int, double, double, double) ;
248 solh_helmholtz_minus[i] = _solh_helmholtz_minus_pas_prevu ;
251 solh_helmholtz_minus[
R_CHEB >>
TRA_R] = _solh_helmholtz_minus_r_cheb ;
252 solh_helmholtz_minus[
R_CHEBU >>
TRA_R] = _solh_helmholtz_minus_r_chebu ;
253 solh_helmholtz_minus[
R_CHEBP >>
TRA_R] = _solh_helmholtz_minus_r_chebp ;
254 solh_helmholtz_minus[
R_CHEBI >>
TRA_R] = _solh_helmholtz_minus_r_chebi ;
257 Tbl res(solh_helmholtz_minus[base_r](n, lq, alpha, beta, masse)) ;
Cmp exp(const Cmp &)
Exponential.
Cmp cos(const Cmp &)
Cosine.
#define TRA_R
Translation en R, used for a bitwise shift (in hex)
#define R_CHEBI
base de Cheb. impaire (rare) seulement
#define R_CHEBP
base de Cheb. paire (rare) seulement
Cmp sin(const Cmp &)
Sine.
#define R_CHEBU
base de Chebychev ordinaire (fin), dev. en 1/r
#define MAX_BASE
Nombre max. de bases differentes.
#define R_CHEB
base de Chebychev ordinaire (fin)