30char map_af_poisson2d_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Map/map_af_poisson2d.C,v 1.6 2014/10/13 08:53:02 j_novak Exp $" ;
84 assert(source_mat.
get_etat() != ETATNONDEF) ;
85 assert(source_quad.
get_etat() != ETATNONDEF) ;
99 if ( (source_mat.
get_etat() == ETATZERO)
100 && (source_quad.
get_etat() == ETATZERO) ) {
131 int* ndl =
new int[nz+4] ;
133 for (
int l=0; l<nz; l++) {
142 int* indd =
new int[nz] ;
143 for (
int l=0; l<nz; l++) {
158 cout <<
"Map_af::poisson2d: unknown type_r !" << endl ;
168 for (
int l=0; l<nz ; l++) {
169 nrmax = ( ndl[1+l] > nrmax ) ? ndl[1+l] : nrmax ;
171 int ndr = nrmax + 5 ;
180 double* erre =
new double [ndz*ndr] ;
182 for (
int l=0; l<nz; l++) {
183 for (
int i=0; i<ndl[1+l]; i++) {
185 erre[ ndr*l + i ] =
alpha[l] * xr +
beta[l] ;
193 int ndrtp = ndr*ndt*ndp ;
194 int taille = ndrtp*ndz ;
196 double* tsou_m =
new double[ taille ] ;
197 double* tsou_q =
new double[ taille ] ;
198 double* tuu =
new double[ taille ] ;
201 for (
int i=0; i<taille; i++) {
209 const Valeur& va_m = source_mat.
va ;
210 assert(va_m.
get_etat() == ETATQCQ) ;
212 const Mtbl* s_m = va_m.
c ;
213 assert(s_m->
get_etat() == ETATQCQ) ;
217 for (
int l=0; l<nz; l++) {
221 for (
int k=0; k<np1; k++) {
222 for (
int j=0; j<nt; j++) {
223 for (
int i=0; i<nr; i++) {
224 tsou_m[ndrtp*l + ndrt*k + ndr*j + i] = 0 ;
226 if ( mpsymm == SYM ) tsou_m[ndrtp*l + ndrt*k + ndr*(nt2-1-j) + i] = 0 ;
233 assert( s_m->
t[l]->
get_etat() == ETATQCQ ) ;
234 for (
int k=0; k<np1; k++) {
235 for (
int j=0; j<nt; j++) {
236 for (
int i=0; i<nr; i++) {
237 double xx = s_m->
t[l]->
t[nrt*k + nr*j + i] ;
238 tsou_m[ndrtp*l + ndrt*k + ndr*j + i] = xx ;
240 if ( mpsymm == SYM ) tsou_m[ndrtp*l + ndrt*k + ndr*(nt2-1-j) + i] = xx ;
250 if (source_quad.
get_etat() != ETATZERO) {
252 const Valeur& va_q = source_quad.
va ;
253 assert(va_q.
get_etat() == ETATQCQ) ;
255 const Mtbl* s_q = va_q.
c ;
257 assert( va_q.
base == base_s ) ;
259 assert(s_q->
get_etat() == ETATQCQ) ;
261 for (
int l=0; l<nz; l++) {
265 for (
int k=0; k<np1; k++) {
266 for (
int j=0; j<nt; j++) {
267 for (
int i=0; i<nr; i++) {
268 tsou_q[ndrtp*l + ndrt*k + ndr*j + i] = 0 ;
270 if ( mpsymm == SYM ) tsou_q[ndrtp*l + ndrt*k + ndr*(nt2-1-j) + i] = 0 ;
277 assert( s_q->
t[l]->
get_etat() == ETATQCQ ) ;
278 for (
int k=0; k<np1; k++) {
279 for (
int j=0; j<nt; j++) {
280 for (
int i=0; i<nr; i++) {
281 double xx = s_q->
t[l]->
t[nrt*k + nr*j + i] ;
282 tsou_q[ndrtp*l + ndrt*k + ndr*j + i] = xx ;
284 if ( mpsymm == SYM ) tsou_q[ndrtp*l + ndrt*k + ndr*(nt2-1-j) + i] = xx ;
297 int base_t = (va_m.
base).get_base_t(0) ;
308 F77_poiss2d(ndl, &ndr, &ndt, &ndp, indd, erre, tsou_m, tsou_q,
319 double* tsou =
new double[taille] ;
320 for (
int i=0; i<taille; i++) {
321 tsou[i] = tsou_m[i] + tsou_q[i] ;
324 F77_poiss2di(ndl, &ndr, &ndt, &ndp, indd, erre, tsou, tuu) ;
335 cout <<
"Map_af::poisson2d : unkown theta basis !" << endl ;
336 cout <<
" basis : " << hex << base_t << endl ;
347 (uu.
va).set_etat_c_qcq() ;
350 for (
int l=0; l<nz; l++) {
352 for (
int k=0; k<
mg->
get_np(l); k++) {
353 for (
int j=0; j<nt; j++) {
354 for (
int i=0; i<nr; i++) {
355 uu.
set(l, k, j, i) = tuu[ndrtp*l + ndr*j + i] ;
361 (uu.
va).set_base( base_uu ) ;
Bases of the spectral expansions.
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
void allocate_all()
Sets the logical state to ETATQCQ (ordinary state) and performs the memory allocation of all the elem...
int get_etat() const
Returns the logical state.
Valeur va
The numerical value of the Cmp
Tbl & set(int l)
Read/write of the value in a given domain.
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.
double * x
Array of values of at the nr collocation points.
double * beta
Array (size: mg->nzone ) of the values of in each domain.
double * alpha
Array (size: mg->nzone ) of the values of in each 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.
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_type_t() const
Returns the type of sampling in the direction: SYM : : symmetry with respect to the equatorial pl...
const Grille3d * get_grille3d(int l) const
Returns a pointer on the 3D mono-grid for domain no. l.
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
int get_nzone() const
Returns the number of domains.
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
int get_type_r(int l) const
Returns the type of sampling in the radial direction in domain no.
int get_etat() const
Gives the logical state.
Tbl ** t
Array (size nzone ) of pointers on the Tbl 's.
double & get_double_mod(int position=0) const
Returns the reference of a stored modifiable double .
int get_etat() const
Gives the logical state.
double * t
The array of double.
Values and coefficients of a (real-value) function.
int get_etat() const
Returns the logical state.
Mtbl * c
Values of the function at the points of the multi-grid
void coef_i() const
Computes the physical value of *this.
Base_val base
Bases on which the spectral expansion is performed.
#define T_COS_P
dev. cos seulement, harmoniques paires
#define T_SIN_I
dev. sin seulement, harmoniques impaires
#define T_COS
dev. cos seulement
#define T_SIN
dev. sin seulement