24 constexpr
short COV{-1};
25 constexpr
short CON{+1};
28 #include "base_tensor.hpp"
31 #include "val_domain.hpp"
44 Tensor operator+(
const Tensor &);
45 Tensor operator-(
const Tensor &);
46 Tensor operator+(
const Tensor &,
const Tensor &);
47 Tensor operator-(
const Tensor &,
const Tensor &);
48 Scalar operator+(
const Tensor &,
const Scalar &);
49 Scalar operator+(
const Scalar &,
const Tensor &);
50 Tensor operator+(
const Tensor &,
double);
51 Tensor operator+(
double,
const Tensor &);
52 Scalar operator-(
const Tensor &,
const Scalar &);
53 Scalar operator-(
const Scalar &,
const Tensor &);
54 Tensor operator-(
const Tensor &,
double);
55 Tensor operator-(
double,
const Tensor &);
56 Tensor operator*(
const Scalar &,
const Tensor &);
57 Tensor operator*(
const Tensor &,
const Scalar &);
58 Tensor operator*(
double,
const Tensor &);
59 Tensor operator*(
const Tensor &,
double);
60 Tensor operator*(
int,
const Tensor &);
61 Tensor operator*(
const Tensor &,
int);
62 Tensor operator*(
const Tensor &,
const Tensor &);
63 Tensor operator/(
const Tensor &,
const Scalar &);
64 Tensor operator/(
const Tensor &,
double);
65 Tensor operator/(
const Tensor &,
int);
67 double maxval(
const Tensor &);
68 double minval(
const Tensor &);
70 void affecte_one_dom(
int, Tensor *,
const Tensor *);
72 Tensor add_one_dom(
int,
const Tensor &,
const Tensor &);
73 Tensor add_one_dom(
int,
const Tensor &,
double);
74 Tensor add_one_dom(
int,
double,
const Tensor &);
75 Tensor sub_one_dom(
int,
const Tensor &,
const Tensor &);
76 Tensor sub_one_dom(
int,
const Tensor &,
double);
77 Tensor sub_one_dom(
int,
double,
const Tensor &);
78 Tensor mult_one_dom(
int,
const Tensor &,
const Tensor &);
79 Tensor mult_one_dom(
int,
const Tensor &,
double);
80 Tensor mult_one_dom(
int,
double,
const Tensor &);
81 Tensor mult_one_dom(
int,
const Tensor &,
int);
82 Tensor mult_one_dom(
int,
int,
const Tensor &);
83 Tensor div_one_dom(
int,
const Tensor &,
const Tensor &);
84 Tensor div_one_dom(
int,
const Tensor &,
double);
85 Tensor div_one_dom(
int,
double,
const Tensor &);
86 Tensor scal_one_dom(
int,
const Tensor &,
const Tensor &);
87 Tensor partial_one_dom(
int,
char,
const Tensor &);
88 Tensor sqrt_one_dom(
int,
const Tensor &);
95 int add_m_quant(
const Param_tensor &,
const Param_tensor &);
96 int mult_m_quant(
const Param_tensor &,
const Param_tensor &);
97 int div_m_quant(
const Param_tensor &,
const Param_tensor &);
98 int inv_m_quant(
const Param_tensor &);
179 Memory_mapped_array<Scalar *>
cmp;
243 #ifdef TENSOR_MOVE_SEMANTIC
245 void do_move(
Tensor &&so,
bool move_cmp) noexcept;
305 virtual void save(FILE *)
const;
412 Scalar &
set(
int i1,
int i2,
int i3,
int i4);
596 const Scalar &
at(
int i1,
int i2)
const;
738 #ifndef REMOVE_ALL_CHECKS
740 cerr <<
"m_order not affected in Param_tensor" << endl;
748 #ifndef REMOVE_ALL_CHECKS
750 cerr <<
"m_quant not affected in Param_tensor" << endl;
768 std::swap(m_quant_affected, so.m_quant_affected);
769 std::swap(m_quant, so.m_quant);
770 std::swap(m_order_affected, so.m_order_affected);
771 std::swap(m_order, so.m_order);
reference set(const Index &pos)
Read/write of an element.
Describes the tensorial basis used by the various tensors.
int & set_basis(int nd)
Read/write the basis in a given domain.
Class for bispherical coordinates with a symmetry with respect to the plane .
Class for bispherical coordinates with a symmetry with respect to the plane .
Class for bispherical coordinates with a symmetry with respect to the plane .
Class for a spherical compactified domain and a symmetry with respect to the plane .
Class for a spherical domain containing the origin and a symmetry with respect to the plane .
Class for a spherical nucleus with a symmetry in .
Class for a spherical shell with a symmetry in .
Class for a spherical-like domain, having a symmetry with respect to the plane .
Class for a spherical-like domain, having a symmetry with respect to the plane .
Class for a spherical-like domain, having a symmetry with respect to the plane .
Class for a spherical-like domain, having a symmetry with respect to the plane .
Class for a spherical shell and a symmetry with respect to the plane .
Abstract class that implements the fonctionnalities common to all the type of domains.
Class for an equation representing the matching of quantities accross a boundary.
Class that gives the position inside a multi-dimensional Array.
Particular type of Tensor, dedicated to the desription of metrics.
Class for handling additional parameters for some Tensor.
friend int add_m_quant(const Param_tensor &, const Param_tensor &)
Addition quantum numbers.
friend int div_m_quant(const Param_tensor &, const Param_tensor &)
Division of quantum numbers.
void swap(Param_tensor &so) noexcept
Sylvain's stuff.
friend int inv_m_quant(const Param_tensor &)
Inverse of a quantum number.
int & set_m_order()
Sets .
int get_m_order() const
Returns .
int m_order
The value of , if affected.
bool operator!() const noexcept
Check if the parameters are not affected.
int get_m_quant() const
Returns .
bool m_quant_affected
States if the parameter is affected.
int m_quant
The value of , if affected.
int & set_m_quant()
Sets .
bool m_order_affected
States if the parameter is affected.
friend int mult_m_quant(const Param_tensor &, const Param_tensor &)
Multiplication of quantum numbers.
The class Scalar does not really implements scalars in the mathematical sense but rather tensorial co...
The Space_spheric_adapted class fills the space with one shell adapted on the inside,...
Spacetime intended for binary black hole configurations in full general relativity (see constructor f...
Spacetime intended for binary black hole configurations (see constructor for details about the domain...
Spacetime intended for binary neutron stars configurations (see constructor for details about the dom...
The Space_polar_adapted class fills the space with one polar nucleus, one polar shell adapted on the ...
The Space_polar_periodic class fills the space with one polar nucleus and several polar shells,...
The Space_spheric_adapted class fills the space with one nucleus, one shell adapted on the outside,...
The Space class is an ensemble of domains describing the whole space of the computation.
Class used to describe and solve a system of equations.
void affect_parameters()
The function affect_parameters is deprecated and actually does nothing since the parameters are now a...
virtual ~Tensor()
Destructor.
const Scalar & operator()() const
Read only for a Scalar.
bool name_affected
Indicator that states if the indices have been given names.
Memory_mapped_array< char > name_indice
If the indices haves names they are stored here.
void swap(Tensor &) noexcept
Swap method.
void set_name_ind(int dd, char name)
Sets the name of one index ; the names must have been affected first.
virtual Tensor & operator=(const Tensor &)
Assignment to a Tensor.
bool is_m_order_affected() const
Checks whether the additional parameter order is affected (not very used).
friend Tensor operator-(const Tensor &)
Operator -.
Base_tensor basis
Tensorial basis with respect to which the tensor components are defined.
void change_basis_spher_to_cart()
Changes the tensorial basis from orthonormal spherical to Cartesian.
bool find_indices(const Tensor &tt, Array< int > &output_ind) const
Checks whether the current Tensor and tt have compatible indices (i.e.
Tensor do_summation() const
Does the inner contraction of the Tensor.
void operator-=(const Tensor &)
-= Tensor
int ndom
The number of Domain.
Tensor(const Space &sp, int val, const Array< int > &tipe, const Base_tensor &ba)
Constructor.
int valence
Valence of the tensor (0 = scalar, 1 = vector, etc...)
friend double minval(const Tensor &)
Gives the minimum value amongst all the components, at all the collocation points.
void set_name_affected()
Affects the name of the indices.
int(* give_place_index)(const Index &, int)
Pointer on the function that gives the storage location corresponding to a set of indices values....
friend ostream & operator<<(ostream &, const Tensor &)
Display.
void coef() const
Computes the coefficients.
Tensor grad() const
Computes the flat gradient, in Cartesian coordinates.
friend Tensor operator+(const Tensor &)
Operator + (unitary version)
Array< int > type_indice
1D array of integers of size valence containing the type of each index: COV for a covariant one and C...
Param_tensor parameters
Possible additional parameters relevant for the current Tensor.
Array< int >(* give_indices)(int, int, int)
Pointer on the function that gives the indices corresponding to a give storage location.
Param_tensor & set_parameters()
Read/write of the parameters.
void filter_phi(int dom, int ncf)
Sets to zero all the coefficients above a given order, for the coefficients, in a gicen Domain.
virtual void std_base()
Sets the standard spectal bases of decomposition for each component.
void coef_i() const
Computes the values in the configuration space.
Memory_mapped_array< Scalar * > cmp
Array of size n_comp of pointers onto the components.
const Param_tensor & get_parameters() const
Returns a pointer on the possible additional parameter.
Array< int > get_index_type() const
void filter(double tre)
Sets all the coefficients below a given treshold, to zero (maintaining regularity).
int & set_index_type(int i)
Sets the type of the index number.
char const * get_name_ind() const
int get_index_type(int i) const
Gives the type (covariant or contravariant) of a given index.
friend Tensor add_one_dom(int, const Tensor &, const Tensor &)
Addition (one domain version)
virtual void annule_hard()
Sets the Tensor to zero (hard version ; no logical state used).
friend Tensor mult_one_dom(int, const Tensor &, const Tensor &)
Multiplication (one domain version)
void operator+=(const Tensor &)
+= Tensor
friend Tensor partial_one_dom(int, char, const Tensor &)
Partial derivative (one domain version)
void change_basis_cart_to_spher()
Changes the tensorial basis from Cartesian to orthonormal spherical.
virtual int position(const Index &idx) const
Gives the location of a given component in the array used for storage (Index version).
const Base_tensor & get_basis() const
Returns the vectorial basis (triad) on which the components are defined.
Array< int > & set_index_type()
Sets the types of all the indices.
friend Tensor sqrt_one_dom(int, const Tensor &)
Square root (one domain version)
int get_n_comp() const
Returns the number of stored components.
virtual void save(FILE *) const
Saving operator.
Scalar & set()
Read/write for a Scalar.
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 comp...
friend void affecte_one_dom(int dom, Tensor *out, const Tensor *so)
Affectation in one domain only.
friend Tensor div_one_dom(int, const Tensor &, const Tensor &)
Division (one domain version)
int n_comp
Number of stored components, depending on the symmetry.
const Space & espace
The Space.
int get_valence() const
Returns the valence.
friend Tensor sub_one_dom(int, const Tensor &, const Tensor &)
Difference (one domain version)
friend Tensor scal_one_dom(int, const Tensor &, const Tensor &)
Scalar product (one domain version)
const Scalar & at(int i1, int i2) const
Sylvain' stuff.
friend Tensor operator/(const Tensor &, const Scalar &)
Operator /.
virtual int position(const Array< int > &idx) const
Gives the location of a given component in the array used for storage (Array version).
bool is_name_affected() const
Check whether the names of the indices have been affected.
bool is_m_quant_affected() const
Checks whether the additional parameter is affected (used for boson stars for instance).
Tensor do_summation_one_dom(int dd) const
Does the inner contraction of the Tensor in a given domain.
int(* give_place_array)(const Array< int > &, int)
Pointer on the function that gives the storage location corresponding to a set of indices values....
friend Tensor operator*(const Scalar &, const Tensor &)
Operator *.
int get_ndim() const
Returns the number dimension.
const Space & get_space() const
Returns the Space.
friend double maxval(const Tensor &)
Gives the maximum value amongst all the components, at all the collocation points.
int & set_basis(int dd)
Assigns a new tensorial basis in a given domain.
A class derived from Tensor to deal specificaly with objects of valence 1 (and so also 1-forms).