276 #include "base_vect.h" 391 explicit Tenseur (
const Map& map,
const Metrique* met = 0x0,
395 explicit Tenseur (
const Cmp& cmp,
const Metrique* met = 0x0,
416 const Base_vect& triad_i,
const Metrique* met = 0x0,
438 const Base_vect* triad_i,
const Metrique* met = 0x0,
453 Tenseur (
const Map& map,
int val,
int tipe,
const 454 Base_vect& triad_i,
const Metrique* met = 0x0,
475 const Metrique* met = 0x0) ;
486 Tenseur (
const Map& map, FILE* fich,
const Metrique* met = 0x0) ;
510 const Base_vect& triad_i,
const Metrique* met = 0x0,
528 const Base_vect& triad_i,
const Metrique* met = 0x0,
628 Cmp&
set (int, int) ;
629 Cmp&
set (int, int, int) ;
650 void annule(
int l_min,
int l_max) ;
759 void sauve(FILE *)
const ;
760 friend ostream& operator<<(ostream& ,
const Tenseur & ) ;
881 void poisson_vect_falloff(
double lambda,
Param& par,
Tenseur& shift,
884 void poisson_vect_ylm(
double lambda,
Param& para,
Tenseur& shift,
886 double* intvec)
const ;
923 Tenseur& scal,
int* k_falloff )
const ;
926 Tenseur& scalaire,
int nylm,
double* intvec)
const ;
959 void poisson_vect_oohara_tau(
double lambda,
Param& par,
Tenseur& shift,
994 Tenseur poisson_vect_oohara_tau(
double lambda,
Tenseur& scal)
const ;
1032 friend class Metrique ;
1062 Tenseur
operator*(
const Tenseur&,
const Tenseur&) ;
1066 Tenseur
operator%(
const Tenseur&,
const Tenseur&) ;
1090 Tenseur
contract(
const Tenseur&,
int id1,
int id2) ;
1114 Tenseur
contract(
const Tenseur&,
int id1,
const Tenseur&,
int id2) ;
1133 Tenseur
manipule(
const Tenseur&,
const Metrique&,
int idx) ;
1139 Tenseur
manipule(
const Tenseur&,
const Metrique&) ;
1148 Tenseur
skxk (
const Tenseur&) ;
1156 Tenseur
lie_derive (
const Tenseur& t,
const Tenseur& x,
const Metrique* = 0x0);
1166 Tenseur
sans_trace(
const Tenseur& tens,
const Metrique& metre) ;
1179 Tenseur
operator+(
const Tenseur&,
const Tenseur &) ;
1182 Tenseur
operator+(
const Tenseur&,
double ) ;
1185 Tenseur
operator+(
double,
const Tenseur& ) ;
1188 Tenseur
operator+(
const Tenseur&,
int ) ;
1191 Tenseur
operator+(
int,
const Tenseur& ) ;
1193 Tenseur
operator-(
const Tenseur &,
const Tenseur &) ;
1196 Tenseur
operator-(
const Tenseur&,
double ) ;
1199 Tenseur
operator-(
double,
const Tenseur& ) ;
1202 Tenseur
operator-(
const Tenseur&,
int ) ;
1205 Tenseur
operator-(
int,
const Tenseur& ) ;
1208 Tenseur
operator*(
const Tenseur&,
double ) ;
1211 Tenseur
operator*(
double,
const Tenseur& ) ;
1214 Tenseur
operator*(
const Tenseur&,
int ) ;
1217 Tenseur
operator*(
int,
const Tenseur& ) ;
1220 Tenseur
operator/(
const Tenseur& a,
const Tenseur& b) ;
1222 Tenseur
operator/(
const Tenseur&,
double ) ;
1225 Tenseur
operator/(
double,
const Tenseur &) ;
1227 Tenseur
operator/(
const Tenseur&,
int ) ;
1230 Tenseur
operator/(
int,
const Tenseur &) ;
1232 Tenseur
exp(
const Tenseur& ) ;
1233 Tenseur
log(
const Tenseur& ) ;
1234 Tenseur
sqrt(
const Tenseur& ) ;
1235 Tenseur
abs(
const Tenseur& ) ;
1236 Tenseur
pow(
const Tenseur&,
int ) ;
1237 Tenseur
pow(
const Tenseur&,
double ) ;
1277 const Base_vect& triad_i,
const Metrique* met = 0x0,
1278 double weight = 0) ;
1290 const Base_vect& triad_i,
const Metrique* met = 0x0,
1291 double weight = 0) ;
1311 const Metrique* met = 0x0) ;
1409 const Metrique* = 0x0);
Itbl type_indice
Array of size valence contening the type of each index, COV for a covariant one and CON for a contrav...
const Map *const mp
Reference mapping.
double get_poids() const
Returns the weight.
const Base_vect * triad
Vectorial basis (triad) with respect to which the tensor components are defined.
virtual ~Tenseur()
Destructor.
Cmp log(const Cmp &)
Neperian logarithm.
int get_type_indice(int i) const
Returns the type of the index number i .
void annule(int l)
Sets the Tenseur to zero in a given domain.
int get_place_met(const Metrique &metre) const
Returns the position of the pointer on metre in the array met_depend .
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Cmp exp(const Cmp &)
Exponential.
void dec2_dzpuis()
dzpuis -= 2 ;
void poisson_vect(double lambda, Param &par, Tenseur &shift, Tenseur &vect, Tenseur &scal) const
Solves the vectorial Poisson equation : .
const Tenseur & gradient_spher() const
Returns the gradient of *this (Spherical coordinates) (scalar field only).
void set_triad(const Base_vect &new_triad)
Assigns a new vectorial basis (triad) of decomposition.
void poisson_vect_oohara(double lambda, Param &par, Tenseur &shift, Tenseur &scal) const
Solves the vectorial Poisson equation .
Cmp sqrt(const Cmp &)
Square root.
int n_comp
Number of components, depending on the symmetry.
Itbl get_type_indice() const
Returns the types of all the indices.
void set_poids(double weight)
Sets the weight for a tensor density.
void set_std_base()
Set the standard spectal basis of decomposition for each component.
Class intended to describe tensors with a symmetry on the two last indices *** DEPRECATED : use class...
virtual int donne_place(const Itbl &idx) const
Returns the position in the Cmp 1-D array c of a component given by its indices.
Base_val operator*(const Base_val &, const Base_val &)
This operator is used when calling multiplication or division of Valeur .
Base class for coordinate mappings.
int etat
Logical state ETATZERO , ETATQCQ or ETATNONDEF.
Tenseur flat_scalar_prod(const Tenseur &t1, const Tenseur &t2)
Scalar product of two Tenseur when the metric is : performs the contraction of the last index of t1 w...
virtual Itbl donne_indices(int place) const
Returns the indices of a component given by its position in the Cmp 1-D array c . ...
void new_der_met()
Builds the arrays met_depend , p_derive_cov , p_derive_con and p_carre_scal and fills them with null ...
Basic integer array class.
virtual ~Tenseur_sym()
Destructor.
Cmp operator%(const Cmp &, const Cmp &)
Cmp * Cmp with desaliasing.
const Tenseur & derive_con(const Metrique &) const
Returns the contravariant derivative of *this , with respect to met .
Cmp operator/(const Cmp &, const Cmp &)
Cmp / Cmp.
virtual Itbl donne_indices(int place) const
Returns the indices of a component given by its position in the Cmp 1-D array c . ...
Vectorial bases (triads) with respect to which the tensorial components are defined.
virtual void fait_gradient() const
Calculates, if needed, the gradient of *this .
void inc_dzpuis()
dzpuis += 1 ;
virtual void fait_derive_cov(const Metrique &met, int i) const
Calculates, if needed, the covariant derivative of *this , with respect to met .
const Cmp & operator()() const
Read only for a scalar.
friend Tenseur_sym operator*(const Tenseur &, const Tenseur_sym &)
Tensorial product.
void inc2_dzpuis()
dzpuis += 2 ;
int get_valence() const
Returns the valence.
void del_t()
Logical destructor.
virtual void operator=(const Tenseur &tens)
Assignment to another Tenseur.
void set_metric(const Metrique &met)
Sets the pointer on the metric for a tensor density.
friend Tenseur operator*(const Tenseur &, const Tenseur &)
Tensorial product.
virtual void operator=(const Tenseur &)
Assignment from a Tenseur .
Tenseur * p_gradient_spher
Pointer on the gradient of *this in a spherical orthonormal basis (scalar field only).
virtual void fait_gradient() const
Calculates, if needed, the gradient of *this .
void del_derive_met(int i) const
Logical destructor of the derivatives depending on the i-th element of *met_depend ...
void change_triad(const Base_vect &new_triad)
Sets a new vectorial basis (triad) of decomposition and modifies the components accordingly.
virtual void fait_derive_cov(const Metrique &met, int i) const
Calculates, if needed, the covariant derivative of *this , with respect to met .
friend Tenseur lie_derive(const Tenseur &, const Tenseur &, const Metrique *)
Lie Derivative of t with respect to x .
const Map * get_mp() const
Returns pointer on the mapping.
void sauve(FILE *) const
Save in a file.
Tenseur flat_scalar_prod_desal(const Tenseur &t1, const Tenseur &t2)
Same as flat_scalar_prod but with desaliasing.
Tenseur * p_gradient
Pointer on the gradient of *this .
Tenseur skxk(const Tenseur &)
Contraction of the last index of (*this) with or , depending on the type of S .
void mult_r_zec()
Multiplication by r in the external zone.
const Metrique * get_metric() const
Returns a pointer on the metric defining the conformal factor for tensor densities.
virtual int donne_place(const Itbl &idx) const
Returns the position in the Cmp 1-D array c of a component given by its indices.
Cmp operator+(const Cmp &)
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.
bool verif() const
Returns false for a tensor density without a defined metric.
Tenseur lie_derive(const Tenseur &t, const Tenseur &x, const Metrique *=0x0)
Lie Derivative of t with respect to x .
double poids
For tensor densities: the weight.
Tenseur ** p_derive_con
Array of pointers on the contravariant derivatives of *this with respect to the corresponding metric...
int get_etat() const
Returns the logical state.
virtual void fait_derive_con(const Metrique &, int i) const
Calculates, if needed, the contravariant derivative of *this , with respect to met ...
friend Tenseur contract(const Tenseur &, int id1, int id2)
Self contraction of two indices of a Tenseur .
void fait_carre_scal(const Metrique &, int i) const
Calculates, if needed, the scalar square of *this , with respect to met .
Cmp pow(const Cmp &, int)
Power .
friend Tenseur skxk(const Tenseur &)
Contraction of the last index of (*this) with or , depending on the type of S .
Tenseur contract(const Tenseur &, int id1, int id2)
Self contraction of two indices of a Tenseur .
const Metrique ** met_depend
Array of pointers on the Metrique 's used to calculate derivatives members.
friend Tenseur_sym manipule(const Tenseur_sym &, const Metrique &)
Raise or lower all the indices, depending on their type, using the given Metrique ...
int get_n_comp() const
Returns the number of components.
Tenseur sans_trace(const Tenseur &tens, const Metrique &metre)
Computes the traceless part of a Tenseur of valence 2.
void set_der_0x0() const
Sets the pointers of all the derivatives to zero.
Tenseur(const Map &map, const Metrique *met=0x0, double weight=0)
Constructor for a scalar field.
void allocate_all()
Sets the logical state to ETATQCQ (ordinary state) and performs the memory allocation of all the elem...
void dec_dzpuis()
dzpuis -= 1 ;
void set_dependance(const Metrique &met) const
To be used to describe the fact that the derivatives members have been calculated with met ...
friend Tenseur flat_scalar_prod(const Tenseur &t1, const Tenseur &t2)
Scalar product of two Tenseur when the metric is : performs the contraction of the last index of t1 w...
friend Tenseur lie_derive(const Tenseur &, const Tenseur &, const Metrique *)
Lie Derivative of t with respect to x .
void set_der_met_0x0(int i) const
Sets the pointers of the derivatives depending on the i-th element of *met_depend to zero (as well as...
Tenseur inverse_poisson_vect(double lambda) const
Compute of *this , *this being of valence 1.
Tenseur_sym(const Map &map, int val, const Itbl &tipe, const Base_vect &triad_i, const Metrique *met=0x0, double weight=0)
Standard constructor.
Cmp abs(const Cmp &)
Absolute value.
const Metrique * metric
For tensor densities: the metric defining the conformal factor.
friend Tenseur manipule(const Tenseur &, const Metrique &, int idx)
Raise or lower the index idx depending on its type, using the given Metrique .
Tenseur ** p_derive_cov
Array of pointers on the covariant derivatives of *this with respect to the corresponding metric in ...
Cmp operator-(const Cmp &)
- Cmp
friend Tenseur operator%(const Tenseur &, const Tenseur &)
Tensorial product with desaliasing.
const Tenseur & carre_scal(const Metrique &) const
Returns the scalar square of *this , with respect to met .
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
const Tenseur & derive_cov(const Metrique &met) const
Returns the covariant derivative of *this , with respect to met .
void del_derive() const
Logical destructor of all the derivatives.
friend Tenseur flat_scalar_prod_desal(const Tenseur &t1, const Tenseur &t2)
Same as flat_scalar_prod but with desaliasing.
void set_etat_zero()
Sets the logical state to ETATZERO (zero state).
void poisson_vect_regu(int k_div, int nzet, double unsgam1, double lambda, Param &par, Tenseur &shift, Tenseur &vect, Tenseur &scal) const
Solves the vectorial Poisson equation : .
virtual void fait_derive_con(const Metrique &, int i) const
Calculates, if needed, the contravariant derivative of *this , with respect to met ...
Tenseur ** p_carre_scal
Array of pointers on the scalar squares of *this with respect to the corresponding metric in *met_de...
void fait_gradient_spher() const
Calculates, if needed, the gradient of *this in a spherical orthonormal basis (scalar field only)...
Tensor handling *** DEPRECATED : use class Tensor instead ***.
void set_etat_nondef()
Sets the logical state to ETATNONDEF (undefined state).
const Tenseur & gradient() const
Returns the gradient of *this (Cartesian coordinates)
Tenseur manipule(const Tenseur &, const Metrique &, int idx)
Raise or lower the index idx depending on its type, using the given Metrique .