LORENE
mtbl_cf_pde.C
1/*
2 * Method Mtbl_cf::poisson_angu().
3 *
4 * (see file mtbl_cf.h for documentation)
5 *
6 */
7
8/*
9 * Copyright (c) 2003-2005 Eric Gourgoulhon & Jerome Novak
10 * Copyright (c) 2005 Michael Forot
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_pde.C,v 1.7 2016/12/05 16:18:00 j_novak Exp $
35 * $Log: mtbl_cf_pde.C,v $
36 * Revision 1.7 2016/12/05 16:18:00 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 2005/04/04 21:32:13 e_gourgoulhon
49 * Added argument lambda to method poisson_angu
50 * to deal with the generalized angular Poisson equation:
51 * Lap_ang u + lambda u = source.
52 *
53 * Revision 1.2 2004/12/17 13:35:03 m_forot
54 * Add the case T_LEG
55 *
56 * Revision 1.1 2003/10/15 21:12:22 e_gourgoulhon
57 * First version.
58 *
59 *
60 * $Header: /cvsroot/Lorene/C++/Source/Mtbl_cf/mtbl_cf_pde.C,v 1.7 2016/12/05 16:18:00 j_novak Exp $
61 *
62 */
63
64
65// Headers Lorene
66#include "mtbl_cf.h"
67#include "base_val.h"
68#include "type_parite.h"
69
70
71// Prototypage des fonctions utilisees:
72namespace Lorene {
73void _poisangu_pas_prevu(Mtbl_cf *, int, double) ;
74void _poisangu_t_leg_p(Mtbl_cf *, int, double) ;
75void _poisangu_t_leg_i(Mtbl_cf *, int, double) ;
76void _poisangu_t_leg_pp(Mtbl_cf *, int, double) ;
77void _poisangu_t_leg_ip(Mtbl_cf *, int, double) ;
78void _poisangu_t_leg_pi(Mtbl_cf *, int, double) ;
79void _poisangu_t_leg_ii(Mtbl_cf *, int, double) ;
80void _poisangu_t_leg_mp(Mtbl_cf *, int, double) ;
81void _poisangu_t_leg_mi(Mtbl_cf *, int, double) ;
82void _poisangu_t_leg(Mtbl_cf *, int, double) ;
83
84//*****************************************************************************
85
86void Mtbl_cf::poisson_angu(double lambda) {
87
88 // Routines de derivation
89 static void (*poisangu[MAX_BASE])(Mtbl_cf *, int, double) ;
90 static int nap = 0 ;
91
92 // Premier appel
93 if (nap==0) {
94 nap = 1 ;
95 for (int i=0 ; i<MAX_BASE ; i++) {
96 poisangu[i] = _poisangu_pas_prevu ;
97 }
98 // Les routines existantes
99 poisangu[T_LEG_P >> TRA_T] = _poisangu_t_leg_p ;
100 poisangu[T_LEG_PP >> TRA_T] = _poisangu_t_leg_pp ;
101 poisangu[T_LEG_I >> TRA_T] = _poisangu_t_leg_i ;
102 poisangu[T_LEG_IP >> TRA_T] = _poisangu_t_leg_ip ;
103 poisangu[T_LEG_PI >> TRA_T] = _poisangu_t_leg_pi ;
104 poisangu[T_LEG_MP >> TRA_T] = _poisangu_t_leg_mp ;
105 poisangu[T_LEG_MI >> TRA_T] = _poisangu_t_leg_mi ;
106 poisangu[T_LEG >> TRA_T] = _poisangu_t_leg ;
107 }
108
109 // Boucle sur les zones
110 for (int l=0 ; l<get_mg()->get_nzone() ; l++) {
111 int base_t = (base.b[l] & MSQ_T) >> TRA_T ;
112 poisangu[base_t](this, l, lambda) ;
113 }
114
115}
116}
int get_nzone() const
Returns the number of domains.
Definition grilles.h:465
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
void poisson_angu(double lambda=0)
Resolution of the generalized angular Poisson equation.
Definition mtbl_cf_pde.C:86
const Mg3d * get_mg() const
Returns the Mg3d on which the Mtbl_cf is defined.
Definition mtbl_cf.h:463
Mtbl_cf(const Mg3d &mgrid, const Base_val &basis)
Constructor.
Definition mtbl_cf.C:127
#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_I
fct. de Legendre associees impaires
#define T_LEG_PP
fct. de Legendre associees paires avec m pair
Lorene prototypes.
Definition app_hor.h:67