129 #include "param_elliptic.h" 136 bool nullite = true ;
137 for (
int i=0; i<3; i++) {
138 assert(
cmp[i]->check_dzpuis(4)) ;
139 if (
cmp[i]->get_etat() != ETATZERO) nullite = false ;
141 assert ((method>=0) && (method<7)) ;
153 if (fabs(lambda+1) < 1.e-8)
169 if (fabs(lambda+1) < 1.e-8)
172 divf = (
potential(met_f) / (lambda + 1)) ;
184 if (div_lnot0.
get_etat() != ETATZERO) {
187 for (
int lz=0; lz<nz; lz++) {
191 if (va_div.
c_cf->operator()(lz).get_etat() != ETATZERO)
192 for (
int k=0; k<np+1; k++)
193 for (
int j=0; j<nt; j++) {
194 int l_q, m_q, base_r ;
195 if (nullite_plm(j, nt, k, np, va_div.
base) == 1) {
196 donne_lm(nz, lz, j, k, va_div.
base, m_q, l_q, base_r) ;
198 for (
int i=0; i<nr; i++)
199 va_div.
c_cf->
set(lz, k, j, i) = 0. ;
214 source_r += *(
cmp[0]) - lambda*divf.
dsdr() ;
216 if (source_r.
get_etat() != ETATZERO) {
222 for (
int lz=0; lz<nz; lz++)
233 source_eta -= 2*f_r ;
244 for (
int i=0; i<3; i++) {
245 source_p.set(i) =
Cmp(*
cmp[i]) ;
253 Tenseur resu_p(source_p.poisson_vect(lambda, vect_auxi, scal_auxi)) ;
256 for (
int i=1; i<=3; i++)
257 resu.
set(i) = resu_p(i-1) ;
266 for (
int i=0; i<3; i++) {
267 source_p.set(i) =
Cmp(*
cmp[i]) ;
273 Tenseur resu_p(source_p.poisson_vect_oohara(lambda, scal_auxi)) ;
276 for (
int i=1; i<=3; i++)
277 resu.
set(i) = resu_p(i-1) ;
284 if (fabs(lambda+1) < 1.e-8)
287 divf = (
potential(met_f) / (lambda + 1)) ;
299 if (div_tmp.
get_etat() != ETATZERO) {
301 for (
int lz=0; lz<nz; lz++) {
305 if (va_div.
c_cf->operator()(lz).get_etat() != ETATZERO)
306 for (
int k=0; k<np+1; k++)
307 for (
int j=0; j<nt; j++) {
308 int l_q, m_q, base_r ;
309 if (nullite_plm(j, nt, k, np, va_div.
base) == 1) {
310 donne_lm(nz, lz, j, k, va_div.
base, m_q, l_q, base_r) ;
312 for (
int i=0; i<nr; i++)
313 va_div.
c_cf->
set(lz, k, j, i) = 0. ;
328 source_r += *(
cmp[0]) - lambda*divf.
dsdr() ;
330 if (source_r.
get_etat() != ETATZERO) {
336 for (
int lz=0; lz<nz; lz++)
349 source_eta = source_eta.
dsdt() ;
351 source_eta = (source_eta +
cmp[2]->
stdsdp()).poisson_angu() ;
369 for (
int lz=0; lz<nz; lz++) {
374 if (va_eta.
c_cf->operator()(lz).get_etat() != ETATZERO)
375 for (
int k=0; k<np+1; k++)
376 for (
int j=0; j<nt; j++) {
377 int l_q, m_q, base_r ;
378 if (nullite_plm(j, nt, k, np, va_eta.
base) == 1) {
379 donne_lm(nz, lz, j, k, va_eta.
base, m_q, l_q, base_r) ;
381 for (
int i=0; i<nr; i++) {
382 if (va_div.
c_cf->operator()(lz).get_etat() != ETATZERO)
384 -= (lambda + 2. / double(ced ? -l_q : (l_q+1) ))
385 * va_div.
c_cf->operator()(lz, k, j, i) ;
386 if (va_fsr.
c_cf->operator()(lz).get_etat() != ETATZERO) {
388 += 2. / double(ced ? -l_q : (l_q+1) )
389 * va_dfr.
c_cf->operator()(lz, k, j, i) ;
391 -= 2.*( ced ? double(l_q+2)/double(l_q)
392 : double(l_q-1)/double(l_q+1) )
393 * va_fsr.
c_cf->
set(lz, k, j, i) ;
399 if (va_eta.
c != 0x0) {
409 for (
int lz=0; lz<nz; lz++)
420 if (fabs(lambda+1) < 1.e-8)
423 divf = (
potential(met_f) / (lambda + 1)) ;
435 if (div_lnot0.
get_etat() != ETATZERO) {
438 for (
int lz=0; lz<nz; lz++) {
442 if (va_div.
c_cf->operator()(lz).get_etat() != ETATZERO)
443 for (
int k=0; k<np+1; k++)
444 for (
int j=0; j<nt; j++) {
445 int l_q, m_q, base_r ;
446 if (nullite_plm(j, nt, k, np, va_div.
base) == 1) {
447 donne_lm(nz, lz, j, k, va_div.
base, m_q, l_q, base_r) ;
449 for (
int i=0; i<nr; i++)
450 va_div.
c_cf->
set(lz, k, j, i) = 0. ;
465 source_r += *(
cmp[0]) - lambda*divf.
dsdr() ;
467 if (source_r.
get_etat() != ETATZERO) {
474 for (
int lz=0; lz<nz; lz++)
484 source_eta -= (lambda+2.)*divf ;
490 tmp = (1.+lambda)*divf ;
493 source_eta = source_eta.
primr() ;
502 poisson_block(lambda, resu) ;
507 cout <<
"Vector::poisson : unexpected type of method !" << endl
508 <<
" method = " << method << endl ;
526 assert ((tspher != 0x0) || (tcart != 0x0)) ;
530 assert (tcart == 0x0) ;
535 assert (tspher == 0x0) ;
539 return (
poisson(lambda, *met_f, method) );
549 for (
int i=0; i<3; i++)
550 assert(
cmp[i]->check_dzpuis(4)) ;
552 assert ((method==0) || (method==2)) ;
561 int nitermax = par.
get_int(0) ;
577 if (fabs(lambda+1) < 1.e-8)
589 par_free.
add_int(nitermax, 0) ;
606 for (
int i=0; i<3; i++) {
607 source_p.set(i) =
Cmp(*
cmp[i]) ;
613 for (
int i=0; i<3 ;i++){
614 vect_auxi.set(i) = 0. ;
623 source_p.poisson_vect(lambda, par, resu_p, vect_auxi, scal_auxi) ;
626 for (
int i=1; i<=3; i++)
627 resu.
set(i) = resu_p(i-1) ;
633 cout <<
"Vector::poisson : unexpected type of method !" << endl
634 <<
" 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.