ope_pois_tens_rr.C

00001 /*
00002  *  Methods of class Ope_pois_tens_rr
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_tens_rr_C[] = "$Header: /cvsroot/Lorene/C++/Source/Ope_elementary/Ope_pois_vect_r/ope_pois_tens_rr.C,v 1.1 2004/12/23 16:30:15 j_novak Exp $" ;
00029 
00030 /*
00031  * $Id: ope_pois_tens_rr.C,v 1.1 2004/12/23 16:30:15 j_novak Exp $
00032  * $Log: ope_pois_tens_rr.C,v $
00033  * Revision 1.1  2004/12/23 16:30:15  j_novak
00034  * New files and class for the solution of the rr component of the tensor Poisson
00035  * equation.
00036  *
00037  *
00038  * 
00039  * $Header: /cvsroot/Lorene/C++/Source/Ope_elementary/Ope_pois_vect_r/ope_pois_tens_rr.C,v 1.1 2004/12/23 16:30:15 j_novak Exp $
00040  *
00041  */
00042 
00043 #include"type_parite.h"
00044 #include "ope_elementary.h"
00045 
00046 Matrice ope_ptens_rr_mat(int , int , double , int, int ) ;
00047 Tbl sh_ptens_rr(int, int, double, int) ;
00048 Matrice cl_ptens_rr (const Matrice&, int, double, int, int) ;
00049 Matrice nondeg_ptens_rr (const Matrice&, int, double, int, int) ;
00050 Tbl val_solh (int, double, double, int) ;
00051 
00052 // Standard constructor :
00053 Ope_pois_tens_rr::Ope_pois_tens_rr (int nbr, int baser, double alf, double bet, int lq, int dz): 
00054   Ope_poisson(nbr, baser, alf, bet, lq, dz) 
00055 {
00056   assert (dzpuis == 4) ;
00057   assert (l_quant > 1) ;
00058 }
00059 
00060 // Constructor by copy :
00061 Ope_pois_tens_rr::Ope_pois_tens_rr (const Ope_pois_tens_rr& so) : Ope_poisson(so)
00062 {
00063   assert (dzpuis == 4) ;
00064   assert (l_quant > 1) ;
00065 }
00066 
00067 // Destructor :
00068 Ope_pois_tens_rr::~Ope_pois_tens_rr() {} 
00069 
00070 // True functions :
00071 void Ope_pois_tens_rr::do_ope_mat() const {
00072   if (ope_mat != 0x0)
00073     delete ope_mat ;
00074 
00075   ope_mat = new Matrice 
00076     (ope_ptens_rr_mat(nr, l_quant, beta/alpha, dzpuis, base_r)) ;
00077 }
00078 
00079 void Ope_pois_tens_rr::do_ope_cl() const {
00080   if (ope_mat == 0x0)
00081     do_ope_mat() ;
00082 
00083   if (ope_cl != 0x0)
00084     delete ope_cl ;
00085 
00086   ope_cl = new Matrice 
00087     (cl_ptens_rr(*ope_mat, l_quant, beta/alpha, dzpuis, base_r)) ;
00088 }
00089 
00090 void Ope_pois_tens_rr::do_non_dege() const {
00091   if (ope_cl == 0x0)
00092     do_ope_cl() ;
00093 
00094   if (non_dege != 0x0)
00095     delete non_dege ;
00096 
00097   non_dege = new Matrice 
00098     (nondeg_ptens_rr(*ope_cl, l_quant, beta/alpha, dzpuis, base_r)) ;
00099 }
00100   
00101 Tbl Ope_pois_tens_rr::get_solh() const {
00102 
00103     assert (l_quant > 1) ;
00104     int l1 = l_quant - 2 ;
00105     int l2 = l_quant + 2 ;
00106  
00107     Tbl valeurs1 (val_solh (l1, alpha, beta, base_r)) ;
00108     Tbl valeurs2 (val_solh (l2, alpha, beta, base_r)) ;
00109     
00110     assert (valeurs1.get_ndim() == valeurs2.get_ndim()) ;
00111 
00112   if (valeurs1.get_ndim() == 2) {
00113     // cas 2 sh
00114     s_one_plus = valeurs1(0,0) ;
00115     s_one_minus = valeurs1(0,1) ;
00116     ds_one_plus = valeurs1(0,2) ;
00117     ds_one_minus = valeurs1(0,3) ;
00118 
00119     s_two_plus = valeurs2(1,0) ;
00120     s_two_minus = valeurs2(1,1) ;
00121     ds_two_plus = valeurs2(1,2) ;
00122     ds_two_minus = valeurs2(1,3) ;
00123   }
00124   else {
00125     // cas 1 sh :
00126     Tbl&  valeurs = (base_r == R_CHEBU) ? valeurs2 : valeurs1 ;
00127     s_one_plus = valeurs(0) ;
00128     s_one_minus = valeurs(1) ;
00129     ds_one_plus = valeurs(2) ;
00130     ds_one_minus = valeurs(3) ;
00131   } 
00132  
00133   return sh_ptens_rr(nr, l_quant, beta/alpha, base_r) ;
00134 }
00135 

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