128 #include "param_elliptic.h" 135 bool nullite = true ;
136 for (
int i=0; i<3; i++) {
137 assert(
cmp[i]->check_dzpuis(4)) ;
138 if (
cmp[i]->get_etat() != ETATZERO) nullite = false ;
140 assert ((method>=0) && (method<7)) ;
152 if (fabs(lambda+1) < 1.e-8)
168 if (fabs(lambda+1) < 1.e-8)
171 divf = (
potential(met_f) / (lambda + 1)) ;
183 if (div_lnot0.
get_etat() != ETATZERO) {
186 for (
int lz=0; lz<nz; lz++) {
190 if (va_div.
c_cf->operator()(lz).get_etat() != ETATZERO)
191 for (
int k=0; k<np+1; k++)
192 for (
int j=0; j<nt; j++) {
193 int l_q, m_q, base_r ;
194 if (nullite_plm(j, nt, k, np, va_div.
base) == 1) {
195 donne_lm(nz, lz, j, k, va_div.
base, m_q, l_q, base_r) ;
197 for (
int i=0; i<nr; i++)
198 va_div.
c_cf->
set(lz, k, j, i) = 0. ;
213 source_r += *(
cmp[0]) - lambda*divf.
dsdr() ;
215 if (source_r.
get_etat() != ETATZERO) {
221 for (
int lz=0; lz<nz; lz++)
232 source_eta -= 2*f_r ;
243 for (
int i=0; i<3; i++) {
244 source_p.set(i) =
Cmp(*
cmp[i]) ;
252 Tenseur resu_p(source_p.poisson_vect(lambda, vect_auxi, scal_auxi)) ;
255 for (
int i=1; i<=3; i++)
256 resu.
set(i) = resu_p(i-1) ;
265 for (
int i=0; i<3; i++) {
266 source_p.set(i) =
Cmp(*
cmp[i]) ;
272 Tenseur resu_p(source_p.poisson_vect_oohara(lambda, scal_auxi)) ;
275 for (
int i=1; i<=3; i++)
276 resu.
set(i) = resu_p(i-1) ;
283 if (fabs(lambda+1) < 1.e-8)
286 divf = (
potential(met_f) / (lambda + 1)) ;
298 if (div_tmp.
get_etat() != ETATZERO) {
300 for (
int lz=0; lz<nz; lz++) {
304 if (va_div.
c_cf->operator()(lz).get_etat() != ETATZERO)
305 for (
int k=0; k<np+1; k++)
306 for (
int j=0; j<nt; j++) {
307 int l_q, m_q, base_r ;
308 if (nullite_plm(j, nt, k, np, va_div.
base) == 1) {
309 donne_lm(nz, lz, j, k, va_div.
base, m_q, l_q, base_r) ;
311 for (
int i=0; i<nr; i++)
312 va_div.
c_cf->
set(lz, k, j, i) = 0. ;
327 source_r += *(
cmp[0]) - lambda*divf.
dsdr() ;
329 if (source_r.
get_etat() != ETATZERO) {
335 for (
int lz=0; lz<nz; lz++)
348 source_eta = source_eta.
dsdt() ;
350 source_eta = (source_eta +
cmp[2]->
stdsdp()).poisson_angu() ;
368 for (
int lz=0; lz<nz; lz++) {
373 if (va_eta.
c_cf->operator()(lz).get_etat() != ETATZERO)
374 for (
int k=0; k<np+1; k++)
375 for (
int j=0; j<nt; j++) {
376 int l_q, m_q, base_r ;
377 if (nullite_plm(j, nt, k, np, va_eta.
base) == 1) {
378 donne_lm(nz, lz, j, k, va_eta.
base, m_q, l_q, base_r) ;
380 for (
int i=0; i<nr; i++) {
381 if (va_div.
c_cf->operator()(lz).get_etat() != ETATZERO)
383 -= (lambda + 2. / double(ced ? -l_q : (l_q+1) ))
384 * va_div.
c_cf->operator()(lz, k, j, i) ;
385 if (va_fsr.
c_cf->operator()(lz).get_etat() != ETATZERO) {
387 += 2. / double(ced ? -l_q : (l_q+1) )
388 * va_dfr.
c_cf->operator()(lz, k, j, i) ;
390 -= 2.*( ced ? double(l_q+2)/double(l_q)
391 : double(l_q-1)/double(l_q+1) )
392 * va_fsr.
c_cf->
set(lz, k, j, i) ;
398 if (va_eta.
c != 0x0) {
408 for (
int lz=0; lz<nz; lz++)
419 if (fabs(lambda+1) < 1.e-8)
422 divf = (
potential(met_f) / (lambda + 1)) ;
434 if (div_lnot0.
get_etat() != ETATZERO) {
437 for (
int lz=0; lz<nz; lz++) {
441 if (va_div.
c_cf->operator()(lz).get_etat() != ETATZERO)
442 for (
int k=0; k<np+1; k++)
443 for (
int j=0; j<nt; j++) {
444 int l_q, m_q, base_r ;
445 if (nullite_plm(j, nt, k, np, va_div.
base) == 1) {
446 donne_lm(nz, lz, j, k, va_div.
base, m_q, l_q, base_r) ;
448 for (
int i=0; i<nr; i++)
449 va_div.
c_cf->
set(lz, k, j, i) = 0. ;
464 source_r += *(
cmp[0]) - lambda*divf.
dsdr() ;
466 if (source_r.
get_etat() != ETATZERO) {
473 for (
int lz=0; lz<nz; lz++)
483 source_eta -= (lambda+2.)*divf ;
489 tmp = (1.+lambda)*divf ;
492 source_eta = source_eta.
primr() ;
501 poisson_block(lambda, resu) ;
506 cerr <<
"Vector::poisson : unexpected type of method !" << endl
507 <<
" method = " << method << endl ;
525 assert ((tspher != 0x0) || (tcart != 0x0)) ;
529 assert (tcart == 0x0) ;
534 assert (tspher == 0x0) ;
538 return (
poisson(lambda, *met_f, method) );
548 for (
int i=0; i<3; i++)
549 assert(
cmp[i]->check_dzpuis(4)) ;
551 assert ((method==0) || (method==2)) ;
560 int nitermax = par.
get_int(0) ;
576 if (fabs(lambda+1) < 1.e-8)
588 par_free.
add_int(nitermax, 0) ;
605 for (
int i=0; i<3; i++) {
606 source_p.set(i) =
Cmp(*
cmp[i]) ;
612 for (
int i=0; i<3 ;i++){
613 vect_auxi.set(i) = 0. ;
622 source_p.poisson_vect(lambda, par, resu_p, vect_auxi, scal_auxi) ;
625 for (
int i=1; i<=3; i++)
626 resu.
set(i) = resu_p(i-1) ;
632 cerr <<
"Vector::poisson : unexpected type of method !" << endl
633 <<
" method = " << method << endl ;
void set_poisson_vect_eta(int zone)
Sets the operator to be a regular elliptic operator to solve for the component of the vector Poisson...
Mtbl_cf * c_cf
Coefficients of the spectral expansion of the function.
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
void add_int(const int &n, int position=0)
Adds the address of a new int to the list.
void ylm_i()
Inverse of ylm()
const Scalar & lapang() const
Returns the angular Laplacian of *this , where .
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
void coef() const
Computes the coeffcients of *this.
virtual void set_etat_zero()
Sets the logical state to ETATZERO (zero).
const Vector_divfree & div_free(const Metric &) const
Returns the div-free vector in the Helmholtz decomposition.
void set_std_base()
Set the standard spectal basis of decomposition for each component.
const Base_vect_spher & get_bvect_spher() const
Returns the orthonormal vectorial basis associated with the coordinates of the mapping.
Tbl & set(int l)
Read/write of the Tbl containing the coefficients in a given domain.
void ylm()
Computes the coefficients of *this.
const Scalar & dsdt() const
Returns of *this .
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
Flat metric for tensor calculation.
Tensor field of valence 0 (or component of a tensorial field).
Scalar poisson() const
Solves the scalar Poisson equation with *this as a source.
Scalar primr(bool null_infty=true) const
Computes the radial primitive which vanishes for .
void mult_sint()
Multiplication by .
void annule_hard()
Sets the Cmp to zero in a hard way.
const Base_vect * triad
Vectorial basis (triad) with respect to which the tensor components are defined.
Values and coefficients of a (real-value) function.
int get_etat() const
Returns the logical state ETATNONDEF (undefined), ETATZERO (null) or ETATQCQ (ordinary).
virtual void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
const Vector & derive_con(const Metric &gam) const
Returns the "contravariant" derivative of *this with respect to some metric , by raising the index of...
Tensor field of valence 1.
Scalar poisson_angu(double lambda=0) const
Solves the (generalized) angular Poisson equation with *this as source.
const Metric_flat & flat_met_cart() const
Returns the flat metric associated with the Cartesian coordinates and with components expressed in th...
void set_dzpuis(int)
Modifies the dzpuis flag.
virtual void dec_dzpuis(int dec=1)
Decreases by dec units the value of dzpuis and changes accordingly the values in the compactified ext...
void annule_hard()
Sets the Scalar to zero in a hard way.
Cmp & get_cmp_mod(int position=0) const
Returns the reference of a modifiable Cmp stored in the list.
Cmp & set()
Read/write for a scalar (see also operator=(const Cmp&) ).
const int & get_int(int position=0) const
Returns the reference of a int stored in the list.
void change_triad(const Base_vect &new_triad)
Sets a new vectorial basis (triad) of decomposition and modifies the components accordingly.
virtual void inc_dzpuis(int inc=1)
Increases by inc units the value of dzpuis and changes accordingly the values of the Scalar in the co...
Vector poisson(double lambda, int method=6) const
Solves the vector Poisson equation with *this as a source.
Base_val base
Bases on which the spectral expansion is performed.
void set_vr_eta_mu(const Scalar &vr_i, const Scalar &eta_i, const Scalar &mu_i)
Defines the components through potentials and (see members p_eta and p_mu ), as well as the compon...
Scalar ** cmp
Array of size n_comp of pointers onto the components.
Scalar sol_elliptic(Param_elliptic ¶ms) const
Resolution of a general elliptic equation, putting zero at infinity.
Mtbl * c
Values of the function at the points of the multi-grid.
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.
const Scalar & stdsdp() const
Returns of *this .
Vector_divfree poisson() const
Computes the solution of a vectorial Poisson equation with *this as a source: .
This class contains the parameters needed to call the general elliptic solver.
Cartesian vectorial bases (triads).
Spherical orthonormal vectorial bases (triads).
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
const Base_vect_cart & get_bvect_cart() const
Returns the Cartesian basis associated with the coordinates (x,y,z) of the mapping, i.e.
const Scalar & potential(const Metric &) const
Returns the potential in the Helmholtz decomposition.
void add_double(const double &x, int position=0)
Adds the the address of a new double to the list.
const Scalar & dsdr() const
Returns of *this .
virtual const Scalar & mu() const
Gives the field such that the angular components of the vector are written: .
void div_sint()
Division by .
virtual void set_etat_zero()
Sets the logical state of all components to ETATZERO (zero state).
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)
Scalar & set(int)
Read/write access to a component.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
void add_cmp_mod(Cmp &ti, int position=0)
Adds the address of a new modifiable Cmp to the list.
int get_type_r(int l) const
Returns the type of sampling in the radial direction in domain no.
const Map *const mp
Mapping on which the numerical values at the grid points are defined.
void div_r_dzpuis(int ced_mult_r)
Division by r everywhere but with the output flag dzpuis set to ced_mult_r .
virtual void dec_dzpuis(int dec=1)
Decreases by dec units the value of dzpuis and changes accordingly the values of the Scalar in the co...
const Metric_flat & flat_met_spher() const
Returns the flat metric associated with the spherical coordinates and with components expressed in th...
void mult_r_dzpuis(int ced_mult_r)
Multiplication by r everywhere but with the output flag dzpuis set to ced_mult_r ...
Tensor handling *** DEPRECATED : use class Tensor instead ***.
void add_int_mod(int &n, int position=0)
Adds the address of a new modifiable int to the list.
void set_poisson_vect_r(int zone, bool only_l_zero=false)
Sets the operator to in all domains, for ; and to in all domains otherwise.