116 int nitermax = par.
get_int(0) ;
119 int nz_search = par.
get_int(2) ;
120 int adapt_flag = par.
get_int(3) ;
136 assert(ent.
get_mp() ==
this) ;
137 assert(nzadapt < nz) ;
138 assert(nzadapt > 0) ;
139 assert(nz_search >= nzadapt) ;
140 for (
int l=1; l<nz; l++) {
146 assert(ent_limit.
get_etat() == ETATQCQ) ;
152 const double xi_max = 1 ;
158 if ( (adapt_flag == 0) || (nzadapt == 0) ) {
172 double* nalpha =
new double[nz] ;
173 double* nbeta =
new double[nz] ;
178 Tbl xtgg(np, nt, 1) ;
180 Tbl xtff(np, nt, 1) ;
186 double ent0 = ent_limit(0) ;
194 (ent.
va).equipot_outward(ent0, nz_search, precis, nitermax, niter0,
197 niter = ( niter0 > niter ) ? niter0 : niter ;
206 assert(l_ext.
get_etat() == ETATQCQ) ;
208 double r_eq =
val_r_jk(0, xi_max, j_bord, k_bord) ;
210 double* pxtgg = xtgg.
t ;
211 int* pl_ext = l_ext.
t ;
212 double* px_ext = x_ext.
t ;
214 for (
int k=0; k<np; k++) {
215 for (
int j=0; j<nt; j++) {
217 *pxtgg =
val_r_jk(*pl_ext, *px_ext, j, k) - r_eq ;
231 int base_p = ( ((ent.
va).base).b[0] ) &
MSQ_P ;
245 double* pxtff = xtff.
t ;
257 double* cf =
new double[(np+2)*nt] ;
258 double* cf0 =
new double[(np+2)*nt] ;
259 double* ff0 =
new double[np*nt] ;
261 for (
int i=0; i < np*nt; i++) {
266 cfpcossin(deg, dimc, cf) ;
272 for (
int k=0; k<np-1; k += 4) {
273 for(
int j=0; j<2*nt; j++) {
278 for(
int j=0; j<2*nt; j++) {
285 for(
int j=0; j<2*nt; j++) {
292 cipcossin(deg, dimc, deg, cf0, ff0) ;
295 for (
int i=0; i < np*nt; i++) {
304 for (
int k=0; k<np-1; k += 4) {
305 for(
int j=0; j<2*nt; j++) {
310 for(
int j=0; j<2*nt; j++) {
317 for(
int j=0; j<2*nt; j++) {
323 cipcossin(deg, dimc, deg, cf0, ff0) ;
326 for (
int i=0; i < np*nt; i++) {
338 cout <<
"Map_et::adapt: unknown phi basis !" << endl ;
339 cout <<
" base_p = " << base_p << endl ;
350 double mu = - fact_lamu *
min(xtgg) ;
355 nalpha[0] = r_eq - lambda - mu ;
366 *(nff.t[0]) = ( xtff + lambda ) / nalpha[0] ;
367 *(ngg.t[0]) = ( xtgg + mu ) / nalpha[0] ;
375 double r_eqlm1 = r_eq ;
380 for (
int l=1; l<nzadapt; l++) {
382 ent0 = ent_limit(l) ;
389 (ent.
va).equipot_outward(ent0, nz_search, precis, nitermax, niter0,
392 niter = ( niter0 > niter ) ? niter0 : niter ;
401 assert(l_ext.
get_etat() == ETATQCQ) ;
403 r_eq =
val_r_jk(l, xi_max, j_bord, k_bord) ;
409 for (
int k=0; k<np; k++) {
410 for (
int j=0; j<nt; j++) {
412 *pxtgg =
val_r_jk(*pl_ext, *px_ext, j, k) - r_eq ;
424 lambda = - fact_lamu *
max(xtff) ;
425 mu = - fact_lamu *
min(xtgg) ;
430 nalpha[l] = .5 * ( r_eq - r_eqlm1 + lambda - mu ) ;
431 nbeta[l] = .5 * ( r_eq + r_eqlm1 - lambda - mu ) ;
436 *(nff.t[l]) = ( xtff + lambda ) / nalpha[l] ;
437 *(ngg.t[l]) = ( xtgg + mu ) / nalpha[l] ;
453 xtff = 1 / (xtff + r_eqlm1) -
double(1) / r_eqlm1 ;
455 lambda = - fact_lamu *
min(xtff) ;
457 nalpha[nzadapt] = .5 * ( lambda - double(1) / r_eqlm1 ) ;
458 nbeta[nzadapt] = - nalpha[nzadapt] ;
461 *(nff.t[nzadapt]) = ( xtff + lambda ) / nalpha[nzadapt] ;
468 r_eq =
val_r_jk(nzadapt, xi_max, j_bord, k_bord) ;
470 lambda = - fact_lamu *
max(xtff) ;
472 nalpha[nzadapt] = .5 * ( r_eq - r_eqlm1 + lambda ) ;
473 nbeta[nzadapt] = .5 * ( r_eq + r_eqlm1 - lambda ) ;
477 *(nff.t[nzadapt]) = ( xtff + lambda ) / nalpha[nzadapt] ;
482 ngg.t[nzadapt]->set_etat_zero() ;
489 for (
int l=nzadapt+1; l<nz; l++) {
491 nalpha[l] =
alpha[l] ;
497 for (
int l=nzadapt+1; l<nz; l++) {
498 nff.t[l]->set_etat_zero() ;
503 assert(
ff.
c != 0x0) ;
505 for (
int l=nzadapt+1; l<nz; l++) {
506 *(nff.t[l]) = *(
ff.
c->
t[l]) ;
511 for (
int l=nzadapt+1; l<nz; l++) {
512 ngg.t[l]->set_etat_zero() ;
517 assert(
gg.
c != 0x0) ;
519 for (
int l=nzadapt+1; l<nz; l++) {
520 *(ngg.t[l]) = *(
gg.
c->
t[l]) ;
530 for (
int l=0; l<nz; l++) {
533 alpha[l] = nalpha[l] / fact_echelle ;
534 beta[l] = nbeta[l] / fact_echelle ;
537 alpha[l] = fact_echelle * nalpha[l] ;
538 beta[l] = fact_echelle * nbeta[l] ;
550 if (nbr_filtre !=0) {
555 for (
int l=0 ; l<nzadapt+1 ; l++)
556 for (
int k=np-nbr_filtre ; k<np ; k++)
557 for (
int j=0 ; j<nt ; j++) {
const Map * get_mp() const
Returns the mapping.
Mtbl_cf * c_cf
Coefficients of the spectral expansion of the function.
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
#define P_COSSIN
dev. standart
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
void set_etat_cf_qcq()
Sets the logical state to ETATQCQ (ordinary state) for values in the configuration space (Mtbl_cf c_c...
void coef() const
Computes the coeffcients of *this.
double * alpha
Array (size: mg->nzone ) of the values of in each domain.
Tbl & set(int l)
Read/write of the Tbl containing the coefficients in a given domain.
#define MSQ_P
Extraction de l'info sur Phi.
Basic integer array class.
int get_etat() const
Gives the logical state.
Tbl min(const Cmp &)
Minimum values of a Cmp in each domain.
void std_base_scal()
Sets the bases for spectral expansions (member base ) to the standard ones for a scalar.
const Mg3d * get_mg() const
Returns the Mg3d on which the this is defined.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
int get_etat() const
Gives the logical state.
int get_etat() const
Returns the logical state.
const Tbl & get_tbl(int position=0) const
Returns the reference of a Tbl stored in the list.
int get_ndim() const
Gives the number of dimensions (ie dim.ndim)
const int & get_int(int position=0) const
Returns the reference of a int stored in the list.
Valeur ff
Values of the function at the nt*np angular collocation points in each domain.
double * t
The array of double.
Mtbl * c
Values of the function at the points of the multi-grid.
int get_nzone() const
Returns the number of domains.
int & get_int_mod(int position=0) const
Returns the reference of a modifiable int stored in the list.
virtual void homothetie(double lambda)
Sets a new radial scale.
Tbl max(const Cmp &)
Maximum values of a Cmp in each domain.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
int get_etat() const
Gives the logical state.
virtual void reset_coord()
Resets all the member Coords.
const Mg3d * mg
Pointer on the multi-grid Mgd3 on which this is defined.
virtual void adapt(const Cmp &ent, const Param &par, int nbr_filtre=0)
Adaptation of the mapping to a given scalar field.
Valeur gg
Values of the function at the nt*np angular collocation points in each domain.
int get_taille() const
Gives the total size (ie dim.taille)
double * beta
Array (size: mg->nzone ) of the values of in each domain.
int * t
The array of int 's.
const double & get_double(int position=0) const
Returns the reference of a double stored in the list.
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
#define P_COSSIN_P
dev. sur Phi = 2*phi, freq. paires
int get_type_r(int l) const
Returns the type of sampling in the radial direction in domain no.
Tbl ** t
Array (size nzone ) of pointers on the Tbl 's.
Valeur va
The numerical value of the Cmp.
Tbl ** t
Array (size nzone ) of pointers on the Tbl 's which contain the spectral coefficients in each domain...
virtual double val_r_jk(int l, double xi, int j, int k) const
Returns the value of the radial coordinate r for a given and a given collocation point in in a give...