23char solp_helmholtz_minus_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Non_class_members/PDE/solp_helmholtz_minus.C,v 1.9 2014/10/13 08:53:31 j_novak Exp $" ;
71#include "type_parite.h"
78Tbl _solp_helmholtz_minus_pas_prevu (
const Matrice &,
const Matrice &,
79 const Tbl &,
double,
double,
int) {
80 cout <<
" Solution homogene pas prevue ..... : "<< endl ;
94Tbl _solp_helmholtz_minus_r_chebu (
const Matrice &lap,
const Matrice &nondege,
95 const Tbl &source,
double,
double,
int) {
98 int dege = n-nondege.get_dim(0) ;
101 Tbl source_cl (cl_helmholtz_minus(source,
R_CHEBU)) ;
105 for (
int i=0 ; i<n-dege ; i++)
106 so.set(i) = source_cl(i);
108 Tbl sol (nondege.inverse(so)) ;
112 for (
int i=1 ; i<n-2 ; i++) {
113 res.set(i) += sol(i-1)*(2*i+3) ;
114 res.set(i+1) += -sol(i-1)*(4*i+4) ;
115 res.set(i+2) += sol(i-1)*(2*i+1) ;
125Tbl _solp_helmholtz_minus_r_cheb (
const Matrice &lap,
const Matrice &nondege,
126 const Tbl &source,
double alpha,
double beta,
int) {
129 int dege = n-nondege.get_dim(0) ;
132 Tbl source_aux(source*alpha*alpha) ;
133 Tbl xso(source_aux) ;
134 Tbl xxso(source_aux) ;
135 multx_1d(n, &xso.t,
R_CHEB) ;
136 multx_1d(n, &xxso.t,
R_CHEB) ;
137 multx_1d(n, &xxso.t,
R_CHEB) ;
138 source_aux = beta*beta/alpha/alpha*source_aux+2*beta/alpha*xso+xxso ;
140 source_aux = cl_helmholtz_minus (source_aux,
R_CHEB) ;
144 for (
int i=0 ; i<n-dege ; i++)
145 so.set(i) = source_aux(i) ;
147 Tbl auxi(nondege.inverse(so)) ;
151 for (
int i=dege ; i<n ; i++)
152 res.set(i) = auxi(i-dege) ;
154 for (
int i=0 ; i<dege ; i++)
163Tbl _solp_helmholtz_minus_r_chebp (
const Matrice &,
const Matrice &nondege,
164 const Tbl &source,
double alpha,
double,
int lq) {
167 int dege = (lq==0) ? 1 : 2 ;
168 int n = nondege.get_dim(0) + dege ;
169 Tbl source_cl (cl_helmholtz_minus(source*alpha*alpha,
R_CHEBP)) ;
173 for (
int i=0 ; i<n-dege ; i++)
174 so.set(i) = source_cl(i);
176 Tbl sol (nondege.inverse(so)) ;
181 for (
int i=1 ; i<n-1 ; i++) {
182 res.set(i) += sol(i-1) ;
183 res.set(i+1) += sol(i-1) ;
187 for (
int i=1 ; i<n ; i++)
188 res.set(i) = sol(i-1) ;
196Tbl _solp_helmholtz_minus_r_chebi (
const Matrice &,
const Matrice &nondege,
197 const Tbl &source,
double alpha,
double,
int lq) {
199 int dege = (lq==1) ? 1 : 2 ;
200 int n = nondege.get_dim(0) + dege ;
201 Tbl source_cl (cl_helmholtz_minus(source*alpha*alpha,
R_CHEBI)) ;
205 for (
int i=0 ; i<n-dege ; i++)
206 so.set(i) = source_cl(i);
208 Tbl sol (nondege.inverse(so)) ;
213 for (
int i=1 ; i<n-1 ; i++) {
214 res.set(i) += (2*i+3)*sol(i-1) ;
215 res.set(i+1) += (2*i+1)*sol(i-1) ;
219 for (
int i=1 ; i<n ; i++)
220 res.set(i) = sol(i-1) ;
232Tbl solp_helmholtz_minus (
const Matrice &lap,
const Matrice &nondege,
233 const Tbl &source,
double alpha,
double beta,
int lq,
237 static Tbl (*solp_helmholtz_minus[
MAX_BASE]) (
const Matrice&,
const Matrice&,
238 const Tbl&, double, double, int) ;
245 solp_helmholtz_minus[i] = _solp_helmholtz_minus_pas_prevu ;
248 solp_helmholtz_minus[
R_CHEB >>
TRA_R] = _solp_helmholtz_minus_r_cheb ;
249 solp_helmholtz_minus[
R_CHEBU >>
TRA_R] = _solp_helmholtz_minus_r_chebu ;
250 solp_helmholtz_minus[
R_CHEBP >>
TRA_R] = _solp_helmholtz_minus_r_chebp ;
251 solp_helmholtz_minus[
R_CHEBI >>
TRA_R] = _solp_helmholtz_minus_r_chebi ;
254 Tbl res(solp_helmholtz_minus[base_r] (lap, nondege, source, alpha, beta, lq)) ;
int get_dim(int i) const
Gives the i-th dimension (ie dim.dim[i])
#define MAX_BASE
Nombre max. de bases differentes.
#define R_CHEBU
base de Chebychev ordinaire (fin), dev. en 1/r
#define R_CHEBI
base de Cheb. impaire (rare) seulement
#define TRA_R
Translation en R, used for a bitwise shift (in hex)
#define R_CHEB
base de Chebychev ordinaire (fin)
#define R_CHEBP
base de Cheb. paire (rare) seulement