Tbl_val Class Reference
[Grid wedding]

Finite-difference array intended to store field values. More...

#include <tbl_val.h>

List of all members.

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 $\theta$) interface (index (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 $\theta$) interface (index (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 $\phi$) interface (index (k,j,i) ) (3D case).
double & set_xti (int k, int j, int i)
 Read/write of a particular element on the x (or $\theta$) interface (index (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 $\phi$) interface (index (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 $\theta$) interface (index (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_valget_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 $\theta$) interfaces.
double * typi
 The array at y (or $\phi$) interfaces.

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_tbldim
 The Dim_tbl giving the dimensions and number of points (without the hidden cells).
const Grille_valgval
 The Grille_val (cartesian or spherical) on which the array is defined.

Friends

ostream & operator<< (ostream &, const Tbl_val &)
 Display.

Detailed Description

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.

Definition at line 93 of file tbl_val.h.


Constructor & Destructor Documentation

Tbl_val::Tbl_val ( const Grille_val g  )  [explicit]

Constructor from a 3D grid.

Definition at line 79 of file tbl_val.C.

Tbl_val::Tbl_val ( const Grille_val g,
FILE *  fd 
) [explicit]

Constructor from a file (see sauve(FILE*) ).

Definition at line 118 of file tbl_val.C.

References etat, fread_be(), get_ndim(), get_taille(), get_taille_i(), t, txti, typi, and tzri.

Tbl_val::Tbl_val ( const Tbl_val tc  ) 

Copy constructor.

Definition at line 83 of file tbl_val.C.

References etat, get_ndim(), get_taille(), get_taille_i(), t, txti, typi, and tzri.

Tbl_val::~Tbl_val (  ) 

Destructor.

Definition at line 150 of file tbl_val.C.

References del_t().


Member Function Documentation

void Tbl_val::affiche_seuil ( ostream &  ostr,
int  precision = 4,
double  threshold = 1.e-7 
) const

Prints only the values greater than a given threshold.

Parameters:
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 425 of file tbl_val.C.

References etat, get_dim(), Grille_val::get_fantome(), get_ndim(), get_taille(), and gval.

void 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 307 of file tbl_val.C.

References etat, get_ndim(), get_taille(), get_taille_i(), t, txti, typi, and tzri.

void Tbl_val::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).

Definition at line 332 of file tbl_val.C.

References del_t(), etat, and t.

void Tbl_val::del_t (  )  [private]

Logical destructor: dellocates the memory occupied by the array t and sets the logical state to ETATNONDEF.

Definition at line 263 of file tbl_val.C.

References etat, t, txti, typi, and tzri.

void 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[.

Parameters:
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 302 of file tbl_val_interp.C.

References annule_hard(), Grille_val::contenue_dans(), Scalar::get_etat(), Tensor::get_mp(), Grille_val::get_ndim(), get_taille(), gval, set_etat_qcq(), Grille_val::somme_spectrale1(), Grille_val::somme_spectrale2(), Gval_spher::somme_spectrale2ri(), Gval_spher::somme_spectrale2ti(), Grille_val::somme_spectrale3(), t, txti, and tzri.

int Tbl_val::get_dim ( int  i  )  const [inline]

Gives the i th dimension (ie dim->dim[i] , without hidden cells).

Definition at line 481 of file tbl_val.h.

References Dim_tbl::dim, and dim.

int Tbl_val::get_etat (  )  const [inline]

Gives the logical state.

Definition at line 455 of file tbl_val.h.

References etat.

const Grille_val* Tbl_val::get_grille (  )  const [inline]

Returns a pointer on the grid on which the Tbl_val is defined.

Definition at line 487 of file tbl_val.h.

References gval.

int Tbl_val::get_ndim (  )  const [inline]

Gives the number of dimensions (ie dim->ndim ).

Definition at line 478 of file tbl_val.h.

References dim, and Dim_tbl::ndim.

int Tbl_val::get_taille (  )  const [inline]

Gives the size of the node array (including the hidden cells).

Definition at line 458 of file tbl_val.h.

References Dim_tbl::dim, dim, Grille_val::get_fantome(), gval, and Dim_tbl::ndim.

int Tbl_val::get_taille_i ( int  i  )  const [inline]

Gives the size of the interface arrays (including the hidden cells).

Definition at line 465 of file tbl_val.h.

References Dim_tbl::dim, dim, Grille_val::get_fantome(), gval, and Dim_tbl::ndim.

double Tbl_val::get_xti ( int  k,
int  j,
int  i 
) const [inline]

Read-only of a particular element on the x (or $\theta$) interface (index (k,j,i) ) (3D case).

Definition at line 418 of file tbl_val.h.

References Dim_tbl::dim, dim, etat, Grille_val::get_fantome(), gval, Dim_tbl::ndim, and txti.

double Tbl_val::get_xti ( int  j,
int  i 
) const [inline]

Read-only of a particular element on the x (or $\theta$) interface (index (j,i) ) (2D case).

Definition at line 292 of file tbl_val.h.

References Dim_tbl::dim, dim, etat, Grille_val::get_fantome(), gval, Dim_tbl::ndim, and txti.

double Tbl_val::get_ypi ( int  k,
int  j,
int  i 
) const [inline]

Read-only of a particular element on the y (or $\phi$) interface (index (k,j,i) ) (3D case).

Definition at line 399 of file tbl_val.h.

References Dim_tbl::dim, dim, etat, Grille_val::get_fantome(), gval, Dim_tbl::ndim, and typi.

double Tbl_val::get_zri ( int  k,
int  j,
int  i 
) const [inline]

Read-only of a particular element on the z (or r) interface (index (k,j,i) ) (3D case).

Definition at line 437 of file tbl_val.h.

References Dim_tbl::dim, dim, etat, Grille_val::get_fantome(), gval, Dim_tbl::ndim, and tzri.

double Tbl_val::get_zri ( int  j,
int  i 
) const [inline]

Read-only of a particular element on the z (or r) interface (index (j,i) ) (2D case).

Definition at line 309 of file tbl_val.h.

References Dim_tbl::dim, dim, etat, Grille_val::get_fantome(), gval, Dim_tbl::ndim, and tzri.

double Tbl_val::get_zri ( int  i  )  const [inline]

Read-only of a particular element on the interface (index i ) (1D case).

Definition at line 225 of file tbl_val.h.

References dim, etat, Grille_val::get_fantome(), gval, Dim_tbl::ndim, and tzri.

double Tbl_val::operator() ( int  k,
int  j,
int  i 
) const [inline]

Read-only of a particular element (index (k,j,i) ) (3D case).

Definition at line 380 of file tbl_val.h.

References Dim_tbl::dim, dim, etat, Grille_val::get_fantome(), gval, Dim_tbl::ndim, and t.

double Tbl_val::operator() ( int  j,
int  i 
) const [inline]

Read-only of a particular element (index (j,i) ) (2D case).

Definition at line 275 of file tbl_val.h.

References Dim_tbl::dim, dim, etat, Grille_val::get_fantome(), gval, Dim_tbl::ndim, and t.

double Tbl_val::operator() ( int  i  )  const [inline]

Read-only of a particular element (index i ) (1D case).

Definition at line 211 of file tbl_val.h.

References dim, etat, Grille_val::get_fantome(), gval, Dim_tbl::ndim, and t.

void Tbl_val::operator*= ( double  x  ) 

Multiplication of this by a double.

Definition at line 820 of file arithm_tbl_val.C.

References etat, get_taille(), get_taille_i(), set_etat_zero(), t, txti, typi, and tzri.

void Tbl_val::operator*= ( const Tbl_val ti  ) 

Multiplication of this by a Tbl_val.

Definition at line 787 of file arithm_tbl_val.C.

References etat, get_etat(), get_taille(), get_taille_i(), gval, set_etat_zero(), t, txti, typi, and tzri.

void Tbl_val::operator+= ( double  x  ) 

Addition of a double to this.

Definition at line 627 of file arithm_tbl_val.C.

References etat, get_taille(), get_taille_i(), set_etat_qcq(), t, txti, typi, and tzri.

void Tbl_val::operator+= ( const Tbl_val ti  ) 

Addition of a Tbl_val to this.

Definition at line 573 of file arithm_tbl_val.C.

References etat, get_etat(), get_taille(), get_taille_i(), gval, set_etat_qcq(), t, txti, typi, and tzri.

void Tbl_val::operator-= ( double  x  ) 

Subtraction of a double to this.

Definition at line 734 of file arithm_tbl_val.C.

References etat, get_taille(), get_taille_i(), set_etat_qcq(), t, txti, typi, and tzri.

void Tbl_val::operator-= ( const Tbl_val ti  ) 

Subtraction of a Tbl_val to this.

Definition at line 679 of file arithm_tbl_val.C.

References etat, get_etat(), get_taille(), get_taille_i(), gval, set_etat_qcq(), t, txti, typi, and tzri.

void Tbl_val::operator/= ( double  x  ) 

Division of this by a double.

Definition at line 886 of file arithm_tbl_val.C.

References etat, get_taille(), get_taille_i(), t, txti, typi, and tzri.

void Tbl_val::operator/= ( const Tbl_val ti  ) 

Division of this by a Tbl_val.

Definition at line 851 of file arithm_tbl_val.C.

References etat, get_etat(), get_taille(), get_taille_i(), gval, t, txti, typi, and tzri.

void Tbl_val::operator= ( int  m  ) 

Assignment to a int.

Definition at line 215 of file tbl_val.C.

References get_taille(), get_taille_i(), set_etat_qcq(), set_etat_zero(), t, txti, typi, and tzri.

void Tbl_val::operator= ( double  a  ) 

Assignment to a double.

Definition at line 192 of file tbl_val.C.

References get_taille(), get_taille_i(), set_etat_qcq(), set_etat_zero(), t, txti, typi, and tzri.

void Tbl_val::operator= ( const Tbl_val tx  ) 

Assignment to another Tbl_val.

Definition at line 159 of file tbl_val.C.

References etat, get_etat(), get_ndim(), get_taille(), get_taille_i(), gval, set_etat_qcq(), set_etat_zero(), t, txti, typi, and tzri.

void Tbl_val::sauve ( FILE *  fd  )  const

Save in a file.

Definition at line 245 of file tbl_val.C.

References etat, fwrite_be(), get_ndim(), get_taille(), get_taille_i(), t, txti, typi, and tzri.

double& Tbl_val::set ( int  k,
int  j,
int  i 
) [inline]

Read/write of a particular element (index (k,j,i) ) (3D case).

Definition at line 323 of file tbl_val.h.

References Dim_tbl::dim, dim, etat, Grille_val::get_fantome(), gval, Dim_tbl::ndim, and t.

double& Tbl_val::set ( int  j,
int  i 
) [inline]

Read/write of a particular element (index (j,i) ) (2D case).

Definition at line 239 of file tbl_val.h.

References Dim_tbl::dim, dim, etat, Grille_val::get_fantome(), gval, Dim_tbl::ndim, and t.

double& Tbl_val::set ( int  i  )  [inline]

Read/write of a particular element (index i ) (1D case).

Definition at line 191 of file tbl_val.h.

References dim, etat, Grille_val::get_fantome(), gval, Dim_tbl::ndim, and t.

void Tbl_val::set_etat_nondef (  ) 

Sets the logical state to ETATNONDEF (undefined).

Deallocates the memory occupied by the double array t .

Definition at line 283 of file tbl_val.C.

References del_t(), and etat.

void 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 290 of file tbl_val.C.

References etat, get_ndim(), get_taille(), get_taille_i(), t, txti, typi, and tzri.

void Tbl_val::set_etat_zero (  ) 

Sets the logical state to ETATZERO (zero).

Deallocates the memory occupied by the double array t .

Definition at line 276 of file tbl_val.C.

References del_t(), and etat.

double& Tbl_val::set_xti ( int  k,
int  j,
int  i 
) [inline]

Read/write of a particular element on the x (or $\theta$) interface (index (k,j,i) ) (3D case).

Definition at line 353 of file tbl_val.h.

References Dim_tbl::dim, dim, etat, Grille_val::get_fantome(), gval, Dim_tbl::ndim, and txti.

double& Tbl_val::set_xti ( int  j,
int  i 
) [inline]

Read/write of a particular element on the x (or $\theta$) interface (index (j,i) ) (2D case).

Definition at line 252 of file tbl_val.h.

References Dim_tbl::dim, dim, etat, Grille_val::get_fantome(), gval, Dim_tbl::ndim, and txti.

double& Tbl_val::set_ypi ( int  k,
int  j,
int  i 
) [inline]

Read/write of a particular element on the y (or $\phi$) interface (index (k,j,i) ) (3D case).

Definition at line 338 of file tbl_val.h.

References Dim_tbl::dim, dim, etat, Grille_val::get_fantome(), gval, Dim_tbl::ndim, and typi.

double& Tbl_val::set_zri ( int  k,
int  j,
int  i 
) [inline]

Read/write of a particular element on the z (or r) interface (index (k,j,i) ) (3D case).

Definition at line 368 of file tbl_val.h.

References Dim_tbl::dim, dim, etat, Grille_val::get_fantome(), gval, Dim_tbl::ndim, and tzri.

double& Tbl_val::set_zri ( int  j,
int  i 
) [inline]

Read/write of a particular element on the z (or r) interface (index (j,i) ) (2D case).

Definition at line 265 of file tbl_val.h.

References Dim_tbl::dim, dim, etat, Grille_val::get_fantome(), gval, Dim_tbl::ndim, and tzri.

double& Tbl_val::set_zri ( int  i  )  [inline]

Read/write of a particular element on the interface (index i ) (1D case).

Definition at line 201 of file tbl_val.h.

References dim, etat, Grille_val::get_fantome(), gval, Dim_tbl::ndim, and tzri.

Scalar 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[.

Parameters:
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 $\theta$ and $\phi$ of the spectral grid may be different/domain. Still, the domain with the highest number of points in $\theta$ (resp.$\phi$) must contain the collocation points
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)\
Returns:
Scalar containing the value of the field at spectral collocation points.

Definition at line 90 of file tbl_val_interp.C.

References Grille_val::compatible(), Dim_tbl::dim, dim, etat, Grille_val::get_fantome(), Map::get_mg(), Mg3d::get_np(), Mg3d::get_nr(), Mg3d::get_nt(), Mg3d::get_nzone(), gval, Grille_val::interpol1(), Grille_val::interpol2(), Grille_val::interpol3(), Map::phi, Map::r, Tbl::set(), Tbl::set_etat_qcq(), Tbl::t, t, Map::tet, and Grille_val::zr.


Friends And Related Function Documentation

ostream& operator<< ( ostream &  ,
const Tbl_val  
) [friend]

Display.


Member Data Documentation

const Dim_tbl* Tbl_val::dim [private]

The Dim_tbl giving the dimensions and number of points (without the hidden cells).

Definition at line 104 of file tbl_val.h.

int Tbl_val::etat [private]

logical state (ETATNONDEF , ETATQCQ or ETATZERO ).

Definition at line 99 of file tbl_val.h.

const Grille_val* Tbl_val::gval [private]

The Grille_val (cartesian or spherical) on which the array is defined.

Definition at line 106 of file tbl_val.h.

double* Tbl_val::t

The array of double at the nodes.

Definition at line 110 of file tbl_val.h.

double* Tbl_val::txti

The array at x (or $\theta$) interfaces.

Definition at line 114 of file tbl_val.h.

double* Tbl_val::typi

The array at y (or $\phi$) interfaces.

Definition at line 116 of file tbl_val.h.

double* Tbl_val::tzri

The array at z (or r) interfaces.

Definition at line 112 of file tbl_val.h.


The documentation for this class was generated from the following files:

Generated on 7 Oct 2014 for LORENE by  doxygen 1.6.1