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 char valeur_mult2_xm1_C[] = "$Header: /cvsroot/Lorene/C++/Source/Valeur/valeur_mult2_xm1.C,v 1.3 2014/10/13 08:53:50 j_novak Exp $" ;
34 
35 /*
36  * $Id: valeur_mult2_xm1.C,v 1.3 2014/10/13 08:53:50 j_novak Exp $
37  * $Log: valeur_mult2_xm1.C,v $
38  * Revision 1.3 2014/10/13 08:53:50 j_novak
39  * Lorene classes and functions now belong to the namespace Lorene.
40  *
41  * Revision 1.2 2014/10/06 15:13:23 j_novak
42  * Modified #include directives to use c++ syntax.
43  *
44  * Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon
45  * LORENE
46  *
47  * Revision 2.3 2000/03/09 16:54:13 eric
48  * Traitement du cas etat=ETATZERO
49  *
50  * Revision 2.2 1999/11/30 12:44:31 eric
51  * Valeur::base est desormais du type Base_val et non plus Base_val*.
52  *
53  * Revision 2.1 1999/10/18 13:42:21 eric
54  * Suppression de l'argument base dans les routines de derivation des mtbl_cf.
55  *
56  * Revision 2.0 1999/04/26 16:28:24 phil
57  * *** empty log message ***
58  *
59  *
60  * $Header: /cvsroot/Lorene/C++/Source/Valeur/valeur_mult2_xm1.C,v 1.3 2014/10/13 08:53:50 j_novak Exp $
61  *
62  */
63 
64 // Headers C
65 #include <cassert>
66 
67 // Headers Lorene
68 #include "mtbl_cf.h"
69 #include "valeur.h"
70 
71 // Local prototypes
72 namespace Lorene {
73 void _mult2_xm1_identite(Tbl*, int&) ;
74 void _mult2_xm1_cheb(Tbl*, int&) ;
75 
77 
78  // Peut-etre ne rien faire ?
79  if (etat==ETATZERO) {
80  return ;
81  }
82 
83  assert(etat==ETATQCQ) ;
84 
85  // Calcul des coef.
86  coef() ;
87 
88  // Division par (x-1) dans la ZEC
89  c_cf->mult2_xm1_zec() ;
90  set_etat_cf_qcq() ;
91 
92  base = c_cf->base ; // On remonte la base de sortie au niveau Valeur
93 
94 }
95 
96 
97 /*
98  * Fonction membre de la classe Mtbl_cf pour la multiplication par (x-1)
99  * dans la zone externe compactifiee applique a this
100  *
101  */
102 
104 {
105 
106 // Routines de derivation
107 static void (*_mult2_xm1[MAX_BASE])(Tbl *, int&) ;
108 static int nap = 0 ;
109 
110  if (nap==0) {
111  nap = 1 ;
112  for (int i=0 ; i<MAX_BASE ; i++) {
113  _mult2_xm1[i] = _mult2_xm1_identite ;
114  }
115 
116  // Les routines existantes cas UNSURR
117  _mult2_xm1[R_CHEBU >> TRA_R] = _mult2_xm1_cheb ;
118  }
119 
120  // Peut-etre ne rien faire ?
121  if (etat==ETATZERO) {
122  return ;
123  }
124 
125  assert(etat==ETATQCQ) ;
126 
127  // Boucle sur les zones
128  for (int l=0 ; l<nzone ; l++) {
129  int base_r = (base.b[l] & MSQ_R) >> TRA_R ;
130  _mult2_xm1[base_r](t[l], base.b[l]) ;
131  }
132 
133 }
134 }
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
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
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 mult2_xm1_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
#define MAX_BASE
Nombre max. de bases differentes.
Definition: type_parite.h:144