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
31char mtbl_cf_lapang_C[] = "$Header: /cvsroot/Lorene/C++/Source/Mtbl_cf/mtbl_cf_lapang.C,v 1.6 2014/10/13 08:53:08 j_novak Exp $" ;
32
33/*
34 * $Id: mtbl_cf_lapang.C,v 1.6 2014/10/13 08:53:08 j_novak Exp $
35 * $Log: mtbl_cf_lapang.C,v $
36 * Revision 1.6 2014/10/13 08:53:08 j_novak
37 * Lorene classes and functions now belong to the namespace Lorene.
38 *
39 * Revision 1.5 2009/10/23 12:56:19 j_novak
40 * New base T_LEG_MI
41 *
42 * Revision 1.4 2009/10/13 19:44:41 j_novak
43 * New base T_LEG_MP.
44 *
45 * Revision 1.3 2004/12/17 13:35:02 m_forot
46 * Add the case T_LEG
47 *
48 * Revision 1.2 2003/09/16 12:11:59 j_novak
49 * Added the base T_LEG_II.
50 *
51 * Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon
52 * LORENE
53 *
54 * Revision 2.3 2000/10/04 14:55:45 eric
55 * Ajout des bases T_LEG_IP et T_LEG_PI.
56 *
57 * Revision 2.2 1999/10/18 13:41:58 eric
58 * Suppression de l'argument base dans les routines de derivation des mtbl_cf.
59 *
60 * Revision 2.1 1999/09/30 12:54:31 eric
61 * *** empty log message ***
62 *
63 * Revision 2.0 1999/04/26 16:42:17 phil
64 * *** empty log message ***
65 *
66 *
67 * $Header: /cvsroot/Lorene/C++/Source/Mtbl_cf/mtbl_cf_lapang.C,v 1.6 2014/10/13 08:53:08 j_novak Exp $
68 *
69 */
70
71
72// Headers Lorene
73#include "mtbl_cf.h"
74#include "base_val.h"
75#include "type_parite.h"
76
77
78// Prototypage des fonctions utilisees:
79namespace Lorene {
80void _lapang_pas_prevu(Mtbl_cf *, int) ;
81void _lapang_t_leg_p(Mtbl_cf *, int) ;
82void _lapang_t_leg_i(Mtbl_cf *, int) ;
83void _lapang_t_leg_pp(Mtbl_cf *, int) ;
84void _lapang_t_leg_ip(Mtbl_cf *, int) ;
85void _lapang_t_leg_pi(Mtbl_cf *, int) ;
86void _lapang_t_leg_ii(Mtbl_cf *, int) ;
87void _lapang_t_leg_mp(Mtbl_cf *, int) ;
88void _lapang_t_leg_mi(Mtbl_cf *, int) ;
89void _lapang_t_leg(Mtbl_cf *, int) ;
90
91//*****************************************************************************
92
93void Mtbl_cf::lapang() // Version appliquee a this
94{
95
96// Routines de derivation
97static void (*_lapang[MAX_BASE])(Mtbl_cf *, int) ;
98static int nap = 0 ;
99
100 // Premier appel
101 if (nap==0) {
102 nap = 1 ;
103 for (int i=0 ; i<MAX_BASE ; i++) {
104 _lapang[i] = _lapang_pas_prevu ;
105 }
106 // Les routines existantes
107 _lapang[T_LEG_P >> TRA_T] = _lapang_t_leg_p ;
108 _lapang[T_LEG_PP >> TRA_T] = _lapang_t_leg_pp ;
109 _lapang[T_LEG_I >> TRA_T] = _lapang_t_leg_i ;
110 _lapang[T_LEG_IP >> TRA_T] = _lapang_t_leg_ip ;
111 _lapang[T_LEG_PI >> TRA_T] = _lapang_t_leg_pi ;
112 _lapang[T_LEG_II >> TRA_T] = _lapang_t_leg_ii ;
113 _lapang[T_LEG_MP >> TRA_T] = _lapang_t_leg_mp ;
114 _lapang[T_LEG_MI >> TRA_T] = _lapang_t_leg_mi ;
115 _lapang[T_LEG >> TRA_T] = _lapang_t_leg ;
116 }
117
118 // Boucle sur les zones
119 for (int l=0 ; l<get_mg()->get_nzone() ; l++) {
120 int base_t = (base.b[l] & MSQ_T) >> TRA_T ;
121 _lapang[base_t](this, l) ;
122 }
123
124}
125}
int * b
Array (size: nzone ) of the spectral basis in each domain.
Definition base_val.h:331
int get_nzone() const
Returns the number of domains.
Definition grilles.h:448
Coefficients storage for the multi-domain spectral method.
Definition mtbl_cf.h:186
Base_val base
Bases of the spectral expansions.
Definition mtbl_cf.h:200
const Mg3d * get_mg() const
Returns the Mg3d on which the Mtbl_cf is defined.
Definition mtbl_cf.h:453
void lapang()
Angular Laplacian.
#define TRA_T
Translation en Theta, used for a bitwise shift (in hex)
#define T_LEG_MP
fct. de Legendre associees avec m pair
#define MAX_BASE
Nombre max. de bases differentes.
#define T_LEG_PI
fct. de Legendre associees paires avec m impair
#define T_LEG
fct. de Legendre associees
#define T_LEG_P
fct. de Legendre associees paires
#define T_LEG_IP
fct. de Legendre associees impaires avec m pair
#define T_LEG_MI
fct. de Legendre associees avec m impair
#define MSQ_T
Extraction de l'info sur Theta.
#define T_LEG_II
fct. de Legendre associees impaires avec m impair
#define T_LEG_I
fct. de Legendre associees impaires
#define T_LEG_PP
fct. de Legendre associees paires avec m pair
Lorene prototypes.
Definition app_hor.h:64