LORENE
map_af_poisson_ylm.C
1 /*
2  * Method of the class Map_af for the resolution of the scalar Poisson
3  * equation with a multipole falloff condition at the outer boundary
4  *
5  * (see file map.h for documentation).
6  *
7  */
8 
9 /*
10  * Copyright (c) 2004 Joshua A. Faber
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 version 2
16  * as published by the Free Software Foundation.
17  *
18  * LORENE is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with LORENE; if not, write to the Free Software
25  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26  *
27  */
28 
29 
30 
31 /*
32  * $Id: map_af_poisson_ylm.C,v 1.4 2016/12/05 16:17:57 j_novak Exp $
33  * $Log: map_af_poisson_ylm.C,v $
34  * Revision 1.4 2016/12/05 16:17:57 j_novak
35  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
36  *
37  * Revision 1.3 2014/10/13 08:53:03 j_novak
38  * Lorene classes and functions now belong to the namespace Lorene.
39  *
40  * Revision 1.2 2005/02/18 13:14:08 j_novak
41  * Changing of malloc/free to new/delete + suppression of some unused variables
42  * (trying to avoid compilation warnings).
43  *
44  * Revision 1.1 2004/12/30 15:55:57 k_taniguchi
45  * *** empty log message ***
46  *
47  *
48  * $Header: /cvsroot/Lorene/C++/Source/Map/map_af_poisson_ylm.C,v 1.4 2016/12/05 16:17:57 j_novak Exp $
49  *
50  */
51 
52 // Lorene headers
53 #include "map.h"
54 #include "cmp.h"
55 
56 namespace Lorene {
57 Mtbl_cf sol_poisson_ylm(const Map_af&, const Mtbl_cf&, const int, const double*) ;
58 //*****************************************************************************
59 
60 void Map_af::poisson_ylm(const Cmp& source, Param& , Cmp& pot, int nylm, double* intvec) const {
61 
62  assert(source.get_etat() != ETATNONDEF) ;
63  assert(source.get_mp()->get_mg() == mg) ;
64  assert(pot.get_mp()->get_mg() == mg) ;
65 
66  // Spherical harmonic expansion of the source
67  // ------------------------------------------
68 
69  const Valeur& sourva = source.va ;
70 
71  if (sourva.get_etat() == ETATZERO) {
72  pot.set_etat_zero() ;
73  return ;
74  }
75 
76  // Spectral coefficients of the source
77  assert(sourva.get_etat() == ETATQCQ) ;
78 
79  Valeur rho(sourva.get_mg()) ;
80  sourva.coef() ;
81  rho = *(sourva.c_cf) ; // copy of the coefficients of the source
82 
83  rho.ylm() ; // spherical harmonic transforms
84 
85  // Call to the Mtbl_cf version
86  // ---------------------------
87  Mtbl_cf resu = sol_poisson_ylm(*this, *(rho.c_cf), nylm, intvec) ;
88 
89  // Final result returned as a Cmp
90  // ------------------------------
91 
92  pot.set_etat_zero() ; // to call Cmp::del_t().
93 
94  pot.set_etat_qcq() ;
95 
96  pot.va = resu ;
97  (pot.va).ylm_i() ; // On repasse en base standard.
98 
99 }
100 
101 }
Lorene prototypes.
Definition: app_hor.h:67
const Mg3d * mg
Pointer on the multi-grid Mgd3 on which this is defined.
Definition: map.h:688