LORENE
op_mult_xm1.C
1/*
2 * Copyright (c) 1999-2001 Eric Gourgoulhon
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: op_mult_xm1.C,v 1.3 2016/12/05 16:18:08 j_novak Exp $
27 * $Log: op_mult_xm1.C,v $
28 * Revision 1.3 2016/12/05 16:18:08 j_novak
29 * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
30 *
31 * Revision 1.2 2014/10/13 08:53:26 j_novak
32 * Lorene classes and functions now belong to the namespace Lorene.
33 *
34 * Revision 1.1.1.1 2001/11/20 15:19:29 e_gourgoulhon
35 * LORENE
36 *
37 * Revision 2.2 1999/11/15 16:38:48 eric
38 * Tbl::dim est desormais un Dim_tbl et non plus un Dim_tbl*.
39 *
40 * Revision 2.1 1999/04/26 16:19:38 phil
41 * changement commentaire
42 *
43 * Revision 2.0 1999/04/26 16:16:24 phil
44 * *** empty log message ***
45 *
46 *
47 * $Header: /cvsroot/Lorene/C++/Source/Non_class_members/Operators/op_mult_xm1.C,v 1.3 2016/12/05 16:18:08 j_novak Exp $
48 *
49 */
50
51/*
52 * Ensemble des routines de base pour l'operateur (x-1) Id
53 * (Utilisation interne)
54 *
55 * Prototype :
56 * ---------
57 * void _mult_xm1_XXXX(Tbl * tb, int& base)
58 *
59 * Entree/Sortie :
60 * -------------
61 * tb pointeur sur le Tbl d'entree-sortie
62 *
63 * Entree :
64 * ------
65 * base base de travail
66 *
67 */
68
69
70 //Lorene
71#include "tbl.h"
72#include "type_parite.h"
73
74// Prototypage
75#include "proto.h"
76
77
78 //------------------------------------
79 // Routine qui ne fait rien ---
80 //------------------------------------
81
82namespace Lorene {
83void _mult_xm1_identite(Tbl* , int& ) {
84 return ;
85}
86
87 //-------------------------
88 // cas R_CHEB et R_CHEBU --
89 //-------------------------
90
91void _mult_xm1_cheb(Tbl *tb, int& )
92{
93
94 // Peut-etre rien a faire ?
95 if (tb->get_etat() == ETATZERO) {
96 return ;
97 }
98
99 // Pour le confort
100 int nr = (tb->dim).dim[0] ; // Nombre
101 int nt = (tb->dim).dim[1] ; // de points
102 int np = (tb->dim).dim[2] ; // physiques REELS
103 np = np - 2 ; // Nombre de points physiques
104
105 int ntnr = nt*nr ;
106
107 double* trav = new double[nr] ;
108
109 int k, j, i ;
110 for (k=0 ; k<np+1 ; k++) {
111 if (k==1) continue ; // On ne traite pas le coefficient de sin(0*phi)
112 for (j=0 ; j<nt ; j++) {
113
114 double* cf = tb->t + k*ntnr + j*nr ;
115
116 mult_xm1_1d_cheb(nr, cf, trav) ; // multiplication par (x-1)
117
118 for (i=0; i<nr; i++) {
119 cf[i] = trav[i] ;
120 }
121
122 } // Fin de la boucle sur theta
123 } // Fin de la boucle sur phi
124
125 delete [] trav ;
126
127 // base de developpement
128 // inchangee
129}
130
131}
Basic array class.
Definition tbl.h:161
Lorene prototypes.
Definition app_hor.h:67