sym_tensor.h

00001 /*
00002  *  Definition of Lorene class Sym_tensor, 
00003  *  as well as derived classes Sym_tensor_trans and Sym_tensor_tt
00004  *
00005  */
00006 
00007 /*
00008  *   Copyright (c) 2003-2004 Eric Gourgoulhon & Jerome Novak
00009  *
00010  *   This file is part of LORENE.
00011  *
00012  *   LORENE is free software; you can redistribute it and/or modify
00013  *   it under the terms of the GNU General Public License version 2
00014  *   as published by the Free Software Foundation.
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 #ifndef __SYM_TENSOR_H_ 
00028 #define __SYM_TENSOR_H_ 
00029 
00030 /*
00031  * $Id: sym_tensor.h,v 1.48 2010/10/11 10:23:03 j_novak Exp $
00032  * $Log: sym_tensor.h,v $
00033  * Revision 1.48  2010/10/11 10:23:03  j_novak
00034  * Removed methods Sym_tensor_trans::solve_hrr() and Sym_tensor_trans::set_WX_det_one(), as they are no longer relevant.
00035  *
00036  * Revision 1.47  2008/12/05 08:46:19  j_novak
00037  * New method Sym_tensor_trans_aux::set_tt_part_det_one.
00038  *
00039  * Revision 1.46  2008/12/03 10:18:56  j_novak
00040  * Method 6 is now the default for calls to vector Poisson solver.
00041  *
00042  * Revision 1.45  2008/08/20 14:39:53  n_vasset
00043  * New Dirac solvers handling degenerate elliptic operators on excised spacetimes.
00044  *
00045  * Revision 1.44  2007/12/21 16:06:16  j_novak
00046  * Methods to filter Tensor, Vector and Sym_tensor objects.
00047  *
00048  * Revision 1.43  2007/11/27 15:48:52  n_vasset
00049  * New member p_tilde_c for class Sym_tensor
00050  *
00051  * Revision 1.42  2007/05/04 16:43:50  n_vasset
00052  * adding of functions sol_Dirac_BC2 and sol_Dirac_A2
00053  *
00054  * Revision 1.41  2006/10/24 13:03:17  j_novak
00055  * New methods for the solution of the tensor wave equation. Perhaps, first
00056  * operational version...
00057  *
00058  * Revision 1.40  2006/08/31 12:13:21  j_novak
00059  * Added an argument of type Param to Sym_tensor_trans::sol_  rac_A().
00060  *
00061  * Revision 1.39  2006/06/20 12:07:13  j_novak
00062  * Improved execution speed for sol_Dirac_tildeB...
00063  *
00064  * Revision 1.38  2006/06/14 10:04:19  j_novak
00065  * New methods sol_Dirac_l01, set_AtB_det_one and set_AtB_trace_zero.
00066  *
00067  * Revision 1.37  2006/06/13 13:30:12  j_novak
00068  * New members sol_Dirac_A and sol_Dirac_tildeB (see documentation).
00069  *
00070  * Revision 1.36  2006/06/12 13:37:23  j_novak
00071  * Added bounds in l (multipolar momentum) for Sym_tensor_trans::solve_hrr.
00072  *
00073  * Revision 1.35  2006/06/12 07:42:28  j_novak
00074  * Fields A and tilde{B} are defined only for l>1.
00075  *
00076  * Revision 1.34  2006/06/12 07:27:18  j_novak
00077  * New members concerning A and tilde{B}, dealing with the transverse part of the
00078  * Sym_tensor.
00079  *
00080  * Revision 1.33  2005/11/28 14:45:14  j_novak
00081  * Improved solution of the Poisson tensor equation in the case of a transverse
00082  * tensor.
00083  *
00084  * Revision 1.32  2005/09/16 13:58:10  j_novak
00085  * New Poisson solver for a Sym_tensor_trans.
00086  *
00087  * Revision 1.31  2005/09/07 16:47:42  j_novak
00088  * Removed method Sym_tensor_trans::T_from_det_one
00089  * Modified Sym_tensor::set_auxiliary, so that it takes eta/r and mu/r as
00090  * arguments.
00091  * Modified Sym_tensor_trans::set_hrr_mu.
00092  * Added new protected method Sym_tensor_trans::solve_hrr
00093  *
00094  * Revision 1.30  2005/04/08 08:22:04  j_novak
00095  * New methods set_hrr_mu_det_one() and set_WX_det_one(). Not tested yet...
00096  *
00097  * Revision 1.29  2005/04/06 15:43:58  j_novak
00098  * New method Sym_tensor_trans::T_from_det_one(...).
00099  *
00100  * Revision 1.28  2005/04/04 15:25:22  j_novak
00101  * Added new members www, xxx, ttt and the associated methods.
00102  *
00103  * Revision 1.27  2005/04/01 14:28:31  j_novak
00104  * Members p_eta and p_mu are now defined in class Sym_tensor.
00105  *
00106  * Revision 1.26  2005/01/03 08:34:58  f_limousin
00107  * Come back to the previous version.
00108  *
00109  * Revision 1.25  2005/01/03 08:15:39  f_limousin
00110  * The first argument of the function trace_from_det_one(...) is now
00111  * a Sym_tensor_trans instead of a Sym_tensor_tt (because of a
00112  * compilation error with some compilators).
00113  *
00114  * Revision 1.24  2004/12/28 14:21:46  j_novak
00115  * Added the method Sym_tensor_trans::trace_from_det_one
00116  *
00117  * Revision 1.23  2004/12/28 10:37:22  j_novak
00118  * Better way of enforcing zero divergence.
00119  *
00120  * Revision 1.22  2004/06/14 20:44:44  e_gourgoulhon
00121  * Added argument method_poisson to Sym_tensor::longit_pot and
00122  * Sym_tensor::transverse.
00123  *
00124  * Revision 1.21  2004/05/25 14:57:20  f_limousin
00125  * Add parameters in argument of functions transverse, longit_pot,
00126  * set_tt_trace, tt_part and set_khi_mu for the case of a Map_et.
00127  *
00128  * Revision 1.20  2004/05/24 13:44:54  e_gourgoulhon
00129  * Added parameter dzp to method Sym_tensor_tt::update.
00130  *
00131  * Revision 1.19  2004/04/08 16:37:54  e_gourgoulhon
00132  * Sym_tensor_tt::set_khi_mu: added argument dzp (dzpuis of resulting h^{ij}).
00133  *
00134  * Revision 1.18  2004/03/30 14:01:19  j_novak
00135  * Copy constructors and operator= now copy the "derived" members.
00136  *
00137  * Revision 1.17  2004/03/29 16:13:06  j_novak
00138  * New methods set_longit_trans and set_tt_trace .
00139  *
00140  * Revision 1.16  2004/03/22 13:12:43  j_novak
00141  * Modification of comments to use doxygen instead of doc++
00142  *
00143  * Revision 1.15  2004/03/03 13:54:16  j_novak
00144  * Error in comments corrected.
00145  *
00146  * Revision 1.14  2004/03/03 13:16:20  j_novak
00147  * New potential khi (p_khi) and the functions manipulating it.
00148  *
00149  * Revision 1.13  2004/02/26 22:45:13  e_gourgoulhon
00150  * Added method derive_lie.
00151  *
00152  * Revision 1.12  2004/02/18 18:43:22  e_gourgoulhon
00153  * Method trace() renamed the_trace() in order to avoid
00154  * any confusion with new method Tensor::trace().
00155  *
00156  * Revision 1.11  2004/01/04 20:49:06  e_gourgoulhon
00157  * Sym_tensor is now a derived class of Tensor_sym.
00158  * Suppressed methods Sym_tensor::indices and Sym_tensor::position:
00159  *  they are now implemented at the Tensor_sym level.
00160  *
00161  * Revision 1.10  2003/11/27 16:05:11  e_gourgoulhon
00162  * Changed return value of methods transverse( ) and longit_pot( ).
00163  *
00164  * Revision 1.9  2003/11/26 21:56:21  e_gourgoulhon
00165  * Class Sym_tensor: added the members p_transverse and p_longit_pot,
00166  * and the associated methods transverse( ), longit_pot( ),
00167  * del_deriv_met( ) and set_der_met_0x0( ).
00168  *
00169  * Revision 1.8  2003/11/07 16:54:23  e_gourgoulhon
00170  * Added method Sym_tensor_tt::poisson().
00171  *
00172  * Revision 1.7  2003/11/06 14:43:37  e_gourgoulhon
00173  * Gave a name to const arguments in certain method prototypes (e.g.
00174  * constructors) to correct a bug of DOC++.
00175  *
00176  * Revision 1.6  2003/11/05 15:26:31  e_gourgoulhon
00177  * Modif documentation.
00178  *
00179  * Revision 1.5  2003/11/04 22:57:26  e_gourgoulhon
00180  * Class Sym_tensor_tt: method set_eta_mu renamed set_rr_eta_mu
00181  *    method update_tp() renamed update()
00182  *    added method set_rr_mu.
00183  *
00184  * Revision 1.4  2003/11/03 22:29:54  e_gourgoulhon
00185  * Class Sym_tensor_tt: added functions set_eta_mu and update_tp.
00186  *
00187  * Revision 1.3  2003/11/03 17:09:30  e_gourgoulhon
00188  * Class Sym_tensor_tt: added the methods eta() and mu().
00189  *
00190  * Revision 1.2  2003/10/28 21:22:51  e_gourgoulhon
00191  * Class Sym_tensor_trans: added methods trace() and tt_part().
00192  *
00193  * Revision 1.1  2003/10/27 10:45:19  e_gourgoulhon
00194  * New derived classes Sym_tensor_trans and Sym_tensor_tt.
00195  *
00196  *
00197  * $Header: /cvsroot/Lorene/C++/Include/sym_tensor.h,v 1.48 2010/10/11 10:23:03 j_novak Exp $
00198  *
00199  */
00200 
00201 class Sym_tensor_trans ;
00202 class Sym_tensor_tt ;
00203 
00204 
00205 
00206 
00207             //---------------------------------//
00208             //        class Sym_tensor         //
00209             //---------------------------------//
00210             
00219 class Sym_tensor : public Tensor_sym {
00220 
00221     // Derived data : 
00222     // ------------
00223     protected:
00235     mutable Sym_tensor_trans* p_transverse[N_MET_MAX] ;
00236 
00242     mutable Vector* p_longit_pot[N_MET_MAX] ;
00243 
00256     mutable Scalar* p_eta ;
00257     
00270     mutable Scalar* p_mu ;
00271 
00289     mutable Scalar* p_www ;
00290 
00308     mutable Scalar* p_xxx ;
00309 
00311     mutable Scalar* p_ttt ;
00312 
00318     mutable Scalar* p_aaa ;
00319 
00330     mutable Scalar* p_tilde_b ;
00331 
00342     mutable Scalar* p_tilde_c ;
00343 
00344 
00345      
00346 
00347 
00348 
00349     // Constructors - Destructor :
00350     // -------------------------
00351     
00352     public:
00366     Sym_tensor(const Map& map, const Itbl& tipe, const Base_vect& triad_i) ;
00367 
00376     Sym_tensor(const Map& map, int tipe, const Base_vect& triad_i) ;
00377 
00378     Sym_tensor(const Sym_tensor& a) ; 
00379 
00383     Sym_tensor(const Tensor& a) ;
00384     
00395     Sym_tensor(const Map& map, const Base_vect& triad_i, FILE* fich) ;
00396 
00397     virtual ~Sym_tensor() ;    
00398 
00399       
00400 
00401     // Memory management
00402     // -----------------
00403     protected:
00404     virtual void del_deriv() const; 
00405 
00407     void set_der_0x0() const ; 
00408 
00413     virtual void del_derive_met(int i) const ;
00414 
00418     void set_der_met_0x0(int i) const ;
00419 
00420 
00421     // Mutators / assignment
00422     // ---------------------
00423     public:
00425     virtual void operator=(const Sym_tensor& a) ;
00426 
00428     virtual void operator=(const Tensor_sym& a) ;
00429 
00435     virtual void operator=(const Tensor& a) ;
00436 
00442     void set_longit_trans( const Vector& v, const Sym_tensor_trans& a) ;
00443 
00450     void set_auxiliary( const Scalar& trr, const Scalar& eta_over_r, const
00451                 Scalar& mu_over_r, const Scalar& www, const Scalar&
00452                 xxx, const Scalar& ttt ) ;
00453 
00459     virtual void  exponential_filter_r(int lzmin, int lzmax, int p, 
00460                 double alpha= -16.) ;
00461 
00467     virtual void exponential_filter_ylm(int lzmin, int lzmax, int p, 
00468                 double alpha= -16.) ;
00469 
00470     // Computation of derived members
00471     // ------------------------------
00472     public:
00473 
00474 
00478     const Vector& divergence(const Metric&) const ; 
00479 
00483         Sym_tensor derive_lie(const Vector& v) const ; 
00484 
00502     const Sym_tensor_trans& transverse(const Metric& gam, Param* par = 0x0,
00503                 int method_poisson = 6) const ; 
00504 
00515     const Vector& longit_pot(const Metric& gam, Param* par = 0x0,
00516                 int method_poisson = 6) const ; 
00517     
00519     virtual const Scalar& eta(Param* par = 0x0) const ;
00520 
00522     const Scalar& mu(Param* par = 0x0) const ;
00523 
00525     const Scalar& www() const ;
00526 
00528     const Scalar& xxx() const ;
00529 
00531     const Scalar& ttt() const ;
00532 
00538     const Scalar& compute_A(bool output_ylm = true, Param* par = 0x0) const ;
00539 
00545     const Scalar& compute_tilde_B(bool output_ylm = true, Param* par = 0x0) const ;
00546 
00553     Scalar compute_tilde_B_tt(bool output_ylm = true, Param* par = 0x0) const ;
00554 
00560     const Scalar& compute_tilde_C(bool output_ylm = true, Param* par = 0x0) const ;
00561 
00562 
00563 
00564 
00565 
00566  protected:
00570     Scalar get_tilde_B_from_TT_trace(const Scalar& tilde_B_tt_in, const Scalar&
00571         trace) const ;
00572     
00573     // Mathematical operators
00574     // ----------------------
00575  protected:
00580     Sym_tensor* inverse() const ;
00581 
00582     // Friend classes
00583     //-----------------
00584     friend class Metric ;
00585  
00586 } ;
00587 
00588 
00589             //---------------------------------//
00590             //    class Sym_tensor_trans       //
00591             //---------------------------------//
00592             
00593 
00604 class Sym_tensor_trans: public Sym_tensor {
00605 
00606     // Data : 
00607     // -----
00608     protected:
00610     const Metric* const met_div ; 
00611     
00613     mutable Scalar* p_trace ; 
00614     
00616     mutable Sym_tensor_tt* p_tt ;
00617     
00618     // Constructors - Destructor
00619     // -------------------------
00620     public:
00628     Sym_tensor_trans(const Map& map, const Base_vect& triad_i, 
00629         const Metric& met) ;
00630 
00631     Sym_tensor_trans(const Sym_tensor_trans& ) ;       
00632 
00644     Sym_tensor_trans(const Map& map, const Base_vect& triad_i, 
00645         const Metric& met, FILE* fich) ;
00646 
00647     virtual ~Sym_tensor_trans() ;           
00648 
00649  
00650     // Memory management
00651     // -----------------
00652     protected:
00653     virtual void del_deriv() const; 
00654 
00656     void set_der_0x0() const ; 
00657 
00658 
00659     // Accessors
00660     // ---------
00661         public:
00665     const Metric& get_met_div() const {return *met_div ; } ;
00666 
00667     // Mutators / assignment
00668     // ---------------------
00669 
00670     public:
00672     virtual void operator=(const Sym_tensor_trans& a) ; 
00673     
00675     virtual void operator=(const Sym_tensor& a) ;   
00676     
00678     virtual void operator=(const Tensor_sym& a) ;
00679 
00681     virtual void operator=(const Tensor& a) ;   
00682     
00688     void set_tt_trace(const Sym_tensor_tt& a, const Scalar& h, 
00689               Param* par = 0x0) ;
00690 
00691     // Computational methods
00692     // ---------------------
00694     const Scalar& the_trace() const ; 
00695     
00700     const Sym_tensor_tt& tt_part(Param* par = 0x0) const ; 
00701 
00702  protected:
00718     void sol_Dirac_A(const Scalar& aaa, Scalar& tilde_mu, Scalar& xxx,
00719              const Param* par_bc = 0x0) const ;
00720 
00721 
00748     void sol_Dirac_tilde_B(const Scalar& tilde_b, const Scalar& hh, Scalar& hrr,
00749                    Scalar& tilde_eta, Scalar& www, Param* par_bc=0x0,
00750                    Param* par_mat=0x0) const ;
00751 
00756     void sol_Dirac_l01(const Scalar& hh, Scalar& hrr, Scalar& tilde_eta,
00757                Param* par_mat) const ;
00758 
00759 
00760 
00761  public:
00762 
00763 
00764         
00770     void sol_Dirac_Abound(const Scalar& aaa, Scalar& tilde_mu, Scalar& x_new,
00771               Scalar bound_mu, const Param* par_bc);
00772  
00773         
00780     void sol_Dirac_A2(const Scalar& aaa, Scalar& tilde_mu, Scalar& x_new,
00781               Scalar bound_mu, const Param* par_bc);       
00782 
00788     void sol_Dirac_BC2(const Scalar& bb, const Scalar& cc, const Scalar& hh, 
00789                 Scalar& hrr, Scalar& tilde_eta, Scalar& ww, Scalar bound_eta,double dir, double neum, double rhor, Param* par_bc, Param* par_mat); 
00790  
00791 
00797     void sol_Dirac_BC3(const Scalar& bb, const Scalar& hh, 
00798                 Scalar& hrr, Scalar& tilde_eta, Scalar& ww, Scalar bound_hrr, Scalar bound_eta, Param* par_bc, Param* par_mat); 
00799 
00800 
00801 
00802      // Solving the electric system for l=0 and l=1 only (simpler case), with boundary conditions imposed by the degenerate elliptic system.
00803    
00804     void sol_Dirac_l01_bound(const Scalar& hh, Scalar& hrr, Scalar& tilde_eta, Scalar& bound_hrr, Scalar& bound_eta, Param* par_mat) ;
00805 
00806     // Provisory: just for compilation, to be removed
00807     void sol_Dirac_l01_2(const Scalar& hh, Scalar& hrr, Scalar& tilde_eta, Param* par_mat) ;
00808 
00809 
00814     void sol_elliptic_ABC(Sym_tensor& source, Scalar aaa, Scalar bbb, Scalar ccc) ;
00815 
00816 
00817 
00831     void trace_from_det_one(const Sym_tensor_tt& htt, 
00832                 double precis = 1.e-14, int it_max = 100) ;
00833 
00848     void set_hrr_mu_det_one(const Scalar& hrr, const Scalar& mu_in,
00849                 double precis = 1.e-14, int it_max = 100) ;
00850 
00865     void set_tt_part_det_one(const Sym_tensor_tt& hijtt, const 
00866                  Scalar* h_prev = 0x0, Param* par_mat = 0x0, 
00867                  double precis = 1.e-14, int it_max = 100) ;
00868 
00887     void set_AtBtt_det_one(const Scalar& a_in, const Scalar& tbtt_in, 
00888                    const Scalar* h_prev = 0x0, Param* par_bc = 0x0,
00889                    Param* par_mat = 0x0, double precis = 1.e-14, 
00890                    int it_max = 100) ;
00891 
00899     void set_AtB_trace(const Scalar& a_in, const Scalar& tb_in, const 
00900                Scalar& trace, Param* par_bc = 0x0, Param* par_mat = 0x0) ;
00901 
00915     Sym_tensor_trans poisson(const Scalar* h_guess = 0x0) const ; 
00916 } ; 
00917     
00918 
00919             //------------------------------//
00920             //    class Sym_tensor_tt       //
00921             //------------------------------//
00922             
00923 
00934 class Sym_tensor_tt: public Sym_tensor_trans {
00935 
00936     // Data : 
00937     // -----
00938 
00939     protected:
00942     mutable Scalar* p_khi ;
00943     
00944     
00945     // Constructors - Destructor
00946     // -------------------------
00947     public:
00955     Sym_tensor_tt(const Map& map, const Base_vect& triad_i, 
00956         const Metric& met) ;
00957 
00958     Sym_tensor_tt(const Sym_tensor_tt& ) ;       
00959 
00971     Sym_tensor_tt(const Map& map, const Base_vect& triad_i, 
00972         const Metric& met, FILE* fich) ;
00973 
00974     virtual ~Sym_tensor_tt() ;          
00975 
00976  
00977     // Memory management
00978     // -----------------
00979     protected:
00980     virtual void del_deriv() const; 
00981 
00983     void set_der_0x0() const ; 
00984 
00985 
00986     // Mutators / assignment
00987     // ---------------------
00988 
00989     public:
00991     virtual void operator=(const Sym_tensor_tt& a) ;    
00992     
00994     virtual void operator=(const Sym_tensor_trans& a) ; 
00995     
00997     virtual void operator=(const Sym_tensor& a) ;   
00998     
01000     virtual void operator=(const Tensor_sym& a) ;
01001 
01003     virtual void operator=(const Tensor& a) ;   
01004     
01016     void set_rr_eta_mu(const Scalar& hrr, const Scalar& eta_i, 
01017                         const Scalar& mu_i) ; 
01018 
01030     void set_rr_mu(const Scalar& hrr, const Scalar& mu_i) ; 
01031     
01032     
01044     void set_khi_eta_mu(const Scalar& khi_i, const Scalar& eta_i, 
01045                         const Scalar& mu_i) ; 
01046         
01060     void set_khi_mu(const Scalar& khi_i, const Scalar& mu_i, int dzp = 0,
01061             Param* par1 = 0x0, Param* par2 = 0x0, 
01062             Param* par3 = 0x0) ; 
01063 
01071     void set_A_tildeB(const Scalar& a_in, const Scalar& tb_in, Param* par_bc = 0x0,
01072               Param* par_mat = 0x0) ;
01073 
01074     // Computational methods
01075     // ---------------------
01076     
01077     public:
01081     const Scalar& khi() const ;
01082     
01084     virtual const Scalar& eta(Param* par = 0x0) const ;
01085 
01086     protected:
01093     void update(int dzp, Param* par1 = 0x0, Param* par2 = 0x0) ;
01094 
01095     public:
01107     Sym_tensor_tt poisson(int dzfin = 2) const ; 
01108     
01109 
01110 
01111 } ; 
01112     
01113 
01114 
01115 
01116 #endif

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