ope_helmholtz_minus.C

00001 /*
00002  *   Copyright (c) 2003 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 ope_helmholtz_minus_C[] = "$Header: /cvsroot/Lorene/C++/Source/Ope_elementary/ope_helmholtz_minus.C,v 1.6 2008/07/10 10:59:17 p_grandclement Exp $" ;
00022 
00023 /*
00024  * $Id: ope_helmholtz_minus.C,v 1.6 2008/07/10 10:59:17 p_grandclement Exp $
00025  * $Log: ope_helmholtz_minus.C,v $
00026  * Revision 1.6  2008/07/10 10:59:17  p_grandclement
00027  * forgot another ones
00028  *
00029  * Revision 1.5  2004/08/24 09:14:45  p_grandclement
00030  * Addition of some new operators, like Poisson in 2d... It now requieres the
00031  * GSL library to work.
00032  *
00033  * Also, the way a variable change is stored by a Param_elliptic is changed and
00034  * no longer uses Change_var but rather 2 Scalars. The codes using that feature
00035  * will requiere some modification. (It should concern only the ones about monopoles)
00036  *
00037  * Revision 1.4  2004/01/15 09:15:38  p_grandclement
00038  * Modification and addition of the Helmholtz operators
00039  *
00040  * Revision 1.3  2003/12/11 16:12:10  e_gourgoulhon
00041  * Changed sqrt(2) to sqrt(double(2)).
00042  *
00043  * Revision 1.2  2003/12/11 15:57:27  p_grandclement
00044  * include stdlib.h encore ...
00045  *
00046  * Revision 1.1  2003/12/11 14:48:50  p_grandclement
00047  * Addition of ALL (and that is a lot !) the files needed for the general elliptic solver ... UNDER DEVELOPEMENT...
00048  *
00049  * 
00050  * $Header: /cvsroot/Lorene/C++/Source/Ope_elementary/ope_helmholtz_minus.C,v 1.6 2008/07/10 10:59:17 p_grandclement Exp $
00051  *
00052  */
00053 #include <math.h>
00054 #include <stdlib.h>
00055 
00056 #include "proto.h"
00057 #include "ope_elementary.h"
00058 
00059 // Standard constructor :
00060 Ope_helmholtz_minus::Ope_helmholtz_minus (int nbr, int base, int lquant, 
00061                       double alf, double bet, double mas): 
00062   Ope_elementary(nbr, base, alf, bet), lq (lquant), masse (mas) {
00063 }
00064 
00065 // Constructor by copy :
00066 Ope_helmholtz_minus::Ope_helmholtz_minus (const Ope_helmholtz_minus& so) : 
00067   Ope_elementary(so), lq(so.lq), masse (so.masse) {
00068 }
00069 
00070 // Destructor :
00071 Ope_helmholtz_minus::~Ope_helmholtz_minus() {} 
00072 
00073 // True functions :
00074 void Ope_helmholtz_minus::do_ope_mat() const {
00075   if (ope_mat != 0x0)
00076     delete ope_mat ;
00077 
00078   ope_mat = new Matrice 
00079     (helmholtz_minus_mat(nr, lq, alpha, beta, masse, base_r)) ;
00080 }
00081 
00082 void Ope_helmholtz_minus::do_ope_cl() const {
00083   if (ope_mat == 0x0)
00084     do_ope_mat() ;
00085 
00086   if (ope_cl != 0x0)
00087     delete ope_cl ;
00088 
00089   ope_cl = new Matrice 
00090     (cl_helmholtz_minus(*ope_mat, base_r)) ;
00091 }
00092 
00093 void Ope_helmholtz_minus::do_non_dege() const {
00094   if (ope_cl == 0x0)
00095     do_ope_cl() ;
00096 
00097   if (non_dege != 0x0)
00098     delete non_dege ;
00099 
00100   non_dege = new Matrice 
00101     (prepa_helmholtz_minus_nondege(*ope_cl, base_r)) ;
00102 }
00103   
00104 Tbl Ope_helmholtz_minus::get_solp (const Tbl& so) const {
00105 
00106   if (non_dege == 0x0)
00107     do_non_dege() ;
00108 
00109   Tbl res(solp_helmholtz_minus (*ope_mat, *non_dege, so, alpha, beta, lq, base_r));
00110   
00111   Tbl valeurs (val_solp (res, alpha, base_r)) ;
00112   sp_plus = valeurs(0) ;
00113   sp_minus = valeurs(1) ;
00114   dsp_plus = valeurs(2) ;
00115   dsp_minus = valeurs(3) ;
00116   
00117   return res ;
00118 }
00119 
00120 Tbl Ope_helmholtz_minus::get_solh() const {
00121   
00122   Tbl res (solh_helmholtz_minus (nr, lq, alpha, beta, masse, base_r)) ;
00123    
00124   // Un peu tricky...
00125   if (res.get_ndim() == 1) {
00126     Tbl val_lim (val_solp (res, alpha, base_r)) ;
00127 
00128     s_one_plus   = val_lim(0) ;
00129     s_one_minus  = val_lim(1) ; 
00130     ds_one_plus  = val_lim(2) ;
00131     ds_one_minus = val_lim(3) ;
00132 
00133   }
00134   else {
00135     Tbl auxi (nr) ;
00136     auxi.set_etat_qcq() ;
00137     for (int i=0 ; i<nr ; i++)
00138       auxi.set(i) = res(0,i) ;
00139 
00140     Tbl val_one  (val_solp (auxi, alpha, base_r)) ; 
00141    
00142     s_one_plus   = val_one(0) ;
00143     s_one_minus  = val_one(1) ; 
00144     ds_one_plus  = val_one(2) ;
00145     ds_one_minus = val_one(3) ;
00146 
00147     for (int i=0 ; i<nr ; i++)
00148       auxi.set(i) = res(1,i) ;
00149 
00150     Tbl val_two  (val_solp (auxi, alpha, base_r)) ;
00151 
00152     s_two_plus   = val_two(0) ;
00153     s_two_minus  = val_two(1) ; 
00154     ds_two_plus  = val_two(2) ;
00155     ds_two_minus = val_two(3) ;   
00156   }
00157   return res ;
00158 }
00159 
00160 
00161 
00162 void Ope_helmholtz_minus::inc_l_quant() {
00163 
00164   cout << "inc_l_quant not implemented for Helmholtz operator." << endl ;
00165   abort() ;
00166 }

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