24 #include "val_domain.hpp"
28 using std::unique_ptr;
32 Scalar operator+ (
const Scalar&) ;
33 Scalar operator- (
const Scalar&) ;
34 Scalar operator+ (
const Scalar&,
const Scalar&) ;
35 Scalar operator+ (
const Scalar&,
double) ;
36 Scalar operator+ (
double,
const Scalar&) ;
37 Scalar operator- (
const Scalar&,
const Scalar&) ;
38 Scalar operator- (
const Scalar&,
double) ;
39 Scalar operator- (
double,
const Scalar&) ;
40 Scalar operator* (
const Scalar&,
const Scalar&) ;
41 Scalar operator* (
const Scalar&,
double) ;
42 Scalar operator* (
double,
const Scalar&) ;
43 Scalar operator* (
const Scalar&,
int) ;
44 Scalar operator* (
int,
const Scalar&) ;
45 Scalar operator* (
const Scalar&,
long int) ;
46 Scalar operator* (
long int,
const Scalar&) ;
47 Scalar operator/ (
const Scalar&,
const Scalar&) ;
48 Scalar operator/ (
const Scalar&,
double) ;
49 Scalar operator/ (
double,
const Scalar&) ;
50 Scalar pow (
const Scalar&,
int) ;
51 Scalar pow (
const Scalar&,
double) ;
52 Scalar sqrt (
const Scalar&) ;
53 Scalar exp (
const Scalar&) ;
54 Scalar sin (
const Scalar&) ;
55 Scalar cos (
const Scalar&) ;
56 Scalar atan (
const Scalar&) ;
57 double diffmax (
const Scalar&,
const Scalar&) ;
100 #ifdef TENSOR_MOVE_SEMANTIC
108 virtual void save (FILE*)
const ;
239 void import (
const Scalar& so) ;
302 int num_un,
double var_un_min,
double var_un_max,
303 int num_deux,
double var_deux_min,
double var_deux_max,
304 const char* title = 0x0,
const char* axis_one=0x0,
const char* axis_two = 0x0,
int ncour=15,
int n_un=100,
int n_deux=100) ;
306 void des_coupe_zeronotdef (
const Scalar& uu,
const Point& x0,
307 int num_un,
double var_un_min,
double var_un_max,
308 int num_deux,
double var_deux_min,
double var_deux_max,
309 const char* title = 0x0,
const char* axis_one=0x0,
const char* axis_two = 0x0,
int ncour=15,
int n_un=100,
int n_deux=100) ;
311 void des_sphere (
const Scalar& uu,
const Point& x0,
double rad,
const char* title = 0x0,
int ncour=15,
int n_un=100,
int n_deux=100) ;
319 inline Scalar::Scalar (
const Space& sp) :
Tensor{sp}, val_zones{ndom} {
320 for (
int l=0 ; l<
ndom ; l++)
325 inline Scalar::Scalar(
const Scalar& so,
bool copie) :
Tensor{so.espace}, val_zones{ndom} {
326 for (
int l=0 ; l<
ndom ; l++)
334 inline Scalar::Scalar (
const Tensor& so,
bool copie) :
Tensor{so.espace}, val_zones{ndom} {
337 for (
int l=0 ; l<
ndom ; l++)
345 inline Scalar::Scalar (
const Space& sp, FILE* fd) :
Tensor{sp}, val_zones{ndom} {
346 for (
int l=0 ; l<
ndom ; l++)
351 #ifdef TENSOR_MOVE_SEMANTIC
352 inline Scalar::Scalar(
Scalar && so) noexcept :
Tensor{std::move(so)}, val_zones{std::move(so.val_zones)}
355 assert(so.cmp.get_data() ==
nullptr);
360 this->do_move(std::move(so),
false);
361 val_zones.swap(so.val_zones);
363 assert(cmp[0] ==
this && so.cmp[0] == &so);
369 for(
auto & v :
val_zones) safe_delete(v);
370 if(!
cmp.empty())
cmp[0] = nullptr ;
374 for (
int i=0 ; i<
ndom ; i++)
380 for (
int i=0 ; i<
ndom ; i++)
385 for (
int i=0 ; i<
ndom ; i++)
390 for (
int l=0 ; l<
ndom ; l++)
395 for (
int l=0 ; l<
ndom ; l++)
401 for (
int l=0 ; l<
ndom ; l++)
405 for (
int l=0 ; l<
ndom ; l++)
411 for (
int l=0 ; l<
ndom ; l++)
416 for (
int l=0 ; l<
ndom ; l++)
421 for (
int l=0 ; l<
ndom ; l++)
426 for (
int l=0 ; l<
ndom ; l++)
431 for (
int l=0 ; l<
ndom ; l++)
436 for (
int l=0 ; l<
ndom ; l++)
502 for (
int l=1 ; l<
ndom ; l++)
507 for (
int l=0 ; l<
ndom ; l++)
513 for (
int l=1 ; l<
ndom ; l++)
518 for (
int l=0 ; l<
ndom ; l++)
536 for (
int l=0 ; l<
ndom ; l++)
541 for (
int l=0 ; l<
ndom ; l++)
547 assert ((i>=0) && (i<
ndom)) ;
556 assert ((l>=0) && (l<
ndom)) ;
570 for (
int l=0; l<
ndom; l++)
576 for (
int l=0; l<
ndom; l++)
Abstract class that implements the fonctionnalities common to all the type of domains.
int get_m_quant() const
Returns .
The class Point is used to store the coordinates of a point.
The class Scalar does not really implements scalars in the mathematical sense but rather tensorial co...
void std_anti_base_domain(int)
Sets the standard, anti-symetric, basis of decomposition, in a given Domain.
Scalar mult_sin_phi() const
Returns the multiplication by .
friend Scalar exp(const Scalar &)
Operator exponential.
void std_base_p_spher()
Sets the basis for the component of a vector in orthonormal spherical coordinates.
friend Scalar cos(const Scalar &)
Operator cosine.
void std_base_rp_spher_domain(int d)
Sets the basis for the component of a 2-tensor in orthonormal spherical coordinates,...
void std_xodd_todd_base()
Sets the basis for an odd function in and (Critic case).
const Domain * get_domain(int i) const
void std_xodd_base()
Sets the basis for an odd function in (Critic case).
Scalar der_r() const
Returns the radial derivative.
Val_domain & set_domain(int)
Read/write of a particular Val_domain.
const Space & get_space() const
Scalar & operator=(const Scalar &)
Assignement to another Scalar.
Scalar div_rsint() const
Returns the division by .
virtual void annule_hard()
Sets the value to zero everywhere in the collocation space (the logical state of the Val_domain is NO...
void operator*=(const Scalar &)
Operator *=.
void std_base_odd()
Sets the basis in odd polynomials.
void filter_phi(int dom, int ncf)
Sets to zero all the coefficients above a given order, for the coefficients, in a gicen Domain.
friend double diffmax(const Scalar &, const Scalar &)
Maximal difference.
void set_val_inf(double xx)
Sets the value at infinity (in the last domain) to xx.
void std_base_r_spher()
Sets the basis for the radial component of a vector in orthonormal spherical coordinates.
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.
double integrale() const
Returns the integral in the whole space.
void set_in_conf()
Destroys the values in the coefficient space.
void operator+=(const Scalar &)
Operator +=.
void std_base_z_cart_domain(int)
Sets the basis for the Z-component of a vector in Cartesian coordinates, in a given Domain.
void std_base_t_spher()
Sets the basis for the component of a vector in orthonormal spherical coordinates.
void operator-=(const Scalar &)
Operator -=.
void std_base_y_cart_domain(int)
Sets the basis for the Y-component of a vector in Cartesian coordinates, in a given Domain.
void std_base_rt_spher_domain(int d)
Sets the basis for the component of a 2-tensor in orthonormal spherical coordinates,...
void std_base_domain(int d, int l, int m)
Sets the standard basis of decomposition assuming a given harmonic wrt and , in a given Domain.
void std_base_r_mtz_domain(int)
Sets the basis for the radial component of a vector in orthonormal coordinates in the MTZ context,...
Scalar mult_cos_theta() const
Returns the multiplication by .
Scalar mult_sin_theta() const
Returns the multiplication by .
static Scalar zero(Space const &espace)
void std_base(int l, int m)
Sets the standard basis of decomposition assuming a given harmonic wrt and .
friend Scalar operator*(const Scalar &, const Scalar &)
Operator *.
Vector grad() const
Computes the gradient (in Cartesian coordinates).
void operator/=(const Scalar &)
Operator /=.
Memory_mapped_array< Val_domain * > val_zones
Pointers on the various Val_domain describing the field in each Domain.
friend ostream & operator<<(ostream &o, const Scalar &)
Display.
friend Scalar sin(const Scalar &)
Operator sine.
void coef_i() const
Computes the values in the configuration space.
void std_base_p_mtz_domain(int)
Sets the basis for the component of a vector in orthonormal coordinates in the MTZ context,...
Scalar mult_r() const
Returns the multiplication by r.
void std_base_r_spher_domain(int)
Sets the basis for the radial component of a vector in orthonormal spherical coordinates,...
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.
void allocate_coef()
Allocates the values in the coefficient space and destroys the values in the configuration space.
const Val_domain & at(int) const
Read only of a particular Val_domain.
virtual string get_class_name() const
Gives the class of the tensor.
void std_anti_base()
Sets the standard, anti-symetric, basis of decomposition.
friend Scalar operator/(const Scalar &, const Scalar &)
Operator /.
Scalar div_r() const
Returns the division by .
Scalar der_abs(int) const
Returns the derivative with respect to one particular absolute Cartesian coordinate.
Scalar der_spher(int) const
Returns the derivative with respect to one particular absolute Cartesian coordinate.
void std_base_t_mtz_domain(int)
Sets the basis for the component of a vector in orthonormal coordinates in the MTZ context,...
int get_nbr_domains() const
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.
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.
void std_base_tp_spher_domain(int d)
Sets the basis for the component of a 2-tensor in orthonormal spherical coordinates,...
Scalar div_1mx2() const
Returns the division by .
friend Scalar sqrt(const Scalar &)
Operator square root.
void std_base_p_spher_domain(int)
Sets the basis for the component of a vector in orthonormal spherical coordinates,...
friend Scalar pow(const Scalar &, int)
Operator power (integer version)
friend Scalar operator+(const Scalar &)
Operator + (unitary version)
void coef() const
Computes the coefficients.
void set_in_coef()
Destroys the values in the configuration space.
void std_todd_base()
Sets the basis for an odd function in (Critic case).
void std_base_domain(int)
Sets the standard basis of decomposition, in a given Domain.
void allocate_conf()
Allocates the values in the configuration space and destroys the values in the coefficients space.
~Scalar() override
Destructor.
Scalar mult_cos_phi() const
Returns the multiplication by .
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.
double integ_volume() const
virtual void annule_hard_coef()
Sets the value to zero everywhere in the coefficient space(the logical state of the Val_domain is NOT...
void std_base_x_cart_domain(int)
Sets the basis for the X-component of a vector in Cartesian coordinates, in a given Domain.
Scalar der_var(int) const
Returns the derivative with respect to one particular numerical coordinate.
virtual void save(FILE *) const
Saving function.
friend Scalar operator-(const Scalar &)
Operator - (unitary version)
void std_base()
Sets the standard basis of decomposition.
void std_base_t_spher_domain(int)
Sets the basis for the component of a vector in orthonormal spherical coordinates,...
The Space_spheric class fills the space with one nucleus, several shells and a compactified domain,...
The Space class is an ensemble of domains describing the whole space of the computation.
const Domain * get_domain(int i) const
returns a pointer on the domain.
const Scalar & operator()() const
Read only for a Scalar.
int ndom
The number of Domain.
int valence
Valence of the tensor (0 = scalar, 1 = vector, etc...)
Param_tensor parameters
Possible additional parameters relevant for the current Tensor.
Param_tensor & set_parameters()
Read/write of the parameters.
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.
const Space & espace
The Space.
bool is_m_quant_affected() const
Checks whether the additional parameter is affected (used for boson stars for instance).
Class for storing the basis of decompositions of a field and its values on both the configuration and...
void annule_hard_coef()
Sets all the arrays to zero in the coefficient space (the logical state is NOT set to zero).
void annule_hard()
Sets all the arrays to zero (the logical state is NOT set to zero).
A class derived from Tensor to deal specificaly with objects of valence 1 (and so also 1-forms).