32 #include "ope_elementary.h" 39 Tbl _cl_helmholtz_minus_2d_pas_prevu (
const Tbl & source,
int) {
40 cout <<
"Combinaison lineaire pas prevue..." << endl ;
52 Tbl _cl_helmholtz_minus_2d_r_cheb (
const Tbl &source,
int) {
54 int n = source.get_dim(0) ;
57 for (
int i=0 ; i<n-2 ; i++) {
58 barre.set(i) = ((1+dirac)*source(i)-source(i+2))
64 for (
int i=0 ; i<n-4 ; i++)
65 res.set(i) = barre(i)-barre(i+2) ;
74 Tbl _cl_helmholtz_minus_2d_r_chebu_deux(
const Tbl&) ;
76 Tbl _cl_helmholtz_minus_2d_r_chebu (
const Tbl &source,
int puis) {
84 res = _cl_helmholtz_minus_2d_r_chebu_deux(source) ;
95 Tbl _cl_helmholtz_minus_2d_r_chebu_deux (
const Tbl &source) {
98 int n = source.get_dim(0) ;
101 for (
int i=0 ; i<n-2 ; i++) {
102 barre.set(i) = ((1+dirac)*source(i)-source(i+2)) ;
103 if (i==0) dirac = 0 ;
107 for (
int i=0 ; i<n-4 ; i++)
108 tilde.set(i) = (barre(i)-barre(i+2)) ;
111 for (
int i=0 ; i<n-4 ; i++)
112 bis.set(i) = (tilde(i)+tilde(i+1)) ;
115 for (
int i=0 ; i<n-4 ; i++)
116 res.set(i) = (bis(i)-bis(i+1)) ;
126 Tbl cl_helmholtz_minus_2d (
const Tbl &source,
int puis,
int base_r) {
128 static Tbl (*cl_helmholtz_minus_2d[
MAX_BASE])(
const Tbl &, int) ;
135 cl_helmholtz_minus_2d[i] = _cl_helmholtz_minus_2d_pas_prevu ;
138 cl_helmholtz_minus_2d[
R_CHEB >>
TRA_R] = _cl_helmholtz_minus_2d_r_cheb ;
139 cl_helmholtz_minus_2d[
R_CHEBU >>
TRA_R] = _cl_helmholtz_minus_2d_r_chebu ;
143 Tbl res(cl_helmholtz_minus_2d[base_r](source, puis)) ;
151 Tbl _solp_helmholtz_minus_2d_pas_prevu (
const Matrice &,
const Matrice &,
152 double,
double,
const Tbl &,
int) {
153 cout <<
" Solution homogene pas prevue ..... : "<< endl ;
165 Tbl _solp_helmholtz_minus_2d_r_cheb (
const Matrice &lap,
const Matrice &nondege,
166 double alpha,
double beta,
167 const Tbl &source,
int) {
170 int dege = n-nondege.get_dim(0) ;
173 Tbl source_aux(source*alpha*alpha) ;
174 Tbl xso(source_aux) ;
175 Tbl xxso(source_aux) ;
176 multx_1d(n, &xso.t,
R_CHEB) ;
177 multx_1d(n, &xxso.t,
R_CHEB) ;
178 multx_1d(n, &xxso.t,
R_CHEB) ;
179 source_aux = beta*beta/alpha/alpha*source_aux+2*beta/alpha*xso+xxso ;
180 source_aux = cl_helmholtz_minus_2d(source_aux, 0,
R_CHEB) ;
184 for (
int i=0 ; i<n-dege ; i++)
185 so.set(i) = source_aux(i) ;
187 Tbl auxi(nondege.inverse(so)) ;
191 for (
int i=dege ; i<n ; i++)
192 res.set(i) = auxi(i-dege) ;
194 for (
int i=0 ; i<dege ; i++)
205 Tbl _solp_helmholtz_minus_2d_r_chebu_deux (
const Matrice&,
const Matrice&,
208 Tbl _solp_helmholtz_minus_2d_r_chebu (
const Matrice &lap,
const Matrice &nondege,
210 const Tbl &source,
int puis) {
217 res = _solp_helmholtz_minus_2d_r_chebu_deux
218 (lap, nondege, source) ;
228 Tbl _solp_helmholtz_minus_2d_r_chebu_deux (
const Matrice &lap,
const Matrice &nondege,
232 int dege = n-nondege.get_dim(0) ;
235 Tbl source_cl (cl_helmholtz_minus_2d(source, 2,
R_CHEBU)) ;
239 for (
int i=0 ; i<n-dege ; i++)
240 so.set(i) = source_cl(i);
242 Tbl sol (nondege.inverse(so)) ;
246 for (
int i=1 ; i<n-2 ; i++) {
247 res.set(i) += sol(i-1)*(2*i+3) ;
248 res.set(i+1) += -sol(i-1)*(4*i+4) ;
249 res.set(i+2) += sol(i-1)*(2*i+1) ;
263 double, double,
const Tbl&, int) ;
270 solp_helmholtz_minus_2d[i] = _solp_helmholtz_minus_2d_pas_prevu ;
273 solp_helmholtz_minus_2d[
R_CHEB >>
TRA_R] = _solp_helmholtz_minus_2d_r_cheb ;
274 solp_helmholtz_minus_2d[
R_CHEBU >>
TRA_R] = _solp_helmholtz_minus_2d_r_chebu ;
281 valeurs *=
sqrt(
double(2)) ;
double alpha
Parameter of the associated mapping.
Matrice * ope_cl
Pointer on the banded-matrix of the operator.
Cmp sqrt(const Cmp &)
Square root.
double beta
Parameter of the associated mapping.
double dsp_minus
Value of the derivative of the particular solution at the inner boundary.
virtual Tbl get_solp(const Tbl &so) const
Computes the particular solution, given the source so .
double sp_minus
Value of the particular solution at the inner boundary.
int base_r
Radial basis of decomposition.
double sp_plus
Value of the particular solution at the outer boundary.
virtual void do_non_dege() const
Computes the non-degenerated matrix of the operator.
#define TRA_R
Translation en R, used for a bitwise shift (in hex)
double dsp_plus
Value of the derivative of the particular solution at the outer boundary.
int get_dim(int i) const
Gives the i-th dimension (ie dim.dim[i])
int get_dim(int i) const
Returns the dimension of the matrix.
int dzpuis
the associated dzpuis, if in the compactified domain.
#define R_CHEBU
base de Chebychev ordinaire (fin), dev. en 1/r
#define MAX_BASE
Nombre max. de bases differentes.
Matrice * non_dege
Pointer on the non-degenerated matrix of the operator.
#define R_CHEB
base de Chebychev ordinaire (fin)