valeur_d2sdp2.C

00001 /*
00002  * Computation of d^2/dphi^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_d2sdp2_C[] = "$Header: /cvsroot/Lorene/C++/Source/Valeur/valeur_d2sdp2.C,v 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon Exp $" ;
00033 
00034 /*
00035  * $Id: valeur_d2sdp2.C,v 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon Exp $
00036  * $Log: valeur_d2sdp2.C,v $
00037  * Revision 1.1.1.1  2001/11/20 15:19:27  e_gourgoulhon
00038  * LORENE
00039  *
00040  * Revision 2.8  1999/11/30  12:43:12  eric
00041  * Valeur::base est desormais du type Base_val et non plus Base_val*.
00042  *
00043  * Revision 2.7  1999/11/23  16:15:57  eric
00044  * Reorganisation du calcul dans le cas ETATZERO.
00045  *
00046  * Revision 2.6  1999/11/19  09:29:56  eric
00047  * La valeur de retour est desormais const Valeur &.
00048  *
00049  * Revision 2.5  1999/10/28  07:58:56  eric
00050  * Modif commentaires.
00051  *
00052  * Revision 2.4  1999/10/18  13:40:38  eric
00053  * Suppression de l'argument base dans les routines de derivation des mtbl_cf.
00054  *
00055  * Revision 2.3  1999/09/07  15:47:03  phil
00056  * correction de la gestion des bases
00057  *
00058  * Revision 2.2  1999/03/01  15:07:51  eric
00059  * *** empty log message ***
00060  *
00061  * Revision 2.1  1999/02/23  11:43:58  hyc
00062  * *** empty log message ***
00063  *
00064  * Revision 2.0  1999/02/23  11:32:52  hyc
00065  * *** empty log message ***
00066  *
00067  * $Header: /cvsroot/Lorene/C++/Source/Valeur/valeur_d2sdp2.C,v 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon Exp $
00068  *
00069  */
00070 
00071 // Headers C
00072 #include <assert.h>
00073 
00074 // Headers Lorene
00075 #include "mtbl_cf.h"
00076 #include "valeur.h"
00077 
00078 // Prototypage temporaire
00079 void _d2sdphi2_pas_prevu(Tbl *, int &) ;
00080 void _d2sdphi2_p_cossin(Tbl *, int &) ;
00081 
00082 // Version membre d'un Valeur
00083 // --------------------------
00084 
00085 const Valeur& Valeur::d2sdp2() const {
00086 
00087     // Protection
00088     assert(etat != ETATNONDEF) ;
00089 
00090     // Peut-etre rien a faire ?
00091     if (p_d2sdp2 != 0x0) {
00092     return *p_d2sdp2 ;
00093     }
00094     
00095     // ... si, il faut bosser
00096 
00097     p_d2sdp2 = new Valeur(mg) ;
00098 
00099     if (etat == ETATZERO) {
00100     p_d2sdp2->set_etat_zero() ; 
00101     }
00102     else {
00103     assert(etat == ETATQCQ) ; 
00104     p_d2sdp2->set_etat_cf_qcq() ;
00105     Mtbl_cf* cfp = p_d2sdp2->c_cf ; // Pointeur sur le Mtbl_cf qui vient d'etre
00106                     // cree par le set_etat_cf_qcq()
00107     // Initialisation de *cfp : recopie des coef. de la fonction
00108 
00109     if (c_cf == 0x0) {
00110         coef() ;
00111     }
00112     *cfp = *c_cf ;  
00113  
00114     cfp->d2sdp2() ; // calcul 
00115     
00116     p_d2sdp2->base = cfp->base ; // On remonte la base de sortie au niveau Valeur
00117     }
00118     
00119     // Termine
00120     return *p_d2sdp2 ;
00121 }
00122 
00123 // Version membre d'un Mtbl_cf
00124 // ---------------------------
00125 void Mtbl_cf::d2sdp2() {
00126 
00127 // Routines de derivation
00128 static void (*_d2sdphi2[MAX_BASE])(Tbl *, int &) ;
00129 static int nap = 0 ;
00130 
00131     // Premier appel
00132     if (nap==0) {
00133     nap = 1 ;
00134     for (int i=0 ; i<MAX_BASE ; i++) {
00135         _d2sdphi2[i] = _d2sdphi2_pas_prevu ;
00136     }
00137     // Les routines existantes
00138         _d2sdphi2[P_COSSIN >> TRA_P] = _d2sdphi2_p_cossin ;
00139     }
00140 
00141     //- Debut de la routine -
00142 
00143     // Protection
00144     assert(etat == ETATQCQ) ;
00145     
00146     // Boucle sur les zones
00147     for (int l=0 ; l<nzone ; l++) {
00148     int base_p = (base.b[l] & MSQ_P) >> TRA_P ;
00149     assert(t[l] != 0x0) ;
00150     _d2sdphi2[base_p](t[l], base.b[l]) ;
00151     }
00152 }

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