25 char tenseur_sym_operateur_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Tenseur/tenseur_sym_operateur.C,v 1.8 2014/10/13 08:53:43 j_novak Exp $" ;
86 assert ((t1.
get_etat() != ETATNONDEF) && (t2.
etat != ETATNONDEF)) ;
91 poids_res = (fabs(poids_res) < 1.e-10 ? 0. : poids_res) ;
92 const Metrique* met_res = 0x0 ;
93 if (poids_res != 0.) {
103 for (
int i=0 ; i<t2.
valence ; i++)
112 met_res, poids_res) ;
115 if ((t1.
get_etat() == ETATZERO) || (t2.
etat == ETATZERO))
124 for (
int i=0 ; i<res.
n_comp ; i++) {
127 jeux_indice_t1.
set(j) = jeux_indice_res(j) ;
128 for (
int j=0 ; j<t2.
valence ; j++)
131 res.
set(jeux_indice_res) = t1(jeux_indice_t1)*t2(jeux_indice_t2) ;
142 for (
int i=0 ; i<t1.
valence ; i++) {
145 auxi_old =
new Tenseur(*auxi) ;
172 for (
int i=0 ; i<val ; i++)
190 for (
int i=0 ; i<val ; i++) {
194 Itbl indices_aux(val) ;
199 indices_aux.
set(val-1) = indices(i) ;
200 for (
int idx=0 ; idx<val-1 ; idx++)
202 indices_aux.
set(idx) = indices(idx) ;
204 indices_aux.
set(idx) = indices(idx+1) ;
206 resu.
set(indices) += (*auxi)(indices_aux) ;
212 Itbl indices_aux(val) ;
219 indices_aux.
set(val-1) = indices(i) ;
220 for (
int idx=0 ; idx<val-1 ; idx++)
222 indices_aux.
set(idx) = indices(idx) ;
224 indices_aux.
set(idx) = indices(idx+1) ;
225 resu.
set(indices) -= (*auxi)(indices_aux) ;
232 resu = resu + poids*
contract(dx,0,1)*t ;
239 assert(t.
get_etat() != ETATNONDEF) ;
240 assert(metre.get_etat() != ETATNONDEF) ;
244 if (resu.
get_etat() == ETATZERO)
return resu ;
245 assert(resu.
get_etat() == ETATQCQ) ;
251 mix.
set(0) = (t0 == t1 ? -t0 : t0) ;
266 resu = resu - 1./3.*trace * metre.cov() ;
270 resu = resu - 1./3.*trace * metre.con() ;
274 cout <<
"Erreur bizarre dans sans_trace!" << endl ;
283 for (
int i=0; i<3; i++)
284 for (
int j=i; j<3; j++)
285 delta.
set(i,j) = (i==j ? 1 : 0) ;
286 resu = resu - trace/3. * delta ;
virtual int identify() const =0
Returns a number to identify the sub-classe of Base_vect the object belongs to.
Basic integer array class.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
int & set(int i)
Read/write of a particular element (index i ) (1D case)
Class intended to describe tensors with a symmetry on the two last indices *** DEPRECATED : use 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 .
Tensor handling *** DEPRECATED : use class Tensor instead ***.
Cmp & set()
Read/write for a scalar (see also operator=(const Cmp&) ).
int get_type_indice(int i) const
Returns the type of the index number i .
const Metrique * metric
For tensor densities: the metric defining the conformal factor.
const Map *const mp
Reference mapping.
const Tenseur & derive_cov(const Metrique &met) const
Returns the covariant derivative of *this , with respect to met .
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
double get_poids() const
Returns the weight.
const Map * get_mp() const
Returns pointer on the mapping.
const Tenseur & gradient() const
Returns the gradient of *this (Cartesian coordinates)
int n_comp
Number of components, depending on the symmetry.
void set_std_base()
Set the standard spectal basis of decomposition for each component.
void set_etat_zero()
Sets the logical state to ETATZERO (zero state).
Itbl type_indice
Array of size valence contening the type of each index, COV for a covariant one and CON for a contrav...
const Metrique * get_metric() const
Returns a pointer on the metric defining the conformal factor for tensor densities.
int etat
Logical state ETATZERO , ETATQCQ or ETATNONDEF.
double poids
For tensor densities: the weight.
int get_valence() const
Returns the valence.
int get_n_comp() const
Returns the number of components.
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.
int get_etat() const
Returns the logical state.
Base_val operator*(const Base_val &, const Base_val &)
This operator is used when calling multiplication or division of Valeur .
Tenseur lie_derive(const Tenseur &t, const Tenseur &x, const Metrique *=0x0)
Lie Derivative of t with respect to x .
Tenseur contract(const Tenseur &, int id1, int id2)
Self contraction of two indices of a Tenseur .
Tenseur sans_trace(const Tenseur &tens, const Metrique &metre)
Computes the traceless part of a Tenseur of valence 2.
Tenseur manipule(const Tenseur &, const Metrique &, int idx)
Raise or lower the index idx depending on its type, using the given Metrique .