/* * Method of class Star_bhns to compute a spherical star configuration * * (see file star_bhns.h for documentation). * */ /* * Copyright (c) 2005,2007 Keisuke Taniguchi * * This file is part of LORENE. * * LORENE is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * LORENE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with LORENE; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ char star_bhns_spher_C[] = "$Header: /cvsroot/Lorene/C++/Source/Star_bhns/star_bhns_spher.C,v 1.4 2014/10/13 08:53:41 j_novak Exp $" ; /* * $Id: star_bhns_spher.C,v 1.4 2014/10/13 08:53:41 j_novak Exp $ * $Log: star_bhns_spher.C,v $ * Revision 1.4 2014/10/13 08:53:41 j_novak * Lorene classes and functions now belong to the namespace Lorene. * * Revision 1.3 2014/10/06 15:13:16 j_novak * Modified #include directives to use c++ syntax. * * Revision 1.2 2008/05/15 19:16:54 k_taniguchi * Change of some parameters. * * Revision 1.1 2007/06/22 01:32:19 k_taniguchi * *** empty log message *** * * * $Header: /cvsroot/Lorene/C++/Source/Star_bhns/star_bhns_spher.C,v 1.4 2014/10/13 08:53:41 j_novak Exp $ * */ // C++ headers //#include <> // C headers #include // Lorene headers #include "star_bhns.h" #include "param.h" #include "cmp.h" #include "tenseur.h" #include "unites.h" namespace Lorene { void Star_bhns::equil_spher_bhns(double ent_c, double precis) { // Fundamental constants and units // ------------------------------- using namespace Unites ; // Initializations // --------------- const Mg3d* mg = mp.get_mg() ; int nz = mg->get_nzone() ; // Index of the point at phi=0, theta=pi/2 at the surface of the star: int l_b = nzet - 1 ; int i_b = mg->get_nr(l_b) - 1 ; int j_b = mg->get_nt(l_b) - 1 ; int k_b = 0 ; // Value of the enthalpy defining the surface of the star double ent_b = 0. ; // Initialization of the enthalpy field to the constant value ent_c : ent = ent_c ; ent.annule(nzet, nz-1) ; // Corresponding profiles of baryon density, energy density and pressure equation_of_state() ; // Initial metric lapconf_auto = 1. ; lapconf_auto.std_spectral_base() ; confo_auto = 1. ; confo_auto.std_spectral_base() ; // Auxiliary quantities // -------------------- // Affine mapping for solving the Poisson equations Map_af mpaff(mp) ; Param par_nul ; // Param (null) for Map_af::poisson Scalar ent_jm1(mp) ; // Enthalpy at previous step ent_jm1 = ent_c ; ent_jm1.std_spectral_base() ; ent_jm1.annule(nzet, nz-1) ; Scalar source_lapconf(mp) ; Scalar source_confo(mp) ; Scalar lapconf_auto_m1(mp) ; Scalar confo_auto_m1(mp) ; lapconf_auto_m1 = 0. ; confo_auto_m1 = 0. ; double diff_ent = 1. ; int mermax = 200 ; // Maximum number of iterations double alpha_r = 1. ; //==========================================================// // Start of iteration // //==========================================================// for (int mer=0 ; (diff_ent > precis) && (mer