121 #include "type_parite.h" 122 #include "utilitaires.h" 142 if (c1.
c == 0x0) c1.
fait() ;
168 assert(mtc.
get_etat() != ETATNONDEF) ;
172 if (mtc.
etat == ETATQCQ) {
174 for (
int i=0 ; i<
nzone ; i++) {
179 assert(mtc.
etat == ETATZERO) ;
189 if (*
mg != *mg_tmp) {
190 cout <<
"Mtbl::Mtbl(Mg3d & , FILE*): grid not consistent !" << endl ;
201 if (
etat == ETATQCQ) {
203 for (
int i=0 ; i<
nzone ; i++) {
208 fread_be(&dzpuis_vieux,
sizeof(
int), 1, fd) ;
216 if (
etat == ETATQCQ) {
217 for (
int i=0 ; i<
nzone ; i++) {
221 int dzpuis_vieux = 0 ;
222 fwrite_be(&dzpuis_vieux,
sizeof(
int), 1, fd) ;
230 assert (
mg == mtc.
mg) ;
231 assert(mtc.
get_etat() != ETATNONDEF) ;
240 for (
int i=0 ; i<
nzone ; i++) {
248 if (x ==
double(0)) {
253 for (
int i=0 ; i<
nzone ; i++) {
267 for (
int i=0 ; i<
nzone ; i++) {
282 for (
int l=0 ; l<
nzone ; l++) {
291 if (
etat == ETATZERO) return ;
297 if (
etat == ETATNONDEF) return ;
303 if (
etat == ETATQCQ) return ;
306 assert( (
etat == ETATZERO) || (
etat == ETATNONDEF) ) ;
309 for (
int i=0 ; i<
nzone ; i++) {
318 for (
int i=0 ; i<
nzone ; i++) {
323 for (
int i=0 ; i<
nzone ; i++) {
334 assert( (l_min >= 0) && (l_min <
nzone) ) ;
335 assert( (l_max >= 0) && (l_max <
nzone) ) ;
338 if ( (l_min == 0) && (l_max ==
nzone-1) ) {
343 assert(
etat != ETATNONDEF ) ;
345 if (
etat == ETATZERO ) {
349 assert(
etat == ETATQCQ ) ;
350 for (
int l=l_min; l<=l_max; l++) {
368 ostream& operator<<(ostream& o,
const Mtbl& mt) {
370 assert(mt.
get_etat() != ETATNONDEF) ;
374 o.setf(ios::showpoint);
375 o <<
"*** Mtbl " << nzone <<
" domains" << endl ;
378 o <<
"Logically NULL" << endl ;
381 for (
int l=0 ; l<nzone ; l++) {
382 o <<
" Domain #" << l << endl ;
397 ost <<
"*** Mtbl " <<
nzone <<
" domains" << endl ;
402 if (
etat == ETATNONDEF) {
403 ost <<
" state: UNDEFINED" << endl ;
407 if (
etat == ETATZERO) {
408 ost <<
" state: ZERO" << endl ;
415 for (
int l=0; l <
nzone; l++) {
427 const char* f = __FILE__ ;
432 const char* f = __FILE__ ;
437 const char* f = __FILE__ ;
442 const char* f = __FILE__ ;
const Grille3d * get_grille3d(int l) const
Returns a pointer on the 3D mono-grid for domain no. l.
void del_t()
Logical destructor: dellocates the memory occupied by the Tbl array t .
Mtbl * c
The coordinate values at each grid point.
void annule(int l_min, int l_max)
Sets the Mtbl to zero in some domains.
void operator*=(const Mtbl &)
*= Mtbl
int get_etat() const
Gives the logical state.
void operator+=(const Mtbl &)
+= Mtbl
int get_nzone() const
Gives the number of zones (domains)
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
void sauve(FILE *fd, bool save_base=false) const
Saves into a file.
const Mg3d * mg
Pointer on the multi-grid Mgd3 on which this is defined.
void affiche_seuil(ostream &ostr, int precision=4, double threshold=1.e-7) const
Prints only the values greater than a given threshold.
Mtbl(const Mg3d &mgrid)
Constructor.
int etat
Logical state (ETATNONDEF , ETATQCQ or ETATZERO ).
int nzone
Number of domains (zones)
int get_nzone() const
Returns the number of domains.
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.
Active physical coordinates and mapping derivatives.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
void fait() const
Computes, at each point of the grid, the value of the coordinate or mapping derivative represented by...
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
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.
void sauve(FILE *) const
Save in a file.
void annule_hard()
Sets the Mtbl to zero in a hard way.
void operator/=(const Mtbl &)
/= Mtbl
void c_est_pas_fait(const char *)
Helpful function to say something is not implemented yet.
void sauve(FILE *) const
Save in a file.
void operator-=(const Mtbl &)
-= Mtbl
Tbl ** t
Array (size nzone ) of pointers on the Tbl 's.
const Mg3d * get_mg() const
Gives the Mg3d on which the Mtbl is defined.
void annule_hard()
Sets the Tbl to zero in a hard way.
void set_etat_nondef()
Sets the logical state to ETATNONDEF (undefined).
void operator=(const Mtbl &)
Assignement to another Mtbl.