spheroid.h

00001 /*
00002  *  Definition of Lorene class Spheroid
00003  *
00004  */
00005 
00006 /*
00007  *   Copyright (c) 2006  Nicolas Vasset, Jerome Novak & Jose-Luis Jaramillo
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 __SPHEROID_H_ 
00027 #define __SPHEROID_H_ 
00028 
00029 /*
00030  * $Id: spheroid.h,v 1.12 2008/12/10 13:53:56 jl_jaramillo Exp $
00031  * $Log: spheroid.h,v $
00032  * Revision 1.12  2008/12/10 13:53:56  jl_jaramillo
00033  * versions developed at Meudon in Novemver 2008
00034  *
00035  * Revision 1.11  2008/11/12 15:18:32  n_vasset
00036  * New definition for the computation of Ricci scalar (instead of Ricci
00037  * tensor previously)
00038  *
00039  * Revision 1.10  2008/07/09 08:48:23  n_vasset
00040  * protected member zeta added.
00041  *
00042  * Revision 1.9  2008/06/04 12:31:56  n_vasset
00043  * new functions multipole_mass and multipole_angu.
00044  *
00045  * Revision 1.8  2008/06/03 14:32:23  n_vasset
00046  * dzpuis corrections (provisory). New function mass implemented.
00047  *
00048  * Revision 1.7  2006/09/07 08:39:43  j_novak
00049  * Minor changes.
00050  *
00051  * Revision 1.6  2006/07/03 10:12:51  n_vasset
00052  * adding of flag isphere
00053  *
00054  * Revision 1.5  2006/06/13 08:07:55  n_vasset
00055  *   Addition of 2 members
00056  *
00057  * Revision 1.4  2006/06/08 09:50:49  n_vasset
00058  * corrected version for coordinates transformation
00059  *
00060  * Revision 1.3  2006/06/07 14:32:24  n_vasset
00061  * modified constructor for 3d projector (Sym_tensor to Tensor)
00062  *
00063  * Revision 1.2  2006/05/26 13:25:42  j_novak
00064  * Removed a 'const'
00065  *
00066  * Revision 1.1  2006/05/26 13:20:42  j_novak
00067  * New class spheroid.
00068  *
00069  *
00070  *
00071  * $Header: /cvsroot/Lorene/C++/Include/spheroid.h,v 1.12 2008/12/10 13:53:56 jl_jaramillo Exp $
00072  *
00073  */
00074 #include "metric.h"
00075 
00080 class Spheroid {
00081 
00082 
00083     // Data : 
00084     // -----
00085     protected:
00087         Scalar h_surf ; 
00088 
00092     Tensor jac2d ;
00093 
00096         Tensor proj ;
00097 
00100     Sym_tensor qq ; 
00101    
00104         Vector ss ;
00105 
00109     Vector ephi;
00110 
00111     Metric qab ;  
00112 
00113     Scalar ricci; 
00114 
00118     Sym_tensor hh ; 
00119 
00120     Scalar trk ; 
00121 
00125     Vector ll ;  
00126 
00130     Sym_tensor jj ; 
00131 
00134     Scalar fff;
00135 
00139     Scalar ggg;
00140 
00141         /*** */
00142 
00143     Scalar zeta;
00144 
00147         bool issphere ;  
00148 
00149 
00150     // Derived data : 
00151     // ------------
00152     protected:
00153     mutable Scalar* p_sqrt_q ; 
00154     mutable double* p_area ;   
00155     mutable double* p_angu_mom ; 
00156     mutable double* p_mass ; 
00157     mutable double* p_multipole_mass ;
00158     mutable double* p_multipole_angu ;
00159     mutable double* p_epsilon_A_minus_one ; 
00160     mutable double* p_epsilon_P_minus_one ; 
00161     mutable Scalar* p_theta_plus ; 
00162     mutable Scalar* p_theta_minus ; 
00163     mutable Sym_tensor* p_shear ; 
00164         mutable Tensor* p_delta ; 
00165 
00166 
00167 
00168     // Constructors - Destructor
00169     // -------------------------
00170     public:
00175     Spheroid(const Map_af& map, double radius) ;  
00185     Spheroid(const Scalar& h_in, const Metric& gamij, const Sym_tensor& Kij) ;
00186     Spheroid(const Spheroid& ) ;        
00187 
00189     Spheroid(FILE* ) ;          
00190 
00191     virtual ~Spheroid() ;           
00192  
00193 
00194     // Memory management
00195     // -----------------
00196     protected:
00198     virtual void del_deriv() const ; 
00199     
00201     void set_der_0x0() const ; 
00202 
00203 
00204     // Mutators / assignment
00205     // ---------------------
00206     public:
00208     void operator=(const Spheroid&) ;   
00209     
00210 
00212     void set_ephi(const Scalar&) ; 
00213 
00214 
00215     // Accessors
00216     // ---------
00217     public:
00219     const Scalar& get_hsurf() const {return h_surf ; } ;
00220 
00222     const Metric& get_qab() const {return qab ; } ;
00223 
00225     const Scalar& get_ricci() const {return ricci ; } ;
00226 
00228     const Sym_tensor& get_hh() const {return hh ; } ;
00229 
00231     const Sym_tensor& get_qq() const {return qq ; } ;
00232 
00234     const Tensor& get_proj() const {return proj ; } ;
00235 
00237     const Tensor& get_jac2d() const {return jac2d ; } ;
00238 
00240     const Scalar& get_trk() const {return trk; } ;
00241 
00243     const Vector& get_ll() const {return ll;} ;
00244 
00246     const Vector& get_ss() const {return ss;} ;
00247 
00249     const Vector& get_ephi() const {return ephi;};
00250 
00252     const Sym_tensor& get_jj() const {return jj;} ;
00253 
00255     const Scalar& get_fff() const {return fff;} ;
00256     
00258     const Scalar& get_ggg() const {return ggg;} ;
00259 
00261     bool get_issphere() const{return issphere;}; 
00262 
00264     Scalar& set_hsurf() {del_deriv() ; return h_surf ; } ;
00265 
00267     Metric& set_qab() {del_deriv() ; return qab ; } ;
00268 
00270     Scalar& set_ricci() {del_deriv() ; return ricci ; } ;
00271 
00273     Sym_tensor& set_qq() {del_deriv() ; return qq ; } ;
00274 
00276     Tensor& set_proj() {del_deriv() ; return proj ; } ;
00277 
00279     Sym_tensor& set_hh() {del_deriv() ; return hh ; } ;
00280 
00282     Scalar& set_trk() {del_deriv() ; return trk; } ;
00283 
00285     Vector& set_ll() {del_deriv() ; return ll;} ;
00286 
00288     Vector& set_ss() {del_deriv() ; return ss;} ;
00289 
00291     Sym_tensor& set_jj() {del_deriv() ; return jj;} ;
00292 
00294     Scalar& set_fff() {del_deriv() ; return fff;} ;
00295 
00297     Scalar& set_ggg() {del_deriv() ; return ggg;} ;
00298 
00300         bool set_issphere() {del_deriv() ; return issphere; };  
00301       
00303         void update_from_tslice(const Metric& gamij, const Sym_tensor& Kij) ;
00304     
00305     // Computational functions
00306     // -----------------------
00307     public:
00308 
00310 //  Vector compute_normal(const Metric& gamij) ;
00311 
00313     const Scalar& sqrt_q() const ;
00314 
00319     double area() const ;
00320 
00328     double angu_mom() const ;
00329 
00336     double mass() const;
00337 
00343     double multipole_mass(const int order) const;
00344 
00345 
00351     double multipole_angu(const int order) const;
00352 
00353 
00354 
00356         double epsilon_A_minus_one() const;
00357 
00361     double epsilon_P_minus_one() const;
00362 
00364         const Scalar& theta_plus() const ;
00365 
00367     const Scalar& theta_minus() const ;
00368 
00370     const Sym_tensor& shear () const ;
00371 
00373  
00374     Tensor derive_cov2dflat(const Tensor& uu) const ; 
00375 
00377   
00378     const Tensor& delta() const; 
00379 
00381  
00382     Tensor derive_cov2d(const Tensor& uu) const ; 
00383 
00384     // Outputs
00385     // -------
00386     public:
00387     virtual void sauve(FILE *) const ;      
00388     
00390     friend ostream& operator<<(ostream& , const Spheroid& ) ;   
00391 
00392 };
00393 
00394 ostream& operator<<(ostream& , const Spheroid& ) ;
00395 
00396  //------------------
00397  //  Class App_hor
00398  //------------------
00399 
00404 class App_hor : public Spheroid {
00405 
00406     // Constructors - Destructor
00407     // -------------------------
00408     public:
00409     App_hor(const Mg3d& grid_angu, double radius) ;  
00410 
00418     App_hor(const Scalar& h_in, const Metric& gamij, const Sym_tensor& Kij) ;
00419     App_hor(const App_hor& ) ;      
00420 
00422     App_hor(FILE* ) ;           
00423        
00424     virtual ~App_hor() ;            
00425  
00426     // Mutators / assignment
00427     // ---------------------
00428     public:
00430     void operator=(const App_hor&) ;
00431 
00432     bool check_expansion(double thres = 1.e-7) const ;
00433 
00435     const Sym_tensor& lie_derive_shear(const Scalar& bb, const Scalar& lapse) ;
00436 
00440     const Sym_tensor& lie_derive_theta_plus(const Scalar& bb, const Scalar& lapse);
00441 
00445     const Sym_tensor& lie_derive_theta_minus(const Scalar& bb, const Scalar& lapse);
00446 
00448     const Sym_tensor& lie_derive_q_ab(const Scalar& bb, const Scalar& lapse) ;
00449 
00453     const Scalar& l_non_affinity(const Scalar& bb, const Scalar& lapse) ;
00454         
00455 } ;
00456     
00457 
00458 #endif

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