126 const Scalar& source)
const {
129 assert(source.
get_etat() != ETATNONDEF) ;
131 assert(fj.
get_etat() != ETATNONDEF) ;
133 assert(fjm1.
get_etat() != ETATNONDEF) ;
145 int nz0 = (ced ? nz - 1 : nz) ;
149 Scalar fjm1_local = fjm1 ;
154 Scalar sigma = 2*fj_local - fjm1_local ;
161 coeff =
new Tbl(12,nz);
167 Tbl a1(nz) ; a1 = 1 ;
168 Tbl a2(nz) ; a2 = 0 ;
169 Tbl a3(nz) ; a3 = 0 ;
174 assert(metri != 0x0) ;
175 assert (metri->get_etat() == ETATQCQ) ;
179 double* bornes =
new double[nz+1] ;
180 bornes[0] =
beta[0] ;
181 for (
int i=0; i<nz; i++) bornes[i+1] =
alpha[i] +
beta[i] ;
188 assert (tmap != 0x0) ;
190 metri->set_spectral_va().ylm() ;
199 for (
int lz=0; lz<nz0; lz++)
200 for (
int ir=0; ir<
mg->
get_nr(lz); ir++)
201 mt->
set(lz,0,0,ir) = (*metri->get_spectral_va().c_cf)(lz, 0, 0, ir) ;
203 if (
mg->
get_nt(0) != 1) xmetr = xmetr /
sqrt(
double(2)) ;
206 const Mtbl& erre = this->
r ;
213 for (
int lz=0; lz<nz0; lz++) {
215 double r1 = erre(lz, 0, 0, nr-1) ;
216 double rm1 = erre(lz, 0, 0, 0) ;
223 a3.
set(lz) = (x1 - a1(lz)) / (r1 * r1);
227 double r0 = erre(lz, 0, 0, i0) ;
229 double p1 = (r1 - rm1)*(r1 - r0) ;
230 double pm1 = (r0 - rm1)*(r1 - rm1) ;
231 double p0 = (r0 - rm1)*(r1 - r0) ;
232 a1.
set(lz) = xm1*r1*r0/pm1 + x1*rm1*r0/p1 - x0*rm1*r1/p0 ;
233 a2.
set(lz) = x0*(rm1 + r1)/p0 - xm1*(r1 + r0)/pm1
235 a3.
set(lz) = xm1/pm1+x1/p1-x0/p0 ;
238 for (
int k=0; k<
mg->
get_np(lz)+2; k++)
239 for (
int j=0; j<
mg->
get_nt(lz); j++)
240 for (
int i=0; i<nr; i++)
242 (a2(lz) + erre(lz, 0, 0, i)*a3(lz)) ;
244 Tbl diff = metri->domain(lz) - mime.
domain(lz) ;
245 double offset =
max(diff) ;
246 a1.
set(lz) += offset ;
252 sigma += (dt*dt)*(source + reste) ;
254 sigma += (0.5*dt*dt)*mime*fjm1_local.
laplacian() ;
257 sigma += (dt*dt) * source ;
259 sigma += (0.5*dt*dt)*fjm1_local.
laplacian() ;
268 int l_q, m_q, baser ;
270 for (
int lz=0; lz<nz-1; lz++) {
273 for (
int k=0; k<np+2; k++)
274 for (
int j=0; j<nt; j++) {
276 if ((nullite_plm(j, nt, k, np, base) == 1) && (l_q+dl >= l_min) ) {
277 for (
int i=0; i<
mg->
get_nr(lz); i++) {
279 0.5*dt*dt*dl*(2*l_q + dl +1)
297 for (
int i=0; i<nz; i++) {
298 coeff->
set(1,i) = a1(i) ;
299 coeff->
set(2,i) = a2(i) ;
300 coeff->
set(3,i) = a3(i) ;
301 coeff->
set(4,i) = 0. ;
302 coeff->
set(5,i) = 0. ;
303 coeff->
set(6,i) = 0. ;
304 coeff->
set(7,i) = 0. ;
305 coeff->
set(8,i) = 0. ;
306 coeff->
set(9,i) = 0. ;
313 double R = this->
val_r(nz0-1, 1., 0., 0.) ;
329 tbc3 =
new Tbl(np2,nt) ;
337 phijm1 =
new Tbl(np2,nt) ;
338 phij =
new Tbl(np2,nt) ;
365 bound3 = R*(4*fj_local.
get_spectral_va() - fjm1_local.get_spectral_va()) ;
366 if (bound3.
get_etat() == ETATZERO) {
372 if (nz0>1) bound3.
annule(0,nz0-2) ;
382 for (
int k=0; k<np2; k++)
383 for (
int j=0; j<nt; j++) {
385 for (
int i=0; i<nr; i++)
386 val += (*bound3.
c_cf)(nz0-1,k,j,i) ;
387 tbc3->
set(k,j) = val ;
400 if (nz0>1) souphi.
annule(0,nz0-2) ;
404 bool zero = (souphi.
get_etat() == ETATZERO) ;
412 int l_s, m_s, base_r ;
414 int dl = (par.
get_n_int() > 1) ? -1 : 0 ;
415 for (
int k=0; k<np2; k++) {
416 for (
int j=0; j<nt; j++) {
417 donne_lm(nz, nz0-1, j, k, souphi.
base, m_s, l_s, base_r) ;
422 double multi = 8*R*R + dt*dt*(6+3*l_s*(l_s+1)) + 12*R*dt ;
423 val = ( 16*R*R*(*phij)(k,j) -
424 (multi-24*R*dt)*(*phijm1)(k,j)
426 phijm1->
set(k,j) = (*phij)(k,j) ;
427 phij->
set(k,j) = val ;
433 bound3 = R*(4*fj_local.
get_spectral_va() - fjm1_local.get_spectral_va()) ;
434 if (bound3.
get_etat() == ETATZERO) *tbc3 = 0 ;
436 if (nz0 > 1) bound3.
annule(0,nz0-2) ;
440 for (
int k=0; k<np2; k++)
441 for (
int j=0; j<nt; j++) {
443 for (
int i=0; i<nr; i++)
444 val += (*bound3.
c_cf)(nz0-1,k,j,i) ;
445 tbc3->
set(k,j) = val + 2*R*dt*(*phij)(k,j);
451 cout <<
"ERROR: Map_af::dalembert" << endl ;
452 cout <<
"The boundary condition par.get_int(0) = "<< par.
get_int(0)
453 <<
" is unknown!" << endl ;
467 assert(sourva.
get_etat() == ETATQCQ) ;
const Base_val & get_spectral_base() const
Returns the spectral bases of the Valeur va.
void add_tbl_mod(Tbl &ti, int position=0)
Adds the address of a new modifiable Tbl to the list.
void annule_domain(int l)
Sets the Tensor to zero in a given domain.
Mtbl_cf * c_cf
Coefficients of the spectral expansion of the function.
double & get_double_mod(int position=0) const
Returns the reference of a stored modifiable double .
void ylm_i()
Inverse of ylm()
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
void set_etat_cf_qcq()
Sets the logical state to ETATQCQ (ordinary state) for values in the configuration space (Mtbl_cf c_c...
void coef() const
Computes the coeffcients of *this.
Cmp sqrt(const Cmp &)
Square root.
virtual void set_etat_zero()
Sets the logical state to ETATZERO (zero).
void give_quant_numbers(int, int, int, int &, int &, int &) const
Computes the various quantum numbers and 1d radial base.
const Tbl & domain(int l) const
Read-only of the value in a given domain.
double * alpha
Array (size: mg->nzone ) of the values of in each domain.
Tbl & set(int l)
Read/write of the Tbl containing the coefficients in a given domain.
void ylm()
Computes the coefficients of *this.
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
const Scalar & laplacian(int ced_mult_r=4) const
Returns the Laplacian of *this.
double & set(int i)
Read/write of a particular element (index i) (1D case)
Tensor field of valence 0 (or component of a tensorial field).
void coef_i() const
Computes the physical value of *this.
virtual double val_r(int l, double xi, double theta, double pphi) const
Returns the value of the radial coordinate r for a given in a given domain.
void dsdx()
The basis is transformed as with a operation.
const Map & get_map(int position=0) const
Returns the reference of a Map stored in the list.
const Mg3d * get_radial() const
Returns the pointer on the associated radial grid.
virtual void std_spectral_base()
Sets the spectral bases of the Valeur va to the standard ones for a scalar field. ...
Values and coefficients of a (real-value) function.
int get_etat() const
Returns the logical state ETATNONDEF (undefined), ETATZERO (null) or ETATQCQ (ordinary).
void annule(int l)
Sets the Valeur to zero in a given domain.
virtual void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
void set_base(const Base_val &)
Sets the bases for spectral expansions (member base )
Tbl & set_domain(int l)
Read/write of the value in a given domain.
virtual void dalembert(Param &par, Scalar &fJp1, const Scalar &fJ, const Scalar &fJm1, const Scalar &source) const
Performs one time-step integration of the d'Alembert scalar equation.
void set_dzpuis(int)
Modifies the dzpuis flag.
void add_double_mod(double &x, int position=0)
Adds the address of a new modifiable double to the list.
double val_grid_point(int l, int k, int j, int i) const
Returns the value of the field at a specified grid point.
double val_out_bound_jk(int l, int j, int k) const
Computes the angular coefficient of index j,k of the field represented by *this at by means of the s...
void annule_hard()
Sets the Scalar to zero in a hard way.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
int get_etat() const
Returns the logical state.
void div_r()
Division by r everywhere; dzpuis is not changed.
Tensor & get_tensor_mod(int position=0) const
Returns the reference of a modifiable Tensor stored in the list.
int get_n_double() const
Returns the number of stored double 's addresses.
int get_n_int() const
Returns the number of stored int 's addresses.
const int & get_int(int position=0) const
Returns the reference of a int stored in the list.
Map_af(const Mg3d &mgrille, const double *r_limits)
Standard Constructor.
void add_map(const Map &mi, int position=0)
Adds the address of a new Map to the list.
Base_val base
Bases on which the spectral expansion is performed.
int get_n_tensor_mod() const
Returns the number of modifiable Tensor 's addresses in the list.
int get_dzpuis() const
Returns dzpuis.
Mtbl * c
Values of the function at the points of the multi-grid.
Tbl & get_tbl_mod(int position=0) const
Returns the reference of a modifiable Tbl stored in the list.
double * beta
Array (size: mg->nzone ) of the values of in each domain.
int get_nzone() const
Returns the number of domains.
int & get_int_mod(int position=0) const
Returns the reference of a modifiable int stored in the list.
Tbl max(const Cmp &)
Maximum values of a Cmp in each domain.
int get_n_int_mod() const
Returns the number of modifiable int 's addresses in the list.
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.
int get_n_tbl_mod() const
Returns the number of modifiable Tbl 's addresses in the list.
Bases of the spectral expansions.
Base_val std_base_scal() const
Returns the standard spectral bases for a scalar.
double & set_grid_point(int l, int k, int j, int i)
Setting the value of the field at a given grid point.
void annule_hard()
Sets the Mtbl_cf to zero in a hard way.
Coefficients storage for the multi-domain spectral method.
const Scalar & dsdr() const
Returns of *this .
void set_base_t(int base_t)
Sets the expansion basis for functions in all domains.
const double & get_double(int position=0) const
Returns the reference of a double stored in the list.
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
Valeur & set_spectral_va()
Returns va (read/write version)
int get_type_r(int l) const
Returns the type of sampling in the radial direction in domain no.
const Map & get_mp() const
Returns the mapping.
void annule_hard()
Sets the Tbl to zero in a hard way.
const Valeur & get_spectral_va() const
Returns va (read only version)
#define T_LEG_PP
fct. de Legendre associees paires avec m pair
Coord r
r coordinate centered on the grid