KADATH
Kadath::Scalar Class Reference

The class Scalar does not really implements scalars in the mathematical sense but rather tensorial coordinates of tensors. More...

#include <scalar.hpp>

Inheritance diagram for Kadath::Scalar:
Kadath::Tensor

Public Member Functions

 Scalar (const Space &)
 Standard constructor. More...
 
 Scalar (const Scalar &so, bool copy=true)
 Copy constructor. More...
 
 Scalar (const Tensor &so, bool copy=true)
 Constructor from a Tensor. More...
 
 Scalar (const Space &sp, FILE *fd)
 Constructor from a file. More...
 
 ~Scalar () override
 Destructor. More...
 
virtual void save (FILE *) const
 Saving function. More...
 
int get_ndim () const
 
int get_nbr_domains () const
 
const Domainget_domain (int i) const
 
const Spaceget_space () const
 
virtual string get_class_name () const
 Gives the class of the tensor. More...
 
Val_domainset_domain (int)
 Read/write of a particular Val_domain. More...
 
const Val_domainoperator() (int) const
 Read only of a particular Val_domain. More...
 
const Val_domainat (int) const
 Read only of a particular Val_domain. More...
 
Scalaroperator= (const Scalar &)
 Assignement to another Scalar. More...
 
Scalaroperator= (const Tensor &) override
 Assignement to a Tensor (must be scalar) More...
 
