LORENE
Lorene::Metric Class Reference

Metric for tensor calculation. More...

#include <metric.h>

Inheritance diagram for Lorene::Metric:
Lorene::Metric_flat

Public Member Functions

 Metric (const Sym_tensor &tens)
 Standard constructor from a Sym_tensor . More...
 
 Metric (const Metric &met)
 Copy constructor. More...
 
 Metric (const Map &, FILE *)
 Constructor from a file (see sauve(FILE*) ) More...
 
virtual ~Metric ()
 Destructor. More...
 
void operator= (const Metric &met)
 Assignment to another Metric. More...
 
virtual void operator= (const Sym_tensor &tens)
 Assignment from a Sym_tensor . More...
 
const Mapget_mp () const
 Returns the mapping. More...
 
virtual const Sym_tensorcov () const
 Read-only access to the covariant representation. More...
 
virtual const Sym_tensorcon () const
 Read-only access to the contravariant representation. More...
 
virtual const Connectionconnect () const
 Returns the connection. More...
 
const Sym_tensorricci () const
 Returns the Ricci tensor (given by the Connection
p_connect ) More...
 
virtual const Scalarricci_scal () const
 Returns the Ricci scalar. More...
 
virtual const Vectorradial_vect () const
 Returns the radial vector normal to a spherical slicing and pointing toward spatial infinity. More...
 
virtual const Scalardeterminant () const
 Returns the determinant. More...
 
virtual void sauve (FILE *) const
 Save in a file. More...
 

Protected Member Functions

 Metric (const Map &mpi)
 Simplified constructor used by derived classes. More...
 
void del_deriv () const
 Deletes all the derived quantities. More...
 
void set_der_0x0 () const
 Sets to 0x0 all the pointers on derived quantities. More...
 
void del_tensor_depend () const
 Deletes all the derivative members of the Tensor contained in tensor_depend . More...
 
void set_tensor_depend_0x0 () const
 Sets all elements of tensor_depend to 0x0. More...
 
virtual ostream & operator>> (ostream &) const
 Operator >> (virtual function called by the operator <<). More...
 

Protected Attributes

const Map *const mp
 Reference mapping. More...
 
Sym_tensorp_met_cov
 Pointer on the contravariant representation. More...
 
Sym_tensorp_met_con
 Pointer on the covariant representation. More...
 
Connectionp_connect
 Connection associated with the metric. More...
 
Scalarp_ricci_scal
 Pointer on the Ricci scalar. More...
 
Vectorp_radial_vect
 Pointer to the radial vector normal to a spherical slicing and pointing toward spatial infinity. More...
 
Scalarp_determinant
 Pointer on the determinant. More...
 
const Tensortensor_depend [N_TENSOR_DEPEND]
 Pointer on the dependancies, that means the array contains pointers on all the Tensor whom derivative members have been calculated using *this . More...
 

Friends

class Tensor
 
ostream & operator<< (ostream &, const Metric &)
 Display. More...
 

Detailed Description

Metric for tensor calculation.

()

Definition at line 90 of file metric.h.

Constructor & Destructor Documentation

◆ Metric() [1/4]

Lorene::Metric::Metric ( const Sym_tensor tens)
explicit

Standard constructor from a Sym_tensor .

The symmetric tensor can be either the covariant or the contravariant representation of the metric.

Definition at line 107 of file metric.C.

References Lorene::Tensor::get_index_type(), p_met_con, p_met_cov, set_der_0x0(), and set_tensor_depend_0x0().

◆ Metric() [2/4]

Lorene::Metric::Metric ( const Metric met)

Copy constructor.

Definition at line 128 of file metric.C.

References p_met_con, p_met_cov, set_der_0x0(), and set_tensor_depend_0x0().

◆ Metric() [3/4]

Lorene::Metric::Metric ( const Map mpi,
FILE *   
)

Constructor from a file (see sauve(FILE*) )

Definition at line 141 of file metric.C.

◆ Metric() [4/4]

Lorene::Metric::Metric ( const Map mpi)
explicitprotected

Simplified constructor used by derived classes.

Definition at line 150 of file metric.C.

References set_der_0x0(), and set_tensor_depend_0x0().

◆ ~Metric()

Lorene::Metric::~Metric ( )
virtual

Destructor.

Definition at line 163 of file metric.C.

References del_deriv(), del_tensor_depend(), p_met_con, and p_met_cov.

Member Function Documentation

◆ con()

const Sym_tensor & Lorene::Metric::con ( ) const
virtual

Read-only access to the contravariant representation.

Reimplemented in Lorene::Metric_flat.

Definition at line 293 of file metric.C.

References Lorene::Sym_tensor::inverse(), p_met_con, and p_met_cov.

◆ connect()

const Connection & Lorene::Metric::connect ( ) const
virtual

Returns the connection.

Reimplemented in Lorene::Metric_flat.

Definition at line 304 of file metric.C.

References Lorene::Map::flat_met_cart(), Lorene::Map::flat_met_spher(), Lorene::Tensor::get_triad(), mp, p_connect, p_met_con, and p_met_cov.

◆ cov()

const Sym_tensor & Lorene::Metric::cov ( ) const
virtual

Read-only access to the covariant representation.

Reimplemented in Lorene::Metric_flat.

Definition at line 283 of file metric.C.

References Lorene::Sym_tensor::inverse(), p_met_con, and p_met_cov.

◆ del_deriv()

void Lorene::Metric::del_deriv ( ) const
protected

Deletes all the derived quantities.

Definition at line 179 of file metric.C.

