86 static double* cx_tcp = 0 ;
87 static double* cx_rrp = 0 ;
88 static double* cx_rf_x2 = 0 ;
89 static double* cx_rf_x = 0 ;
90 static double* cx_rf = 0 ;
92 static int nt_cp_pre = 0 ;
93 static int nr_p_pre = 0 ;
94 static int nr_f_pre = 0 ;
96 assert(ci.
get_etat() != ETATNONDEF) ;
107 assert( ci.
get_etat() == ETATQCQ ) ;
115 assert(p_mti->
get_etat() == ETATQCQ) ;
121 for (
int l=0 ; l<nz ; l++) {
123 const Tbl* p_tbi = p_mti->
t[l] ;
125 if ( p_tbi->
get_etat() == ETATZERO ) {
130 assert( p_tbi->
get_etat() == ETATQCQ ) ;
135 int base = (p_mti->
base).get_b(l) ;
136 int base_r = base &
MSQ_R ;
137 int base_t = base &
MSQ_T ;
138 int base_p = base &
MSQ_P ;
144 double* s_tr =
new double[nr] ;
145 double* x_spec = p_tbi->
t ;
150 if (nt > nt_cp_pre) {
153 =
static_cast<double*
>(realloc(cx_tcp, nt*
sizeof(
double))) ;
154 for (
int j=0 ; j<nt ; j++) {
155 cx_tcp[j] = 2./(1. - 4.*j*j) ;
160 for (
int i=0 ; i<nr ; i++) s_tr[i] = 0 ;
161 for (
int j=0 ; j<nt ; j++) {
162 for (
int i=0 ; i<nr ; i++) {
163 s_tr[i] += cx_tcp[j] * x_spec[i] ;
171 for (
int i=0 ; i<nr ; i++) s_tr[i] = 0 ;
172 for (
int j=0 ; j<nt ; j++) {
174 for (
int i=0 ; i<nr ; i++) {
175 s_tr[i] += (2. / (1.-j*j)) * x_spec[i] ;
182 cout <<
"Map_af::integrale: unknown theta basis ! " << endl ;
200 assert(
beta[l] == 0) ;
203 cx_rrp =
static_cast<double*
>(realloc(cx_rrp, nr*
sizeof(
double))) ;
204 for (
int i=0 ; i<nr ; i++) {
205 cx_rrp[i] = (3. - 4.*i*i) /
206 (9. - 40. * i*i + 16. * i*i*i*i) ;
210 for (
int i=0 ; i<nr ; i++) {
211 som += cx_rrp[i] * s_tr[i] ;
213 double rmax =
alpha[l] ;
214 som *= rmax*rmax*rmax ;
221 cx_rf_x2 =
static_cast<double*
>(realloc(cx_rf_x2, nr*
sizeof(
double))) ;
222 cx_rf_x =
static_cast<double*
>(realloc(cx_rf_x, nr*
sizeof(
double))) ;
223 cx_rf =
static_cast<double*
>(realloc(cx_rf, nr*
sizeof(
double))) ;
224 for (
int i=0 ; i<nr ; i +=2 ) {
225 cx_rf_x2[i] = 2.*(3. - i*i)/(9. - 10. * i*i + i*i*i*i) ;
227 cx_rf[i] = 2./(1. - i*i) ;
229 for (
int i=1 ; i<nr ; i +=2 ) {
231 cx_rf_x[i] = 2./(4. - i*i) ;
236 for (
int i=0 ; i<nr ; i +=2 ) {
237 som_x2 += cx_rf_x2[i] * s_tr[i] ;
239 for (
int i=1 ; i<nr ; i +=2 ) {
240 som_x += cx_rf_x[i] * s_tr[i] ;
242 for (
int i=0 ; i<nr ; i +=2 ) {
243 som_c += cx_rf[i] * s_tr[i] ;
245 double a =
alpha[l] ;
247 som = a*a*a * som_x2 + 2.*a*a*b * som_x + a*b*b * som_c ;
254 cx_rf_x2 =
static_cast<double*
>(realloc(cx_rf_x2, nr*
sizeof(
double))) ;
255 cx_rf_x =
static_cast<double*
>(realloc(cx_rf_x, nr*
sizeof(
double))) ;
256 cx_rf =
static_cast<double*
>(realloc(cx_rf, nr*
sizeof(
double))) ;
258 for (
int i=0 ; i<nr ; i +=1 ) {
260 cx_rf_x[i] = 2*signe/double(i+1)/double(i+2);
264 cx_rf_x2[0] = double(8)/double(3) ;
267 for (
int i=0 ; i<nr ; i +=1 ) {
268 som_x2 += cx_rf_x2[i] * s_tr[i] ;
270 for (
int i=1 ; i<nr ; i +=1 ) {
271 som_x += cx_rf_x[i] * s_tr[i] ;
273 for (
int i=0 ; i<nr ; i +=1 ) {
274 som_c += cx_rf[i] * s_tr[i] ;
276 double a =
alpha[l] ;
279 som = a*a*a * som_x2 + 2.*a*a*(b-a) * som_x + a*(b-a)*(b-a) * som_c ;
287 cx_rf =
static_cast<double*
>(realloc(cx_rf, nr*
sizeof(
double))) ;
288 for (
int i=0 ; i<nr ; i +=2 ) {
289 cx_rf[i] = 2./(1. - i*i) ;
291 for (
int i=1 ; i<nr ; i +=2 ) {
296 for (
int i=0 ; i<nr ; i +=2 ) {
297 som_c += cx_rf[i] * s_tr[i] ;
299 som = -
alpha[l] * som_c ;
305 cout <<
"Map_af::integrale: unknown r basis ! " << endl ;
329 cout <<
"Map_af::integrale: unknown phi basis ! " << endl ;
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
#define P_COSSIN
dev. standart
double * alpha
Array (size: mg->nzone ) of the values of in each domain.
int get_etat() const
Returns the logical state.
#define MSQ_P
Extraction de l'info sur Phi.
#define T_COS
dev. cos seulement
int get_etat() const
Gives the logical state.
virtual Tbl * integrale(const Cmp &) const
Computes the integral over all space of a Cmp.
int get_etat() const
Returns the logical state.
#define R_JACO02
base de Jacobi(0,2) ordinaire (finjac)
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
#define R_CHEBP
base de Cheb. paire (rare) seulement
#define T_COS_P
dev. cos seulement, harmoniques paires
#define MSQ_T
Extraction de l'info sur Theta.
#define T_COSSIN_C
dev. cos-sin alternes, cos pour m=0
double * t
The array of double.
#define MSQ_R
Extraction de l'info sur R.
double * beta
Array (size: mg->nzone ) of the values of in each domain.
int get_nzone() const
Returns the number of domains.
#define R_CHEBPIM_P
Cheb. pair-impair suivant m, pair pour m=0.
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
const Mg3d * mg
Pointer on the multi-grid Mgd3 on which this is defined.
#define R_CHEBPI_P
Cheb. pair-impair suivant l pair pour l=0.
Coefficients storage for the multi-domain spectral method.
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...
Base_val base
Bases of the spectral expansions.
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
#define R_CHEBU
base de Chebychev ordinaire (fin), dev. en 1/r
#define P_COSSIN_P
dev. sur Phi = 2*phi, freq. paires
#define T_COSSIN_CP
cos pair-sin impair alternes, cos pour m=0
void annule_hard()
Sets the Tbl to zero in a hard way.
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...
#define R_CHEB
base de Chebychev ordinaire (fin)