73 assert (t1.
mp == t2.
mp) ;
79 for (
int i=0 ; i<t1.
valence ; i++)
81 for (
int i=0 ; i<t2.
valence ; i++)
88 assert ( *(t2.
get_triad()) == *triad_res ) ;
97 for (
int i=0 ; i<res.n_comp ; i++) {
98 Itbl jeux_indice_res(res.indices(i)) ;
99 for (
int j=0 ; j<t1.
valence ; j++)
100 jeux_indice_t1.
set(j) = jeux_indice_res(j) ;
101 for (
int j=0 ; j<t2.
valence ; j++)
102 jeux_indice_t2.
set(j) = jeux_indice_res(j+t1.
valence) ;
104 res.set(jeux_indice_res) = t1(jeux_indice_t1)*t2(jeux_indice_t2) ;
113 assert (t1.
mp == t2.
mp) ;
119 for (
int i=0 ; i<t1.
valence ; i++)
121 for (
int i=0 ; i<t2.
valence ; i++)
128 assert ( *(t1.
get_triad()) == *triad_res ) ;
134 Tensor_sym res(*t2.
mp, val_res, tipe, *triad_res, ids1, ids2) ;
139 for (
int i=0 ; i<res.
n_comp ; i++) {
141 for (
int j=0 ; j<t1.
valence ; j++)
142 jeux_indice_t1.
set(j) = jeux_indice_res(j) ;
143 for (
int j=0 ; j<t2.
valence ; j++)
144 jeux_indice_t2.
set(j) = jeux_indice_res(j+t1.
valence) ;
146 res.
set(jeux_indice_res) = t1(jeux_indice_t1)*t2(jeux_indice_t2) ;
156 assert (t1.
mp == t2.
mp) ;
162 for (
int i=0 ; i<t1.
valence ; i++)
164 for (
int i=0 ; i<t2.
valence ; i++)
170 assert ( *(t2.
get_triad()) == *triad_res ) ;
178 for (
int i=0 ; i<res.n_comp ; i++) {
179 Itbl jeux_indice_res(res.indices(i)) ;
180 for (
int j=0 ; j<t1.
valence ; j++)
181 jeux_indice_t1.
set(j) = jeux_indice_res(j) ;
182 for (
int j=0 ; j<t2.
valence ; j++)
183 jeux_indice_t2.
set(j) = jeux_indice_res(j+t1.
valence) ;
185 res.set(jeux_indice_res) = t1(jeux_indice_t1)*t2(jeux_indice_t2) ;
200 assert(p_resu != 0x0) ;
212 assert(p_resu != 0x0) ;
Metric for tensor calculation.
int & set(int i)
Read/write of a particular element (index i ) (1D case)
int n_comp
Number of stored components, depending on the symmetry.
int sym_index1() const
Number of the first symmetric index (0<= id_sym1 < valence )
Base_val operator*(const Base_val &, const Base_val &)
This operator is used when calling multiplication or division of Valeur .
int id_sym2
Number of the second symmetric index (id_sym1 < id_sym2 < valence )
virtual Itbl indices(int pos) const
Returns the indices of a component given by its position in the array cmp .
const Tensor_sym & derive_con(const Metric &gam) const
Returns the "contravariant" derivative of this with respect to some metric , by raising the last inde...
int sym_index2() const
Number of the second symmetric index (id_sym1 < id_sym2 < valence )
Basic integer array class.
const Base_vect * triad
Vectorial basis (triad) with respect to which the tensor components are defined.
Tensor field of valence 1.
const Tensor_sym & derive_cov(const Metric &gam) const
Returns the covariant derivative of this with respect to some metric .
Vectorial bases (triads) with respect to which the tensorial components are defined.
Itbl type_indice
1D array of integers (class Itbl ) of size valence containing the type of each index: COV for a cova...
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.
void compute_derive_lie(const Vector &v, Tensor &resu) const
Computes the Lie derivative of this with respect to some vector field v (protected method; the public...
int id_sym1
Number of the first symmetric index (0<= id_sym1 < valence )
const Tensor & derive_cov(const Metric &gam) const
Returns the covariant derivative of this with respect to some metric .
int valence
Valence of the tensor (0 = scalar, 1 = vector, etc...)
const Tensor & derive_con(const Metric &gam) const
Returns the "contravariant" derivative of this with respect to some metric , by raising the last inde...
Scalar & set(const Itbl &ind)
Returns the value of a component (read/write version).
Symmetric tensors (with respect to two of their arguments).
Tensor_sym derive_lie(const Vector &v) const
Computes the Lie derivative of this with respect to some vector field v.
const Map *const mp
Mapping on which the numerical values at the grid points are defined.