78 for (
int ic=0 ; ic<res.get_n_comp() ; ic++) {
79 Itbl ind = res.indices(ic) ;
80 res.
set(ind) = -tt(ind) ;
109 for (
int ic=0 ; ic<res.get_n_comp() ; ic++) {
110 Itbl ind = res.indices(ic) ;
111 res.
set(ind) = t1(ind) + t2(ind) ;
140 for (
int ic=0 ; ic<res.get_n_comp() ; ic++) {
141 Itbl ind = res.indices(ic) ;
142 res.
set(ind) = t1(ind) - t2(ind) ;
159 if (t1.
get_etat() == ETATUN)
return t2 ;
164 for (
int ic=0 ; ic<res.get_n_comp() ; ic++) {
165 Itbl ind = res.indices(ic) ;
166 res.
set(ind) = t1 * t2(ind) ;
185 for (
int ic=0 ; ic<res.get_n_comp() ; ic++) {
186 Itbl ind = res.indices(ic) ;
187 res.
set(ind) = x * tt(ind) ;
201 return double(m) * t ;
206 return double(m) * t ;
217 assert(s2.
get_etat() != ETATNONDEF) ;
222 cout <<
"Division by 0 in Tensor_sym / Scalar !" << endl ;
226 if (s2.
get_etat() == ETATUN)
return t1 ;
231 for (
int ic=0 ; ic<res.get_n_comp() ; ic++) {
232 Itbl ind = res.indices(ic) ;
233 res.
set(ind) = t1(ind) / s2 ;
243 if ( x ==
double(0) ) {
244 cout <<
"Division by 0 in Tensor_sym / double !" << endl ;
248 if ( x ==
double(1) )
return tt ;
253 for (
int ic=0 ; ic<res.get_n_comp() ; ic++) {
254 Itbl ind = res.indices(ic) ;
255 res.
set(ind) = tt(ind) / x ;
266 return t / double(m) ;
int & set(int i)
Read/write of a particular element (index i ) (1D case)
int sym_index1() const
Number of the first symmetric index (0<= id_sym1 < valence )
Tensor field of valence 0 (or component of a tensorial field).
Base_val operator*(const Base_val &, const Base_val &)
This operator is used when calling multiplication or division of Valeur .
int sym_index2() const
Number of the second symmetric index (id_sym1 < id_sym2 < valence )
Basic integer array class.
int get_etat() const
Returns the logical state ETATNONDEF (undefined), ETATZERO (null) or ETATQCQ (ordinary).
Cmp operator/(const Cmp &, const Cmp &)
Cmp / Cmp.
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.
Cmp operator+(const Cmp &)
int get_index_type(int i) const
Gives the type (covariant or contravariant) of the index number i .
int get_valence() const
Returns the valence.
Cmp operator-(const Cmp &)
- Cmp
Symmetric tensors (with respect to two of their arguments).
const Map & get_mp() const
Returns the mapping.