LORENE
valeur_mult2_xm1.C
1 /*
2  * Computation of the multiplication by (x-1)^2 in the external compactified
3  * domain
4  *
5  * for:
6  * - Valeur
7  * - Mtbl_cf
8  */
9 
10 /*
11  * Copyright (c) 1999-2001 Eric Gourgoulhon
12  * Copyright (c) 1999-2001 Philippe Grandclement
13  *
14  * This file is part of LORENE.
15  *
16  * LORENE is free software; you can redistribute it and/or modify
17  * it under the terms of the GNU General Public License as published by
18  * the Free Software Foundation; either version 2 of the License, or
19  * (at your option) any later version.
20  *
21  * LORENE is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24  * GNU General Public License for more details.
25  *
26  * You should have received a copy of the GNU General Public License
27  * along with LORENE; if not, write to the Free Software
28  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29  *
30  */
31 
32 
33 
34 
35 /*
36  * $Id: valeur_mult2_xm1.C,v 1.4 2016/12/05 16:18:20 j_novak Exp $
37  * $Log: valeur_mult2_xm1.C,v $
38  * Revision 1.4 2016/12/05 16:18:20 j_novak
39  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
40  *
41  * Revision 1.3 2014/10/13 08:53:50 j_novak
42  * Lorene classes and functions now belong to the namespace Lorene.
43  *
44  * Revision 1.2 2014/10/06 15:13:23 j_novak
45  * Modified #include directives to use c++ syntax.
46  *
47  * Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon
48  * LORENE
49  *
50  * Revision 2.3 2000/03/09 16:54:13 eric
51  * Traitement du cas etat=ETATZERO
52  *
53  * Revision 2.2 1999/11/30 12:44:31 eric
54  * Valeur::base est desormais du type Base_val et non plus Base_val*.
55  *
56  * Revision 2.1 1999/10/18 13:42:21 eric
57  * Suppression de l'argument base dans les routines de derivation des mtbl_cf.
58  *
59  * Revision 2.0 1999/04/26 16:28:24 phil
60  * *** empty log message ***
61  *
62  *
63  * $Header: /cvsroot/Lorene/C++/Source/Valeur/valeur_mult2_xm1.C,v 1.4 2016/12/05 16:18:20 j_novak Exp $
64  *
65  */
66 
67 // Headers C
68 #include <cassert>
69 
70 // Headers Lorene
71 #include "mtbl_cf.h"
72 #include "valeur.h"
73 
74 // Local prototypes
75 namespace Lorene {
76 void _mult2_xm1_identite(Tbl*, int&) ;
77 void _mult2_xm1_cheb(Tbl*, int&) ;
78 
80 
81  // Peut-etre ne rien faire ?
82  if (etat==ETATZERO) {
83  return ;
84  }
85 
86  assert(etat==ETATQCQ) ;
87 
88  // Calcul des coef.
89  coef() ;
90 
91  // Division par (x-1) dans la ZEC
92  c_cf->mult2_xm1_zec() ;
93  set_etat_cf_qcq() ;
94 
95  base = c_cf->base ; // On remonte la base de sortie au niveau Valeur
96 
97 }
98 
99 
100 /*
101  * Fonction membre de la classe Mtbl_cf pour la multiplication par (x-1)
102  * dans la zone externe compactifiee applique a this
103  *
104  */
105 
107 {
108 
109 // Routines de derivation
110 static void (*_mult2_xm1[MAX_BASE])(Tbl *, int&) ;
111 static int nap = 0 ;
112 
113  if (nap==0) {
114  nap = 1 ;
115  for (int i=0 ; i<MAX_BASE ; i++) {
116  _mult2_xm1[i] = _mult2_xm1_identite ;
117  }
118 
119  // Les routines existantes cas UNSURR
120  _mult2_xm1[R_CHEBU >> TRA_R] = _mult2_xm1_cheb ;
121  }
122 
123  // Peut-etre ne rien faire ?
124  if (etat==ETATZERO) {
125  return ;
126  }
127 
128  assert(etat==ETATQCQ) ;
129 
130  // Boucle sur les zones
131  for (int l=0 ; l<nzone ; l++) {
132  int base_r = (base.b[l] & MSQ_R) >> TRA_R ;
133  _mult2_xm1[base_r](t[l], base.b[l]) ;
134  }
135 
136 }
137 }
Mtbl_cf * c_cf
Coefficients of the spectral expansion of the function.
Definition: valeur.h:312
void set_etat_cf_qcq()
Sets the logical state to ETATQCQ (ordinary state) for values in the configuration space (Mtbl_cf c_c...
Definition: valeur.C:715
void coef() const
Computes the coeffcients of *this.
Definition: valeur_coef.C:151
Lorene prototypes.
Definition: app_hor.h:67
void mult2_xm1_zec()
Applies the following operator to *this : \ Id (r sampling = RARE, FIN ) \ (r -sampling = UNSURR ) ...
#define TRA_R
Translation en R, used for a bitwise shift (in hex)
Definition: type_parite.h:158
int etat
Logical state (ETATNONDEF , ETATQCQ or ETATZERO ).
Definition: mtbl_cf.h:206
Base_val base
Bases on which the spectral expansion is performed.
Definition: valeur.h:315
int * b
Array (size: nzone ) of the spectral basis in each domain.
Definition: base_val.h:334
#define MSQ_R
Extraction de l&#39;info sur R.
Definition: type_parite.h:152
int nzone
Number of domains (zones)
Definition: mtbl_cf.h:204
void mult2_xm1_zec()
Id (r sampling = RARE, FIN ) \ (r -sampling = UNSURR )
Base_val base
Bases of the spectral expansions.
Definition: mtbl_cf.h:210
int etat
Logical state (ETATNONDEF , ETATQCQ or ETATZERO ).
Definition: valeur.h:305
Basic array class.
Definition: tbl.h:164
#define R_CHEBU
base de Chebychev ordinaire (fin), dev. en 1/r
Definition: type_parite.h:180
#define MAX_BASE
Nombre max. de bases differentes.
Definition: type_parite.h:144
Tbl ** t
Array (size nzone ) of pointers on the Tbl &#39;s which contain the spectral coefficients in each domain...
Definition: mtbl_cf.h:215