| 1 | /* |
| 2 | * Definition of Lorene class Gravastar |
| 3 | * |
| 4 | */ |
| 5 | |
| 6 | /* |
| 7 | * Copyright (c) 2010 Frederic Vincent |
| 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 as published by |
| 13 | * the Free Software Foundation; either version 2 of the License, or |
| 14 | * (at your option) any later version. |
| 15 | * |
| 16 | * LORENE is distributed in the hope that it will be useful, |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 | * GNU General Public License for more details. |
| 20 | * |
| 21 | * You should have received a copy of the GNU General Public License |
| 22 | * along with LORENE; if not, write to the Free Software |
| 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 24 | * |
| 25 | */ |
| 26 | |
| 27 | |
| 28 | #ifndef __GRAVASTAR_H_ |
| 29 | #define __GRAVASTAR_H_ |
| 30 | |
| 31 | |
| 32 | |
| 33 | // Headers Lorene |
| 34 | #include "star_rot.h" |
| 35 | |
| 36 | namespace Lorene { |
| 37 | class Eos ; |
| 38 | |
| 39 | //--------------------------// |
| 40 | // class Gravastar // |
| 41 | //--------------------------// |
| 42 | |
| 43 | /** |
| 44 | * Class for perfect fluid rotating gravastar. \ingroup (star) |
| 45 | * |
| 46 | |
| 47 | * |
| 48 | */ |
| 49 | class Gravastar : public Star_rot { |
| 50 | |
| 51 | // Data : |
| 52 | // ----- |
| 53 | protected: |
| 54 | /** |
| 55 | * Energy density in gravastar's core |
| 56 | */ |
| 57 | double rho_core; |
| 58 | |
| 59 | // Derived data : |
| 60 | // ------------ |
| 61 | protected: |
| 62 | |
| 63 | |
| 64 | |
| 65 | // Constructors - Destructor |
| 66 | // ------------------------- |
| 67 | public: |
| 68 | /** Standard constructor. |
| 69 | * |
| 70 | * @param mp_i Mapping on which the gravastar is contructed |
| 71 | * @param nzet_i Number of domains occupied by the gravastar |
| 72 | * @param eos_i Equation of state of the crust matter |
| 73 | * @param rho_core_i Energy density in gravastar's core (constant, =-p_core) |
| 74 | * NB:pas de choix pour l'EOS en fait : a virer?? |
| 75 | */ |
| 76 | Gravastar(Map& mp_i, int nzet_i, const Eos& eos_i, const double rho_core_i) ; |
| 77 | |
| 78 | |
| 79 | Gravastar(const Gravastar& ) ; ///< Copy constructor |
| 80 | |
| 81 | /** Constructor from a file (see \c sauve(FILE*) ). |
| 82 | * |
| 83 | * @param mp_i Mapping on which the gravastar is constructed |
| 84 | * @param eos_i Equation of state of the crust matter |
| 85 | * @param fich input file (must have been created by the function |
| 86 | * \c Gravastar::sauve ) |
| 87 | */ |
| 88 | Gravastar(Map& mp_i, const Eos& eos_i, FILE* fich) ; |
| 89 | |
| 90 | ~Gravastar() ; ///< Destructor |
| 91 | |
| 92 | |
| 93 | // Mutators / assignment |
| 94 | // --------------------- |
| 95 | public: |
| 96 | /// Assignment to another \c Gravastar |
| 97 | void operator=(const Gravastar& ) ; |
| 98 | |
| 99 | /** Allows to computes the proper baryon and energy density, as well as |
| 100 | * pressure from the enthalpy, in the gravastar's crust only (in the core, |
| 101 | * p=-rho=cst) |
| 102 | */ |
| 103 | void equation_of_state() ; |
| 104 | |
| 105 | // Computational routines |
| 106 | // ---------------------- |
| 107 | public: |
| 108 | |
| 109 | /** Computes an equilibrium configuration. |
| 110 | * |
| 111 | * @param omega0 [input] Requested angular velocity |
| 112 | * (if \c fact_omega=1. ) |
| 113 | * @param fact_omega [input] 1.01 = search for the Keplerian frequency, |
| 114 | * 1. = otherwise. |
| 115 | * @param nzadapt [input] Number of (inner) domains where the mapping |
| 116 | * adaptation to an iso-enthalpy surface |
| 117 | * should be performed |
| 118 | * @param ent_limit [input] 1-D \c Tbl of dimension \c nzet which |
| 119 | * defines the enthalpy at the outer boundary |
| 120 | * of each domain |
| 121 | * @param icontrol [input] Set of integer parameters (stored as a |
| 122 | * 1-D \c Itbl of size 8) to control the |
| 123 | * iteration: |
| 124 | * \li \c icontrol(0) = mer_max : maximum number of steps |
| 125 | * \li \c icontrol(1) = mer_rot : step at which the rotation is |
| 126 | * switched on |
| 127 | * \li \c icontrol(2) = mer_change_omega : step at which the rotation |
| 128 | * velocity is changed to reach the final one |
| 129 | * \li \c icontrol(3) = mer_fix_omega : step at which the final |
| 130 | * rotation velocity must have been reached |
| 131 | * \li \c icontrol(4) = mer_mass : the absolute value of |
| 132 | * \c mer_mass is the step from which the |
| 133 | * baryon mass is forced to converge, |
| 134 | * by varying the central enthalpy |
| 135 | * (\c mer_mass>0 ) or the angular |
| 136 | * velocity (\c mer_mass<0 ) |
| 137 | * \li \c icontrol(5) = mermax_poisson : maximum number of steps in |
| 138 | * \c Map_et::poisson |
| 139 | * \li \c icontrol(6) = mer_triax : step at which the 3-D |
| 140 | * perturbation is switched on |
| 141 | * \li \c icontrol(7) = delta_mer_kep : number of steps |
| 142 | * after \c mer_fix_omega when \c omega |
| 143 | * starts to be increased by \c fact_omega |
| 144 | * to search for the Keplerian velocity |
| 145 | * |
| 146 | * @param control [input] Set of parameters (stored as a |
| 147 | * 1-D \c Tbl of size 7) to control the |
| 148 | * iteration: |
| 149 | * \li \c control(0) = precis : threshold on the enthalpy relative |
| 150 | * change for ending the computation |
| 151 | * \li \c control(1) = omega_ini : initial angular velocity, |
| 152 | * switched on only if \c mer_rot<0 , |
| 153 | * otherwise 0 is used |
| 154 | * \li \c control(2) = relax : relaxation factor in the main |
| 155 | * iteration |
| 156 | * \li \c control(3) = relax_poisson : relaxation factor in |
| 157 | * \c Map_et::poisson |
| 158 | * \li \c control(4) = thres_adapt : threshold on dH/dr for |
| 159 | * freezing the adaptation of the mapping |
| 160 | * \li \c control(5) = ampli_triax : relative amplitude of |
| 161 | * the 3-D perturbation |
| 162 | * \li \c control(6) = precis_adapt : precision for |
| 163 | * \c Map_et::adapt |
| 164 | * |
| 165 | * @param diff [output] 1-D \c Tbl of size 7 for the storage of |
| 166 | * some error indicators : |
| 167 | * \li \c diff(0) : Relative change in the enthalpy field |
| 168 | * between two successive steps |
| 169 | * \li \c diff(1) : Relative error in the resolution of the |
| 170 | * Poisson equation for \c nuf |
| 171 | * \li \c diff(2) : Relative error in the resolution of the |
| 172 | * Poisson equation for \c nuq |
| 173 | * \li \c diff(3) : Relative error in the resolution of the |
| 174 | * Poisson equation for \c dzeta |
| 175 | * \li \c diff(4) : Relative error in the resolution of the |
| 176 | * Poisson equation for \c tggg |
| 177 | * \li \c diff(5) : Relative error in the resolution of the |
| 178 | * equation for \c shift (x comp.) |
| 179 | * \li \c diff(6) : Relative error in the resolution of the |
| 180 | * equation for \c shift (y comp.) |
| 181 | */ |
| 182 | void equilibrium(double omega0, double fact_omega, |
| 183 | int nzadapt, const Tbl& ent_limit, |
| 184 | const Itbl& icontrol, const Tbl& control, |
| 185 | Tbl& diff, Param* = 0x0) ; |
| 186 | |
| 187 | // Outputs |
| 188 | // ------- |
| 189 | public: |
| 190 | |
| 191 | |
| 192 | protected: |
| 193 | /// Operator >> (virtual function called by the operator <<). |
| 194 | virtual ostream& operator>>(ostream& ) const ; |
| 195 | |
| 196 | }; |
| 197 | |
| 198 | } |
| 199 | #endif |