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