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
31char mtbl_cf_pde_C[] = "$Header: /cvsroot/Lorene/C++/Source/Mtbl_cf/mtbl_cf_pde.C,v 1.6 2014/10/13 08:53:08 j_novak Exp $" ;
32
33/*
34 * $Id: mtbl_cf_pde.C,v 1.6 2014/10/13 08:53:08 j_novak Exp $
35 * $Log: mtbl_cf_pde.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 2005/04/04 21:32:13 e_gourgoulhon
46 * Added argument lambda to method poisson_angu
47 * to deal with the generalized angular Poisson equation:
48 * Lap_ang u + lambda u = source.
49 *
50 * Revision 1.2 2004/12/17 13:35:03 m_forot
51 * Add the case T_LEG
52 *
53 * Revision 1.1 2003/10/15 21:12:22 e_gourgoulhon
54 * First version.
55 *
56 *
57 * $Header: /cvsroot/Lorene/C++/Source/Mtbl_cf/mtbl_cf_pde.C,v 1.6 2014/10/13 08:53:08 j_novak Exp $
58 *
59 */
60
61
62// Headers Lorene
63#include "mtbl_cf.h"
64#include "base_val.h"
65#include "type_parite.h"
66
67
68// Prototypage des fonctions utilisees:
69namespace Lorene {
70void _poisangu_pas_prevu(Mtbl_cf *, int, double) ;
71void _poisangu_t_leg_p(Mtbl_cf *, int, double) ;
72void _poisangu_t_leg_i(Mtbl_cf *, int, double) ;
73void _poisangu_t_leg_pp(Mtbl_cf *, int, double) ;
74void _poisangu_t_leg_ip(Mtbl_cf *, int, double) ;
75void _poisangu_t_leg_pi(Mtbl_cf *, int, double) ;
76void _poisangu_t_leg_ii(Mtbl_cf *, int, double) ;
77void _poisangu_t_leg_mp(Mtbl_cf *, int, double) ;
78void _poisangu_t_leg_mi(Mtbl_cf *, int, double) ;
79void _poisangu_t_leg(Mtbl_cf *, int, double) ;
80
81//*****************************************************************************
82
83void Mtbl_cf::poisson_angu(double lambda) {
84
85 // Routines de derivation
86 static void (*poisangu[MAX_BASE])(Mtbl_cf *, int, double) ;
87 static int nap = 0 ;
88
89 // Premier appel
90 if (nap==0) {
91 nap = 1 ;
92 for (int i=0 ; i<MAX_BASE ; i++) {
93 poisangu[i] = _poisangu_pas_prevu ;
94 }
95 // Les routines existantes
96 poisangu[T_LEG_P >> TRA_T] = _poisangu_t_leg_p ;
97 poisangu[T_LEG_PP >> TRA_T] = _poisangu_t_leg_pp ;
98 poisangu[T_LEG_I >> TRA_T] = _poisangu_t_leg_i ;
99 poisangu[T_LEG_IP >> TRA_T] = _poisangu_t_leg_ip ;
100 poisangu[T_LEG_PI >> TRA_T] = _poisangu_t_leg_pi ;
101 poisangu[T_LEG_MP >> TRA_T] = _poisangu_t_leg_mp ;
102 poisangu[T_LEG_MI >> TRA_T] = _poisangu_t_leg_mi ;
103 poisangu[T_LEG >> TRA_T] = _poisangu_t_leg ;
104 }
105
106 // Boucle sur les zones
107 for (int l=0 ; l<get_mg()->get_nzone() ; l++) {
108 int base_t = (base.b[l] & MSQ_T) >> TRA_T ;
109 poisangu[base_t](this, l, lambda) ;
110 }
111
112}
113}
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
void poisson_angu(double lambda=0)
Resolution of the generalized angular Poisson equation.
Definition mtbl_cf_pde.C:83
const Mg3d * get_mg() const
Returns the Mg3d on which the Mtbl_cf is defined.
Definition mtbl_cf.h:453
#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:64