ope_helmholtz_minus_2d_non_dege.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 ope_helmholtz_minus_2d_non_dege_C[] = "$Header: /cvsroot/Lorene/C++/Source/Ope_elementary/Ope_helmholtz_minus_2d/ope_helmholtz_minus_2d_non_dege.C,v 1.1 2004/08/24 09:14:46 p_grandclement Exp $" ;
00022 
00023 /*
00024  * $Id: ope_helmholtz_minus_2d_non_dege.C,v 1.1 2004/08/24 09:14:46 p_grandclement Exp $
00025  * $Header: /cvsroot/Lorene/C++/Source/Ope_elementary/Ope_helmholtz_minus_2d/ope_helmholtz_minus_2d_non_dege.C,v 1.1 2004/08/24 09:14:46 p_grandclement Exp $
00026  *
00027  */
00028 #include <math.h>
00029 #include <stdlib.h>
00030 
00031 #include "proto.h"
00032 #include "ope_elementary.h"
00033 
00034 
00035         //------------------------------------
00036         // Routine pour les cas non prevus --
00037         //-----------------------------------
00038 
00039 Matrice _helmholtz_minus_2d_non_dege_pas_prevu(const Matrice &lap, int) {
00040     cout << "Construction non degeneree pas prevue..." << endl ;
00041     abort() ;
00042     exit(-1) ;
00043     return lap ;
00044 }
00045 
00046 
00047 
00048             //-------------------
00049            //--  R_CHEB   -------
00050           //--------------------
00051 
00052 Matrice _helmholtz_minus_2d_non_dege_r_cheb (const Matrice &lap, int) {
00053     
00054     
00055   int n = lap.get_dim(0) ;
00056     
00057   Matrice res(n-2, n-2) ;
00058   res.set_etat_qcq() ;
00059   for (int i=0 ; i<n-2 ; i++)
00060     for (int j=0 ; j<n-2 ; j++)
00061       res.set(i, j) = lap(i, j+2) ;
00062   
00063   res.set_band(4, 4) ;
00064   res.set_lu() ;
00065   
00066   return res ;
00067 }
00068 
00069 
00070             //-------------------
00071            //--  R_CHEBU   -----
00072           //-------------------
00073 Matrice _helmholtz_minus_2d_non_dege_r_chebu_deux (const Matrice&) ;    
00074           
00075 Matrice _helmholtz_minus_2d_non_dege_r_chebu (const Matrice &lap,  int puis) {
00076 
00077     switch (puis) {
00078     case 2 :
00079         return _helmholtz_minus_2d_non_dege_r_chebu_deux (lap) ;
00080     default :
00081         abort() ;
00082         exit(-1) ;
00083         return Matrice(0, 0) ;
00084     }
00085 }
00086 
00087 
00088 // Cas dzpuis = 2 ;
00089 Matrice _helmholtz_minus_2d_non_dege_r_chebu_deux (const Matrice &lap) {
00090     
00091    int n = lap.get_dim(0) ;
00092     
00093    Matrice res(n-1, n-1) ;
00094    res.set_etat_qcq() ;
00095    for (int i=0 ;i<n-1 ; i++)
00096      for (int j=0 ; j<n-1 ; j++)
00097        res.set(i, j) = lap(i, j+1) ;
00098    res.set_band(5, 3) ;
00099    res.set_lu() ;
00100    
00101    return res ;
00102 }
00103 
00104 
00105 void Ope_helmholtz_minus_2d::do_non_dege() const {
00106   if (ope_cl == 0x0)
00107     do_ope_cl() ;
00108   
00109   if (non_dege != 0x0)
00110     delete non_dege ;
00111   
00112   // Routines de derivation
00113   static Matrice (*helmholtz_minus_2d_non_dege[MAX_BASE])(const Matrice&, int);
00114   static int nap = 0 ;
00115   
00116   // Premier appel
00117   if (nap==0) {
00118     nap = 1 ;
00119     for (int i=0 ; i<MAX_BASE ; i++) {
00120       helmholtz_minus_2d_non_dege[i] = _helmholtz_minus_2d_non_dege_pas_prevu ;
00121     }
00122     // Les routines existantes
00123     helmholtz_minus_2d_non_dege[R_CHEB >> TRA_R] = _helmholtz_minus_2d_non_dege_r_cheb ;
00124     helmholtz_minus_2d_non_dege[R_CHEBU >> TRA_R] = _helmholtz_minus_2d_non_dege_r_chebu ;
00125   }
00126   non_dege = new Matrice(helmholtz_minus_2d_non_dege[base_r](*ope_cl, dzpuis)) ;
00127 }

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