00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 char map_radial_reevaluate_C[] = "$Header: /cvsroot/Lorene/C++/Source/Map/map_radial_reevaluate.C,v 1.2 2007/05/15 12:43:57 p_grandclement Exp $" ;
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #include <stdlib.h>
00044
00045
00046 #include "map.h"
00047 #include "cmp.h"
00048 #include "param.h"
00049 #include "scalar.h"
00050
00051 void Map_radial::reevaluate(const Map* mp_prev0, int nzet, Cmp& uu) const {
00052
00053 const Map_radial* mp_prev = dynamic_cast<const Map_radial*>(mp_prev0) ;
00054
00055 if (mp_prev == 0x0) {
00056 cout <<
00057 "Map_radial::reevaluate : the mapping mp_prev does not belong"
00058 << endl ;
00059 cout << " to the class Map_radial !" << endl ;
00060 abort() ;
00061 }
00062
00063 int nz = mg->get_nzone() ;
00064
00065
00066
00067 assert(uu.get_mp() == this) ;
00068 assert(uu.get_dzpuis() == 0) ;
00069 assert(uu.get_etat() != ETATNONDEF) ;
00070 assert(mp_prev->mg == mg) ;
00071 assert(nzet <= nz) ;
00072
00073
00074
00075 if ( uu.get_etat() == ETATZERO ) {
00076 return ;
00077 }
00078
00079 assert(uu.get_etat() == ETATQCQ) ;
00080 (uu.va).coef() ;
00081
00082
00083 Mtbl_cf va_cf = *((uu.va).c_cf) ;
00084
00085
00086
00087
00088 (uu.va).set_etat_c_qcq() ;
00089
00090
00091
00092 Mtbl& va_c = *((uu.va).c) ;
00093
00094 va_c.set_etat_qcq() ;
00095
00096
00097
00098
00099
00100
00101 if ( r.c == 0x0 ) r.fait() ;
00102 const Mtbl& rc = *(r.c) ;
00103
00104
00105
00106 int nitermax = 100 ;
00107 int niter ;
00108 double precis = 1.e-15 ;
00109 Param par ;
00110 par.add_int(nitermax) ;
00111 par.add_int_mod(niter) ;
00112 par.add_double(precis) ;
00113
00114
00115
00116
00117 for (int l=0; l<nzet; l++) {
00118 int nr = mg->get_nr(l) ;
00119 int nt = mg->get_nt(l) ;
00120 int np = mg->get_np(l) ;
00121
00122 va_c.t[l]->set_etat_qcq() ;
00123
00124
00125 double* ptx = (va_c.t[l])->t ;
00126
00127 double* pr = (rc.t[l])->t ;
00128
00129
00130
00131 for (int k=0; k<np; k++) {
00132 for (int j=0; j<nt; j++) {
00133 for (int i=0; i<nr; i++) {
00134
00135
00136
00137
00138 int l0 ;
00139 double xi0 ;
00140 mp_prev->val_lx_jk(*pr, j, k, par, l0, xi0) ;
00141
00142
00143
00144 *ptx = va_cf.val_point_jk(l0, xi0, j, k) ;
00145
00146
00147 pr++ ;
00148 ptx++ ;
00149 }
00150 }
00151 }
00152
00153
00154 }
00155
00156
00157
00158
00159 uu.annule(nzet, nz - 1) ;
00160
00161
00162
00163
00164 }
00165
00166 void Map_radial::reevaluate(const Map* mp_prev0, int nzet, Scalar& uu) const {
00167
00168 const Map_radial* mp_prev = dynamic_cast<const Map_radial*>(mp_prev0) ;
00169
00170 if (mp_prev == 0x0) {
00171 cout <<
00172 "Map_radial::reevaluate : the mapping mp_prev does not belong"
00173 << endl ;
00174 cout << " to the class Map_radial !" << endl ;
00175 abort() ;
00176 }
00177
00178 int nz = mg->get_nzone() ;
00179
00180
00181
00182 assert(uu.get_mp() == *this) ;
00183 assert(uu.get_dzpuis() == 0) ;
00184 assert(uu.get_etat() != ETATNONDEF) ;
00185 assert(mp_prev->mg == mg) ;
00186 assert(nzet <= nz) ;
00187
00188
00189
00190 if ( uu.get_etat() == ETATZERO ) {
00191 return ;
00192 }
00193
00194 assert(uu.get_etat() == ETATQCQ) ;
00195 uu.set_spectral_va().coef() ;
00196
00197
00198 Mtbl_cf va_cf = *(uu.set_spectral_va().c_cf) ;
00199
00200
00201
00202
00203 uu.set_spectral_va().set_etat_c_qcq() ;
00204
00205
00206
00207 Mtbl& va_c = *(uu.set_spectral_va().c) ;
00208
00209 va_c.set_etat_qcq() ;
00210
00211
00212
00213
00214
00215
00216 if ( r.c == 0x0 ) r.fait() ;
00217 const Mtbl& rc = *(r.c) ;
00218
00219
00220
00221 int nitermax = 100 ;
00222 int niter ;
00223 double precis = 1.e-15 ;
00224 Param par ;
00225 par.add_int(nitermax) ;
00226 par.add_int_mod(niter) ;
00227 par.add_double(precis) ;
00228
00229
00230
00231
00232 for (int l=0; l<nzet; l++) {
00233 int nr = mg->get_nr(l) ;
00234 int nt = mg->get_nt(l) ;
00235 int np = mg->get_np(l) ;
00236
00237 va_c.t[l]->set_etat_qcq() ;
00238
00239
00240 double* ptx = (va_c.t[l])->t ;
00241
00242 double* pr = (rc.t[l])->t ;
00243
00244
00245
00246 for (int k=0; k<np; k++) {
00247 for (int j=0; j<nt; j++) {
00248 for (int i=0; i<nr; i++) {
00249
00250
00251
00252
00253 int l0 ;
00254 double xi0 ;
00255 mp_prev->val_lx_jk(*pr, j, k, par, l0, xi0) ;
00256
00257
00258
00259 *ptx = va_cf.val_point_jk(l0, xi0, j, k) ;
00260
00261
00262 pr++ ;
00263 ptx++ ;
00264 }
00265 }
00266 }
00267
00268
00269 }
00270
00271
00272
00273
00274 uu.annule(nzet, nz - 1) ;
00275
00276
00277
00278
00279 }