Debian Codegraph @

C++/Include/boson_star.h

raw symbols SCIP
1 /*
2 * Definition of Lorene class Boson_star
3 *
4 */
5
6 /*
7 * Copyright (c) 2012 Claire Some, Eric Gourgoulhon
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 #ifndef __BOSON_STAR_H_
27 #define __BOSON_STAR_H_
28
29 /*
30 * $Id: boson_star.h,v 1.4 2014/10/13 08:52:32 j_novak Exp $
31 * $Log: boson_star.h,v $
32 * Revision 1.4 2014/10/13 08:52:32 j_novak
33 * Lorene classes and functions now belong to the namespace Lorene.
34 *
35 * Revision 1.3 2012/12/03 15:26:14 c_some
36 * Added data member m2
37 *
38 * Revision 1.2 2012/11/23 15:42:14 c_some
39 * Small changes
40 *
41 * Revision 1.1 2012/11/22 16:03:16 c_some
42 * New class Boson_star
43 *
44 *
45 * $Header: /cvsroot/Lorene/C++/Include/boson_star.h,v 1.4 2014/10/13 08:52:32 j_novak Exp $
46 *
47 */
48
49
50 // Headers Lorene
51 #include "compobj.h"
52
53
54 //--------------------------//
55 // class Boson_star //
56 //--------------------------//
57
58 namespace Lorene {
59 /**
60 * Class for stationary axisymmetric boson stars (***under development***).
61 * \ingroup(compactobjects)
62 *
63 */
64 class Boson_star : public Star_QI {
65
66 // Data :
67 // -----
68 protected:
69
70 /** Real part of the scalar field Phi
71 */
72 Scalar rphi ;
73
74 /** Imaginary part of the scalar field Phi
75 */
76 Scalar iphi ;
77
78 /** Coefficient omega in the time dependence of Phi
79 */
80 double omega ;
81
82 /** Coefficient kkk in the azimuthal dependence of Phi
83 */
84 int kkk ;
85
86 /** Boson mass
87 */
88 double mmm ;
89
90 /** Boson mass squared
91 */
92 double m2 ;
93
94
95 // Derived data :
96 // ------------
97 protected:
98
99 // Constructors - Destructor
100 // -------------------------
101 public:
102 /** Standard constructor.
103 *
104 * @param mp_i Mapping on which the star is contructed
105 * @param m Boson mass //## which unit ?
106 * @param k Coefficient \e k in the azimuthal dependence of Phi
107 *
108 */
109 Boson_star(Map& mp_i, double m, int k) ;
110
111
112 Boson_star(const Boson_star& ) ; ///< Copy constructor
113
114 /** Constructor from a file (see \c sauve(FILE*) ).
115 *
116 * @param mp_i Mapping on which the star is constructed
117 * @param fich input file (must have been created by the function
118 * \c Boson_star::sauve )
119 */
120 Boson_star(Map& mp_i, FILE* fich) ;
121
122 virtual ~Boson_star() ; ///< Destructor
123
124
125 // Memory management
126 // -----------------
127 protected:
128 /// Deletes all the derived quantities
129 virtual void del_deriv() const ;
130
131 /// Sets to \c 0x0 all the pointers on derived quantities
132 virtual void set_der_0x0() const ;
133
134 // Mutators / assignment
135 // ---------------------
136 public:
137 /// Assignment to another \c Boson_star
138 void operator=(const Boson_star& ) ;
139
140 // Accessors
141 // ---------
142 public:
143
144 /** Returns the real part of the scalar field
145 */
146 const Scalar& get_rphi() const {return rphi;} ;
147
148 /** Returns the imaginary part of the scalar field
149 */
150 const Scalar& get_iphi() const {return iphi;} ;
151
152 /** Sets a value to the real part of the scalar field
153 */
154 Scalar& set_rphi() {del_deriv(); return rphi;} ;
155
156 /** Sets a value to the imaginary part of the scalar field
157 */
158 Scalar& set_iphi() {del_deriv(); return iphi;} ;
159
160
161 // Outputs
162 // -------
163 public:
164 virtual void sauve(FILE* ) const ; ///< Save in a file
165
166 protected:
167 /// Operator >> (virtual function called by the operator <<).
168 virtual ostream& operator>>(ostream& ) const ;
169
170 // Global quantities
171 // -----------------
172 public:
173
174
175 // Computational routines
176 // ----------------------
177 public:
178
179 /** Computes the 3+1 components of the energy-momentum tensor (E, P_i and S_{ij})
180 * from the values of the scalar field and the metric
181 */
182 void update_ener_mom() ;
183
184 /** Solves the equation satisfied by the scalar field
185 */
186 // void solve_phi() ;
187
188 /** Computes an equilibrium configuration.
189 *
190 * @param rphi_c [input] Central value of the real part of the scalar field
191 * @param iphi_c [input] Central value of the imaginary part of the scalar field
192 * @param nzadapt [input] Number of (inner) domains where the mapping
193 * adaptation to an iso-enthalpy surface
194 * should be performed
195 * @param ent_limit [input] 1-D \c Tbl of dimension \c nzet which
196 * defines the enthalpy at the outer boundary
197 * of each domain
198 * @param icontrol [input] Set of integer parameters (stored as a
199 * 1-D \c Itbl of size 8) to control the
200 * iteration:
201 * \li \c icontrol(0) = mer_max : maximum number of steps
202 * \li \c icontrol(1) = mer_rot : step at which the rotation is
203 * switched on
204 * \li \c icontrol(2) = mer_change_omega : step at which the rotation
205 * velocity is changed to reach the final one
206 * \li \c icontrol(3) = mer_fix_omega : step at which the final
207 * rotation velocity must have been reached
208 * \li \c icontrol(4) = mer_mass : the absolute value of
209 * \c mer_mass is the step from which the
210 * baryon mass is forced to converge,
211 * by varying the central enthalpy
212 * (\c mer_mass>0 ) or the angular
213 * velocity (\c mer_mass<0 )
214 * \li \c icontrol(5) = mermax_poisson : maximum number of steps in
215 * \c Map_et::poisson
216 * \li \c icontrol(6) = mer_triax : step at which the 3-D
217 * perturbation is switched on
218 * \li \c icontrol(7) = delta_mer_kep : number of steps
219 * after \c mer_fix_omega when \c omega
220 * starts to be increased by \c fact_omega
221 * to search for the Keplerian velocity
222 *
223 * @param control [input] Set of parameters (stored as a
224 * 1-D \c Tbl of size 7) to control the
225 * iteration:
226 * \li \c control(0) = precis : threshold on the enthalpy relative
227 * change for ending the computation
228 * \li \c control(1) = omega_ini : initial angular velocity,
229 * switched on only if \c mer_rot<0 ,
230 * otherwise 0 is used
231 * \li \c control(2) = relax : relaxation factor in the main
232 * iteration
233 * \li \c control(3) = relax_poisson : relaxation factor in
234 * \c Map_et::poisson
235 * \li \c control(4) = thres_adapt : threshold on dH/dr for
236 * freezing the adaptation of the mapping
237 * \li \c control(5) = ampli_triax : relative amplitude of
238 * the 3-D perturbation
239 * \li \c control(6) = precis_adapt : precision for
240 * \c Map_et::adapt
241 *
242 * @param diff [output] 1-D \c Tbl of size 7 for the storage of
243 * some error indicators :
244 * \li \c diff(0) : Relative change in the enthalpy field
245 * between two successive steps
246 * \li \c diff(1) : Relative error in the resolution of the
247 * Poisson equation for \c nuf
248 * \li \c diff(2) : Relative error in the resolution of the
249 * Poisson equation for \c nuq
250 * \li \c diff(3) : Relative error in the resolution of the
251 * Poisson equation for \c dzeta
252 * \li \c diff(4) : Relative error in the resolution of the
253 * Poisson equation for \c tggg
254 * \li \c diff(5) : Relative error in the resolution of the
255 * equation for \c shift (x comp.)
256 * \li \c diff(6) : Relative error in the resolution of the
257 * equation for \c shift (y comp.)
258 */
259 virtual void equilibrium(double rphi_c, double iphi_c,
260 int nzadapt, const Tbl& ent_limit,
261 const Itbl& icontrol, const Tbl& control,
262 Tbl& diff, Param* = 0x0) ;
263
264 };
265
266
267 }
268 #endif