00001 /* 00002 * Method of the class Map_af for the resolution of the scalar 2D-Poisson 00003 * equation 00004 */ 00005 00006 /* 00007 * Copyright (c) 2004 Philippe Grandclement 00008 * 00009 * This file is part of LORENE. 00010 * 00011 * LORENE is free software; you can redistribute it and/or modify 00012 * it under the terms of the GNU General Public License as published by 00013 * the Free Software Foundation; either version 2 of the License, or 00014 * (at your option) any later version. 00015 * 00016 * LORENE is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU General Public License 00022 * along with LORENE; if not, write to the Free Software 00023 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00024 * 00025 */ 00026 00027 00028 char map_af_elliptic_2d_C[] = "$Header: /cvsroot/Lorene/C++/Source/Map/map_af_elliptic_2d.C,v 1.1 2004/08/24 09:14:42 p_grandclement Exp $" ; 00029 00030 /* 00031 * $Id: map_af_elliptic_2d.C,v 1.1 2004/08/24 09:14:42 p_grandclement Exp $ 00032 * $Log: map_af_elliptic_2d.C,v $ 00033 * Revision 1.1 2004/08/24 09:14:42 p_grandclement 00034 * Addition of some new operators, like Poisson in 2d... It now requieres the 00035 * GSL library to work. 00036 * 00037 * Also, the way a variable change is stored by a Param_elliptic is changed and 00038 * no longer uses Change_var but rather 2 Scalars. The codes using that feature 00039 * will requiere some modification. (It should concern only the ones about monopoles) 00040 * 00041 * 00042 * $Header: /cvsroot/Lorene/C++/Source/Map/map_af_elliptic_2d.C,v 1.1 2004/08/24 09:14:42 p_grandclement Exp $ 00043 * 00044 */ 00045 00046 // Header Lorene: 00047 #include "map.h" 00048 #include "scalar.h" 00049 #include "param_elliptic.h" 00050 00051 //***************************************************************************** 00052 00053 void Map_af::sol_elliptic_2d(Param_elliptic& ope_var, 00054 const Scalar& source, Scalar& pot) const { 00055 00056 assert(source.get_etat() != ETATNONDEF) ; 00057 assert(source.get_mp().get_mg() == mg) ; 00058 assert(pot.get_mp().get_mg() == mg) ; 00059 00060 assert( source.check_dzpuis(2) || source.check_dzpuis(4) 00061 || source.check_dzpuis(3)) ; 00062 00063 // Spherical harmonic expansion of the source 00064 // ------------------------------------------ 00065 00066 const Valeur& sourva = source.get_spectral_va() ; 00067 00068 if (sourva.get_etat() == ETATZERO) { 00069 pot.set_etat_zero() ; 00070 return ; 00071 } 00072 00073 // Spectral coefficients of the source 00074 assert(sourva.get_etat() == ETATQCQ) ; 00075 00076 Valeur rho(sourva.get_mg()) ; 00077 sourva.coef() ; 00078 rho = *(sourva.c_cf) ; // copy of the coefficients of the source 00079 00080 // On calcule les coefs radiaux de F et G 00081 ope_var.var_F.set_spectral_va().coef() ; 00082 ope_var.var_G.set_spectral_va().coef() ; 00083 00084 // Call to the Mtbl_cf version 00085 // --------------------------- 00086 Mtbl_cf resu = elliptic_solver (ope_var, *(rho.c_cf)) ; 00087 00088 pot.set_etat_zero() ; 00089 pot.set_etat_qcq() ; 00090 pot.set_spectral_va() = resu ; 00091 pot.set_dzpuis(0) ; 00092 } 00093 00094
1.4.6