KADATH
Kadath::Metric_tensor Class Reference

Particular type of Tensor, dedicated to the desription of metrics. More...

#include <metric_tensor.hpp>

Inheritance diagram for Kadath::Metric_tensor:
Kadath::Tensor

Public Member Functions

 Metric_tensor (const Space &sp, int type_descr, const Base_tensor &ba)
 Constructor. More...
 
 Metric_tensor (const Metric_tensor &, bool copie=true)
 Constructor by copy. More...
 
 Metric_tensor (const Space &sp, FILE *)
 Copy from file. More...
 
Metric_tensoroperator= (const Metric_tensor &)
 Assignment to another Metric_tensor. More...
 
Metric_tensoroperator= (const Tensor &a) override
 Assignment to a Tensor. More...
 
Metric_tensoroperator= (double xx) override
 Assignment to a double (the same value for all the components at all the collocation points). More...
 
Metric_tensor inverse ()
 Computes the inverse of the current objetc. More...
 
void std_base2 ()
 Specialized base setting (for AADS) More...
 
int get_type () const
 
void swap (Tensor &) noexcept
 Swap method. More...
 
virtual void save (FILE *) const
 Saving operator. More...
 
const Param_tensorget_parameters () const
 Returns a pointer on the possible additional parameter. More...
 
Param_tensorset_parameters ()
 Read/write of the parameters. More...
 
void affect_parameters ()
 The function affect_parameters is deprecated and actually does nothing since the parameters are now always stored in order to lower usage of the memory heap. More...
 
bool is_m_order_affected () const
 Checks whether the additional parameter order is affected (not very used). More...
 
bool is_m_quant_affected () const
 Checks whether the additional parameter $m$ is affected (used for boson stars for instance). More...
 
int & set_basis (int dd)
 Assigns a new tensorial basis in a given domain. More...
 
virtual void annule_hard ()
 Sets the Tensor to zero (hard version ; no logical state used). More...
 
Scalarset (const Array< int > &ind)
 Returns the value of a component (read/write version). More...
 
Scalarset (const Index &ind)
 Returns the value of a component (read/write version). More...
 
Scalarset ()
 Read/write for a Scalar. More...
 
Scalarset (int i)
 Returns the value of a component for a tensor of valence 1 (read/write version). More...
 
Scalarset (int i1, int i2)
 Returns the value of a component for a tensor of valence 2 (read/write version). More...
 
Scalarset (int i1, int i2, int i3)
 Returns the value of a component for a tensor of valence 3 (read/write version). More...
 
Scalarset (int i1, int i2, int i3, int i4)
 Returns the value of a component for a tensor of valence 4 (read/write version). More...
 
void set_name_ind (int dd, char name)
 Sets the name of one index ; the names must have been affected first. More...
 
char const * get_name_ind () const
 
bool is_name_affected () const
 Check whether the names of the indices have been affected. More...
 
void set_name_affected ()
 Affects the name of the indices. More...
 
Tensor do_summation () const
 Does the inner contraction of the Tensor. More...
 
Tensor do_summation_one_dom (int dd) const
 Does the inner contraction of the Tensor in a given domain. More...
 
Tensor grad () const
 Computes the flat gradient, in Cartesian coordinates. More...
 
virtual void std_base ()
 Sets the standard spectal bases of decomposition for each component. More...
 
virtual int position (const Array< int > &idx) const
 Gives the location of a given component in the array used for storage (Array version). More...
 
virtual int position (const Index &idx) const
 Gives the location of a given component in the array used for storage (Index version). More...
 
virtual Array< int > indices (int pos) const
 Gives the values of the indices corresponding to a location in the array used for storage of the components. More...
 
const Spaceget_space () const
 Returns the Space. More...
 
const Base_tensorget_basis () const
 Returns the vectorial basis (triad) on which the components are defined. More...
 
int get_valence () const
 Returns the valence. More...
 
int get_n_comp () const
 Returns the number of stored components. More...
 
int get_ndim () const
 Returns the number dimension. More...
 
int get_index_type (int i) const
 Gives the type (covariant or contravariant) of a given index. More...
 
Array< int > get_index_type () const
 
int & set_index_type (int i)
 Sets the type of the index number. More...
 
Array< int > & set_index_type ()
 Sets the types of all the indices. More...
 
