LORENE
op_sxp12.C
1 /*
2  * Copyright (c) 1999-2000 Jean-Alain Marck
3  * Copyright (c) 1999-2001 Eric Gourgoulhon
4  * Copyright (c) 1999-2001 Philippe Grandclement
5  *
6  * This file is part of LORENE.
7  *
8  * LORENE is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * LORENE is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with LORENE; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21  *
22  */
23 
24 
25 char op_sxp12_C[] = "$Header: /cvsroot/Lorene/C++/Source/Non_class_members/Operators/op_sxp12.C,v 1.4 2014/10/13 08:53:26 j_novak Exp $" ;
26 
27 /*
28  * Ensemble des routines de base de division par rapport a (x+1)²
29  * (Utilisation interne)
30  *
31  * void _sx_XXXX(Tbl * t, int & b)
32  * t pointeur sur le Tbl d'entree-sortie
33  * b base spectrale
34  *
35  */
36 
37  /*
38  * $Id: op_sxp12.C,v 1.4 2014/10/13 08:53:26 j_novak Exp $
39  * $Log: op_sxp12.C,v $
40  * Revision 1.4 2014/10/13 08:53:26 j_novak
41  * Lorene classes and functions now belong to the namespace Lorene.
42  *
43  * Revision 1.3 2014/10/06 15:16:06 j_novak
44  * Modified #include directives to use c++ syntax.
45  *
46  * Revision 1.2 2008/08/19 06:42:00 j_novak
47  * Minor modifications to avoid warnings with gcc 4.3. Most of them concern
48  * cast-type operations, and constant strings that must be defined as const char*
49  *
50  * Revision 1.1 2007/12/11 15:42:23 jl_cornou
51  * Premiere version des fonctions liees aux polynomes de Jacobi(0,2)
52  *
53  * Revision 1.2 2004/11/23 15:16:01 m_forot
54  *
55  * Added the bases for the cases without any equatorial symmetry
56  * (T_COSSIN_C, T_COSSIN_S, T_LEG, R_CHEBPI_P, R_CHEBPI_I).
57  *
58  * Revision 1.1.1.1 2001/11/20 15:19:29 e_gourgoulhon
59  * LORENE
60  *
61  * Revision 2.5 2000/09/07 12:50:48 phil
62  * *** empty log message ***
63  *
64  * Revision 2.4 2000/02/24 16:42:59 eric
65  * Initialisation a zero du tableau xo avant le calcul.
66  *
67  * Revision 2.3 1999/11/15 16:39:17 eric
68  * Tbl::dim est desormais un Dim_tbl et non plus un Dim_tbl*.
69  *
70  * Revision 2.2 1999/10/18 13:40:11 eric
71  * Suppression de la routine _sx_r_chebu car doublon avec _sxm1_cheb.
72  *
73  * Revision 2.1 1999/09/13 11:35:42 phil
74  * gestion des cas k==1 et k==np
75  *
76  * Revision 2.0 1999/04/26 14:59:42 phil
77  * *** empty log message ***
78  *
79  *
80  * $Header: /cvsroot/Lorene/C++/Source/Non_class_members/Operators/op_sxp12.C,v 1.4 2014/10/13 08:53:26 j_novak Exp $
81  *
82  */
83 
84  // Fichier includes
85 #include "tbl.h"
86 #include <cmath>
87 
88 namespace Lorene {
89 void sxp12_1d(int , double **, int ) ;
90 
91  //-----------------------------------
92  // Routine pour les cas non prevus --
93  //-----------------------------------
94 
95 void _sxp12_pas_prevu(Tbl * tb, int& base) {
96  cout << "sxp12 pas prevu..." << endl ;
97  cout << "Tbl: " << tb << " base: " << base << endl ;
98  abort () ;
99  exit(-1) ;
100 }
101 
102  //-------------
103  // Identite ---
104  //-------------
105 
106 void _sxp12_identite(Tbl* , int& ) {
107  return ;
108 }
109 
110  //--------------
111  // cas R_JACO02-
112  //--------------
113 
114 void _sxp12_r_jaco02(Tbl* tb, int& )
115  {
116  // Peut-etre rien a faire ?
117  if (tb->get_etat() == ETATZERO) {
118  return ;
119  }
120 
121  // Pour le confort
122  int nr = (tb->dim).dim[0] ; // Nombre
123  int nt = (tb->dim).dim[1] ; // de points
124  int np = (tb->dim).dim[2] ; // physiques REELS
125  np = np - 2 ; // Nombre de points physiques
126 
127  // pt. sur le tableau de double resultat
128  double* xo = new double [tb->get_taille()];
129 
130  // Initialisation a zero :
131  for (int i=0; i<tb->get_taille(); i++) {
132  xo[i] = 0 ;
133  }
134 
135  // On y va...
136  double* xi = tb->t ;
137  double* xci = xi ; // Pointeurs
138  double* xco = xo ; // courants
139 
140  int borne_phi = np + 1 ;
141  if (np == 1) {
142  borne_phi = 1 ;
143  }
144 
145  for (int k=0 ; k< borne_phi ; k++)
146  if (k==1) {
147  xci += nr*nt ;
148  xco += nr*nt ;
149  }
150  else {
151  for (int j=0 ; j<nt ; j++) {
152 
153  double** tb1 = new double*[nr] ;
154  for (int i = 0 ; i<nr ; i++ ) {
155  *tb1[i]=xci[i] ;
156  }
157  sxp12_1d(nr,tb1,R_JACO02 >> TRA_R) ;
158  for (int i = 0 ; i<nr ; i++ ) {
159  xco[i] = *tb1[i] ;
160  }
161  delete [] (*tb1) ;
162 
163  xci += nr ;
164  xco += nr ;
165  } // Fin de la boucle sur theta
166  } // Fin de la boucle sur phi
167 
168  // On remet les choses la ou il faut
169  delete [] tb->t ;
170  tb->t = xo ;
171 
172  // base de developpement
173  // inchangée
174 
175 }
176 
177 }
Lorene
Lorene prototypes.
Definition: app_hor.h:64
R_JACO02
#define R_JACO02
base de Jacobi(0,2) ordinaire (finjac)
Definition: type_parite.h:188
TRA_R
#define TRA_R
Translation en R, used for a bitwise shift (in hex)
Definition: type_parite.h:158