| 1 |
/* |
| 2 |
* Method of the class Map_af for the resolution of the scalar Poisson |
| 3 |
* equation with a 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 |
char map_af_poisson_falloff_C[] = "$Header: /cvsroot/Lorene/C++/Source/Map/map_af_poisson_falloff.C,v 1.3 2014/10/13 08:53:03 j_novak Exp $" ; |
| 30 |
|
| 31 |
/* |
| 32 |
* $Id: map_af_poisson_falloff.C,v 1.3 2014/10/13 08:53:03 j_novak Exp $ |
| 33 |
* $Log: map_af_poisson_falloff.C,v $ |
| 34 |
* Revision 1.3 2014/10/13 08:53:03 j_novak |
| 35 |
* Lorene classes and functions now belong to the namespace Lorene. |
| 36 |
* |
| 37 |
* Revision 1.2 2005/02/18 13:14:08 j_novak |
| 38 |
* Changing of malloc/free to new/delete + suppression of some unused variables |
| 39 |
* (trying to avoid compilation warnings). |
| 40 |
* |
| 41 |
* Revision 1.1 2004/11/30 20:53:38 k_taniguchi |
| 42 |
* *** empty log message *** |
| 43 |
* |
| 44 |
* |
| 45 |
* $Header: /cvsroot/Lorene/C++/Source/Map/map_af_poisson_falloff.C,v 1.3 2014/10/13 08:53:03 j_novak Exp $ |
| 46 |
* |
| 47 |
*/ |
| 48 |
|
| 49 |
// Header Lorene: |
| 50 |
#include "map.h" |
| 51 |
#include "cmp.h" |
| 52 |
|
| 53 |
namespace Lorene { |
| 54 |
Mtbl_cf sol_poisson_falloff(const Map_af&, const Mtbl_cf&, const int) ; |
| 55 |
//***************************************************************************** |
| 56 |
|
| 57 |
void Map_af::poisson_falloff(const Cmp& source, Param& , Cmp& pot, int k_falloff) const { |
| 58 |
|
| 59 |
assert(source.get_etat() != ETATNONDEF) ; |
| 60 |
assert(source.get_mp()->get_mg() == mg) ; |
| 61 |
assert(pot.get_mp()->get_mg() == mg) ; |
| 62 |
|
| 63 |
// Spherical harmonic expansion of the source |
| 64 |
// ------------------------------------------ |
| 65 |
|
| 66 |
const Valeur& sourva = source.va ; |
| 67 |
|
| 68 |
if (sourva.get_etat() == ETATZERO) { |
| 69 |
pot.set_etat_zero() ; |
| 70 |
return ; |
| 71 |
} |
| 72 |
|
| 73 |
// Spectral coefficients of the source |
| 74 |
assert(sourva.get_etat() == ETATQCQ) ; |
| 75 |
|
| 76 |
Valeur rho(sourva.get_mg()) ; |
| 77 |
sourva.coef() ; |
| 78 |
rho = *(sourva.c_cf) ; // copy of the coefficients of the source |
| 79 |
|
| 80 |
rho.ylm() ; // spherical harmonic transforms |
| 81 |
|
| 82 |
// Call to the Mtbl_cf version |
| 83 |
// --------------------------- |
| 84 |
Mtbl_cf resu = sol_poisson_falloff(*this, *(rho.c_cf), k_falloff) ; |
| 85 |
|
| 86 |
// Final result returned as a Cmp |
| 87 |
// ------------------------------ |
| 88 |
|
| 89 |
pot.set_etat_zero() ; // to call Cmp::del_t(). |
| 90 |
|
| 91 |
pot.set_etat_qcq() ; |
| 92 |
|
| 93 |
pot.va = resu ; |
| 94 |
(pot.va).ylm_i() ; // On repasse en base standard. |
| 95 |
|
| 96 |
} |
| 97 |
|
| 98 |
} |