30 char valeur_math_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Valeur/valeur_math.C,v 1.5 2014/10/13 08:53:50 j_novak Exp $" ;
87 assert(ti.
get_etat() != ETATNONDEF) ;
101 *(to.c) =
sin( *(ti.
c) ) ;
112 assert(ti.
get_etat() != ETATNONDEF) ;
128 *(to.c) =
cos( *(ti.
c) ) ;
139 assert(ti.
get_etat() != ETATNONDEF) ;
153 *(to.c) =
tan( *(ti.
c) ) ;
164 assert(ti.
get_etat() != ETATNONDEF) ;
178 *(to.c) =
asin( *(ti.
c) ) ;
189 assert(ti.
get_etat() != ETATNONDEF) ;
196 *(to.c) = M_PI * .5 ;
205 *(to.c) =
acos( *(ti.
c) ) ;
216 assert(ti.
get_etat() != ETATNONDEF) ;
230 *(to.c) =
atan( *(ti.
c) ) ;
241 assert(ti.
get_etat() != ETATNONDEF) ;
255 *(to.c) =
sqrt( *(ti.
c) ) ;
266 assert(ti.
get_etat() != ETATNONDEF) ;
282 *(to.c) =
exp( *(ti.
c) ) ;
293 assert(ti.
get_etat() != ETATNONDEF) ;
322 assert(ti.
get_etat() != ETATNONDEF) ;
326 cout <<
"Valeur log: log(ETATZERO) !" << endl ;
337 *(to.c) =
log( *(ti.
c) ) ;
348 assert(ti.
get_etat() != ETATNONDEF) ;
352 cout <<
"Valeur log10: log10(ETATZERO) !" << endl ;
363 *(to.c) =
log10( *(ti.
c) ) ;
374 assert(ti.
get_etat() != ETATNONDEF) ;
382 cout <<
"Valeur pow: ETATZERO^n with n<=0 ! "<< endl ;
395 *(to.c) =
pow( *(ti.
c), x ) ;
406 assert(ti.
get_etat() != ETATNONDEF) ;
414 cout <<
"Valeur pow: ETATZERO^x with x<=0 !" << endl ;
426 *(to.c) =
pow( *(ti.
c), x ) ;
437 assert(vi.
get_etat() != ETATNONDEF) ;
455 *(vo.c) =
abs( *(vi.
c) ) ;
466 assert(vi.
get_etat() != ETATNONDEF) ;
490 assert(vi.
get_etat() != ETATNONDEF) ;
519 assert(vi.
get_etat() != ETATNONDEF) ;
547 assert(vi.
get_etat() != ETATNONDEF) ;
561 resu =
max( *(vi.
c) ) ;
575 assert(vi.
get_etat() != ETATNONDEF) ;
589 resu =
min( *(vi.
c) ) ;
603 assert(vi.
get_etat() != ETATNONDEF) ;
631 assert(v1.
get_etat() != ETATNONDEF) ;
632 assert(v2.
get_etat() != ETATNONDEF) ;
641 assert(normdiff.
get_etat() == ETATQCQ) ;
642 assert(norme2.
get_etat() == ETATQCQ) ;
645 for (
int l=0; l<nz; l++) {
646 if ( norme2(l) ==
double(0) ) {
647 resu.
set(l) = normdiff(l) ;
650 resu.
set(l) = normdiff(l) / norme2(l) ;
665 assert(v1.
get_etat() != ETATNONDEF) ;
666 assert(v2.
get_etat() != ETATNONDEF) ;
675 assert(maxdiff.
get_etat() == ETATQCQ) ;
676 assert(max2.
get_etat() == ETATQCQ) ;
679 for (
int l=0; l<nz; l++) {
680 if ( max2(l) ==
double(0) ) {
681 resu.
set(l) = maxdiff(l) ;
684 resu.
set(l) = maxdiff(l) / max2(l) ;
Cmp log(const Cmp &)
Neperian logarithm.
Cmp asin(const Cmp &)
Arcsine.
Cmp exp(const Cmp &)
Exponential.
Cmp sqrt(const Cmp &)
Square root.
Cmp racine_cubique(const Cmp &)
Cube root.
double & set(int i)
Read/write of a particular element (index i) (1D case)
void coef_i() const
Computes the physical value of *this.
Values and coefficients of a (real-value) function.
int get_etat() const
Gives the logical state.
Tbl min(const Cmp &)
Minimum values of a Cmp in each domain.
Cmp cos(const Cmp &)
Cosine.
Tbl diffrel(const Cmp &a, const Cmp &b)
Relative difference between two Cmp (norme version).
const Mg3d * get_mg() const
Returns the Mg3d on which the this is defined.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Cmp tan(const Cmp &)
Tangent.
int get_etat() const
Returns the logical state.
Tbl norme(const Cmp &)
Sums of the absolute values of all the values of the Cmp in each domain.
Cmp atan(const Cmp &)
Arctangent.
Mtbl * c
Values of the function at the points of the multi-grid.
int get_nzone() const
Returns the number of domains.
Tbl max(const Cmp &)
Maximum values of a Cmp in each domain.
double totalmax(const Mtbl &)
Maximum value of the Mtbl elements in all domains.
Cmp pow(const Cmp &, int)
Power .
double totalmin(const Mtbl &)
Minimum value of the Mtbl elements in all domain.
Cmp log10(const Cmp &)
Basis 10 logarithm.
Cmp acos(const Cmp &)
Arccosine.
Cmp abs(const Cmp &)
Absolute value.
void set_etat_c_qcq()
Sets the logical state to ETATQCQ (ordinary state) for values in the configuration space (Mtbl c )...
Cmp sin(const Cmp &)
Sine.
Mtbl Heaviside(const Mtbl &)
Heaviside function.
void annule_hard()
Sets the Tbl to zero in a hard way.
Tbl diffrelmax(const Cmp &a, const Cmp &b)
Relative difference between two Cmp (max version).