64 const Map& map0 = source.get_mp() ;
65 const Map_af* map1 =
dynamic_cast<const Map_af*
>(&map0) ;
67 const Map_af& map = *map1 ;
69 const Mg3d& mgrid = *map.get_mg() ;
73 if (source.get_etat() == ETATZERO) {
79 resu.std_spectral_base_odd() ;
80 resu.set_spectral_va().ylm() ;
81 Mtbl_cf& sol_coef = (*resu.set_spectral_va().c_cf) ;
82 const Base_val& base = source.get_spectral_base() ;
83 assert(resu.get_spectral_base() == base) ;
84 assert(source.check_dzpuis(4)) ;
86 Mtbl_cf sol_part(mgrid, base) ; sol_part.annule_hard() ;
87 Mtbl_cf sol_hom1(mgrid, base) ; sol_hom1.annule_hard() ;
88 Mtbl_cf sol_hom2(mgrid, base) ; sol_hom2.annule_hard() ;
91 int nr = mgrid.get_nr(lz) ;
92 double alpha2 = map.get_alpha()[lz]*map.get_alpha()[lz] ;
93 assert(mgrid.get_type_r(lz) == RARE) ;
101 for (
int lin=0; lin<nr-1; lin++)
102 for (
int col=0; col<nr; col++)
103 ope.
set(lin,col) = (mdx2(lin,col) + 2*msdx(lin,col) - 2*ms2(lin,col))/alpha2 ;
105 ope.set(nr-1, 0) = 1 ;
106 for (
int i=1; i<nr; i++)
107 ope.set(nr-1, i) = 0 ;
111 for (
int i=0; i<nr-1; i++)
112 rhs.set(i) = (*source.get_spectral_va().c_cf)(lz, 0, 0, i) ;
115 Tbl sol = ope.inverse(rhs) ;
117 for (
int i=0; i<nr; i++)
118 sol_part.
set(lz, 0, 0, i) = sol(i) ;
122 sol = ope.inverse(rhs) ;
123 for (
int i=0; i<nr; i++)
124 sol_hom1.set(lz, 0, 0, i) = sol(i) ;
128 for (
int lz=1; lz<nz-1; lz++) {
129 int nr = mgrid.get_nr(lz) ;
130 double alpha = map.get_alpha()[lz] ;
131 double beta = map.get_beta()[lz] ;
132 double ech = beta / alpha ;
133 assert(mgrid.get_type_r(lz) == FIN) ;
146 for (
int lin=0; lin<nr-2; lin++)
147 for (
int col=0; col<nr; col++)
148 ope.
set(lin, col) = mx2dx2(lin, col) + 2*ech*mxdx2(lin, col) + ech*ech*mdx2(lin, col)
149 + 2*(mxdx(lin, col) + ech*mdx(lin, col)) - 2*mid(lin, col) ;
151 ope.set(nr-2, 0) = 0 ;
152 ope.set(nr-2, 1) = 1 ;
153 for (
int col=2; col<nr; col++) {
154 ope.set(nr-2, col) = 0 ;
156 ope.set(nr-1, 0) = 1 ;
157 for (
int col=1; col<nr; col++)
158 ope.set(nr-1, col) = 0 ;
162 for (
int i=0; i<nr; i++)
163 src.set(i) = (*source.get_spectral_va().c_cf)(lz, 0, 0, i) ;
164 Tbl xsrc = src ; multx_1d(nr, &xsrc.t, base_r) ;
165 Tbl x2src = src ; multx2_1d(nr, &x2src.t, base_r) ;
168 for (
int i=0; i<nr-2; i++)
169 rhs.set(i) = beta*beta*src(i) + 2*beta*alpha*xsrc(i) + alpha*alpha*x2src(i) ;
173 Tbl sol = ope.inverse(rhs) ;
175 for (
int i=0; i<nr; i++)
176 sol_part.
set(lz, 0, 0, i) = sol(i) ;
180 sol = ope.inverse(rhs) ;
181 for (
int i=0; i<nr; i++)
182 sol_hom1.set(lz, 0, 0, i) = sol(i) ;
186 sol = ope.inverse(rhs) ;
187 for (
int i=0; i<nr; i++)
188 sol_hom2.set(lz, 0, 0, i) = sol(i) ;
193 int nr = mgrid.get_nr(lz) ;
194 double alpha2 = map.get_alpha()[lz]*map.get_alpha()[lz] ;
195 assert(mgrid.get_type_r(lz) == UNSURR) ;
203 for (
int lin=0; lin<nr-3; lin++)
204 for (
int col=0; col<nr; col++)
205 ope.
set(lin, col) = (mdx2(lin, col) - 2*ms2(lin, col))/alpha2 ;
207 for (
int i=0; i<nr; i++) {
208 ope.set(nr-3, i) = i*i ;
211 for (
int i=0; i<nr; i++) {
212 ope.set(nr-2, i) = 1 ;
215 ope.set(nr-1, 0) = 1 ;
216 for (
int i=1; i<nr; i++)
217 ope.set(nr-1, i) = 0 ;
221 for (
int i=0; i<nr-3; i++)
222 rhs.set(i) = (*source.get_spectral_va().c_cf)(lz, 0, 0, i) ;
227 Tbl sol = ope.inverse(rhs) ;
228 for (
int i=0; i<nr; i++)
229 sol_part.
set(lz, 0, 0, i) = sol(i) ;
233 sol = ope.inverse(rhs) ;
234 for (
int i=0; i<nr; i++)
235 sol_hom2.set(lz, 0, 0, i) = sol(i) ;
243 Matrice systeme(2*(nz-1), 2*(nz-1)) ;
244 systeme.annule_hard() ;
251 double alpha = map.get_alpha()[0] ;
252 systeme.set(lin,col) = sol_hom1.val_out_bound_jk(0, 0, 0) ;
253 rhs.set(lin) -= sol_part.val_out_bound_jk(0, 0, 0) ;
255 systeme.set(lin,col) = dhom1.val_out_bound_jk(0, 0, 0) / alpha ;
256 rhs.set(lin) -= dpart.val_out_bound_jk(0, 0, 0) / alpha ;
260 for (
int lz=1; lz<nz-1; lz++) {
261 alpha = map.get_alpha()[lz] ;
263 systeme.set(lin,col) -= sol_hom1.val_in_bound_jk(lz, 0, 0) ;
264 systeme.set(lin,col+1) -= sol_hom2.val_in_bound_jk(lz, 0, 0) ;
265 rhs.set(lin) += sol_part.val_in_bound_jk(lz, 0, 0) ;
268 systeme.set(lin,col) -= dhom1.val_in_bound_jk(lz, 0, 0) / alpha ;
269 systeme.set(lin,col+1) -= dhom2.val_in_bound_jk(lz, 0, 0) / alpha ;
270 rhs.set(lin) += dpart.val_in_bound_jk(lz, 0, 0) / alpha;
273 systeme.set(lin, col) += sol_hom1.val_out_bound_jk(lz, 0, 0) ;
274 systeme.set(lin, col+1) += sol_hom2.val_out_bound_jk(lz, 0, 0) ;
275 rhs.set(lin) -= sol_part.val_out_bound_jk(lz, 0, 0) ;
278 systeme.set(lin, col) += dhom1.val_out_bound_jk(lz, 0, 0) / alpha ;
279 systeme.set(lin, col+1) += dhom2.val_out_bound_jk(lz, 0, 0) / alpha ;
280 rhs.set(lin) -= dpart.val_out_bound_jk(lz, 0, 0) / alpha ;
285 alpha = map.get_alpha()[nz-1] ;
287 systeme.set(lin,col) -= sol_hom2.val_in_bound_jk(nz-1, 0, 0) ;
288 rhs.set(lin) += sol_part.val_in_bound_jk(nz-1, 0, 0) ;
291 systeme.set(lin,col) -= (-4*alpha)*dhom2.val_in_bound_jk(nz-1, 0, 0) ;
292 rhs.set(lin) += (-4*alpha)*dpart.val_in_bound_jk(nz-1, 0, 0) ;
295 Tbl coef = systeme.inverse(rhs) ;
298 for (
int i=0; i<mgrid.get_nr(0); i++)
299 sol_coef.
set(0, 0, 0, i) = sol_part(0, 0, 0, i)
300 + coef(indice)*sol_hom1(0, 0, 0, i) ;
302 for (
int lz=1; lz<nz-1; lz++) {
303 for (
int i=0; i<mgrid.get_nr(lz); i++)
304 sol_coef.set(lz, 0, 0, i) = sol_part(lz, 0, 0, i)
305 +coef(indice)*sol_hom1(lz, 0, 0, i)
306 +coef(indice+1)*sol_hom2(lz, 0, 0, i) ;
309 for (
int i=0; i<mgrid.get_nr(nz-1); i++)
310 sol_coef.set(nz-1, 0, 0, i) = sol_part(nz-1, 0, 0, i)
311 +coef(indice)*sol_hom2(nz-1, 0, 0, i) ;
313 delete resu.set_spectral_va().c ;
314 resu.set_spectral_va().c = 0x0 ;
316 resu.set_spectral_va().ylm_i() ;
Bases of the spectral expansions.
Class for the elementary differential operator (see the base class Diff ).
Class for the elementary differential operator (see the base class Diff ).
Class for the elementary differential operator Identity (see the base class Diff ).
Class for the elementary differential operator division by (see the base class Diff ).
Class for the elementary differential operator (see the base class Diff ).
Class for the elementary differential operator (see the base class Diff ).
Class for the elementary differential operator (see the base class Diff ).
Class for the elementary differential operator (see the base class Diff ).
double & set(int j, int i)
Read/write of a particuliar element.
int get_nzone() const
Returns the number of domains.
Coefficients storage for the multi-domain spectral method.
Tensor field of valence 0 (or component of a tensorial field).
double & set(int i)
Read/write of a particular element (index i) (1D case).
#define R_CHEBU
base de Chebychev ordinaire (fin), dev. en 1/r
#define R_CHEBI
base de Cheb. impaire (rare) seulement
#define R_CHEB
base de Chebychev ordinaire (fin)
Map(const Mg3d &)
Constructor from a multi-domain 3D grid.