| 1 | /* |
| 2 | * Definition of Lorene class Metconf |
| 3 | * |
| 4 | */ |
| 5 | |
| 6 | /* |
| 7 | * Copyright (c) 2002 Jerome Novak |
| 8 | * |
| 9 | * This file is part of LORENE. |
| 10 | * |
| 11 | * LORENE is free software; you can redistribute it and/or modify |
| 12 | * it under the terms of the GNU General Public License as published by |
| 13 | * the Free Software Foundation; either version 2 of the License, or |
| 14 | * (at your option) any later version. |
| 15 | * |
| 16 | * LORENE is distributed in the hope that it will be useful, |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 | * GNU General Public License for more details. |
| 20 | * |
| 21 | * You should have received a copy of the GNU General Public License |
| 22 | * along with LORENE; if not, write to the Free Software |
| 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 24 | * |
| 25 | */ |
| 26 | |
| 27 | |
| 28 | #ifndef __METCONF_H_ |
| 29 | #define __METCONF_H_ |
| 30 | |
| 31 | /* |
| 32 | * $Id: metconf.h,v 1.7 2014/10/13 08:52:35 j_novak Exp $ |
| 33 | * $Log: metconf.h,v $ |
| 34 | * Revision 1.7 2014/10/13 08:52:35 j_novak |
| 35 | * Lorene classes and functions now belong to the namespace Lorene. |
| 36 | * |
| 37 | * Revision 1.6 2003/03/03 19:09:44 f_limousin |
| 38 | * Add a constructor from a tensor and a metric. |
| 39 | * |
| 40 | * Revision 1.5 2002/12/09 09:51:02 f_limousin |
| 41 | * |
| 42 | * Added some Doc++ comments |
| 43 | * |
| 44 | * Revision 1.4 2002/10/16 14:36:29 j_novak |
| 45 | * Reorganization of #include instructions of standard C++, in order to |
| 46 | * use experimental version 3 of gcc. |
| 47 | * |
| 48 | * Revision 1.3 2002/09/11 08:50:56 j_novak |
| 49 | * Modifs. des commentaires |
| 50 | * |
| 51 | * Revision 1.2 2002/08/13 08:02:45 j_novak |
| 52 | * Handling of spherical vector/tensor components added in the classes |
| 53 | * Mg3d and Tenseur. Minor corrections for the class Metconf. |
| 54 | * |
| 55 | * Revision 1.1 2002/08/09 15:41:08 j_novak |
| 56 | * New class Metconf added for conformal metric handling. |
| 57 | * |
| 58 | * |
| 59 | * $Header: /cvsroot/Lorene/C++/Include/metconf.h,v 1.7 2014/10/13 08:52:35 j_novak Exp $ |
| 60 | * |
| 61 | */ |
| 62 | |
| 63 | // Headers Lorene |
| 64 | #include "metrique.h" |
| 65 | |
| 66 | namespace Lorene { |
| 67 | /** |
| 68 | * Pseudo-metric handling. |
| 69 | * |
| 70 | * This class is used to described 3-dimensionnal pseudo-metrics |
| 71 | * $\tilde{\gamma}_{ij} = \gamma^{-1/3}\gamma_{ij}$, with $\gamma_{ij}$ |
| 72 | * being a usual 3-metric. Thus the covariant representation is a tensor |
| 73 | * density of weight -2/3 and the contravariant a 2/3 one. |
| 74 | * It is a child class of {\tt Metrique} and |
| 75 | * includes a dynamical calculation of the Christoffel symbols, |
| 76 | * the Ricci-curvature and the Ricci-scalar. |
| 77 | * |
| 78 | * @version #$Id: metconf.h,v 1.7 2014/10/13 08:52:35 j_novak Exp $# |
| 79 | */ |
| 80 | class Metconf: public Metrique { |
| 81 | |
| 82 | // Data : |
| 83 | // ----- |
| 84 | protected: |
| 85 | /// Pointer on the physical 3-metric |
| 86 | const Metrique* gamij ; |
| 87 | |
| 88 | /// Pointer on the flat 3-metric |
| 89 | const Metrique* fij ; |
| 90 | |
| 91 | /// Flag for Dirac gauge |
| 92 | bool dirac ; |
| 93 | |
| 94 | // Derived data : |
| 95 | // ------------ |
| 96 | /** |
| 97 | * Pointer on the $\Delta^i_{jk}$'s |
| 98 | */ |
| 99 | mutable Tenseur_sym* p_delta ; |
| 100 | |
| 101 | /** |
| 102 | * Pointer on the divergence |
| 103 | */ |
| 104 | mutable Tenseur* p_Hi ; |
| 105 | |
| 106 | // Constructors - Destructor : |
| 107 | // ------------------------- |
| 108 | public: |
| 109 | /** Standard constructor. |
| 110 | * Nothing is allocated but {\tt dependances}. |
| 111 | */ |
| 112 | explicit Metconf (const Map&, const Metrique& metric, |
| 113 | const Metrique& metplat, bool jauge = false, |
| 114 | bool plate = false) ; |
| 115 | |
| 116 | Metconf (const Metconf&) ; /// Constructor by copy. |
| 117 | |
| 118 | /** Constructor from a {\tt Tenseur\_sym} of {\tt valence} = 2. |
| 119 | * One representation is allocated depending on the |
| 120 | * type of {\tt source}. |
| 121 | */ |
| 122 | Metconf (const Tenseur_sym& source, const Metrique& metplat, |
| 123 | bool jauge = false, bool plate = false) ; |
| 124 | |
| 125 | /** Constructor from a {\tt Tenseur\_sym} of {\tt valence} = 2 |
| 126 | * and a metric. |
| 127 | * One representation is allocated depending on the |
| 128 | * type of {\tt source}. |
| 129 | */ |
| 130 | Metconf (const Tenseur_sym& source, const Metrique& metric, |
| 131 | const Metrique& metplat, bool jauge = false, |
| 132 | bool plate = false) ; |
| 133 | |
| 134 | /** Constructor from a file (see {\tt sauve(FILE* )}). |
| 135 | * |
| 136 | * @param map the mapping |
| 137 | * @param triad_i vectorial basis (triad) with respect to which |
| 138 | * the tensor components are defined. It will |
| 139 | * be checked that it coincides with the basis |
| 140 | * saved in the file. |
| 141 | * @param fich file which has been created by |
| 142 | * the function {\tt sauve(FILE* )}. |
| 143 | */ |
| 144 | Metconf(const Map& map, const Base_vect& triad_i, const Metrique& |
| 145 | metric, const Metrique& metplat, FILE* fich) ; |
| 146 | |
| 147 | virtual ~Metconf() ; /// Destructor |
| 148 | |
| 149 | // Memory management |
| 150 | // ----------------- |
| 151 | protected: |
| 152 | virtual void del_deriv() ; /// Logical destructor of the derivative members. |
| 153 | |
| 154 | /** |
| 155 | * Sets all the pointer on the derivative members to zero. |
| 156 | */ |
| 157 | virtual void set_der_0x0() ; |
| 158 | |
| 159 | // Mutators / assignment |
| 160 | // --------------------- |
| 161 | public: |
| 162 | ///Assignment from another {\tt Metconf}. |
| 163 | void operator= (const Metconf&) ; |
| 164 | |
| 165 | /** |
| 166 | * Assignment from a {\tt Tenseur\_sym} of {\tt valence =2}. |
| 167 | * The allocated representation depends on the type of {\tt t}. |
| 168 | * All the other members are deleted. |
| 169 | */ |
| 170 | virtual void operator= (const Tenseur_sym& t) ; |
| 171 | |
| 172 | // Accessors |
| 173 | // --------- |
| 174 | public: |
| 175 | const Tenseur_sym& delta() const ; ///Returns $\Delta^i_{jk}$ |
| 176 | ///Returns the divergence of {\it this}, using the flat metric. |
| 177 | const Tenseur& Hi() const ; |
| 178 | /// Returns a pointer on the flat metric. |
| 179 | const Metrique* get_fij() const{return fij ; } ; |
| 180 | ///Is the metric in the Dirac gauge? |
| 181 | bool dirac_gauge() const {return dirac;} ; |
| 182 | void set_dirac_gauge(bool gauge) ; ///Sets the dirac flag |
| 183 | void set_flat_metric(const Metrique& flat) ; ///Sets the flat metric |
| 184 | |
| 185 | // Outputs |
| 186 | // ------- |
| 187 | public: |
| 188 | virtual void sauve(FILE *) const ; /// Save in a file |
| 189 | |
| 190 | // Computation of derived members |
| 191 | // ------------------------------ |
| 192 | protected: |
| 193 | /** |
| 194 | * Calculates, if needed, the $\Delta^i_{jk}$. |
| 195 | * The result is in {\tt *p\_delta}. |
| 196 | */ |
| 197 | void fait_delta() const ; |
| 198 | |
| 199 | /** |
| 200 | * Calculates, if needed, the divergence of the pseudo metric. |
| 201 | * The result is in {\tt *p\_Hi}. |
| 202 | */ |
| 203 | void fait_Hi() const ; |
| 204 | |
| 205 | /** |
| 206 | * Calculates, if needed, the Christoffel symbols. |
| 207 | * The result is in {\tt *p\_gamma}. |
| 208 | */ |
| 209 | virtual void fait_gamma() const ; |
| 210 | |
| 211 | /** |
| 212 | * Calculates, if needed, the Ricci-curvature. |
| 213 | * The result is in {\tt *p\_ricci}. |
| 214 | */ |
| 215 | virtual void fait_ricci() const ; |
| 216 | |
| 217 | /** |
| 218 | * Calculates, if needed, the Ricci-scalar. |
| 219 | * The result is in {\tt *p\_ricci\_scal}. |
| 220 | */ |
| 221 | virtual void fait_ricci_scal() const ; |
| 222 | |
| 223 | /** |
| 224 | * The determinant is always one for the conformal metric. |
| 225 | * This result is in {\tt *p\_determinant}. |
| 226 | */ |
| 227 | virtual void fait_determinant() const ; |
| 228 | |
| 229 | // Friend classes |
| 230 | // --------------- |
| 231 | |
| 232 | friend class Tenseur ; /// Friend class {\tt Tenseur}. |
| 233 | |
| 234 | }; |
| 235 | |
| 236 | } |
| 237 | #endif |