30 char TBL_VAL_MATH_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Valencia/tbl_val_math.C,v 1.4 2014/10/13 08:53:48 j_novak Exp $" ;
70 assert(ti.
get_etat() != ETATNONDEF) ;
82 for (
int i=0 ; i<taille ; i++) {
83 to.
t[i] =
sin(ti.
t[i]) ;
101 assert(ti.
get_etat() != ETATNONDEF) ;
115 for (
int i=0 ; i<taille ; i++) {
116 to.
t[i] =
cos(ti.
t[i]) ;
134 assert(ti.
get_etat() != ETATNONDEF) ;
146 for (
int i=0 ; i<taille ; i++) {
147 to.
t[i] =
tan(ti.
t[i]) ;
165 assert(ti.
get_etat() != ETATNONDEF) ;
177 for (
int i=0 ; i<taille ; i++) {
197 assert(ti.
get_etat() != ETATNONDEF) ;
211 for (
int i=0 ; i<taille ; i++) {
230 assert(ti.
get_etat() != ETATNONDEF) ;
242 for (
int i=0 ; i<taille ; i++) {
261 assert(ti.
get_etat() != ETATNONDEF) ;
273 for (
int i=0 ; i<taille ; i++) {
292 assert(ti.
get_etat() != ETATNONDEF) ;
306 for (
int i=0 ; i<taille ; i++) {
307 to.
t[i] =
exp(ti.
t[i]) ;
325 assert(ti.
get_etat() != ETATNONDEF) ;
329 cout <<
"Tbl_val log: log(ETATZERO) !" << endl ;
338 for (
int i=0 ; i<taille ; i++) {
339 to.
t[i] =
log(ti.
t[i]) ;
357 assert(ti.
get_etat() != ETATNONDEF) ;
361 cout <<
"Tbl_val log10: log10(ETATZERO) !" << endl ;
370 for (
int i=0 ; i<taille ; i++) {
389 assert(ti.
get_etat() != ETATNONDEF) ;
397 cout <<
"Tbl_val pow: ETATZERO^n avec n<=0 ! "<< endl ;
408 for (
int i=0 ; i<taille ; i++) {
409 to.
t[i] =
pow(ti.
t[i], x) ;
427 assert(ti.
get_etat() != ETATNONDEF) ;
435 cout <<
"Tbl_val pow: ETATZERO^x avec x<=0 !" << endl ;
445 for (
int i=0 ; i<taille ; i++) {
446 to.
t[i] =
pow(ti.
t[i], x) ;
464 assert(ti.
get_etat() != ETATNONDEF) ;
477 const double* xi = ti.
t ;
481 for (
int i=0 ; i<taille ; i++) {
482 xo[i] = fabs( xi[i] ) ;
500 assert(ti.
get_etat() != ETATNONDEF) ;
517 if (ti.
tzri[i] < 0) res.
tzri[i] *= -1 ;
519 if (ti.
txti[i] < 0) res.
txti[i] *= -1 ;
521 if (ti.
typi[i] < 0) res.
typi[i] *= -1 ;
533 assert(ti.
get_etat() != ETATNONDEF) ;
543 const double* x = ti.
t ;
546 if ( x[i] > resu ) resu = x[i] ;
559 assert(ti.
get_etat() != ETATNONDEF) ;
569 const double* x = ti.
t ;
572 if ( x[i] < resu ) resu = x[i] ;
585 assert(ti.
get_etat() != ETATNONDEF) ;
592 const double* x = ti.
t ;
594 resu += fabs( x[i] ) ;
609 assert(t1.
get_etat() != ETATNONDEF) ;
610 assert(t2.
get_etat() != ETATNONDEF) ;
612 double norm2 =
norme(t2) ;
613 double normdiff =
norme(t1-t2) ;
615 if ( norm2 ==
double(0) ) {
619 resu = normdiff / norm2 ;
633 assert(t1.
get_etat() != ETATNONDEF) ;
634 assert(t2.
get_etat() != ETATNONDEF) ;
636 double max2 =
max(
abs(t2)) ;
637 double maxdiff =
max(
abs(t1-t2)) ;
639 if ( max2 ==
double(0) ) {
643 resu = maxdiff / max2 ;
Finite-difference array intended to store field values.
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 set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
const Grille_val * get_grille() const
Returns a pointer on the grid on which the Tbl_val is defined.
double * t
The array of double at the nodes.
int get_etat() const
Gives the logical state.
double * typi
The array at y (or ) interfaces.
int get_taille() const
Gives the size of the node array (including the hidden cells)
Cmp atan(const Cmp &)
Arctangent.
Cmp sqrt(const Cmp &)
Square root.
Cmp log10(const Cmp &)
Basis 10 logarithm.
Cmp exp(const Cmp &)
Exponential.
Cmp sin(const Cmp &)
Sine.
Tbl diffrel(const Cmp &a, const Cmp &b)
Relative difference between two Cmp (norme version).
Tbl norme(const Cmp &)
Sums of the absolute values of all the values of the Cmp in each domain.
Cmp acos(const Cmp &)
Arccosine.
Cmp asin(const Cmp &)
Arcsine.
Cmp racine_cubique(const Cmp &)
Cube root.
Tbl min(const Cmp &)
Minimum values of a Cmp in each domain.
Tbl max(const Cmp &)
Maximum values of a Cmp in each domain.
Cmp pow(const Cmp &, int)
Power .
Cmp cos(const Cmp &)
Cosine.
Cmp abs(const Cmp &)
Absolute value.
Tbl diffrelmax(const Cmp &a, const Cmp &b)
Relative difference between two Cmp (max version).
Cmp tan(const Cmp &)
Tangent.
Cmp log(const Cmp &)
Neperian logarithm.