LORENE
tbl_val.h
1 /*
2  * Definition of Lorene class Tbl_val
3  *
4  */
5 
6 /*
7  * Copyright (c) 2001 Jerome Novak
8  *
9  * This file is part of LORENE.
10  *
11  * LORENE is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * LORENE is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with LORENE; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24  *
25  */
26 
27 
28 #ifndef __TBL_VAL_H_
29 #define __TBL_VAL_H_
30 
31 /*
32  * $Id: tbl_val.h,v 1.12 2014/10/13 08:52:37 j_novak Exp $
33  * $Log: tbl_val.h,v $
34  * Revision 1.12 2014/10/13 08:52:37 j_novak
35  * Lorene classes and functions now belong to the namespace Lorene.
36  *
37  * Revision 1.11 2014/10/06 15:09:40 j_novak
38  * Modified #include directives to use c++ syntax.
39  *
40  * Revision 1.10 2012/01/17 10:21:31 j_penner
41  * function added: Heaviside
42  *
43  * Revision 1.9 2010/04/14 11:45:24 j_novak
44  * Changed comments
45  *
46  * Revision 1.8 2007/11/02 15:45:56 j_novak
47  * Added an ugly method "append_array", which substitutes the argument to the
48  * main array t.
49  *
50  * Revision 1.7 2005/06/22 09:09:38 lm_lin
51  *
52  * Grid wedding: convert from the old C++ object "Cmp" to "Scalar".
53  *
54  * Revision 1.6 2004/11/26 17:02:18 j_novak
55  * Added a function giving a smooth transition to the atmosphere.
56  *
57  * Revision 1.5 2004/03/22 13:12:43 j_novak
58  * Modification of comments to use doxygen instead of doc++
59  *
60  * Revision 1.4 2002/11/13 11:22:57 j_novak
61  * Version "provisoire" de l'interpolation (sommation depuis la grille
62  * spectrale) aux interfaces de la grille de Valence.
63  *
64  * Revision 1.3 2002/11/12 10:03:53 j_novak
65  * The method "Tbl_val::get_gval" has been changed to "get_grid".
66  *
67  * Revision 1.2 2002/10/16 14:36:29 j_novak
68  * Reorganization of #include instructions of standard C++, in order to
69  * use experimental version 3 of gcc.
70  *
71  * Revision 1.1 2001/11/22 13:38:09 j_novak
72  * added Include files for Valencia objects: tbl_val.h and grille_val.h
73  *
74  *
75  * $Header: /cvsroot/Lorene/C++/Include/tbl_val.h,v 1.12 2014/10/13 08:52:37 j_novak Exp $
76  *
77  */
78 
79 // Fichiers includes
80 #include <cassert>
81 #include <cstdlib>
82 
83 #include "grille_val.h"
84 #include "tensor.h"
85 
86 namespace Lorene {
87 class Grille_val ;
88 
97 class Tbl_val {
98 
99  // Data :
100  // -----
101  private:
103  int etat ;
108  const Dim_tbl* dim ;
110  const Grille_val* gval ;
111 
112  public:
114  double* t ;
116  double* tzri ;
118  double* txti ;
120  double* typi ;
121 
122  // Constructors - Destructor
123  // -------------------------
124 
125  public:
127  explicit Tbl_val(const Grille_val* ) ;
129  explicit Tbl_val(const Grille_val*, FILE* ) ;
131  Tbl_val(const Tbl_val& ) ;
132 
134  ~Tbl_val() ;
135 
136  // Assignement
137  // -----------
139  void operator=(const Tbl_val& ) ;
141  void operator=(double ) ;
143  void operator=(int ) ;
144 
145  // Memory management
146  // -----------------
147  private:
151  void del_t() ;
152 
153  public:
154 
159  void set_etat_nondef() ;
160 
165  void set_etat_zero() ;
166 
173  void set_etat_qcq() ;
174 
179  void append_array(double* t_in) ;
180 
189  void annule_hard() ;
190 
191  // Access to individual elements
192  // -----------------------------
193  public:
195  double& set(int i) {
196  assert (etat == ETATQCQ) ;
197  assert( dim->ndim == 1 ) ;
198  int fant = gval->get_fantome() ;
199  assert( i >= - fant) ;
200  assert( i < dim->dim[0] + fant) ;
201  return t[i + fant] ;
202  } ;
203 
205  double& set_zri(int i) {
206  assert (etat == ETATQCQ) ;
207  assert( dim->ndim == 1 ) ;
208  int fant = gval->get_fantome() ;
209  assert( i >= -fant ) ;
210  assert( i < dim->dim[0] + fant + 1) ;
211  return tzri[i+fant] ;
212  } ;
213 
215  double operator()(int i) const {
216  assert(etat != ETATNONDEF) ;
217  assert( dim->ndim == 1 ) ;
218  int fant = gval->get_fantome() ;
219  assert( i >= -fant ) ;
220  assert( i < dim->dim[0] + fant ) ;
221  if (etat == ETATZERO) {
222  double zero = 0. ;
223  return zero ;
224  }
225  else return t[i+fant] ;
226  };
227 
229  double get_zri(int i) const {
230  assert(etat != ETATNONDEF) ;
231  assert( dim->ndim == 1 ) ;
232  int fant = gval->get_fantome() ;
233  assert( i >= -fant ) ;
234  assert( i < dim->dim[0] + fant +1) ;
235  if (etat == ETATZERO) {
236  double zero = 0. ;
237  return zero ;
238  }
239  else return tzri[i+fant] ;
240  };
241 
243  double& set(int j, int i) {
244  assert (etat == ETATQCQ) ;
245  assert( dim->ndim == 2 ) ;
246  int fant = gval->get_fantome() ;
247  assert( (i>=-fant) && (i<dim->dim[0]+fant) ) ;
248  assert( (j>=-fant) && (j<dim->dim[1]+fant) ) ;
249  return t[(dim->dim[0] +2*fant)* (j+fant) + i + fant] ;
250  };
251 
256  double& set_xti(int j, int i) {
257  assert (etat == ETATQCQ) ;
258  assert( dim->ndim == 2 ) ;
259  int fant = gval->get_fantome() ;
260  assert( (i>=-fant) && (i<dim->dim[0]+fant) ) ;
261  assert( (j>=-fant) && (j<dim->dim[1]+fant+1) ) ;
262  return txti[(dim->dim[0] +2*fant)*(j+fant) + i + fant] ;
263  };
264 
269  double& set_zri(int j, int i) {
270  assert (etat == ETATQCQ) ;
271  assert( dim->ndim == 2 ) ;
272  int fant = gval->get_fantome() ;
273  assert( (i>=-fant) && (i<dim->dim[0] + fant+1) ) ;
274  assert( (j>=-fant) && (j<dim->dim[1] + fant) ) ;
275  return tzri[(dim->dim[0] +2*fant+1)*(j+fant) + i + fant] ;
276  };
277 
279  double operator()(int j, int i) const {
280  assert(etat != ETATNONDEF) ;
281  assert( dim->ndim == 2 ) ;
282  int fant = gval->get_fantome() ;
283  assert( (i>=-fant) && (i<dim->dim[0] + fant) ) ;
284  assert( (j>=-fant) && (j<dim->dim[1] + fant) ) ;
285  if (etat == ETATZERO) {
286  double zero = 0. ;
287  return zero ;
288  }
289  else return t[(dim->dim[0] + 2*fant) *(j+fant) + i + fant] ;
290  };
291 
296  double get_xti(int j, int i) const {
297  assert(etat != ETATNONDEF) ;
298  assert( dim->ndim == 2 ) ;
299  int fant = gval->get_fantome() ;
300  assert( (i>=-fant) && (i<dim->dim[0] + fant) ) ;
301  assert( (j>=-fant) && (j<dim->dim[1] + fant + 1) ) ;
302  if (etat == ETATZERO) {
303  double zero = 0. ;
304  return zero ;
305  }
306  else return txti[(dim->dim[0] + 2*fant) *(j+fant) + i + fant] ;
307  };
308 
313  double get_zri(int j, int i) const {
314  assert(etat != ETATNONDEF) ;
315  assert( dim->ndim == 2 ) ;
316  int fant = gval->get_fantome() ;
317  assert( (i>=-fant) && (i<dim->dim[0] + fant + 1) ) ;
318  assert( (j>=-fant) && (j<dim->dim[1] + fant) ) ;
319  if (etat == ETATZERO) {
320  double zero = 0. ;
321  return zero ;
322  }
323  else return tzri[(dim->dim[0] + 2*fant + 1) *(j+fant) + i + fant] ;
324  };
325 
327  double& set(int k, int j, int i) {
328  assert (etat == ETATQCQ) ;
329  assert( dim->ndim == 3 ) ;
330  int fant = gval->get_fantome() ;
331  assert( (i>=-fant) && (i<dim->dim[0] + fant) ) ;
332  assert( (j>=-fant) && (j<dim->dim[1] + fant) ) ;
333  assert( (k>=-fant) && (k<dim->dim[2] + fant) ) ;
334  return t[(dim->dim[1]+2*fant)*(dim->dim[0]+2*fant)*(k+fant) +
335  (dim->dim[0]+2*fant)*(j+fant) + i +fant] ;
336  };
337 
342  double& set_ypi(int k, int j, int i) {
343  assert (etat == ETATQCQ) ;
344  assert( dim->ndim == 3 ) ;
345  int fant = gval->get_fantome() ;
346  assert( (i>=-fant) && (i<dim->dim[0] + fant) ) ;
347  assert( (j>=-fant) && (j<dim->dim[1] + fant) ) ;
348  assert( (k>=-fant) && (k<dim->dim[2] + fant + 1) ) ;
349  return typi[(dim->dim[1]+2*fant)*(dim->dim[0]+2*fant)*(k+fant) +
350  (dim->dim[0]+2*fant)*(j+fant) + i +fant] ;
351  };
352 
357  double& set_xti(int k, int j, int i) {
358  assert (etat == ETATQCQ) ;
359  assert( dim->ndim == 3 ) ;
360  int fant = gval->get_fantome() ;
361  assert( (i>=-fant) && (i<dim->dim[0] + fant) ) ;
362  assert( (j>=-fant) && (j<dim->dim[1] + fant + 1) ) ;
363  assert( (k>=-fant) && (k<dim->dim[2] + fant) ) ;
364  return txti[(dim->dim[1]+2*fant+1)*(dim->dim[0]+2*fant)*(k+fant) +
365  (dim->dim[0]+2*fant)*(j+fant) + i +fant] ;
366  };
367 
372  double& set_zri(int k, int j, int i) {
373  assert (etat == ETATQCQ) ;
374  assert( dim->ndim == 3 ) ;
375  int fant = gval->get_fantome() ;
376  assert( (i>=-fant) && (i<dim->dim[0] + fant + 1) ) ;
377  assert( (j>=-fant) && (j<dim->dim[1] + fant) ) ;
378  assert( (k>=-fant) && (k<dim->dim[2] + fant) ) ;
379  return tzri[(dim->dim[1]+2*fant)*(dim->dim[0]+2*fant+1)*(k+fant) +
380  (dim->dim[0]+2*fant+1)*(j+fant) + i +fant] ;
381  };
382 
384  double operator()(int k, int j, int i) const {
385  assert(etat != ETATNONDEF) ;
386  assert( dim->ndim == 3 ) ;
387  int fant = gval->get_fantome() ;
388  assert( (i>=-fant) && (i<dim->dim[0] + fant) ) ;
389  assert( (j>=-fant) && (j<dim->dim[1] + fant) ) ;
390  assert( (k>=-fant) && (k<dim->dim[2] + fant) ) ;
391  if (etat == ETATZERO) {
392  double zero = 0. ;
393  return zero ;
394  }
395  else return t[(dim->dim[1]+2*fant)*(dim->dim[0]+2*fant)*(k+fant)
396  + (dim->dim[0]+2*fant)*(j+fant) + i +fant] ;
397  };
398 
403  double get_ypi(int k, int j, int i) const {
404  assert(etat != ETATNONDEF) ;
405  assert( dim->ndim == 3 ) ;
406  int fant = gval->get_fantome() ;
407  assert( (i>=-fant) && (i<dim->dim[0] + fant) ) ;
408  assert( (j>=-fant) && (j<dim->dim[1] + fant) ) ;
409  assert( (k>=-fant) && (k<dim->dim[2] + fant + 1) ) ;
410  if (etat == ETATZERO) {
411  double zero = 0. ;
412  return zero ;
413  }
414  else return typi[(dim->dim[1]+2*fant)*(dim->dim[0]+2*fant)*(k+fant)
415  + (dim->dim[0]+2*fant)*(j+fant) + i +fant] ;
416  };
417 
422  double get_xti(int k, int j, int i) const {
423  assert(etat != ETATNONDEF) ;
424  assert( dim->ndim == 3 ) ;
425  int fant = gval->get_fantome() ;
426  assert( (i>=-fant) && (i<dim->dim[0] + fant) ) ;
427  assert( (j>=-fant) && (j<dim->dim[1] + fant + 1) ) ;
428  assert( (k>=-fant) && (k<dim->dim[2] + fant) ) ;
429  if (etat == ETATZERO) {
430  double zero = 0. ;
431  return zero ;
432  }
433  else return txti[(dim->dim[1]+2*fant+1)*(dim->dim[0]+2*fant)*(k+fant)
434  + (dim->dim[0]+2*fant)*(j+fant) + i +fant] ;
435  };
436 
441  double get_zri(int k, int j, int i) const {
442  assert(etat != ETATNONDEF) ;
443  assert( dim->ndim == 3 ) ;
444  int fant = gval->get_fantome() ;
445  assert( (i>=-fant) && (i<dim->dim[0] + fant + 1) ) ;
446  assert( (j>=-fant) && (j<dim->dim[1] + fant) ) ;
447  assert( (k>=-fant) && (k<dim->dim[2] + fant) ) ;
448  if (etat == ETATZERO) {
449  double zero = 0. ;
450  return zero ;
451  }
452  else return tzri[(dim->dim[1]+2*fant)*(dim->dim[0]+2*fant+1)*(k+fant)
453  + (dim->dim[0]+2*fant+1)*(j+fant) + i +fant] ;
454  };
455 
456  // Extraction of information
457  // -------------------------
459  int get_etat() const { return etat ; };
460 
462  int get_taille() const {
463  int resu = 1 ;
464  for (int i=0; i<dim->ndim; i++)
465  resu *= dim->dim[i] + 2*(gval->get_fantome()) ;
466  return resu ; };
467 
469  int get_taille_i(int i) const {
470  assert (i<dim->ndim) ;
471  int resu = 1 ;
472  for (int j=0; j<dim->ndim; j++)
473  if (j!=i) {
474  resu *= dim->dim[j] + 2*gval->get_fantome() ;
475  }
476  else {
477  resu *= dim->dim[j] + 2*gval->get_fantome() + 1 ;
478  }
479  return resu ; };
480 
482  int get_ndim() const { return dim->ndim ; };
483 
485  int get_dim(int i) const {
486  assert( (i>=0) && (i<dim->ndim) ) ;
487  return dim->dim[i] ;
488  };
489 
491  const Grille_val* get_grille() const { return gval ; } ;
492 
493  // Outputs
494  // -------
495  public:
497  void sauve(FILE* ) const ;
498 
505  void affiche_seuil(ostream& ostr, int precision = 4,
506  double threshold = 1.e-7) const ;
508  friend ostream& operator<<(ostream& , const Tbl_val& ) ;
509 
510  // Member arithmetics
511  // ------------------
512  public:
513 
515  void operator+=(const Tbl_val &) ;
517  void operator+=(double) ;
519  void operator-=(const Tbl_val &) ;
521  void operator-=(double) ;
523  void operator*=(const Tbl_val &) ;
525  void operator*=(double) ;
527  void operator/=(const Tbl_val &) ;
529  void operator/=(double) ;
530 
553  Scalar to_spectral(const Map& map, const int lmax, const int lmin=0,
554  int type_inter = 2) const ;
555 
563  void from_spectral(const Scalar& meudon, int lmax, int lmin=0,
564  bool interfr = false, bool interft = false) ;
565 
566 
567  void smooth_atmosphere(double atmosphere_thr) ;
568 } ;
569 
570 
577 Tbl_val operator+(const Tbl_val&) ;
580 Tbl_val operator-(const Tbl_val&) ;
582 Tbl_val operator+(const Tbl_val&, const Tbl_val&) ;
584 Tbl_val operator+(const Tbl_val&, double) ;
586 Tbl_val operator+(double, const Tbl_val&) ;
588 Tbl_val operator+(const Tbl_val&, int) ;
590 Tbl_val operator+(int, const Tbl_val&) ;
592 Tbl_val operator-(const Tbl_val&, const Tbl_val&) ;
594 Tbl_val operator-(const Tbl_val&, double) ;
596 Tbl_val operator-(double, const Tbl_val&) ;
598 Tbl_val operator-(const Tbl_val&, int) ;
600 Tbl_val operator-(int, const Tbl_val&) ;
602 Tbl_val operator*(const Tbl_val&, const Tbl_val&) ;
604 Tbl_val operator*(const Tbl_val&, double) ;
606 Tbl_val operator*(double, const Tbl_val&) ;
608 Tbl_val operator*(const Tbl_val&, int) ;
610 Tbl_val operator*(int, const Tbl_val&) ;
612 Tbl_val operator/(const Tbl_val&, const Tbl_val&) ;
614 Tbl_val operator/(const Tbl_val&, double) ;
616 Tbl_val operator/(double, const Tbl_val&) ;
618 Tbl_val operator/(const Tbl_val&, int) ;
620 Tbl_val operator/(int, const Tbl_val&) ;
621 
623 Tbl_val sin(const Tbl_val& ) ;
625 Tbl_val cos(const Tbl_val& ) ;
627 Tbl_val tan(const Tbl_val& ) ;
629 Tbl_val asin(const Tbl_val& ) ;
631 Tbl_val acos(const Tbl_val& ) ;
633 Tbl_val atan(const Tbl_val& ) ;
635 Tbl_val exp(const Tbl_val& ) ;
637 Tbl_val Heaviside(const Tbl_val& ) ;
639 Tbl_val log(const Tbl_val& ) ;
641 Tbl_val log10(const Tbl_val& ) ;
643 Tbl_val sqrt(const Tbl_val& ) ;
645 Tbl_val racine_cubique (const Tbl_val&) ;
647 Tbl_val pow(const Tbl_val& , int ) ;
649 Tbl_val pow(const Tbl_val& , double ) ;
651 Tbl_val abs(const Tbl_val& ) ;
653 double max(const Tbl_val& ) ;
655 double min(const Tbl_val& ) ;
656 
658 double norme(const Tbl_val& ) ;
659 
665 double diffrel(const Tbl_val& a, const Tbl_val& b) ;
666 
672 double diffrelmax(const Tbl_val& a, const Tbl_val& b) ;
673 
676 }
677 #endif
678 
double operator()(int k, int j, int i) const
Read-only of a particular element (index (k,j,i) ) (3D case)
Definition: tbl_val.h:384
int get_fantome() const
Returns the number of hidden cells.
Definition: grille_val.h:168
Cmp log(const Cmp &)
Neperian logarithm.
Definition: cmp_math.C:299
Cmp asin(const Cmp &)
Arcsine.
Definition: cmp_math.C:147
Cmp exp(const Cmp &)
Exponential.
Definition: cmp_math.C:273
double & set_xti(int k, int j, int i)
Read/write of a particular element on the x (or ) interface (index (k,j,i) ) (3D case) ...
Definition: tbl_val.h:357
Cmp sqrt(const Cmp &)
Square root.
Definition: cmp_math.C:223
Lorene prototypes.
Definition: app_hor.h:67
double & set_zri(int i)
Read/write of a particular element on the interface (index i ) (1D case)
Definition: tbl_val.h:205
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...
Definition: tbl_val.C:339
Cmp racine_cubique(const Cmp &)
Cube root.
Definition: cmp_math.C:248
int get_ndim() const
Gives the number of dimensions (ie dim->ndim )
Definition: tbl_val.h:482
Tensor field of valence 0 (or component of a tensorial field).
Definition: scalar.h:393
void operator=(const Tbl_val &)
Assignment to another Tbl_val.
Definition: tbl_val.C:166
Base_val operator*(const Base_val &, const Base_val &)
This operator is used when calling multiplication or division of Valeur .
double get_xti(int j, int i) const
Read-only of a particular element on the x (or ) interface (index (j,i) ) (2D case) ...
Definition: tbl_val.h:296
Base class for coordinate mappings.
Definition: map.h:682
const Dim_tbl * dim
The Dim_tbl giving the dimensions and number of points (without the hidden cells).
Definition: tbl_val.h:108
double get_ypi(int k, int j, int i) const
Read-only of a particular element on the y (or ) interface (index (k,j,i) ) (3D case) ...
Definition: tbl_val.h:403
int etat
logical state (ETATNONDEF , ETATQCQ or ETATZERO ).
Definition: tbl_val.h:103
double & set_ypi(int k, int j, int i)
Read/write of a particular element on the y (or ) interface (index (k,j,i) ) (3D case) ...
Definition: tbl_val.h:342
void set_etat_nondef()
Sets the logical state to ETATNONDEF (undefined).
Definition: tbl_val.C:290
double & set_zri(int j, int i)
Read/write of a particular element on the z (or r) interface (index (j,i) ) (2D case) ...
Definition: tbl_val.h:269
void del_t()
Logical destructor: dellocates the memory occupied by the array t and sets the logical state to ETATN...
Definition: tbl_val.C:270
void operator+=(const Tbl_val &)
Addition of a Tbl_val to this.
double operator()(int i) const
Read-only of a particular element (index i ) (1D case)
Definition: tbl_val.h:215
Cmp operator/(const Cmp &, const Cmp &)
Cmp / Cmp.
Definition: cmp_arithm.C:460
Tbl min(const Cmp &)
Minimum values of a Cmp in each domain.
Definition: cmp_math.C:461
Cmp cos(const Cmp &)
Cosine.
Definition: cmp_math.C:97
Tbl diffrel(const Cmp &a, const Cmp &b)
Relative difference between two Cmp (norme version).
Definition: cmp_math.C:507
double get_zri(int i) const
Read-only of a particular element on the interface (index i ) (1D case)
Definition: tbl_val.h:229
Base class for Godunov-type grids.
Definition: grille_val.h:94
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) ...
Definition: tbl_val.h:313
Cmp tan(const Cmp &)
Tangent.
Definition: cmp_math.C:123
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Definition: tbl_val.C:297
void operator-=(const Tbl_val &)
Subtraction of a Tbl_val to this.
void operator/=(const Tbl_val &)
Division of this by a Tbl_val.
void operator*=(const Tbl_val &)
Multiplication of this by a Tbl_val.
int get_taille_i(int i) const
Gives the size of the interface arrays (including the hidden cells)
Definition: tbl_val.h:469
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) ...
Definition: tbl_val.h:372
Tbl norme(const Cmp &)
Sums of the absolute values of all the values of the Cmp in each domain.
Definition: cmp_math.C:484
Cmp atan(const Cmp &)
Arctangent.
Definition: cmp_math.C:198
Cmp operator+(const Cmp &)
Definition: cmp_arithm.C:107
int get_etat() const
Gives the logical state.
Definition: tbl_val.h:459
double operator()(int j, int i) const
Read-only of a particular element (index (j,i) ) (2D case)
Definition: tbl_val.h:279
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
Definition: tbl_val.C:283
Tbl max(const Cmp &)
Maximum values of a Cmp in each domain.
Definition: cmp_math.C:438
double * tzri
The array at z (or r) interfaces.
Definition: tbl_val.h:116
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) ...
Definition: tbl_val.h:441
Finite-difference array intended to store field values.
Definition: tbl_val.h:97
Cmp pow(const Cmp &, int)
Power .
Definition: cmp_math.C:351
void affiche_seuil(ostream &ostr, int precision=4, double threshold=1.e-7) const
Prints only the values greater than a given threshold.
Definition: tbl_val.C:432
double * typi
The array at y (or ) interfaces.
Definition: tbl_val.h:120
int ndim
Number of dimensions of the Tbl: can be 1, 2 or 3.
Definition: dim_tbl.h:101
Storage of array dimensions.
Definition: dim_tbl.h:99
friend ostream & operator<<(ostream &, const Tbl_val &)
Display.
Definition: tbl_val.C:354
int get_dim(int i) const
Gives the i th dimension (ie dim->dim[i] , without hidden cells)
Definition: tbl_val.h:485
Cmp log10(const Cmp &)
Basis 10 logarithm.
Definition: cmp_math.C:325
Cmp acos(const Cmp &)
Arccosine.
Definition: cmp_math.C:172
Cmp abs(const Cmp &)
Absolute value.
Definition: cmp_math.C:413
void annule_hard()
Sets the Tbl_val to zero in a hard way.
Definition: tbl_val.C:314
double * t
The array of double at the nodes.
Definition: tbl_val.h:114
void sauve(FILE *) const
Save in a file.
Definition: tbl_val.C:252
int get_taille() const
Gives the size of the node array (including the hidden cells)
Definition: tbl_val.h:462
double & set_xti(int j, int i)
Read/write of a particular element on the x (or ) interface (index (j,i) ) (2D case) ...
Definition: tbl_val.h:256
Cmp operator-(const Cmp &)
- Cmp
Definition: cmp_arithm.C:111
Cmp sin(const Cmp &)
Sine.
Definition: cmp_math.C:72
Mtbl Heaviside(const Mtbl &)
Heaviside function.
Definition: mtbl_math.C:320
~Tbl_val()
Destructor.
Definition: tbl_val.C:157
Tbl_val(const Grille_val *)
Constructor from a 3D grid.
Definition: tbl_val.C:86
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).
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 .
double * txti
The array at x (or ) interfaces.
Definition: tbl_val.h:118
const Grille_val * gval
The Grille_val (cartesian or spherical) on which the array is defined.
Definition: tbl_val.h:110
Tbl diffrelmax(const Cmp &a, const Cmp &b)
Relative difference between two Cmp (max version).
Definition: cmp_math.C:542
int * dim
Array of dimensions (size: ndim).
Definition: dim_tbl.h:102
const Grille_val * get_grille() const
Returns a pointer on the grid on which the Tbl_val is defined.
Definition: tbl_val.h:491
double get_xti(int k, int j, int i) const
Read-only of a particular element on the x (or ) interface (index (k,j,i) ) (3D case) ...
Definition: tbl_val.h:422