273 #include "base_vect.h" 388 explicit Tenseur (
const Map& map,
const Metrique* met = 0x0,
392 explicit Tenseur (
const Cmp& cmp,
const Metrique* met = 0x0,
413 const Base_vect& triad_i,
const Metrique* met = 0x0,
435 const Base_vect* triad_i,
const Metrique* met = 0x0,
450 Tenseur (
const Map& map,
int val,
int tipe,
const 451 Base_vect& triad_i,
const Metrique* met = 0x0,
472 const Metrique* met = 0x0) ;
483 Tenseur (
const Map& map, FILE* fich,
const Metrique* met = 0x0) ;
507 const Base_vect& triad_i,
const Metrique* met = 0x0,
524 Tenseur (
const Map&,
int val,
int tipe,
int n_comp,
525 const Base_vect& triad_i,
const Metrique* met = 0x0,
625 Cmp&
set (int, int) ;
626 Cmp&
set (int, int, int) ;
647 void annule(
int l_min,
int l_max) ;
756 void sauve(FILE *)
const ;
757 friend ostream& operator<<(ostream& ,
const Tenseur & ) ;
878 void poisson_vect_falloff(
double lambda,
Param& par,
Tenseur& shift,
881 void poisson_vect_ylm(
double lambda,
Param& para,
Tenseur& shift,
883 double* intvec)
const ;
920 Tenseur& scal,
int* k_falloff )
const ;
923 Tenseur& scalaire,
int nylm,
double* intvec)
const ;
956 void poisson_vect_oohara_tau(
double lambda,
Param& par,
Tenseur& shift,
991 Tenseur poisson_vect_oohara_tau(
double lambda,
Tenseur& scal)
const ;
1029 friend class Metrique ;
1274 const Base_vect& triad_i,
const Metrique* met = 0x0,
1275 double weight = 0) ;
1287 const Base_vect& triad_i,
const Metrique* met = 0x0,
1288 double weight = 0) ;
1308 const Metrique* met = 0x0) ;
1405 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 class for coordinate mappings.
int etat
Logical state ETATZERO , ETATQCQ or ETATNONDEF.
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.
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.
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 ;
const Cmp & operator()() const
Read only for a scalar.
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.
Tenseur * p_gradient_spher
Pointer on the gradient of *this in a spherical orthonormal basis (scalar field only).
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 .
const Map * get_mp() const
Returns pointer on the mapping.
void sauve(FILE *) const
Save in a file.
Tenseur * p_gradient
Pointer on the gradient of *this .
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.
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.
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 .
const Metrique ** met_depend
Array of pointers on the Metrique 's used to calculate derivatives members.
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.
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 : .
Tenseur ** p_carre_scal
Array of pointers on the scalar squares of *this with respect to the corresponding metric in *met_dep...
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)