154 assert(vi.
get_etat() != ETATNONDEF) ;
162 assert(vi.
get_etat() != ETATNONDEF) ;
179 assert(vi.
c_cf != 0x0) ;
180 resu = - *(vi.
c_cf) ;
197 assert(t1.
get_etat() != ETATNONDEF) ;
198 assert(t2.
get_etat() != ETATNONDEF) ;
217 resu = *(t1.
c) + *(t2.
c) ;
221 assert(t2.
c_cf != 0x0) ;
222 if (t1.
c_cf != 0x0) {
227 resu = *(t1.
c) + *(t2.
c) ;
233 assert(t1.
c_cf != 0x0) ;
234 if (t2.
c_cf != 0x0) {
238 assert(t2.
c != 0x0) ;
240 resu = *(t1.
c) + *(t2.
c) ;
253 assert(t1.
get_etat() != ETATNONDEF) ;
254 assert(mi.
get_etat() != ETATNONDEF) ;
268 assert(resu.
get_etat() == ETATQCQ) ;
289 assert(t1.
get_etat() != ETATNONDEF) ;
292 if (
x ==
double(0)) {
303 assert(resu.
get_etat() == ETATQCQ) ;
306 *(resu.
c) = *(resu.
c) +
x ;
323 return t1 + double(m) ;
330 return t1 + double(m) ;
344 assert(t1.
get_etat() != ETATNONDEF) ;
345 assert(t2.
get_etat() != ETATNONDEF) ;
364 resu = *(t1.
c) - *(t2.
c) ;
368 assert(t2.
c_cf != 0x0) ;
369 if (t1.
c_cf != 0x0) {
374 resu = *(t1.
c) - *(t2.
c) ;
380 assert(t1.
c_cf != 0x0) ;
381 if (t2.
c_cf != 0x0) {
385 assert(t2.
c != 0x0) ;
387 resu = *(t1.
c) - *(t2.
c) ;
401 assert(t1.
get_etat() != ETATNONDEF) ;
402 assert(mi.
get_etat() != ETATNONDEF) ;
416 assert(resu.
get_etat() == ETATQCQ) ;
436 assert(t1.
get_etat() != ETATNONDEF) ;
439 if (
x ==
double(0)) {
450 assert(resu.
get_etat() == ETATQCQ) ;
453 *(resu.
c) = *(resu.
c) -
x ;
470 return t1 - double(m) ;
477 return double(m) - t1 ;
493 assert(t1.
get_etat() != ETATNONDEF) ;
494 assert(t2.
get_etat() != ETATNONDEF) ;
517 resu = (*(t1.
c)) * (*(t2.
c)) ;
531 assert(c1.
get_etat() != ETATNONDEF) ;
534 if ((c1.
get_etat() == ETATZERO) || ( a ==
double(1) )) {
544 result = *(c1.
c) * a ;
549 assert(c1.
c_cf != 0x0) ;
550 result = *(c1.
c_cf) * a ;
567 return t1 * double(m) ;
574 return t1 * double(m) ;
583 assert(c1.
get_etat() != ETATNONDEF) ;
600 result = *(c1.
c) * c2 ;
619 assert(c1.
get_etat() != ETATNONDEF) ;
636 result = *(c1.
c) * c2 ;
658 assert(t1.
get_etat() != ETATNONDEF) ;
659 assert(t2.
get_etat() != ETATNONDEF) ;
664 cout <<
"Division by 0 in Valeur / Valeur !" << endl ;
684 resu = (*(t1.
c)) / (*(t2.
c)) ;
697 assert(t1.
get_etat() != ETATNONDEF) ;
700 if (
x ==
double(0) ) {
701 cout <<
"Division by 0 in Valeur / double !" << endl ;
704 if ((t1.
get_etat() == ETATZERO) || (
x ==
double(1) )) {
717 assert(t1.
c_cf != 0x0) ;
718 resu = *(t1.
c_cf) /
x ;
729 assert(c2.
get_etat() != ETATNONDEF) ;
733 cout <<
"Division by 0 in double / Valeur !" << endl ;
748 *(
r.c) =
x / *(c2.
c) ;
760 return t1 / double(m) ;
766 return double(m) / t1 ;
774 assert(t1.
get_etat() != ETATNONDEF) ;
775 assert(m2.
get_etat() != ETATNONDEF) ;
779 cout <<
"Division by 0 in Valeur / Mtbl !" << endl ;
795 resu = (*(t1.
c)) / m2 ;
805 assert(m1.
get_etat() != ETATNONDEF) ;
806 assert(c2.
get_etat() != ETATNONDEF) ;
810 cout <<
"Division by 0 in Mtbl / Valeur !" << endl ;
825 resu = m1 / (*(c2.
c)) ;
844 assert(
etat != ETATNONDEF) ;
845 assert(vi.
get_etat() != ETATNONDEF) ;
855 if (
etat == ETATZERO) {
867 assert(vi.
c_cf != 0x0) ;
882 assert(
c_cf != 0x0) ;
883 if (vi.
c_cf != 0x0) {
889 assert(vi.
c != 0x0) ;
907 assert(
etat != ETATNONDEF) ;
908 assert(vi.
get_etat() != ETATNONDEF) ;
918 if (
etat == ETATZERO) {
929 assert(vi.
c_cf != 0x0) ;
944 assert(
c_cf != 0x0) ;
945 if (vi.
c_cf != 0x0) {
951 assert(vi.
c != 0x0) ;
968 assert(
etat != ETATNONDEF) ;
969 assert(vi.
get_etat() != ETATNONDEF) ;
972 if (
etat == ETATZERO) {
1012 assert(t1.
get_etat() != ETATNONDEF) ;
1013 assert(t2.
get_etat() != ETATNONDEF) ;
1033 if (t1.
c_cf == 0x0) {
1036 if (t2.
c_cf == 0x0) {
1043 assert( c1.
get_etat() == ETATQCQ ) ;
1044 assert( c2.
get_etat() == ETATQCQ ) ;
1061 int nr2 = mg2.
get_nr(l) ;
1062 int nt2 = mg2.
get_nt(l) ;
1063 int np2 = mg2.
get_np(l) ;
1068 if ( c1.
t[l]->
get_etat() == ETATZERO ) {
1073 assert( c1.
t[l]->
get_etat() == ETATQCQ ) ;
1077 for (
int k=0; k<np+1; k++) {
1078 for (
int j=0; j<nt; j++) {
1079 for (
int i=0; i<nr; i++) {
1080 cc1.
t[l]->
set(k, j, i) = (*(c1.
t[l]))(k, j, i) ;
1086 for (
int k=np+1; k<np2+2; k++) {
1087 for (
int j=0; j<nt2; j++) {
1088 for (
int i=0; i<nr2; i++) {
1089 cc1.
t[l]->
set(k, j, i) = 0 ;
1095 for (
int k=0; k<np+1; k++) {
1096 for (
int j=nt; j<nt2; j++) {
1097 for (
int i=0; i<nr2; i++) {
1098 cc1.
t[l]->
set(k, j, i) = 0 ;
1104 for (
int k=0; k<np+1; k++) {
1105 for (
int j=0; j<nt; j++) {
1106 for (
int i=nr; i<nr2; i++) {
1107 cc1.
t[l]->
set(k, j, i) = 0 ;
1117 if ( c2.
t[l]->
get_etat() == ETATZERO ) {
1122 assert( c2.
t[l]->
get_etat() == ETATQCQ ) ;
1126 for (
int k=0; k<np+1; k++) {
1127 for (
int j=0; j<nt; j++) {
1128 for (
int i=0; i<nr; i++) {
1129 cc2.
t[l]->
set(k, j, i) = (*(c2.
t[l]))(k, j, i) ;
1135 for (
int k=np+1; k<np2+2; k++) {
1136 for (
int j=0; j<nt2; j++) {
1137 for (
int i=0; i<nr2; i++) {
1138 cc2.
t[l]->
set(k, j, i) = 0 ;
1144 for (
int k=0; k<np+1; k++) {
1145 for (
int j=nt; j<nt2; j++) {
1146 for (
int i=0; i<nr2; i++) {
1147 cc2.
t[l]->
set(k, j, i) = 0 ;
1153 for (
int k=0; k<np+1; k++) {
1154 for (
int j=0; j<nt; j++) {
1155 for (
int i=nr; i<nr2; i++) {
1156 cc2.
t[l]->
set(k, j, i) = 0 ;
1193 if ( cr2.
t[l]->
get_etat() == ETATZERO ) {
1200 assert( cr2.
t[l]->
get_etat() == ETATQCQ ) ;
1209 for (
int k=0; k<np+1; k++) {
1210 for (
int j=0; j<nt; j++) {
1211 for (
int i=0; i<nr; i++) {
1212 cr.
t[l]->
set(k, j, i) = (*(cr2.
t[l]))(k, j, i) ;
1218 for (
int j=0; j<nt; j++) {
1219 for (
int i=0; i<nr; i++) {
1220 cr.
t[l]->
set(np+1, j, i) = 0 ;
1244 assert(t1.
get_etat() != ETATNONDEF) ;
1245 assert(t2.
get_etat() != ETATNONDEF) ;
1265 if (t1.
c_cf == 0x0) {
1268 if (t2.
c_cf == 0x0) {
1275 assert( c1.
get_etat() == ETATQCQ ) ;
1276 assert( c2.
get_etat() == ETATQCQ ) ;
1293 int nr2 = mg2.
get_nr(l) ;
1294 int nt2 = mg2.
get_nt(l) ;
1295 int np2 = mg2.
get_np(l) ;
1300 if ( c1.
t[l]->
get_etat() == ETATZERO ) {
1305 assert( c1.
t[l]->
get_etat() == ETATQCQ ) ;
1309 for (
int k=0; k<np+1; k++) {
1310 for (
int j=0; j<nt; j++) {
1311 for (
int i=0; i<nr; i++) {
1312 cc1.
t[l]->
set(k, j, i) = (*(c1.
t[l]))(k, j, i) ;
1318 for (
int k=np+1; k<np2+2; k++) {
1319 for (
int j=0; j<nt2; j++) {
1320 for (
int i=0; i<nr2; i++) {
1321 cc1.
t[l]->
set(k, j, i) = 0 ;
1327 for (
int k=0; k<np+1; k++) {
1328 for (
int j=nt; j<nt2; j++) {
1329 for (
int i=0; i<nr2; i++) {
1330 cc1.
t[l]->
set(k, j, i) = 0 ;
1336 for (
int k=0; k<np+1; k++) {
1337 for (
int j=0; j<nt; j++) {
1338 for (
int i=nr; i<nr2; i++) {
1339 cc1.
t[l]->
set(k, j, i) = 0 ;
1349 if ( c2.
t[l]->
get_etat() == ETATZERO ) {
1354 assert( c2.
t[l]->
get_etat() == ETATQCQ ) ;
1358 for (
int k=0; k<np+1; k++) {
1359 for (
int j=0; j<nt; j++) {
1360 for (
int i=0; i<nr; i++) {
1361 cc2.
t[l]->
set(k, j, i) = (*(c2.
t[l]))(k, j, i) ;
1367 for (
int k=np+1; k<np2+2; k++) {
1368 for (
int j=0; j<nt2; j++) {
1369 for (
int i=0; i<nr2; i++) {
1370 cc2.
t[l]->
set(k, j, i) = 0 ;
1376 for (
int k=0; k<np+1; k++) {
1377 for (
int j=nt; j<nt2; j++) {
1378 for (
int i=0; i<nr2; i++) {
1379 cc2.
t[l]->
set(k, j, i) = 0 ;
1414 if ( cr2.
t[l]->
get_etat() == ETATZERO ) {
1421 assert( cr2.
t[l]->
get_etat() == ETATQCQ ) ;
1430 for (
int k=0; k<np+1; k++) {
1431 for (
int j=0; j<nt; j++) {
1432 for (
int i=0; i<nr; i++) {
1433 cr.
t[l]->
set(k, j, i) = (*(cr2.
t[l]))(k, j, i) ;
1439 for (
int j=0; j<nt; j++) {
1440 for (
int i=0; i<nr; i++) {
1441 cr.
t[l]->
set(np+1, j, i) = 0 ;
1463 assert(t1.
get_etat() != ETATNONDEF) ;
1464 assert(t2.
get_etat() != ETATNONDEF) ;
1484 if (t1.
c_cf == 0x0) {
1487 if (t2.
c_cf == 0x0) {
1494 assert( c1.
get_etat() == ETATQCQ ) ;
1495 assert( c2.
get_etat() == ETATQCQ ) ;
1512 int nr2 = mg2.
get_nr(l) ;
1517 if ( c1.
t[l]->
get_etat() == ETATZERO ) {
1522 assert( c1.
t[l]->
get_etat() == ETATQCQ ) ;
1526 for (
int k=0; k<np+1; k++) {
1527 for (
int j=0; j<nt; j++) {
1528 for (
int i=0; i<nr; i++) {
1529 cc1.
t[l]->
set(k, j, i) = (*(c1.
t[l]))(k, j, i) ;
1535 for (
int j=0; j<nt; j++) {
1536 for (
int i=0; i<nr2; i++) {
1537 cc1.
t[l]->
set(np+1, j, i) = 0 ;
1543 for (
int k=0; k<np+1; k++) {
1544 for (
int j=0; j<nt; j++) {
1545 for (
int i=nr; i<nr2; i++) {
1546 cc1.
t[l]->
set(k, j, i) = 0 ;
1556 if ( c2.
t[l]->
get_etat() == ETATZERO ) {
1561 assert( c2.
t[l]->
get_etat() == ETATQCQ ) ;
1565 for (
int k=0; k<np+1; k++) {
1566 for (
int j=0; j<nt; j++) {
1567 for (
int i=0; i<nr; i++) {
1568 cc2.
t[l]->
set(k, j, i) = (*(c2.
t[l]))(k, j, i) ;
1574 for (
int j=0; j<nt; j++) {
1575 for (
int i=0; i<nr2; i++) {
1576 cc2.
t[l]->
set(np+1, j, i) = 0 ;
1581 for (
int k=0; k<np+1; k++) {
1582 for (
int j=0; j<nt; j++) {
1583 for (
int i=nr; i<nr2; i++) {
1584 cc2.
t[l]->
set(k, j, i) = 0 ;
1618 if ( cr2.
t[l]->
get_etat() == ETATZERO ) {
1625 assert( cr2.
t[l]->
get_etat() == ETATQCQ ) ;
1634 for (
int k=0; k<np+1; k++) {
1635 for (
int j=0; j<nt; j++) {
1636 for (
int i=0; i<nr; i++) {
1637 cr.
t[l]->
set(k, j, i) = (*(cr2.
t[l]))(k, j, i) ;
1643 for (
int j=0; j<nt; j++) {
1644 for (
int i=0; i<nr; i++) {
1645 cr.
t[l]->
set(np+1, j, i) = 0 ;
Active physical coordinates and mapping derivatives.
const Mg3d * get_twice() const
Returns the pointer on the grid which has twice the number of points in each dimension (for desaliasi...
const Mg3d * plus_half() const
Returns the pointer on the grid which has 50% more points in r dimension (for desaliasing).
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
int get_nzone() const
Returns the number of domains.
const Mg3d * plus_half_angu() const
Returns the pointer on the grid which has 50% more points in \theta and \phi dimension (for desalia...
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
Base_val std_base_scal() const
Returns the standard spectral bases for a scalar.
Coefficients storage for the multi-domain spectral method.
Base_val base
Bases of the spectral expansions.
int get_etat() const
Returns the logical state.
Tbl ** t
Array (size nzone ) of pointers on the Tbl 's which contain the spectral coefficients in each domain.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
int get_etat() const
Gives the logical state.
int get_etat() const
Gives the logical state.
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
double & set(int i)
Read/write of a particular element (index i) (1D case).
Values and coefficients of a (real-value) function.
void operator-=(const Valeur &)
-= Valeur
void set_etat_c_qcq()
Sets the logical state to ETATQCQ (ordinary state) for values in the configuration space (Mtbl c ).
int get_etat() const
Returns the logical state.
void operator+=(const Valeur &)
+= Valeur
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
Valeur(const Mg3d &mgrid)
Constructor.
Mtbl * c
Values of the function at the points of the multi-grid.
const Mg3d * mg
Multi-grid Mgd3 on which this is defined.
void coef_i() const
Computes the physical value of *this.
Mtbl_cf * c_cf
Coefficients of the spectral expansion of the function.
void coef() const
Computes the coeffcients of *this.
void operator*=(const Valeur &)
*= Valeur
const Mg3d * get_mg() const
Returns the Mg3d on which the this is defined.
Base_val base
Bases on which the spectral expansion is performed.
void annule_hard()
Sets the Valeur to zero in a hard way.
int etat
Logical state (ETATNONDEF , ETATQCQ or ETATZERO ).
void del_deriv()
Logical destructor of the derivatives.
Base_val operator*(const Base_val &, const Base_val &)
This operator is used when calling multiplication or division of Valeur .
Cmp operator-(const Cmp &)
- Cmp
Cmp operator/(const Cmp &, const Cmp &)
Cmp / Cmp.
Cmp operator%(const Cmp &, const Cmp &)
Cmp * Cmp with desaliasing.
Cmp operator+(const Cmp &)
Scalar operator|(const Scalar &, const Scalar &)
Scalar * Scalar with desaliasing only in r.
Valeur operator&(const Valeur &, const Valeur &)
Valeur * Valeur with desaliasing only in \theta and \phi direction.
Coord x
x coordinate centered on the grid
Coord r
r coordinate centered on the grid