89 assert ((t1.
get_etat() != ETATNONDEF) && (t2.
etat != ETATNONDEF)) ;
94 poids_res = (fabs(poids_res) < 1.e-10 ? 0. : poids_res) ;
95 const Metrique* met_res = 0x0 ;
96 if (poids_res != 0.) {
102 Itbl tipe (val_res) ;
106 for (
int i=0 ; i<t2.
valence ; i++)
115 met_res, poids_res) ;
118 if ((t1.
get_etat() == ETATZERO) || (t2.
etat == ETATZERO))
127 for (
int i=0 ; i<res.
n_comp ; i++) {
130 jeux_indice_t1.
set(j) = jeux_indice_res(j) ;
131 for (
int j=0 ; j<t2.
valence ; j++)
134 res.
set(jeux_indice_res) = t1(jeux_indice_t1)*t2(jeux_indice_t2) ;
145 for (
int i=0 ; i<t1.
valence ; i++) {
148 auxi_old =
new Tenseur(*auxi) ;
175 for (
int i=0 ; i<val ; i++)
193 for (
int i=0 ; i<val ; i++) {
197 Itbl indices_aux(val) ;
202 indices_aux.
set(val-1) = indices(i) ;
203 for (
int idx=0 ; idx<val-1 ; idx++)
205 indices_aux.
set(idx) = indices(idx) ;
207 indices_aux.
set(idx) = indices(idx+1) ;
209 resu.
set(indices) += (*auxi)(indices_aux) ;
215 Itbl indices_aux(val) ;
222 indices_aux.
set(val-1) = indices(i) ;
223 for (
int idx=0 ; idx<val-1 ; idx++)
225 indices_aux.
set(idx) = indices(idx) ;
227 indices_aux.
set(idx) = indices(idx+1) ;
228 resu.
set(indices) -= (*auxi)(indices_aux) ;
235 resu = resu + poids*
contract(dx,0,1)*t ;
242 assert(t.
get_etat() != ETATNONDEF) ;
243 assert(metre.get_etat() != ETATNONDEF) ;
247 if (resu.get_etat() == ETATZERO)
return resu ;
248 assert(resu.get_etat() == ETATQCQ) ;
254 mix.
set(0) = (t0 == t1 ? -t0 : t0) ;
269 resu = resu - 1./3.*trace * metre.cov() ;
273 resu = resu - 1./3.*trace * metre.con() ;
277 cout <<
"Erreur bizarre dans sans_trace!" << endl ;
286 for (
int i=0; i<3; i++)
287 for (
int j=i; j<3; j++)
288 delta.set(i,j) = (i==j ? 1 : 0) ;
289 resu = resu - trace/3. * delta ;
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.
int get_type_indice(int i) const
Returns the type of the index number i .
int & set(int i)
Read/write of a particular element (index i ) (1D case)
int n_comp
Number of components, depending on the symmetry.
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...
Base_val operator*(const Base_val &, const Base_val &)
This operator is used when calling multiplication or division of Valeur .
int etat
Logical state ETATZERO , ETATQCQ or ETATNONDEF.
Basic integer array class.
virtual Itbl donne_indices(int place) const
Returns the indices of a component given by its position in the Cmp 1-D array c . ...
int get_valence() const
Returns the valence.
Cmp & set()
Read/write for a scalar (see also operator=(const Cmp&) ).
const Map * get_mp() const
Returns pointer on the mapping.
const Metrique * get_metric() const
Returns a pointer on the metric defining the conformal factor for tensor densities.
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.
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.
virtual int identify() const =0
Returns a number to identify the sub-classe of Base_vect the object belongs to.
int get_etat() const
Returns the logical state.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Tenseur contract(const Tenseur &, int id1, int id2)
Self contraction of two indices of a Tenseur .
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.
const Metrique * metric
For tensor densities: the metric defining the conformal factor.
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 set_etat_zero()
Sets the logical state to ETATZERO (zero state).
Tensor handling *** DEPRECATED : use class Tensor instead ***.
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 .