32 char valeur_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Valeur/valeur.C,v 1.8 2014/10/13 08:53:49 j_novak Exp $" ;
190 #include "utilitaires.h"
230 assert((vc.
c != 0x0) || (vc.
c_cf != 0x0) ) ;
242 if (vc.
c_cf != 0x0) {
255 cout <<
"Etat pas possible" << endl ;
267 if (*
mg != *mg_tmp) {
269 "Valeur::Valeur(const Mg3d& g, FILE* fd): grid not consistent !"
277 if (
etat == ETATQCQ) {
278 c =
new Mtbl(g, fd) ;
376 cout <<
"Unkwon state in Valeur::operator=(const Valeur&) !"
391 assert(mt.
get_etat() != ETATNONDEF) ;
419 cout <<
"Unkwon state in Valeur::operator=(const Mtbl&) !"
434 assert(mt.
get_etat() != ETATNONDEF) ;
436 assert(&mt !=
c_cf) ;
462 cout <<
"Unkwon state in Valeur::operator=(const Mtbl_cf&) !"
481 if (
etat == ETATQCQ) {
496 ostream& operator<<(ostream& o,
const Valeur & vi) {
500 o <<
"*** Valeur in UNDEFINED STATE" ;
505 o <<
"*** Valeur IDENTICALLY ZERO" ;
511 o <<
"*** Valeur (configuration space) :" << endl ;
512 o << *(vi.
c) << endl ;
514 if (vi.
c_cf != 0x0) {
515 o <<
"*** Valeur (coefficients) :" << endl ;
516 o << *(vi.
c_cf) << endl ;
522 cout <<
"operator<<(ostream&, const Valeur&) : unknown state !"
538 if (
etat == ETATNONDEF) {
539 ost <<
" state: UNDEFINED" << endl ;
543 if (
etat == ETATZERO) {
544 ost <<
" state: ZERO" << endl ;
559 double seuil)
const {
560 ost <<
"*** Valeur " << endl ;
566 if (
etat == ETATNONDEF) {
567 ost <<
" state: UNDEFINED" << endl ;
571 if (
etat == ETATZERO) {
572 ost <<
" state: ZERO" << endl ;
579 ost <<
" Coefficients of the Valeur : " << endl ;
586 ost <<
" Values of the Valeur at the collocation points: " << endl ;
594 ost <<
" Coefficients of the Valeur : " << endl ;
596 ost <<
" Values of the Valeur at the collocation points: " << endl ;
602 cout <<
"Unknown type in Valeur::affiche_seuil !" << endl ;
690 if (
etat == ETATZERO) return ;
696 if (
etat == ETATNONDEF) return ;
757 if ( (l_min == 0) && (l_max ==
mg->
get_nzone()-1) ) {
762 assert(
etat != ETATNONDEF ) ;
764 if (
etat == ETATZERO ) {
768 assert(
etat == ETATQCQ ) ;
884 assert(
etat != ETATNONDEF) ;
888 if (
etat == ETATZERO) {
892 assert(
etat == ETATQCQ) ;
902 assert(
etat != ETATNONDEF) ;
906 if (
etat == ETATZERO) {
910 assert(
etat == ETATQCQ) ;
931 if (
etat != ETATZERO) {
932 assert (
etat == ETATQCQ) ;
934 for (
int lz=nz1; lz<=nz2; lz++) {
936 for (
int k=0; k<np+1; k++)
937 for (
int j=0; j<nt; j++) {
938 int l_q, m_q, base_r ;
939 if (nullite_plm(j, nt, k, np,
base) == 1) {
940 donne_lm(nz, lz, j, k,
base, m_q, l_q,base_r) ;
942 for (
int i=0; i<nr; i++)
Bases of the spectral expansions.
void sauve(FILE *) const
Save in a file.
void set_base_t(int base_t)
Sets the expansion basis for functions in all domains.
void set_base_r(int l, int base_r)
Sets the expansion basis for r ( ) functions in a given domain.
void set_base_nondef()
Sets the spectral bases to NONDEF.
void set_base_p(int base_p)
Sets the expansion basis for functions in all domains.
Base_val std_base_scal_odd() const
Returns the standard odd spectral bases for a scalar.
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
int get_nzone() const
Returns the number of domains.
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
void sauve(FILE *fd, bool save_base=false) const
Saves into a file.
Base_val std_base_scal() const
Returns the standard spectral bases for a scalar.
Coefficients storage for the multi-domain spectral method.
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...
Base_val base
Bases of the spectral expansions.
const Mg3d * get_mg() const
Returns the Mg3d on which the Mtbl_cf is defined.
int get_etat() const
Returns the logical state.
void annule(int l_min, int l_max)
Sets the Mtbl_cf to zero in some domains.
void affiche_seuil(ostream &ostr, int precision=4, double threshold=1.e-7) const
Prints only the values greater than a given threshold.
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...
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 annule_hard()
Sets the Mtbl_cf to zero in a hard way.
Tbl & set(int l)
Read/write of the Tbl containing the coefficients in a given domain.
void sauve(FILE *) const
Save in a file.
void annule(int l_min, int l_max)
Sets the Mtbl to zero in some domains.
const Mg3d * get_mg() const
Gives the Mg3d on which the Mtbl is defined.
int get_etat() const
Gives the logical state.
void affiche_seuil(ostream &ostr, int precision=4, double threshold=1.e-7) const
Prints only the values greater than a given threshold.
void annule_hard()
Sets the Mtbl to zero in a hard way.
Values and coefficients of a (real-value) function.
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...
void del_t()
Logical destructor.
void set_etat_cf_qcq()
Sets the logical state to ETATQCQ (ordinary state) for values in the configuration space (Mtbl_cf c_c...
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 set_etat_c_qcq()
Sets the logical state to ETATQCQ (ordinary state) for values in the configuration space (Mtbl c ).
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...
Valeur * p_dsdp
Pointer on .
Valeur * p_mult_sp
Pointer on .
Valeur * p_mult_x
Pointer on .
Valeur * p_scost
Pointer on
int get_etat() const
Returns the logical state.
Valeur * p_sx2
Pointer on .
Valeur * p_d2sdx2
Pointer on .
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
void set_base(const Base_val &)
Sets the bases for spectral expansions (member base )
Valeur * p_dsdx
Pointer on .
Valeur(const Mg3d &mgrid)
Constructor.
void nouveau()
Memory allocation.
void ylm()
Computes the coefficients of *this.
Valeur * p_d2sdt2
Pointer on .
Mtbl * c
Values of the function at the points of the multi-grid
const Mg3d * get_mg() const
Returns the Mg3d on which the this is defined.
Valeur * p_mult_cp
Pointer on .
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)
Sets the Valeur to zero in a given domain.
const Mg3d * mg
Multi-grid Mgd3 on which this is defined.
void operator=(const Valeur &a)
Assignement to another Valeur.
void std_base_scal_odd()
Sets the bases for spectral expansions (member base ) to the standard odd ones for a scalar.
Valeur * p_sx
Pointer on .
void coef_i() const
Computes the physical value of *this.
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.
Mtbl_cf * c_cf
Coefficients of the spectral expansion of the function.
void coef() const
Computes the coeffcients of *this.
Valeur * p_ssint
Pointer on .
void set_der_0x0()
Sets the pointers for derivatives to 0x0.
Valeur * p_stdsdp
Pointer on .
void set_base_r(int l, int base_r)
Sets the expansion basis for r ( ) functions in a given domain.
Valeur * p_dsdt
Pointer on .
Valeur * p_lapang
Pointer on the angular Laplacian.
Base_val base
Bases on which the spectral expansion is performed.
void std_base_scal()
Sets the bases for spectral expansions (member base ) to the standard ones for a scalar.
void annule_hard()
Sets the Valeur to zero in a hard way.
Valeur * p_mult_ct
Pointer on .
int etat
Logical state (ETATNONDEF , ETATQCQ or ETATZERO ).
void set_base_t(int base_t)
Sets the expansion basis for functions in all domains.
void set_base_p(int base_p)
Sets the expansion basis for functions in all domains.
void set_etat_nondef()
Sets the logical state to ETATNONDEF (undefined).
Valeur * p_d2sdp2
Pointer on .
Valeur * p_mult_st
Pointer on .
void del_deriv()
Logical destructor of the derivatives.
void sauve(FILE *) const
Save in a file.
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 fwrite_be(const int *aa, int size, int nb, FILE *fich)
Writes integer(s) into a binary file according to the big endian convention.