/usr/include/lorene/C++/Include/metric.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 | /*
* Definition of Lorene class Metric
*
*/
/*
* Copyright (c) 2003 Eric Gourgoulhon & Jerome Novak
*
* Copyright (c) 1999-2001 Philippe Grandclement (for previous class Metrique)
*
* 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 version 2
* as published by the Free Software Foundation.
*
* 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 __METRIC_H_
#define __METRIC_H_
/*
* $Id: metric.h,v 1.9 2014/10/13 08:52:35 j_novak Exp $
* $Log: metric.h,v $
* Revision 1.9 2014/10/13 08:52:35 j_novak
* Lorene classes and functions now belong to the namespace Lorene.
*
* Revision 1.8 2004/11/18 12:23:42 jl_jaramillo
* radial vector normal to a spherical slicing and pointing towards
* spatial infinity
*
* Revision 1.7 2004/03/22 13:12:42 j_novak
* Modification of comments to use doxygen instead of doc++
*
* Revision 1.6 2003/12/30 23:04:58 e_gourgoulhon
* Important reorganization of class Metric:
* -- suppression of virtual methods fait_* : the actual computations
* are now performed via the virtual methods con(), cov(), connect(),
* ricci(), ricci_scal(), determinant()
* -- the member p_connect is now treated as an ordinary derived data
* member
* -- the construction of the associated connection (member p_connect)
* is performed thanks to the new methods Map::flat_met_spher() and
* Map::flat_met_cart().
*
* Revision 1.5 2003/11/06 14:43:37 e_gourgoulhon
* Gave a name to const arguments in certain method prototypes (e.g.
* constructors) to correct a bug of DOC++.
*
* Revision 1.4 2003/10/06 15:30:32 j_novak
* Defined methods for flat metric.
*
* Revision 1.3 2003/10/06 13:58:45 j_novak
* The memory management has been improved.
* Implementation of the covariant derivative with respect to the exact Tensor
* type.
*
* Revision 1.2 2003/10/03 11:21:45 j_novak
* More methods for the class Metric
*
* Revision 1.1 2003/10/02 15:45:48 j_novak
* New class Metric
*
*
*
*
* $Header: /cvsroot/Lorene/C++/Include/metric.h,v 1.9 2014/10/13 08:52:35 j_novak Exp $
*
*/
// Lorene headers
#include "connection.h"
#define N_TENSOR_DEPEND 200
namespace Lorene {
/**
* Metric for tensor calculation. \ingroup (tensor)
*
*/
class Metric {
// Data :
// -----
protected:
const Map* const mp ; ///< Reference mapping.
/**
* Pointer on the contravariant representation.
*/
mutable Sym_tensor* p_met_cov ;
/**
* Pointer on the covariant representation.
*/
mutable Sym_tensor* p_met_con ;
// Derived data :
// ------------
protected:
mutable Connection* p_connect ; ///< Connection associated with the metric
/**
* Pointer on the Ricci scalar.
* Remark: the Ricci tensor is stored in the connection (member
* \c p_connect->p_ricci ).
*/
mutable Scalar* p_ricci_scal ;
/**
* Pointer to the radial vector normal to a spherical slicing and pointing
* toward spatial infinity
*/
mutable Vector* p_radial_vect ;
/**
* Pointer on the determinant.
*/
mutable Scalar* p_determinant ;
/**
* Pointer on the dependancies, that means the array contains pointers
* on all the \c Tensor whom derivative members have been calculated
* using \c *this .
*/
mutable const Tensor* tensor_depend[N_TENSOR_DEPEND] ;
// Constructors - Destructor
// -------------------------
public:
/** Standard constructor from a \c Sym_tensor .
*
* The symmetric tensor can be either the covariant or
* the contravariant representation of the metric.
*/
explicit Metric(const Sym_tensor& tens) ;
Metric(const Metric& met) ; ///< Copy constructor
/// Constructor from a file (see \c sauve(FILE*) )
Metric(const Map&, FILE* ) ;
protected:
/// Simplified constructor used by derived classes.
explicit Metric(const Map& mpi) ;
public:
virtual ~Metric() ; ///< Destructor
// Memory management
// -----------------
protected:
/// Deletes all the derived quantities
void del_deriv() const ;
/// Sets to \c 0x0 all the pointers on derived quantities
void set_der_0x0() const ;
/**
* Deletes all the derivative members of the \c Tensor contained in
* \c tensor_depend . Those quantities had been previously
* calculated using \c *this .
*/
void del_tensor_depend() const ;
///Sets all elements of \c tensor_depend to 0x0.
void set_tensor_depend_0x0() const ;
// Mutators / assignment
// ---------------------
public:
/// Assignment to another Metric
void operator=(const Metric& met) ;
/**
* Assignment from a \c Sym_tensor .
* The allocated representation depends on the type of the
* input tensor indices.
* All the other members are deleted.
*/
virtual void operator=(const Sym_tensor& tens) ;
// Accessors
// ---------
public:
/// Returns the mapping
const Map& get_mp() const {return *mp ; } ;
/// Read-only access to the covariant representation
virtual const Sym_tensor& cov() const ;
/// Read-only access to the contravariant representation
virtual const Sym_tensor& con() const ;
/// Returns the connection
virtual const Connection& connect() const ;
/** Returns the Ricci tensor (given by the \c Connection
* \c p_connect )
*/
const Sym_tensor& ricci() const ;
/// Returns the Ricci scalar
virtual const Scalar& ricci_scal() const ;
/** Returns the radial vector normal to a spherical slicing and pointing
* toward spatial infinity
*/
virtual const Vector& radial_vect() const ;
/**Returns the determinant.
*
* This determinant is stored as a \c Scalar although it
* a scalar density. To be a real scalar it must be divided
* by e.g. the determinant of a flat metric.
*/
virtual const Scalar& determinant() const ;
// Outputs
// -------
public:
virtual void sauve(FILE *) const ; ///< Save in a file
/// Display
friend ostream& operator<<(ostream& , const Metric& ) ;
protected:
/// Operator >> (virtual function called by the operator <<).
virtual ostream& operator>>(ostream& ) const ;
friend class Tensor ;
};
/**
* Flat metric for tensor calculation.\ingroup (tensor)
*
*/
class Metric_flat: public Metric {
// Data :
// -----
protected:
/** Vectorial basis (triad) with respect to which the components of
* the flat metric are defined.
*/
const Base_vect* triad ;
// Constructors - Destructor
// -------------------------
public:
/** Standard constructor.
*
* Standard constructor from a mapping and a triad.
*/
Metric_flat(const Map&, const Base_vect& ) ;
Metric_flat(const Metric_flat& ) ; ///< Copy constructor
/// Constructor from a file (see \c sauve(FILE*) )
Metric_flat(const Map&, FILE* ) ;
public:
virtual ~Metric_flat() ; ///< Destructor
// Mutators / assignment
// ---------------------
public:
/// Assignment to another Metric_flat
void operator=(const Metric_flat&) ;
/**
* Assignment from a \c Sym_tensor .
* In principle, this method should not be used for a \c Metric_flat .
*/
virtual void operator=(const Sym_tensor& tens) ;
// Accessors
// ---------
public:
/** Returns the vectorial basis (triad) on which the metric
* is defined.
*/
const Base_vect* get_triad() const {return triad;} ;
/// Read-only access to the covariant representation
virtual const Sym_tensor& cov() const ;
/// Read-only access to the contravariant representation
virtual const Sym_tensor& con() const ;
/// Returns the connection
virtual const Connection& connect() const ;
/// Returns the Ricci scalar
virtual const Scalar& ricci_scal() const ;
/**Returns the determinant.
*
* This determinant is stored as a \c Scalar although it
* a scalar density. To be a real scalar it must be divided
* by e.g. the determinant of a flat metric.
*/
virtual const Scalar& determinant() const ;
// Outputs
// -------
public:
virtual void sauve(FILE *) const ; ///< Save in a file
protected:
/// Operator >> (virtual function called by the operator <<).
virtual ostream& operator>>(ostream& ) const ;
};
}
#endif
|