prepa_helmholtz_plus.C

00001 /*
00002  *   Copyright (c) 1999-2001 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 as published by
00008  *   the Free Software Foundation; either version 2 of the License, or
00009  *   (at your option) any later version.
00010  *
00011  *   LORENE is distributed in the hope that it will be useful,
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *   GNU General Public License for more details.
00015  *
00016  *   You should have received a copy of the GNU General Public License
00017  *   along with LORENE; if not, write to the Free Software
00018  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  *
00020  */
00021 
00022 
00023 char prepa_helmholtz_plus_C[] = "$Header: /cvsroot/Lorene/C++/Source/Non_class_members/PDE/prepa_helmholtz_plus.C,v 1.3 2008/02/18 13:53:43 j_novak Exp $" ;
00024 
00025 /*
00026  * $Id: prepa_helmholtz_plus.C,v 1.3 2008/02/18 13:53:43 j_novak Exp $
00027  * $Log: prepa_helmholtz_plus.C,v $
00028  * Revision 1.3  2008/02/18 13:53:43  j_novak
00029  * Removal of special indentation instructions.
00030  *
00031  * Revision 1.2  2004/01/15 09:15:37  p_grandclement
00032  * Modification and addition of the Helmholtz operators
00033  *
00034  * Revision 1.1  2003/12/11 14:48:49  p_grandclement
00035  * Addition of ALL (and that is a lot !) the files needed for the general elliptic solver ... UNDER DEVELOPEMENT...
00036  *
00037  * 
00038  * $Header: /cvsroot/Lorene/C++/Source/Non_class_members/PDE/prepa_helmholtz_plus.C,v 1.3 2008/02/18 13:53:43 j_novak Exp $
00039  *
00040  */
00041 
00042 //fichiers includes
00043 #include <stdio.h>
00044 #include <stdlib.h>
00045 #include <math.h>
00046 
00047 #include "matrice.h"
00048 #include "type_parite.h"
00049 #include "proto.h"
00050 
00051 
00052 
00053 
00054         //------------------------------------
00055         // Routine pour les cas non prevus --
00056         //-----------------------------------
00057 
00058 Matrice _prepa_helmholtz_plus_nondege_pas_prevu(const Matrice &so) {
00059   
00060     cout << "Unknown case for prepa_helmholtz_plus_nondege" << endl ;
00061     abort() ;
00062     exit(-1) ;
00063     return so;
00064 }
00065 
00066 
00067             //-------------------
00068            //--  R_CHEB   -------
00069           //--------------------
00070 
00071 Matrice _prepa_helmholtz_plus_nondege_r_cheb (const Matrice &lap) {
00072     
00073  int n = lap.get_dim(0) ;
00074  int non_dege = 2 ;
00075  
00076  Matrice res(n-non_dege, n-non_dege) ;
00077  res.set_etat_qcq() ;
00078  for (int i=0 ; i<n-non_dege ; i++)
00079    for (int j=0 ; j<n-non_dege ; j++)
00080      res.set(i, j) = lap(i, j+non_dege) ;
00081  
00082  res.set_band (4,4) ;
00083  res.set_lu() ;
00084  
00085  return res ;
00086 } 
00087 
00088 
00089             //-------------------
00090            //--  R_CHEBP   -------
00091           //--------------------
00092 
00093 Matrice _prepa_helmholtz_plus_nondege_r_chebp (const Matrice &lap) {
00094     
00095  int n = lap.get_dim(0) ;
00096  int non_dege = 1 ;
00097  
00098  Matrice res(n-non_dege, n-non_dege) ;
00099  res.set_etat_qcq() ;
00100  for (int i=0 ; i<n-non_dege ; i++)
00101    for (int j=0 ; j<n-non_dege ; j++)
00102      res.set(i, j) = lap(i, j+non_dege) ;
00103  
00104  res.set_band (4,1) ;
00105  res.set_lu() ;
00106  return res ;
00107 } 
00108   
00109 
00110             //-------------------
00111            //--  Fonction   ----
00112           //-------------------
00113           
00114 Matrice prepa_helmholtz_plus_nondege(const Matrice &ope, int base_r) {
00115 
00116   // Routines de derivation
00117   static Matrice (*prepa_helmholtz_plus_nondege[MAX_BASE])
00118     (const Matrice&) ;
00119   static int nap = 0 ;
00120   
00121   // Premier appel
00122   if (nap==0) {
00123     nap = 1 ;
00124     for (int i=0 ; i<MAX_BASE ; i++) {
00125       prepa_helmholtz_plus_nondege[i] = 
00126     _prepa_helmholtz_plus_nondege_pas_prevu ;
00127     }
00128     // Les routines existantes
00129     prepa_helmholtz_plus_nondege[R_CHEB >> TRA_R] = 
00130       _prepa_helmholtz_plus_nondege_r_cheb ;
00131     prepa_helmholtz_plus_nondege[R_CHEBP >> TRA_R] = 
00132       _prepa_helmholtz_plus_nondege_r_chebp ;
00133   }
00134   
00135   Matrice res(prepa_helmholtz_plus_nondege[base_r](ope)) ;
00136   return res ;
00137 }
00138 

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