binary.h

00001 /*
00002  *  Definition of Lorene class Binary
00003  *
00004  */
00005 
00006 /*
00007  *   Copyright (c) 2004  Limousin Francois
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 version 2
00013  *   as published by the Free Software Foundation.
00014  *
00015  *   LORENE is distributed in the hope that it will be useful,
00016  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *   GNU General Public License for more details.
00019  *
00020  *   You should have received a copy of the GNU General Public License
00021  *   along with LORENE; if not, write to the Free Software
00022  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023  *
00024  */
00025 
00026 #ifndef __BINARY_H_ 
00027 #define __BINARY_H_ 
00028 
00029 /*
00030  * $Id: binary.h,v 1.9 2006/04/11 14:26:12 f_limousin Exp $
00031  * $Log: binary.h,v $
00032  * Revision 1.9  2006/04/11 14:26:12  f_limousin
00033  * New version of the code : improvement of the computation of some
00034  * critical sources, estimation of the dirac gauge, helical symmetry...
00035  *
00036  * Revision 1.8  2005/11/08 20:17:55  f_limousin
00037  * Add function dirac_gauge() used to impose Dirac gauge during an iteration.
00038  *
00039  * Revision 1.7  2005/09/15 15:56:28  e_gourgoulhon
00040  * Made the documentation compliant with Doxygen.
00041  *
00042  * Revision 1.6  2005/09/13 19:38:32  f_limousin
00043  * Reintroduction of the resolution of the equations in cartesian coordinates.
00044  *
00045  * Revision 1.5  2004/07/21 11:45:20  f_limousin
00046  * Add function mass_adm_vol() to compute the ADM mass of the system
00047  * with a volume integral instead of a surface one.
00048  *
00049  * Revision 1.4  2004/05/25 14:50:06  f_limousin
00050  * Add the virial theorem for conformally flat configurations.
00051  *
00052  * Revision 1.3  2004/01/20 15:25:39  f_limousin
00053  * Nex class binary
00054  *
00055  *
00056  * $Header: /cvsroot/Lorene/C++/Include/binary.h,v 1.9 2006/04/11 14:26:12 f_limousin Exp $
00057  *
00058  */
00059 
00060 // Lorene headers
00061 #include "star.h"
00062 
00069 class Binary {
00070 
00071     // Data : 
00072     // -----
00073     protected:
00074 
00076     Star_bin star1 ;
00077      
00079     Star_bin star2 ;
00080     
00085     Star_bin* et[2] ; 
00086     
00090     double omega ;
00091     
00094     double x_axe ;
00095 
00096 
00097     // Derived data : 
00098     // ------------
00099     protected:
00101     mutable double* p_mass_adm ; 
00102 
00104     mutable double* p_mass_kom ; 
00105 
00107     mutable Tbl* p_angu_mom ; 
00108 
00110     mutable double* p_total_ener ; 
00111 
00113     mutable double* p_virial ; 
00114 
00116     mutable double* p_ham_constr ;
00117     
00119     mutable Tbl* p_mom_constr ;
00120 
00121     
00122 
00123     // Constructors - Destructor
00124     // -------------------------
00125     public:
00141     Binary(Map& mp1, int nzet1, const Eos& eos1, int irrot1, 
00142            Map& mp2, int nzet2, const Eos& eos2, int irrot2,
00143            int conf_flat) ;         
00144 
00145 
00146     Binary(const Binary& ) ;        
00147 
00157     Binary(Map& mp1, const Eos& eos1, Map& mp2, const Eos& eos2, 
00158            FILE* fich) ;            
00159 
00160     ~Binary() ;         
00161  
00162 
00163 
00164     // Memory management
00165     // -----------------
00166     protected:
00167         
00169     void del_deriv() const ; 
00170     
00172     void set_der_0x0() const ; 
00173 
00174 
00175     // Mutators / assignment
00176     // ---------------------
00177     public:
00179     void operator=(const Binary&) ; 
00180     
00182     Star_bin& set(int i) 
00183         { assert( (i==1) || (i==2) ); 
00184           del_deriv() ; 
00185           return *et[i-1] ;} ; 
00186 
00188     double& set_omega() {return omega; } ; 
00189 
00191     double& set_x_axe() {return x_axe; } ; 
00192     
00193 
00194     // Accessors
00195     // ---------
00196     public:
00198     const Star_bin& operator()(int i) const 
00199         { assert( (i==1) || (i==2) ); 
00200           return *et[i-1] ;} ; 
00201 
00203     double get_omega() const {return omega; } ; 
00204     
00206     double get_x_axe() const {return x_axe; } ; 
00207 
00211     double separation() const ; 
00212 
00213 
00214     // Outputs
00215     // -------
00216     public:
00217     void sauve(FILE *) const ;      
00218     
00220     friend ostream& operator<<(ostream& , const Binary& ) ; 
00221 
00223     void display_poly(ostream& ) const ; 
00224 
00228     void write_global(ostream& ) const  ;
00229 
00230       private:
00232     ostream& operator>>(ostream& ) const ;    
00233 
00234 
00235     // Computational routines
00236     // ----------------------
00237     public:
00238 
00240         double mass_adm() const ;
00241 
00243         double mass_adm_vol() const ;
00244 
00246         double mass_kom() const ;
00247     
00249         double mass_kom_vol() const ;
00250 
00258         const Tbl& angu_mom() const ;   
00259 
00268         double total_ener() const ; 
00269 
00272         double virial() const ; 
00273 
00276         double ham_constr() const ; 
00277 
00280         const Tbl& mom_constr() const ; 
00281 
00308     void orbit(double fact_omeg_min, double fact_omeg_max, double& xgg1, 
00309            double& xgg2) ;
00310        
00314     void analytical_omega() ; 
00315 
00320     void analytical_shift() ; 
00321 
00330     void fait_decouple () ;
00331 
00333     void dirac_gauge() ;
00334 
00336     void helical() ;
00337 
00338  
00339 };
00340 ostream& operator<<(ostream& , const Binary& ) ;    
00341 
00342 #endif

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