/usr/include/lorene/C++/Include/metrique.h is in liblorene-dev 0.0.0~cvs20161116+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 | /*
* Definition of Lorene class Metrique
*
*/
/*
* Copyright (c) 1999-2001 Philippe Grandclement
* Copyright (c) 2002 Jerome Novak
*
* This file is part of LORENE.
*
* LORENE is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* LORENE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LORENE; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef __METRIQUE_H_
#define __METRIQUE_H_
/*
* $Id: metrique.h,v 1.14 2014/10/13 08:52:35 j_novak Exp $
* $Log: metrique.h,v $
* Revision 1.14 2014/10/13 08:52:35 j_novak
* Lorene classes and functions now belong to the namespace Lorene.
*
* Revision 1.13 2003/10/17 13:04:18 f_limousin
* Add new functions get_cov() and get_con().
*
* Revision 1.12 2003/06/20 14:22:20 f_limousin
* The functions set_con() and set_cov() now returns a Tenseur&.
*
* Revision 1.11 2003/03/03 19:13:46 f_limousin
* Add two new methods : set_con() and set_cov().
*
* Revision 1.10 2003/02/12 18:30:18 f_limousin
* Added set_cov and set_con methods
*
* Revision 1.9 2003/02/07 15:41:46 e_gourgoulhon
*
* ### Added a PROVISORY set_cov method ###
*
* Revision 1.8 2002/10/16 14:36:29 j_novak
* Reorganization of #include instructions of standard C++, in order to
* use experimental version 3 of gcc.
*
* Revision 1.7 2002/09/13 09:17:33 j_novak
* Modif. commentaires
*
* Revision 1.6 2002/08/09 15:41:08 j_novak
* New class Metconf added for conformal metric handling.
*
* Revision 1.5 2002/08/08 15:10:44 j_novak
* The flag "plat" has been added to the class Metrique to show flat metrics.
*
* Revision 1.4 2002/08/07 16:14:10 j_novak
* class Tenseur can now also handle tensor densities, this should be transparent to older codes
*
* Revision 1.3 2002/08/02 15:07:41 j_novak
* Member function determinant has been added to the class Metrique.
* A better handling of spectral bases is now implemented for the class Tenseur.
*
* Revision 1.2 2002/06/17 14:05:17 j_novak
* friend functions are now also declared outside the class definition
*
* Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon
* LORENE
*
* Revision 2.4 2000/02/09 19:28:54 eric
* Ajout de l'argument triad dans le constructeur par lecture de fichier.
*
* Revision 2.3 2000/01/11 11:13:45 eric
* Modif commentaires.
*
* Revision 2.2 2000/01/10 17:21:03 eric
* Modif commentaires.
*
* Revision 2.1 1999/12/07 15:24:50 phil
* ajout include
*
* Revision 2.0 1999/12/02 17:15:40 phil
* *** empty log message ***
*
* Revision 1.1 1999/12/02 17:13:23 phil
* Initial revision
*
*
* $Header: /cvsroot/Lorene/C++/Include/metrique.h,v 1.14 2014/10/13 08:52:35 j_novak Exp $
*
*/
// Headers Lorene
#include "tenseur.h"
#define N_DEPEND 200
namespace Lorene {
/**
* Metric handling.
*
* This class is used to described 3-dimensionnal metrics.
*
* This class includes a dynamical calculation of the Christoffel symbols,
* the Ricci-curvature and the Ricci-scalar.
*
* @version #$Id: metrique.h,v 1.14 2014/10/13 08:52:35 j_novak Exp $#
*/
class Metrique {
// Data :
// -----
protected:
const Map* const mp ; /// Reference mapping.
int etat ; ///Logical state {\tt (ETATZERO, ETATQCQ or ETATNONDEF)}
bool plat ; ///Flag for a flat metric
/**
* Pointer on the contravariant representation.
*/
mutable Tenseur_sym* p_met_con ;
/**
* Pointer on the covariant representation.
*/
mutable Tenseur_sym* p_met_cov ;
// Derived data :
// ------------
/**
* Pointer on the Christoffel symbols.
*/
mutable Tenseur_sym* p_gamma ;
/**
* Pointer on the Ricci curvature.
*/
mutable Tenseur_sym* p_ricci ;
/**
* Pointer on the Ricci scalar.
*/
mutable Tenseur* p_ricci_scal ;
/**
* Pointer on the determinant.
*/
mutable Tenseur* p_determinant ;
/**
* Pointer on the dependancies, that means the array contains pointers
* on all the {\tt Tenseur} whom derivative members have been calculated
* using {\tt *this}.
*/
const Tenseur** dependances ;
// Constructors - Destructor :
// -------------------------
public:
/** Standard constructor.
* Nothing is allocated but {\tt dependances}.
* By default, the {\tt Metrique} is not flat.
*/
explicit Metrique (const Map&, bool plate = false) ;
Metrique (const Metrique&) ; /// Constructor by copy.
/** Constructor from a {\tt Tenseur\_sym} of {\tt valence} = 2.
* One representation is allocated depending on the
* type of {\tt source}. By default, the {\tt Metrique} is not flat.
*/
explicit Metrique (const Tenseur_sym& source, bool plate = false) ;
/** Constructor from a file (see {\tt sauve(FILE* )}).
*
* @param map the mapping
* @param triad_i vectorial basis (triad) with respect to which
* the tensor components are defined. It will
* be checked that it coincides with the basis
* saved in the file.
* @param fich file which has been created by
* the function {\tt sauve(FILE* )}.
*/
Metrique(const Map& map, const Base_vect& triad_i, FILE* fich) ;
virtual ~Metrique() ; /// Destructor
// Memory management
// -----------------
protected:
void del_t() ; /// Logical destructor
virtual void del_deriv() ; /// Logical destructor of the derivative members.
/**
* Sets all the pointer on the derivative members to zero.
*/
virtual void set_der_0x0() ;
/**
* Delete all the derivative members of the {\tt Tenseur} contained in
* {\tt dependances}. Those quantities had been previously
* calculated using {\tt *this}.
*/
void del_dependances() ;
// Mutators / assignment
// ---------------------
public:
/**
* Sets the logical state to {\tt ETATNONDEF} (undefined state).
* Everything is deallocated.
*/
void set_etat_nondef() ;
/**
* Sets the logical state to {\tt ETATZERO} (zero state).
* Everything is deallocated.
*/
void set_etat_zero() ;
/**
* Sets the logical state to {\tt ETATQCQ} (ordinary state).
* The contravariant representation is allocated.
*/
void set_etat_con_qcq() ;
/**
* Sets the logical state to {\tt ETATQCQ} (ordinary state).
* The covariant representation is allocated.
*/
void set_etat_cov_qcq() ;
///Assignment from another {\tt Metrique}.
void operator= (const Metrique&) ;
/**
* Assignment from a {\tt Tenseur\_sym} of {\tt valence =2}.
* The allocated representation depends on the type of {\tt t}.
* All the other members are deleted.
*/
virtual void operator= (const Tenseur_sym& t) ;
/**
* Set the standard spectral basis on the allocated representations.
*/
void set_std_base() ;
/// Sets a component (covariant representation)
Cmp& set_cov(int i, int j) ;
/// Sets a component (contravariant representation)
Cmp& set_con(int i, int j) ;
/// Gets a component (covariant representation)
const Cmp& get_cov(int i, int j) const ;
/// Gets a component (contravariant representation)
const Cmp& get_con(int i, int j) const ;
/// Sets the covariant representation of the metric.
Tenseur_sym& set_cov() ;
/// Sets the contravariant representation of the metric.
Tenseur_sym& set_con() ;
/// Gets the covariant representation of the metric.
const Tenseur_sym& get_cov() const ;
/// Gets the contravariant representation of the metric.
const Tenseur_sym& get_con() const ;
// Accessors
// ---------
public:
/// Returns the contravariant representation.
const Tenseur_sym& con() const ;
/// Returns the covariant representation.
const Tenseur_sym& cov() const ;
/// Returns the Christoffel symbols.
const Tenseur_sym& gamma() const ;
/// Returns the Ricci-curvature.
const Tenseur_sym& ricci() const ;
/// Returns the Ricci-scalar.
const Tenseur& ricci_scal() const ;
/// Returns the determinant.
const Tenseur& determinant() const ;
/// Returns a pointer on the mapping.
const Map* get_mp() const{return mp ; } ;
int get_etat() const{return etat ;} ; /// Returns the logical state.
bool is_flat() const {return plat;} ; ///Is the metric a flat one?
void set_flat(bool plate) {plat = plate;} ;///Sets the flat flag
// Outputs
// -------
public:
virtual void sauve(FILE *) const ; /// Save in a file
friend ostream& operator<<(ostream& , const Metrique & ) ; /// Display.
// Computation of derived members
// ------------------------------
protected:
/**
* Calculates, if needed, the contravariant representation.
* The result is in {\tt *p\_met\_con}.
*/
void fait_con() const ;
/**
* Calculates, if needed, the covariant representation.
* The result is in {\tt *p\_met\_cov}.
*/
void fait_cov() const ;
/**
* Calculates, if needed, the Christoffel symbols.
* The result is in {\tt *p\_gamma}.
*/
virtual void fait_gamma() const ;
/**
* Calculates, if needed, the Ricci-curvature.
* The result is in {\tt *p\_ricci}.
*/
virtual void fait_ricci() const ;
/**
* Calculates, if needed, the Ricci-scalar.
* The result is in {\tt *p\_ricci\_scal}.
*/
virtual void fait_ricci_scal() const ;
/**
* Calculates, if needed, the determinant.
* The result is in {\tt *p\_determinant}.
*/
virtual void fait_determinant() const ;
// Friend classes
// ---------------
friend class Tenseur ; /// Friend class {\tt Tenseur}.
};
ostream& operator<<(ostream& , const Metrique & ) ;
/**
* @name Utilities for {\tt Metrique}
*/
//@{
/**
* Calculates the inverse of {\tt t}, being a {\tt Tenseur\_sym}
* of {\tt valence} = 2.
*/
Tenseur_sym fait_inverse (const Tenseur_sym& t) ;
//@}
}
#endif
|