LORENE
mtbl_cf_lapang.C
1 /*
2  * Function Mtbl_cf::lapang for the computation of the angular Laplacian:
3  *
4  * d^2/dtheta^2 + cos(theta)/sin(theta) d/dtheta + 1/sin(theta) d^2/dphi^2
5  *
6  */
7 
8 /*
9  * Copyright (c) 1999-2001 Eric Gourgoulhon
10  * Copyright (c) 1999-2001 Philippe Grandclement
11  *
12  * This file is part of LORENE.
13  *
14  * LORENE is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 2 of the License, or
17  * (at your option) any later version.
18  *
19  * LORENE is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with LORENE; if not, write to the Free Software
26  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27  *
28  */
29 
30 
31 
32 
33 /*
34  * $Id: mtbl_cf_lapang.C,v 1.7 2016/12/05 16:17:59 j_novak Exp $
35  * $Log: mtbl_cf_lapang.C,v $
36  * Revision 1.7 2016/12/05 16:17:59 j_novak
37  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
38  *
39  * Revision 1.6 2014/10/13 08:53:08 j_novak
40  * Lorene classes and functions now belong to the namespace Lorene.
41  *
42  * Revision 1.5 2009/10/23 12:56:19 j_novak
43  * New base T_LEG_MI
44  *
45  * Revision 1.4 2009/10/13 19:44:41 j_novak
46  * New base T_LEG_MP.
47  *
48  * Revision 1.3 2004/12/17 13:35:02 m_forot
49  * Add the case T_LEG
50  *
51  * Revision 1.2 2003/09/16 12:11:59 j_novak
52  * Added the base T_LEG_II.
53  *
54  * Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon
55  * LORENE
56  *
57  * Revision 2.3 2000/10/04 14:55:45 eric
58  * Ajout des bases T_LEG_IP et T_LEG_PI.
59  *
60  * Revision 2.2 1999/10/18 13:41:58 eric
61  * Suppression de l'argument base dans les routines de derivation des mtbl_cf.
62  *
63  * Revision 2.1 1999/09/30 12:54:31 eric
64  * *** empty log message ***
65  *
66  * Revision 2.0 1999/04/26 16:42:17 phil
67  * *** empty log message ***
68  *
69  *
70  * $Header: /cvsroot/Lorene/C++/Source/Mtbl_cf/mtbl_cf_lapang.C,v 1.7 2016/12/05 16:17:59 j_novak Exp $
71  *
72  */
73 
74 
75 // Headers Lorene
76 #include "mtbl_cf.h"
77 #include "base_val.h"
78 #include "type_parite.h"
79 
80 
81 // Prototypage des fonctions utilisees:
82 namespace Lorene {
83 void _lapang_pas_prevu(Mtbl_cf *, int) ;
84 void _lapang_t_leg_p(Mtbl_cf *, int) ;
85 void _lapang_t_leg_i(Mtbl_cf *, int) ;
86 void _lapang_t_leg_pp(Mtbl_cf *, int) ;
87 void _lapang_t_leg_ip(Mtbl_cf *, int) ;
88 void _lapang_t_leg_pi(Mtbl_cf *, int) ;
89 void _lapang_t_leg_ii(Mtbl_cf *, int) ;
90 void _lapang_t_leg_mp(Mtbl_cf *, int) ;
91 void _lapang_t_leg_mi(Mtbl_cf *, int) ;
92 void _lapang_t_leg(Mtbl_cf *, int) ;
93 
94 //*****************************************************************************
95 
96 void Mtbl_cf::lapang() // Version appliquee a this
97 {
98 
99 // Routines de derivation
100 static void (*_lapang[MAX_BASE])(Mtbl_cf *, int) ;
101 static int nap = 0 ;
102 
103  // Premier appel
104  if (nap==0) {
105  nap = 1 ;
106  for (int i=0 ; i<MAX_BASE ; i++) {
107  _lapang[i] = _lapang_pas_prevu ;
108  }
109  // Les routines existantes
110  _lapang[T_LEG_P >> TRA_T] = _lapang_t_leg_p ;
111  _lapang[T_LEG_PP >> TRA_T] = _lapang_t_leg_pp ;
112  _lapang[T_LEG_I >> TRA_T] = _lapang_t_leg_i ;
113  _lapang[T_LEG_IP >> TRA_T] = _lapang_t_leg_ip ;
114  _lapang[T_LEG_PI >> TRA_T] = _lapang_t_leg_pi ;
115  _lapang[T_LEG_II >> TRA_T] = _lapang_t_leg_ii ;
116  _lapang[T_LEG_MP >> TRA_T] = _lapang_t_leg_mp ;
117  _lapang[T_LEG_MI >> TRA_T] = _lapang_t_leg_mi ;
118  _lapang[T_LEG >> TRA_T] = _lapang_t_leg ;
119  }
120 
121  // Boucle sur les zones
122  for (int l=0 ; l<get_mg()->get_nzone() ; l++) {
123  int base_t = (base.b[l] & MSQ_T) >> TRA_T ;
124  _lapang[base_t](this, l) ;
125  }
126 
127 }
128 }
#define T_LEG
fct. de Legendre associees
Definition: type_parite.h:236
#define T_LEG_MP
fct. de Legendre associees avec m pair
Definition: type_parite.h:238
#define T_LEG_PI
fct. de Legendre associees paires avec m impair
Definition: type_parite.h:224
#define T_LEG_MI
fct. de Legendre associees avec m impair
Definition: type_parite.h:240
Lorene prototypes.
Definition: app_hor.h:67
#define TRA_T
Translation en Theta, used for a bitwise shift (in hex)
Definition: type_parite.h:160
const Mg3d * get_mg() const
Returns the Mg3d on which the Mtbl_cf is defined.
Definition: mtbl_cf.h:463
#define T_LEG_I
fct. de Legendre associees impaires
Definition: type_parite.h:220
#define MSQ_T
Extraction de l&#39;info sur Theta.
Definition: type_parite.h:154
int * b
Array (size: nzone ) of the spectral basis in each domain.
Definition: base_val.h:334
int get_nzone() const
Returns the number of domains.
Definition: grilles.h:465
#define T_LEG_IP
fct. de Legendre associees impaires avec m pair
Definition: type_parite.h:222
#define T_LEG_P
fct. de Legendre associees paires
Definition: type_parite.h:216
Coefficients storage for the multi-domain spectral method.
Definition: mtbl_cf.h:196
Base_val base
Bases of the spectral expansions.
Definition: mtbl_cf.h:210
#define T_LEG_II
fct. de Legendre associees impaires avec m impair
Definition: type_parite.h:226
#define MAX_BASE
Nombre max. de bases differentes.
Definition: type_parite.h:144
void lapang()
Angular Laplacian.
#define T_LEG_PP
fct. de Legendre associees paires avec m pair
Definition: type_parite.h:218