# Tensor calculus [Tensorial fields]

() More...

## Functions

Tensor Lorene::operator* (const Tensor &a, const Tensor &b)
Tensorial product.
Tensor_sym Lorene::operator* (const Tensor &a, const Tensor_sym &b)
Tensorial product with symmetries.
Tensor_sym Lorene::operator* (const Tensor_sym &a, const Tensor &b)
Tensorial product with symmetries.
Tensor_sym Lorene::operator* (const Tensor_sym &a, const Tensor_sym &b)
Tensorial product of two symmetric tensors.
Tensor Lorene::contract (const Tensor &t1, int ind1, const Tensor &t2, int ind2, bool desaliasing=false)
Contraction of two tensors.
Tensor Lorene::contract (const Tensor &t1, int ind_i1, int ind_j1, const Tensor &t2, int ind_i2, int ind_j2, bool desaliasing=false)
Double contraction of two tensors.
Tensor Lorene::contract (const Tensor &t1, int ind1, int ind2)
Contraction on two indices of a single tensor (trace).
Tbl Lorene::max (const Tensor &aa, const char *comment=0x0, ostream &ost=cout)
Maxima in each domain of the values of the tensor components.
Tbl Lorene::min (const Tensor &aa, const char *comment=0x0, ostream &ost=cout)
Minima in each domain of the values of the tensor components.
Tbl Lorene::maxabs (const Tensor &aa, const char *comment=0x0, ostream &ost=cout, bool verb=true)
Maxima in each domain of the absolute values of the tensor components.
Tbl Lorene::diffrel (const Tensor &aa, const Tensor &bb, const char *comment=0x0, ostream &ost=cout)
Relative difference between two `Tensor` ( version).
Tbl Lorene::diffrelmax (const Tensor &aa, const Tensor &bb, const char *comment=0x0, ostream &ost=cout)
Relative difference between two `Tensor` (max version).
Tbl Lorene::central_value (const Tensor &aa, const char *comment=0x0, ostream &ost=cout)
Central value of each component of a tensor.
Tbl Lorene::max_all_domains (const Tensor &aa, int l_excluded=-1, const char *comment=0x0, ostream &ost=cout)
Maximum value of each component of a tensor over all the domains.
Tbl Lorene::min_all_domains (const Tensor &aa, int l_excluded=-1, const char *comment=0x0, ostream &ost=cout)
Minimum value of each component of a tensor over all the domains.
Tbl Lorene::maxabs_all_domains (const Tensor &aa, int l_excluded=-1, const char *comment=0x0, ostream &ost=cout, bool verb=true)
Maximum of the absolute value of each component of a tensor over all the domains.

()

## Function Documentation

 Tbl Lorene::central_value ( const Tensor & aa, const char * comment = `0x0`, ostream & ost = `cout` )

Central value of each component of a tensor.

Parameters:
 aa tensor comment comment to be printed on `ost` (default: 0x0 = nothing printed) ost output stream for a formatted output of the result; used only if `comment` != `0x0`.
Returns:
1-D `Tbl` of size the number of independent components (`aa.get_ncomp()`), the elements of which are the central values of the various components.

Definition at line 652 of file tensor_calculus_ext.C.

 Tensor Lorene::contract ( const Tensor & t1, int ind1, int ind2 )

Contraction on two indices of a single tensor (trace).

Parameters:
 t1 [input] tensor ind1 [input] first index of the tensor for the contraction, obeying to the following convention : `ind1` = 0 : first index of the tensor `ind1` = 1 : second index of the tensor and so on... (`ind1` must thus be in the range 0...t1.valence-1) ind2 [input] second index of the tensor for the contraction, with the same convention as `ind1`
Returns:
tensor resulting of the contraction NB: the types (`COV` or `CON` ) of the indices `ind1` and `ind2` must be different.

Definition at line 343 of file tensor_calculus_ext.C.

 Tensor Lorene::contract ( const Tensor & t1, int ind_i1, int ind_j1, const Tensor & t2, int ind_i2, int ind_j2, bool desaliasing = `false` )

Double contraction of two tensors.

