|
LORENE
|
Finite-difference array intended to store field values. More...
#include <tbl_val.h>
Public Member Functions | |
| Tbl_val (const Grille_val *) | |
| Constructor from a 3D grid. | |
| Tbl_val (const Grille_val *, FILE *) | |
Constructor from a file (see sauve(FILE*) ). | |
| Tbl_val (const Tbl_val &) | |
| Copy constructor. | |
| ~Tbl_val () | |
| Destructor. | |
| void | operator= (const Tbl_val &) |
Assignment to another Tbl_val. | |
| void | operator= (double) |
Assignment to a double. | |
| void | operator= (int) |
Assignment 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 | append_array (double *t_in) |
Appends an array of doubles as the main array t of this (DO NOT use it, unless you REALLY know how it works). | |
| void | annule_hard () |
Sets the Tbl_val to zero in a hard way. | |
| double & | set (int i) |
Read/write of a particular element (index i ) (1D case). | |
| double & | set_zri (int i) |
Read/write of a particular element on the interface (index i ) (1D case). | |
| double | operator() (int i) const |
Read-only of a particular element (index i ) (1D case). | |
| double | get_zri (int i) const |
Read-only of a particular element on the interface (index i ) (1D case). | |
| double & | set (int j, int i) |
Read/write of a particular element (index (j,i) ) (2D case). | |
| double & | set_xti (int j, int i) |
Read/write of a particular element on the x (or ![]() (j,i) ) (2D case). | |
| double & | set_zri (int j, int i) |
Read/write of a particular element on the z (or r) interface (index (j,i) ) (2D case). | |
| double | operator() (int j, int i) const |
Read-only of a particular element (index (j,i) ) (2D case). | |
| double | get_xti (int j, int i) const |
Read-only of a particular element on the x (or ![]() (j,i) ) (2D case). | |
| double | get_zri (int j, int i) const |
Read-only of a particular element on the z (or r) interface (index (j,i) ) (2D case). | |
| double & | set (int k, int j, int i) |
Read/write of a particular element (index (k,j,i) ) (3D case). | |
| double & | set_ypi (int k, int j, int i) |
Read/write of a particular element on the y (or ![]() (k,j,i) ) (3D case). | |
| double & | set_xti (int k, int j, int i) |
Read/write of a particular element on the x (or ![]() (k,j,i) ) (3D case). | |
| double & | set_zri (int k, int j, int i) |
Read/write of a particular element on the z (or r) interface (index (k,j,i) ) (3D case). | |
| double | operator() (int k, int j, int i) const |
Read-only of a particular element (index (k,j,i) ) (3D case). | |
| double | get_ypi (int k, int j, int i) const |
Read-only of a particular element on the y (or ![]() (k,j,i) ) (3D case). | |
| double | get_xti (int k, int j, int i) const |
Read-only of a particular element on the x (or ![]() (k,j,i) ) (3D case). | |
| double | get_zri (int k, int j, int i) const |
Read-only of a particular element on the z (or r) interface (index (k,j,i) ) (3D case). | |
| int | get_etat () const |
| Gives the logical state. | |
| int | get_taille () const |
| Gives the size of the node array (including the hidden cells). | |
| int | get_taille_i (int i) const |
| Gives the size of the interface arrays (including the hidden cells). | |
| int | get_ndim () const |
Gives the number of dimensions (ie dim->ndim ). | |
| int | get_dim (int i) const |
Gives the i th dimension (ie dim->dim[i] , without hidden cells). | |
| const Grille_val * | get_grille () const |
Returns a pointer on the grid on which the Tbl_val is defined. | |
| 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 Tbl_val &) |
Addition of a Tbl_val to this. | |
| void | operator+= (double) |
Addition of a double to this. | |
| void | operator-= (const Tbl_val &) |
Subtraction of a Tbl_val to this. | |
| void | operator-= (double) |
Subtraction of a double to this. | |
| void | operator*= (const Tbl_val &) |
Multiplication of this by a Tbl_val. | |
| void | operator*= (double) |
Multiplication of this by a double. | |
| void | operator/= (const Tbl_val &) |
Division of this by a Tbl_val. | |
| void | operator/= (double) |
Division of this by a double. | |
| Scalar | to_spectral (const Map &map, const int lmax, const int lmin=0, int type_inter=2) const |
Interpolation from a Tbl_val to a Scalar . | |
| void | from_spectral (const Scalar &meudon, int lmax, int lmin=0, bool interfr=false, bool interft=false) |
Interpolation from a Scalar to a Tbl_val (spectral summation). | |
| void | smooth_atmosphere (double atmosphere_thr) |
Public Attributes | |
| double * | t |
The array of double at the nodes. | |
| double * | tzri |
| The array at z (or r) interfaces. | |
| double * | txti |
The array at x (or ![]() | |
| double * | typi |
The array at y (or ![]() | |
Private Member Functions | |
| void | del_t () |
Logical destructor: dellocates the memory occupied by the array t and sets the logical state to ETATNONDEF. | |
Private Attributes | |
| int | etat |
logical state (ETATNONDEF , ETATQCQ or ETATZERO ). | |
| const Dim_tbl * | dim |
The Dim_tbl giving the dimensions and number of points (without the hidden cells). | |
| const Grille_val * | gval |
The Grille_val (cartesian or spherical) on which the array is defined. | |
Friends | |
| ostream & | operator<< (ostream &o, const Tbl_val &t) |
| Display. | |
Finite-difference array intended to store field values.
()
Class defined on a cartesian (Gval_cart ) or spherical (Gval_spher ) grid, in order to represent Godunov-type arrays in 1,2 or 3D.
|
explicit |
|
explicit |
Constructor from a file (see sauve(FILE*) ).
Definition at line 122 of file tbl_val.C.
References dim, etat, Lorene::fread_be(), get_ndim(), get_taille(), get_taille_i(), gval, t, Tbl_val(), txti, typi, and tzri.
| Lorene::Tbl_val::Tbl_val | ( | const Tbl_val & | tc | ) |
| Lorene::Tbl_val::~Tbl_val | ( | ) |
| void Lorene::Tbl_val::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 429 of file tbl_val.C.
References etat, get_dim(), get_ndim(), get_taille(), and gval.
| void Lorene::Tbl_val::annule_hard | ( | ) |
Sets the Tbl_val 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 double array t , and fills it with zeros. NB: this function must be used for debugging purposes only. For other operations, the function set_etat_zero() must be perferred.
Definition at line 311 of file tbl_val.C.
References etat, get_ndim(), get_taille(), get_taille_i(), t, txti, typi, and tzri.
| void Lorene::Tbl_val::append_array | ( | double * | t_in | ) |
|
private |
| void Lorene::Tbl_val::from_spectral | ( | const Scalar & | meudon, |
| int | lmax, | ||
| int | lmin = 0, | ||
| bool | interfr = false, | ||
| bool | interft = false ) |
Interpolation from a Scalar to a Tbl_val (spectral summation).
The Scalar is considered only in zones [lmin,lmax[.
| meudon | [input] The Scalar from which the interpolation is done |
| lmax | [input] index of the outer zone +1 |
| lmin | [input] index of the inner zone |
Definition at line 306 of file tbl_val_interp.C.
References annule_hard(), Lorene::Scalar::get_etat(), Lorene::Tensor::get_mp(), get_taille(), gval, Lorene::Map(), set_etat_qcq(), Lorene::Gval_spher::somme_spectrale2ri(), Lorene::Gval_spher::somme_spectrale2ti(), t, txti, and tzri.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| void Lorene::Tbl_val::operator*= | ( | const Tbl_val & | ti | ) |
Multiplication of this by a Tbl_val.
Definition at line 791 of file arithm_tbl_val.C.
References etat, get_etat(), get_taille(), get_taille_i(), gval, set_etat_zero(), t, Tbl_val(), txti, typi, and tzri.
| void Lorene::Tbl_val::operator*= | ( | double | x | ) |
Multiplication of this by a double.
Definition at line 824 of file arithm_tbl_val.C.
References etat, get_taille(), get_taille_i(), set_etat_zero(), t, txti, typi, tzri, and Lorene::x.
| void Lorene::Tbl_val::operator+= | ( | const Tbl_val & | ti | ) |
Addition of a Tbl_val to this.
Definition at line 577 of file arithm_tbl_val.C.
References etat, get_etat(), get_taille(), get_taille_i(), gval, set_etat_qcq(), t, Tbl_val(), txti, typi, and tzri.
| void Lorene::Tbl_val::operator+= | ( | double | x | ) |
Addition of a double to this.
Definition at line 631 of file arithm_tbl_val.C.
References etat, get_taille(), get_taille_i(), set_etat_qcq(), t, txti, typi, tzri, and Lorene::x.
| void Lorene::Tbl_val::operator-= | ( | const Tbl_val & | ti | ) |
Subtraction of a Tbl_val to this.
Definition at line 683 of file arithm_tbl_val.C.
References etat, get_etat(), get_taille(), get_taille_i(), gval, set_etat_qcq(), t, Tbl_val(), txti, typi, and tzri.
| void Lorene::Tbl_val::operator-= | ( | double | x | ) |
Subtraction of a double to this.
Definition at line 738 of file arithm_tbl_val.C.
References etat, get_taille(), get_taille_i(), set_etat_qcq(), t, txti, typi, tzri, and Lorene::x.
| void Lorene::Tbl_val::operator/= | ( | const Tbl_val & | ti | ) |
Division of this by a Tbl_val.
Definition at line 855 of file arithm_tbl_val.C.
References etat, get_etat(), get_taille(), get_taille_i(), gval, t, Tbl_val(), txti, typi, and tzri.
| void Lorene::Tbl_val::operator/= | ( | double | x | ) |
Division of this by a double.
Definition at line 890 of file arithm_tbl_val.C.
References etat, get_taille(), get_taille_i(), t, txti, typi, tzri, and Lorene::x.
| void Lorene::Tbl_val::operator= | ( | const Tbl_val & | tx | ) |
Assignment to another Tbl_val.
Definition at line 163 of file tbl_val.C.
References etat, get_etat(), get_ndim(), get_taille(), get_taille_i(), gval, set_etat_qcq(), set_etat_zero(), t, Tbl_val(), txti, typi, and tzri.
| void Lorene::Tbl_val::operator= | ( | double | a | ) |
Assignment to a double.
Definition at line 196 of file tbl_val.C.
References get_taille(), get_taille_i(), set_etat_qcq(), set_etat_zero(), t, txti, typi, and tzri.
| void Lorene::Tbl_val::operator= | ( | int | m | ) |
Assignment to a int.
Definition at line 219 of file tbl_val.C.
References get_taille(), get_taille_i(), set_etat_qcq(), set_etat_zero(), t, txti, typi, and tzri.
| void Lorene::Tbl_val::sauve | ( | FILE * | fd | ) | const |
Save in a file.
Definition at line 249 of file tbl_val.C.
References etat, Lorene::fwrite_be(), get_ndim(), get_taille(), get_taille_i(), t, txti, typi, and tzri.
|
inline |
|
inline |
|
inline |
| void Lorene::Tbl_val::set_etat_nondef | ( | ) |
| void Lorene::Tbl_val::set_etat_qcq | ( | ) |
Sets the logical state to ETATQCQ (ordinary state).
If the state (member etat ) is already ETATQCQ , this function does nothing. Otherwise, it performs the memory allocation for the double array t .
Definition at line 294 of file tbl_val.C.
References etat, get_ndim(), get_taille(), get_taille_i(), t, txti, typi, and tzri.
| void Lorene::Tbl_val::set_etat_zero | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| void Lorene::Tbl_val::smooth_atmosphere | ( | double | atmosphere_thr | ) |
Definition at line 57 of file tbl_val_smooth.C.
| Scalar Lorene::Tbl_val::to_spectral | ( | const Map & | map, |
| const int | lmax, | ||
| const int | lmin = 0, | ||
| int | type_inter = 2 ) const |
Interpolation from a Tbl_val to a Scalar .
The Scalar is evaluated only in zones [lmin, lmax[.
| map | [input] The Mapping to which the Tbl_val is interpolated. The symetries of both grids must be the same (see Mg3d and Grille_val documentation), and the spectral grid (between lmin and lmax-1) must be included in the Godunov one. The number of points in ![]() ![]() ![]() ![]() |
| lmax | [input] index of the outer zone +1 |
| lmin | [input] index of the inner zone |
| type_inter | [input] type of interpolation: \ 0 -> uses the INSMTS routine of second derivative minimization\ 1 -> linear interpolation\ 2 -> parabolic interpolation\ 3 -> spline interpolation (not implemented yet)\ |
Definition at line 94 of file tbl_val_interp.C.
References Lorene::Scalar::allocate_all(), Lorene::Scalar::annule(), dim, etat, Lorene::Mg3d::get_np(), Lorene::Mg3d::get_nr(), Lorene::Mg3d::get_nt(), Lorene::Mg3d::get_nzone(), gval, Lorene::Map(), Lorene::phi, Lorene::Tbl::set(), Lorene::Tbl::set_etat_qcq(), Lorene::Scalar::set_grid_point(), Lorene::Tbl::t, t, and Lorene::tet.
|
friend |
|
private |
|
private |
|
private |
The Grille_val (cartesian or spherical) on which the array is defined.
| double* Lorene::Tbl_val::t |
| double* Lorene::Tbl_val::txti |
| double* Lorene::Tbl_val::typi |
| double* Lorene::Tbl_val::tzri |