193 #include "utilitaires.h" 233 assert((vc.
c != 0x0) || (vc.
c_cf != 0x0) ) ;
245 if (vc.
c_cf != 0x0) {
258 cout <<
"Etat pas possible" << endl ;
270 if (*
mg != *mg_tmp) {
272 "Valeur::Valeur(const Mg3d& g, FILE* fd): grid not consistent !" 280 if (
etat == ETATQCQ) {
281 c =
new Mtbl(g, fd) ;
379 cout <<
"Unkwon state in Valeur::operator=(const Valeur&) !" 394 assert(mt.
get_etat() != ETATNONDEF) ;
422 cout <<
"Unkwon state in Valeur::operator=(const Mtbl&) !" 437 assert(mt.
get_etat() != ETATNONDEF) ;
439 assert(&mt !=
c_cf) ;
465 cout <<
"Unkwon state in Valeur::operator=(const Mtbl_cf&) !" 484 if (
etat == ETATQCQ) {
499 ostream& operator<<(ostream& o,
const Valeur & vi) {
503 o <<
"*** Valeur in UNDEFINED STATE" ;
508 o <<
"*** Valeur IDENTICALLY ZERO" ;
514 o <<
"*** Valeur (configuration space) :" << endl ;
515 o << *(vi.
c) << endl ;
517 if (vi.
c_cf != 0x0) {
518 o <<
"*** Valeur (coefficients) :" << endl ;
519 o << *(vi.
c_cf) << endl ;
525 cout <<
"operator<<(ostream&, const Valeur&) : unknown state !" 541 if (
etat == ETATNONDEF) {
542 ost <<
" state: UNDEFINED" << endl ;
546 if (
etat == ETATZERO) {
547 ost <<
" state: ZERO" << endl ;
562 double seuil)
const {
563 ost <<
"*** Valeur " << endl ;
569 if (
etat == ETATNONDEF) {
570 ost <<
" state: UNDEFINED" << endl ;
574 if (
etat == ETATZERO) {
575 ost <<
" state: ZERO" << endl ;
582 ost <<
" Coefficients of the Valeur : " << endl ;
589 ost <<
" Values of the Valeur at the collocation points: " << endl ;
597 ost <<
" Coefficients of the Valeur : " << endl ;
599 ost <<
" Values of the Valeur at the collocation points: " << endl ;
605 cout <<
"Unknown type in Valeur::affiche_seuil !" << endl ;
693 if (
etat == ETATZERO) return ;
699 if (
etat == ETATNONDEF) return ;
760 if ( (l_min == 0) && (l_max ==
mg->
get_nzone()-1) ) {
765 assert(
etat != ETATNONDEF ) ;
767 if (
etat == ETATZERO ) {
771 assert(
etat == ETATQCQ ) ;
887 assert(
etat != ETATNONDEF) ;
891 if (
etat == ETATZERO) {
895 assert(
etat == ETATQCQ) ;
905 assert(
etat != ETATNONDEF) ;
909 if (
etat == ETATZERO) {
913 assert(
etat == ETATQCQ) ;
934 if (
etat != ETATZERO) {
935 assert (
etat == ETATQCQ) ;
937 for (
int lz=nz1; lz<=nz2; lz++) {
939 for (
int k=0; k<np+1; k++)
940 for (
int j=0; j<nt; j++) {
941 int l_q, m_q, base_r ;
942 if (nullite_plm(j, nt, k, np,
base) == 1) {
943 donne_lm(nz, lz, j, k,
base, m_q, l_q,base_r) ;
945 for (
int i=0; i<nr; i++)
void std_base_scal_odd()
Sets the bases for spectral expansions (member base ) to the standard odd ones for a scalar...
Mtbl_cf * c_cf
Coefficients of the spectral expansion of the function.
Valeur * p_dsdt
Pointer on .
Valeur * p_d2sdt2
Pointer on .
Valeur * p_sx
Pointer on .
Valeur * p_ssint
Pointer on .
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 set_base_r(int l, int base_r)
Sets the expansion basis for r ( ) functions in a given domain.
void coef() const
Computes the coeffcients of *this.
Valeur * p_dsdp
Pointer on .
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
Tbl & set(int l)
Read/write of the Tbl containing the coefficients in a given domain.
void display(double threshold=1.e-7, int precision=4, ostream &ostr=cout) const
Prints the coefficients whose values are greater than a given threshold, as well as the corresponding...
void ylm()
Computes the coefficients of *this.
void annule_hard()
Sets the Valeur to zero in a hard way.
Valeur * p_scost
Pointer on .
void coef_i() const
Computes the physical value of *this.
void display_coef(double threshold=1.e-7, int precision=4, ostream &ostr=cout) const
Displays the spectral coefficients and the associated basis functions.
void annule(int l_min, int l_max)
Sets the Mtbl to zero in some domains.
Values and coefficients of a (real-value) function.
void annule(int l)
Sets the Valeur to zero in a given domain.
void set_base_t(int base_t)
Sets the expansion basis for functions in all domains.
int get_etat() const
Returns the logical state.
void set_base(const Base_val &)
Sets the bases for spectral expansions (member base )
void std_base_scal()
Sets the bases for spectral expansions (member base ) to the standard ones for a scalar.
const Mg3d * get_mg() const
Returns the Mg3d on which the Mtbl_cf is defined.
const Mg3d * get_mg() const
Returns the Mg3d on which the this is defined.
int get_etat() const
Gives the logical state.
int get_etat() const
Returns the logical state.
const Mg3d * mg
Multi-grid Mgd3 on which this is defined.
Base_val std_base_scal_odd() const
Returns the standard odd spectral bases for a scalar.
double val_point_jk(int l, double x, int j, int k) const
Computes the value of the field represented by *this at an arbitrary point in , but collocation point...
double val_point(int l, double x, double theta, double phi) const
Computes the value of the field represented by *this at an arbitrary point, by means of the spectral ...
void sauve(FILE *fd, bool save_base=false) const
Saves into a file.
Valeur * p_dsdx
Pointer on .
void sauve(FILE *) const
Save in a file.
void set_etat_nondef()
Sets the logical state to ETATNONDEF (undefined).
void sauve(FILE *) const
Save in a file.
void del_t()
Logical destructor.
void affiche_seuil(ostream &ostr, int precision=4, double threshold=1.e-7) const
Prints only the values greater than a given threshold.
void nouveau()
Memory allocation.
Base_val base
Bases on which the spectral expansion is performed.
void set_base_p(int base_p)
Sets the expansion basis for functions in all domains.
void filtre_tp(int nn, int nz1, int nz2)
Sets the n lasts coefficients in to 0 in the domain nz1 to nz2 when expressed in spherical harmonics...
Mtbl * c
Values of the function at the points of the multi-grid.
void affiche_seuil(ostream &ostr, int type=0, int precision=4, double threshold=1.e-7) const
Prints only the values greater than a given threshold.
void annule(int l_min, int l_max)
Sets the Mtbl_cf to zero in some domains.
Valeur(const Mg3d &mgrid)
Constructor.
int get_nzone() const
Returns the number of domains.
double val_point_jk(int l, double x, int j, int k) const
Computes the value of the field represented by *this at an arbitrary point in , but collocation point...
int fwrite_be(const int *aa, int size, int nb, FILE *fich)
Writes integer(s) into a binary file according to the big endian convention.
void affiche_seuil(ostream &ostr, int precision=4, double threshold=1.e-7) const
Prints only the values greater than a given threshold.
Valeur * p_mult_st
Pointer on .
Valeur * p_d2sdx2
Pointer on .
Valeur * p_mult_cp
Pointer on .
void operator=(const Valeur &a)
Assignement to another Valeur.
double val_point(int l, double x, double theta, double phi) const
Computes the value of the field represented by *this at an arbitrary point, by means of the spectral ...
int fread_be(int *aa, int size, int nb, FILE *fich)
Reads integer(s) from a binary file according to the big endian convention.
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
void sauve(FILE *) const
Save in a file.
void annule_hard()
Sets the Mtbl to zero in a hard way.
Bases of the spectral expansions.
Base_val std_base_scal() const
Returns the standard spectral bases for a scalar.
void annule_hard()
Sets the Mtbl_cf to zero in a hard way.
void set_base_r(int l, int base_r)
Sets the expansion basis for r ( ) functions in a given domain.
Valeur * p_lapang
Pointer on the angular Laplacian.
Valeur * p_mult_ct
Pointer on .
void set_base_p(int base_p)
Sets the expansion basis for functions in all domains.
Valeur * p_sx2
Pointer on .
void set_base_nondef()
Sets the spectral bases to NONDEF.
Valeur * p_d2sdp2
Pointer on .
Coefficients storage for the multi-domain spectral method.
void set_etat_c_qcq()
Sets the logical state to ETATQCQ (ordinary state) for values in the configuration space (Mtbl c )...
Base_val base
Bases of the spectral expansions.
void set_base_t(int base_t)
Sets the expansion basis for functions in all domains.
int etat
Logical state (ETATNONDEF , ETATQCQ or ETATZERO ).
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
void del_deriv()
Logical destructor of the derivatives.
Valeur * p_mult_sp
Pointer on .
Valeur * p_stdsdp
Pointer on .
const Mg3d * get_mg() const
Gives the Mg3d on which the Mtbl is defined.
void set_der_0x0()
Sets the pointers for derivatives to 0x0.
Valeur * p_mult_x
Pointer on .