00001 /* 00002 * Copyright (c) 1999-2000 Jean-Alain Marck 00003 * Copyright (c) 1999-2001 Eric Gourgoulhon 00004 * Copyright (c) 1999-2001 Philippe Grandclement 00005 * 00006 * This file is part of LORENE. 00007 * 00008 * LORENE is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU General Public License as published by 00010 * the Free Software Foundation; either version 2 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * LORENE is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with LORENE; if not, write to the Free Software 00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00021 * 00022 */ 00023 00024 00025 char op_sxp12_C[] = "$Header: /cvsroot/Lorene/C++/Source/Non_class_members/Operators/op_sxp12.C,v 1.2 2008/08/19 06:42:00 j_novak Exp $" ; 00026 00027 /* 00028 * Ensemble des routines de base de division par rapport a (x+1)² 00029 * (Utilisation interne) 00030 * 00031 * void _sx_XXXX(Tbl * t, int & b) 00032 * t pointeur sur le Tbl d'entree-sortie 00033 * b base spectrale 00034 * 00035 */ 00036 00037 /* 00038 * $Id: op_sxp12.C,v 1.2 2008/08/19 06:42:00 j_novak Exp $ 00039 * $Log: op_sxp12.C,v $ 00040 * Revision 1.2 2008/08/19 06:42:00 j_novak 00041 * Minor modifications to avoid warnings with gcc 4.3. Most of them concern 00042 * cast-type operations, and constant strings that must be defined as const char* 00043 * 00044 * Revision 1.1 2007/12/11 15:42:23 jl_cornou 00045 * Premiere version des fonctions liees aux polynomes de Jacobi(0,2) 00046 * 00047 * Revision 1.2 2004/11/23 15:16:01 m_forot 00048 * 00049 * Added the bases for the cases without any equatorial symmetry 00050 * (T_COSSIN_C, T_COSSIN_S, T_LEG, R_CHEBPI_P, R_CHEBPI_I). 00051 * 00052 * Revision 1.1.1.1 2001/11/20 15:19:29 e_gourgoulhon 00053 * LORENE 00054 * 00055 * Revision 2.5 2000/09/07 12:50:48 phil 00056 * *** empty log message *** 00057 * 00058 * Revision 2.4 2000/02/24 16:42:59 eric 00059 * Initialisation a zero du tableau xo avant le calcul. 00060 * 00061 * Revision 2.3 1999/11/15 16:39:17 eric 00062 * Tbl::dim est desormais un Dim_tbl et non plus un Dim_tbl*. 00063 * 00064 * Revision 2.2 1999/10/18 13:40:11 eric 00065 * Suppression de la routine _sx_r_chebu car doublon avec _sxm1_cheb. 00066 * 00067 * Revision 2.1 1999/09/13 11:35:42 phil 00068 * gestion des cas k==1 et k==np 00069 * 00070 * Revision 2.0 1999/04/26 14:59:42 phil 00071 * *** empty log message *** 00072 * 00073 * 00074 * $Header: /cvsroot/Lorene/C++/Source/Non_class_members/Operators/op_sxp12.C,v 1.2 2008/08/19 06:42:00 j_novak Exp $ 00075 * 00076 */ 00077 00078 // Fichier includes 00079 #include "tbl.h" 00080 #include <math.h> 00081 00082 void sxp12_1d(int , double **, int ) ; 00083 00084 //----------------------------------- 00085 // Routine pour les cas non prevus -- 00086 //----------------------------------- 00087 00088 void _sxp12_pas_prevu(Tbl * tb, int& base) { 00089 cout << "sxp12 pas prevu..." << endl ; 00090 cout << "Tbl: " << tb << " base: " << base << endl ; 00091 abort () ; 00092 exit(-1) ; 00093 } 00094 00095 //------------- 00096 // Identite --- 00097 //------------- 00098 00099 void _sxp12_identite(Tbl* , int& ) { 00100 return ; 00101 } 00102 00103 //-------------- 00104 // cas R_JACO02- 00105 //-------------- 00106 00107 void _sxp12_r_jaco02(Tbl* tb, int& ) 00108 { 00109 // Peut-etre rien a faire ? 00110 if (tb->get_etat() == ETATZERO) { 00111 return ; 00112 } 00113 00114 // Pour le confort 00115 int nr = (tb->dim).dim[0] ; // Nombre 00116 int nt = (tb->dim).dim[1] ; // de points 00117 int np = (tb->dim).dim[2] ; // physiques REELS 00118 np = np - 2 ; // Nombre de points physiques 00119 00120 // pt. sur le tableau de double resultat 00121 double* xo = new double [tb->get_taille()]; 00122 00123 // Initialisation a zero : 00124 for (int i=0; i<tb->get_taille(); i++) { 00125 xo[i] = 0 ; 00126 } 00127 00128 // On y va... 00129 double* xi = tb->t ; 00130 double* xci = xi ; // Pointeurs 00131 double* xco = xo ; // courants 00132 00133 int borne_phi = np + 1 ; 00134 if (np == 1) { 00135 borne_phi = 1 ; 00136 } 00137 00138 for (int k=0 ; k< borne_phi ; k++) 00139 if (k==1) { 00140 xci += nr*nt ; 00141 xco += nr*nt ; 00142 } 00143 else { 00144 for (int j=0 ; j<nt ; j++) { 00145 00146 double** tb1 = new double*[nr] ; 00147 for (int i = 0 ; i<nr ; i++ ) { 00148 *tb1[i]=xci[i] ; 00149 } 00150 sxp12_1d(nr,tb1,R_JACO02 >> TRA_R) ; 00151 for (int i = 0 ; i<nr ; i++ ) { 00152 xco[i] = *tb1[i] ; 00153 } 00154 delete [] (*tb1) ; 00155 00156 xci += nr ; 00157 xco += nr ; 00158 } // Fin de la boucle sur theta 00159 } // Fin de la boucle sur phi 00160 00161 // On remet les choses la ou il faut 00162 delete [] tb->t ; 00163 tb->t = xo ; 00164 00165 // base de developpement 00166 // inchangée 00167 00168 } 00169
1.4.6