Parameters:
 t1 [input] first tensor ind_i1 [input] position of the first index i1 in the first tensor for the contraction, obeying to the following convention : `ind_i1` = 0 : first index of the tensor `ind_i1` = 1 : second index of the tensor and so on... (`ind_i1` must thus be in the range 0...t1.valence-1) ind_j1 [input] position of the second index j1 in the first tensor for the contraction; one must have `ind_i1` < `ind_` j1 t2 [input] second tensor ind_i2 [input] position of the first index i2 in the second tensor for the contraction ind_j2 [input] position of the second index j2 in the second tensor for the contraction; one must have `ind_i2` < `ind_` j2 desaliasing [input] determines whether the products are performed with desaliasing or not
Returns:
tensor resulting of the contraction of the index `ind_i1` of `t1` with the index `ind_i2` of `t2` and of the contraction of the index `ind_j1` of `t1` with the index `ind_j2` of `t2` NB: the types (`COV` or `CON` ) of the indices `ind_i1` and `ind_i2` (resp. `ind_j1` and `ind_j2` ) must be different.

Definition at line 241 of file tensor_calculus_ext.C.

 Tensor Lorene::contract ( const Tensor & t1, int ind1, const Tensor & t2, int ind2, bool desaliasing = `false` )

Contraction of two tensors.

Parameters:
 t1 [input] first tensor ind1 [input] index of the first tensor for the contraction, obeying to the following convention : `ind1` = 0 : first index of the tensor `ind1` = 1 : second index of the tensor and so on... (`ind1` must thus be in the range 0...t1.valence-1) t2 [input] second tensor ind2 [input] index of the second tensor for the contraction, with the same convention as `ind1` desaliasing [input] determines whether the products are performed with desaliasing or not
Returns:
tensor resulting of the contraction of the index `ind1` of `t1` with the index `ind2` of `t2` . NB: the types (`COV` or `CON` ) of the indices `ind1` and `ind2` must be different.

Definition at line 163 of file tensor_calculus_ext.C.

 Tbl Lorene::diffrel ( const Tensor & aa, const Tensor & bb, const char * comment = `0x0`, ostream & ost = `cout` )

Relative difference between two `Tensor` ( version).

Parameters:
 aa first tensor bb second tensor comment comment to be printed on `ost` before the result (default: 0x0 = nothing printed) ost output stream for a formatted output of the result
Returns:
2-D `Tbl` of size the number of independent components times the number of domains, the elements (i,l) of which are `norme`[a(l)-b(l)]/norme[b(l)] if `b(l)!=0` and `norme`[a(l)-b(l)] if `b(l)=0` , where `a(l)` and `b(l)` denote symbolically the values of `aa` and `bb` in domain no. `l` and for component no.`i` .

Definition at line 411 of file tensor_calculus_ext.C.

 Tbl Lorene::diffrelmax ( const Tensor & aa, const Tensor & bb, const char * comment = `0x0`, ostream & ost = `cout` )

Relative difference between two `Tensor` (max version).

Parameters:
 aa first tensor bb second tensor comment comment to be printed on `ost` before the result (default: 0x0 = nothing printed) ost output stream for a formatted output of the result
Returns:
2-D `Tbl` of size the number of independent components times the number of domains, the elements (i,l) of which are `max`[abs(a(l)-b(l))]/max[abs(b(l))] if `b(l)!=0` and `max`[abs(a(l)-b(l))] if `b(l)=0` , where `a(l)` and `b(l)` denote symbolically the values of `aa` and `bb` in domain no. `l` and for component no.`i` .

Definition at line 467 of file tensor_calculus_ext.C.

 Tbl Lorene::max ( const Tensor & aa, const char * comment = `0x0`, ostream & ost = `cout` )

Maxima in each domain of the values of the tensor components.

Parameters:
 aa tensor comment comment to be printed on `ost` before the result (default: 0x0 = nothing printed) ost output stream for a formatted output of the result
Returns:
2-D `Tbl` of size the number of independent components times the number of domains, the elements (i,l) of which are `max`(a(l)) , where `a(l)` denotes symbolically the values of `aa` in domain no. `l` and for component no.`i` .

Definition at line 524 of file tensor_calculus_ext.C.

 Tbl Lorene::max_all_domains ( const Tensor & aa, int l_excluded = `-1`, const char * comment = `0x0`, ostream & ost = `cout` )

