74 #include "type_parite.h" 81 Tbl _solp_helmholtz_minus_pas_prevu (
const Matrice &,
const Matrice &,
82 const Tbl &,
double,
double,
int) {
83 cout <<
" Solution homogene pas prevue ..... : "<< endl ;
97 Tbl _solp_helmholtz_minus_r_chebu (
const Matrice &lap,
const Matrice &nondege,
98 const Tbl &source,
double,
double,
int) {
101 int dege = n-nondege.get_dim(0) ;
104 Tbl source_cl (cl_helmholtz_minus(source,
R_CHEBU)) ;
108 for (
int i=0 ; i<n-dege ; i++)
109 so.set(i) = source_cl(i);
111 Tbl sol (nondege.inverse(so)) ;
115 for (
int i=1 ; i<n-2 ; i++) {
116 res.set(i) += sol(i-1)*(2*i+3) ;
117 res.set(i+1) += -sol(i-1)*(4*i+4) ;
118 res.set(i+2) += sol(i-1)*(2*i+1) ;
128 Tbl _solp_helmholtz_minus_r_cheb (
const Matrice &lap,
const Matrice &nondege,
129 const Tbl &source,
double alpha,
double beta,
int) {
132 int dege = n-nondege.get_dim(0) ;
135 Tbl source_aux(source*alpha*alpha) ;
136 Tbl xso(source_aux) ;
137 Tbl xxso(source_aux) ;
138 multx_1d(n, &xso.t,
R_CHEB) ;
139 multx_1d(n, &xxso.t,
R_CHEB) ;
140 multx_1d(n, &xxso.t,
R_CHEB) ;
141 source_aux = beta*beta/alpha/alpha*source_aux+2*beta/alpha*xso+xxso ;
143 source_aux = cl_helmholtz_minus (source_aux,
R_CHEB) ;
147 for (
int i=0 ; i<n-dege ; i++)
148 so.set(i) = source_aux(i) ;
150 Tbl auxi(nondege.inverse(so)) ;
154 for (
int i=dege ; i<n ; i++)
155 res.set(i) = auxi(i-dege) ;
157 for (
int i=0 ; i<dege ; i++)
166 Tbl _solp_helmholtz_minus_r_chebp (
const Matrice &,
const Matrice &nondege,
167 const Tbl &source,
double alpha,
double,
int lq) {
170 int dege = (lq==0) ? 1 : 2 ;
171 int n = nondege.
get_dim(0) + dege ;
172 Tbl source_cl (cl_helmholtz_minus(source*alpha*alpha,
R_CHEBP)) ;
176 for (
int i=0 ; i<n-dege ; i++)
177 so.set(i) = source_cl(i);
179 Tbl sol (nondege.inverse(so)) ;
184 for (
int i=1 ; i<n-1 ; i++) {
185 res.set(i) += sol(i-1) ;
186 res.set(i+1) += sol(i-1) ;
190 for (
int i=1 ; i<n ; i++)
191 res.set(i) = sol(i-1) ;
199 Tbl _solp_helmholtz_minus_r_chebi (
const Matrice &,
const Matrice &nondege,
200 const Tbl &source,
double alpha,
double,
int lq) {
202 int dege = (lq==1) ? 1 : 2 ;
203 int n = nondege.
get_dim(0) + dege ;
204 Tbl source_cl (cl_helmholtz_minus(source*alpha*alpha,
R_CHEBI)) ;
208 for (
int i=0 ; i<n-dege ; i++)
209 so.set(i) = source_cl(i);
211 Tbl sol (nondege.inverse(so)) ;
216 for (
int i=1 ; i<n-1 ; i++) {
217 res.set(i) += (2*i+3)*sol(i-1) ;
218 res.set(i+1) += (2*i+1)*sol(i-1) ;
222 for (
int i=1 ; i<n ; i++)
223 res.set(i) = sol(i-1) ;
235 Tbl solp_helmholtz_minus (
const Matrice &lap,
const Matrice &nondege,
236 const Tbl &source,
double alpha,
double beta,
int lq,
240 static Tbl (*solp_helmholtz_minus[
MAX_BASE]) (
const Matrice&,
const Matrice&,
241 const Tbl&, double, double, int) ;
248 solp_helmholtz_minus[i] = _solp_helmholtz_minus_pas_prevu ;
251 solp_helmholtz_minus[
R_CHEB >>
TRA_R] = _solp_helmholtz_minus_r_cheb ;
252 solp_helmholtz_minus[
R_CHEBU >>
TRA_R] = _solp_helmholtz_minus_r_chebu ;
253 solp_helmholtz_minus[
R_CHEBP >>
TRA_R] = _solp_helmholtz_minus_r_chebp ;
254 solp_helmholtz_minus[
R_CHEBI >>
TRA_R] = _solp_helmholtz_minus_r_chebi ;
257 Tbl res(solp_helmholtz_minus[base_r] (lap, nondege, source, alpha, beta, lq)) ;
#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
int get_dim(int i) const
Gives the i-th dimension (ie dim.dim[i])
#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)