metric.h
/*
* 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 {
class Metric {
// Data :
// -----
protected:
const Map* const mp ;
mutable Sym_tensor* p_met_cov ;
mutable Sym_tensor* p_met_con ;
// Derived data :
// ------------
protected:
mutable Connection* p_connect ;
mutable Scalar* p_ricci_scal ;
mutable Vector* p_radial_vect ;
mutable Scalar* p_determinant ;
mutable const Tensor* tensor_depend[N_TENSOR_DEPEND] ;
// Constructors - Destructor
// -------------------------
public:
explicit Metric(const Sym_tensor& tens) ;
Metric(const Metric& met) ;
Metric(const Map&, FILE* ) ;
protected:
explicit Metric(const Map& mpi) ;
public:
virtual ~Metric() ;
// Memory management
// -----------------
protected:
void del_deriv() const ;
void set_der_0x0() const ;
void del_tensor_depend() const ;
void set_tensor_depend_0x0() const ;
// Mutators / assignment
// ---------------------
public:
void operator=(const Metric& met) ;
virtual void operator=(const Sym_tensor& tens) ;
// Accessors
// ---------
public:
const Map& get_mp() const {return *mp ; } ;
virtual const Sym_tensor& cov() const ;
virtual const Sym_tensor& con() const ;
virtual const Connection& connect() const ;
const Sym_tensor& ricci() const ;
virtual const Scalar& ricci_scal() const ;
virtual const Vector& radial_vect() const ;
virtual const Scalar& determinant() const ;
// Outputs
// -------
public:
virtual void sauve(FILE *) const ;
friend ostream& operator<<(ostream& , const Metric& ) ;
protected:
virtual ostream& operator>>(ostream& ) const ;
friend class Tensor ;
};
class Metric_flat: public Metric {
// Data :
// -----
protected:
const Base_vect* triad ;
// Constructors - Destructor
// -------------------------
public:
Metric_flat(const Map&, const Base_vect& ) ;
Metric_flat(const Metric_flat& ) ;
Metric_flat(const Map&, FILE* ) ;
public:
virtual ~Metric_flat() ;
// Mutators / assignment
// ---------------------
public:
void operator=(const Metric_flat&) ;
virtual void operator=(const Sym_tensor& tens) ;
// Accessors
// ---------
public:
const Base_vect* get_triad() const {return triad;} ;
virtual const Sym_tensor& cov() const ;
virtual const Sym_tensor& con() const ;
virtual const Connection& connect() const ;
virtual const Scalar& ricci_scal() const ;
virtual const Scalar& determinant() const ;
// Outputs
// -------
public:
virtual void sauve(FILE *) const ;
protected:
virtual ostream& operator>>(ostream& ) const ;
};
}
#endif
Lorene::Base_vect
Vectorial bases (triads) with respect to which the tensorial components are defined.
Definition base_vect.h:105
Lorene::Connection
Class Connection.
Definition connection.h:113
Lorene::Metric_flat::connect
virtual const Connection & connect() const
Returns the connection.
Definition metric_flat.C:175
Lorene::Metric_flat::~Metric_flat
virtual ~Metric_flat()
Destructor.
Definition metric_flat.C:103
Lorene::Metric_flat::Metric_flat
Metric_flat(const Map &, const Base_vect &)
Standard constructor.
Definition metric_flat.C:76
Lorene::Metric_flat::ricci_scal
virtual const Scalar & ricci_scal() const
Returns the Ricci scalar.
Definition metric_flat.C:201
Lorene::Metric_flat::get_triad
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the metric is defined.
Definition metric.h:309
Lorene::Metric_flat::con
virtual const Sym_tensor & con() const
Read-only access to the contravariant representation.
Definition metric_flat.C:153
Lorene::Metric_flat::cov
virtual const Sym_tensor & cov() const
Read-only access to the covariant representation.
Definition metric_flat.C:134
Lorene::Metric_flat::sauve
virtual void sauve(FILE *) const
Save in a file.
Definition metric_flat.C:231
Lorene::Metric_flat::operator=
void operator=(const Metric_flat &)
Assignment to another Metric_flat.
Definition metric_flat.C:112
Lorene::Metric_flat::triad
const Base_vect * triad
Vectorial basis (triad) with respect to which the components of the flat metric are defined.
Definition metric.h:270
Lorene::Metric_flat::operator>>
virtual ostream & operator>>(ostream &) const
Operator >> (virtual function called by the operator <<).
Definition metric_flat.C:241
Lorene::Metric_flat::determinant
virtual const Scalar & determinant() const
Returns the determinant.
Definition metric_flat.C:214
Lorene::Metric
Metric for tensor calculation.
Definition metric.h:90
Lorene::Metric::del_tensor_depend
void del_tensor_depend() const
Deletes all the derivative members of the Tensor contained in tensor_depend .
Definition metric.C:197
Lorene::Metric::del_deriv
void del_deriv() const
Deletes all the derived quantities.
Definition metric.C:176
Lorene::Metric::~Metric
virtual ~Metric()
Destructor.
Definition metric.C:160
Lorene::Metric::con
virtual const Sym_tensor & con() const
Read-only access to the contravariant representation.
Definition metric.C:290
Lorene::Metric::radial_vect
virtual const Vector & radial_vect() const
Returns the radial vector normal to a spherical slicing and pointing toward spatial infinity.
Definition metric.C:362
Lorene::Metric::Metric
Metric(const Sym_tensor &tens)
Standard constructor from a Sym_tensor .
Definition metric.C:104
Lorene::Metric::mp
const Map *const mp
Reference mapping.
Definition metric.h:95
Lorene::Metric::get_mp
const Map & get_mp() const
Returns the mapping.
Definition metric.h:202
Lorene::Metric::cov
virtual const Sym_tensor & cov() const
Read-only access to the covariant representation.
Definition metric.C:280
Lorene::Metric::set_tensor_depend_0x0
void set_tensor_depend_0x0() const
Sets all elements of tensor_depend to 0x0.
Definition metric.C:208
Lorene::Metric::set_der_0x0
void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
Definition metric.C:188
Lorene::Metric::ricci
const Sym_tensor & ricci() const
Returns the Ricci tensor (given by the Connection p_connect ).
Definition metric.C:338
Lorene::Metric::p_met_con
Sym_tensor * p_met_con
Pointer on the covariant representation.
Definition metric.h:105
Lorene::Metric::p_radial_vect
Vector * p_radial_vect
Pointer to the radial vector normal to a spherical slicing and pointing toward spatial infinity.
Definition metric.h:125
Lorene::Metric::connect
virtual const Connection & connect() const
Returns the connection.
Definition metric.C:301
Lorene::Metric::determinant
virtual const Scalar & determinant() const
Returns the determinant.
Definition metric.C:392
Lorene::Metric::p_met_cov
Sym_tensor * p_met_cov
Pointer on the contravariant representation.
Definition metric.h:100
Lorene::Metric::operator>>
virtual ostream & operator>>(ostream &) const
Operator >> (virtual function called by the operator <<).
Definition metric.C:446
Lorene::Metric::p_determinant
Scalar * p_determinant
Pointer on the determinant.
Definition metric.h:132
Lorene::Metric::ricci_scal
virtual const Scalar & ricci_scal() const
Returns the Ricci scalar.
Definition metric.C:350
Lorene::Metric::operator<<
friend ostream & operator<<(ostream &, const Metric &)
Display.
Definition metric.C:439
Lorene::Metric::operator=
void operator=(const Metric &met)
Assignment to another Metric.
Definition metric.C:220
Lorene::Metric::sauve
virtual void sauve(FILE *) const
Save in a file.
Definition metric.C:414
Lorene::Metric::tensor_depend
const Tensor * tensor_depend[N_TENSOR_DEPEND]
Pointer on the dependancies, that means the array contains pointers on all the Tensor whom derivative...
Definition metric.h:139
Lorene::Metric::p_ricci_scal
Scalar * p_ricci_scal
Pointer on the Ricci scalar.
Definition metric.h:119
Lorene::Metric::p_connect
Connection * p_connect
Connection associated with the metric.
Definition metric.h:112
Lorene::Scalar
Tensor field of valence 0 (or component of a tensorial field).
Definition scalar.h:387
Lorene::Sym_tensor
Class intended to describe valence-2 symmetric tensors.
Definition sym_tensor.h:223
Lorene::Tensor
Tensor handling.
Definition tensor.h:288
Lorene::Vector
Tensor field of valence 1.
Definition vector.h:188
Lorene
Lorene prototypes.
Definition app_hor.h:64
Lorene::Map
Map(const Mg3d &)
Constructor from a multi-domain 3D grid.
Definition map.C:139