map_af_poisson_falloff.C

00001 /*
00002  *  Method of the class Map_af for the resolution of the scalar Poisson
00003  *   equation with a falloff condition at the outer boundary
00004  *
00005  *    (see file map.h for documentation).
00006  *
00007  */
00008 
00009 /*
00010  *   Copyright (c) 2004 Joshua A. Faber
00011  *
00012  *   This file is part of LORENE.
00013  *
00014  *   LORENE is free software; you can redistribute it and/or modify
00015  *   it under the terms of the GNU General Public License version 2
00016  *   as published by the Free Software Foundation.
00017  *
00018  *   LORENE is distributed in the hope that it will be useful,
00019  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  *   GNU General Public License for more details.
00022  *
00023  *   You should have received a copy of the GNU General Public License
00024  *   along with LORENE; if not, write to the Free Software
00025  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00026  *
00027  */
00028 
00029 char map_af_poisson_falloff_C[] = "$Header: /cvsroot/Lorene/C++/Source/Map/map_af_poisson_falloff.C,v 1.2 2005/02/18 13:14:08 j_novak Exp $" ;
00030 
00031 /*
00032  * $Id: map_af_poisson_falloff.C,v 1.2 2005/02/18 13:14:08 j_novak Exp $
00033  * $Log: map_af_poisson_falloff.C,v $
00034  * Revision 1.2  2005/02/18 13:14:08  j_novak
00035  * Changing of malloc/free to new/delete + suppression of some unused variables
00036  * (trying to avoid compilation warnings).
00037  *
00038  * Revision 1.1  2004/11/30 20:53:38  k_taniguchi
00039  * *** empty log message ***
00040  *
00041  *
00042  * $Header: /cvsroot/Lorene/C++/Source/Map/map_af_poisson_falloff.C,v 1.2 2005/02/18 13:14:08 j_novak Exp $
00043  *
00044  */
00045 
00046 // Header Lorene:
00047 #include "map.h"
00048 #include "cmp.h"
00049 
00050 Mtbl_cf sol_poisson_falloff(const Map_af&, const Mtbl_cf&, const int) ;
00051 //*****************************************************************************
00052 
00053 void Map_af::poisson_falloff(const Cmp& source, Param& , Cmp& pot, int k_falloff) const {
00054     
00055     assert(source.get_etat() != ETATNONDEF) ; 
00056     assert(source.get_mp()->get_mg() == mg) ; 
00057     assert(pot.get_mp()->get_mg() == mg) ; 
00058 
00059     // Spherical harmonic expansion of the source
00060     // ------------------------------------------
00061     
00062     const Valeur& sourva = source.va ; 
00063 
00064     if (sourva.get_etat() == ETATZERO) {
00065     pot.set_etat_zero() ;
00066     return ;  
00067     }
00068 
00069     // Spectral coefficients of the source
00070     assert(sourva.get_etat() == ETATQCQ) ; 
00071     
00072     Valeur rho(sourva.get_mg()) ; 
00073     sourva.coef() ; 
00074     rho = *(sourva.c_cf) ;  // copy of the coefficients of the source
00075     
00076     rho.ylm() ;         // spherical harmonic transforms 
00077         
00078     // Call to the Mtbl_cf version
00079     // ---------------------------
00080     Mtbl_cf resu = sol_poisson_falloff(*this, *(rho.c_cf), k_falloff) ;
00081     
00082     // Final result returned as a Cmp
00083     // ------------------------------
00084     
00085     pot.set_etat_zero() ;  // to call Cmp::del_t().
00086 
00087     pot.set_etat_qcq() ; 
00088     
00089     pot.va = resu ;
00090     (pot.va).ylm_i() ; // On repasse en base standard.      
00091 
00092 }
00093 

Generated on Tue Feb 7 01:35:17 2012 for LORENE by  doxygen 1.4.6