param_elliptic_pseudo_1d.C

00001 /*
00002  *   Copyright (c) 2004 Philippe Grandclement
00003  *
00004  *   This file is part of LORENE.
00005  *
00006  *   LORENE is free software; you can redistribute it and/or modify
00007  *   it under the terms of the GNU General Public License version 2
00008  *   as published by the Free Software Foundation.
00009  *
00010  *   LORENE is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details.
00014  *
00015  *   You should have received a copy of the GNU General Public License
00016  *   along with LORENE; if not, write to the Free Software
00017  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018  *
00019  */
00020 
00021 char param_elliptic_pseudo_1d_C[] = "$Header: /cvsroot/Lorene/C++/Source/Param_elliptic/param_elliptic_pseudo_1d.C,v 1.1 2004/08/24 09:14:49 p_grandclement Exp $" ;
00022 
00023 /*
00024  * $Id: param_elliptic_pseudo_1d.C,v 1.1 2004/08/24 09:14:49 p_grandclement Exp $
00025  * $Log: param_elliptic_pseudo_1d.C,v $
00026  * Revision 1.1  2004/08/24 09:14:49  p_grandclement
00027  * Addition of some new operators, like Poisson in 2d... It now requieres the
00028  * GSL library to work.
00029  *
00030  * Also, the way a variable change is stored by a Param_elliptic is changed and
00031  * no longer uses Change_var but rather 2 Scalars. The codes using that feature
00032  * will requiere some modification. (It should concern only the ones about monopoles)
00033  *
00034  * 
00035  * $Header: /cvsroot/Lorene/C++/Source/Param_elliptic/param_elliptic_pseudo_1d.C,v 1.1 2004/08/24 09:14:49 p_grandclement Exp $
00036  *
00037  */
00038 
00039 #include "headcpp.h"
00040 
00041 #include <math.h>
00042 #include <stdlib.h>
00043 
00044 #include "param_elliptic.h"
00045 #include "base_val.h" 
00046 #include "map.h"
00047 #include "ope_elementary.h"
00048 #include "change_var.h"
00049 #include "scalar.h"
00050 
00051 
00052 void Param_elliptic::set_poisson_pseudo_1d(Scalar& source) {
00053 
00054   if (type_map != MAP_AFF) {
00055     cout << "set_poisson_pseudo_1d only defined for an affine mapping..." << endl ;
00056     abort() ;
00057   }
00058   else {
00059 
00060     int nz = get_mp().get_mg()->get_nzone() ;
00061     
00062     int nr ;
00063     double alpha, beta ;
00064     int m_quant, l_quant, base_r_1d ;
00065 
00066     int conte = 0 ;
00067     for (int l=0 ; l<nz ; l++) {
00068       
00069       nr = get_mp().get_mg()->get_nr(l) ;
00070       alpha = get_alpha (l) ;
00071       beta = get_beta (l) ;
00072 
00073       for (int k=0 ; k<get_mp().get_mg()->get_np(l)+1 ; k++)
00074     for (int j=0 ; j<get_mp().get_mg()->get_nt(l) ; j++) {
00075       if (operateurs[conte] != 0x0)     
00076         delete operateurs[conte] ;
00077         source.get_spectral_va().base.give_quant_numbers(l, k, j, m_quant, l_quant, base_r_1d) ;
00078         if ((k!=1) && (l!=nz-1))
00079         operateurs[conte] = new Ope_poisson_pseudo_1d (nr, base_r_1d, alpha, beta, l_quant) ;
00080         else
00081           operateurs[conte] = 0x0 ;
00082         conte ++ ;
00083     }
00084     }
00085   }
00086 }
00087 
00088 void Param_elliptic::set_helmholtz_minus_pseudo_1d(int zone, double masse, Scalar& source) {
00089 
00090   int dzpuis = source.get_dzpuis() ;
00091   assert (masse > 0) ;
00092 
00093   if (type_map != MAP_AFF) {
00094     cout << "set_helmholtz_minus_pseudo_1d only defined for an affine mapping..." << endl ;
00095     abort() ;
00096   }
00097   else {
00098 
00099     int nz = get_mp().get_mg()->get_nzone() ;
00100     if (zone == nz-1)  
00101       source.check_dzpuis(2) ; 
00102     int nr ;
00103     double alpha, beta ;
00104     int m_quant, l_quant, base_r_1d ;
00105 
00106     int conte = 0 ;
00107     for (int l=0 ; l<nz ; l++) {
00108       
00109       nr = get_mp().get_mg()->get_nr(l) ;
00110       alpha = get_alpha (l) ;
00111       beta = get_beta (l) ;
00112 
00113       for (int k=0 ; k<get_mp().get_mg()->get_np(l)+1 ; k++)
00114     for (int j=0 ; j<get_mp().get_mg()->get_nt(l) ; j++) {
00115       if (l==zone) {
00116         if (operateurs[conte] != 0x0)       
00117           delete operateurs[conte] ;
00118           source.get_spectral_va().base.give_quant_numbers 
00119         (l, k, j, m_quant, l_quant, base_r_1d) ;
00120           operateurs[conte] = new Ope_helmholtz_minus_pseudo_1d (nr, base_r_1d, 
00121                                      alpha, beta, l_quant, masse, dzpuis) ;
00122       } 
00123       conte ++ ;
00124     }
00125     }
00126   }
00127 }
00128 

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