/* * Method of class Star_bin_xcts to compute the velocity scalar * potential $\psi$ by solving the continuity equation * (see file star.h for documentation). */ /* * Copyright (c) 2010 Michal Bejger * * 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_bin_vel_pot_xcts_C[] = "$Header: /cvsroot/Lorene/C++/Source/Star/star_bin_vel_pot_xcts.C,v 1.7 2014/10/13 08:53:39 j_novak Exp $" ; /* * $Id: star_bin_vel_pot_xcts.C,v 1.7 2014/10/13 08:53:39 j_novak Exp $ * $Log: star_bin_vel_pot_xcts.C,v $ * Revision 1.7 2014/10/13 08:53:39 j_novak * Lorene classes and functions now belong to the namespace Lorene. * * Revision 1.6 2010/12/09 10:47:31 m_bejger * Small changes, definition of lnPsi2N * * Revision 1.5 2010/10/26 20:01:06 m_bejger * Cleanup * * Revision 1.4 2010/10/18 20:56:15 m_bejger * Generalization for many domains in the star: buggy * * Revision 1.3 2010/06/17 15:07:10 m_bejger * Psi4, lnPsi2N corrected * * Revision 1.2 2010/06/15 08:05:55 m_bejger * Various fields were lacking bases * * Revision 1.1 2010/05/04 07:51:05 m_bejger * Initial version * * $Header: /cvsroot/Lorene/C++/Source/Star/star_bin_vel_pot_xcts.C,v 1.7 2014/10/13 08:53:39 j_novak Exp $ * */ // Headers Lorene #include "star.h" #include "eos.h" #include "param.h" #include "cmp.h" #include "tenseur.h" #include "graphique.h" #include "utilitaires.h" // Local prototype namespace Lorene { Cmp raccord_c1(const Cmp& uu, int l1) ; double Star_bin_xcts::velocity_potential(int mermax, double precis, double relax) { int nzm1 = mp.get_mg()->get_nzone() - 1 ; //---------------------------------- // Specific relativistic enthalpy ---> hhh //---------------------------------- Scalar hhh = exp(ent) ; // = 1 at the Newtonian limit hhh.std_spectral_base() ; //------------------------------------------------------------------ // Computation of W^i = Psi^4 h Gamma_n B^i/N // See Eq (62) from Gourgoulhon et al. (2001) //------------------------------------------------------------------ Vector www = hhh * gam_euler * psi4 * bsn ; www.change_triad( mp.get_bvect_cart() ) ; // components on the mapping // Cartesian basis //------------------------------------------------- // Constant value of W^i at the center of the star //------------------------------------------------- Vector v_orb(mp, CON, mp.get_bvect_cart()) ; v_orb.set_etat_qcq() ; for (int i=1; i<=3; i++) v_orb.set(i) = www(i).val_grid_point(0, 0, 0, 0) ; v_orb.set_triad( *(www.get_triad()) ) ; v_orb.std_spectral_base() ; //------------------------------------------------- // Source and coefficients a, b for poisson_compact // (independent from psi0) //------------------------------------------------- Scalar dndh_log(mp) ; dndh_log = 0 ; for (int l=0; l erreur) erreur = err ; } //-------------------------------- // Computation of grad(psi) //-------------------------------- d_psi.set_etat_qcq() ; for (int i=1; i<=3; i++) d_psi.set(i) = (psi0.derive_cov(flat))(i) + v_orb(i) ; d_psi.change_triad(mp.get_bvect_cart()) ; // C^1 continuation of d_psi outside the star // (to ensure a smooth enthalpy field accross the stellar surface) // ---------------------------------------------------------------- d_psi.annule(nzet, nzm1) ; for (int i=1; i<=3; i++) d_psi.set(i) = raccord_c1(d_psi(i), nzet) ; return erreur ; } }