Maximum value of each component of a tensor over all the domains.

Parameters:
 aa tensor l_excluded index of domain to be excluded from the computation: the default = -1 corresponds to no excluded domain comment comment to be printed on `ost` (default: 0x0 = nothing printed) ost output stream for a formatted output of the result; used only if `comment` != `0x0`.
Returns:
1-D `Tbl` of size the number of independent components (`aa.get_ncomp()`), the elements of which are the maximum values of the various components.

Definition at line 690 of file tensor_calculus_ext.C.

 Tbl Lorene::maxabs ( const Tensor & aa, const char * comment = `0x0`, ostream & ost = `cout`, bool verb = `true` )

Maxima in each domain of the absolute values of the tensor components.

Parameters:
 aa tensor comment comment to be printed on `ost` before the result (default: 0x0 = nothing printed) ost output stream for a formatted output of the result
Returns:
2-D `Tbl` of size the number of independent components times the number of domains, the elements (i,l) of which are `max`[abs(a(l))] , where `a(l)` denotes symbolically the values of `aa` in domain no. `l` and for component no.`i` .

Definition at line 609 of file tensor_calculus_ext.C.

 Tbl Lorene::maxabs_all_domains ( const Tensor & aa, int l_excluded = `-1`, const char * comment = `0x0`, ostream & ost = `cout`, bool verb = `true` )

Maximum of the absolute value of each component of a tensor over all the domains.

Parameters:
 aa tensor l_excluded index of domain to be excluded from the computation: the default = -1 corresponds to no excluded domain comment comment to be printed on `ost` (default: 0x0 = nothing printed) ost output stream for a formatted output of the result; used only if `comment` != `0x0`.
Returns:
1-D `Tbl` of size the number of independent components (`aa.get_ncomp()`), the elements of which are the maximum of of the absolute value of the various components.

Definition at line 791 of file tensor_calculus_ext.C.

 Tbl Lorene::min ( const Tensor & aa, const char * comment = `0x0`, ostream & ost = `cout` )

Minima in each domain of the values of the tensor components.

Parameters:
 aa tensor comment comment to be printed on `ost` before the result (default: 0x0 = nothing printed) ost output stream for a formatted output of the result
Returns:
2-D `Tbl` of size the number of independent components times the number of domains, the elements (i,l) of which are `min`(a(l)), where `a(l)` denotes symbolically the values of `aa` in domain no. `l` and for component no.`i` .

Definition at line 567 of file tensor_calculus_ext.C.

 Tbl Lorene::min_all_domains ( const Tensor & aa, int l_excluded = `-1`, const char * comment = `0x0`, ostream & ost = `cout` )

Minimum value of each component of a tensor over all the domains.

Parameters:
 aa tensor l_excluded index of domain to be excluded from the computation: the default = -1 corresponds to no excluded domain comment comment to be printed on `ost` (default: 0x0 = nothing printed) ost output stream for a formatted output of the result; used only if `comment` != `0x0`.
Returns:
1-D `Tbl` of size the number of independent components (`aa.get_ncomp()`), the elements of which are the minimum values of the various components.

Definition at line 740 of file tensor_calculus_ext.C.

 Tensor_sym Lorene::operator* ( const Tensor_sym & a, const Tensor_sym & b )

Tensorial product of two symmetric tensors.

NB: the output is an object of class `Tensor_sym` , with the two symmetric indices corresponding to the symmetric indices of tensor `a` . This means that the symmetries of tensor `b` indices are not used in the storage, since there is currently no class in Lorene to manage tensors with more than two symmetric indices.

Definition at line 154 of file tensor_sym_calculus.C.

 Tensor_sym Lorene::operator* ( const Tensor_sym & a, const Tensor & b )

Tensorial product with symmetries.

Definition at line 71 of file tensor_sym_calculus.C.

 Tensor_sym Lorene::operator* ( const Tensor & a, const Tensor_sym & b )

Tensorial product with symmetries.

Definition at line 111 of file tensor_sym_calculus.C.

 Tensor Lorene::operator* ( const Tensor & a, const Tensor & b )

Tensorial product.

Definition at line 110 of file tensor_calculus_ext.C.

Generated on 7 Dec 2019 for LORENE by 1.6.1