| 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 |
char jac02_base_scal_C[] = "$Header: /cvsroot/Lorene/C++/Source/Non_class_members/Coef/jac02_base_scal.C,v 1.2 2014/10/13 08:53:12 j_novak Exp $" ; |
| 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.2 2014/10/13 08:53:12 j_novak Exp $ |
| 34 |
* $Log: jac02_base_scal.C,v $ |
| 35 |
* Revision 1.2 2014/10/13 08:53:12 j_novak |
| 36 |
* Lorene classes and functions now belong to the namespace Lorene. |
| 37 |
* |
| 38 |
* Revision 1.1 2013/06/05 15:10:43 j_novak |
| 39 |
* Suppression of FINJAC sampling in r. This Jacobi(0,2) base is now |
| 40 |
* available by setting colloc_r to BASE_JAC02 in the Mg3d constructor. |
| 41 |
* |
| 42 |
* |
| 43 |
* $Header: /cvsroot/Lorene/C++/Source/Non_class_members/Coef/jac02_base_scal.C,v 1.2 2014/10/13 08:53:12 j_novak Exp $ |
| 44 |
* |
| 45 |
*/ |
| 46 |
|
| 47 |
// Headers C |
| 48 |
#include <cstdlib> |
| 49 |
|
| 50 |
// Lorene |
| 51 |
#include "headcpp.h" |
| 52 |
#include "type_parite.h" |
| 53 |
|
| 54 |
|
| 55 |
//------------------------------// |
| 56 |
// Le plus simple: cas une zone // |
| 57 |
//------------------------------// |
| 58 |
|
| 59 |
// Cree la base standart pour une zone |
| 60 |
namespace Lorene { |
| 61 |
int jac02_base_scal_1z(int type_r, int type_t, int type_p) { |
| 62 |
|
| 63 |
// Base d'echantillonnage en (r,theta,phi) a determiner : |
| 64 |
int base_l = 0 ; |
| 65 |
|
| 66 |
// proccess phi |
| 67 |
switch ( type_p ) { |
| 68 |
case NONSYM : |
| 69 |
// Cas sans symetrie sur phi : phi dans [0, 2 pi[ |
| 70 |
base_l = P_COSSIN ; // developpement en cos,sin(m*phi) |
| 71 |
// Base en theta: |
| 72 |
switch ( type_t ) { |
| 73 |
case NONSYM : |
| 74 |
// pas de symetrie en theta : theta dans [0,pi] |
| 75 |
base_l = base_l | T_COSSIN_C ; // developpement en |
| 76 |
// cos(l*theta) pour m pair |
| 77 |
// sin(l*theta) pour m impair |
| 78 |
|
| 79 |
// Base en r : |
| 80 |
switch ( type_r ) { |
| 81 |
case FIN : |
| 82 |
base_l = base_l | R_JACO02 ; // developpement en J_k(x) |
| 83 |
break ; |
| 84 |
|
| 85 |
default : |
| 86 |
cout << |
| 87 |
"jac02_base_scal : le cas type_p, type_t, type_r = " |
| 88 |
<< type_p << " " << type_t << " " << type_r << endl ; |
| 89 |
cout << " n'est pas prevu ! " << endl ; |
| 90 |
abort () ; |
| 91 |
} |
| 92 |
break ; // fin du cas type_t = NONSYM |
| 93 |
|
| 94 |
case SYM : // en theta |
| 95 |
// symetrie theta -> pi - theta : theta dans [0, pi/2] |
| 96 |
base_l = base_l | T_COSSIN_CP ; // developpement en |
| 97 |
// cos(2*l*theta) pour m pair |
| 98 |
// sin((2*l+1)*theta) pour m impair |
| 99 |
|
| 100 |
// Base en r : |
| 101 |
switch ( type_r ) { |
| 102 |
case FIN : |
| 103 |
base_l = base_l | R_JACO02 ; // developpement en J_k(x) |
| 104 |
break ; |
| 105 |
|
| 106 |
default : |
| 107 |
cout << |
| 108 |
"jac02_base_scal : le cas type_p, type_t, type_r = " |
| 109 |
<< type_p<< " " << type_t<< " " <<type_r << endl ; |
| 110 |
cout << " n'est pas prevu ! " << endl ; |
| 111 |
abort () ; |
| 112 |
} |
| 113 |
break ; // fin du cas type_t = SYM |
| 114 |
|
| 115 |
default : |
| 116 |
cout << |
| 117 |
"jac02_base_scal : le cas type_p, type_t = " |
| 118 |
<< type_p<< " " <<type_t << endl ; |
| 119 |
cout << " n'est pas prevu ! " << endl ; |
| 120 |
abort () ; |
| 121 |
} // fin des cas sur type_t |
| 122 |
break ; // fin du cas sans symetrie pour phi |
| 123 |
|
| 124 |
|
| 125 |
case SYM : // en phi |
| 126 |
// Cas symetrie phi -> phi + pi : phi in [0, pi] |
| 127 |
base_l = P_COSSIN_P ; // developpement en cos,sin(2*m*phi) |
| 128 |
// Base en theta: |
| 129 |
switch ( type_t ) { |
| 130 |
case NONSYM : |
| 131 |
// pas de symetrie en theta : theta dans [0,pi] |
| 132 |
base_l = base_l | T_COS ; // developpement en cos(l*theta) seulement |
| 133 |
// (puisque m est toujours pair) |
| 134 |
// Base en r : |
| 135 |
switch ( type_r ) { |
| 136 |
case FIN : |
| 137 |
base_l = base_l | R_JACO02 ; // developpement en J_k(x) |
| 138 |
break ; |
| 139 |
|
| 140 |
default : |
| 141 |
cout << |
| 142 |
"jac02_base_scal : le cas type_p, type_t, type_r = " |
| 143 |
<< type_p<< " " <<type_t<< " " <<type_r << endl ; |
| 144 |
cout << " n'est pas prevu ! " << endl ; |
| 145 |
abort () ; |
| 146 |
} |
| 147 |
break ; // fin du cas type_t = NONSYM |
| 148 |
|
| 149 |
case SYM : // symetrie theta -> pi - theta : theta dans [0, pi/2] |
| 150 |
base_l = base_l | T_COS_P ; // developpement en cos(2*l*theta) |
| 151 |
// (puisque m est toujours pair) |
| 152 |
// Base en r : |
| 153 |
switch ( type_r ) { |
| 154 |
case FIN : |
| 155 |
base_l = base_l | R_JACO02 ; // developpement en J_k(x) |
| 156 |
break ; |
| 157 |
|
| 158 |
default : |
| 159 |
cout << |
| 160 |
"jac02_base_scal : le cas type_p, type_t, type_r = " |
| 161 |
<< type_p<< " " <<type_t<< " " <<type_r << endl ; |
| 162 |
cout << " n'est pas prevu ! " << endl ; |
| 163 |
abort () ; |
| 164 |
} |
| 165 |
break ; // fin du cas type_t = SYM |
| 166 |
|
| 167 |
default : |
| 168 |
cout << |
| 169 |
"jac02_base_scal : le cas type_p, type_t = " |
| 170 |
<< type_p<< " " <<type_t << endl ; |
| 171 |
cout << " n'est pas prevu ! " << endl ; |
| 172 |
abort () ; |
| 173 |
} // fin des cas sur type_t |
| 174 |
break ; // fin du cas symetrie phi -> phi + pi |
| 175 |
|
| 176 |
default : |
| 177 |
cout << |
| 178 |
"jac02_base_scal : le cas type_p = " << type_p << endl ; |
| 179 |
cout << " n'est pas prevu ! " << endl ; |
| 180 |
abort () ; |
| 181 |
} // Fin des cas en phi |
| 182 |
|
| 183 |
// On range le resultat |
| 184 |
return base_l ; |
| 185 |
} |
| 186 |
} |