valeur_d2sdx2.C

00001 /*
00002  * Computation of d^2/dx^2
00003  *
00004  * for:
00005  *   - Valeur
00006  *   - Mtbl_cf
00007  */
00008 
00009 /*
00010  *   Copyright (c) 1999-2000 Jean-Alain Marck
00011  *   Copyright (c) 1999-2001 Eric Gourgoulhon
00012  *
00013  *   This file is part of LORENE.
00014  *
00015  *   LORENE is free software; you can redistribute it and/or modify
00016  *   it under the terms of the GNU General Public License as published by
00017  *   the Free Software Foundation; either version 2 of the License, or
00018  *   (at your option) any later version.
00019  *
00020  *   LORENE is distributed in the hope that it will be useful,
00021  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00022  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023  *   GNU General Public License for more details.
00024  *
00025  *   You should have received a copy of the GNU General Public License
00026  *   along with LORENE; if not, write to the Free Software
00027  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00028  *
00029  */
00030 
00031 
00032 char valeur_d2sdx2_C[] = "$Header: /cvsroot/Lorene/C++/Source/Valeur/valeur_d2sdx2.C,v 1.3 2008/08/27 08:52:55 jl_cornou Exp $" ;
00033 
00034 /*
00035  * $Id: valeur_d2sdx2.C,v 1.3 2008/08/27 08:52:55 jl_cornou Exp $
00036  * $Log: valeur_d2sdx2.C,v $
00037  * Revision 1.3  2008/08/27 08:52:55  jl_cornou
00038  * Added Jacobi(0,2) polynomials case
00039  *
00040  * Revision 1.2  2004/11/23 15:17:19  m_forot
00041  * Added the bases for the cases without any equatorial symmetry
00042  *  (T_COSSIN_C, T_COSSIN_S, T_LEG, R_CHEBPI_P, R_CHEBPI_I).
00043  *
00044  * Revision 1.1.1.1  2001/11/20 15:19:27  e_gourgoulhon
00045  * LORENE
00046  *
00047  * Revision 2.9  2000/08/16  10:46:03  eric
00048  * Suppression de Mtbl_cf::dzpuis.
00049  *
00050  * Revision 2.8  1999/11/30  12:43:41  eric
00051  * Valeur::base est desormais du type Base_val et non plus Base_val*.
00052  *
00053  * Revision 2.7  1999/11/23  16:16:32  eric
00054  * Reorganisation du calcul dans le cas ETATZERO.
00055  *
00056  * Revision 2.6  1999/11/19  09:30:38  eric
00057  * La valeur de retour est desormais const Valeur &.
00058  *
00059  * Revision 2.5  1999/10/28  07:59:29  eric
00060  * Modif commentaires.
00061  *
00062  * Revision 2.4  1999/10/18  13:41:11  eric
00063  * Suppression de l'argument base dans les routines de derivation des mtbl_cf.
00064  *
00065  * Revision 2.3  1999/09/07  15:43:08  phil
00066  * coreection bases
00067  *
00068  * Revision 2.2  1999/03/01  15:08:40  eric
00069  * *** empty log message ***
00070  *
00071  * Revision 2.1  1999/02/23  10:39:02  hyc
00072  * *** empty log message ***
00073  *
00074  *
00075  * $Header: /cvsroot/Lorene/C++/Source/Valeur/valeur_d2sdx2.C,v 1.3 2008/08/27 08:52:55 jl_cornou Exp $
00076  *
00077  */
00078 
00079 // Headers C
00080 #include <assert.h>
00081 
00082 // Headers Lorene
00083 #include "mtbl_cf.h"
00084 #include "valeur.h"
00085 
00086 // Prototypage temporaire
00087 void _d2sdx2_pas_prevu(Tbl *, int &) ;
00088 void _d2sdx2_r_cheb(Tbl *, int &) ;
00089 void _d2sdx2_r_chebu_0(Tbl *, int &) ;
00090 void _d2sdx2_r_chebp(Tbl *, int &) ;
00091 void _d2sdx2_r_chebi(Tbl *, int &) ;
00092 void _d2sdx2_r_chebpim_p(Tbl *, int &) ;
00093 void _d2sdx2_r_chebpim_i(Tbl *, int &) ;
00094 void _d2sdx2_r_chebpi_p(Tbl *, int &) ;
00095 void _d2sdx2_r_chebpi_i(Tbl *, int &) ;
00096 void _d2sdx2_r_jaco02(Tbl *, int &) ;
00097 
00098 // Version membre d'un Valeur
00099 // --------------------------
00100 
00101 const Valeur& Valeur::d2sdx2() const {
00102 
00103     // Protection
00104     assert(etat != ETATNONDEF) ;
00105 
00106     // Peut-etre rien a faire ?
00107     if (p_d2sdx2 != 0x0) {
00108     return *p_d2sdx2 ;
00109     }
00110     
00111     // ... si, il faut bosser
00112 
00113     p_d2sdx2 = new Valeur(mg) ;
00114 
00115     if (etat == ETATZERO) {
00116     p_d2sdx2->set_etat_zero() ; 
00117     }
00118     else {
00119     assert(etat == ETATQCQ) ; 
00120     p_d2sdx2->set_etat_cf_qcq() ;
00121     Mtbl_cf* cfp = p_d2sdx2->c_cf ; // Pointeur sur le Mtbl_cf qui vient d'etre
00122                     // cree par le set_etat_cf_qcq()
00123 
00124     // Initialisation de *cfp : recopie des coef. de la fonction
00125     if (c_cf == 0x0) {
00126         coef() ;
00127     }
00128     *cfp = *c_cf ;  
00129  
00130     cfp->d2sdx2() ; // calcul 
00131     
00132     p_d2sdx2->base = cfp->base ; // On remonte la base de sortie au niveau Valeur
00133     }
00134 
00135     // Termine
00136     return *p_d2sdx2 ;
00137 }
00138 
00139 // Version membre d'un Mtbl_cf
00140 // ---------------------------
00141 
00142 void Mtbl_cf::d2sdx2() {
00143 
00144 // Routines de derivation
00145 static void (*_d2sdx2[MAX_BASE])(Tbl *, int &) ;
00146 static int nap = 0 ;
00147 
00148     // Premier appel
00149     if (nap==0) {
00150     nap = 1 ;
00151     for (int i=0 ; i<MAX_BASE ; i++) {
00152         _d2sdx2[i] = _d2sdx2_pas_prevu ;
00153     }
00154     // Les routines existantes
00155     _d2sdx2[R_CHEB >> TRA_R] = _d2sdx2_r_cheb ;
00156     _d2sdx2[R_CHEBU >> TRA_R] = _d2sdx2_r_chebu_0 ;
00157     _d2sdx2[R_CHEBP >> TRA_R] = _d2sdx2_r_chebp ;
00158     _d2sdx2[R_CHEBI >> TRA_R] = _d2sdx2_r_chebi ;
00159     _d2sdx2[R_CHEBPIM_P >> TRA_R] = _d2sdx2_r_chebpim_p ;
00160     _d2sdx2[R_CHEBPIM_I >> TRA_R] = _d2sdx2_r_chebpim_i ;
00161     _d2sdx2[R_CHEBPI_P >> TRA_R] = _d2sdx2_r_chebpi_p ;
00162     _d2sdx2[R_CHEBPI_I >> TRA_R] = _d2sdx2_r_chebpi_i ;
00163     _d2sdx2[R_JACO02 >> TRA_R] = _d2sdx2_r_jaco02 ;
00164     }
00165 
00166     //- Debut de la routine -
00167 
00168     // Protection
00169     assert(etat == ETATQCQ) ;
00170 
00171     // Boucle sur les zones
00172     for (int l=0 ; l<nzone ; l++) {
00173     int base_r = (base.b[l] & MSQ_R) >> TRA_R ;
00174     assert(t[l] != 0x0) ;
00175     _d2sdx2[base_r](t[l], base.b[l]) ;
00176     }
00177 }

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