32 #include "ope_elementary.h" 39 Tbl _solh_poisson_pseudo_1d_pas_prevu (
int,
int,
double,
double, Tbl&) {
41 cout <<
" Solution homogene pas prevue ..... : "<< endl ;
52 Tbl _solh_poisson_pseudo_1d_r_cheb (
int n,
int l,
double alpha,
double beta,
56 double echelle = beta / alpha ;
58 int expo_deux = -l+1 ;
60 val_lim.
set(0,0) =
pow(echelle-1,
double(expo_un)) ;
61 val_lim.set(0,1) = double(expo_un) *
pow(echelle-1,
double(expo_un-1))/alpha ;
62 val_lim.
set(0,2) =
pow(echelle+1,
double(expo_un)) ;
63 val_lim.set(0,3) = double(expo_un) *
pow(echelle+1,
double(expo_un-1))/alpha ;
66 val_lim.
set(1,0) =
pow(echelle-1,
double(expo_deux)) ;
67 val_lim.set(1,1) = double(expo_deux) *
pow(echelle-1,
double(expo_deux-1))/alpha ;
68 val_lim.
set(1,2) =
pow(echelle+1,
double(expo_deux)) ;
69 val_lim.set(1,3) = double(expo_deux) *
pow(echelle+1,
double(expo_deux-1))/alpha ;
74 double* coloc =
new double[n] ;
76 int * deg =
new int[3] ;
83 for (
int i=0 ; i<n ; i++)
84 coloc[i] =
pow(echelle-
cos(M_PI*i/(n-1)),
double(expo_un)) ;
86 cfrcheb(deg, deg, coloc, deg, coloc) ;
87 for (
int i=0 ; i<n ;i++)
88 res.set(0, i) = coloc[i] ;
91 for (
int i=0 ; i<n ; i++)
92 coloc[i] =
pow(echelle-
cos(M_PI*i/(n-1)),
double(expo_deux)) ;
94 cfrcheb(deg, deg, coloc, deg, coloc) ;
95 for (
int i=0 ; i<n ;i++)
96 res.set(1, i) = coloc[i] ;
110 Tbl _solh_poisson_pseudo_1d_r_chebp (
int n,
int l,
double alpha,
111 double, Tbl& val_lim) {
114 val_lim.
set(0,0) = (l!=0) ? 1 : 0 ;
115 val_lim.set(0,1) = (l!=1) ? 0 : 1 ;
116 val_lim.set(0,2) = 1. ;
117 val_lim.set(0,3) = double(l)/alpha ;
120 assert (div(l, 2).rem ==0) ;
124 double* coloc =
new double[n] ;
126 int * deg =
new int[3] ;
131 for (
int i=0 ; i<n ; i++)
132 coloc[i] =
pow(
sin(M_PI*i/2/(n-1)),
double(l)) ;
134 cfrchebp(deg, deg, coloc, deg, coloc) ;
135 for (
int i=0 ; i<n ;i++)
136 res.set(i) = coloc[i] ;
148 Tbl _solh_poisson_pseudo_1d_r_chebi (
int n,
int l,
149 double alpha,
double, Tbl& val_lim) {
151 val_lim.
set(0,0) = 0 ;
152 val_lim.set(0,1) = (l!=1) ? 0 : 1 ;
153 val_lim.set(0,2) = 1. ;
154 val_lim.set(0,3) = double(l)/alpha ;
158 assert (div(l, 2).rem == 1) ;
162 double* coloc =
new double[n] ;
164 int * deg =
new int[3] ;
169 for (
int i=0 ; i<n ; i++)
170 coloc[i] =
pow(
sin(M_PI*i/2/(n-1)),
double(l)) ;
172 cfrchebi(deg, deg, coloc, deg, coloc) ;
173 for (
int i=0 ; i<n ;i++)
174 res.set(i) = coloc[i] ;
186 static Tbl (*solh_poisson_pseudo_1d[
MAX_BASE]) (int, int, double, double,
Tbl&) ;
193 solh_poisson_pseudo_1d[i] = _solh_poisson_pseudo_1d_pas_prevu ;
196 solh_poisson_pseudo_1d[
R_CHEB >>
TRA_R] = _solh_poisson_pseudo_1d_r_cheb ;
197 solh_poisson_pseudo_1d[
R_CHEBP >>
TRA_R] = _solh_poisson_pseudo_1d_r_chebp ;
198 solh_poisson_pseudo_1d[
R_CHEBI >>
TRA_R] = _solh_poisson_pseudo_1d_r_chebi ;
double alpha
Parameter of the associated mapping.
double s_one_minus
Value of the first homogeneous solution at the inner boundary.
double ds_two_minus
Value of the derivative of the second homogeneous solution at the inner boundary. ...
double beta
Parameter of the associated mapping.
double & set(int i)
Read/write of a particular element (index i) (1D case)
double ds_two_plus
Value of the derivative of the second homogeneous solution at the outer boundary. ...
virtual Tbl get_solh() const
Computes the homogeneous solutions(s).
Cmp cos(const Cmp &)
Cosine.
int base_r
Radial basis of decomposition.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
#define TRA_R
Translation en R, used for a bitwise shift (in hex)
double ds_one_plus
Value of the derivative of the first homogeneous solution at the outer boundary.
#define R_CHEBI
base de Cheb. impaire (rare) seulement
#define R_CHEBP
base de Cheb. paire (rare) seulement
double s_two_minus
Value of the second homogeneous solution at the inner boundary.
Cmp pow(const Cmp &, int)
Power .
Tbl & set(int l)
Read/write of the value in a given domain.
double s_one_plus
Value of the first homogeneous solution at the outer boundary.
int nr
Number of radial points.
double ds_one_minus
Value of the derivative of the first homogeneous solution at the inner boundary.
Cmp sin(const Cmp &)
Sine.
double s_two_plus
Value of the second homogeneous solution at the outer boundary.
#define MAX_BASE
Nombre max. de bases differentes.
int l_quant
quantum number
#define R_CHEB
base de Chebychev ordinaire (fin)