ope_helmholtz_plus.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_plus_C[] = "$Header: /cvsroot/Lorene/C++/Source/Ope_elementary/ope_helmholtz_plus.C,v 1.5 2007/05/06 10:48:13 p_grandclement Exp $" ;
00022 
00023 /*
00024  * $Id: ope_helmholtz_plus.C,v 1.5 2007/05/06 10:48:13 p_grandclement Exp $
00025  * $Log: ope_helmholtz_plus.C,v $
00026  * Revision 1.5  2007/05/06 10:48:13  p_grandclement
00027  * Modification of a few operators for the vorton project
00028  *
00029  * Revision 1.4  2004/01/15 09:15:38  p_grandclement
00030  * Modification and addition of the Helmholtz operators
00031  *
00032  * Revision 1.3  2003/12/11 16:12:10  e_gourgoulhon
00033  * Changed sqrt(2) to sqrt(double(2)).
00034  *
00035  * Revision 1.2  2003/12/11 15:57:27  p_grandclement
00036  * include stdlib.h encore ...
00037  *
00038  * Revision 1.1  2003/12/11 14:48:50  p_grandclement
00039  * Addition of ALL (and that is a lot !) the files needed for the general elliptic solver ... UNDER DEVELOPEMENT...
00040  *
00041  * 
00042  * $Header: /cvsroot/Lorene/C++/Source/Ope_elementary/ope_helmholtz_plus.C,v 1.5 2007/05/06 10:48:13 p_grandclement Exp $
00043  *
00044  */
00045 #include <math.h>
00046 #include <stdlib.h>
00047 
00048 #include "proto.h"
00049 #include "ope_elementary.h"
00050 
00051 // Standard constructor :
00052 Ope_helmholtz_plus::Ope_helmholtz_plus (int nbr, int base, int lquant, double alf, 
00053                       double bet, double mas): 
00054   Ope_elementary(nbr, base, alf, bet), lq(lquant), masse (mas) {
00055 }
00056 
00057 // Constructor by copy :
00058 Ope_helmholtz_plus::Ope_helmholtz_plus (const Ope_helmholtz_plus& so) : 
00059   Ope_elementary(so), lq (so.lq), masse (so.masse) {
00060 }
00061 
00062 // Destructor :
00063 Ope_helmholtz_plus::~Ope_helmholtz_plus() {} 
00064 
00065 // True functions :
00066 void Ope_helmholtz_plus::do_ope_mat() const {
00067   if (ope_mat != 0x0)
00068     delete ope_mat ;
00069 
00070   ope_mat = new Matrice 
00071     (helmholtz_plus_mat(nr, lq, alpha, beta, masse, base_r)) ;
00072 }
00073 
00074 void Ope_helmholtz_plus::do_ope_cl() const {
00075   if (ope_mat == 0x0)
00076     do_ope_mat() ;
00077 
00078   if (ope_cl != 0x0)
00079     delete ope_cl ;
00080 
00081   ope_cl = new Matrice 
00082     (cl_helmholtz_plus(*ope_mat, base_r)) ;
00083 }
00084 
00085 void Ope_helmholtz_plus::do_non_dege() const {
00086   if (ope_cl == 0x0)
00087     do_ope_cl() ;
00088 
00089   if (non_dege != 0x0)
00090     delete non_dege ;
00091 
00092   non_dege = new Matrice 
00093     (prepa_helmholtz_plus_nondege(*ope_cl, base_r)) ;
00094 }
00095   
00096 Tbl Ope_helmholtz_plus::get_solp (const Tbl& so) const {
00097 
00098   if (non_dege == 0x0)
00099     do_non_dege() ;
00100 
00101   Tbl res(solp_helmholtz_plus (*ope_mat, *non_dege, so, alpha, beta, base_r));
00102   
00103   Tbl valeurs (val_solp (res, alpha, base_r)) ;
00104   sp_plus = valeurs(0) ;
00105   sp_minus = valeurs(1) ;
00106   dsp_plus = valeurs(2) ;
00107   dsp_minus = valeurs(3) ;
00108   
00109   return res ;
00110 }
00111 
00112 Tbl Ope_helmholtz_plus::get_solh() const {
00113 
00114   Tbl res (solh_helmholtz_plus (nr, lq, alpha, beta, masse, base_r)) ;
00115    
00116   // Un peu tricky...
00117   if (res.get_ndim() == 1) {
00118     Tbl val_lim (val_solp (res, alpha, base_r)) ;
00119 
00120     s_one_plus   = val_lim(0) ;
00121     s_one_minus  = val_lim(1) ; 
00122     ds_one_plus  = val_lim(2) ;
00123     ds_one_minus = val_lim(3) ;
00124 
00125   }
00126   else {
00127     Tbl auxi (nr) ;
00128     auxi.set_etat_qcq() ;
00129     for (int i=0 ; i<nr ; i++)
00130       auxi.set(i) = res(0,i) ;
00131 
00132     Tbl val_one  (val_solp (auxi, alpha, base_r)) ; 
00133    
00134     s_one_plus   = val_one(0) ;
00135     s_one_minus  = val_one(1) ; 
00136     ds_one_plus  = val_one(2) ;
00137     ds_one_minus = val_one(3) ;
00138 
00139     for (int i=0 ; i<nr ; i++)
00140       auxi.set(i) = res(1,i) ;
00141 
00142     Tbl val_two  (val_solp (auxi, alpha, base_r)) ;
00143 
00144     s_two_plus   = val_two(0) ;
00145     s_two_minus  = val_two(1) ; 
00146     ds_two_plus  = val_two(2) ;
00147     ds_two_minus = val_two(3) ;   
00148   }
00149   return res ;
00150 }
00151 
00152 
00153 void Ope_helmholtz_plus::inc_l_quant() {
00154 
00155   cout << "inc_l_quant not implemented for Helmholtz operator." << endl ;
00156   abort() ;
00157 }

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