LORENE
valeur_lapang.C
1/*
2 * Function Valeur::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: valeur_lapang.C,v 1.3 2016/12/05 16:18:20 j_novak Exp $
35 * $Log: valeur_lapang.C,v $
36 * Revision 1.3 2016/12/05 16:18:20 j_novak
37 * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
38 *
39 * Revision 1.2 2014/10/13 08:53:50 j_novak
40 * Lorene classes and functions now belong to the namespace Lorene.
41 *
42 * Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon
43 * LORENE
44 *
45 * Revision 2.4 1999/11/30 12:44:22 eric
46 * Valeur::base est desormais du type Base_val et non plus Base_val*.
47 *
48 * Revision 2.3 1999/11/23 16:17:37 eric
49 * Reorganisation du calcul dans le cas ETATZERO.
50 *
51 * Revision 2.2 1999/11/19 09:32:40 eric
52 * La valeur de retour est desormais const Valeur &.
53 *
54 * Revision 2.1 1999/10/18 13:42:09 eric
55 * Suppression de l'argument base dans les routines de derivation des mtbl_cf.
56 *
57 * Revision 2.0 1999/04/26 16:43:22 phil
58 * *** empty log message ***
59 *
60 * Revision 1.1 1999/04/26 16:42:30 phil
61 * Initial revision
62 *
63 *
64 * $Header: /cvsroot/Lorene/C++/Source/Valeur/valeur_lapang.C,v 1.3 2016/12/05 16:18:20 j_novak Exp $
65 *
66 */
67
68
69// Headers Lorene
70#include "mtbl_cf.h"
71#include "valeur.h"
72
73
74namespace Lorene {
75const Valeur& Valeur::lapang() const {
76
77 // Protection
78 assert(etat != ETATNONDEF) ;
79
80 // Peut-etre rien a faire ?
81 if (p_lapang != 0x0) {
82 return *p_lapang ;
83 }
84
85 // ... si, il faut bosser
86
87 p_lapang = new Valeur(mg) ;
88
89 if (etat == ETATZERO) {
90 p_lapang->set_etat_zero() ;
91 }
92 else {
93 assert(etat == ETATQCQ) ;
94 p_lapang->set_etat_cf_qcq() ;
95 Mtbl_cf* cfp = p_lapang->c_cf ; // Pointeur sur le Mtbl_cf qui vient d'etre
96 // cree par le set_etat_cf_qcq()
97
98 // Initialisation de *cfp : recopie des coef. de la fonction
99 if (c_cf == 0x0) {
100 coef() ;
101 }
102 *cfp = *c_cf ;
103
104 cfp->lapang() ; // calcul
105
106 p_lapang->base = cfp->base ; // On remonte la base de sortie au niveau Valeur
107 }
108
109 // Termine
110 return *p_lapang ;
111
112}
113}
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 lapang()
Angular Laplacian.
Valeur(const Mg3d &mgrid)
Constructor.
Definition valeur.C:203
const Mg3d * mg
Multi-grid Mgd3 on which this is defined.
Definition valeur.h:302
Mtbl_cf * c_cf
Coefficients of the spectral expansion of the function.
Definition valeur.h:312
void coef() const
Computes the coeffcients of *this.
Valeur * p_lapang
Pointer on the angular Laplacian.
Definition valeur.h:339
int etat
Logical state (ETATNONDEF , ETATQCQ or ETATZERO ).
Definition valeur.h:305
const Valeur & lapang() const
Returns the angular Laplacian of *this.
Lorene prototypes.
Definition app_hor.h:67