| 1 |
/* |
| 2 |
* Member functions of the class Map_radial for various theta manipulations |
| 3 |
* of Scalar's. |
| 4 |
*/ |
| 5 |
|
| 6 |
/* |
| 7 |
* Copyright (c) 2003 Eric Gourgoulhon & Jerome Novak |
| 8 |
* |
| 9 |
* This file is part of LORENE. |
| 10 |
* |
| 11 |
* LORENE is free software; you can redistribute it and/or modify |
| 12 |
* it under the terms of the GNU General Public License version 2 |
| 13 |
* as published by the Free Software Foundation. |
| 14 |
* |
| 15 |
* LORENE is distributed in the hope that it will be useful, |
| 16 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 |
* GNU General Public License for more details. |
| 19 |
* |
| 20 |
* You should have received a copy of the GNU General Public License |
| 21 |
* along with LORENE; if not, write to the Free Software |
| 22 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 23 |
* |
| 24 |
*/ |
| 25 |
|
| 26 |
char map_radial_th_manip_C[] = "$Header: /cvsroot/Lorene/C++/Source/Map/map_radial_th_manip.C,v 1.4 2014/10/13 08:53:07 j_novak Exp $" ; |
| 27 |
|
| 28 |
/* |
| 29 |
* $Id: map_radial_th_manip.C,v 1.4 2014/10/13 08:53:07 j_novak Exp $ |
| 30 |
* $Log: map_radial_th_manip.C,v $ |
| 31 |
* Revision 1.4 2014/10/13 08:53:07 j_novak |
| 32 |
* Lorene classes and functions now belong to the namespace Lorene. |
| 33 |
* |
| 34 |
* Revision 1.3 2006/05/26 09:00:11 j_novak |
| 35 |
* New members for multiplication or division by cos(theta). |
| 36 |
* |
| 37 |
* Revision 1.2 2003/11/05 15:27:52 e_gourgoulhon |
| 38 |
* Treatment of case ETATUN now possible by a simple call |
| 39 |
* to set_etat_qcq(), thanks to a modification of the latter. |
| 40 |
* |
| 41 |
* Revision 1.1 2003/11/04 22:59:13 e_gourgoulhon |
| 42 |
* First version. |
| 43 |
* |
| 44 |
* |
| 45 |
* $Header: /cvsroot/Lorene/C++/Source/Map/map_radial_th_manip.C,v 1.4 2014/10/13 08:53:07 j_novak Exp $ |
| 46 |
* |
| 47 |
*/ |
| 48 |
|
| 49 |
// Lorene headers |
| 50 |
#include "map.h" |
| 51 |
#include "tensor.h" |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
//---------------------------// |
| 57 |
// mult_cost // |
| 58 |
//---------------------------// |
| 59 |
|
| 60 |
namespace Lorene { |
| 61 |
void Map_radial::mult_cost(Scalar& ci) const { |
| 62 |
|
| 63 |
assert(ci.get_etat() != ETATNONDEF) ; |
| 64 |
|
| 65 |
if (ci.get_etat() == ETATZERO) { |
| 66 |
return ; // Nothing to do if the Scalar is null |
| 67 |
} |
| 68 |
|
| 69 |
assert((ci.get_etat() == ETATQCQ) || (ci.get_etat() == ETATUN)) ; |
| 70 |
|
| 71 |
Valeur& val = ci.set_spectral_va() ; |
| 72 |
|
| 73 |
assert(val.get_mg() == mg) ; |
| 74 |
|
| 75 |
val = val.mult_ct() ; // Multiplication by cos(theta) |
| 76 |
|
| 77 |
ci.set_etat_qcq() ; |
| 78 |
|
| 79 |
} |
| 80 |
|
| 81 |
//---------------------------// |
| 82 |
// div_cost // |
| 83 |
//---------------------------// |
| 84 |
|
| 85 |
void Map_radial::div_cost(Scalar& ci) const { |
| 86 |
|
| 87 |
assert(ci.get_etat() != ETATNONDEF) ; |
| 88 |
|
| 89 |
if (ci.get_etat() == ETATZERO) { |
| 90 |
return ; // Nothing to do if the Scalar is null |
| 91 |
} |
| 92 |
|
| 93 |
assert((ci.get_etat() == ETATQCQ) || (ci.get_etat() == ETATUN)) ; |
| 94 |
|
| 95 |
Valeur& val = ci.set_spectral_va() ; |
| 96 |
|
| 97 |
assert(val.get_mg() == mg) ; |
| 98 |
|
| 99 |
val = val.scost() ; // Division by cos(theta) |
| 100 |
|
| 101 |
ci.set_etat_qcq() ; |
| 102 |
} |
| 103 |
|
| 104 |
|
| 105 |
//---------------------------// |
| 106 |
// mult_sint // |
| 107 |
//---------------------------// |
| 108 |
|
| 109 |
void Map_radial::mult_sint(Scalar& ci) const { |
| 110 |
|
| 111 |
assert(ci.get_etat() != ETATNONDEF) ; |
| 112 |
|
| 113 |
if (ci.get_etat() == ETATZERO) { |
| 114 |
return ; // Nothing to do if the Scalar is null |
| 115 |
} |
| 116 |
|
| 117 |
assert((ci.get_etat() == ETATQCQ) || (ci.get_etat() == ETATUN)) ; |
| 118 |
|
| 119 |
Valeur& val = ci.set_spectral_va() ; |
| 120 |
|
| 121 |
assert(val.get_mg() == mg) ; |
| 122 |
|
| 123 |
val = val.mult_st() ; // Multiplication by sin(theta) |
| 124 |
|
| 125 |
ci.set_etat_qcq() ; |
| 126 |
|
| 127 |
} |
| 128 |
|
| 129 |
//---------------------------// |
| 130 |
// div_sint // |
| 131 |
//---------------------------// |
| 132 |
|
| 133 |
void Map_radial::div_sint(Scalar& ci) const { |
| 134 |
|
| 135 |
assert(ci.get_etat() != ETATNONDEF) ; |
| 136 |
|
| 137 |
if (ci.get_etat() == ETATZERO) { |
| 138 |
return ; // Nothing to do if the Scalar is null |
| 139 |
} |
| 140 |
|
| 141 |
assert((ci.get_etat() == ETATQCQ) || (ci.get_etat() == ETATUN)) ; |
| 142 |
|
| 143 |
Valeur& val = ci.set_spectral_va() ; |
| 144 |
|
| 145 |
assert(val.get_mg() == mg) ; |
| 146 |
|
| 147 |
val = val.ssint() ; // Division by sin(theta) |
| 148 |
|
| 149 |
ci.set_etat_qcq() ; |
| 150 |
} |
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
//---------------------------// |
| 155 |
// div_tant // |
| 156 |
//---------------------------// |
| 157 |
|
| 158 |
void Map_radial::div_tant(Scalar& ci) const { |
| 159 |
|
| 160 |
assert(ci.get_etat() != ETATNONDEF) ; |
| 161 |
|
| 162 |
if (ci.get_etat() == ETATZERO) { |
| 163 |
return ; // Nothing to do if the Scalar is null |
| 164 |
} |
| 165 |
|
| 166 |
assert((ci.get_etat() == ETATQCQ) || (ci.get_etat() == ETATUN)) ; |
| 167 |
|
| 168 |
Valeur& val = ci.set_spectral_va() ; |
| 169 |
|
| 170 |
assert(val.get_mg() == mg) ; |
| 171 |
|
| 172 |
val = val.mult_ct() ; // Multiplication by cos(theta) |
| 173 |
|
| 174 |
val = val.ssint() ; // Division by sin(theta) |
| 175 |
|
| 176 |
ci.set_etat_qcq() ; |
| 177 |
} |
| 178 |
|
| 179 |
} |