LORENE
base_val_manip.C
1 /*
2  * Copyright (c) 2001 Jerome Novak
3  *
4  * This file is part of LORENE.
5  *
6  * LORENE is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * LORENE is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with LORENE; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  */
21 
22 
23 
24 
25 /*
26  * $Id: base_val_manip.C,v 1.13 2016/12/05 16:17:44 j_novak Exp $
27  * $Log: base_val_manip.C,v $
28  * Revision 1.13 2016/12/05 16:17:44 j_novak
29  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
30  *
31  * Revision 1.12 2015/03/09 10:32:27 j_novak
32  * Inclusion of r-Legendre bases.
33  *
34  * Revision 1.11 2014/10/13 08:52:38 j_novak
35  * Lorene classes and functions now belong to the namespace Lorene.
36  *
37  * Revision 1.10 2014/10/06 15:12:56 j_novak
38  * Modified #include directives to use c++ syntax.
39  *
40  * Revision 1.9 2009/10/08 16:20:13 j_novak
41  * Addition of new bases T_COS and T_SIN.
42  *
43  * Revision 1.8 2008/12/03 15:21:21 j_novak
44  * New method mult_cost.
45  *
46  * Revision 1.7 2008/02/18 13:53:38 j_novak
47  * Removal of special indentation instructions.
48  *
49  * Revision 1.6 2004/11/23 15:08:00 m_forot
50  * Added the bases for the cases without any equatorial symmetry
51  * (T_COSSIN_C, T_COSSIN_S, T_LEG, R_CHEBPI_P, R_CHEBPI_I).
52  *
53  * Revision 1.5 2004/01/27 14:31:26 j_novak
54  * New method Base_val::mult_sint()
55  *
56  * Revision 1.4 2004/01/27 14:13:59 j_novak
57  * Added method Base_val::mult_x()
58  *
59  * Revision 1.3 2003/09/16 08:54:09 j_novak
60  * Addition of the T_LEG_II base (odd in theta, only for odd m) and the
61  * transformation functions to and from the T_SIN_P base.
62  *
63  * Revision 1.2 2002/10/16 14:36:30 j_novak
64  * Reorganization of #include instructions of standard C++, in order to
65  * use experimental version 3 of gcc.
66  *
67  * Revision 1.1.1.1 2001/11/20 15:19:28 e_gourgoulhon
68  * LORENE
69  *
70  * Revision 1.3 2001/10/12 15:06:50 novak
71  * *** empty log message ***
72  *
73  * Revision 1.2 2001/10/12 15:05:14 novak
74  * *** empty log message ***
75  *
76  * Revision 1.1 2001/10/12 14:57:24 novak
77  * Initial revision
78  *
79  *
80  * $Header: /cvsroot/Lorene/C++/Source/Base_val/base_val_manip.C,v 1.13 2016/12/05 16:17:44 j_novak Exp $
81  *
82  */
83 
84 // Headers C
85 #include <cstdlib>
86 #include <cassert>
87 
88 // Headers Lorene
89 #include "headcpp.h"
90 #include "type_parite.h"
91 #include "base_val.h"
92 
93 namespace Lorene {
95 
96  switch(get_base_r(0)) {
97  case R_CHEBP:
98  set_base_r(0, R_CHEBI) ;
99  break ;
100  case R_CHEBI:
101  set_base_r(0, R_CHEBP) ;
102  break ;
103  case R_CHEBPIM_P:
104  set_base_r(0, R_CHEBPIM_I) ;
105  break ;
106  case R_CHEBPIM_I:
107  set_base_r(0, R_CHEBPIM_P) ;
108  break ;
109  case R_CHEBPI_P:
110  set_base_r(0, R_CHEBPI_I) ;
111  break ;
112  case R_CHEBPI_I:
113  set_base_r(0, R_CHEBPI_P) ;
114  break ;
115  case R_LEGP:
116  set_base_r(0, R_LEGI) ;
117  break ;
118  case R_LEGI:
119  set_base_r(0, R_LEGP) ;
120  break ;
121  default:
122  break ;
123  }
124  return ;
125 }
126 
127 void Base_val::sx() {
128 
129  switch(get_base_r(0)) {
130  case R_CHEBP:
131  set_base_r(0, R_CHEBI) ;
132  break ;
133  case R_CHEBI:
134  set_base_r(0, R_CHEBP) ;
135  break ;
136  case R_CHEBPIM_P:
137  set_base_r(0, R_CHEBPIM_I) ;
138  break ;
139  case R_CHEBPIM_I:
140  set_base_r(0, R_CHEBPIM_P) ;
141  break ;
142  case R_CHEBPI_P:
143  set_base_r(0, R_CHEBPI_I) ;
144  break ;
145  case R_CHEBPI_I:
146  set_base_r(0, R_CHEBPI_P) ;
147  break ;
148  case R_LEGP:
149  set_base_r(0, R_LEGI) ;
150  break ;
151  case R_LEGI:
152  set_base_r(0, R_LEGP) ;
153  break ;
154  default:
155  break ;
156  }
157  return ;
158 }
159 
161 
162  switch(get_base_r(0)) {
163  case R_CHEBP:
164  set_base_r(0, R_CHEBI) ;
165  break ;
166  case R_CHEBI:
167  set_base_r(0, R_CHEBP) ;
168  break ;
169  case R_CHEBPIM_P:
170  set_base_r(0, R_CHEBPIM_I) ;
171  break ;
172  case R_CHEBPIM_I:
173  set_base_r(0, R_CHEBPIM_P) ;
174  break ;
175  case R_CHEBPI_P:
176  set_base_r(0, R_CHEBPI_I) ;
177  break ;
178  case R_CHEBPI_I:
179  set_base_r(0, R_CHEBPI_P) ;
180  break ;
181  case R_LEGP:
182  set_base_r(0, R_LEGI) ;
183  break ;
184  case R_LEGI:
185  set_base_r(0, R_LEGP) ;
186  break ;
187  default:
188  break ;
189  }
190  return ;
191 }
192 
194 
195  switch(get_base_t(0)) {
196  case T_COS_P:
198  break ;
199  case T_COS_I:
201  break ;
202  case T_SIN_P:
204  break ;
205  case T_SIN_I:
207  break ;
208  case T_COSSIN_CP:
210  break ;
211  case T_COSSIN_SP:
213  break ;
214  case T_COSSIN_CI:
216  break ;
217  case T_COSSIN_SI:
219  break ;
220  case T_COSSIN_C:
222  break ;
223  case T_COSSIN_S:
225  break ;
226  case T_COS:
227  set_base_t(T_SIN) ;
228  break ;
229  case T_SIN:
230  set_base_t(T_COS) ;
231  break ;
232  default:
233  cout << "Wrong base in Base_val::dsdt()!" << endl ;
234  abort() ;
235  exit(-1) ;
236  break ;
237  }
238  return ;
239 }
240 
242 
243  switch(get_base_t(0)) {
244  case T_COS_P:
246  break ;
247  case T_COS_I:
249  break ;
250  case T_SIN_P:
252  break ;
253  case T_SIN_I:
255  break ;
256  case T_COSSIN_CP:
258  break ;
259  case T_COSSIN_SP:
261  break ;
262  case T_COSSIN_CI:
264  break ;
265  case T_COSSIN_SI:
267  break ;
268  case T_COSSIN_C:
270  break ;
271  case T_COSSIN_S:
273  break ;
274  case T_COS:
275  set_base_t(T_SIN) ;
276  break ;
277  case T_SIN:
278  set_base_t(T_COS) ;
279  break ;
280  default:
281  cout << "Wrong base in Base_val::ssint()!" << endl ;
282  abort() ;
283  exit(-1) ;
284  break ;
285  }
286  return ;
287 }
288 
290 
291  switch(get_base_t(0)) {
292  case T_COS_P:
294  break ;
295  case T_COS_I:
297  break ;
298  case T_SIN_P:
300  break ;
301  case T_SIN_I:
303  break ;
304  case T_COSSIN_CP:
306  break ;
307  case T_COSSIN_SP:
309  break ;
310  case T_COSSIN_CI:
312  break ;
313  case T_COSSIN_SI:
315  break ;
316  case T_COSSIN_C:
318  break ;
319  case T_COSSIN_S:
321  break ;
322  case T_COS:
323  set_base_t(T_SIN) ;
324  break ;
325  case T_SIN:
326  set_base_t(T_COS) ;
327  break ;
328  default:
329  cout << "Wrong base in Base_val::mult_sint()!" << endl ;
330  abort() ;
331  exit(-1) ;
332  break ;
333  }
334  return ;
335 }
336 
338 
339  switch(get_base_t(0)) {
340  case T_COS_P:
342  break ;
343  case T_COS_I:
345  break ;
346  case T_SIN_P:
348  break ;
349  case T_SIN_I:
351  break ;
352  case T_COSSIN_CP:
354  break ;
355  case T_COSSIN_SP:
357  break ;
358  case T_COSSIN_CI:
360  break ;
361  case T_COSSIN_SI:
363  break ;
364  case T_COSSIN_C:
366  break ;
367  case T_COSSIN_S:
369  break ;
370  case T_COS:
371  set_base_t(T_COS) ;
372  break ;
373  case T_SIN:
374  set_base_t(T_SIN) ;
375  break ;
376  default:
377  cout << "Wrong base in Base_val::mult_cost()!" << endl ;
378  abort() ;
379  exit(-1) ;
380  break ;
381  }
382  return ;
383 }
384 
386 
387  switch(get_base_t(0)) {
388  case T_COS_P:
390  break ;
391  case T_COS_I:
393  break ;
394  case T_SIN_I:
396  break ;
397  case T_SIN_P:
399  break ;
400  case T_COSSIN_CP:
402  break ;
403  case T_COSSIN_CI:
405  break ;
406  case T_COSSIN_C:
407  set_base_t(T_LEG) ;
408  break ;
409  case T_COSSIN_S:
410  set_base_t(T_LEG) ;
411  break ;
412  case T_COS:
414  break ;
415  default:
416  cout << "Wrong base in Base_val::ylm()!" << endl ;
417  abort() ;
418  exit(-1) ;
419  break ;
420  }
421  return ;
422 }
423 }
#define T_LEG
fct. de Legendre associees
Definition: type_parite.h:236
void mult_cost()
The basis is transformed as with a multiplication.
#define T_LEG_MP
fct. de Legendre associees avec m pair
Definition: type_parite.h:238
void sx()
The basis is transformed as with a multiplication.
void set_base_r(int l, int base_r)
Sets the expansion basis for r ( ) functions in a given domain.
Definition: base_val.C:188
#define T_LEG_PI
fct. de Legendre associees paires avec m impair
Definition: type_parite.h:224
#define R_CHEBPI_I
Cheb. pair-impair suivant l impair pour l=0.
Definition: type_parite.h:174
Lorene prototypes.
Definition: app_hor.h:67
int get_base_t(int l) const
Returns the expansion basis for functions in the domain of index l (e.g.
Definition: base_val.h:414
void dsdx()
The basis is transformed as with a operation.
#define T_COS
dev. cos seulement
Definition: type_parite.h:196
#define T_COSSIN_SP
sin pair-cos impair alternes, sin pour m=0
Definition: type_parite.h:210
#define R_LEGP
base de Legendre paire (rare) seulement
Definition: type_parite.h:184
void ylm()
The basis is transformed as with a transformation to basis.
#define R_LEGI
base de Legendre impaire (rare) seulement
Definition: type_parite.h:186
void set_base_t(int base_t)
Sets the expansion basis for functions in all domains.
Definition: base_val.C:198
#define T_SIN
dev. sin seulement
Definition: type_parite.h:198
int get_base_r(int l) const
Returns the expansion basis for r ( ) functions in the domain of index l (e.g.
Definition: base_val.h:403
#define T_LEG_I
fct. de Legendre associees impaires
Definition: type_parite.h:220
#define T_COS_I
dev. cos seulement, harmoniques impaires
Definition: type_parite.h:204
#define R_CHEBI
base de Cheb. impaire (rare) seulement
Definition: type_parite.h:170
#define R_CHEBP
base de Cheb. paire (rare) seulement
Definition: type_parite.h:168
#define T_COS_P
dev. cos seulement, harmoniques paires
Definition: type_parite.h:200
#define T_COSSIN_C
dev. cos-sin alternes, cos pour m=0
Definition: type_parite.h:192
#define T_SIN_P
dev. sin seulement, harmoniques paires
Definition: type_parite.h:202
#define T_COSSIN_SI
sin impair-cos pair alternes, sin pour m=0
Definition: type_parite.h:214
#define T_LEG_IP
fct. de Legendre associees impaires avec m pair
Definition: type_parite.h:222
#define R_CHEBPIM_I
Cheb. pair-impair suivant m, impair pour m=0.
Definition: type_parite.h:178
#define R_CHEBPIM_P
Cheb. pair-impair suivant m, pair pour m=0.
Definition: type_parite.h:176
void ssint()
The basis is transformed as with a multiplication.
void dsdt()
The basis is transformed as with a operation.
#define T_LEG_P
fct. de Legendre associees paires
Definition: type_parite.h:216
#define R_CHEBPI_P
Cheb. pair-impair suivant l pair pour l=0.
Definition: type_parite.h:172
#define T_COSSIN_CI
cos impair-sin pair alternes, cos pour m=0
Definition: type_parite.h:212
void mult_x()
The basis is transformed as with a multiplication by .
void mult_sint()
The basis is transformed as with a multiplication.
#define T_LEG_II
fct. de Legendre associees impaires avec m impair
Definition: type_parite.h:226
#define T_COSSIN_CP
cos pair-sin impair alternes, cos pour m=0
Definition: type_parite.h:208
#define T_SIN_I
dev. sin seulement, harmoniques impaires
Definition: type_parite.h:206
#define T_LEG_PP
fct. de Legendre associees paires avec m pair
Definition: type_parite.h:218
#define T_COSSIN_S
dev. cos-sin alternes, sin pour m=0
Definition: type_parite.h:194