121 #include "utilitaires.h" 158 assert(mtc.
get_etat() != ETATNONDEF) ;
162 if (mtc.
etat == ETATQCQ) {
164 for (
int i=0 ; i<
nzone ; i++) {
169 assert(mtc.
etat == ETATZERO) ;
181 if (*
mg != *mg_tmp) {
182 cout <<
"Mtbl_cf::Mtbl_cf(const Mg3d& , FILE*): grid not consistent !" 195 if (
etat == ETATQCQ) {
197 for (
int i=0 ; i<
nzone ; i++) {
202 fread_be(&dzpuis_vieux,
sizeof(
int), 1, fd) ;
212 if (
etat == ETATQCQ) {
213 for (
int i=0 ; i<
nzone ; i++) {
217 int dzpuis_vieux = 0 ;
218 fwrite_be(&dzpuis_vieux,
sizeof(
int), 1, fd) ;
226 assert (
mg == mtc.
mg) ;
227 assert(mtc.
get_etat() != ETATNONDEF) ;
239 for (
int i=0 ; i<
nzone ; i++) {
247 if ( x ==
double(0) ) {
252 for (
int i=0 ; i<
nzone ; i++) {
266 for (
int i=0 ; i<
nzone ; i++) {
282 for (
int l=0 ; l<
nzone ; l++) {
292 if (
etat == ETATZERO) return ;
298 if (
etat == ETATNONDEF) return ;
304 if (
etat == ETATQCQ) return ;
306 for (
int i=0 ; i<
nzone ; i++) {
310 t[i] =
new Tbl(nbp+2, nbt, nbr) ;
318 for (
int i=0 ; i<
nzone ; i++) {
322 t[i] =
new Tbl(nbp+2, nbt, nbr) ;
326 for (
int i=0 ; i<
nzone ; i++) {
337 assert( (l_min >= 0) && (l_min <
nzone) ) ;
338 assert( (l_max >= 0) && (l_max <
nzone) ) ;
341 if ( (l_min == 0) && (l_max ==
nzone-1) ) {
346 assert(
etat != ETATNONDEF ) ;
348 if (
etat == ETATZERO ) {
352 assert(
etat == ETATQCQ ) ;
353 for (
int l=l_min; l<=l_max; l++) {
369 ostream& operator<<(ostream& o,
const Mtbl_cf& mt) {
371 assert(mt.
get_etat() != ETATNONDEF) ;
375 o.setf(ios::showpoint);
376 o <<
"*** MTBL_CF " << nzone <<
" domains" << endl ;
378 o << mt.
base << endl ;
380 o <<
"Values of the coefficients : " << endl ;
382 o <<
"Logically NUL" << endl ;
385 for (
int l=0 ; l<nzone ; l++) {
386 o <<
" Domain #" << l << endl ;
401 ost <<
"*** Mtbl_cf " <<
nzone <<
" domains" << endl ;
402 ost <<
base << endl ;
403 ost <<
"Values of the coefficients : " << endl ;
408 if (
etat == ETATNONDEF) {
409 ost <<
" state: UNDEFINED" << endl ;
413 if (
etat == ETATZERO) {
414 ost <<
" state: ZERO" << endl ;
422 for (
int l=0; l <
nzone; l++) {
433 const char* f = __FILE__ ;
438 const char* f = __FILE__ ;
void operator/=(double)
/= double
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
const Mg3d * mg
Pointer on the multi-grid Mgd3 on which this is defined.
int get_etat() const
Returns the logical state.
void operator*=(double)
*= double
void set_etat_nondef()
Sets the logical state to ETATNONDEF (undefined).
int etat
Logical state (ETATNONDEF , ETATQCQ or ETATZERO ).
Mtbl_cf(const Mg3d &mgrid, const Base_val &basis)
Constructor.
void sauve(FILE *fd, bool save_base=false) const
Saves into a file.
void sauve(FILE *) const
Save in a file.
int get_nzone() const
Returns the number of domains.
void sauve(FILE *) const
Save in a file.
void annule(int l_min, int l_max)
Sets the Mtbl_cf to zero in some domains.
int get_nzone() const
Returns the number of domains.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
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.
int get_nzone() const
Returns the number of zones (domains)
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
int nzone
Number of domains (zones)
void affiche_seuil(ostream &ostr, int precision=4, double threshold=1.e-7) const
Prints only the values greater than a given threshold.
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 set_etat_zero()
Sets the logical state to ETATZERO (zero).
void del_t()
Logical destructor: dellocates the memory occupied by the Tbl array t .
Bases of the spectral expansions.
void annule_hard()
Sets the Mtbl_cf to zero in a hard way.
void operator=(const Mtbl_cf &)
Assignement to another Mtbl_cf.
void c_est_pas_fait(const char *)
Helpful function to say something is not implemented yet.
Coefficients storage for the multi-domain spectral method.
void sauve(FILE *) const
Save in a file.
Base_val base
Bases of the spectral expansions.
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
void annule_hard()
Sets the Tbl to zero in a hard way.
Tbl ** t
Array (size nzone ) of pointers on the Tbl 's which contain the spectral coefficients in each domain...