LORENE
jac02_base_scal.C
1/*
2 * Copyright (c) 2007 Jean-Louis Cornou
3 * Copyright (c) 2013 Jerome Novak
4 *
5 * This file is part of LORENE.
6 *
7 * LORENE is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * LORENE is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with LORENE; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 */
22
23
24
25
26/*
27 * Ensemble des routines de manipulation de base spectrales dans
28 * le cas scalaire et la base Jacobi(0,2).
29 *
30 */
31
32/*
33 * $Id: jac02_base_scal.C,v 1.3 2016/12/05 16:18:02 j_novak Exp $
34 * $Log: jac02_base_scal.C,v $
35 * Revision 1.3 2016/12/05 16:18:02 j_novak
36 * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
37 *
38 * Revision 1.2 2014/10/13 08:53:12 j_novak
39 * Lorene classes and functions now belong to the namespace Lorene.
40 *
41 * Revision 1.1 2013/06/05 15:10:43 j_novak
42 * Suppression of FINJAC sampling in r. This Jacobi(0,2) base is now
43 * available by setting colloc_r to BASE_JAC02 in the Mg3d constructor.
44 *
45 *
46 * $Header: /cvsroot/Lorene/C++/Source/Non_class_members/Coef/jac02_base_scal.C,v 1.3 2016/12/05 16:18:02 j_novak Exp $
47 *
48 */
49
50// Headers C
51#include <cstdlib>
52
53// Lorene
54#include "headcpp.h"
55#include "type_parite.h"
56
57
58 //------------------------------//
59 // Le plus simple: cas une zone //
60 //------------------------------//
61
62// Cree la base standart pour une zone
63namespace Lorene {
64int jac02_base_scal_1z(int type_r, int type_t, int type_p) {
65
66 // Base d'echantillonnage en (r,theta,phi) a determiner :
67 int base_l = 0 ;
68
69 // proccess phi
70 switch ( type_p ) {
71 case NONSYM :
72 // Cas sans symetrie sur phi : phi dans [0, 2 pi[
73 base_l = P_COSSIN ; // developpement en cos,sin(m*phi)
74 // Base en theta:
75 switch ( type_t ) {
76 case NONSYM :
77 // pas de symetrie en theta : theta dans [0,pi]
78 base_l = base_l | T_COSSIN_C ; // developpement en
79 // cos(l*theta) pour m pair
80 // sin(l*theta) pour m impair
81
82 // Base en r :
83 switch ( type_r ) {
84 case FIN :
85 base_l = base_l | R_JACO02 ; // developpement en J_k(x)
86 break ;
87
88 default :
89 cout <<
90 "jac02_base_scal : le cas type_p, type_t, type_r = "
91 << type_p << " " << type_t << " " << type_r << endl ;
92 cout << " n'est pas prevu ! " << endl ;
93 abort () ;
94 }
95 break ; // fin du cas type_t = NONSYM
96
97 case SYM : // en theta
98 // symetrie theta -> pi - theta : theta dans [0, pi/2]
99 base_l = base_l | T_COSSIN_CP ; // developpement en
100 // cos(2*l*theta) pour m pair
101 // sin((2*l+1)*theta) pour m impair
102
103 // Base en r :
104 switch ( type_r ) {
105 case FIN :
106 base_l = base_l | R_JACO02 ; // developpement en J_k(x)
107 break ;
108
109 default :
110 cout <<
111 "jac02_base_scal : le cas type_p, type_t, type_r = "
112 << type_p<< " " << type_t<< " " <<type_r << endl ;
113 cout << " n'est pas prevu ! " << endl ;
114 abort () ;
115 }
116 break ; // fin du cas type_t = SYM
117
118 default :
119 cout <<
120 "jac02_base_scal : le cas type_p, type_t = "
121 << type_p<< " " <<type_t << endl ;
122 cout << " n'est pas prevu ! " << endl ;
123 abort () ;
124 } // fin des cas sur type_t
125 break ; // fin du cas sans symetrie pour phi
126
127
128 case SYM : // en phi
129 // Cas symetrie phi -> phi + pi : phi in [0, pi]
130 base_l = P_COSSIN_P ; // developpement en cos,sin(2*m*phi)
131 // Base en theta:
132 switch ( type_t ) {
133 case NONSYM :
134 // pas de symetrie en theta : theta dans [0,pi]
135 base_l = base_l | T_COS ; // developpement en cos(l*theta) seulement
136 // (puisque m est toujours pair)
137 // Base en r :
138 switch ( type_r ) {
139 case FIN :
140 base_l = base_l | R_JACO02 ; // developpement en J_k(x)
141 break ;
142
143 default :
144 cout <<
145 "jac02_base_scal : le cas type_p, type_t, type_r = "
146 << type_p<< " " <<type_t<< " " <<type_r << endl ;
147 cout << " n'est pas prevu ! " << endl ;
148 abort () ;
149 }
150 break ; // fin du cas type_t = NONSYM
151
152 case SYM : // symetrie theta -> pi - theta : theta dans [0, pi/2]
153 base_l = base_l | T_COS_P ; // developpement en cos(2*l*theta)
154 // (puisque m est toujours pair)
155 // Base en r :
156 switch ( type_r ) {
157 case FIN :
158 base_l = base_l | R_JACO02 ; // developpement en J_k(x)
159 break ;
160
161 default :
162 cout <<
163 "jac02_base_scal : le cas type_p, type_t, type_r = "
164 << type_p<< " " <<type_t<< " " <<type_r << endl ;
165 cout << " n'est pas prevu ! " << endl ;
166 abort () ;
167 }
168 break ; // fin du cas type_t = SYM
169
170 default :
171 cout <<
172 "jac02_base_scal : le cas type_p, type_t = "
173 << type_p<< " " <<type_t << endl ;
174 cout << " n'est pas prevu ! " << endl ;
175 abort () ;
176 } // fin des cas sur type_t
177 break ; // fin du cas symetrie phi -> phi + pi
178
179 default :
180 cout <<
181 "jac02_base_scal : le cas type_p = " << type_p << endl ;
182 cout << " n'est pas prevu ! " << endl ;
183 abort () ;
184 } // Fin des cas en phi
185
186 // On range le resultat
187 return base_l ;
188}
189}
#define P_COSSIN_P
dev. sur Phi = 2*phi, freq. paires
#define R_JACO02
base de Jacobi(0,2) ordinaire (finjac)
#define T_COS_P
dev. cos seulement, harmoniques paires
#define P_COSSIN
dev. standart
#define T_COSSIN_CP
cos pair-sin impair alternes, cos pour m=0
#define T_COS
dev. cos seulement
#define T_COSSIN_C
dev. cos-sin alternes, cos pour m=0
Lorene prototypes.
Definition app_hor.h:67