Scalaroperator= (double)
 Assignment to a double (sets all the values in the configuration space to that value. More...
 
virtual void annule_hard ()
 Sets the value to zero everywhere in the collocation space (the logical state of the Val_domain is NOT zero). More...
 
virtual void annule_hard_coef ()
 Sets the value to zero everywhere in the coefficient space(the logical state of the Val_domain is NOT zero). More...
 
Scalar der_var (int) const
 Returns the derivative with respect to one particular numerical coordinate. More...
 
Scalar der_abs (int) const
 Returns the derivative with respect to one particular absolute Cartesian coordinate. More...
 
Scalar der_spher (int) const
 Returns the derivative with respect to one particular absolute Cartesian coordinate. More...
 
Scalar der_r () const
 Returns the radial derivative. More...
 
Scalar div_r () const
 Returns the division by $ r$. More...
 
Scalar div_rsint () const
 Returns the division by $ r\sin \theta$. More...
 
Scalar div_1mx2 () const
 Returns the division by $ 1-x^2$. More...
 
Scalar mult_cos_theta () const
 Returns the multiplication by $\cos \theta$. More...
 
Scalar mult_sin_theta () const
 Returns the multiplication by $\sin \theta$. More...
 
Scalar mult_cos_phi () const
 Returns the multiplication by $\cos \varphi$. More...
 
Scalar mult_sin_phi () const
 Returns the multiplication by $\sin \varphi$. More...
 
double integrale () const
 Returns the integral in the whole space. More...
 
Scalar mult_r () const
 Returns the multiplication by r. More...
 
Vector grad () const
 Computes the gradient (in Cartesian coordinates). More...
 
void set_in_conf ()
 Destroys the values in the coefficient space. More...
 
void set_in_coef ()
 Destroys the values in the configuration space. More...
 
void allocate_conf ()
 Allocates the values in the configuration space and destroys the values in the coefficients space. More...
 
void allocate_coef ()
 Allocates the values in the coefficient space and destroys the values in the configuration space. More...
 
void std_base ()
 Sets the standard basis of decomposition. More...
 
void std_anti_base ()
 Sets the standard, anti-symetric, basis of decomposition. More...
 
void std_base (int m)
 Sets the standard basis of decomposition assuming a given harmonic wrt $\varphi$. More...
 
void std_base (int l, int m)
 Sets the standard basis of decomposition assuming a given harmonic wrt $\varphi$ and $\theta$. More...
 
void std_anti_base (int m)
 Sets the standard, anti-symetric, basis of decomposition assuming a given harmonic wrt $\varphi$. More...
 
void std_base_r_spher ()
 Sets the basis for the radial component of a vector in orthonormal spherical coordinates. More...
 
void std_base_t_spher ()
 Sets the basis for the $\theta$ component of a vector in orthonormal spherical coordinates. More...
 
void std_base_p_spher ()
 Sets the basis for the $\varphi$ component of a vector in orthonormal spherical coordinates. More...
 
void std_base_domain (int)
 Sets the standard basis of decomposition, in a given Domain. More...
 
void std_anti_base_domain (int)
 Sets the standard, anti-symetric, basis of decomposition, in a given Domain. More...
 
void std_base_domain (int, int m)
 Sets the standard basis of decomposition assuming a given harmonic wrt $\varphi$, in a given Domain. More...
 
void std_base_domain (int d, int l, int m)
 Sets the standard basis of decomposition assuming a given harmonic wrt $\varphi$ and $\theta$, in a given Domain. More...
 
void std_base_r_spher_domain (int)
 Sets the basis for the radial component of a vector in orthonormal spherical coordinates, in a given Domain. More...
 
void std_base_t_spher_domain (int)
 Sets the basis for the $\theta$ component of a vector in orthonormal spherical coordinates, in a given Domain. More...
 
void std_base_p_spher_domain (int)
 Sets the basis for the $\varphi$ component of a vector in orthonormal spherical coordinates, in a given Domain. More...
 
void std_base_x_cart_domain (int)
 Sets the basis for the X-component of a vector in Cartesian coordinates, in a given Domain. More...
 
void std_base_y_cart_domain (int)
 Sets the basis for the Y-component of a vector in Cartesian coordinates, in a given Domain. More...
 
void std_base_z_cart_domain (int)
 Sets the basis for the Z-component of a vector in Cartesian coordinates, in a given Domain. More...
 
void std_base_rt_spher_domain (int d)
 Sets the basis for the $(r,\theta)$ component of a 2-tensor in orthonormal spherical coordinates, in a given Domain. More...
 
void std_base_rp_spher_domain (int d)
 Sets the basis for the $(r,\varphi)$ component of a 2-tensor in orthonormal spherical coordinates, in a given Domain. More...
 
void std_base_tp_spher_domain (int d)
 Sets the basis for the $(\theta, \varphi)$ component of a 2-tensor in orthonormal spherical coordinates, in a given Domain. More...
 
void std_base_xy_cart_domain (int d)
 Sets the basis for the XY component of a 2-tensor in Cartesian coordinates, in a given Domain. More...
 
void std_base_xz_cart_domain (int d)
 Sets the basis for the XZ component of a 2-tensor in Cartesian coordinates, in a given Domain. More...
 
void std_base_yz_cart_domain (int d)
 Sets the basis for the YZ component of a 2-tensor in Cartesian coordinates, in a given Domain. More...
 
void std_base_r_mtz_domain (int)
 Sets the basis for the radial component of a vector in orthonormal coordinates in the MTZ context, in a given Domain. More...
 
void std_base_t_mtz_domain (int)
 Sets the basis for the $\theta$ component of a vector in orthonormal coordinates in the MTZ context, in a given Domain. More...
 
void std_base_p_mtz_domain (int)
 Sets the basis for the $\varphi$ component of a vector in orthonormal coordinates in the MTZ context, in a given Domain. More...
 
void std_xodd_base ()
 Sets the basis for an odd function in $X$ (Critic case). More...
 
void std_todd_base ()
 Sets the basis for an odd function in $T$ (Critic case). More...
 
void std_xodd_todd_base ()
 Sets the basis for an odd function in $X$ and $T$ (Critic case). More...
 
void std_base_odd ()
 Sets the basis in odd polynomials. More...
 
void set_val_inf (double xx)
 Sets the value at infinity (in the last domain) to xx. More...
 
void set_val_inf (double xx, int l)
 Sets the value at infinity (in the domain l) to xx. More...
 
double integ_volume () const
 
double val_point (const Point &xxx, int sens=-1) const
 Computes the value of the field at a given point, by doing the spectral summation. More...
 
double val_point_zeronotdef (const Point &xxx, int sens=-1) const
 Computes the value of the field at a given point, by doing the spectral summation. More...
 
void import (const Scalar &so)
 Affects all the values to the one of another scalar. More...
 
void coef () const
 Computes the coefficients. More...
 
void coef_i () const
 Computes the values in the configuration space. 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...
 
void operator+= (const Scalar &)
 Operator +=. More...
 
void operator-= (const Scalar &)
 Operator -=. More...
 
void operator*= (const Scalar &)
 Operator *=. More...
 
void operator/= (const Scalar &)
 Operator /=. More...
 
void operator+= (double)
 Operator +=. More...
 
void operator-= (double)
 Operator -=. More...
 
void operator*= (double)
 Operator *=. More...
 
void operator/= (double)
 Operator /=. More...
 
void swap (Tensor &) noexcept
 Swap method. 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 ()
 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...
 
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 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_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 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 operator+= (const Tensor &)
 += Tensor More...
 
void operator-= (const Tensor &)
 -= Tensor More...
 

Static Public Member Functions

static Scalar zero (Space const &espace)
 

Protected Attributes

Memory_mapped_array< Val_domain * > val_zones
 Pointers on the various Val_domain describing the field in each Domain. More...
 
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...
 

Friends

class Space
 
class Space_spheric
 
ostream & operator<< (ostream &o, const Scalar &)
 Display. More...
 
Scalar operator+ (const Scalar &)
 Operator + (unitary version) More...
 
Scalar operator- (const Scalar &)
 Operator - (unitary version) More...
 
Scalar operator+ (const Scalar &, const Scalar &)
 Operator +. More...
 
Scalar operator+ (const Scalar &, double)
 Operator +. More...
 
Scalar operator+ (double, const Scalar &)
 Operator +. More...
 
Scalar operator- (const Scalar &, const Scalar &)
 Operator -. More...
 
Scalar operator- (const Scalar &, double)
 Operator -. More...
 
Scalar operator- (double, const Scalar &)
 Operator -. More...
 
Scalar operator* (const Scalar &, const Scalar &)
 Operator *. More...
 
Scalar operator* (const Scalar &, double)
 Operator *. More...
 
Scalar operator* (double, const Scalar &)
 Operator *. More...
 
Scalar operator/ (const Scalar &, const Scalar &)
 Operator /. More...
 
Scalar operator/ (const Scalar &, double)
 Operator /. More...
 
Scalar operator/ (double, const Scalar &)
 Operator /. More...
 
Scalar pow (const Scalar &, int)
 Operator power (integer version) More...
 
Scalar pow (const Scalar &, double)
 Operator power (double version) More...
 
Scalar sqrt (const Scalar &)
 Operator square root. More...
 
Scalar exp (const Scalar &)
 Operator exponential. More...
 
Scalar sin (const Scalar &)
 Operator sine. More...
 
Scalar cos (const Scalar &)
 Operator cosine. More...
 
double diffmax (const Scalar &, const Scalar &)
 Maximal difference. More...
 
Scalar operator+ (const Tensor &, const Scalar &)
 Operator +. More...
 
Scalar operator+ (const Scalar &, const Tensor &)
 Operator +. More...
 
Scalar operator- (const Tensor &, const Scalar &)
 Operator -. More...
 
Scalar operator- (const Scalar &, const Tensor &)
 Operator -. More...
 
Tensor operator* (const Scalar &, const Tensor &)
 Operator *. More...
 
Tensor operator* (const Tensor &, const Scalar &)
 Operator *. More...
 
Tensor operator/ (const Tensor &, const Scalar &)
 Operator /. More...
 

Detailed Description

The class Scalar does not really implements scalars in the mathematical sense but rather tensorial coordinates of tensors.

This class is mainly an array of various Val_domain. It also stores some quantities like the derivatives of the field with respect to the absolute Cartesian coordinates.

Definition at line 67 of file scalar.hpp.

Constructor & Destructor Documentation

◆ Scalar() [1/4]

Kadath::Scalar::Scalar ( const Space sp)
inline

Standard constructor.

The value of the field is not initialized.

Parameters
sp[input] : the space on which the field is defined.

Definition at line 319 of file scalar.hpp.

References Kadath::Tensor::cmp, Kadath::Space::get_domain(), Kadath::Tensor::ndom, and val_zones.

◆ Scalar() [2/4]

Kadath::Scalar::Scalar ( const Scalar so,
bool  copy = true 
)
inline

Copy constructor.

Parameters
so[input] : Scalar to be copied.
copy[input] : the values of so are only copied if copy is true. Otherwise, the values of the field are left uninitialized.

Definition at line 325 of file scalar.hpp.

References Kadath::Tensor::cmp, Kadath::Tensor::get_parameters(), Kadath::Tensor::ndom, Kadath::Tensor::parameters, Kadath::Tensor::set_parameters(), and val_zones.

◆ Scalar() [3/4]

Kadath::Scalar::Scalar ( const Tensor so,
bool  copy = true 
)
inline

Constructor from a Tensor.

Parameters
so[input] : Tensor to be copied : it must be a valence zero tensor.
copy[input] : the values of so are only copied if copy is true. Otherwise, the values of the field are left uninitialized.

Definition at line 334 of file scalar.hpp.

References Kadath::Tensor::cmp, Kadath::Tensor::get_parameters(), Kadath::Tensor::ndom, Kadath::Tensor::parameters, Kadath::Tensor::set_parameters(), val_zones, and Kadath::Tensor::valence.

◆ Scalar() [4/4]

Kadath::Scalar::Scalar ( const Space sp,
FILE *  fd 
)
inline

Constructor from a file.

Parameters
sp: the Space.
fd: file (generated by the saving function).

Definition at line 345 of file scalar.hpp.

References Kadath::Tensor::cmp, Kadath::Space::get_domain(), Kadath::Tensor::ndom, and val_zones.

◆ ~Scalar()

Kadath::Scalar::~Scalar ( )
inlineoverride

Destructor.

Definition at line 368 of file scalar.hpp.

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

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.

◆ allocate_coef()

void Kadath::Scalar::allocate_coef ( )
inline

Allocates the values in the coefficient space and destroys the values in the configuration space.

Definition at line 540 of file scalar.hpp.

References Kadath::Tensor::ndom, and val_zones.

◆ allocate_conf()

void Kadath::Scalar::allocate_conf ( )
inline

Allocates the values in the configuration space and destroys the values in the coefficients space.

Definition at line 535 of file scalar.hpp.

References Kadath::Tensor::ndom, and val_zones.

◆ annule_hard()

void Kadath::Scalar::annule_hard ( )
inlinevirtual

Sets the value to zero everywhere in the collocation space (the logical state of the Val_domain is NOT zero).

Reimplemented from Kadath::Tensor.

Definition at line 379 of file scalar.hpp.

References Kadath::Val_domain::annule_hard(), Kadath::Tensor::ndom, and set_domain().

◆ annule_hard_coef()

void Kadath::Scalar::annule_hard_coef ( )
inlinevirtual

Sets the value to zero everywhere in the coefficient space(the logical state of the Val_domain is NOT zero).

Definition at line 384 of file scalar.hpp.

References Kadath::Val_domain::annule_hard_coef(), Kadath::Tensor::ndom, and set_domain().

◆ 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 Val_domain & Kadath::Scalar::at ( int  i) const
inline

Read only of a particular Val_domain.

Definition at line 550 of file scalar.hpp.

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

◆ change_basis_cart_to_spher()

◆ change_basis_spher_to_cart()

◆ coef()

void Kadath::Scalar::coef ( ) const
inline

Computes the coefficients.

Definition at line 568 of file scalar.hpp.

References Kadath::Tensor::ndom, and val_zones.

◆ coef_i()

void Kadath::Scalar::coef_i ( ) const
inline

Computes the values in the configuration space.

Definition at line 574 of file scalar.hpp.

References Kadath::Tensor::ndom, and val_zones.

◆ der_abs()

Scalar Kadath::Scalar::der_abs ( int  var) const

Returns the derivative with respect to one particular absolute Cartesian coordinate.

Definition at line 149 of file scalar.cpp.

References Kadath::Tensor::ndom, set_domain(), and val_zones.

◆ der_r()

Scalar Kadath::Scalar::der_r ( ) const

Returns the radial derivative.

Definition at line 165 of file scalar.cpp.

References Kadath::Tensor::ndom, set_domain(), and val_zones.

◆ der_spher()

Scalar Kadath::Scalar::der_spher ( int  var) const

Returns the derivative with respect to one particular absolute Cartesian coordinate.

Definition at line 157 of file scalar.cpp.

References Kadath::Tensor::ndom, set_domain(), and val_zones.

◆ der_var()

Scalar Kadath::Scalar::der_var ( int  var) const

Returns the derivative with respect to one particular numerical coordinate.

Definition at line 142 of file scalar.cpp.

References Kadath::Tensor::ndom, set_domain(), and val_zones.

◆ div_1mx2()

Scalar Kadath::Scalar::div_1mx2 ( ) const

Returns the division by $ 1-x^2$.

Definition at line 58 of file scalar_calculus.cpp.

References div_1mx2(), Kadath::Tensor::ndom, Kadath::Tensor::operator()(), and set_domain().

◆ div_r()

Scalar Kadath::Scalar::div_r ( ) const

Returns the division by $ r$.

Definition at line 33 of file scalar_calculus.cpp.

References Kadath::Tensor::ndom, set_domain(), and val_zones.

◆ div_rsint()

Scalar Kadath::Scalar::div_rsint ( ) const

Returns the division by $ r\sin \theta$.

Definition at line 49 of file scalar_calculus.cpp.

References Kadath::Val_domain::div_sin_theta(), Kadath::Tensor::ndom, set_domain(), and val_zones.

◆ 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(), 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::Scalar::filter_phi ( int  dom,
int  ncf 
)

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 130 of file scalar.cpp.

References coef(), get_domain(), Kadath::Space::get_domain(), Kadath::Domain::get_nbr_coefs(), get_space(), Kadath::Index::inc(), Kadath::Val_domain::set_coef(), and set_domain().

◆ 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_class_name()

virtual string Kadath::Scalar::get_class_name ( ) const
inlinevirtual

Gives the class of the tensor.

Definition at line 131 of file scalar.hpp.

◆ get_domain()

const Domain* Kadath::Scalar::get_domain ( int  i) const
inline
Parameters
i: index of the desired Domain
Returns
Pointer on a particular domain.

Definition at line 122 of file scalar.hpp.

References val_zones.

◆ 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_nbr_domains()

int Kadath::Scalar::get_nbr_domains ( ) const
inline
Returns
the number of domains.

Definition at line 117 of file scalar.hpp.

References Kadath::Tensor::ndom.

◆ get_ndim()

int Kadath::Scalar::get_ndim ( ) const
inline
Returns
the number of dimensions.

Definition at line 113 of file scalar.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::Scalar::get_space ( ) const
inline
Returns
the Space.

Definition at line 126 of file scalar.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()

Vector Kadath::Scalar::grad ( ) const

Computes the gradient (in Cartesian coordinates).

Definition at line 24 of file scalar_calculus.cpp.

References der_abs(), Kadath::Tensor::espace, Kadath::Tensor::ndim, and Kadath::Vector::set().

◆ import()

void Kadath::Scalar::import ( const Scalar so)

Affects all the values to the one of another scalar.

This is done by using spectral summation and so does not requires the two fields to be have the same collocation points.

Parameters
so: the source Scalar.

Definition at line 26 of file import.cpp.

References allocate_conf(), Kadath::Domain::get_cart(), get_domain(), Kadath::Space::get_domain(), get_nbr_domains(), Kadath::Domain::get_nbr_points(), get_space(), Kadath::Index::inc(), Kadath::Tensor::ndim, Kadath::Tensor::set(), Kadath::Point::set(), set_in_conf(), val_point(), and val_zones.

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

◆ integ_volume()

double Kadath::Scalar::integ_volume ( ) const
Returns
integral in the whole space.

Definition at line 191 of file scalar.cpp.

References Kadath::Tensor::ndom, and val_zones.

◆ integrale()

double Kadath::Scalar::integrale ( ) const

Returns the integral in the whole space.

Definition at line 173 of file scalar.cpp.

References Kadath::Tensor::ndom, and val_zones.

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

◆ mult_cos_phi()

Scalar Kadath::Scalar::mult_cos_phi ( ) const

Returns the multiplication by $\cos \varphi$.

Definition at line 84 of file scalar_calculus.cpp.

References mult_cos_phi(), Kadath::Tensor::ndom, Kadath::Tensor::operator()(), and set_domain().

◆ mult_cos_theta()

Scalar Kadath::Scalar::mult_cos_theta ( ) const

Returns the multiplication by $\cos \theta$.

Definition at line 68 of file scalar_calculus.cpp.

References mult_cos_theta(), Kadath::Tensor::ndom, Kadath::Tensor::operator()(), and set_domain().

◆ mult_r()

Scalar Kadath::Scalar::mult_r ( ) const

Returns the multiplication by r.

Copy using unique_ptr

Definition at line 41 of file scalar_calculus.cpp.

References Kadath::Tensor::ndom, set_domain(), and val_zones.

◆ mult_sin_phi()

Scalar Kadath::Scalar::mult_sin_phi ( ) const

Returns the multiplication by $\sin \varphi$.

Definition at line 92 of file scalar_calculus.cpp.

References mult_sin_phi(), Kadath::Tensor::ndom, Kadath::Tensor::operator()(), and set_domain().

◆ mult_sin_theta()

Scalar Kadath::Scalar::mult_sin_theta ( ) const

Returns the multiplication by $\sin \theta$.

Definition at line 76 of file scalar_calculus.cpp.

References mult_sin_theta(), Kadath::Tensor::ndom, Kadath::Tensor::operator()(), and set_domain().

◆ 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 Val_domain & Kadath::Scalar::operator() ( int  i) const
inline

Read only of a particular Val_domain.

Definition at line 546 of file scalar.hpp.

References Kadath::Tensor::ndom, and val_zones.

◆ operator*=() [1/2]

void Kadath::Scalar::operator*= ( const Scalar so)

Operator *=.

Definition at line 33 of file scalar_math.cpp.

References Kadath::Tensor::espace.

◆ operator*=() [2/2]

void Kadath::Scalar::operator*= ( double  xx)

Operator *=.

Definition at line 52 of file scalar_math.cpp.

◆ operator+=() [1/3]

void Kadath::Scalar::operator+= ( const Scalar so)

Operator +=.

Definition at line 23 of file scalar_math.cpp.

References Kadath::Tensor::espace.

◆ operator+=() [2/3]

◆ operator+=() [3/3]

void Kadath::Scalar::operator+= ( double  xx)

Operator +=.

Definition at line 43 of file scalar_math.cpp.

◆ operator-=() [1/3]

void Kadath::Scalar::operator-= ( const Scalar so)

Operator -=.

Definition at line 28 of file scalar_math.cpp.

References Kadath::Tensor::espace.

◆ operator-=() [2/3]

◆ operator-=() [3/3]

void Kadath::Scalar::operator-= ( double  xx)

Operator -=.

Definition at line 47 of file scalar_math.cpp.

◆ operator/=() [1/2]

void Kadath::Scalar::operator/= ( const Scalar so)

Operator /=.

Definition at line 38 of file scalar_math.cpp.

References Kadath::Tensor::espace.

◆ operator/=() [2/2]

void Kadath::Scalar::operator/= ( double  xx)

Operator /=.

Definition at line 57 of file scalar_math.cpp.

◆ operator=() [1/3]

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

Assignement to another Scalar.

Definition at line 31 of file scalar.cpp.

References Kadath::Tensor::espace, Kadath::Tensor::ndom, and val_zones.

◆ operator=() [2/3]

Scalar & Kadath::Scalar::operator= ( const Tensor so)
overridevirtual

Assignement to a Tensor (must be scalar)

Reimplemented from Kadath::Tensor.

Definition at line 40 of file scalar.cpp.

References Kadath::Tensor::cmp, Kadath::Tensor::espace, Kadath::Tensor::ndom, val_zones, and Kadath::Tensor::valence.

◆ operator=() [3/3]

Scalar & Kadath::Scalar::operator= ( double  xx)
inlinevirtual

Assignment to a double (sets all the values in the configuration space to that value.

Reimplemented from Kadath::Tensor.

Definition at line 373 of file scalar.hpp.

References Kadath::Tensor::ndom, and set_domain().

◆ 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::Scalar::save ( FILE *  fd) const
virtual

Saving function.

Reimplemented from Kadath::Tensor.

Definition at line 26 of file scalar.cpp.

References get_nbr_domains(), and val_zones.

◆ 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_domain()

Val_domain & Kadath::Scalar::set_domain ( int  l)
inline

Read/write of a particular Val_domain.

Definition at line 555 of file scalar.hpp.

References Kadath::Tensor::ndom, and val_zones.

◆ set_in_coef()

void Kadath::Scalar::set_in_coef ( )
inline

Destroys the values in the configuration space.

Definition at line 394 of file scalar.hpp.

References Kadath::Tensor::ndom, and val_zones.

◆ set_in_conf()

void Kadath::Scalar::set_in_conf ( )
inline

Destroys the values in the coefficient space.

Definition at line 389 of file scalar.hpp.

References Kadath::Tensor::ndom, and val_zones.

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

◆ set_val_inf() [1/2]

void Kadath::Scalar::set_val_inf ( double  xx)
inline

Sets the value at infinity (in the last domain) to xx.

Definition at line 560 of file scalar.hpp.

References Kadath::Tensor::ndom, and val_zones.

◆ set_val_inf() [2/2]

void Kadath::Scalar::set_val_inf ( double  xx,
int  l 
)
inline

Sets the value at infinity (in the domain l) to xx.

Definition at line 564 of file scalar.hpp.

References val_zones.

◆ std_anti_base() [1/2]

void Kadath::Scalar::std_anti_base ( )
inline

Sets the standard, anti-symetric, basis of decomposition.

Definition at line 410 of file scalar.hpp.

References Kadath::Tensor::ndom, and val_zones.

◆ std_anti_base() [2/2]

void Kadath::Scalar::std_anti_base ( int  m)
inline

Sets the standard, anti-symetric, basis of decomposition assuming a given harmonic wrt $\varphi$.

Definition at line 420 of file scalar.hpp.

References Kadath::Tensor::ndom, std_anti_base(), and val_zones.

◆ std_anti_base_domain()

void Kadath::Scalar::std_anti_base_domain ( int  d)
inline

Sets the standard, anti-symetric, basis of decomposition, in a given Domain.

Definition at line 444 of file scalar.hpp.

References val_zones.

◆ std_base() [1/3]

void Kadath::Scalar::std_base ( )
inlinevirtual

Sets the standard basis of decomposition.

Reimplemented from Kadath::Tensor.

Definition at line 399 of file scalar.hpp.

References Kadath::Param_tensor::get_m_quant(), Kadath::Tensor::is_m_quant_affected(), Kadath::Tensor::ndom, Kadath::Tensor::parameters, and val_zones.

◆ std_base() [2/3]

void Kadath::Scalar::std_base ( int  l,
int  m 
)

Sets the standard basis of decomposition assuming a given harmonic wrt $\varphi$ and $\theta$.

◆ std_base() [3/3]

void Kadath::Scalar::std_base ( int  m)
inline

Sets the standard basis of decomposition assuming a given harmonic wrt $\varphi$.

Definition at line 415 of file scalar.hpp.

References Kadath::Tensor::ndom, std_base(), and val_zones.

◆ std_base_domain() [1/3]

void Kadath::Scalar::std_base_domain ( int  d,
int  l,
int  m 
)

Sets the standard basis of decomposition assuming a given harmonic wrt $\varphi$ and $\theta$, in a given Domain.

◆ std_base_domain() [2/3]

void Kadath::Scalar::std_base_domain ( int  d)
inline

Sets the standard basis of decomposition, in a given Domain.

Definition at line 440 of file scalar.hpp.

References val_zones.

◆ std_base_domain() [3/3]

void Kadath::Scalar::std_base_domain ( int  d,
int  m 
)
inline

Sets the standard basis of decomposition assuming a given harmonic wrt $\varphi$, in a given Domain.

Definition at line 448 of file scalar.hpp.

References val_zones.

◆ std_base_odd()

void Kadath::Scalar::std_base_odd ( )
inline

Sets the basis in odd polynomials.

Definition at line 517 of file scalar.hpp.

References Kadath::Tensor::ndom, and val_zones.

◆ std_base_p_mtz_domain()

void Kadath::Scalar::std_base_p_mtz_domain ( int  d)
inline

Sets the basis for the $\varphi$ component of a vector in orthonormal coordinates in the MTZ context, in a given Domain.

Definition at line 530 of file scalar.hpp.

References val_zones.

◆ std_base_p_spher()

void Kadath::Scalar::std_base_p_spher ( )
inline

Sets the basis for the $\varphi$ component of a vector in orthonormal spherical coordinates.

Definition at line 435 of file scalar.hpp.

References Kadath::Tensor::ndom, and val_zones.

◆ std_base_p_spher_domain()

void Kadath::Scalar::std_base_p_spher_domain ( int  d)
inline

Sets the basis for the $\varphi$ component of a vector in orthonormal spherical coordinates, in a given Domain.

Definition at line 472 of file scalar.hpp.

References val_zones.

◆ std_base_r_mtz_domain()

void Kadath::Scalar::std_base_r_mtz_domain ( int  d)
inline

Sets the basis for the radial component of a vector in orthonormal coordinates in the MTZ context, in a given Domain.

Definition at line 522 of file scalar.hpp.

References val_zones.

◆ std_base_r_spher()

void Kadath::Scalar::std_base_r_spher ( )
inline

Sets the basis for the radial component of a vector in orthonormal spherical coordinates.

Definition at line 425 of file scalar.hpp.

References Kadath::Tensor::ndom, and val_zones.

◆ std_base_r_spher_domain()

void Kadath::Scalar::std_base_r_spher_domain ( int  d)
inline

Sets the basis for the radial component of a vector in orthonormal spherical coordinates, in a given Domain.

Definition at line 464 of file scalar.hpp.

References val_zones.

◆ std_base_rp_spher_domain()

void Kadath::Scalar::std_base_rp_spher_domain ( int  d)
inline

Sets the basis for the $(r,\varphi)$ component of a 2-tensor in orthonormal spherical coordinates, in a given Domain.

Definition at line 492 of file scalar.hpp.

References val_zones.

◆ std_base_rt_spher_domain()

void Kadath::Scalar::std_base_rt_spher_domain ( int  d)
inline

Sets the basis for the $(r,\theta)$ component of a 2-tensor in orthonormal spherical coordinates, in a given Domain.

Definition at line 488 of file scalar.hpp.

References val_zones.

◆ std_base_t_mtz_domain()

void Kadath::Scalar::std_base_t_mtz_domain ( int  d)
inline

Sets the basis for the $\theta$ component of a vector in orthonormal coordinates in the MTZ context, in a given Domain.

Definition at line 526 of file scalar.hpp.

References val_zones.

◆ std_base_t_spher()

void Kadath::Scalar::std_base_t_spher ( )
inline

Sets the basis for the $\theta$ component of a vector in orthonormal spherical coordinates.

Definition at line 430 of file scalar.hpp.

References Kadath::Tensor::ndom, and val_zones.

◆ std_base_t_spher_domain()

void Kadath::Scalar::std_base_t_spher_domain ( int  d)
inline

Sets the basis for the $\theta$ component of a vector in orthonormal spherical coordinates, in a given Domain.

Definition at line 468 of file scalar.hpp.

References val_zones.

◆ std_base_tp_spher_domain()

void Kadath::Scalar::std_base_tp_spher_domain ( int  d)
inline

Sets the basis for the $(\theta, \varphi)$ component of a 2-tensor in orthonormal spherical coordinates, in a given Domain.

Definition at line 496 of file scalar.hpp.

References val_zones.

◆ std_base_x_cart_domain()

void Kadath::Scalar::std_base_x_cart_domain ( int  d)
inline

Sets the basis for the X-component of a vector in Cartesian coordinates, in a given Domain.

Definition at line 452 of file scalar.hpp.

References val_zones.

◆ std_base_xy_cart_domain()

void Kadath::Scalar::std_base_xy_cart_domain ( int  d)
inline

Sets the basis for the XY component of a 2-tensor in Cartesian coordinates, in a given Domain.

Definition at line 476 of file scalar.hpp.

References val_zones.

◆ std_base_xz_cart_domain()

void Kadath::Scalar::std_base_xz_cart_domain ( int  d)
inline

Sets the basis for the XZ component of a 2-tensor in Cartesian coordinates, in a given Domain.

Definition at line 480 of file scalar.hpp.

References val_zones.

◆ std_base_y_cart_domain()

void Kadath::Scalar::std_base_y_cart_domain ( int  d)
inline

Sets the basis for the Y-component of a vector in Cartesian coordinates, in a given Domain.

Definition at line 456 of file scalar.hpp.

References val_zones.

◆ std_base_yz_cart_domain()

void Kadath::Scalar::std_base_yz_cart_domain ( int  d)
inline

Sets the basis for the YZ component of a 2-tensor in Cartesian coordinates, in a given Domain.

Definition at line 484 of file scalar.hpp.

References val_zones.

◆ std_base_z_cart_domain()

void Kadath::Scalar::std_base_z_cart_domain ( int  d)
inline

Sets the basis for the Z-component of a vector in Cartesian coordinates, in a given Domain.

Definition at line 460 of file scalar.hpp.

References val_zones.

◆ std_todd_base()

void Kadath::Scalar::std_todd_base ( )
inline

Sets the basis for an odd function in $T$ (Critic case).

Definition at line 506 of file scalar.hpp.

References Kadath::Tensor::ndom, and val_zones.

◆ std_xodd_base()

void Kadath::Scalar::std_xodd_base ( )
inline

Sets the basis for an odd function in $X$ (Critic case).

Definition at line 500 of file scalar.hpp.

References Kadath::Tensor::ndom, std_base(), and val_zones.

◆ std_xodd_todd_base()

void Kadath::Scalar::std_xodd_todd_base ( )
inline

Sets the basis for an odd function in $X$ and $T$ (Critic case).

Definition at line 511 of file scalar.hpp.

References Kadath::Tensor::ndom, std_todd_base(), and val_zones.

◆ swap()

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

Swap method.

Definition at line 270 of file tensor.cpp.

◆ val_point()

double Kadath::Scalar::val_point ( const Point xxx,
int  sens = -1 
) const

Computes the value of the field at a given point, by doing the spectral summation.

Parameters
xxx[input] : absolute Cartesian coordinates of the point.
sens: looks for the point starting from the origin (+1) or infinity (-1).
Returns
the value of the field.

Definition at line 62 of file scalar.cpp.

References coef(), get_domain(), Kadath::Domain::is_in(), Kadath::Tensor::ndom, and val_zones.

◆ val_point_zeronotdef()

double Kadath::Scalar::val_point_zeronotdef ( const Point xxx,
int  sens = -1 
) const

Computes the value of the field at a given point, by doing the spectral summation.

Returns zero if the Point is not found in the computational domain.

Parameters
xxx[input] : absolute Cartesian coordinates of the point.
sens: looks for the point starting from the origin (+1) or infinity (-1).
Returns
the value of the field.

Definition at line 96 of file scalar.cpp.

References coef(), get_domain(), Kadath::Domain::is_in(), Kadath::Tensor::ndom, and val_zones.

◆ zero()

Scalar Kadath::Scalar::zero ( Space const &  espace)
inlinestatic
Returns
: a Scalar containing zero. The result is logically zero.

Definition at line 580 of file scalar.hpp.

References Kadath::Tensor::espace.

Friends And Related Function Documentation

◆ cos

Scalar cos ( const Scalar so)
friend

Operator cosine.

Definition at line 69 of file scalar_math.cpp.

◆ diffmax

double diffmax ( const Scalar aa,
const Scalar bb 
)
friend

Maximal difference.

Definition at line 235 of file scalar_math.cpp.

◆ exp

Scalar exp ( const Scalar so)
friend

Operator exponential.

Definition at line 221 of file scalar_math.cpp.

◆ operator* [1/5]

Scalar operator* ( const Scalar a,
const Scalar b 
)
friend

Operator *.

Definition at line 136 of file scalar_math.cpp.

◆ operator* [2/5]

Tensor operator* ( const Scalar t1,
const Tensor t2 
)
friend

Operator *.

Definition at line 263 of file tensor_math.cpp.

◆ operator* [3/5]

Scalar operator* ( const Scalar so,
double  x 
)
friend

Operator *.

Definition at line 145 of file scalar_math.cpp.

◆ operator* [4/5]

Tensor operator* ( const Tensor t2,
const Scalar t1 
)
friend

Operator *.

Definition at line 275 of file tensor_math.cpp.

◆ operator* [5/5]

Scalar operator* ( double  x,
const Scalar so 
)
friend

Operator *.

Definition at line 152 of file scalar_math.cpp.

◆ operator+ [1/6]

Scalar operator+ ( const Scalar so)
friend

Operator + (unitary version)

Definition at line 77 of file scalar_math.cpp.

◆ operator+ [2/6]

Scalar operator+ ( const Scalar a,
const Scalar b 
)
friend

Operator +.

Definition at line 90 of file scalar_math.cpp.

◆ operator+ [3/6]

Scalar operator+ ( const Scalar t1,
const Tensor t2 
)
friend

Operator +.

Definition at line 187 of file tensor_math.cpp.

◆ operator+ [4/6]

Scalar operator+ ( const Scalar so,
double  x 
)
friend

Operator +.

Definition at line 99 of file scalar_math.cpp.

◆ operator+ [5/6]

Scalar operator+ ( const Tensor t1,
const Scalar t2 
)
friend

Operator +.

Definition at line 180 of file tensor_math.cpp.

◆ operator+ [6/6]

Scalar operator+ ( double  x,
const Scalar so 
)
friend

Operator +.

Definition at line 107 of file scalar_math.cpp.

◆ operator- [1/6]

Scalar operator- ( const Scalar so)
friend

Operator - (unitary version)

Definition at line 82 of file scalar_math.cpp.

◆ operator- [2/6]

Scalar operator- ( const Scalar a,
const Scalar b 
)
friend

Operator -.

Definition at line 114 of file scalar_math.cpp.

◆ operator- [3/6]

Scalar operator- ( const Scalar t1,
const Tensor t2 
)
friend

Operator -.

Definition at line 231 of file tensor_math.cpp.

◆ operator- [4/6]

Scalar operator- ( const Scalar so,
double  x 
)
friend

Operator -.

Definition at line 122 of file scalar_math.cpp.

◆ operator- [5/6]

Scalar operator- ( const Tensor t1,
const Scalar t2 
)
friend

Operator -.

Definition at line 224 of file tensor_math.cpp.

◆ operator- [6/6]

Scalar operator- ( double  x,
const Scalar so 
)
friend

Operator -.

Definition at line 129 of file scalar_math.cpp.

◆ operator/ [1/4]

Scalar operator/ ( const Scalar a,
const Scalar b 
)
friend

Operator /.

Definition at line 178 of file scalar_math.cpp.

◆ operator/ [2/4]

Scalar operator/ ( const Scalar so,
double  x 
)
friend

Operator /.

Definition at line 186 of file scalar_math.cpp.

◆ operator/ [3/4]

Tensor operator/ ( const Tensor t1,
const Scalar s2 
)
friend

Operator /.

Definition at line 506 of file tensor_math.cpp.

◆ operator/ [4/4]

Scalar operator/ ( double  x,
const Scalar so 
)
friend

Operator /.

Definition at line 193 of file scalar_math.cpp.

◆ operator<<

ostream& operator<< ( ostream &  o,
const Scalar so 
)
friend

Display.

Definition at line 181 of file scalar.cpp.

◆ pow [1/2]

Scalar pow ( const Scalar so,
double  nn 
)
friend

Operator power (double version)

Definition at line 207 of file scalar_math.cpp.

◆ pow [2/2]

Scalar pow ( const Scalar so,
int  n 
)
friend

Operator power (integer version)

Definition at line 200 of file scalar_math.cpp.

◆ sin

Scalar sin ( const Scalar so)
friend

Operator sine.

Definition at line 62 of file scalar_math.cpp.

◆ sqrt

Scalar sqrt ( const Scalar so)
friend

Operator square root.

Definition at line 214 of file scalar_math.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.

◆ val_zones

Memory_mapped_array<Val_domain*> Kadath::Scalar::val_zones
protected

Pointers on the various Val_domain describing the field in each Domain.

Definition at line 70 of file scalar.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: