81 #include "proto_f77.h" 90 assert(source_mat.
get_etat() != ETATNONDEF) ;
91 assert(source_quad.
get_etat() != ETATNONDEF) ;
105 if ( (source_mat.
get_etat() == ETATZERO)
106 && (source_quad.
get_etat() == ETATZERO) ) {
137 int* ndl =
new int[nz+4] ;
139 for (
int l=0; l<nz; l++) {
148 int* indd =
new int[nz] ;
149 for (
int l=0; l<nz; l++) {
164 cerr <<
"Map_af::poisson2d: unknown type_r !" << endl ;
174 for (
int l=0; l<nz ; l++) {
175 nrmax = ( ndl[1+l] > nrmax ) ? ndl[1+l] : nrmax ;
177 int ndr = nrmax + 5 ;
186 double* erre =
new double [ndz*ndr] ;
188 for (
int l=0; l<nz; l++) {
189 for (
int i=0; i<ndl[1+l]; i++) {
191 erre[ ndr*l + i ] =
alpha[l] * xr +
beta[l] ;
199 int ndrtp = ndr*ndt*ndp ;
200 int taille = ndrtp*ndz ;
202 double* tsou_m =
new double[ taille ] ;
203 double* tsou_q =
new double[ taille ] ;
204 double* tuu =
new double[ taille ] ;
207 for (
int i=0; i<taille; i++) {
215 const Valeur& va_m = source_mat.
va ;
216 assert(va_m.
get_etat() == ETATQCQ) ;
218 const Mtbl* s_m = va_m.
c ;
219 assert(s_m->
get_etat() == ETATQCQ) ;
223 for (
int l=0; l<nz; l++) {
227 for (
int k=0; k<np1; k++) {
228 for (
int j=0; j<nt; j++) {
229 for (
int i=0; i<nr; i++) {
230 tsou_m[ndrtp*l + ndrt*k + ndr*j + i] = 0 ;
232 if ( mpsymm == SYM ) tsou_m[ndrtp*l + ndrt*k + ndr*(nt2-1-j) + i] = 0 ;
239 assert( s_m->
t[l]->
get_etat() == ETATQCQ ) ;
240 for (
int k=0; k<np1; k++) {
241 for (
int j=0; j<nt; j++) {
242 for (
int i=0; i<nr; i++) {
243 double xx = s_m->
t[l]->
t[nrt*k + nr*j + i] ;
244 tsou_m[ndrtp*l + ndrt*k + ndr*j + i] = xx ;
246 if ( mpsymm == SYM ) tsou_m[ndrtp*l + ndrt*k + ndr*(nt2-1-j) + i] = xx ;
256 if (source_quad.
get_etat() != ETATZERO) {
258 const Valeur& va_q = source_quad.
va ;
259 assert(va_q.
get_etat() == ETATQCQ) ;
261 const Mtbl* s_q = va_q.
c ;
263 assert( va_q.
base == base_s ) ;
265 assert(s_q->
get_etat() == ETATQCQ) ;
267 for (
int l=0; l<nz; l++) {
271 for (
int k=0; k<np1; k++) {
272 for (
int j=0; j<nt; j++) {
273 for (
int i=0; i<nr; i++) {
274 tsou_q[ndrtp*l + ndrt*k + ndr*j + i] = 0 ;
276 if ( mpsymm == SYM ) tsou_q[ndrtp*l + ndrt*k + ndr*(nt2-1-j) + i] = 0 ;
283 assert( s_q->
t[l]->
get_etat() == ETATQCQ ) ;
284 for (
int k=0; k<np1; k++) {
285 for (
int j=0; j<nt; j++) {
286 for (
int i=0; i<nr; i++) {
287 double xx = s_q->
t[l]->
t[nrt*k + nr*j + i] ;
288 tsou_q[ndrtp*l + ndrt*k + ndr*j + i] = xx ;
290 if ( mpsymm == SYM ) tsou_q[ndrtp*l + ndrt*k + ndr*(nt2-1-j) + i] = xx ;
303 int base_t = (va_m.
base).get_base_t(0) ;
314 F77_poiss2d(ndl, &ndr, &ndt, &ndp, indd, erre, tsou_m, tsou_q,
325 double* tsou =
new double[taille] ;
326 for (
int i=0; i<taille; i++) {
327 tsou[i] = tsou_m[i] + tsou_q[i] ;
330 F77_poiss2di(ndl, &ndr, &ndt, &ndp, indd, erre, tsou, tuu) ;
341 cerr <<
"Map_af::poisson2d : unkown theta basis !" << endl ;
342 cerr <<
" basis : " << hex << base_t << endl ;
353 (uu.
va).set_etat_c_qcq() ;
356 for (
int l=0; l<nz; l++) {
358 for (
int k=0; k<
mg->
get_np(l); k++) {
359 for (
int j=0; j<nt; j++) {
360 for (
int i=0; i<nr; i++) {
361 uu.
set(l, k, j, i) = tuu[ndrtp*l + ndr*j + i] ;
367 (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.
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.
virtual void poisson2d(const Cmp &source_mat, const Cmp &source_quad, Param &par, Cmp &uu, bool verbose=true) const
Computes the solution of a 2-D Poisson equation.
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.