const Scalaroperator() (const Array< int > &ind) const
 Returns the value of a component (read only version). More...
 
const Scalaroperator() (const Index &ind) const
 Returns the value of a component (read only version). More...
 
const Scalaroperator() () const
 Read only for a Scalar. More...
 
const Scalaroperator() (int i) const
 Returns the value of a component for a tensor of valence 1 (read only version). More...
 
const Scalaroperator() (int i1, int i2) const
 Returns the value of a component for a tensor of valence 2 (read only version). More...
 
const Scalaroperator() (int i1, int i2, int i3) const
 Returns the value of a component for a tensor of valence 3 (read only version). More...
 
const Scalaroperator() (int i1, int i2, int i3, int i4) const
 Returns the value of a component for a tensor of valence 4 (read only version). More...
 
const Scalarat (int i1, int i2) const
 Sylvain' stuff. More...
 
void change_basis_spher_to_cart ()
 Changes the tensorial basis from orthonormal spherical to Cartesian. More...
 
void change_basis_cart_to_spher ()
 Changes the tensorial basis from Cartesian to orthonormal spherical. More...
 
void filter (double tre)
 Sets all the coefficients below a given treshold, to zero (maintaining regularity). More...
 
void coef () const
 Computes the coefficients. More...
 
void coef_i () const
 Computes the values in the configuration space. More...
 
void operator+= (const Tensor &)
 += Tensor More...
 
void operator-= (const Tensor &)
 -= Tensor More...
 
void filter_phi (int dom, int ncf)
 Sets to zero all the coefficients above a given order, for the $ \varphi$ coefficients, in a gicen Domain. More...
 

Protected Attributes

const Spaceespace
 The Space. More...
 
int ndom
 The number of Domain. More...
 
int ndim
 The dimension/. More...
 
int valence
 Valence of the tensor (0 = scalar, 1 = vector, etc...) More...
 
Base_tensor basis
 Tensorial basis with respect to which the tensor components are defined. More...
 
Array< int > type_indice
 1D array of integers of size valence containing the type of each index: COV for a covariant one and CON for a contravariant one. More...
 
bool name_affected
 Indicator that states if the indices have been given names. More...
 
Memory_mapped_array< char > name_indice
 If the indices haves names they are stored here. More...
 
int n_comp
 Number of stored components, depending on the symmetry. More...
 
Memory_mapped_array< Scalar * > cmp
 Array of size n_comp of pointers onto the components. More...
 
Param_tensor parameters
 Possible additional parameters relevant for the current Tensor. More...
 
int(* give_place_array )(const Array< int > &, int)
 Pointer on the function that gives the storage location corresponding to a set of indices values. (Array version) More...
 
int(* give_place_index )(const Index &, int)
 Pointer on the function that gives the storage location corresponding to a set of indices values. (Index version) More...
 
Array< int >(* give_indices )(int, int, int)
 Pointer on the function that gives the indices corresponding to a give storage location. More...
 

Private Member Functions