References p_connect, p_determinant, p_radial_vect, p_ricci_scal, and set_der_0x0().

◆ del_tensor_depend()

void Lorene::Metric::del_tensor_depend ( ) const
protected

Deletes all the derivative members of the Tensor contained in tensor_depend .

Those quantities had been previously calculated using *this .

Definition at line 200 of file metric.C.

References Lorene::Tensor::del_derive_met(), Lorene::Tensor::get_place_met(), set_tensor_depend_0x0(), and tensor_depend.

◆ determinant()

const Scalar & Lorene::Metric::determinant ( ) const
virtual

Returns the determinant.

This determinant is stored as a Scalar although it a scalar density. To be a real scalar it must be divided by e.g. the determinant of a flat metric.

Reimplemented in Lorene::Metric_flat.

Definition at line 395 of file metric.C.

References cov(), mp, and p_determinant.

◆ get_mp()

const Map& Lorene::Metric::get_mp ( ) const
inline

Returns the mapping.

Definition at line 202 of file metric.h.

References mp.

◆ operator=() [1/2]

void Lorene::Metric::operator= ( const Metric met)

Assignment to another Metric.

Definition at line 223 of file metric.C.

References del_deriv(), mp, p_met_con, and p_met_cov.

◆ operator=() [2/2]

void Lorene::Metric::operator= ( const Sym_tensor tens)
virtual

Assignment from a Sym_tensor .

The allocated representation depends on the type of the input tensor indices. All the other members are deleted.

Reimplemented in Lorene::Metric_flat.

Definition at line 249 of file metric.C.

References del_deriv(), Lorene::Tensor::get_index_type(), Lorene::Tensor::get_mp(), mp, p_met_con, and p_met_cov.

◆ operator>>()

ostream & Lorene::Metric::operator>> ( ostream &  ost) const
protectedvirtual

Operator >> (virtual function called by the operator <<).

Reimplemented in Lorene::Metric_flat.

Definition at line 449 of file metric.C.

References p_connect, p_determinant, p_met_con, p_met_cov, and p_ricci_scal.

◆ radial_vect()

const Vector & Lorene::Metric::radial_vect ( ) const
virtual

Returns the radial vector normal to a spherical slicing and pointing toward spatial infinity.

Definition at line 365 of file metric.C.

References p_radial_vect, Lorene::Vector::set(), Lorene::sqrt(), and Lorene::Scalar::std_spectral_base().

◆ ricci()

const Sym_tensor & Lorene::Metric::ricci ( ) const

Returns the Ricci tensor (given by the Connection
p_connect )

Definition at line 341 of file metric.C.

References connect(), and Lorene::Connection::ricci().

◆ ricci_scal()

const Scalar & Lorene::Metric::ricci_scal ( ) const
virtual

Returns the Ricci scalar.

Reimplemented in Lorene::Metric_flat.

Definition at line 353 of file metric.C.

References p_ricci_scal, and ricci().

◆ sauve()

void Lorene::Metric::sauve ( FILE *  fd) const
virtual

Save in a file.

Reimplemented in Lorene::Metric_flat.

Definition at line 417 of file metric.C.

References Lorene::fwrite_be(), p_met_con, p_met_cov, and Lorene::Tensor_sym::sauve().

◆ set_der_0x0()

void Lorene::Metric::set_der_0x0 ( ) const
protected

Sets to 0x0 all the pointers on derived quantities.

Definition at line 191 of file metric.C.

References p_connect, p_determinant, p_radial_vect, and p_ricci_scal.

◆ set_tensor_depend_0x0()

void Lorene::Metric::set_tensor_depend_0x0 ( ) const
protected

Sets all elements of tensor_depend to 0x0.

Definition at line 211 of file metric.C.

References tensor_depend.

Friends And Related Function Documentation

◆ operator<<

ostream& operator<< ( ostream &  ost,
const Metric meti 
)
friend

Display.

Definition at line 442 of file metric.C.

Member Data Documentation

◆ mp

const Map* const Lorene::Metric::mp
protected

Reference mapping.

Definition at line 95 of file metric.h.

◆ p_connect

Connection* Lorene::Metric::p_connect
mutableprotected

Connection associated with the metric.

Definition at line 112 of file metric.h.

◆ p_determinant

Scalar* Lorene::Metric::p_determinant
mutableprotected

Pointer on the determinant.

Definition at line 132 of file metric.h.

◆ p_met_con

Sym_tensor* Lorene::Metric::p_met_con
mutableprotected

Pointer on the covariant representation.

Definition at line 105 of file metric.h.

◆ p_met_cov

Sym_tensor* Lorene::Metric::p_met_cov
mutableprotected

Pointer on the contravariant representation.

Definition at line 100 of file metric.h.

◆ p_radial_vect

Vector* Lorene::Metric::p_radial_vect
mutableprotected

Pointer to the radial vector normal to a spherical slicing and pointing toward spatial infinity.

Definition at line 125 of file metric.h.

◆ p_ricci_scal

Scalar* Lorene::Metric::p_ricci_scal
mutableprotected

Pointer on the Ricci scalar.

Remark: the Ricci tensor is stored in the connection (member p_connect->p_ricci ).

Definition at line 119 of file metric.h.

◆ tensor_depend

const Tensor* Lorene::Metric::tensor_depend[N_TENSOR_DEPEND]
mutableprotected

Pointer on the dependancies, that means the array contains pointers on all the Tensor whom derivative members have been calculated using *this .

Definition at line 139 of file metric.h.


The documentation for this class was generated from the following files: