78 #include "proto_f77.h" 87 assert(source_mat.
get_etat() != ETATNONDEF) ;
88 assert(source_quad.
get_etat() != ETATNONDEF) ;
102 if ( (source_mat.
get_etat() == ETATZERO)
103 && (source_quad.
get_etat() == ETATZERO) ) {
134 int* ndl =
new int[nz+4] ;
136 for (
int l=0; l<nz; l++) {
145 int* indd =
new int[nz] ;
146 for (
int l=0; l<nz; l++) {
161 cout <<
"Map_af::poisson2d: unknown type_r !" << endl ;
171 for (
int l=0; l<nz ; l++) {
172 nrmax = ( ndl[1+l] > nrmax ) ? ndl[1+l] : nrmax ;
174 int ndr = nrmax + 5 ;
183 double* erre =
new double [ndz*ndr] ;
185 for (
int l=0; l<nz; l++) {
186 for (
int i=0; i<ndl[1+l]; i++) {
188 erre[ ndr*l + i ] =
alpha[l] * xr +
beta[l] ;
196 int ndrtp = ndr*ndt*ndp ;
197 int taille = ndrtp*ndz ;
199 double* tsou_m =
new double[ taille ] ;
200 double* tsou_q =
new double[ taille ] ;
201 double* tuu =
new double[ taille ] ;
204 for (
int i=0; i<taille; i++) {
212 const Valeur& va_m = source_mat.
va ;
213 assert(va_m.
get_etat() == ETATQCQ) ;
215 const Mtbl* s_m = va_m.
c ;
216 assert(s_m->
get_etat() == ETATQCQ) ;
220 for (
int l=0; l<nz; l++) {
224 for (
int k=0; k<np1; k++) {
225 for (
int j=0; j<nt; j++) {
226 for (
int i=0; i<nr; i++) {
227 tsou_m[ndrtp*l + ndrt*k + ndr*j + i] = 0 ;
229 if ( mpsymm == SYM ) tsou_m[ndrtp*l + ndrt*k + ndr*(nt2-1-j) + i] = 0 ;
236 assert( s_m->
t[l]->
get_etat() == ETATQCQ ) ;
237 for (
int k=0; k<np1; k++) {
238 for (
int j=0; j<nt; j++) {
239 for (
int i=0; i<nr; i++) {
240 double xx = s_m->
t[l]->
t[nrt*k + nr*j + i] ;
241 tsou_m[ndrtp*l + ndrt*k + ndr*j + i] = xx ;
243 if ( mpsymm == SYM ) tsou_m[ndrtp*l + ndrt*k + ndr*(nt2-1-j) + i] = xx ;
253 if (source_quad.
get_etat() != ETATZERO) {
255 const Valeur& va_q = source_quad.
va ;
256 assert(va_q.
get_etat() == ETATQCQ) ;
258 const Mtbl* s_q = va_q.
c ;
260 assert( va_q.
base == base_s ) ;
262 assert(s_q->
get_etat() == ETATQCQ) ;
264 for (
int l=0; l<nz; l++) {
268 for (
int k=0; k<np1; k++) {
269 for (
int j=0; j<nt; j++) {
270 for (
int i=0; i<nr; i++) {
271 tsou_q[ndrtp*l + ndrt*k + ndr*j + i] = 0 ;
273 if ( mpsymm == SYM ) tsou_q[ndrtp*l + ndrt*k + ndr*(nt2-1-j) + i] = 0 ;
280 assert( s_q->
t[l]->
get_etat() == ETATQCQ ) ;
281 for (
int k=0; k<np1; k++) {
282 for (
int j=0; j<nt; j++) {
283 for (
int i=0; i<nr; i++) {
284 double xx = s_q->
t[l]->
t[nrt*k + nr*j + i] ;
285 tsou_q[ndrtp*l + ndrt*k + ndr*j + i] = xx ;
287 if ( mpsymm == SYM ) tsou_q[ndrtp*l + ndrt*k + ndr*(nt2-1-j) + i] = xx ;
300 int base_t = (va_m.
base).get_base_t(0) ;
311 F77_poiss2d(ndl, &ndr, &ndt, &ndp, indd, erre, tsou_m, tsou_q,
322 double* tsou =
new double[taille] ;
323 for (
int i=0; i<taille; i++) {
324 tsou[i] = tsou_m[i] + tsou_q[i] ;
327 F77_poiss2di(ndl, &ndr, &ndt, &ndp, indd, erre, tsou, tuu) ;
338 cout <<
"Map_af::poisson2d : unkown theta basis !" << endl ;
339 cout <<
" basis : " << hex << base_t << endl ;
350 (uu.
va).set_etat_c_qcq() ;
353 for (
int l=0; l<nz; l++) {
355 for (
int k=0; k<
mg->
get_np(l); k++) {
356 for (
int j=0; j<nt; j++) {
357 for (
int i=0; i<nr; i++) {
358 uu.
set(l, k, j, i) = tuu[ndrtp*l + ndr*j + i] ;
364 (uu.
va).set_base( base_uu ) ;
const Map * get_mp() const
Returns the mapping.
const Grille3d * get_grille3d(int l) const
Returns a pointer on the 3D mono-grid for domain no. l.
double & get_double_mod(int position=0) const
Returns the reference of a stored modifiable double .
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
double * alpha
Array (size: mg->nzone ) of the values of in each domain.
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
int get_etat() const
Returns the logical state.
void coef_i() const
Computes the physical value of *this.
int get_type_t() const
Returns the type of sampling in the direction: SYM : : symmetry with respect to the equatorial pl...
#define T_COS
dev. cos seulement
Values and coefficients of a (real-value) function.
int get_etat() const
Gives the logical state.
double * x
Array of values of at the nr collocation points.
#define T_SIN
dev. sin seulement
int get_etat() const
Gives the logical state.
int get_etat() const
Returns the logical state.
#define T_COS_P
dev. cos seulement, harmoniques paires
Base_val base
Bases on which the spectral expansion is performed.
double * t
The array of double.
Mtbl * c
Values of the function at the points of the multi-grid.
double * beta
Array (size: mg->nzone ) of the values of in each domain.
int get_nzone() const
Returns the number of domains.
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.
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
void allocate_all()
Sets the logical state to ETATQCQ (ordinary state) and performs the memory allocation of all the elem...
const Mg3d * mg
Pointer on the multi-grid Mgd3 on which this is defined.
Bases of the spectral expansions.
Tbl & set(int l)
Read/write of the value in a given domain.
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...
void set_dzpuis(int)
Set a value to dzpuis.
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
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.
#define T_SIN_I
dev. sin seulement, harmoniques impaires
Valeur va
The numerical value of the Cmp.