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
105namespace Lorene {
106class Tbl ;
107class Itbl ;
108class Matrice ;
109class Mtbl_cf ;
110class Map ;
111class Cmp ;
112class Tenseur ;
113class Tensor ;
114class Scalar ;
115class Etoile ;
116class Star ;
117
125class Param {
126
127 // Data :
128 // -----
129 private:
130 int n_int ;
132 const int** p_int ;
133
136 int** p_int_mod ;
137
138 int n_double ;
140 const double** p_double ;
141
144 double** p_double_mod ;
145
146
147 int n_tbl ;
149 const Tbl** p_tbl ;
150
154
155 int n_itbl ;
157 const Itbl** p_itbl ;
158
162
166
170
171 int n_cmp ;
173 const Cmp** p_cmp ;
174
178
182
186
187 int n_map ;
189 const Map** p_map ;
190
194
195 int n_scalar ;
197 const Scalar** p_scalar ;
198
202
203 int n_tensor ;
205 const Tensor** p_tensor ;
206
210
211 int n_etoile ;
213 const Etoile** p_etoile ;
214
215 int n_star ;
217 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
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Definition cmp.h:446
Base class for stars *** DEPRECATED : use class Star instead ***.
Definition etoile.h:424
Basic integer array class.
Definition itbl.h:122
Base class for coordinate mappings.
Definition map.h:670
Matrix handling.
Definition matrice.h:152
Coefficients storage for the multi-domain spectral method.
Definition mtbl_cf.h:186
Parameter storage.
Definition param.h:125
int get_n_cmp_mod() const
Returns the number of modifiable Cmp 's addresses in the list.
Definition param.C:997
Tensor & get_tensor_mod(int position=0) const
Returns the reference of a modifiable Tensor stored in the list.
Definition param.C:1600
void add_double(const double &x, int position=0)
Adds the the address of a new double to the list.
Definition param.C:315
const Itbl & get_itbl(int position=0) const
Returns the reference of a Itbl stored in the list.
Definition param.C:705
int get_n_itbl() const
Returns the number of Itbl 's addresses in the list.
Definition param.C:653
const Map ** p_map
Array (size n_map ) of the Map 's addresses.
Definition param.h:189
int get_n_itbl_mod() const
Returns the number of modifiable Itbl 's addresses in the list.
Definition param.C:722
const Mtbl_cf ** p_mtbl_cf
Array (size n_mtbl_cf ) of the Mtbl_cf 's addresses.
Definition param.h:193
const int ** p_int
Array (size n_int ) of the int 's addresses.
Definition param.h:132
Param(const Param &)
Copy constructor (private and not implemented to make Param a non-copyable class)
int n_scalar
Number of Scalar 's
Definition param.h:195
~Param()
Destructor.
Definition param.C:144
int n_matrice
Number of Matrice 's
Definition param.h:163
void add_scalar_mod(Scalar &ti, int position=0)
Adds the address of a new modifiable Scalar to the list.
Definition param.C:1417
Cmp & get_cmp_mod(int position=0) const
Returns the reference of a modifiable Cmp stored in the list.
Definition param.C:1049
Scalar ** p_scalar_mod
Array (size n_scalar_mod ) of the modifiable Scalar 's addresses.
Definition param.h:201
int get_n_matrice_mod() const
Returns the number of modifiable Matrice 's addresses in the list.
Definition param.C:859
void add_matrice(const Matrice &ti, int position=0)
Adds the address of a new Matrice to the list.
Definition param.C:797
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
const double ** p_double
Array (size n_double ) of the double 's addresses.
Definition param.h:140
void add_map(const Map &mi, int position=0)
Adds the address of a new Map to the list.
Definition param.C:1211
int n_int_mod
Number of modifiable int 's (integers).
Definition param.h:134
Scalar & get_scalar_mod(int position=0) const
Returns the reference of a modifiable Scalar stored in the list.
Definition param.C:1462
const Star ** p_star
Array (size n_star ) of the Star 's addresses.
Definition param.h:217
const Scalar ** p_scalar
Array (size n_scalar ) of the Scalar 's addresses.
Definition param.h:197
const int & get_int(int position=0) const
Returns the reference of a int stored in the list.
Definition param.C:292
const double & get_double(int position=0) const
Returns the reference of a double stored in the list.
Definition param.C:361
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:1279
int get_n_tbl_mod() const
Returns the number of modifiable Tbl 's addresses in the list.
Definition param.C:584
Itbl & get_itbl_mod(int position=0) const
Returns the reference of a stored modifiable Itbl .
Definition param.C:774
int get_n_double_mod() const
Returns the number of stored modifiable double 's addresses.
Definition param.C:446
void add_tensor_mod(Tensor &ti, int position=0)
Adds the address of a new modifiable Tensor to the list.
Definition param.C:1555
int get_n_tenseur() const
Returns the number of Tenseur 's addresses in the list.
Definition param.C:1066
void add_star(const Star &eti, int position=0)
Adds the address of a new Star to the list.
Definition param.C:1690
int get_n_int_mod() const
Returns the number of modifiable int 's addresses in the list.
Definition param.C:378
Tbl & get_tbl_mod(int position=0) const
Returns the reference of a modifiable Tbl stored in the list.
Definition param.C:636
const Star & get_star(int position=0) const
Returns the reference of a Star stored in the list.
Definition param.C:1735
int get_n_scalar_mod() const
Returns the number of modifiable Scalar 's addresses in the list.
Definition param.C:1410
Tensor ** p_tensor_mod
Array (size n_tensor_mod ) of the modifiable Tensor 's addresses.
Definition param.h:209
void clean_all()
Deletes all the objects stored as modifiables, i.e.
Definition param.C:174
const Tenseur & get_tenseur(int position=0) const
Returns the reference of a Tenseur stored in the list.
Definition param.C:1118
int get_n_etoile() const
Returns the number of Etoile 's addresses in the list.
Definition param.C:1617
void add_cmp_mod(Cmp &ti, int position=0)
Adds the address of a new modifiable Cmp to the list.
Definition param.C:1004
void add_etoile(const Etoile &eti, int position=0)
Adds the address of a new Etoile to the list.
Definition param.C:1624
int get_n_tenseur_mod() const
Returns the number of modifiable Tenseur 's addresses in the list.
Definition param.C:1135
int n_itbl
Number of Itbl 's
Definition param.h:155
Tenseur ** p_tenseur_mod
Array (size n_tenseur_mod ) of the modifiable Tenseur 's addresses.
Definition param.h:185
double ** p_double_mod
Array (size n_double_mod ) of the double 's addresses.
Definition param.h:144
int n_tbl
Number of Tbl 's
Definition param.h:147
void add_matrice_mod(Matrice &ti, int position=0)
Adds the address of a new modifiable Matrice to the list.
Definition param.C:866
int get_n_tensor() const
Returns the number of Tensor 's addresses in the list.
Definition param.C:1479
int get_n_map() const
Returns the number of Map 's addresses in the list.
Definition param.C:1204
const Map & get_map(int position=0) const
Returns the reference of a Map stored in the list.
Definition param.C:1256
int get_n_cmp() const
Returns the number of Cmp 's addresses in the list.
Definition param.C:928
int n_double_mod
Number of modifiable double 's (double precis.
Definition param.h:142
void add_tensor(const Tensor &ti, int position=0)
Adds the address of a new Tensor to the list.
Definition param.C:1486
const Scalar & get_scalar(int position=0) const
Returns the reference of a Scalar stored in the list.
Definition param.C:1393
const Tensor ** p_tensor
Array (size n_tensor ) of the Tensor 's addresses.
Definition param.h:205
int n_int
Number of int 's (integers).
Definition param.h:130
Tenseur & get_tenseur_mod(int position=0) const
Returns the reference of a modifiable Tenseur stored in the list.
Definition param.C:1187
int get_n_mtbl_cf() const
Returns the number of Mtbl_cf 's addresses in the list.
Definition param.C:1272
void add_cmp(const Cmp &ti, int position=0)
Adds the address of a new Cmp to the list.
Definition param.C:935
Matrice ** p_matrice_mod
Array (size n_matrice_mod ) of the modifiable Matrice 's addresses.
Definition param.h:169
const Tbl ** p_tbl
Array (size n_tbl ) of the Tbl 's addresses.
Definition param.h:149
int get_n_tensor_mod() const
Returns the number of modifiable Tensor 's addresses in the list.
Definition param.C:1548
void add_scalar(const Scalar &ti, int position=0)
Adds the address of a new Scalar to the list.
Definition param.C:1348
void add_double_mod(double &x, int position=0)
Adds the address of a new modifiable double to the list.
Definition param.C:453
void operator=(const Param &)
Assignment operator (private and not implemented to make Param a non-copyable class)
Matrice & get_matrice_mod(int position=0) const
Returns the reference of a modifiable Matrice stored in the list.
Definition param.C:911
Cmp ** p_cmp_mod
Array (size n_cmp_mod ) of the modifiable Cmp 's addresses.
Definition param.h:177
int get_n_matrice() const
Returns the number of Matrice 's addresses in the list.
Definition param.C:790
void add_int_mod(int &n, int position=0)
Adds the address of a new modifiable int to the list.
Definition param.C:385
int ** p_int_mod
Array (size n_int_mod ) of the modifiable int 's addresses.
Definition param.h:136
Itbl ** p_itbl_mod
Array (size n_itbl_mod ) of the modifiable Itbl 's addresses.
Definition param.h:161
int n_itbl_mod
Number of modifiable Itbl 's
Definition param.h:159
const Tenseur ** p_tenseur
Array (size n_tenseur ) of the Tenseur 's addresses.
Definition param.h:181
int n_mtbl_cf
Number of Mtbl_cf 's
Definition param.h:191
void add_tenseur(const Tenseur &ti, int position=0)
Adds the address of a new Tenseur to the list.
Definition param.C:1073
void add_tbl_mod(Tbl &ti, int position=0)
Adds the address of a new modifiable Tbl to the list.
Definition param.C:591
int n_tensor
Number of Tensor 's
Definition param.h:203
int n_tenseur
Number of Tenseur 's
Definition param.h:179
void add_itbl_mod(Itbl &ti, int position=0)
Adds the address of a new modifiable Itbl to the list.
Definition param.C:729
const Cmp ** p_cmp
Array (size n_cmp ) of the Cmp 's addresses.
Definition param.h:173
const Etoile ** p_etoile
Array (size n_etoile ) of the Etoile 's addresses.
Definition param.h:213
void add_tenseur_mod(Tenseur &ti, int position=0)
Adds the address of a new modifiable Tenseur to the list.
Definition param.C:1142
const Tbl & get_tbl(int position=0) const
Returns the reference of a Tbl stored in the list.
Definition param.C:567
int get_n_scalar() const
Returns the number of Scalar 's addresses in the list.
Definition param.C:1341
Param()
Default constructor is the only constructor.
Definition param.C:115
int get_n_star() const
Returns the number of Star 's addresses in the list.
Definition param.C:1683
const Itbl ** p_itbl
Array (size n_itbl ) of the Itbl 's addresses.
Definition param.h:157
int n_double
Number of double 's (double precis.
Definition param.h:138
int n_etoile
Number of Etoile 's.
Definition param.h:211
const Tensor & get_tensor(int position=0) const
Returns the reference of a Tensor stored in the list.
Definition param.C:1531
int get_n_double() const
Returns the number of stored double 's addresses.
Definition param.C:308
int get_n_int() const
Returns the number of stored int 's addresses.
Definition param.C:239
const Cmp & get_cmp(int position=0) const
Returns the reference of a Cmp stored in the list.
Definition param.C:980
int n_tenseur_mod
Number of modifiable Tenseur 's
Definition param.h:183
int n_cmp_mod
Number of modifiable Cmp 's
Definition param.h:175
int n_matrice_mod
Number of modifiable Matrice 's
Definition param.h:167
int & get_int_mod(int position=0) const
Returns the reference of a modifiable int stored in the list.
Definition param.C:430
int n_tbl_mod
Number of modifiable Tbl 's
Definition param.h:151
void add_itbl(const Itbl &ti, int position=0)
Adds the address of a new Itbl to the list.
Definition param.C:660
double & get_double_mod(int position=0) const
Returns the reference of a stored modifiable double .
Definition param.C:498
int n_star
Number of Star 's.
Definition param.h:215
int n_map
Number of Map 's
Definition param.h:187
void add_int(const int &n, int position=0)
Adds the address of a new int to the list.
Definition param.C:246
int n_scalar_mod
Number of modifiable Scalar 's
Definition param.h:199
const Etoile & get_etoile(int position=0) const
Returns the reference of a Etoile stored in the list.
Definition param.C:1669
const Matrice & get_matrice(int position=0) const
Returns the reference of a Matrice stored in the list.
Definition param.C:842
int get_n_tbl() const
Returns the number of Tbl 's addresses in the list.
Definition param.C:515
int n_tensor_mod
Number of modifiable Tensor 's
Definition param.h:207
int n_cmp
Number of Cmp 's
Definition param.h:171
void add_tbl(const Tbl &ti, int position=0)
Adds the address of a new Tbl to the list.
Definition param.C:522
const Mtbl_cf & get_mtbl_cf(int position=0) const
Returns the reference of a Mtbl_cf stored in the list.
Definition param.C:1325
Tensor field of valence 0 (or component of a tensorial field).
Definition scalar.h:387
Base class for stars.
Definition star.h:175
Basic array class.
Definition tbl.h:161
Tensor handling *** DEPRECATED : use class Tensor instead ***.
Definition tenseur.h:301
Tensor handling.
Definition tensor.h:288
Lorene prototypes.
Definition app_hor.h:64