30char TBL_VAL_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Valencia/tbl_val.C,v 1.7 2014/10/13 08:53:48 j_novak Exp $" ;
73#include "utilitaires.h"
84 dim(g->get_dim_tbl()), gval(g), t(0x0), tzri(0x0), txti(0x0), typi(0x0) {}
91 if (
tc.etat == ETATQCQ) {
128 if (
etat == ETATQCQ) {
167 assert(
tx.get_etat() != ETATNONDEF) ;
178 for (
int i=0 ;
i<
n ;
i++) {
189 cout <<
"Erreur bizarre !" <<
endl ;
198 if (
a ==
double(0) ) {
204 for (
int i=0 ;
i<
n ;
i++) {
227 for (
int i=0 ;
i<
n ;
i++) {
252 if (
etat == ETATQCQ) {
268 if (
t != 0x0)
delete []
t ;
355 o.setf(ios::showpoint);
356 o <<
"*** Tbl_val " << ndim <<
"D" <<
" size: " ;
357 for (
int i = 0;
i<ndim-1;
i++) {
359 if (ndim-
i == 3)
o <<
"(Y)" <<
" x " ;
360 if (ndim-
i == 2)
o <<
"(X)" <<
" x " ;
362 o << t.
get_dim(0) <<
"(Z)" <<
" + " << t.
gval->get_fantome() <<
366 o <<
"Identically ZERO" <<
endl ;
371 o <<
"UNDEFINED STATE" <<
endl ;
389 o <<
" J_x " <<
j <<
" : " <<
endl ;
391 o <<
" " << t(
j,
i) ;
401 o <<
" K_y = " <<
k <<
" : " <<
endl ;
403 o <<
" J_x = " <<
j <<
" : " ;
405 o <<
" " << t(
k,
j,
i) ;
416 cout <<
"operator<< Tbl_val : unexpected dimension !" <<
endl ;
417 cout <<
" ndim = " << ndim <<
endl ;
432 ost <<
"*** Tbl_val " << ndim <<
"D" <<
" size: " ;
433 for (
int i = 0;
i<ndim-1;
i++) {
442 if (
etat == ETATNONDEF) {
443 ost <<
" state: UNDEFINED" <<
endl ;
447 if (
etat == ETATZERO) {
448 ost <<
" state: ZERO" <<
endl ;
456 ost.precision(precis);
457 ost.setf(ios::showpoint);
459 ost <<
" Values on the nodes, without hidden cells:" <<
endl ;
464 ost <<
" " <<
setw(precis) << (*this)(
i) ;
473 ost <<
" #j=" <<
j <<
" : " ;
475 ost <<
" " <<
setw(precis) << (*this)(
j,
i) ;
492 ost <<
" #k=" <<
k <<
",j=" <<
j <<
" : " ;
494 ost <<
" " <<
setw(precis) << (*this)(
k,
j,
i) ;
505 cout <<
"Tbl_val:affiche_seuil : unexpected dimension !" <<
endl ;
515 ost.unsetf(ios::showpoint);
Time evolution with partial storage (*** under development ***).
Base class for Godunov-type grids.
Finite-difference array intended to store field values.
void del_t()
Logical destructor: dellocates the memory occupied by the array t and sets the logical state to ETATN...
const Grille_val * gval
The Grille_val (cartesian or spherical) on which the array is defined.
void operator=(const Tbl_val &)
Assignment to another Tbl_val.
void set_etat_nondef()
Sets the logical state to ETATNONDEF (undefined).
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)
int get_taille_i(int i) const
Gives the size of the interface arrays (including the hidden cells)
double * txti
The array at x (or ) interfaces.
double * tzri
The array at z (or r) interfaces.
void annule_hard()
Sets the Tbl_val to zero in a hard way.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
double * t
The array of double at the nodes.
int get_etat() const
Gives the logical state.
Tbl_val(const Grille_val *)
Constructor from a 3D grid.
void sauve(FILE *) const
Save in a file.
double * typi
The array at y (or ) interfaces.
int get_taille() const
Gives the size of the node array (including the hidden cells)
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 etat
logical state (ETATNONDEF , ETATQCQ or ETATZERO ).
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...
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 fwrite_be(const int *aa, int size, int nb, FILE *fich)
Writes integer(s) into a binary file according to the big endian convention.