31 char tensor_sym_calculus_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Tensor/tensor_sym_calculus.C,v 1.5 2014/10/13 08:53:44 j_novak Exp $" ;
70 assert (t1.
mp == t2.
mp) ;
76 for (
int i=0 ; i<t1.
valence ; i++)
78 for (
int i=0 ; i<t2.
valence ; i++)
85 assert ( *(t2.
get_triad()) == *triad_res ) ;
94 for (
int i=0 ; i<res.
n_comp ; i++) {
96 for (
int j=0 ; j<t1.
valence ; j++)
97 jeux_indice_t1.
set(j) = jeux_indice_res(j) ;
98 for (
int j=0 ; j<t2.
valence ; j++)
99 jeux_indice_t2.
set(j) = jeux_indice_res(j+t1.
valence) ;
101 res.
set(jeux_indice_res) = t1(jeux_indice_t1)*t2(jeux_indice_t2) ;
110 assert (t1.
mp == t2.
mp) ;
116 for (
int i=0 ; i<t1.
valence ; i++)
118 for (
int i=0 ; i<t2.
valence ; i++)
125 assert ( *(t1.
get_triad()) == *triad_res ) ;
131 Tensor_sym res(*t2.
mp, val_res, tipe, *triad_res, ids1, ids2) ;
136 for (
int i=0 ; i<res.
n_comp ; i++) {
138 for (
int j=0 ; j<t1.
valence ; j++)
139 jeux_indice_t1.
set(j) = jeux_indice_res(j) ;
140 for (
int j=0 ; j<t2.
valence ; j++)
141 jeux_indice_t2.
set(j) = jeux_indice_res(j+t1.
valence) ;
143 res.
set(jeux_indice_res) = t1(jeux_indice_t1)*t2(jeux_indice_t2) ;
153 assert (t1.
mp == t2.
mp) ;
159 for (
int i=0 ; i<t1.
valence ; i++)
161 for (
int i=0 ; i<t2.
valence ; i++)
167 assert ( *(t2.
get_triad()) == *triad_res ) ;
175 for (
int i=0 ; i<res.
n_comp ; i++) {
177 for (
int j=0 ; j<t1.
valence ; j++)
178 jeux_indice_t1.
set(j) = jeux_indice_res(j) ;
179 for (
int j=0 ; j<t2.
valence ; j++)
180 jeux_indice_t2.
set(j) = jeux_indice_res(j+t1.
valence) ;
182 res.
set(jeux_indice_res) = t1(jeux_indice_t1)*t2(jeux_indice_t2) ;
197 assert(p_resu != 0x0) ;
209 assert(p_resu != 0x0) ;
Vectorial bases (triads) with respect to which the tensorial components are defined.
Basic integer array class.
int & set(int i)
Read/write of a particular element (index i ) (1D case)
Metric for tensor calculation.
Symmetric tensors (with respect to two of their arguments).
Tensor field of valence 1.
Base_val operator*(const Base_val &, const Base_val &)
This operator is used when calling multiplication or division of Valeur .
Tensor_sym derive_lie(const Vector &v) const
Computes the Lie derivative of this with respect to some vector field v.
int sym_index1() const
Number of the first symmetric index (0<= id_sym1 < valence )
const Tensor_sym & derive_cov(const Metric &gam) const
Returns the covariant derivative of this with respect to some metric .
const Map *const mp
Mapping on which the numerical values at the grid points are defined.
virtual Itbl indices(int pos) const
Returns the indices of a component given by its position in the array cmp .
int sym_index2() const
Number of the second symmetric index (id_sym1 < id_sym2 < valence )
const Tensor & derive_con(const Metric &gam) const
Returns the "contravariant" derivative of this with respect to some metric , by raising the last inde...
int id_sym1
Number of the first symmetric index (0<= id_sym1 < valence )
int valence
Valence of the tensor (0 = scalar, 1 = vector, etc...)
int id_sym2
Number of the second symmetric index (id_sym1 < id_sym2 < valence )
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 n_comp
Number of stored components, depending on the symmetry.
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...
const Tensor & derive_cov(const Metric &gam) const
Returns the covariant derivative of this with respect to some metric .
Itbl type_indice
1D array of integers (class Itbl ) of size valence containing the type of each index: COV for a cov...
Scalar & set(const Itbl &ind)
Returns the value of a component (read/write version).
const Base_vect * triad
Vectorial basis (triad) with respect to which the tensor components are defined.
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.