30char map_et_poisson2d_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Map/map_et_poisson2d.C,v 1.4 2014/10/13 08:53:05 j_novak Exp $" ;
83 assert(source_mat.
get_etat() != ETATNONDEF) ;
84 assert(source_quad.
get_etat() != ETATNONDEF) ;
98 if ( (source_mat.
get_etat() == ETATZERO)
99 && (source_quad.
get_etat() == ETATZERO) ) {
106 int base_t = ((source_mat.
va).base).get_base_t(0) ;
119 double theta0 = M_PI / 2 ;
124 for (
int l=0 ; l<nz ; l++) {
125 double rmax =
val_r(l,
double(1), theta0, phi0) ;
128 double rmin =
val_r(l,
double(0), theta0, phi0) ;
135 double rmin =
val_r(l,
double(-1), theta0, phi0) ;
136 mpaff.
set_alpha(
double(.5) * (rmax - rmin), l ) ;
137 mpaff.
set_beta(
double(.5) * (rmax + rmin), l) ;
142 double rmin =
val_r(l,
double(-1), theta0, phi0) ;
143 double umax = double(1) / rmin ;
144 double umin = double(1) / rmax ;
145 mpaff.
set_alpha(
double(.5) * (umin - umax), l) ;
146 mpaff.
set_beta(
double(.5) * (umin + umax), l) ;
151 cout <<
"Map_et::poisson2d: unknown type_r ! " << endl ;
162 saff_m.
import( nzm1, source_mat ) ;
163 (saff_m.
va).set_base( (source_mat.
va).base ) ;
168 Cmp set_q = source_quad ;
171 saff_q.
import( nzm1, set_q ) ;
172 (saff_q.
va).set_base( (set_q.
va).base ) ;
175 if ( (set_q.
va).get_etat() == ETATQCQ) {
176 (set_q.
va).coef_i() ;
177 assert( (set_q.
va).c->get_etat() == ETATQCQ ) ;
178 assert( (saff_q.
va).c->get_etat() == ETATQCQ ) ;
179 *( (saff_q.
va).c->t[nzm1] ) = *( (set_q.
va).c->t[nzm1] ) ;
190 mpaff.
poisson2d(saff_m, saff_q, par, uaff) ;
216 for (
int l=0; l<nz; l++) {
220 apre1 = apre1 *
dxdr *
dxdr * unjj ;
230 for (
int l=0; l<nz; l++) {
231 *(amax1.
t[l]) = amax0(l) ;
245 double unmlambda_relax = 1. - lambda_relax ;
271 cout <<
"Map_et::poisson2d : relat. diff. u^J <-> u^{J-1} : " << endl ;
304 sxlapang = sxlapang.
d2sdt2() ;
306 sxlapang = sxlapang.
sx() ;
328 jac_ext.
annule(0, nzm1-1) ;
329 jac_ext = - jac_ext ;
330 jac = jac + jac_ext ;
337 vuu = jac * (
rsxdxdr * unjj - 1.) * duudx
351 sauve_base = vuu.
base ;
373 ssj = lambda_relax * ssjm1 + unmlambda_relax * ssjm2 ;
375 ssj = ( source_mat + source_quad + uu + (amax - apre) * ssj ) / amax ;
377 (ssj.
va).set_base((source_mat.
va).base) ;
392 cout <<
" step " << niter <<
" : " ;
393 for (
int l=0; l<nz; l++) {
394 cout << tdiff(l) <<
" " ;
409 while ( (diff > precis) && (niter < nitermax) ) ;
422 cout <<
"Map_et::poisson2d : unkown theta basis !" << endl ;
423 cout <<
" basis : " << hex << base_t << endl ;
Bases of the spectral expansions.
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
void import(const Cmp &ci)
Assignment to another Cmp defined on a different mapping.
int get_etat() const
Returns the logical state.
Valeur va
The numerical value of the Cmp
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
int get_dzpuis() const
Returns dzpuis.
void set_dzpuis(int)
Set a value to dzpuis.
bool check_dzpuis(int dzi) const
Returns false if the last domain is compactified and *this is not zero in this domain and dzpuis is n...
const Map * get_mp() const
Returns the mapping.
void set_beta(double beta0, int l)
Modifies the value of in domain no. l.
virtual void poisson2d(const Cmp &source_mat, const Cmp &source_quad, Param &par, Cmp &uu) const
Computes the solution of a 2-D Poisson equation.
void set_alpha(double alpha0, int l)
Modifies the value of in domain no. l.
virtual double val_r(int l, double xi, double theta, double pphi) const
Returns the value of the radial coordinate r for a given in a given domain.
virtual void poisson2d(const Cmp &source_mat, const Cmp &source_quad, Param &par, Cmp &uu) const
Computes the solution of a 2-D Poisson equation.
Coord rsxdxdr
in the nucleus; \ in the shells; \ in the outermost compactified domain.
double * alpha
Array (size: mg->nzone ) of the values of in each domain.
Coord d2rdx2
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
Coord sr2drdt
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
Coord d2rdtdx
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
Coord srdrdt
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
Coord xsr
in the nucleus; \ 1/R in the non-compactified shells; \ in the compactified outer domain.
Coord dxdr
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
Coord sr2d2rdt2
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
const Mg3d * mg
Pointer on the multi-grid Mgd3 on which this is defined
int get_nzone() const
Returns the number of domains.
int get_type_r(int l) const
Returns the type of sampling in the radial direction in domain no.
void annule(int l_min, int l_max)
Sets the Mtbl to zero in some domains.
Tbl ** t
Array (size nzone ) of pointers on the Tbl 's.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Cmp & get_cmp_mod(int position=0) const
Returns the reference of a modifiable Cmp stored in the list.
const int & get_int(int position=0) const
Returns the reference of a int stored in the list.
const double & get_double(int position=0) const
Returns the reference of a double stored in the list.
int & get_int_mod(int position=0) const
Returns the reference of a modifiable int stored in the list.
double & get_double_mod(int position=0) const
Returns the reference of a stored modifiable double .
Values and coefficients of a (real-value) function.
const Valeur & sx() const
Returns (r -sampling = RARE ) \ Id (r sampling = FIN ) \ (r -sampling = UNSURR )
const Valeur & d2sdt2() const
Returns of *this.
void set_base(const Base_val &)
Sets the bases for spectral expansions (member base )
const Valeur & dsdt() const
Returns of *this.
Base_val base
Bases on which the spectral expansion is performed.
Tbl diffrel(const Cmp &a, const Cmp &b)
Relative difference between two Cmp (norme version).
Tbl max(const Cmp &)
Maximum values of a Cmp in each domain.
#define T_COS_P
dev. cos seulement, harmoniques paires
#define T_SIN_I
dev. sin seulement, harmoniques impaires