binaire.h

00001 /*
00002  *  Definition of Lorene class Binaire
00003  *
00004  */
00005 
00006 /*
00007  *   Copyright (c) 2000-2003 Eric Gourgoulhon
00008  *
00009  *   This file is part of LORENE.
00010  *
00011  *   LORENE is free software; you can redistribute it and/or modify
00012  *   it under the terms of the GNU General Public License as published by
00013  *   the Free Software Foundation; either version 2 of the License, or
00014  *   (at your option) any later version.
00015  *
00016  *   LORENE is distributed in the hope that it will be useful,
00017  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *   GNU General Public License for more details.
00020  *
00021  *   You should have received a copy of the GNU General Public License
00022  *   along with LORENE; if not, write to the Free Software
00023  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00024  *
00025  */
00026 
00027 
00028 #ifndef __BINAIRE_H_ 
00029 #define __BINAIRE_H_ 
00030 
00031 /*
00032  * $Id: binaire.h,v 1.5 2009/06/18 18:42:13 k_taniguchi Exp $
00033  * $Log: binaire.h,v $
00034  * Revision 1.5  2009/06/18 18:42:13  k_taniguchi
00035  * Defined a slightly modified code to determine
00036  * the orbital angular velocity.
00037  *
00038  * Revision 1.4  2003/09/15 15:09:47  e_gourgoulhon
00039  * Added the member function write_global.
00040  *
00041  * Revision 1.3  2002/06/17 14:05:16  j_novak
00042  * friend functions are now also declared outside the class definition
00043  *
00044  * Revision 1.2  2001/12/20 13:00:31  k_taniguchi
00045  * Addition of the Komar mass, the virial error by Gourgoulhon and Bonazzola, and the virial error by Friedman, Uryu, and Shibata.
00046  *
00047  * Revision 1.1.1.1  2001/11/20 15:19:27  e_gourgoulhon
00048  * LORENE
00049  *
00050  * Revision 2.11  2001/02/28  14:27:32  keisuke
00051  * *** empty log message ***
00052  *
00053  * Revision 2.10  2000/07/07  14:10:04  eric
00054  * AJout de display_poly.
00055  *
00056  * Revision 2.9  2000/03/17  15:26:53  eric
00057  * Ajout de la fonction analytical_omega.
00058  *
00059  * Revision 2.8  2000/03/15  16:43:12  eric
00060  * Ajout de la fonction analytical_shift().
00061  *
00062  * Revision 2.7  2000/03/13  14:24:50  eric
00063  * Ajout des membres p_ham_constr et p_mom_constr ainsi que des
00064  * fonctions de calcul associees (verification des equations de contrainte).
00065  *
00066  * Revision 2.6  2000/02/18  14:52:05  eric
00067  * Ajout des membres p_virial et p_total_ener et des fonctions de calcul
00068  * associees.
00069  *
00070  * Revision 2.5  2000/02/12  17:36:39  eric
00071  * Ajout de la fonction separation().
00072  *
00073  * Revision 2.4  2000/02/12  17:09:02  eric
00074  * Ajout de la fonction orbit.
00075  *
00076  * Revision 2.3  2000/02/04  17:15:05  eric
00077  *  Ajout du membre ref_triad.
00078  *
00079  * Revision 2.2  2000/02/02  10:13:08  eric
00080  * Ajout des fonctions de lecture/ecriture omega, x_axe.
00081  *
00082  * Revision 2.1  2000/01/31  17:01:46  eric
00083  * *** empty log message ***
00084  *
00085  * Revision 2.0  2000/01/31  15:57:39  eric
00086  * *** empty log message ***
00087  *
00088  *
00089  * $Header: /cvsroot/Lorene/C++/Include/binaire.h,v 1.5 2009/06/18 18:42:13 k_taniguchi Exp $
00090  *
00091  */
00092 
00093 #include "etoile.h"
00094 
00100 class Binaire {
00101 
00102     // Data : 
00103     // -----
00104     private: 
00108     const Base_vect_cart ref_triad ; 
00109     
00111     Etoile_bin star1 ;
00112      
00114     Etoile_bin star2 ;
00115     
00120     Etoile_bin* et[2] ; 
00121     
00125     double omega ;
00126     
00129     double x_axe ;
00130     
00131     // Derived data : 
00132     // ------------
00133     private: 
00135     mutable double* p_mass_adm ; 
00136 
00138     mutable double* p_mass_kom ; 
00139 
00141     mutable Tbl* p_angu_mom ; 
00142 
00144     mutable double* p_total_ener ; 
00145 
00147     mutable double* p_virial ; 
00148 
00150     mutable double* p_virial_gb ; 
00151 
00153     mutable double* p_virial_fus ; 
00154     
00156     mutable double* p_ham_constr ;
00157     
00159     mutable Tbl* p_mom_constr ;
00160 
00161 
00162     // Constructors - Destructor
00163     // -------------------------
00164     public:
00181     Binaire(Map& mp1, int nzet1, const Eos& eos1, int irrot1, 
00182         Map& mp2, int nzet2, const Eos& eos2, int irrot2,
00183         int relat) ;            
00184 
00185 
00186     Binaire(const Binaire& ) ;      
00187 
00197     Binaire(Map& mp1, const Eos& eos1, Map& mp2, const Eos& eos2, 
00198         FILE* fich) ;           
00199 
00200     ~Binaire() ;            
00201  
00202 
00203     // Memory management
00204     // -----------------
00205     private: 
00207     void del_deriv() const ; 
00208     
00210     void set_der_0x0() const ; 
00211 
00212     // Mutators / assignment
00213     // ---------------------
00214     public:
00216     void operator=(const Binaire&) ;    
00217     
00219     Etoile_bin& set(int i) 
00220         { assert( (i==1) || (i==2) ); 
00221           del_deriv() ; 
00222           return *et[i-1] ;} ; 
00223 
00225     double& set_omega() {return omega; } ; 
00226 
00228     double& set_x_axe() {return x_axe; } ; 
00229     
00230 
00231     // Accessors
00232     // ---------
00233     public:
00235     const Etoile_bin& operator()(int i) const 
00236         { assert( (i==1) || (i==2) ); 
00237           return *et[i-1] ;} ; 
00238 
00240     double get_omega() const {return omega; } ; 
00241     
00243     double get_x_axe() const {return x_axe; } ; 
00244 
00248     double separation() const ; 
00249 
00250     // Outputs
00251     // -------
00252     public:
00253     void sauve(FILE *) const ;      
00254     
00256     friend ostream& operator<<(ostream& , const Binaire& ) ;    
00257     
00259     void display_poly(ostream& ) const ; 
00260 
00264     void write_global(ostream& ) const  ;
00265     
00266     private:
00268     ostream& operator>>(ostream& ) const ;    
00269     
00270 
00271     // Computational routines
00272     // ----------------------
00273     public:
00275         double mass_adm() const ;
00276 
00278         double mass_kom() const ;
00279     
00287         const Tbl& angu_mom() const ;   
00288 
00297         double total_ener() const ; 
00298 
00303         double virial() const ; 
00304 
00310         double virial_gb() const ;  
00311 
00319         double virial_fus() const ; 
00320 
00328         double ham_constr() const ; 
00329 
00336         const Tbl& mom_constr() const ; 
00337 
00364     void orbit(double fact_omeg_min, double fact_omeg_max, double& xgg1, 
00365            double& xgg2) ;
00366        
00397     void orbit_eqmass(double fact_omeg_min, double fact_omeg_max,
00398               double mass1, double mass2,
00399               double& xgg1, double& xgg2) ;
00400 
00404     void analytical_omega() ; 
00405 
00410     void analytical_shift() ; 
00411 
00412 };
00413 ostream& operator<<(ostream& , const Binaire& ) ;   
00414 
00415 #endif

Generated on Tue Feb 7 01:35:14 2012 for LORENE by  doxygen 1.4.6