81 Mtbl* map_et_fait_r(
const Map* cvi) {
84 const Map_et* cv =
static_cast<const Map_et*
>(cvi) ;
85 const Mg3d* mg = cv->
get_mg() ;
89 Mtbl* mti =
new Mtbl(mg) ;
93 const double* alpha = cv->alpha ;
94 const double* beta = cv->beta ;
95 const Valeur& ff = cv->ff ;
96 const Valeur& gg = cv->gg ;
98 for (
int l=0 ; l<nz ; l++) {
100 const Grille3d* g = mg->get_grille3d(l) ;
102 const Tbl& aa = *((cv->aa)[l]) ;
103 const Tbl& bb = *((cv->bb)[l]) ;
105 Tbl* tb = (mti->t)[l] ;
107 double* p_r = tb->t ;
109 int np = mg->get_np(l) ;
110 int nt = mg->get_nt(l) ;
111 int nr = mg->get_nr(l) ;
113 switch(mg->get_type_r(l)) {
115 case FIN:
case RARE: {
117 for (
int k=0 ; k<np ; k++) {
118 for (
int j=0 ; j<nt ; j++) {
119 for (
int i=0 ; i<nr ; i++) {
120 *p_r = alpha[l] * ( (g->x)[i]
121 + aa(i) * ff(l, k, j, 0)
122 + bb(i) * gg(l, k, j, 0)
132 for (
int k=0 ; k<np ; k++) {
133 for (
int j=0 ; j<nt ; j++) {
134 for (
int i=0 ; i<nr ; i++) {
135 *p_r = 1./( alpha[l] * (
136 (g->x)[i] + aa(i) * ff(l, k, j, 0)
147 cout <<
"map_et_fait_r: Unknown type_r !" << endl ;
162 Mtbl* map_et_fait_tet(
const Map* cvi) {
165 const Map_et* cv =
static_cast<const Map_et*
>(cvi) ;
166 const Mg3d* mg = cv->
get_mg() ;
170 Mtbl* mti =
new Mtbl(mg) ;
171 mti->set_etat_qcq() ;
173 for (
int l=0 ; l<nz ; l++) {
174 int nr = mg->get_nr(l);
175 int nt = mg->get_nt(l);
176 int np = mg->get_np(l);
177 const Grille3d* g = mg->get_grille3d(l) ;
178 Tbl* tb = (mti->t)[l] ;
180 double* p_r = tb->t ;
181 for (
int k=0 ; k<np ; k++) {
182 for (
int j=0 ; j<nt ; j++) {
183 for (
int i=0 ; i<nr ; i++) {
199 Mtbl* map_et_fait_phi(
const Map* cvi) {
202 const Map_et* cv =
static_cast<const Map_et*
>(cvi) ;
203 const Mg3d* mg = cv->
get_mg() ;
207 Mtbl* mti =
new Mtbl(mg) ;
208 mti->set_etat_qcq() ;
210 for (
int l=0 ; l<nz ; l++) {
211 int nr = mg->get_nr(l);
212 int nt = mg->get_nt(l);
213 int np = mg->get_np(l);
214 const Grille3d* g = mg->get_grille3d(l) ;
215 Tbl* tb = (mti->t)[l] ;
217 double* p_r = tb->t ;
218 for (
int k=0 ; k<np ; k++) {
219 for (
int j=0 ; j<nt ; j++) {
220 for (
int i=0 ; i<nr ; i++) {
236 Mtbl* map_et_fait_x(
const Map* cvi) {
239 const Mg3d* mg = cvi->
get_mg() ;
242 Mtbl* mti =
new Mtbl(mg) ;
244 *mti = (cvi->r) * (cvi->sint) * (cvi->cosp) ;
254 Mtbl* map_et_fait_y(
const Map* cvi) {
257 const Mg3d* mg = cvi->
get_mg() ;
260 Mtbl* mti =
new Mtbl(mg) ;
262 *mti = (cvi->r) * (cvi->sint) * (cvi->sinp) ;
272 Mtbl* map_et_fait_z(
const Map* cvi) {
275 const Mg3d* mg = cvi->
get_mg() ;
278 Mtbl* mti =
new Mtbl(mg) ;
280 *mti = (cvi->r) * (cvi->cost) ;
290 Mtbl* map_et_fait_xa(
const Map* cvi) {
293 const Mg3d* mg = cvi->
get_mg() ;
296 Mtbl* mti =
new Mtbl(mg) ;
298 double r_phi = cvi->get_rot_phi() ;
299 double t_x = cvi->get_ori_x() ;
301 if ( fabs(r_phi) < 1.e-14 ) {
302 *mti = (cvi->x) + t_x ;
304 else if ( fabs(r_phi - M_PI) < 1.e-14 ) {
305 *mti = - (cvi->x) + t_x ;
308 Mtbl phi = cvi->phi + r_phi ;
309 *mti = (cvi->r) * (cvi->sint) *
cos(phi) + t_x ;
320 Mtbl* map_et_fait_ya(
const Map* cvi) {
323 const Mg3d* mg = cvi->
get_mg() ;
326 Mtbl* mti =
new Mtbl(mg) ;
328 double r_phi = cvi->get_rot_phi() ;
329 double t_y = cvi->get_ori_y() ;
331 if ( fabs(r_phi) < 1.e-14 ) {
332 *mti = (cvi->y) + t_y ;
334 else if ( fabs(r_phi - M_PI) < 1.e-14 ) {
335 *mti = - (cvi->y) + t_y ;
338 Mtbl phi = cvi->phi + r_phi ;
339 *mti = (cvi->r) * (cvi->sint) *
sin(phi) + t_y ;
350 Mtbl* map_et_fait_za(
const Map* cvi) {
353 const Mg3d* mg = cvi->
get_mg() ;
355 double t_z = cvi->get_ori_z() ;
358 Mtbl* mti =
new Mtbl(mg) ;
360 *mti = (cvi->r) * (cvi->cost) + t_z ;
370 Mtbl* map_et_fait_sint(
const Map* cvi) {
373 const Map_et* cv =
static_cast<const Map_et*
>(cvi) ;
374 const Mg3d* mg = cv->
get_mg() ;
378 Mtbl* mti =
new Mtbl(mg) ;
379 mti->set_etat_qcq() ;
381 for (
int l=0 ; l<nz ; l++) {
382 int nr = mg->get_nr(l);
383 int nt = mg->get_nt(l);
384 int np = mg->get_np(l);
385 const Grille3d* g = mg->get_grille3d(l) ;
386 Tbl* tb = (mti->t)[l] ;
388 double* p_r = tb->t ;
389 for (
int k=0 ; k<np ; k++) {
390 for (
int j=0 ; j<nt ; j++) {
391 for (
int i=0 ; i<nr ; i++) {
392 *p_r =
sin(g->tet[j]) ;
403 Mtbl* map_et_fait_cost(
const Map* cvi) {
406 const Map_et* cv =
static_cast<const Map_et*
>(cvi) ;
407 const Mg3d* mg = cv->
get_mg() ;
411 Mtbl* mti =
new Mtbl(mg) ;
412 mti->set_etat_qcq() ;
414 for (
int l=0 ; l<nz ; l++) {
415 int nr = mg->get_nr(l);
416 int nt = mg->get_nt(l);
417 int np = mg->get_np(l);
418 const Grille3d* g = mg->get_grille3d(l) ;
419 Tbl* tb = (mti->t)[l] ;
421 double* p_r = tb->t ;
422 for (
int k=0 ; k<np ; k++) {
423 for (
int j=0 ; j<nt ; j++) {
424 for (
int i=0 ; i<nr ; i++) {
425 *p_r =
cos(g->tet[j]) ;
436 Mtbl* map_et_fait_sinp(
const Map* cvi) {
439 const Map_et* cv =
static_cast<const Map_et*
>(cvi) ;
440 const Mg3d* mg = cv->
get_mg() ;
444 Mtbl* mti =
new Mtbl(mg) ;
445 mti->set_etat_qcq() ;
447 for (
int l=0 ; l<nz ; l++) {
448 int nr = mg->get_nr(l);
449 int nt = mg->get_nt(l);
450 int np = mg->get_np(l);
451 const Grille3d* g = mg->get_grille3d(l) ;
452 Tbl* tb = (mti->t)[l] ;
454 double* p_r = tb->t ;
455 for (
int k=0 ; k<np ; k++) {
456 for (
int j=0 ; j<nt ; j++) {
457 for (
int i=0 ; i<nr ; i++) {
458 *p_r =
sin(g->phi[k]) ;
469 Mtbl* map_et_fait_cosp(
const Map* cvi) {
472 const Map_et* cv =
static_cast<const Map_et*
>(cvi) ;
473 const Mg3d* mg = cv->
get_mg() ;
477 Mtbl* mti =
new Mtbl(mg) ;
478 mti->set_etat_qcq() ;
480 for (
int l=0 ; l<nz ; l++) {
481 int nr = mg->get_nr(l);
482 int nt = mg->get_nt(l);
483 int np = mg->get_np(l);
484 const Grille3d* g = mg->get_grille3d(l) ;
485 Tbl* tb = (mti->t)[l] ;
487 double* p_r = tb->t ;
488 for (
int k=0 ; k<np ; k++) {
489 for (
int j=0 ; j<nt ; j++) {
490 for (
int i=0 ; i<nr ; i++) {
491 *p_r =
cos(g->phi[k]) ;
508 Mtbl* map_et_fait_xsr(
const Map* cvi) {
511 const Map_et* cv =
static_cast<const Map_et*
>(cvi) ;
512 const Mg3d* mg = cv->
get_mg() ;
516 Mtbl* mti =
new Mtbl(mg) ;
517 mti->set_etat_qcq() ;
520 const double* alpha = cv->alpha ;
521 const double* beta = cv->beta ;
522 const Valeur& ff = cv->ff ;
523 const Valeur& gg = cv->gg ;
524 const Tbl& asx = cv->aasx ;
525 const Tbl& bsx = cv->bbsx ;
526 const Tbl& asxm1 = cv->zaasx ;
528 for (
int l=0 ; l<nz ; l++) {
529 int nr = mg->get_nr(l);
530 int nt = mg->get_nt(l) ;
531 int np = mg->get_np(l) ;
532 const Grille3d* g = mg->get_grille3d(l) ;
534 const Tbl& aa = *((cv->aa)[l]) ;
535 const Tbl& bb = *((cv->bb)[l]) ;
537 Tbl* tb = (mti->t)[l] ;
539 double* p_r = tb->t ;
541 switch(mg->get_type_r(l)) {
545 for (
int k=0 ; k<np ; k++) {
546 for (
int j=0 ; j<nt ; j++) {
547 for (
int i=0 ; i<nr ; i++) {
548 *p_r = 1. / ( alpha[l] * ( 1. + asx(i) * ff(l, k, j, 0)
549 + bsx(i) * gg(l, k, j, 0)
559 for (
int k=0 ; k<np ; k++) {
560 for (
int j=0 ; j<nt ; j++) {
561 for (
int i=0 ; i<nr ; i++) {
562 *p_r = 1. / ( alpha[l] * ( (g->x)[i]
563 + aa(i) * ff(l, k, j, 0)
564 + bb(i) * gg(l, k, j, 0)
574 assert(beta[l] == - alpha[l]) ;
575 for (
int k=0 ; k<np ; k++) {
576 for (
int j=0 ; j<nt ; j++) {
577 for (
int i=0 ; i<nr ; i++) {
578 *p_r = 1. / ( alpha[l] * ( 1.
579 + asxm1(i) * ff(l, k, j, 0)
589 cout <<
"map_et_fait_xsr: unknown type_r !" << endl ;
Cmp cos(const Cmp &)
Cosine.
int get_nzone() const
Returns the number of domains.
Cmp sin(const Cmp &)
Sine.
const Mg3d * get_mg() const
Gives the Mg3d on which the Mtbl is defined.