LORENE
param.h
1 /*
2  * Definition of Lorene class Param
3  *
4  */
5 
6 /*
7  * Copyright (c) 1999-2005 Eric Gourgoulhon
8  * Copyright (c) 2000-2003 Jerome Novak
9  *
10  * This file is part of LORENE.
11  *
12  * LORENE is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version.
16  *
17  * LORENE is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with LORENE; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25  *
26  */
27 
28 
29 #ifndef __PARAM_H_
30 #define __PARAM_H_
31 
32 
33 /*
34  * $Id: param.h,v 1.9 2014/10/13 08:52:36 j_novak Exp $
35  * $Log: param.h,v $
36  * Revision 1.9 2014/10/13 08:52:36 j_novak
37  * Lorene classes and functions now belong to the namespace Lorene.
38  *
39  * Revision 1.8 2006/06/15 08:15:36 j_novak
40  * Removed members linked to Qtenseur objects.
41  * Added members for Matrice objects.
42  *
43  * Revision 1.7 2005/08/13 16:08:20 m_saijo
44  * Corrected the documents related to the Star
45  *
46  * Revision 1.6 2005/08/13 16:03:36 m_saijo
47  * Added storage of a Star
48  *
49  * Revision 1.5 2005/03/24 21:55:58 e_gourgoulhon
50  * Added storage of a Scalar.
51  *
52  * Revision 1.4 2004/03/22 13:12:43 j_novak
53  * Modification of comments to use doxygen instead of doc++
54  *
55  * Revision 1.3 2003/09/25 12:08:02 j_novak
56  * Tensors can be stored in Param objects
57  *
58  * Revision 1.2 2002/09/19 09:52:42 j_novak
59  * Added objects Qtenseur and Qmetrique for 4D tensor and metric handling.
60  *
61  * Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon
62  * LORENE
63  *
64  * Revision 1.10 2001/10/27 09:26:24 novak
65  * *** empty log message ***
66  *
67  * Revision 1.9 2001/10/11 07:44:12 eric
68  * Ajout du stokage des Etoile's
69  *
70  * Revision 1.8 2000/10/24 14:54:49 novak
71  * Added the function clean_all()
72  *
73  * Revision 1.7 2000/05/25 12:39:19 eric
74  * MODIFICATION MAJEURE: pour les int et les double, ce sont desormais les
75  * adresses qui sont stokees, et non plus les nombres eux-memes
76  * (le traitement des int et des double est donc desormais completement
77  * aligne sur celui des Tbl, Cmp, etc...)
78  *
79  * Revision 1.6 1999/12/29 13:10:39 eric
80  * Ajout du stokage des Mtbl_cf.
81  *
82  * Revision 1.5 1999/12/27 12:16:43 eric
83  * Ajout du stokage des mappings (class Map).
84  *
85  * Revision 1.4 1999/12/16 10:27:40 eric
86  * Ajout des membres modifiables.
87  * Par defaut, les objets listes sont const.
88  *
89  * Revision 1.3 1999/12/15 16:49:52 eric
90  * *** empty log message ***
91  *
92  * Revision 1.2 1999/12/15 16:22:36 eric
93  * Changement de l'ordre des arguments dans add_*
94  * Argument par defaut: position = 0
95  * Ajout du stokage des int et des double.
96  *
97  * Revision 1.1 1999/12/13 14:35:56 eric
98  * Initial revision
99  *
100  *
101  * $Header: /cvsroot/Lorene/C++/Include/param.h,v 1.9 2014/10/13 08:52:36 j_novak Exp $
102  *
103  */
104 
105 namespace Lorene {
106 class Tbl ;
107 class Itbl ;
108 class Matrice ;
109 class Mtbl_cf ;
110 class Map ;
111 class Cmp ;
112 class Tenseur ;
113 class Tensor ;
114 class Scalar ;
115 class Etoile ;
116 class Star ;
117 
125 class Param {
126 
127  // Data :
128  // -----
129  private:
130  int n_int ;
131  const int** p_int ;
133 
134  int n_int_mod ;
135  int** p_int_mod ;
137 
138  int n_double ;
139  const double** p_double ;
141 
143  double** p_double_mod ;
145 
146 
147  int n_tbl ;
148  const Tbl** p_tbl ;
150 
151  int n_tbl_mod ;
152  Tbl** p_tbl_mod ;
154 
155  int n_itbl ;
156  const Itbl** p_itbl ;
158 
159  int n_itbl_mod ;
160  Itbl** p_itbl_mod ;
162 
163  int n_matrice ;
164  const Matrice** p_matrice ;
166 
170 
171  int n_cmp ;
172  const Cmp** p_cmp ;
174 
175  int n_cmp_mod ;
176  Cmp** p_cmp_mod ;
178 
179  int n_tenseur ;
180  const Tenseur** p_tenseur ;
182 
186 
187  int n_map ;
188  const Map** p_map ;
190 
191  int n_mtbl_cf ;
192  const Mtbl_cf** p_mtbl_cf ;
194 
195  int n_scalar ;
196  const Scalar** p_scalar ;
198 
200  Scalar** p_scalar_mod ;
202 
203  int n_tensor ;
204  const Tensor** p_tensor ;
206 
208  Tensor** p_tensor_mod ;
210 
211  int n_etoile ;
212  const Etoile** p_etoile ;
214 
215  int n_star ;
216  const Star** p_star ;
218 
219  // Constructors - Destructor
220  // -------------------------
221 
222  public:
223  Param() ;
224 
225  private:
229  Param(const Param& ) ;
230 
231  public:
232  ~Param() ;
233 
237  void clean_all() ;
238 
239 
240 
241  // Assignment
242  // -----------
243  private:
247  void operator=(const Param& ) ;
248 
249 
250  // Addition/Extraction of one element
251  // ----------------------------------
252  public:
253 
255  int get_n_int() const ;
256 
266  void add_int(const int& n, int position = 0) ;
267 
277  const int& get_int(int position = 0) const;
278 
280  int get_n_int_mod() const ;
281 
291  void add_int_mod(int& n, int position = 0) ;
292 
302  int& get_int_mod(int position = 0) const;
303 
304 
306  int get_n_double() const ;
307 
317  void add_double(const double& x, int position = 0) ;
318 
328  const double& get_double(int position = 0) const;
329 
330 
332  int get_n_double_mod() const ;
333 
343  void add_double_mod(double& x, int position = 0) ;
344 
355  double& get_double_mod(int position = 0) const;
356 
357 
359  int get_n_tbl() const ;
360 
369  void add_tbl(const Tbl& ti, int position = 0) ;
370 
379  const Tbl& get_tbl(int position = 0) const;
380 
381 
383  int get_n_tbl_mod() const ;
384 
393  void add_tbl_mod(Tbl& ti, int position = 0) ;
394 
404  Tbl& get_tbl_mod(int position = 0) const;
405 
406 
408  int get_n_itbl() const ;
409 
418  void add_itbl(const Itbl& ti, int position = 0) ;
419 
428  const Itbl& get_itbl(int position = 0) const;
429 
430 
432  int get_n_itbl_mod() const ;
433 
443  void add_itbl_mod(Itbl& ti, int position = 0) ;
444 
454  Itbl& get_itbl_mod(int position = 0) const;
455 
457  int get_n_matrice() const ;
458 
467  void add_matrice(const Matrice& ti, int position = 0) ;
468 
477  const Matrice& get_matrice(int position = 0) const;
478 
479 
481  int get_n_matrice_mod() const ;
482 
491  void add_matrice_mod(Matrice& ti, int position = 0) ;
492 
502  Matrice& get_matrice_mod(int position = 0) const;
503 
504 
506  int get_n_cmp() const ;
507 
516  void add_cmp(const Cmp& ti, int position = 0) ;
517 
526  const Cmp& get_cmp(int position = 0) const;
527 
528 
530  int get_n_cmp_mod() const ;
531 
540  void add_cmp_mod(Cmp& ti, int position = 0) ;
541 
551  Cmp& get_cmp_mod(int position = 0) const;
552 
553 
555  int get_n_tenseur() const ;
556 
565  void add_tenseur(const Tenseur& ti, int position = 0) ;
566 
575  const Tenseur& get_tenseur(int position = 0) const;
576 
577 
579  int get_n_tenseur_mod() const ;
580 
589  void add_tenseur_mod(Tenseur& ti, int position = 0) ;
590 
600  Tenseur& get_tenseur_mod(int position = 0) const;
601 
603  int get_n_map() const ;
604 
613  void add_map(const Map& mi, int position = 0) ;
614 
623  const Map& get_map(int position = 0) const;
624 
626  int get_n_mtbl_cf() const ;
627 
636  void add_mtbl_cf(const Mtbl_cf& mi, int position = 0) ;
637 
646  const Mtbl_cf& get_mtbl_cf(int position = 0) const;
647 
649  int get_n_scalar() const ;
650 
659  void add_scalar(const Scalar& ti, int position = 0) ;
660 
669  const Scalar& get_scalar(int position = 0) const;
670 
671 
673  int get_n_scalar_mod() const ;
674 
683  void add_scalar_mod(Scalar& ti, int position = 0) ;
684 
694  Scalar& get_scalar_mod(int position = 0) const;
695 
696 
698  int get_n_tensor() const ;
699 
708  void add_tensor(const Tensor& ti, int position = 0) ;
709 
718  const Tensor& get_tensor(int position = 0) const;
719 
720 
722  int get_n_tensor_mod() const ;
723 
732  void add_tensor_mod(Tensor& ti, int position = 0) ;
733 
743  Tensor& get_tensor_mod(int position = 0) const;
744 
746  int get_n_etoile() const ;
747 
756  void add_etoile(const Etoile& eti, int position = 0) ;
757 
766  const Etoile& get_etoile(int position = 0) const;
767 
769  int get_n_star() const ;
770 
779  void add_star(const Star& eti, int position = 0) ;
780 
789  const Star& get_star(int position = 0) const;
790 
791  };
792 
793 }
794 #endif
int n_mtbl_cf
Number of Mtbl_cf 's.
Definition: param.h:191
Cmp ** p_cmp_mod
Array (size n_cmp_mod ) of the modifiable Cmp 's addresses.
Definition: param.h:177
const Tensor & get_tensor(int position=0) const
Returns the reference of a Tensor stored in the list.
Definition: param.C:1534
int get_n_cmp() const
Returns the number of Cmp 's addresses in the list.
Definition: param.C:931
void add_tbl_mod(Tbl &ti, int position=0)
Adds the address of a new modifiable Tbl to the list.
Definition: param.C:594
int get_n_cmp_mod() const
Returns the number of modifiable Cmp 's addresses in the list.
Definition: param.C:1000
Base class for stars *** DEPRECATED : use class Star instead ***.
Definition: etoile.h:427
void add_tensor(const Tensor &ti, int position=0)
Adds the address of a new Tensor to the list.
Definition: param.C:1489
int get_n_scalar_mod() const
Returns the number of modifiable Scalar 's addresses in the list.
Definition: param.C:1413
const Etoile & get_etoile(int position=0) const
Returns the reference of a Etoile stored in the list.
Definition: param.C:1672
const Cmp & get_cmp(int position=0) const
Returns the reference of a Cmp stored in the list.
Definition: param.C:983
const Tenseur & get_tenseur(int position=0) const
Returns the reference of a Tenseur stored in the list.
Definition: param.C:1121
void add_matrice(const Matrice &ti, int position=0)
Adds the address of a new Matrice to the list.
Definition: param.C:800
const Cmp ** p_cmp
Array (size n_cmp ) of the Cmp 's addresses.
Definition: param.h:173
void add_tenseur_mod(Tenseur &ti, int position=0)
Adds the address of a new modifiable Tenseur to the list.
Definition: param.C:1145
double & get_double_mod(int position=0) const
Returns the reference of a stored modifiable double .
Definition: param.C:501
Tenseur & get_tenseur_mod(int position=0) const
Returns the reference of a modifiable Tenseur stored in the list.
Definition: param.C:1190
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Definition: cmp.h:446
const double ** p_double
Array (size n_double ) of the double 's addresses.
Definition: param.h:140
void add_int(const int &n, int position=0)
Adds the address of a new int to the list.
Definition: param.C:249
int get_n_matrice_mod() const
Returns the number of modifiable Matrice 's addresses in the list.
Definition: param.C:862
int n_matrice
Number of Matrice 's.
Definition: param.h:163
Lorene prototypes.
Definition: app_hor.h:67
int get_n_tenseur_mod() const
Returns the number of modifiable Tenseur 's addresses in the list.
Definition: param.C:1138
int get_n_tensor() const
Returns the number of Tensor 's addresses in the list.
Definition: param.C:1482
int get_n_star() const
Returns the number of Star 's addresses in the list.
Definition: param.C:1686
Tensor field of valence 0 (or component of a tensorial field).
Definition: scalar.h:393
const Star & get_star(int position=0) const
Returns the reference of a Star stored in the list.
Definition: param.C:1738
void add_matrice_mod(Matrice &ti, int position=0)
Adds the address of a new modifiable Matrice to the list.
Definition: param.C:869
Base class for coordinate mappings.
Definition: map.h:682
void operator=(const Param &)
Assignment operator (private and not implemented to make Param a non-copyable class) ...
int n_cmp
Number of Cmp 's.
Definition: param.h:171
int n_tenseur_mod
Number of modifiable Tenseur 's.
Definition: param.h:183
const Map & get_map(int position=0) const
Returns the reference of a Map stored in the list.
Definition: param.C:1259
Basic integer array class.
Definition: itbl.h:122
Tenseur ** p_tenseur_mod
Array (size n_tenseur_mod ) of the modifiable Tenseur 's addresses.
Definition: param.h:185
int n_itbl
Number of Itbl 's.
Definition: param.h:155
Base class for stars.
Definition: star.h:175
void add_mtbl_cf(const Mtbl_cf &mi, int position=0)
Adds the address of a new Mtbl_cf to the list.
Definition: param.C:1282
int n_tensor
Number of Tensor 's.
Definition: param.h:203
void clean_all()
Deletes all the objects stored as modifiables, i.e.
Definition: param.C:177
int n_int_mod
Number of modifiable int 's (integers).
Definition: param.h:134
void add_double_mod(double &x, int position=0)
Adds the address of a new modifiable double to the list.
Definition: param.C:456
int get_n_etoile() const
Returns the number of Etoile 's addresses in the list.
Definition: param.C:1620
void add_itbl_mod(Itbl &ti, int position=0)
Adds the address of a new modifiable Itbl to the list.
Definition: param.C:732
int n_double
Number of double 's (double precis.
Definition: param.h:138
Cmp & get_cmp_mod(int position=0) const
Returns the reference of a modifiable Cmp stored in the list.
Definition: param.C:1052
void add_star(const Star &eti, int position=0)
Adds the address of a new Star to the list.
Definition: param.C:1693
const Tbl & get_tbl(int position=0) const
Returns the reference of a Tbl stored in the list.
Definition: param.C:570
const Scalar & get_scalar(int position=0) const
Returns the reference of a Scalar stored in the list.
Definition: param.C:1396
Tensor & get_tensor_mod(int position=0) const
Returns the reference of a modifiable Tensor stored in the list.
Definition: param.C:1603
int get_n_double() const
Returns the number of stored double 's addresses.
Definition: param.C:311
int get_n_int() const
Returns the number of stored int 's addresses.
Definition: param.C:242
const int & get_int(int position=0) const
Returns the reference of a int stored in the list.
Definition: param.C:295
int get_n_tenseur() const
Returns the number of Tenseur 's addresses in the list.
Definition: param.C:1069
void add_cmp(const Cmp &ti, int position=0)
Adds the address of a new Cmp to the list.
Definition: param.C:938
void add_map(const Map &mi, int position=0)
Adds the address of a new Map to the list.
Definition: param.C:1214
int ** p_int_mod
Array (size n_int_mod ) of the modifiable int 's addresses.
Definition: param.h:136
const Map ** p_map
Array (size n_map ) of the Map 's addresses.
Definition: param.h:189
int n_star
Number of Star 's.
Definition: param.h:215
int n_double_mod
Number of modifiable double 's (double precis.
Definition: param.h:142
Matrix handling.
Definition: matrice.h:152
int get_n_itbl_mod() const
Returns the number of modifiable Itbl 's addresses in the list.
Definition: param.C:725
int get_n_itbl() const
Returns the number of Itbl 's addresses in the list.
Definition: param.C:656
int get_n_tensor_mod() const
Returns the number of modifiable Tensor 's addresses in the list.
Definition: param.C:1551
const Tbl ** p_tbl
Array (size n_tbl ) of the Tbl 's addresses.
Definition: param.h:149
void add_tensor_mod(Tensor &ti, int position=0)
Adds the address of a new modifiable Tensor to the list.
Definition: param.C:1558
Parameter storage.
Definition: param.h:125
void add_tbl(const Tbl &ti, int position=0)
Adds the address of a new Tbl to the list.
Definition: param.C:525
Tbl & get_tbl_mod(int position=0) const
Returns the reference of a modifiable Tbl stored in the list.
Definition: param.C:639
int get_n_double_mod() const
Returns the number of stored modifiable double 's addresses.
Definition: param.C:449
const Star ** p_star
Array (size n_star ) of the Star 's addresses.
Definition: param.h:217
Scalar ** p_scalar_mod
Array (size n_scalar_mod ) of the modifiable Scalar 's addresses.
Definition: param.h:201
int & get_int_mod(int position=0) const
Returns the reference of a modifiable int stored in the list.
Definition: param.C:433
const Scalar ** p_scalar
Array (size n_scalar ) of the Scalar 's addresses.
Definition: param.h:197
Itbl & get_itbl_mod(int position=0) const
Returns the reference of a stored modifiable Itbl .
Definition: param.C:777
Tensor ** p_tensor_mod
Array (size n_tensor_mod ) of the modifiable Tensor 's addresses.
Definition: param.h:209
int n_itbl_mod
Number of modifiable Itbl 's.
Definition: param.h:159
int n_tenseur
Number of Tenseur 's.
Definition: param.h:179
Tensor handling.
Definition: tensor.h:294
int n_tbl
Number of Tbl 's.
Definition: param.h:147
int get_n_int_mod() const
Returns the number of modifiable int 's addresses in the list.
Definition: param.C:381
int n_int
Number of int 's (integers).
Definition: param.h:130
int get_n_map() const
Returns the number of Map 's addresses in the list.
Definition: param.C:1207
int n_matrice_mod
Number of modifiable Matrice 's.
Definition: param.h:167
int n_cmp_mod
Number of modifiable Cmp 's.
Definition: param.h:175
int get_n_tbl() const
Returns the number of Tbl 's addresses in the list.
Definition: param.C:518
void add_etoile(const Etoile &eti, int position=0)
Adds the address of a new Etoile to the list.
Definition: param.C:1627
const Mtbl_cf & get_mtbl_cf(int position=0) const
Returns the reference of a Mtbl_cf stored in the list.
Definition: param.C:1328
const Mtbl_cf ** p_mtbl_cf
Array (size n_mtbl_cf ) of the Mtbl_cf 's addresses.
Definition: param.h:193
int get_n_tbl_mod() const
Returns the number of modifiable Tbl 's addresses in the list.
Definition: param.C:587
void add_scalar(const Scalar &ti, int position=0)
Adds the address of a new Scalar to the list.
Definition: param.C:1351
void add_scalar_mod(Scalar &ti, int position=0)
Adds the address of a new modifiable Scalar to the list.
Definition: param.C:1420
int n_etoile
Number of Etoile 's.
Definition: param.h:211
int n_scalar
Number of Scalar 's.
Definition: param.h:195
int get_n_mtbl_cf() const
Returns the number of Mtbl_cf 's addresses in the list.
Definition: param.C:1275
const Tenseur ** p_tenseur
Array (size n_tenseur ) of the Tenseur 's addresses.
Definition: param.h:181
int get_n_matrice() const
Returns the number of Matrice 's addresses in the list.
Definition: param.C:793
int n_scalar_mod
Number of modifiable Scalar 's.
Definition: param.h:199
Scalar & get_scalar_mod(int position=0) const
Returns the reference of a modifiable Scalar stored in the list.
Definition: param.C:1465
void add_double(const double &x, int position=0)
Adds the the address of a new double to the list.
Definition: param.C:318
const Etoile ** p_etoile
Array (size n_etoile ) of the Etoile 's addresses.
Definition: param.h:213
int n_tbl_mod
Number of modifiable Tbl 's.
Definition: param.h:151
Coefficients storage for the multi-domain spectral method.
Definition: mtbl_cf.h:196
Matrice & get_matrice_mod(int position=0) const
Returns the reference of a modifiable Matrice stored in the list.
Definition: param.C:914
const Itbl & get_itbl(int position=0) const
Returns the reference of a Itbl stored in the list.
Definition: param.C:708
void add_tenseur(const Tenseur &ti, int position=0)
Adds the address of a new Tenseur to the list.
Definition: param.C:1076
const Itbl ** p_itbl
Array (size n_itbl ) of the Itbl 's addresses.
Definition: param.h:157
const Matrice & get_matrice(int position=0) const
Returns the reference of a Matrice stored in the list.
Definition: param.C:845
double ** p_double_mod
Array (size n_double_mod ) of the double 's addresses.
Definition: param.h:144
const double & get_double(int position=0) const
Returns the reference of a double stored in the list.
Definition: param.C:364
Basic array class.
Definition: tbl.h:164
void add_cmp_mod(Cmp &ti, int position=0)
Adds the address of a new modifiable Cmp to the list.
Definition: param.C:1007
void add_itbl(const Itbl &ti, int position=0)
Adds the address of a new Itbl to the list.
Definition: param.C:663
const Tensor ** p_tensor
Array (size n_tensor ) of the Tensor 's addresses.
Definition: param.h:205
const int ** p_int
Array (size n_int ) of the int 's addresses.
Definition: param.h:132
~Param()
Destructor.
Definition: param.C:147
int get_n_scalar() const
Returns the number of Scalar 's addresses in the list.
Definition: param.C:1344
Tbl ** p_tbl_mod
Array (size n_tbl_mod ) of the modifiable Tbl 's addresses.
Definition: param.h:153
const Matrice ** p_matrice
Array (size n_matrice ) of the Matrice 's addresses.
Definition: param.h:165
Tensor handling *** DEPRECATED : use class Tensor instead ***.
Definition: tenseur.h:304
void add_int_mod(int &n, int position=0)
Adds the address of a new modifiable int to the list.
Definition: param.C:388
int n_map
Number of Map 's.
Definition: param.h:187
int n_tensor_mod
Number of modifiable Tensor 's.
Definition: param.h:207
Matrice ** p_matrice_mod
Array (size n_matrice_mod ) of the modifiable Matrice 's addresses.
Definition: param.h:169
Param()
Default constructor is the only constructor.
Definition: param.C:118
Itbl ** p_itbl_mod
Array (size n_itbl_mod ) of the modifiable Itbl 's addresses.
Definition: param.h:161