Multi-domain array. More...
#include <mtbl.h>
Public Member Functions | |
| Mtbl (const Mg3d &mgrid) | |
| Constructor. | |
| Mtbl (const Mg3d *p_mgrid) | |
| Constructor. | |
| Mtbl (const Mg3d &, FILE *) | |
Constructor from a file (see sauve(FILE*)). | |
| Mtbl (const Coord &c) | |
| Constructor from a Coord. | |
| Mtbl (const Mtbl &a) | |
| Copy constructor. | |
| ~Mtbl () | |
| Destructor. | |
| void | operator= (const Mtbl &) |
Assignement to another Mtbl. | |
| void | operator= (double) |
Assignement to a double. | |
| void | operator= (int) |
Assignement to a int. | |
| void | set_etat_nondef () |
Sets the logical state to ETATNONDEF (undefined). | |
| void | set_etat_zero () |
Sets the logical state to ETATZERO (zero). | |
| void | set_etat_qcq () |
Sets the logical state to ETATQCQ (ordinary state). | |
| void | annule_hard () |
Sets the Mtbl to zero in a hard way. | |
| void | annule (int l_min, int l_max) |
Sets the Mtbl to zero in some domains. | |
| Tbl & | set (int l) |
Read/write of the Tbl in a given domain. | |
| const Tbl & | operator() (int l) const |
Read-only of the Tbl in a given domain. | |
| double & | set (int l, int k, int j, int i) |
| Read/write of a particular element. | |
| double | operator() (int l, int k, int j, int i) const |
| Read-only of a particular element. | |
| const Mg3d * | get_mg () const |
Gives the Mg3d on which the Mtbl is defined. | |
| int | get_etat () const |
| Gives the logical state. | |
| int | get_nzone () const |
| Gives the number of zones (domains). | |
| void | sauve (FILE *) const |
| Save in a file. | |
| void | affiche_seuil (ostream &ostr, int precision=4, double threshold=1.e-7) const |
| Prints only the values greater than a given threshold. | |
| void | operator+= (const Mtbl &) |
| += Mtbl | |
| void | operator+= (double) |
| += double | |
| void | operator-= (const Mtbl &) |
| -= Mtbl | |
| void | operator-= (double) |
| -= double | |
| void | operator*= (const Mtbl &) |
| *= Mtbl | |
| void | operator*= (double) |
| *= double | |
| void | operator/= (const Mtbl &) |
| /= Mtbl | |
| void | operator/= (double) |
| /= double | |
Public Attributes | |
| Tbl ** | t |
Array (size nzone ) of pointers on the Tbl 's. | |
Private Member Functions | |
| void | del_t () |
Logical destructor: dellocates the memory occupied by the Tbl array t . | |
Private Attributes | |
| const Mg3d * | mg |
Pointer on the multi-grid Mgd3 on which this is defined. | |
| int | nzone |
| Number of domains (zones). | |
| int | etat |
Logical state (ETATNONDEF , ETATQCQ or ETATZERO ). | |
Friends | |
| ostream & | operator<< (ostream &, const Mtbl &) |
| Display. | |
Multi-domain array.
()
This class is essentially an array of Tbl . It is intended to be used in conjunction with the class Mtbl_cf . A Mtbl is initialy created with a logical state NONDEF . Arithmetic operations are provided with the usual meaning (see below).
Definition at line 114 of file mtbl.h.
| Mtbl::Mtbl | ( | const Mg3d & | mgrid | ) | [explicit] |
| Mtbl::Mtbl | ( | const Mg3d * | p_mgrid | ) | [explicit] |
| Mtbl::Mtbl | ( | const Mg3d & | g, | |
| FILE * | fd | |||
| ) |
Constructor from a file (see sauve(FILE*)).
Definition at line 178 of file mtbl.C.
References etat, fread_be(), Mg3d::get_nzone(), mg, nzone, and t.
| Mtbl::Mtbl | ( | const Coord & | c | ) |
| Mtbl::Mtbl | ( | const Mtbl & | a | ) |
Copy constructor.
Definition at line 158 of file mtbl.C.
References etat, get_etat(), nzone, set_etat_qcq(), and t.
| void Mtbl::affiche_seuil | ( | ostream & | ostr, | |
| int | precision = 4, |
|||
| double | threshold = 1.e-7 | |||
| ) | const |
Prints only the values greater than a given threshold.
| ostr | [input] Output stream used for the printing | |
| precision | [input] Number of printed digits (default: 4) | |
| threshold | [input] Value above which an array element is printed (default: 1.e-7) |
Definition at line 389 of file mtbl.C.
References Tbl::affiche_seuil(), etat, and t.
| void Mtbl::annule | ( | int | l_min, | |
| int | l_max | |||
| ) |
Sets the Mtbl to zero in some domains.
| l_min | [input] The Mtbl will be set (logically) to zero in the domains whose indices are in the range [l_min,l_max] . | |
| l_max | [input] see the comments for l_min . |
Note that annule(0,nzone-1) is equivalent to set_etat_zero() .
Definition at line 325 of file mtbl.C.
References etat, nzone, Tbl::set_etat_zero(), set_etat_zero(), and t.
| void Mtbl::annule_hard | ( | ) |
Sets the Mtbl to zero in a hard way.
1/ Sets the logical state to ETATQCQ , i.e. to an ordinary state. 2/ Allocates the memory of the Tbl array t , and fills it with zeros. NB: this function must be used for debugging purposes only. For other operations, the functions set_etat_zero() or annule(int, int) must be perferred.
Definition at line 308 of file mtbl.C.
References Tbl::annule_hard(), etat, Mg3d::get_grille3d(), mg, nzone, and t.
| void Mtbl::del_t | ( | ) | [private] |
| int Mtbl::get_etat | ( | ) | const [inline] |
| const Mg3d* Mtbl::get_mg | ( | ) | const [inline] |
| int Mtbl::get_nzone | ( | ) | const [inline] |
| double Mtbl::operator() | ( | int | l, | |
| int | k, | |||
| int | j, | |||
| int | i | |||
| ) | const [inline] |
| const Tbl& Mtbl::operator() | ( | int | l | ) | const [inline] |
| void Mtbl::operator*= | ( | double | ) |
| void Mtbl::operator*= | ( | const Mtbl & | mi | ) |
*= Mtbl
Definition at line 553 of file mtbl_arithm.C.
References etat, get_etat(), get_mg(), mg, nzone, set_etat_zero(), and t.
| void Mtbl::operator+= | ( | double | ) |
| void Mtbl::operator+= | ( | const Mtbl & | mi | ) |
+= Mtbl
Definition at line 509 of file mtbl_arithm.C.
References annule_hard(), etat, get_etat(), get_mg(), mg, nzone, and t.
| void Mtbl::operator-= | ( | double | ) |
| void Mtbl::operator-= | ( | const Mtbl & | mi | ) |
-= Mtbl
Definition at line 531 of file mtbl_arithm.C.
References annule_hard(), etat, get_etat(), get_mg(), mg, nzone, and t.
| void Mtbl::operator/= | ( | double | ) |
| void Mtbl::operator= | ( | int | m | ) |
Assignement to a int.
Definition at line 253 of file mtbl.C.
References nzone, set_etat_qcq(), set_etat_zero(), and t.
| void Mtbl::operator= | ( | double | x | ) |
Assignement to a double.
Definition at line 239 of file mtbl.C.
References nzone, set_etat_qcq(), set_etat_zero(), and t.
| void Mtbl::operator= | ( | const Mtbl & | mtc | ) |
Assignement to another Mtbl.
Definition at line 220 of file mtbl.C.
References get_etat(), mg, nzone, set_etat_qcq(), set_etat_zero(), and t.
| void Mtbl::sauve | ( | FILE * | fd | ) | const |
Save in a file.
Definition at line 205 of file mtbl.C.
References etat, fwrite_be(), mg, nzone, Tbl::sauve(), Mg3d::sauve(), and t.
| double& Mtbl::set | ( | int | l, | |
| int | k, | |||
| int | j, | |||
| int | i | |||
| ) | [inline] |
| Tbl& Mtbl::set | ( | int | l | ) | [inline] |
| void Mtbl::set_etat_nondef | ( | ) |
| void Mtbl::set_etat_qcq | ( | ) |
| void Mtbl::set_etat_zero | ( | ) |
| ostream& operator<< | ( | ostream & | , | |
| const Mtbl & | ||||
| ) | [friend] |
Display.
int Mtbl::etat [private] |
int Mtbl::nzone [private] |
1.6.1