ope_pois_vect_r.C

00001 /*
00002  *  Methods of class Ope_pois_vect_r
00003  *
00004  *   (see file ope_elementary.h for documentation)
00005  *
00006  */
00007 
00008 /*
00009  *   Copyright (c) 2004 Jerome Novak
00010  *
00011  *   This file is part of LORENE.
00012  *
00013  *   LORENE is free software; you can redistribute it and/or modify
00014  *   it under the terms of the GNU General Public License version 2
00015  *   as published by the Free Software Foundation.
00016  *
00017  *   LORENE is distributed in the hope that it will be useful,
00018  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  *   GNU General Public License for more details.
00021  *
00022  *   You should have received a copy of the GNU General Public License
00023  *   along with LORENE; if not, write to the Free Software
00024  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025  *
00026  */
00027 
00028 char ope_pois_vect_r_C[] = "$Header: /cvsroot/Lorene/C++/Source/Ope_elementary/Ope_pois_vect_r/ope_pois_vect_r.C,v 1.1 2004/05/10 15:28:22 j_novak Exp $" ;
00029 
00030 /*
00031  * $Id: ope_pois_vect_r.C,v 1.1 2004/05/10 15:28:22 j_novak Exp $
00032  * $Log: ope_pois_vect_r.C,v $
00033  * Revision 1.1  2004/05/10 15:28:22  j_novak
00034  * First version of functions for the solution of the r-component of the
00035  * vector Poisson equation.
00036  *
00037  * 
00038  * $Header: /cvsroot/Lorene/C++/Source/Ope_elementary/Ope_pois_vect_r/ope_pois_vect_r.C,v 1.1 2004/05/10 15:28:22 j_novak Exp $
00039  *
00040  */
00041 
00042 #include"type_parite.h"
00043 #include "ope_elementary.h"
00044 
00045 Matrice ope_pvect_r_mat(int , int , double , int, int ) ;
00046 Tbl sh_pvect_r(int, int, double, int) ;
00047 Matrice cl_pvect_r (const Matrice&, int, double, int, int) ;
00048 Matrice nondeg_pvect_r (const Matrice&, int, double, int, int) ;
00049 Tbl val_solh (int, double, double, int) ;
00050 
00051 // Standard constructor :
00052 Ope_pois_vect_r::Ope_pois_vect_r (int nbr, int baser, double alf, double bet, int lq, int dz): 
00053   Ope_poisson(nbr, baser, alf, bet, lq, dz) 
00054 {
00055   assert (dzpuis == 4) ;
00056 }
00057 
00058 // Constructor by copy :
00059 Ope_pois_vect_r::Ope_pois_vect_r (const Ope_pois_vect_r& so) : Ope_poisson(so)
00060 {
00061   assert (dzpuis == 4) ;
00062 
00063 }
00064 
00065 // Destructor :
00066 Ope_pois_vect_r::~Ope_pois_vect_r() {} 
00067 
00068 // True functions :
00069 void Ope_pois_vect_r::do_ope_mat() const {
00070   if (ope_mat != 0x0)
00071     delete ope_mat ;
00072 
00073   ope_mat = new Matrice 
00074     (ope_pvect_r_mat(nr, l_quant, beta/alpha, dzpuis, base_r)) ;
00075 }
00076 
00077 void Ope_pois_vect_r::do_ope_cl() const {
00078   if (ope_mat == 0x0)
00079     do_ope_mat() ;
00080 
00081   if (ope_cl != 0x0)
00082     delete ope_cl ;
00083 
00084   ope_cl = new Matrice 
00085     (cl_pvect_r(*ope_mat, l_quant, beta/alpha, dzpuis, base_r)) ;
00086 }
00087 
00088 void Ope_pois_vect_r::do_non_dege() const {
00089   if (ope_cl == 0x0)
00090     do_ope_cl() ;
00091 
00092   if (non_dege != 0x0)
00093     delete non_dege ;
00094 
00095   non_dege = new Matrice 
00096     (nondeg_pvect_r(*ope_cl, l_quant, beta/alpha, dzpuis, base_r)) ;
00097 }
00098   
00099 Tbl Ope_pois_vect_r::get_solh() const {
00100 
00101   int l1 = ( (l_quant == 0) ? 1 : l_quant - 1 ) ;
00102   int l2 = l_quant + 1 ;
00103  
00104   Tbl valeurs1 (val_solh (l1, alpha, beta, base_r)) ;
00105   Tbl valeurs2 (val_solh (l2, alpha, beta, base_r)) ;
00106 
00107   assert (valeurs1.get_ndim() == valeurs2.get_ndim()) ;
00108 
00109   if (valeurs1.get_ndim() == 2) {
00110     // cas 2 sh
00111     s_one_plus = valeurs1(0,0) ;
00112     s_one_minus = valeurs1(0,1) ;
00113     ds_one_plus = valeurs1(0,2) ;
00114     ds_one_minus = valeurs1(0,3) ;
00115 
00116     s_two_plus = valeurs2(1,0) ;
00117     s_two_minus = valeurs2(1,1) ;
00118     ds_two_plus = valeurs2(1,2) ;
00119     ds_two_minus = valeurs2(1,3) ;
00120   }
00121   else {
00122     // cas 1 sh :
00123     Tbl&  valeurs = (base_r == R_CHEBU) ? valeurs2 : valeurs1 ;
00124     s_one_plus = valeurs(0) ;
00125     s_one_minus = valeurs(1) ;
00126     ds_one_plus = valeurs(2) ;
00127     ds_one_minus = valeurs(3) ;
00128   } 
00129  
00130   return sh_pvect_r(nr, l_quant, beta/alpha, base_r) ;
00131 }
00132 

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