bool find_indices (const Tensor &tt, Array< int > &output_ind) const
 Checks whether the current Tensor and tt have compatible indices (i.e. More...
 

Detailed Description

Particular type of Tensor, dedicated to the desription of metrics.

It deals with symmetric, second order tensors only. The two indices must be of the same type but can be either COV or CON.

Definition at line 40 of file metric_tensor.hpp.

Constructor & Destructor Documentation

◆ Metric_tensor() [1/3]

Kadath::Metric_tensor::Metric_tensor ( const Space sp,
int  type_descr,
const Base_tensor ba 
)
inline

Constructor.

Parameters
sp: the Space.
type_descr: the type of the indices (COV or CON)
ba: the tensorial basis.

Definition at line 84 of file metric_tensor.hpp.

References Kadath::Tensor::give_indices, Kadath::Tensor::give_place_array, and Kadath::Tensor::give_place_index.

◆ Metric_tensor() [2/3]

Kadath::Metric_tensor::Metric_tensor ( const Metric_tensor so,
bool  copie = true 
)
inline

Constructor by copy.

If copie is false, the properties of the tensor are copied but not its values.

Definition at line 92 of file metric_tensor.hpp.

◆ Metric_tensor() [3/3]

Kadath::Metric_tensor::Metric_tensor ( const Space sp,
FILE *  ff 
)
inline

Member Function Documentation

◆ affect_parameters()

void Kadath::Tensor::affect_parameters ( )
inlineinherited

The function affect_parameters is deprecated and actually does nothing since the parameters are now always stored in order to lower usage of the memory heap.

Definition at line 320 of file tensor.hpp.

◆ annule_hard()

void Kadath::Tensor::annule_hard ( )
inlinevirtualinherited

Sets the Tensor to zero (hard version ; no logical state used).

Reimplemented in Kadath::Vector, and Kadath::Scalar.

Definition at line 23 of file tensor_impl.hpp.

References Kadath::Tensor::cmp, and Kadath::Tensor::n_comp.

◆ at()

const Scalar & Kadath::Tensor::at ( int  i1,
int  i2 
) const
inlineinherited

Sylvain' stuff.

Definition at line 164 of file tensor_impl.hpp.

References Kadath::Tensor::operator()().

◆ change_basis_cart_to_spher()

◆ change_basis_spher_to_cart()

◆ coef()

void Kadath::Tensor::coef ( ) const
inlineinherited

Computes the coefficients.

Definition at line 193 of file tensor_impl.hpp.

References Kadath::Index::inc().

◆ coef_i()

void Kadath::Tensor::coef_i ( ) const
inlineinherited

Computes the values in the configuration space.

Definition at line 202 of file tensor_impl.hpp.

References Kadath::Index::inc().

◆ do_summation()

◆ do_summation_one_dom()

Tensor Kadath::Tensor::do_summation_one_dom ( int  dd) const
inherited

Does the inner contraction of the Tensor in a given domain.

The values in the other domains are undefined. It assumes exactly two indices of different types have the same name.

Parameters
dd: the Domain where the contraction is performed.
Returns
: the contracted Tensor (with valence -2).

Definition at line 590 of file tensor_math_one_dom.cpp.

References Kadath::Tensor::basis, Kadath::Tensor::espace, Kadath::Tensor::get_n_comp(), Kadath::Index::inc(), Kadath::Tensor::name_affected, Kadath::Tensor::name_indice, Kadath::Tensor::position(), Kadath::Tensor::set(), Kadath::Array< T >::set(), Kadath::Val_domain::set_base(), Kadath::Scalar::set_domain(), Kadath::Tensor::type_indice, and Kadath::Tensor::valence.

◆ filter()

void Kadath::Tensor::filter ( double  tre)
inlineinherited

Sets all the coefficients below a given treshold, to zero (maintaining regularity).

Parameters
tre: the threshold.

Definition at line 221 of file tensor_impl.hpp.

References Kadath::Tensor::espace, Kadath::Domain::filter(), Kadath::Space::get_domain(), and Kadath::Space::get_nbr_domains().

◆ filter_phi()

void Kadath::Tensor::filter_phi ( int  dom,
int  ncf 
)
inlineinherited

Sets to zero all the coefficients above a given order, for the $ \varphi$ coefficients, in a gicen Domain.

Takes into account the various Galerkin basis to maintain regularity.

Parameters
dom: the Domain where the filter is applied.
ncf: the coefficients which index is above this are set to zero.

Definition at line 211 of file tensor_impl.hpp.

References Kadath::Scalar::filter_phi(), Kadath::Index::inc(), and Kadath::Tensor::set().

◆ find_indices()

bool Kadath::Tensor::find_indices ( const Tensor tt,
Array< int > &  output_ind 
) const
privateinherited

Checks whether the current Tensor and tt have compatible indices (i.e.

same names and types, possibly in a different order).

Parameters
tt: the Tensor used for the comparison.
output_ind: if the indices are compatible, it contains the permutation of the indices.
Returns
: true if the indices are compatible, false otherwise.

Definition at line 445 of file tensor.cpp.

References Kadath::Tensor::name_affected, Kadath::Tensor::name_indice, Kadath::Array< T >::set(), Kadath::Tensor::type_indice, and Kadath::Tensor::valence.

◆ get_basis()

const Base_tensor& Kadath::Tensor::get_basis ( ) const
inlineinherited

Returns the vectorial basis (triad) on which the components are defined.

Definition at line 504 of file tensor.hpp.

References Kadath::Tensor::basis.

◆ get_index_type() [1/2]

Array<int> Kadath::Tensor::get_index_type ( ) const
inlineinherited
Returns
The types of all the indices.

Definition at line 531 of file tensor.hpp.

References Kadath::Tensor::type_indice.

◆ get_index_type() [2/2]

int Kadath::Tensor::get_index_type ( int  i) const
inlineinherited

Gives the type (covariant or contravariant) of a given index.

Parameters
i: the index number (>=1)
Returns
COV for a covariant index, CON for a contravariant one.

Definition at line 526 of file tensor.hpp.

References Kadath::Tensor::type_indice.

◆ get_n_comp()

int Kadath::Tensor::get_n_comp ( ) const
inlineinherited

Returns the number of stored components.

Definition at line 514 of file tensor.hpp.

References Kadath::Tensor::n_comp.

◆ get_name_ind()

char const* Kadath::Tensor::get_name_ind ( ) const
inlineinherited
Returns
the names of all the indices.

Definition at line 424 of file tensor.hpp.

References Kadath::Tensor::name_indice.

◆ get_ndim()

int Kadath::Tensor::get_ndim ( ) const
inlineinherited

Returns the number dimension.

Definition at line 519 of file tensor.hpp.

References Kadath::Tensor::ndim.

◆ get_parameters()

const Param_tensor& Kadath::Tensor::get_parameters ( ) const
inlineinherited

Returns a pointer on the possible additional parameter.

Definition at line 311 of file tensor.hpp.

References Kadath::Tensor::parameters.

◆ get_space()

const Space& Kadath::Tensor::get_space ( ) const
inlineinherited

Returns the Space.

Definition at line 499 of file tensor.hpp.

References Kadath::Tensor::espace.

◆ get_type()

int Kadath::Metric_tensor::get_type ( ) const
inline
Returns
the type of description (CON or COV)

Definition at line 81 of file metric_tensor.hpp.

References Kadath::Tensor::type_indice.

◆ get_valence()

int Kadath::Tensor::get_valence ( ) const
inlineinherited

Returns the valence.

Definition at line 509 of file tensor.hpp.

References Kadath::Tensor::valence.

◆ grad()

◆ indices()

virtual Array<int> Kadath::Tensor::indices ( int  pos) const
inlinevirtualinherited

Gives the values of the indices corresponding to a location in the array used for storage of the components.

Parameters
pos: the storage location.
Returns
: the values of all the indices.

Reimplemented in Kadath::Vector.

Definition at line 484 of file tensor.hpp.

References Kadath::Tensor::give_indices, Kadath::Tensor::ndim, and Kadath::Tensor::valence.

◆ inverse()

◆ is_m_order_affected()

bool Kadath::Tensor::is_m_order_affected ( ) const
inlineinherited

Checks whether the additional parameter order is affected (not very used).

Definition at line 323 of file tensor.hpp.

References Kadath::Param_tensor::m_order_affected, and Kadath::Tensor::parameters.

◆ is_m_quant_affected()

bool Kadath::Tensor::is_m_quant_affected ( ) const
inlineinherited

Checks whether the additional parameter $m$ is affected (used for boson stars for instance).

Definition at line 326 of file tensor.hpp.

References Kadath::Param_tensor::m_quant_affected, and Kadath::Tensor::parameters.

◆ is_name_affected()

bool Kadath::Tensor::is_name_affected ( ) const
inlineinherited

Check whether the names of the indices have been affected.

Definition at line 429 of file tensor.hpp.

References Kadath::Tensor::name_affected.

◆ operator()() [1/7]

const Scalar & Kadath::Tensor::operator() ( ) const
inlineinherited

Read only for a Scalar.

Definition at line 110 of file tensor_impl.hpp.

References Kadath::Tensor::cmp, and Kadath::Tensor::valence.

◆ operator()() [2/7]

const Scalar & Kadath::Tensor::operator() ( const Array< int > &  ind) const
inlineinherited

Returns the value of a component (read only version).

Parameters
indArray of size valence containing the values of each index specifing the component, with the following storage convention:
  • ind(0) : value of the first index
  • ind(1) : value of the second index
  • and so on...
Returns
the component specified by ind

Definition at line 169 of file tensor_impl.hpp.

References Kadath::Tensor::cmp, Kadath::Array< T >::get_ndim(), Kadath::Array< T >::get_size(), Kadath::Tensor::position(), and Kadath::Tensor::valence.

◆ operator()() [3/7]

const Scalar & Kadath::Tensor::operator() ( const Index ind) const
inlineinherited

Returns the value of a component (read only version).

Parameters
indIndex of size valence containing the values of each index specifing the component, with the following storage convention:
  • ind(0) : value of the first index
  • ind(1) : value of the second index
  • and so on...
Returns
the component specified by ind

Definition at line 177 of file tensor_impl.hpp.

References Kadath::Tensor::operator()(), Kadath::Array< T >::set(), and Kadath::Tensor::valence.

◆ operator()() [4/7]

const Scalar & Kadath::Tensor::operator() ( int  i) const
inlineinherited

Returns the value of a component for a tensor of valence 1 (read only version).

Parameters
ivalue of the first index
Returns
the component specified by (i1)

Definition at line 118 of file tensor_impl.hpp.

References Kadath::Tensor::cmp, Kadath::Tensor::position(), Kadath::Array< T >::set(), and Kadath::Tensor::valence.

◆ operator()() [5/7]

const Scalar & Kadath::Tensor::operator() ( int  i1,
int  i2 
) const
inlineinherited

Returns the value of a component for a tensor of valence 2 (read only version).

Parameters
i1value of the first index
i2value of the second index
Returns
the component specified by (i1,i2)

Definition at line 128 of file tensor_impl.hpp.

References Kadath::Tensor::cmp, Kadath::Tensor::position(), Kadath::Array< T >::set(), and Kadath::Tensor::valence.

◆ operator()() [6/7]

const Scalar & Kadath::Tensor::operator() ( int  i1,
int  i2,
int  i3 
) const
inlineinherited

Returns the value of a component for a tensor of valence 3 (read only version).

Parameters
i1value of the first index
i2value of the second index
i3value of the third index
Returns
the component specified by (i1,i2,i3)

Definition at line 139 of file tensor_impl.hpp.

References Kadath::Tensor::cmp, Kadath::Tensor::position(), Kadath::Array< T >::set(), and Kadath::Tensor::valence.

◆ operator()() [7/7]

const Scalar & Kadath::Tensor::operator() ( int  i1,
int  i2,
int  i3,
int  i4 
) const
inlineinherited

Returns the value of a component for a tensor of valence 4 (read only version).

Parameters
i1value of the first index
i2value of the second index
i3value of the third index
i4value of the fourth index
Returns
the component specified by (i1,i2,i3,i4)

Definition at line 151 of file tensor_impl.hpp.

References Kadath::Tensor::cmp, Kadath::Tensor::position(), Kadath::Array< T >::set(), and Kadath::Tensor::valence.

◆ operator+=()

◆ operator-=()

◆ operator=() [1/3]

Metric_tensor & Kadath::Metric_tensor::operator= ( const Metric_tensor so)

◆ operator=() [2/3]

Metric_tensor & Kadath::Metric_tensor::operator= ( const Tensor t)
overridevirtual

◆ operator=() [3/3]

Metric_tensor & Kadath::Metric_tensor::operator= ( double  xx)
overridevirtual

Assignment to a double (the same value for all the components at all the collocation points).

Reimplemented from Kadath::Tensor.

Definition at line 171 of file metric_tensor.cpp.

References Kadath::Tensor::cmp, and Kadath::Tensor::n_comp.

◆ position() [1/2]

virtual int Kadath::Tensor::position ( const Array< int > &  idx) const
inlinevirtualinherited

Gives the location of a given component in the array used for storage (Array version).

Parameters
idx: values of the indices.
Returns
: the storage location.

Reimplemented in Kadath::Vector.

Definition at line 470 of file tensor.hpp.

References Kadath::Tensor::give_place_array, and Kadath::Tensor::ndim.

◆ position() [2/2]

virtual int Kadath::Tensor::position ( const Index idx) const
inlinevirtualinherited

Gives the location of a given component in the array used for storage (Index version).

Parameters
idx: values of the indices.
Returns
: the storage location.

Reimplemented in Kadath::Vector.

Definition at line 477 of file tensor.hpp.

References Kadath::Tensor::give_place_index, and Kadath::Tensor::ndim.

◆ save()

void Kadath::Tensor::save ( FILE *  fd) const
virtualinherited

◆ set() [1/7]

Scalar& Kadath::Tensor::set ( )
inlineinherited

Read/write for a Scalar.

Definition at line 364 of file tensor.hpp.

References Kadath::Tensor::cmp, and Kadath::Tensor::valence.

◆ set() [2/7]

Scalar & Kadath::Tensor::set ( const Array< int > &  ind)
inlineinherited

Returns the value of a component (read/write version).

Parameters
indArray of size valence containing the values of each index specifing the component, with the following storage convention:
  • ind(0) : value of the first index
  • ind(1) : value of the second index
  • and so on...
Returns
modifiable reference on the component specified by ind

Definition at line 91 of file tensor_impl.hpp.

References Kadath::Tensor::cmp, Kadath::Array< T >::get_ndim(), Kadath::Array< T >::get_size(), Kadath::Tensor::position(), and Kadath::Tensor::valence.

◆ set() [3/7]

Scalar & Kadath::Tensor::set ( const Index ind)
inlineinherited

Returns the value of a component (read/write version).

Parameters
ind1-D Index of size valence containing the values of each index specifing the component, with the following storage convention:
  • ind(0) : value of the first index
  • ind(1) : value of the second index
  • and so on...
Returns
modifiable reference on the component specified by ind

Definition at line 101 of file tensor_impl.hpp.

References Kadath::Tensor::set(), Kadath::Array< T >::set(), and Kadath::Tensor::valence.

◆ set() [4/7]

Scalar & Kadath::Tensor::set ( int  i)
inlineinherited

Returns the value of a component for a tensor of valence 1 (read/write version).

Parameters
ivalue of the first index
Returns
modifiable reference on the component specified by (i1)

Definition at line 33 of file tensor_impl.hpp.

References Kadath::Tensor::cmp, Kadath::Tensor::position(), Kadath::Array< T >::set(), and Kadath::Tensor::valence.

◆ set() [5/7]

Scalar & Kadath::Tensor::set ( int  i1,
int  i2 
)
inlineinherited

Returns the value of a component for a tensor of valence 2 (read/write version).

Parameters
i1value of the first index
i2value of the second index
Returns
modifiable reference on the component specified by (i1,i2)

Definition at line 46 of file tensor_impl.hpp.

References Kadath::Tensor::cmp, Kadath::Tensor::position(), Kadath::Array< T >::set(), and Kadath::Tensor::valence.

◆ set() [6/7]

Scalar & Kadath::Tensor::set ( int  i1,
int  i2,
int  i3 
)
inlineinherited

Returns the value of a component for a tensor of valence 3 (read/write version).

Parameters
i1value of the first index
i2value of the second index
i3value of the third index
Returns
modifiable reference on the component specified by (i1,i2,i3)

Definition at line 60 of file tensor_impl.hpp.

References Kadath::Tensor::cmp, Kadath::Tensor::position(), Kadath::Array< T >::set(), and Kadath::Tensor::valence.

◆ set() [7/7]

Scalar & Kadath::Tensor::set ( int  i1,
int  i2,
int  i3,
int  i4 
)
inlineinherited

Returns the value of a component for a tensor of valence 4 (read/write version).

Parameters
i1value of the first index
i2value of the second index
i3value of the third index
i4value of the fourth index
Returns
modifiable reference on the component specified by (i1,i2,i3,i4)

Definition at line 75 of file tensor_impl.hpp.

References Kadath::Tensor::cmp, Kadath::Tensor::position(), Kadath::Array< T >::set(), and Kadath::Tensor::valence.

◆ set_basis()

int& Kadath::Tensor::set_basis ( int  dd)
inlineinherited

Assigns a new tensorial basis in a given domain.

Parameters
dd: the index of the Domain.

Definition at line 331 of file tensor.hpp.

References Kadath::Tensor::basis, and Kadath::Base_tensor::set_basis().

◆ set_index_type() [1/2]

Array<int>& Kadath::Tensor::set_index_type ( )
inlineinherited

Sets the types of all the indices.

Returns
a reference on an array describing the types of all the indices (CON or COV).

Definition at line 545 of file tensor.hpp.

References Kadath::Tensor::type_indice.

◆ set_index_type() [2/2]

int& Kadath::Tensor::set_index_type ( int  i)
inlineinherited

Sets the type of the index number.

Parameters
i: the index number (>=1)
Returns
set to COV or CON.

Definition at line 538 of file tensor.hpp.

References Kadath::Array< T >::set(), and Kadath::Tensor::type_indice.

◆ set_name_affected()

void Kadath::Tensor::set_name_affected ( )
inlineinherited

Affects the name of the indices.

They have to be given values afterwards.

Definition at line 435 of file tensor.hpp.

References Kadath::Tensor::name_affected.

◆ set_name_ind()

void Kadath::Tensor::set_name_ind ( int  dd,
char  name 
)
inlineinherited

Sets the name of one index ; the names must have been affected first.

Parameters
dd: which index ?
name: the name.

Definition at line 186 of file tensor_impl.hpp.

References Kadath::Tensor::name_affected, Kadath::Tensor::name_indice, and Kadath::Tensor::valence.

◆ set_parameters()

Param_tensor& Kadath::Tensor::set_parameters ( )
inlineinherited

Read/write of the parameters.

Definition at line 314 of file tensor.hpp.

References Kadath::Tensor::parameters.

◆ std_base()

void Kadath::Tensor::std_base ( )
virtualinherited

◆ std_base2()

void Kadath::Metric_tensor::std_base2 ( )

Specialized base setting (for AADS)

Definition at line 223 of file metric_tensor.cpp.

References Kadath::Tensor::basis, Kadath::Tensor::cmp, Kadath::Base_tensor::get_basis(), and Kadath::Tensor::ndom.

◆ swap()

void Kadath::Tensor::swap ( Tensor so)
noexceptinherited

Swap method.

Definition at line 270 of file tensor.cpp.

Member Data Documentation

◆ basis

Base_tensor Kadath::Tensor::basis
protectedinherited

Tensorial basis with respect to which the tensor components are defined.

Definition at line 163 of file tensor.hpp.

◆ cmp

Memory_mapped_array<Scalar *> Kadath::Tensor::cmp
protectedinherited

Array of size n_comp of pointers onto the components.

Definition at line 179 of file tensor.hpp.

◆ espace

const Space& Kadath::Tensor::espace
protectedinherited

The Space.

Definition at line 154 of file tensor.hpp.

◆ give_indices

Array<int>(* Kadath::Tensor::give_indices) (int, int, int)
protectedinherited

Pointer on the function that gives the indices corresponding to a give storage location.

Definition at line 185 of file tensor.hpp.

◆ give_place_array

int(* Kadath::Tensor::give_place_array) (const Array< int > &, int)
protectedinherited

Pointer on the function that gives the storage location corresponding to a set of indices values. (Array version)

Definition at line 184 of file tensor.hpp.

◆ give_place_index

int(* Kadath::Tensor::give_place_index) (const Index &, int)
protectedinherited

Pointer on the function that gives the storage location corresponding to a set of indices values. (Index version)

Definition at line 185 of file tensor.hpp.

◆ n_comp

int Kadath::Tensor::n_comp
protectedinherited

Number of stored components, depending on the symmetry.

Definition at line 178 of file tensor.hpp.

◆ name_affected

bool Kadath::Tensor::name_affected
protectedinherited

Indicator that states if the indices have been given names.

Definition at line 172 of file tensor.hpp.

◆ name_indice

Memory_mapped_array<char> Kadath::Tensor::name_indice
protectedinherited

If the indices haves names they are stored here.

Each index is associated with a character.

Definition at line 176 of file tensor.hpp.

◆ ndim

int Kadath::Tensor::ndim
protectedinherited

The dimension/.

Definition at line 156 of file tensor.hpp.

◆ ndom

int Kadath::Tensor::ndom
protectedinherited

The number of Domain.

Definition at line 155 of file tensor.hpp.

◆ parameters

Param_tensor Kadath::Tensor::parameters
protectedinherited

Possible additional parameters relevant for the current Tensor.

Definition at line 181 of file tensor.hpp.

◆ type_indice

Array<int> Kadath::Tensor::type_indice
protectedinherited

1D array of integers of size valence containing the type of each index: COV for a covariant one and CON for a contravariant one.

Definition at line 170 of file tensor.hpp.

◆ valence

int Kadath::Tensor::valence
protectedinherited

Valence of the tensor (0 = scalar, 1 = vector, etc...)

Definition at line 157 of file tensor.hpp.


The documentation for this class was generated from the following files: