map_radial_th_manip.C

00001 /*
00002  *  Member functions of the class Map_radial for various theta manipulations
00003  *  of Scalar's.
00004  */
00005 
00006 /*
00007  *   Copyright (c) 2003 Eric Gourgoulhon & Jerome Novak
00008  *
00009  *   This file is part of LORENE.
00010  *
00011  *   LORENE is free software; you can redistribute it and/or modify
00012  *   it under the terms of the GNU General Public License version 2
00013  *   as published by the Free Software Foundation.
00014  *
00015  *   LORENE is distributed in the hope that it will be useful,
00016  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *   GNU General Public License for more details.
00019  *
00020  *   You should have received a copy of the GNU General Public License
00021  *   along with LORENE; if not, write to the Free Software
00022  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023  *
00024  */
00025 
00026 char map_radial_th_manip_C[] = "$Header: /cvsroot/Lorene/C++/Source/Map/map_radial_th_manip.C,v 1.3 2006/05/26 09:00:11 j_novak Exp $" ;
00027 
00028 /*
00029  * $Id: map_radial_th_manip.C,v 1.3 2006/05/26 09:00:11 j_novak Exp $
00030  * $Log: map_radial_th_manip.C,v $
00031  * Revision 1.3  2006/05/26 09:00:11  j_novak
00032  * New members for multiplication or division by cos(theta).
00033  *
00034  * Revision 1.2  2003/11/05 15:27:52  e_gourgoulhon
00035  * Treatment of case ETATUN now possible by a simple call
00036  *  to set_etat_qcq(), thanks to a modification of the latter.
00037  *
00038  * Revision 1.1  2003/11/04 22:59:13  e_gourgoulhon
00039  * First version.
00040  *
00041  *
00042  * $Header: /cvsroot/Lorene/C++/Source/Map/map_radial_th_manip.C,v 1.3 2006/05/26 09:00:11 j_novak Exp $
00043  *
00044  */
00045 
00046 // Lorene headers
00047 #include "map.h"
00048 #include "tensor.h"
00049 
00050 
00051 
00052 
00053             //---------------------------//
00054             //          mult_cost        //
00055             //---------------------------//
00056 
00057 void Map_radial::mult_cost(Scalar& ci) const {
00058     
00059     assert(ci.get_etat() != ETATNONDEF) ;
00060     
00061     if (ci.get_etat() == ETATZERO) {
00062         return ;             // Nothing to do if the Scalar is null 
00063     }
00064 
00065     assert((ci.get_etat() == ETATQCQ) || (ci.get_etat() == ETATUN)) ;
00066     
00067     Valeur& val = ci.set_spectral_va() ; 
00068 
00069     assert(val.get_mg() == mg) ; 
00070      
00071     val = val.mult_ct() ;   // Multiplication by cos(theta) 
00072 
00073     ci.set_etat_qcq() ; 
00074     
00075 }
00076 
00077             //---------------------------//
00078             //          div_cost         //
00079             //---------------------------//
00080 
00081 void Map_radial::div_cost(Scalar& ci) const {
00082     
00083     assert(ci.get_etat() != ETATNONDEF) ;
00084     
00085     if (ci.get_etat() == ETATZERO) {
00086         return ;             // Nothing to do if the Scalar is null 
00087     }
00088 
00089     assert((ci.get_etat() == ETATQCQ) || (ci.get_etat() == ETATUN)) ;
00090             
00091     Valeur& val = ci.set_spectral_va() ; 
00092 
00093     assert(val.get_mg() == mg) ; 
00094          
00095     val = val.scost() ;     // Division by cos(theta)
00096 
00097     ci.set_etat_qcq() ; 
00098 }
00099 
00100             
00101             //---------------------------//
00102             //          mult_sint        //
00103             //---------------------------//
00104 
00105 void Map_radial::mult_sint(Scalar& ci) const {
00106     
00107     assert(ci.get_etat() != ETATNONDEF) ;
00108     
00109     if (ci.get_etat() == ETATZERO) {
00110         return ;             // Nothing to do if the Scalar is null 
00111     }
00112 
00113     assert((ci.get_etat() == ETATQCQ) || (ci.get_etat() == ETATUN)) ;
00114     
00115     Valeur& val = ci.set_spectral_va() ; 
00116 
00117     assert(val.get_mg() == mg) ; 
00118      
00119     val = val.mult_st() ;   // Multiplication by sin(theta) 
00120 
00121     ci.set_etat_qcq() ;             
00122 
00123 }
00124 
00125             //---------------------------//
00126             //          div_sint         //
00127             //---------------------------//
00128 
00129 void Map_radial::div_sint(Scalar& ci) const {
00130     
00131     assert(ci.get_etat() != ETATNONDEF) ;
00132     
00133     if (ci.get_etat() == ETATZERO) {
00134         return ;             // Nothing to do if the Scalar is null 
00135     }
00136 
00137     assert((ci.get_etat() == ETATQCQ) || (ci.get_etat() == ETATUN)) ;
00138             
00139     Valeur& val = ci.set_spectral_va() ; 
00140 
00141     assert(val.get_mg() == mg) ; 
00142          
00143     val = val.ssint() ;     // Division by sin(theta)
00144 
00145     ci.set_etat_qcq() ; 
00146 }
00147 
00148 
00149 
00150             //---------------------------//
00151             //          div_tant         //
00152             //---------------------------//
00153 
00154 void Map_radial::div_tant(Scalar& ci) const {
00155     
00156     assert(ci.get_etat() != ETATNONDEF) ;
00157     
00158     if (ci.get_etat() == ETATZERO) {
00159         return ;             // Nothing to do if the Scalar is null 
00160     }
00161 
00162     assert((ci.get_etat() == ETATQCQ) || (ci.get_etat() == ETATUN)) ;
00163             
00164     Valeur& val = ci.set_spectral_va() ; 
00165 
00166     assert(val.get_mg() == mg) ; 
00167      
00168     val = val.mult_ct() ;   // Multiplication by cos(theta) 
00169     
00170     val = val.ssint() ;     // Division by sin(theta)
00171 
00172     ci.set_etat_qcq() ; 
00173 }
00174 

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