109void _get_operateur_dal_pas_prevu(
const Param& ,
const int&,
int& ,
Matrice& )
111 cout <<
"get_operateur_dal pas prevu..." << endl ;
117void _get_operateur_dal_r_cheb(
const Param& par,
const int& lz,
118int& type_dal,
Matrice& operateur)
120 int nr = operateur.get_dim(0) ;
121 assert (nr == operateur.get_dim(1)) ;
122 assert (par.get_n_double() > 0) ;
123 assert (par.get_n_tbl_mod() > 0) ;
124 assert ((par.get_tbl_mod()).get_dim(1) == 12 ) ;
125 assert ((par.get_tbl_mod()).get_ndim() ==2 ) ;
127 double dt = par.get_double(0) ;
132 coeff.set_etat_qcq() ;
133 coeff.set(1) = (par.get_tbl_mod())(1,lz) ;
134 coeff.set(2) = (par.get_tbl_mod())(2,lz) ;
135 coeff.set(3) = (par.get_tbl_mod())(3,lz) ;
136 coeff.set(4) = (par.get_tbl_mod())(4,lz) ;
137 coeff.set(5) = (par.get_tbl_mod())(5,lz) ;
138 coeff.set(6) = (par.get_tbl_mod())(6,lz) ;
139 coeff.set(7) = (par.get_tbl_mod())(7,lz) ;
140 coeff.set(8) = (par.get_tbl_mod())(8,lz) ;
141 coeff.set(9) = (par.get_tbl_mod())(9,lz) ;
142 double R1 = (par.get_tbl_mod())(10,lz) ;
143 double R2 = (par.get_tbl_mod())(11,lz) ;
145 double a00 = 0. ;
double a01 = 0. ;
double a02 = 0. ;
146 double a10 = 0. ;
double a11 = 0. ;
double a12 = 0. ;
147 double a13 = 0. ;
double a20 = 0. ;
double a21 = 0. ;
148 double a22 = 0. ;
double a23 = 0. ;
double a24 = 0. ;
150 bool dege = (fabs(coeff(9)) < 1.e-10) ;
153 a00 = R1 - dt*(coeff(7)*R1 + coeff(8)) ;
154 a01 = R2 - dt*R2*coeff(7) ;
156 a10 = -dt*(R1*coeff(4) + R1*R1*coeff(5) + coeff(6))/R2 ;
157 a11 = -dt*(coeff(4) + 2*R1*coeff(5)) ;
158 a12 = -dt*R2*coeff(5) ;
160 a20 = -dt*R1/(R2*R2)*(coeff(1) + R1*coeff(2) + R1*R1*coeff(3)) ;
161 a21 = -dt/R2*(coeff(1) + 2*R1*coeff(2) + 3*R1*R1*coeff(3)) ;
162 a22 = -dt*(coeff(2) + 3*R1*coeff(3)) ;
163 a23 = -dt*R2*coeff(3) ;
165 type_dal = ((0.1*(fabs(a20)+fabs(a21)+fabs(a22)+fabs(a23))*nr*nr*nr
169 a00 = R1*R1 - dt*(coeff(7)*R1*R1 + coeff(8)*R1 + coeff(9)) ;
170 a01 = 2*R1*R2 - dt*(2*R1*R2*coeff(7) + R2*coeff(8)) ;
171 a02 = R2*R2*(1 - dt*coeff(7)) ;
172 a10 = -dt*R1/R2*(R1*coeff(4) + R1*R1*coeff(5) + coeff(6)) ;
173 a11 = -dt*(2*R1*coeff(4) + 3*R1*R1*coeff(5) + coeff(6)) ;
174 a12 = -dt*(R2*coeff(4) + 3*R1*R2*coeff(5)) ;
175 a13 = -dt*R2*R2*coeff(5) ;
176 a20 = -dt*(R1*R1)/(R2*R2)*(coeff(1) + R1*coeff(2) + R1*R1*coeff(3)) ;
177 a21 = -dt*R1/R2*(2*coeff(1) + 3*R1*coeff(2) + 4*R1*R1*coeff(3)) ;
178 a22 = -dt*(coeff(1) + 3*R1*coeff(2) + 6*R1*R1*coeff(3)) ;
179 a23 = -dt*(R2*coeff(2) + 4*R1*R2*coeff(3)) ;
180 a24 = -dt*R2*R2*coeff(3) ;
181 type_dal = ((0.1*(fabs(a20)+fabs(a21)+fabs(a22)+fabs(a23)+fabs(a24))
185 if (fabs(a00)<1.e-15) a00 = 0 ;
186 if (fabs(a01)<1.e-15) a01 = 0 ;
187 if (fabs(a02)<1.e-15) a02 = 0 ;
188 if (fabs(a10)<1.e-15) a10 = 0 ;
189 if (fabs(a11)<1.e-15) a11 = 0 ;
190 if (fabs(a12)<1.e-15) a12 = 0 ;
191 if (fabs(a13)<1.e-15) a13 = 0 ;
192 if (fabs(a20)<1.e-15) a20 = 0 ;
193 if (fabs(a21)<1.e-15) a21 = 0 ;
194 if (fabs(a22)<1.e-15) a22 = 0 ;
195 if (fabs(a23)<1.e-15) a23 = 0 ;
196 if (fabs(a24)<1.e-15) a24 = 0 ;
201 if (fabs(a00)>1.e-15) {
205 operateur.set_etat_qcq() ;
206 for (
int i=0; i<nr; i++)
207 for (
int j=0; j<nr; j++)
208 operateur.set(i,j) = 0. ;
222 for (
int i=0; i<nr; i++) {
223 int jmin = (i>3 ? i-3 : 0) ;
224 int jmax = (i<nr-9 ? i+10 : nr) ;
225 for (
int j=jmin ; j<jmax; j++)
226 operateur.set(i,j) += a01*m01(i,j) + a02*m02(i,j)
227 + a10*m10(i,j) + a11*m11(i,j) + a12*m12(i,j)
228 + a13*m13(i,j) + a20*m20(i,j) + a21*m21(i,j)
229 + a22*m22(i,j) + a23*m23(i,j) + a24*m24(i,j) ;
234void _get_operateur_dal_r_chebp(
const Param& par,
const int& lzone,
235 int& type_dal,
Matrice& operateur)
238 int nr = operateur.get_dim(0) ;
239 assert (nr == operateur.get_dim(1)) ;
240 assert (par.get_n_double() > 0) ;
241 assert (par.get_n_tbl_mod() > 0) ;
242 assert ((par.get_tbl_mod()).get_dim(1) == 12 ) ;
243 assert ((par.get_tbl_mod()).get_ndim() ==2 ) ;
245 double dt = par.get_double(0) ;
250 coeff.set_etat_qcq() ;
251 coeff.set(1) = (par.get_tbl_mod())(1,lzone) ;
252 if (fabs(coeff(1))<1.e-15) coeff.set(1) = 0 ;
253 coeff.set(2) = (par.get_tbl_mod())(3,lzone) ;
254 if (fabs(coeff(2))<1.e-15) coeff.set(2) = 0 ;
255 coeff.set(3) = (par.get_tbl_mod())(6,lzone) ;
256 if (fabs(coeff(3))<1.e-15) coeff.set(3) = 0 ;
257 coeff.set(4) = (par.get_tbl_mod())(5,lzone) ;
258 if (fabs(coeff(4))<1.e-15) coeff.set(4) = 0 ;
259 coeff.set(5) = (par.get_tbl_mod())(9,lzone) ;
260 if (fabs(coeff(5))<1.e-15) coeff.set(5) = 0 ;
261 coeff.set(6) = (par.get_tbl_mod())(7,lzone) ;
262 if (fabs(coeff(6))<1.e-15) coeff.set(6) = 0 ;
263 double alpha2 = (par.get_tbl_mod())(11,lzone)*(par.get_tbl_mod())(11,lzone) ;
274 if (fabs(coeff(1)) + fabs(coeff(2)) + fabs(coeff(5)) < 1.e-30) {
276 if (dt < 0.1/(fabs(coeff(3)) + fabs(coeff(4))*nr))
282 if (fabs(coeff(5)) < 1.e-24) {
283 if (dt < 1./(fabs(coeff(1)) + fabs(coeff(2)) + fabs(coeff(3))*nr
289 if (dt < 1./((fabs(coeff(1)) + fabs(coeff(2)) + fabs(coeff(3))*nr
290 + fabs(coeff(4)) + fabs(coeff(5)))*nr*nr))
296 coeff.set(1) *= dt/alpha2 ;
298 coeff.set(3) *= dt/alpha2 ;
300 coeff.set(5) *= dt/alpha2 ;
304 if (fabs(1-coeff(6))>1.e-15) {
305 operateur = (1-coeff(6))*
id ;
308 operateur.set_etat_qcq() ;
309 for (
int i=0; i<nr; i++)
310 for (
int j=0; j<nr; j++)
311 operateur.set(i,j) = 0. ;
319 for (
int i=0; i<nr; i++) {
320 int jmin = (i>3 ? i-3 : 0) ;
321 int jmax = (i<nr-9 ? i+10 : nr) ;
322 for (
int j=jmin ; j<jmax; j++)
323 operateur.set(i,j) -= coeff(1)*m20(i,j) + coeff(2)*m22(i,j)
324 + coeff(3)*m12(i,j) + coeff(4)*m11(i,j) + coeff(5)*m02(i,j) ;
331void _get_operateur_dal_r_chebi(
const Param& par,
const int& lzone,
332 int& type_dal,
Matrice& operateur)
335 int nr = operateur.get_dim(0) ;
336 assert (nr == operateur.get_dim(1)) ;
337 assert (par.get_n_double() > 0) ;
338 assert (par.get_n_tbl_mod() > 0) ;
339 assert ((par.get_tbl_mod()).get_dim(1) == 12 ) ;
340 assert ((par.get_tbl_mod()).get_ndim() == 2 ) ;
342 double dt = par.get_double(0) ;
347 coeff.set_etat_qcq() ;
348 coeff.set(1) = (par.get_tbl_mod())(1,lzone) ;
349 if (fabs(coeff(1))<1.e-15) coeff.set(1) = 0 ;
350 coeff.set(2) = (par.get_tbl_mod())(3,lzone) ;
351 if (fabs(coeff(2))<1.e-15) coeff.set(2) = 0 ;
352 coeff.set(3) = (par.get_tbl_mod())(6,lzone) ;
353 if (fabs(coeff(3))<1.e-15) coeff.set(3) = 0 ;
354 coeff.set(4) = (par.get_tbl_mod())(5,lzone) ;
355 if (fabs(coeff(4))<1.e-15) coeff.set(4) = 0 ;
356 coeff.set(5) = (par.get_tbl_mod())(9,lzone) ;
357 if (fabs(coeff(5))<1.e-15) coeff.set(5) = 0 ;
358 coeff.set(6) = (par.get_tbl_mod())(7,lzone) ;
359 if (fabs(coeff(6))<1.e-15) coeff.set(6) = 0 ;
360 double alpha2 = (par.get_tbl_mod())(11,lzone)*(par.get_tbl_mod())(11,lzone) ;
371 if (fabs(coeff(1)) + fabs(coeff(2)) + fabs(coeff(3)) +
372 fabs(coeff(5)) < 1.e-30) {
374 if (dt < 0.1/(fabs(coeff(4))*nr))
379 if (fabs(coeff(5)+coeff(3)) < 1.e-6) {
381 if (dt < 1./(fabs(coeff(1)) + fabs(coeff(2)) + fabs(coeff(3))*nr
387 if (dt < 1./((fabs(coeff(1)) + fabs(coeff(2)) + fabs(coeff(3))*nr
388 + fabs(coeff(4)) + fabs(coeff(5)))*nr*nr))
394 coeff.set(1) *= dt/alpha2 ;
396 coeff.set(3) *= dt/alpha2 ;
398 coeff.set(5) *= dt/alpha2 ;
402 if (fabs(1-coeff(6))>1.e-15) {
403 operateur = (1-coeff(6))*
id ;
406 operateur.set_etat_qcq() ;
407 for (
int i=0; i<nr; i++)
408 for (
int j=0; j<nr; j++)
409 operateur.set(i,j) = 0. ;
417 for (
int i=0; i<nr; i++) {
418 int jmin = (i>3 ? i-3 : 0) ;
419 int jmax = (i<nr-9 ? i+10 : nr) ;
420 for (
int j=jmin ; j<jmax; j++)
421 operateur.set(i,j) -= coeff(1)*m20(i,j) + coeff(2)*m22(i,j)
422 + coeff(3)*m12(i,j) + coeff(4)*m11(i,j) + coeff(5)*m02(i,j) ;
429void _get_operateur_dal_r_jaco02(
const Param& par,
const int& lz,
430int& type_dal,
Matrice& operateur)
432 int nr = operateur.
get_dim(0) ;
433 assert (nr == operateur.get_dim(1)) ;
434 assert (par.get_n_double() > 0) ;
435 assert (par.get_n_tbl_mod() > 0) ;
436 assert ((par.get_tbl_mod()).get_dim(1) == 12 ) ;
437 assert ((par.get_tbl_mod()).get_ndim() ==2 ) ;
439 double dt = par.get_double(0) ;
444 coeff.set_etat_qcq() ;
445 coeff.set(1) = (par.get_tbl_mod())(1,lz) ;
446 coeff.set(2) = (par.get_tbl_mod())(2,lz) ;
447 coeff.set(3) = (par.get_tbl_mod())(3,lz) ;
448 coeff.set(4) = (par.get_tbl_mod())(4,lz) ;
449 coeff.set(5) = (par.get_tbl_mod())(5,lz) ;
450 coeff.set(6) = (par.get_tbl_mod())(6,lz) ;
451 coeff.set(7) = (par.get_tbl_mod())(7,lz) ;
452 coeff.set(8) = (par.get_tbl_mod())(8,lz) ;
453 coeff.set(9) = (par.get_tbl_mod())(9,lz) ;
454 double R1 = (par.get_tbl_mod())(10,lz) ;
455 double R2 = (par.get_tbl_mod())(11,lz) ;
457 double a00 = 0. ;
double a01 = 0. ;
double a02 = 0. ;
458 double a10 = 0. ;
double a11 = 0. ;
double a12 = 0. ;
459 double a13 = 0. ;
double a20 = 0. ;
double a21 = 0. ;
460 double a22 = 0. ;
double a23 = 0. ;
double a24 = 0. ;
462 bool dege = (fabs(coeff(9)) < 1.e-10) ;
465 a00 = R1 - dt*(coeff(7)*R1 + coeff(8)) ;
466 a01 = R2 - dt*R2*coeff(7) ;
468 a10 = -dt*(R1*coeff(4) + R1*R1*coeff(5) + coeff(6))/R2 ;
469 a11 = -dt*(coeff(4) + 2*R1*coeff(5)) ;
470 a12 = -dt*R2*coeff(5) ;
472 a20 = -dt*R1/(R2*R2)*(coeff(1) + R1*coeff(2) + R1*R1*coeff(3)) ;
473 a21 = -dt/R2*(coeff(1) + 2*R1*coeff(2) + 3*R1*R1*coeff(3)) ;
474 a22 = -dt*(coeff(2) + 3*R1*coeff(3)) ;
475 a23 = -dt*R2*coeff(3) ;
477 type_dal = ((0.1*(fabs(a20)+fabs(a21)+fabs(a22)+fabs(a23))*nr*nr*nr
481 a00 = R1*R1 - dt*(coeff(7)*R1*R1 + coeff(8)*R1 + coeff(9)) ;
482 a01 = 2*R1*R2 - dt*(2*R1*R2*coeff(7) + R2*coeff(8)) ;
483 a02 = R2*R2*(1 - dt*coeff(7)) ;
484 a10 = -dt*R1/R2*(R1*coeff(4) + R1*R1*coeff(5) + coeff(6)) ;
485 a11 = -dt*(2*R1*coeff(4) + 3*R1*R1*coeff(5) + coeff(6)) ;
486 a12 = -dt*(R2*coeff(4) + 3*R1*R2*coeff(5)) ;
487 a13 = -dt*R2*R2*coeff(5) ;
488 a20 = -dt*(R1*R1)/(R2*R2)*(coeff(1) + R1*coeff(2) + R1*R1*coeff(3)) ;
489 a21 = -dt*R1/R2*(2*coeff(1) + 3*R1*coeff(2) + 4*R1*R1*coeff(3)) ;
490 a22 = -dt*(coeff(1) + 3*R1*coeff(2) + 6*R1*R1*coeff(3)) ;
491 a23 = -dt*(R2*coeff(2) + 4*R1*R2*coeff(3)) ;
492 a24 = -dt*R2*R2*coeff(3) ;
493 type_dal = ((0.1*(fabs(a20)+fabs(a21)+fabs(a22)+fabs(a23)+fabs(a24))
497 if (fabs(a00)<1.e-15) a00 = 0 ;
498 if (fabs(a01)<1.e-15) a01 = 0 ;
499 if (fabs(a02)<1.e-15) a02 = 0 ;
500 if (fabs(a10)<1.e-15) a10 = 0 ;
501 if (fabs(a11)<1.e-15) a11 = 0 ;
502 if (fabs(a12)<1.e-15) a12 = 0 ;
503 if (fabs(a13)<1.e-15) a13 = 0 ;
504 if (fabs(a20)<1.e-15) a20 = 0 ;
505 if (fabs(a21)<1.e-15) a21 = 0 ;
506 if (fabs(a22)<1.e-15) a22 = 0 ;
507 if (fabs(a23)<1.e-15) a23 = 0 ;
508 if (fabs(a24)<1.e-15) a24 = 0 ;
513 if (fabs(a00)>1.e-15) {
517 operateur.set_etat_qcq() ;
518 for (
int i=0; i<nr; i++)
519 for (
int j=0; j<nr; j++)
520 operateur.set(i,j) = 0. ;
534 for (
int i=0; i<nr; i++) {
535 int jmin = (i>3 ? i-3 : 0) ;
536 int jmax = (i<nr-9 ? i+10 : nr) ;
537 for (
int j=jmin ; j<jmax; j++)
538 operateur.set(i,j) += a01*m01(i,j) + a02*m02(i,j)
539 + a10*m10(i,j) + a11*m11(i,j) + a12*m12(i,j)
540 + a13*m13(i,j) + a20*m20(i,j) + a21*m21(i,j)
541 + a22*m22(i,j) + a23*m23(i,j) + a24*m24(i,j) ;
552void get_operateur_dal(
const Param& par,
const int& lzone,
553 const int& base_r,
int& type_dal,
Matrice& operateur)
565 get_operateur_dal[i] = _get_operateur_dal_pas_prevu ;
568 get_operateur_dal[
R_CHEB >>
TRA_R] = _get_operateur_dal_r_cheb ;
569 get_operateur_dal[
R_CHEBP >>
TRA_R] = _get_operateur_dal_r_chebp ;
570 get_operateur_dal[
R_CHEBI >>
TRA_R] = _get_operateur_dal_r_chebi ;
571 get_operateur_dal[
R_JACO02 >>
TRA_R] = _get_operateur_dal_r_jaco02 ;
574 get_operateur_dal[base_r](par, lzone, type_dal, operateur) ;
Class for the elementary differential operator (see the base class Diff ).
Class for the elementary differential operator (see the base class Diff ).
Class for the elementary differential operator Identity (see the base class Diff ).
Class for the elementary differential operator multiplication by (see the base class Diff ).
Class for the elementary differential operator multiplication by (see the base class Diff ).
Class for the elementary differential operator division by (see the base class Diff ).
Class for the elementary differential operator (see the base class Diff ).
Class for the elementary differential operator (see the base class Diff ).
Class for the elementary differential operator (see the base class Diff ).
Class for the elementary differential operator (see the base class Diff ).
Class for the elementary differential operator (see the base class Diff ).
Class for the elementary differential operator (see the base class Diff ).
Class for the elementary differential operator (see the base class Diff ).
Class for the elementary differential operator (see the base class Diff ).
int get_dim(int i) const
Returns the dimension of the matrix.
#define MAX_BASE
Nombre max. de bases differentes.
#define ORDRE1_SMALL
Operateur du premier ordre, .
#define R_JACO02
base de Jacobi(0,2) ordinaire (finjac)
#define O2DEGE_SMALL
Operateur du deuxieme ordre degenere .
#define R_CHEBI
base de Cheb. impaire (rare) seulement
#define ORDRE1_LARGE
Operateur du premier ordre .
#define O2NOND_LARGE
Operateur du deuxieme ordre non degenere .
#define O2DEGE_LARGE
Operateur du deuxieme ordre degenere .
#define O2NOND_SMALL
Operateur du deuxieme ordre non degenere .
#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