32 #include "ope_elementary.h" 39 Tbl _cl_poisson_pseudo_1d_pas_prevu (
const Tbl &source) {
40 cout <<
"Combinaison lineaire pas prevue..." << endl ;
52 Tbl _cl_poisson_pseudo_1d_r_cheb (
const Tbl &source) {
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) ;
73 Tbl _cl_poisson_pseudo_1d_r_chebp (
const Tbl &source) {
75 int n = source.get_dim(0) ;
78 for (
int i=0 ; i<n-2 ; i++) {
79 barre.set(i) = (1+dirac)*source(i)-source(i+2) ;
84 for (
int i=0 ; i<n-4 ; i++)
85 tilde.set(i) = barre(i)-barre(i+2) ;
88 for (
int i=0 ; i<n-4 ; i++)
89 res.set(i) = tilde(i)-tilde(i+1) ;
99 Tbl _cl_poisson_pseudo_1d_r_chebi (
const Tbl &source) {
101 int n = source.get_dim(0) ;
103 for (
int i=0 ; i<n-2 ; i++)
104 barre.set(i) = source(i)-source(i+2) ;
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 res.set(i) = tilde(i)-tilde(i+1) ;
124 Tbl cl_poisson_pseudo_1d (
const Tbl &source,
int base_r) {
127 static Tbl (*cl_poisson_pseudo_1d[
MAX_BASE])(
const Tbl &) ;
134 cl_poisson_pseudo_1d[i] = _cl_poisson_pseudo_1d_pas_prevu ;
137 cl_poisson_pseudo_1d[
R_CHEB >>
TRA_R] = _cl_poisson_pseudo_1d_r_cheb ;
138 cl_poisson_pseudo_1d[
R_CHEBP >>
TRA_R] = _cl_poisson_pseudo_1d_r_chebp ;
139 cl_poisson_pseudo_1d[
R_CHEBI >>
TRA_R] = _cl_poisson_pseudo_1d_r_chebi ;
142 Tbl res(cl_poisson_pseudo_1d[base_r](source)) ;
150 Tbl _solp_poisson_pseudo_1d_pas_prevu (
const Matrice &,
const Matrice &,
151 double,
double,
const Tbl &) {
152 cout <<
" Solution homogene pas prevue ..... : "<< endl ;
164 Tbl _solp_poisson_pseudo_1d_r_cheb (
const Matrice &lap,
165 const Matrice &nondege,
166 double alpha,
double beta,
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_poisson_pseudo_1d(source_aux,
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++)
204 Tbl _solp_poisson_pseudo_1d_r_chebp (
const Matrice &lap,
205 const Matrice &nondege,
206 double alpha,
double ,
const Tbl &source) {
209 int dege = n-nondege.get_dim(0) ;
210 assert ((dege==2) || (dege == 1)) ;
211 Tbl source_aux(alpha*alpha*source) ;
212 source_aux = cl_poisson_pseudo_1d(source_aux,
R_CHEBP) ;
216 for (
int i=0 ; i<n-dege ; i++)
217 so.set(i) = source_aux(i);
219 Tbl auxi(nondege.inverse(so)) ;
223 for (
int i=dege ; i<n ; i++)
224 res.set(i) = auxi(i-dege) ;
226 for (
int i=0 ; i<dege ; i++)
231 for (
int i=0 ; i<n ; i++)
234 else somme += res(i) ;
246 Tbl _solp_poisson_pseudo_1d_r_chebi (
const Matrice &lap,
247 const Matrice &nondege,
248 double alpha,
double,
const Tbl &source) {
252 int dege = n-nondege.get_dim(0) ;
253 assert ((dege==2) || (dege == 1)) ;
254 Tbl source_aux(source*alpha*alpha) ;
255 source_aux = cl_poisson_pseudo_1d(source_aux,
R_CHEBI) ;
259 for (
int i=0 ; i<n-dege ; i++)
260 so.set(i) = source_aux(i);
262 Tbl auxi(nondege.inverse(so)) ;
266 for (
int i=dege ; i<n ; i++)
267 res.set(i) = auxi(i-dege) ;
269 for (
int i=0 ; i<dege ; i++)
274 for (
int i=0 ; i<n ; i++)
276 somme -= (2*i+1)*res(i) ;
277 else somme += (2*i+1)*res(i) ;
293 double, double,
const Tbl&) ;
300 solp_poisson_pseudo_1d[i] = _solp_poisson_pseudo_1d_pas_prevu ;
303 solp_poisson_pseudo_1d[
R_CHEB >>
TRA_R] = _solp_poisson_pseudo_1d_r_cheb ;
304 solp_poisson_pseudo_1d[
R_CHEBP >>
TRA_R] = _solp_poisson_pseudo_1d_r_chebp ;
305 solp_poisson_pseudo_1d[
R_CHEBI >>
TRA_R] = _solp_poisson_pseudo_1d_r_chebi ;
312 valeurs *=
sqrt(
double(2)) ;
double alpha
Parameter of the associated mapping.
virtual void do_non_dege() const
Computes the non-degenerated matrix of the operator.
virtual Tbl get_solp(const Tbl &so) const
Computes the particular solution, given the source so .
Cmp sqrt(const Cmp &)
Square root.
double beta
Parameter of the associated mapping.
Matrice * ope_mat
Pointer on the matrix representation of the operator.
double dsp_minus
Value of the derivative of the particular solution at the inner boundary.
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.
#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.
#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 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)