KADATH
Kadath::Vector Class Reference

A class derived from Tensor to deal specificaly with objects of valence 1 (and so also 1-forms). More...

#include <vector.hpp>

Inheritance diagram for Kadath::Vector:
Kadath::Tensor

Public Member Functions

 Vector (const Space &sp, int tipe, const Base_tensor &ba)
 Standard constructor. More...
 
 Vector (const Vector &a)
 Copy constructor. More...
 
 Vector (const Space &sp, FILE *ff)
 Constructor from file. More...
 
 Vector (const Tensor &a)
 Constructor from a Tensor . More...
 
Vectoroperator= (const Vector &)
 Assignment to another Vector. More...
 
Vectoroperator= (const Tensor &) override
 Assignment to a Tensor. More...
 
Vectoroperator= (double) override
 Assignment to a double (the same value for all the components at all the collocation points). More...
 
void annule_hard () override
 Sets the Tensor to zero (hard version ; no logical state used). More...
 
Scalarset (int)
 Read/write access to a component. More...
 
const Scalaroperator() (int) const
 Readonly access to a component. More...
 
const Scalarat (int) const
 Readonly access to a 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...
 
int get_index_type () const
 Returns the type of the objects (CON or COV) More...
 
virtual Array< int > indices (int place) const
 Gives the values of the indices corresponding to a location in the array used for storage of the components. 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 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...
 
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 (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...
 
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...
 
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 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

A class derived from Tensor to deal specificaly with objects of valence 1 (and so also 1-forms).

Definition at line 41 of file vector.hpp.

Constructor & Destructor Documentation

◆ Vector() [1/4]

Kadath::Vector::Vector ( const Space sp,
int  tipe,
const Base_tensor ba 
)
inline

Standard constructor.

Parameters
sp: the Space.
tipe: the type tensor (COV vs CON).
ba: the tensorial basis used.

Definition at line 49 of file vector.hpp.

◆ Vector() [2/4]

Kadath::Vector::Vector ( const Vector a)
inline

Copy constructor.

Definition at line 51 of file vector.hpp.

◆ Vector() [3/4]

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

Constructor from file.

Definition at line 52 of file vector.hpp.

References Kadath::Tensor::valence.

◆ Vector() [4/4]

Kadath::Vector::Vector ( const Tensor a)
inline

Constructor from a Tensor .

The Tensor must be of valence one.

Definition at line 57 of file vector.hpp.

References Kadath::Tensor::valence.

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::Vector::annule_hard ( )
inlineoverridevirtual

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

Reimplemented from Kadath::Tensor.

Definition at line 229 of file tensor_impl.hpp.

References Kadath::Tensor::cmp.

◆ at() [1/2]

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()().

◆ at() [2/2]

const Scalar & Kadath::Vector::at ( int  index) const
inline

Readonly access to a component.

Definition at line 249 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]

int Kadath::Vector::get_index_type ( ) const
inline

Returns the type of the objects (CON or COV)

Definition at line 98 of file vector.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_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::Vector::indices ( int  pos) const
inlinevirtual

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 from Kadath::Tensor.

Definition at line 100 of file vector.hpp.

References Kadath::Tensor::espace, and Kadath::Space::get_ndim().

◆ 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  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()() [5/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()() [6/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()() [7/7]

const Scalar & Kadath::Vector::operator() ( int  index) const
inline

Readonly access to a component.

Definition at line 244 of file tensor_impl.hpp.

References Kadath::Tensor::cmp.

◆ operator+=()

◆ operator-=()

◆ operator=() [1/3]

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

◆ operator=() [2/3]

Vector & Kadath::Vector::operator= ( const Vector t)

Assignment to another Vector.

Definition at line 25 of file vector.cpp.

References Kadath::Tensor::basis, Kadath::Tensor::cmp, Kadath::Tensor::espace, and Kadath::Tensor::type_indice.

◆ operator=() [3/3]

Vector & Kadath::Vector::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 51 of file vector.cpp.

References Kadath::Tensor::cmp.

◆ position() [1/2]

virtual int Kadath::Vector::position ( const Array< int > &  idx) const
inlinevirtual

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 from Kadath::Tensor.

Definition at line 82 of file vector.hpp.

References Kadath::Tensor::espace, Kadath::Array< T >::get_ndim(), Kadath::Space::get_ndim(), and Kadath::Array< T >::get_size().

◆ position() [2/2]

virtual int Kadath::Vector::position ( const Index idx) const
inlinevirtual

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 from Kadath::Tensor.

Definition at line 90 of file vector.hpp.

References Kadath::Tensor::ndim.

◆ save()

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

◆ set() [1/13]

Scalar& Kadath::Tensor::set
inline

Read/write for a Scalar.

Definition at line 364 of file tensor.hpp.

◆ set() [2/13]

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/13]

Scalar & Kadath::Tensor::set
inline

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 349 of file tensor_impl.hpp.

◆ set() [4/13]

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() [5/13]

Scalar & Kadath::Tensor::set
inline

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 362 of file tensor_impl.hpp.

◆ set() [6/13]

Scalar & Kadath::Tensor::set
inline

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 375 of file tensor_impl.hpp.

◆ set() [7/13]

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() [8/13]

Scalar & Kadath::Tensor::set
inline

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 386 of file tensor_impl.hpp.

◆ set() [9/13]

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() [10/13]

Scalar & Kadath::Tensor::set
inline

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 399 of file tensor_impl.hpp.

◆ set() [11/13]

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() [12/13]

Scalar & Kadath::Tensor::set
inline

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 412 of file tensor_impl.hpp.

◆ set() [13/13]

Scalar & Kadath::Vector::set ( int  index)
inline

Read/write access to a component.

Definition at line 239 of file tensor_impl.hpp.

References Kadath::Tensor::cmp.

◆ 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

◆ 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: