100 #include "utilitaires.h" 114 if (type_index == COV) {
118 assert(type_index == CON) ;
145 cout <<
"Metric::Metric(FILE*) : not implemented yet!" << endl ;
202 for (
int i=0 ; i<N_TENSOR_DEPEND ; i++)
213 for (
int i=0 ; i<N_TENSOR_DEPEND ; i++) {
225 assert(
mp == meti.
mp) ;
266 if (type_index == COV) {
270 assert(type_index == CON) ;
326 if ( triad_s != 0x0 ) {
330 assert( triad_c != 0x0 ) ;
347 assert(
typeid(ricci_connect) ==
typeid(
const Sym_tensor&) ) ;
349 return dynamic_cast<const Sym_tensor&
>( ricci_connect ) ;
442 ostream& operator<<(ostream& ost,
const Metric& meti) {
453 ost <<
"General type metric" <<
'\n' ;
454 ost <<
"-------------------" <<
'\n' ;
458 ost <<
"Covariant representation unknown!" <<
'\n' ;
460 ost <<
"CONTRA-variant representation: " <<
'\n' ;
464 ost <<
"Covariant representation: " <<
'\n' ;
470 ost <<
"Associated connection not computed yet." <<
'\n' ;
472 ost <<
"Associated connection computed." <<
'\n' ;
475 ost <<
"Ricci scalar not computed yet." <<
'\n' ;
477 ost <<
"Ricci scalar computed." <<
'\n' ;
480 ost <<
"determinant not computed yet." <<
'\n' ;
482 ost <<
"determinant computed." <<
'\n' ;
Metric for tensor calculation.
virtual void sauve(FILE *) const
Save in a binary file.
virtual const Sym_tensor & con() const
Read-only access to the contravariant representation.
void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
virtual const Tensor & ricci() const
Computes (if not up to date) and returns the Ricci tensor associated with the current connection...
Cmp sqrt(const Cmp &)
Square root.
const Map *const mp
Reference mapping.
Scalar * p_determinant
Pointer on the determinant.
Sym_tensor * inverse() const
Returns a pointer on the inverse of the Sym_tensor (seen as a matrix).
virtual void del_derive_met(int) const
Logical destructor of the derivatives depending on the i-th element of met_depend ...
Tensor field of valence 0 (or component of a tensorial field).
Base class for coordinate mappings.
virtual const Vector & radial_vect() const
Returns the radial vector normal to a spherical slicing and pointing toward spatial infinity...
virtual void std_spectral_base()
Sets the spectral bases of the Valeur va to the standard ones for a scalar field. ...
void set_tensor_depend_0x0() const
Sets all elements of tensor_depend to 0x0.
const Sym_tensor & ricci() const
Returns the Ricci tensor (given by the Connection p_connect )
void del_tensor_depend() const
Deletes all the derivative members of the Tensor contained in tensor_depend .
void operator=(const Metric &met)
Assignment to another Metric.
int get_place_met(const Metric &) const
Returns the position of the pointer on metre in the array met_depend .
Tensor field of valence 1.
const Metric_flat & flat_met_cart() const
Returns the flat metric associated with the Cartesian coordinates and with components expressed in th...
Vector * p_radial_vect
Pointer to the radial vector normal to a spherical slicing and pointing toward spatial infinity...
Sym_tensor * p_met_con
Pointer on the covariant representation.
virtual void sauve(FILE *) const
Save in a file.
Connection * p_connect
Connection associated with the metric.
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.
virtual const Scalar & ricci_scal() const
Returns the Ricci scalar.
int get_index_type(int i) const
Gives the type (covariant or contravariant) of the index number i .
virtual const Connection & connect() const
Returns the connection.
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.
virtual const Scalar & determinant() const
Returns the determinant.
Cartesian vectorial bases (triads).
Spherical orthonormal vectorial bases (triads).
virtual const Sym_tensor & cov() const
Read-only access to the covariant representation.
const Tensor * tensor_depend[N_TENSOR_DEPEND]
Pointer on the dependancies, that means the array contains pointers on all the Tensor whom derivative...
virtual ostream & operator>>(ostream &) const
Operator >> (virtual function called by the operator <<).
Scalar * p_ricci_scal
Pointer on the Ricci scalar.
Metric(const Sym_tensor &tens)
Standard constructor from a Sym_tensor .
Scalar & set(int)
Read/write access to a component.
void del_deriv() const
Deletes all the derived quantities.
const Map & get_mp() const
Returns the mapping.
Sym_tensor * p_met_cov
Pointer on the contravariant representation.
const Metric_flat & flat_met_spher() const
Returns the flat metric associated with the spherical coordinates and with components expressed in th...
Class intended to describe valence-2 symmetric tensors.
virtual ~Metric()
Destructor.