00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 char mtbl_cf_vp_asymy_C[] = "$Header: /cvsroot/Lorene/C++/Source/Mtbl_cf/mtbl_cf_vp_asymy.C,v 1.2 2012/01/17 15:09:14 j_penner Exp $" ;
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060 #include "mtbl_cf.h"
00061 #include "proto.h"
00062
00063
00064
00065
00066
00067 double Mtbl_cf::val_point_asymy(int l, double x, double theta, double phi)
00068 const {
00069
00070
00071 static void (*som_r[MAX_BASE])
00072 (double*, const int, const int, const int, const double, double*) ;
00073 static void (*som_tet[MAX_BASE])
00074 (double*, const int, const int, const double, double*) ;
00075 static void (*som_phi[MAX_BASE_2])
00076 (double*, const int, const double, double*) ;
00077 static int premier_appel = 1 ;
00078
00079
00080
00081 if (premier_appel == 1) {
00082
00083 premier_appel = 0 ;
00084
00085 for (int i=0 ; i<MAX_BASE ; i++) {
00086 if(i%2==0){
00087 som_phi[i/2] = som_phi_pas_prevu ;
00088 }
00089 som_tet[i] = som_tet_pas_prevu ;
00090 som_r[i] = som_r_pas_prevu ;
00091 }
00092
00093 som_r[R_CHEB >> TRA_R] = som_r_cheb_asymy ;
00094 som_r[R_CHEBP >> TRA_R] = som_r_chebp ;
00095 som_r[R_CHEBI >> TRA_R] = som_r_chebi ;
00096 som_r[R_CHEBU >> TRA_R] = som_r_chebu_asymy ;
00097 som_r[R_CHEBPIM_P >> TRA_R] = som_r_chebpim_p_asymy ;
00098 som_r[R_CHEBPIM_I >> TRA_R] = som_r_chebpim_i_asymy ;
00099
00100 som_tet[T_COS >> TRA_T] = som_tet_cos ;
00101 som_tet[T_SIN >> TRA_T] = som_tet_sin ;
00102 som_tet[T_COS_P >> TRA_T] = som_tet_cos_p ;
00103 som_tet[T_SIN_P >> TRA_T] = som_tet_sin_p ;
00104 som_tet[T_COSSIN_CP >> TRA_T] = som_tet_cossin_cp_asymy ;
00105 som_tet[T_COSSIN_CI >> TRA_T] = som_tet_cossin_ci_asymy ;
00106
00107 som_phi[P_COSSIN >> TRA_P] = som_phi_cossin_asymy ;
00108 som_phi[P_COSSIN_P >> TRA_P] = som_phi_cossin_p ;
00109 som_phi[P_COSSIN_I >> TRA_P] = som_phi_cossin_i ;
00110
00111 }
00112
00113
00114 assert (etat != ETATNONDEF) ;
00115
00116 double resu ;
00117
00118
00119 if (etat == ETATZERO ) {
00120 resu = 0 ;
00121 return resu ;
00122 }
00123
00124
00125 int np = mg->get_np(l) ;
00126 int nt = mg->get_nt(l) ;
00127 int nr = mg->get_nr(l) ;
00128
00129
00130 int base_r = (base.b[l] & MSQ_R) >> TRA_R ;
00131 int base_t = (base.b[l] & MSQ_T) >> TRA_T ;
00132 int base_p = (base.b[l] & MSQ_P) >> TRA_P ;
00133
00134
00135
00136
00137
00138
00139
00140 assert(etat == ETATQCQ) ;
00141 Tbl* tbcf = t[l] ;
00142
00143 if (tbcf->get_etat() == ETATZERO ) {
00144 resu = 0 ;
00145 return resu ;
00146 }
00147
00148
00149 assert(tbcf->get_etat() == ETATQCQ) ;
00150
00151 double* cf = tbcf->t ;
00152
00153
00154 double* trp = new double [np+2] ;
00155 double* trtp = new double [(np+2)*nt] ;
00156
00157 if (nr == 1) {
00158
00159
00160
00161
00162 som_tet[base_t](cf, nt, np, theta, trp) ;
00163 }
00164 else {
00165
00166
00167
00168
00169 som_r[base_r](cf, nr, nt, np, x, trtp) ;
00170 som_tet[base_t](trtp, nt, np, theta, trp) ;
00171 }
00172
00173
00174
00175
00176 if (np == 1) {
00177 resu = trp[0] ;
00178 }
00179 else {
00180 som_phi[base_p](trp, np, phi, &resu) ;
00181 }
00182
00183
00184 delete [] trp ;
00185 delete [] trtp ;
00186
00187
00188 return resu ;
00189
00190 }
00191
00192
00193
00194
00195
00196
00197
00198
00199 double Mtbl_cf::val_point_jk_asymy(int l, double x, int j0, int k0) const {
00200
00201
00202 static void (*som_r[MAX_BASE])
00203 (double*, const int, const int, const int, const double, double*) ;
00204 static int premier_appel = 1 ;
00205
00206
00207
00208 if (premier_appel == 1) {
00209
00210 premier_appel = 0 ;
00211
00212 for (int i=0 ; i<MAX_BASE ; i++) {
00213 som_r[i] = som_r_pas_prevu ;
00214 }
00215
00216 som_r[R_CHEB >> TRA_R] = som_r_cheb_asymy ;
00217 som_r[R_CHEBP >> TRA_R] = som_r_chebp ;
00218 som_r[R_CHEBI >> TRA_R] = som_r_chebi ;
00219 som_r[R_CHEBU >> TRA_R] = som_r_chebu_asymy ;
00220 som_r[R_CHEBPIM_P >> TRA_R] = som_r_chebpim_p_asymy ;
00221 som_r[R_CHEBPIM_I >> TRA_R] = som_r_chebpim_i_asymy ;
00222
00223 }
00224
00225 assert (etat != ETATNONDEF) ;
00226
00227 double resu ;
00228
00229
00230 if (etat == ETATZERO ) {
00231 resu = 0 ;
00232 return resu ;
00233 }
00234
00235
00236 int np = mg->get_np(l) ;
00237 int nt = mg->get_nt(l) ;
00238 int nr = mg->get_nr(l) ;
00239
00240
00241 int base_r = (base.b[l] & MSQ_R) >> TRA_R ;
00242
00243
00244
00245
00246
00247
00248 Tbl tab_phi = base.phi_functions(l, np) ;
00249 Tbl tab_theta = base.theta_functions(l, nt) ;
00250
00251
00252
00253
00254
00255
00256
00257
00258 assert(etat == ETATQCQ) ;
00259 Tbl* tbcf = t[l] ;
00260
00261 if (tbcf->get_etat() == ETATZERO ) {
00262 resu = 0 ;
00263 return resu ;
00264 }
00265
00266
00267 assert(tbcf->get_etat() == ETATQCQ) ;
00268
00269 double* cf = tbcf->t ;
00270
00271
00272 double* coef_tp = new double [(np+2)*nt] ;
00273
00274
00275
00276
00277
00278 som_r[base_r](cf, nr, nt, np, x, coef_tp) ;
00279
00280
00281
00282
00283 double* pi = coef_tp ;
00284
00285 resu = 0 ;
00286
00287 if (np > 1) {
00288
00289
00290 pi += 3*nt ;
00291
00292
00293
00294 int base_t = base.b[l] & MSQ_T ;
00295
00296 switch (base_t) {
00297
00298 case T_COSSIN_CP : {
00299
00300 for (int k=3 ; k<np+1 ; k+=2) {
00301 int m_par = (k/2)%2 ;
00302 double somt = 0 ;
00303 for (int j=0 ; j<nt ; j++) {
00304 somt += (*pi) * tab_theta(m_par, j, j0) ;
00305 pi++ ;
00306 }
00307 resu += somt * tab_phi(k, k0) ;
00308
00309
00310 pi += nt ;
00311 }
00312 break ;
00313 }
00314
00315 default: {
00316 cout << "Mtbl_cf::val_point_jk_asymy: unknown theta basis ! "
00317 << endl ;
00318 abort () ;
00319 }
00320
00321 }
00322
00323 }
00324
00325
00326
00327 delete [] coef_tp ;
00328
00329
00330 return resu ;
00331
00332 }
00333
00334