LORENE
star_rot_cfc.h
1 /*
2  * Definition of Lorene class Star_rot_CFC
3  *
4  */
5 
6 /*
7  * Copyright (c) 2024 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 #ifndef __STAR_ROT_CFC_H_
27 #define __STAR_ROT_CFC_H_
28 
29 // Headers Lorene
30 #include "star.h"
31 
32 
33 namespace Lorene {
39  class Star_rot_CFC : public Star {
40 
41  // Data :
42  // -----
43  protected:
50  int relat_type ;
51 
59 
60  double omega ;
61 
62  // Quantities related to the conformal factor
63  //--------------------------------------------
64 
66 
67 
68  // Fluid quantities
69  //-----------------------------------------
70 
77 
78  // Metric stuff
79  //-------------------------------------
80 
83 
85  const Metric_flat& flat ;
86 
89 
90  // Derived data :
91  // ------------
92  protected:
93 
94  // More to come later.....
95  //----------------------------
96 
97  mutable double* p_angu_mom ;
98  mutable double* p_grv2 ;
99  mutable double* p_grv3 ;
100  mutable double* p_tsw ;
101  mutable double* p_r_circ ;
102  mutable double* p_rp_circ ;
103 
104 
105  // Constructors - Destructor
106  // -------------------------
107  public:
108 
119  Star_rot_CFC(Map& mp_i, int nzet_i, const Eos& eos_i, int relat_i=3,
120  int filter=0) ;
121 
122  Star_rot_CFC(const Star_rot_CFC& ) ;
123 
124 
132  Star_rot_CFC(Map& mp_i, const Eos& eos_i, FILE* fich) ;
133 
134 
135  virtual ~Star_rot_CFC() ;
136 
137 
138  // Memory management
139  // -----------------
140  protected:
141 
143  virtual void del_deriv() const ;
144 
146  void set_der_0x0() const ;
147 
151  virtual void del_hydro_euler() ;
152 
153 
154  // Mutators / assignment
155  // ---------------------
156  public:
157 
159  void operator=(const Star_rot_CFC& ) ;
160 
161  // Accessors
162  // ---------
163  public:
164 
166  int get_relat() const {return relat_type;};
167 
169  bool is_relativistic() const {return (relat_type > 0) ;};
170 
172  int spectral_filter_order() const {return spectral_filter;};
173 
177  double get_omega() const {return omega;} ;
178 
179 
183  const Scalar& get_psi4() const {return psi4;} ;
184 
188  const Scalar& get_psi2() const {return psi2;} ;
189 
193  const Scalar& get_psi() const {return psi;} ;
194 
195  // Fluid stuff
196  //------------------
197 
202  const Vector& get_j_euler() const {return j_euler;} ;
203 
207  const Scalar& get_v2() const {return v2;} ;
208 
209 
210  //Metric stuff
211  //-------------------
215  const Sym_tensor get_hatA() const {return hatA;} ;
216 
220  const Scalar get_hatA_quad() const {return hatA_quad;} ;
221 
222 
223  // Outputs
224  // -------
225  public:
226 
227  virtual void sauve(FILE* ) const ;
228 
229  protected:
230 
231  virtual ostream& operator>>(ostream& ) const ;
232 
233 
234  // Global quantities
235  //-------------------------
236  public:
237 
238  virtual double mass_b() const ;
239  virtual double mass_g() const ;
240  virtual double angu_mom() const ;
241  virtual double grv2() const ;
242  virtual double grv3() const ;
243  virtual double tsw() const ;
244  virtual double aplat() const ;
245  virtual double r_circ() const ;
246  virtual double rp_circ() const ;
247 
253  virtual double ellipt() const ;
254 
255 
256 
257 
258  // Computational routines
259  //--------------------------
260  public:
261 
268  virtual void hydro_euler() ;
269 
270 
279  void update_metric() ;
280 
281 
285  void equilibrium(double ent_c, double omega0, double fact_omega,
286  int nzadapt, const Tbl& ent_limit,
287  const Itbl& icontrol, const Tbl& control,
288  double mbar_wanted, double aexp_mass,
289  Tbl& diff) ;
290 
295  void solve_logn_f(Scalar& ln_f_new) const ;
296 
301  void solve_logn_q(Scalar& ln_q_new) const ;
302 
307  void solve_psi(Scalar& psi_new) ;
308 
313  void solve_shift(Vector& shift_new) const ;
314 
315  };
316 
317 }
318 #endif
virtual ostream & operator>>(ostream &) const
Operator >> (virtual function called by the operator <<).
Definition: star_rot_cfc.C:260
double * p_grv2
Error on the virial identity GRV2.
Definition: star_rot_cfc.h:98
virtual double tsw() const
Ratio T/W.
void solve_logn_q(Scalar &ln_q_new) const
Solution of the quadratic part of the Poisson equation for the lapse for rotating stars in CFC...
Scalar psi
Conformal factor .
Definition: star_rot_cfc.h:65
virtual double grv3() const
Error on the virial identity GRV3.
Lorene prototypes.
Definition: app_hor.h:67
Equation of state base class.
Definition: eos.h:209
Flat metric for tensor calculation.
Definition: metric.h:261
Tensor field of valence 0 (or component of a tensorial field).
Definition: scalar.h:393
virtual double angu_mom() const
Angular momentum.
Base class for coordinate mappings.
Definition: map.h:688
virtual void del_deriv() const
Deletes all the derived quantities.
Definition: star_rot_cfc.C:164
virtual double r_circ() const
Circumferential equatorial radius.
int spectral_filter
Spectral exponential filtering order.
Definition: star_rot_cfc.h:58
double * p_rp_circ
Circumferential polar radius.
Definition: star_rot_cfc.h:102
void operator=(const Star_rot_CFC &)
Assignment to another Star_rot_CFC.
Definition: star_rot_cfc.C:212
Basic integer array class.
Definition: itbl.h:122
Scalar psi4
Conformal factor .
Definition: star_rot_cfc.h:81
const Scalar & get_psi2() const
Returns .
Definition: star_rot_cfc.h:188
int spectral_filter_order() const
Returns the filtering order.
Definition: star_rot_cfc.h:172
Base class for stars.
Definition: star.h:175
virtual void sauve(FILE *) const
Save in a file.
Definition: star_rot_cfc.C:243
Star_rot_CFC(Map &mp_i, int nzet_i, const Eos &eos_i, int relat_i=3, int filter=0)
Standard constructor.
Definition: star_rot_cfc.C:44
Tensor field of valence 1.
Definition: vector.h:188
Class for relativistic rotating stars in Conformal Flatness Condition and maximal slicing...
Definition: star_rot_cfc.h:39
virtual void hydro_euler()
Computes the hydrodynamical quantities relative to the Eulerian observer from those in the fluid fram...
const Vector & get_j_euler() const
Returns the momentum density 3-vector with respect to the Eulerian observer.
Definition: star_rot_cfc.h:202
virtual double aplat() const
Flattening r_pole/r_eq.
double omega
Rotation angular velocity ([f_unit] )
Definition: star_rot_cfc.h:60
int relat_type
Relativistic flag.
Definition: star_rot_cfc.h:50
void solve_shift(Vector &shift_new) const
Solution of the shift equation for rotating stars in CFC.
const Scalar get_hatA_quad() const
Returns .
Definition: star_rot_cfc.h:220
virtual double rp_circ() const
Circumferential polar radius.
double * p_angu_mom
Angular momentum.
Definition: star_rot_cfc.h:97
double * p_r_circ
Circumferential equatorial radius.
Definition: star_rot_cfc.h:101
virtual double mass_b() const
Baryonic mass.
bool is_relativistic() const
Checks whether the star is computed using a relativistic theory.
Definition: star_rot_cfc.h:169
int get_relat() const
Returns the relativity parameter.
Definition: star_rot_cfc.h:166
void solve_logn_f(Scalar &ln_f_new) const
Solution of the `‘matter’&#39; part of the Poisson equation for the lapse for rotating stars in CFC...
void solve_psi(Scalar &psi_new)
Solution of the equations for the conformal factor for rotating stars in CFC.
const Scalar & get_psi() const
Returns .
Definition: star_rot_cfc.h:193
void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
Definition: star_rot_cfc.C:180
void equilibrium(double ent_c, double omega0, double fact_omega, int nzadapt, const Tbl &ent_limit, const Itbl &icontrol, const Tbl &control, double mbar_wanted, double aexp_mass, Tbl &diff)
Computes an equilibrium configuration.
double * p_tsw
Ratio T/W.
Definition: star_rot_cfc.h:100
double * p_grv3
Error on the virial identity GRV3.
Definition: star_rot_cfc.h:99
virtual ~Star_rot_CFC()
Destructor.
Definition: star_rot_cfc.C:153
const Scalar & get_psi4() const
Returns the conformal factor .
Definition: star_rot_cfc.h:183
Basic array class.
Definition: tbl.h:164
void update_metric()
Computes metric quantities from known potentials.
virtual double grv2() const
Error on the virial identity GRV2.
const Sym_tensor get_hatA() const
Returns .
Definition: star_rot_cfc.h:215
const Scalar & get_v2() const
Returns .
Definition: star_rot_cfc.h:207
double get_omega() const
Returns the rotation angular velocity .
Definition: star_rot_cfc.h:177
Vector j_euler
Momentum density 3-vector with respect to the Eulerian observer.
Definition: star_rot_cfc.h:75
virtual void del_hydro_euler()
Sets to ETATNONDEF (undefined state) the hydrodynamical quantities relative to the Eulerian observer...
Definition: star_rot_cfc.C:192
Class intended to describe valence-2 symmetric tensors.
Definition: sym_tensor.h:226
virtual double mass_g() const
Gravitational mass.
virtual double ellipt() const
Ellipticity e.
const Metric_flat & flat
flat metric (spherical components)
Definition: star_rot_cfc.h:85