[LORENE] New class Tensor
Eric.Gourgoulhon at obspm.fr
Fri Oct 24 23:32:59 CEST 2003
The new class Tensor has been introduced in Lorene.
It should replace the "old" class Tenseur.
As explained in the previous message about the class Scalar,
this removes some redundancy between components of a tensorial
field (previously described by the class Cmp) and scalar
fields (previously described by objects of class Tenseur
with valence=0). Indeed the components of a tensor are
now described by the Scalar class, which is a derived class
of Tensor. Beside Scalar, Tensor has other derived classes:
-- Vector : for tensor of valence 1, with derived class
Vector_divfree for divergence-free vectors
-- Sym_tensor : for symmetric tensors of valence 2
-- Tensor_delta : for tensor of valence 3, symmetric on the last
Another major difference between Tensor and Tenseur is
the suppression of the state variable etat for Tensor.
Consequently the memory to store the pointers on the
various components is allocated once the Tensor is created.
This enables short writings of the type
Vector vv(mapping, CON, triad) ;
vv.set(1) = x ;
vv.set(2) = 0 ;
vv.set(3) = -1 ;
without having to call to some set_etat_qcq() function
before the vv.set(*).
Note that following the mathematical convention,
indices of a Tensor run from 1 to 3, and not from 0
to 2 as for Tenseur.
Laboratoire de l'Univers et de ses THeories (LUTH)
UMR 8102 du CNRS / Observatoire de Paris, F-92195 Meudon Cedex, France
tel: +33 1.45.07.74.33 (secretariat : +33 1.45.07.75.10)
e-mail: Eric.Gourgoulhon at obspm.fr WWW: http://www.luth.obspm.fr/
More information about the Lorene.list