LORENE
map_radial_th_manip.C
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 
27 
28 /*
29  * $Id: map_radial_th_manip.C,v 1.5 2016/12/05 16:17:58 j_novak Exp $
30  * $Log: map_radial_th_manip.C,v $
31  * Revision 1.5 2016/12/05 16:17:58 j_novak
32  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
33  *
34  * Revision 1.4 2014/10/13 08:53:07 j_novak
35  * Lorene classes and functions now belong to the namespace Lorene.
36  *
37  * Revision 1.3 2006/05/26 09:00:11 j_novak
38  * New members for multiplication or division by cos(theta).
39  *
40  * Revision 1.2 2003/11/05 15:27:52 e_gourgoulhon
41  * Treatment of case ETATUN now possible by a simple call
42  * to set_etat_qcq(), thanks to a modification of the latter.
43  *
44  * Revision 1.1 2003/11/04 22:59:13 e_gourgoulhon
45  * First version.
46  *
47  *
48  * $Header: /cvsroot/Lorene/C++/Source/Map/map_radial_th_manip.C,v 1.5 2016/12/05 16:17:58 j_novak Exp $
49  *
50  */
51 
52 // Lorene headers
53 #include "map.h"
54 #include "tensor.h"
55 
56 
57 
58 
59  //---------------------------//
60  // mult_cost //
61  //---------------------------//
62 
63 namespace Lorene {
64 void Map_radial::mult_cost(Scalar& ci) const {
65 
66  assert(ci.get_etat() != ETATNONDEF) ;
67 
68  if (ci.get_etat() == ETATZERO) {
69  return ; // Nothing to do if the Scalar is null
70  }
71 
72  assert((ci.get_etat() == ETATQCQ) || (ci.get_etat() == ETATUN)) ;
73 
74  Valeur& val = ci.set_spectral_va() ;
75 
76  assert(val.get_mg() == mg) ;
77 
78  val = val.mult_ct() ; // Multiplication by cos(theta)
79 
80  ci.set_etat_qcq() ;
81 
82 }
83 
84  //---------------------------//
85  // div_cost //
86  //---------------------------//
87 
88 void Map_radial::div_cost(Scalar& ci) const {
89 
90  assert(ci.get_etat() != ETATNONDEF) ;
91 
92  if (ci.get_etat() == ETATZERO) {
93  return ; // Nothing to do if the Scalar is null
94  }
95 
96  assert((ci.get_etat() == ETATQCQ) || (ci.get_etat() == ETATUN)) ;
97 
98  Valeur& val = ci.set_spectral_va() ;
99 
100  assert(val.get_mg() == mg) ;
101 
102  val = val.scost() ; // Division by cos(theta)
103 
104  ci.set_etat_qcq() ;
105 }
106 
107 
108  //---------------------------//
109  // mult_sint //
110  //---------------------------//
111 
112 void Map_radial::mult_sint(Scalar& ci) const {
113 
114  assert(ci.get_etat() != ETATNONDEF) ;
115 
116  if (ci.get_etat() == ETATZERO) {
117  return ; // Nothing to do if the Scalar is null
118  }
119 
120  assert((ci.get_etat() == ETATQCQ) || (ci.get_etat() == ETATUN)) ;
121 
122  Valeur& val = ci.set_spectral_va() ;
123 
124  assert(val.get_mg() == mg) ;
125 
126  val = val.mult_st() ; // Multiplication by sin(theta)
127 
128  ci.set_etat_qcq() ;
129 
130 }
131 
132  //---------------------------//
133  // div_sint //
134  //---------------------------//
135 
136 void Map_radial::div_sint(Scalar& ci) const {
137 
138  assert(ci.get_etat() != ETATNONDEF) ;
139 
140  if (ci.get_etat() == ETATZERO) {
141  return ; // Nothing to do if the Scalar is null
142  }
143 
144  assert((ci.get_etat() == ETATQCQ) || (ci.get_etat() == ETATUN)) ;
145 
146  Valeur& val = ci.set_spectral_va() ;
147 
148  assert(val.get_mg() == mg) ;
149 
150  val = val.ssint() ; // Division by sin(theta)
151 
152  ci.set_etat_qcq() ;
153 }
154 
155 
156 
157  //---------------------------//
158  // div_tant //
159  //---------------------------//
160 
161 void Map_radial::div_tant(Scalar& ci) const {
162 
163  assert(ci.get_etat() != ETATNONDEF) ;
164 
165  if (ci.get_etat() == ETATZERO) {
166  return ; // Nothing to do if the Scalar is null
167  }
168 
169  assert((ci.get_etat() == ETATQCQ) || (ci.get_etat() == ETATUN)) ;
170 
171  Valeur& val = ci.set_spectral_va() ;
172 
173  assert(val.get_mg() == mg) ;
174 
175  val = val.mult_ct() ; // Multiplication by cos(theta)
176 
177  val = val.ssint() ; // Division by sin(theta)
178 
179  ci.set_etat_qcq() ;
180 }
181 
182 }
virtual void mult_cost(Scalar &) const
Multiplication by of a Scalar.
virtual void div_tant(Scalar &) const
Division by of a Scalar.
Lorene prototypes.
Definition: app_hor.h:67
Tensor field of valence 0 (or component of a tensorial field).
Definition: scalar.h:393
Values and coefficients of a (real-value) function.
Definition: valeur.h:297
int get_etat() const
Returns the logical state ETATNONDEF (undefined), ETATZERO (null) or ETATQCQ (ordinary).
Definition: scalar.h:560
virtual void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Definition: scalar.C:359
const Mg3d * get_mg() const
Returns the Mg3d on which the this is defined.
Definition: valeur.h:763
const Valeur & scost() const
Returns of *this.
Definition: valeur_scost.C:102
const Valeur & ssint() const
Returns of *this.
Definition: valeur_ssint.C:115
virtual void div_cost(Scalar &) const
Division by of a Scalar.
virtual void mult_sint(Scalar &) const
Multiplication by of a Scalar.
const Valeur & mult_st() const
Returns applied to *this.
const Mg3d * mg
Pointer on the multi-grid Mgd3 on which this is defined.
Definition: map.h:688
const Valeur & mult_ct() const
Returns applied to *this.
virtual void div_sint(Scalar &) const
Division by of a Scalar.
Valeur & set_spectral_va()
Returns va (read/write version)
Definition: scalar.h:610