valeur_ssint.C

00001 /*
00002  * Computation of 1/(sin theta)
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_ssint_C[] = "$Header: /cvsroot/Lorene/C++/Source/Valeur/valeur_ssint.C,v 1.4 2009/10/10 18:28:11 j_novak Exp $" ;
00033 
00034 /*
00035  * $Id: valeur_ssint.C,v 1.4 2009/10/10 18:28:11 j_novak Exp $
00036  * $Log: valeur_ssint.C,v $
00037  * Revision 1.4  2009/10/10 18:28:11  j_novak
00038  * New bases T_COS and T_SIN.
00039  *
00040  * Revision 1.3  2004/12/17 13:35:05  m_forot
00041  * Add the case T_LEG
00042  *
00043  * Revision 1.2  2004/11/23 15:17:19  m_forot
00044  * Added the bases for the cases without any equatorial symmetry
00045  *  (T_COSSIN_C, T_COSSIN_S, T_LEG, R_CHEBPI_P, R_CHEBPI_I).
00046  *
00047  * Revision 1.1.1.1  2001/11/20 15:19:27  e_gourgoulhon
00048  * LORENE
00049  *
00050  * Revision 2.6  1999/11/30  12:45:37  eric
00051  * Valeur::base est desormais du type Base_val et non plus Base_val*.
00052  *
00053  * Revision 2.5  1999/11/23  16:18:33  eric
00054  * Reorganisation du calcul dans le cas ETATZERO.
00055  *
00056  * Revision 2.4  1999/11/19  09:31:40  eric
00057  * La valeur de retour est desormais const Valeur &.
00058  *
00059  * Revision 2.3  1999/11/16  13:32:38  novak
00060  * Ajout de la base T_COSSIN_SP
00061  *
00062  * Revision 2.2  1999/10/28  08:00:32  eric
00063  * Modif commentaires.
00064  *
00065  * Revision 2.1  1999/10/18  13:42:45  eric
00066  * Suppression de l'argument base dans les routines de derivation des mtbl_cf.
00067  *
00068  * Revision 2.0  1999/09/07  16:09:12  phil
00069  * *** empty log message ***
00070  *
00071  * Revision 1.1  1999/09/07  16:08:38  phil
00072  * Initial revision
00073  *
00074  *
00075  * $Header: /cvsroot/Lorene/C++/Source/Valeur/valeur_ssint.C,v 1.4 2009/10/10 18:28:11 j_novak Exp $
00076  *
00077  */
00078 
00079 
00080 // Headers C
00081 #include <assert.h>
00082 
00083 // Headers Lorene
00084 #include "mtbl_cf.h"
00085 #include "valeur.h"
00086 
00087 // Local prototypes
00088 void _ssint_pas_prevu (Tbl*, int&) ;
00089 void _ssint_t_cos (Tbl*, int&) ;
00090 void _ssint_t_sin (Tbl*, int&) ;
00091 void _ssint_t_sin_p (Tbl*, int&) ;
00092 void _ssint_t_sin_i (Tbl*, int&) ;
00093 void _ssint_t_cos_i (Tbl*, int&) ;
00094 void _ssint_t_cos_p (Tbl*, int&) ;
00095 void _ssint_t_cossin_si (Tbl*, int&) ;
00096 void _ssint_t_cossin_ci (Tbl*, int&) ;
00097 void _ssint_t_cossin_cp (Tbl*, int&) ;
00098 void _ssint_t_cossin_sp (Tbl*, int&) ;
00099 void _ssint_t_cossin_c (Tbl*, int&) ;
00100 void _ssint_t_cossin_s (Tbl*, int&) ;
00101 
00102 // Version membre d'un Valeur
00103 // --------------------------
00104 
00105 const Valeur& Valeur::ssint() const {
00106 
00107     // Protection
00108     assert(etat != ETATNONDEF) ;
00109 
00110     // Peut-etre rien a faire ?
00111     if (p_ssint != 0x0) {
00112     return *p_ssint ;
00113     }
00114     
00115     // ... si, il faut bosser
00116 
00117     p_ssint = new Valeur(mg) ;
00118 
00119     if (etat == ETATZERO) {
00120     p_ssint->set_etat_zero() ; 
00121     }
00122     else {
00123     assert(etat == ETATQCQ) ; 
00124     p_ssint->set_etat_cf_qcq() ;
00125     Mtbl_cf* cfp = p_ssint->c_cf ; // Pointeur sur le Mtbl_cf qui vient d'etre
00126                     // cree par le set_etat_cf_qcq()
00127 
00128     // Initialisation de *cfp : recopie des coef. de la fonction
00129     if (c_cf == 0x0) {
00130         coef() ;
00131     }
00132     *cfp = *c_cf ;  
00133     cfp->ssint() ;  // calcul 
00134     
00135     p_ssint->base = cfp->base ; // On remonte la base de sortie au niveau Valeur
00136     }
00137 
00138     // Termine
00139     return *p_ssint ;
00140 }
00141 
00142 
00143 
00144 // Version membre d'un Mtbl_cf
00145 // ---------------------------
00146 
00147 void Mtbl_cf::ssint() {
00148 
00149 // Routines de derivation
00150 static void (*_ssint[MAX_BASE])(Tbl *, int &) ;
00151 static int nap = 0 ;
00152 
00153     // Premier appel
00154     if (nap==0) {
00155     nap = 1 ;
00156     for (int i=0 ; i<MAX_BASE ; i++) {
00157         _ssint[i] = _ssint_pas_prevu ;
00158     }
00159     // Les routines existantes
00160     _ssint[T_COS >> TRA_T] = _ssint_t_cos ;
00161     _ssint[T_SIN >> TRA_T] = _ssint_t_sin ;
00162     _ssint[T_COS_P >> TRA_T] = _ssint_t_cos_p ;
00163     _ssint[T_COS_I >> TRA_T] = _ssint_t_cos_i ;
00164     _ssint[T_SIN_P >> TRA_T] = _ssint_t_sin_p ;
00165     _ssint[T_SIN_I >> TRA_T] = _ssint_t_sin_i ;
00166     _ssint[T_COSSIN_SI >> TRA_T] = _ssint_t_cossin_si ;
00167     _ssint[T_COSSIN_CI >> TRA_T] = _ssint_t_cossin_ci ;
00168     _ssint[T_COSSIN_CP >> TRA_T] = _ssint_t_cossin_cp ;
00169     _ssint[T_COSSIN_SP >> TRA_T] = _ssint_t_cossin_sp ;
00170     _ssint[T_COSSIN_C >> TRA_T] = _ssint_t_cossin_c  ;
00171     _ssint[T_COSSIN_S  >> TRA_T] = _ssint_t_cossin_s  ;
00172     }
00173 
00174     //- Debut de la routine -
00175 
00176     // Protection
00177     assert(etat == ETATQCQ) ;
00178     
00179     // Boucle sur les zones
00180     for (int l=0 ; l<nzone ; l++) {
00181     int base_t = (base.b[l] & MSQ_T) >> TRA_T ;
00182     assert(t[l] != 0x0) ;
00183     _ssint[base_t](t[l], base.b[l]) ;
00184     }
00185 }

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