28char metric_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Metric/metric.C,v 1.13 2014/10/13 08:53:07 j_novak Exp $" ;
97#include "utilitaires.h"
111 if (type_index == COV) {
115 assert(type_index == CON) ;
142 cout <<
"Metric::Metric(FILE*) : not implemented yet!" << endl ;
199 for (
int i=0 ; i<N_TENSOR_DEPEND ; i++)
210 for (
int i=0 ; i<N_TENSOR_DEPEND ; i++) {
222 assert(
mp == meti.
mp) ;
263 if (type_index == COV) {
267 assert(type_index == CON) ;
323 if ( triad_s != 0x0 ) {
327 assert( triad_c != 0x0 ) ;
344 assert(
typeid(ricci_connect) ==
typeid(
const Sym_tensor&) ) ;
346 return dynamic_cast<const Sym_tensor&
>( ricci_connect ) ;
439ostream& operator<<(ostream& ost,
const Metric& meti) {
450 ost <<
"General type metric" <<
'\n' ;
451 ost <<
"-------------------" <<
'\n' ;
455 ost <<
"Covariant representation unknown!" <<
'\n' ;
457 ost <<
"CONTRA-variant representation: " <<
'\n' ;
461 ost <<
"Covariant representation: " <<
'\n' ;
467 ost <<
"Associated connection not computed yet." <<
'\n' ;
469 ost <<
"Associated connection computed." <<
'\n' ;
472 ost <<
"Ricci scalar not computed yet." <<
'\n' ;
474 ost <<
"Ricci scalar computed." <<
'\n' ;
477 ost <<
"determinant not computed yet." <<
'\n' ;
479 ost <<
"determinant computed." <<
'\n' ;
Cartesian vectorial bases (triads).
Spherical orthonormal vectorial bases (triads).
virtual const Tensor & ricci() const
Computes (if not up to date) and returns the Ricci tensor associated with the current connection.
Base class for coordinate mappings.
const Metric_flat & flat_met_cart() const
Returns the flat metric associated with the Cartesian coordinates and with components expressed in th...
const Metric_flat & flat_met_spher() const
Returns the flat metric associated with the spherical coordinates and with components expressed in th...
Metric for tensor calculation.
void del_tensor_depend() const
Deletes all the derivative members of the Tensor contained in tensor_depend .
void del_deriv() const
Deletes all the derived quantities.
virtual ~Metric()
Destructor.
virtual const Sym_tensor & con() const
Read-only access to the contravariant representation.
virtual const Vector & radial_vect() const
Returns the radial vector normal to a spherical slicing and pointing toward spatial infinity.
Metric(const Sym_tensor &tens)
Standard constructor from a Sym_tensor .
const Map *const mp
Reference mapping.
virtual const Sym_tensor & cov() const
Read-only access to the covariant representation.
void set_tensor_depend_0x0() const
Sets all elements of tensor_depend to 0x0.
void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
const Sym_tensor & ricci() const
Returns the Ricci tensor (given by the Connection p_connect )
Sym_tensor * p_met_con
Pointer on the covariant representation.
Vector * p_radial_vect
Pointer to the radial vector normal to a spherical slicing and pointing toward spatial infinity.
virtual const Connection & connect() const
Returns the connection.
virtual const Scalar & determinant() const
Returns the determinant.
Sym_tensor * p_met_cov
Pointer on the contravariant representation.
virtual ostream & operator>>(ostream &) const
Operator >> (virtual function called by the operator <<).
Scalar * p_determinant
Pointer on the determinant.
virtual const Scalar & ricci_scal() const
Returns the Ricci scalar.
void operator=(const Metric &met)
Assignment to another Metric.
virtual void sauve(FILE *) const
Save in a file.
const Tensor * tensor_depend[N_TENSOR_DEPEND]
Pointer on the dependancies, that means the array contains pointers on all the Tensor whom derivative...
Scalar * p_ricci_scal
Pointer on the Ricci scalar.
Connection * p_connect
Connection associated with the metric.
Tensor field of valence 0 (or component of a tensorial field).
virtual void std_spectral_base()
Sets the spectral bases of the Valeur va to the standard ones for a scalar field.
Class intended to describe valence-2 symmetric tensors.
Sym_tensor * inverse() const
Returns a pointer on the inverse of the Sym_tensor (seen as a matrix).
Tensor field of valence 1.
Scalar & set(int)
Read/write access to a component.
Cmp sqrt(const Cmp &)
Square root.
int fwrite_be(const int *aa, int size, int nb, FILE *fich)
Writes integer(s) into a binary file according to the big endian convention.
const Map & get_mp() const
Returns the mapping.
virtual void del_derive_met(int) const
Logical destructor of the derivatives depending on the i-th element of met_depend .
int get_index_type(int i) const
Gives the type (covariant or contravariant) of the index number i .
int get_place_met(const Metric &) const
Returns the position of the pointer on metre in the array met_depend .
virtual void sauve(FILE *) const
Save in a binary file.
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.