KADATH
scalar.hpp
1 /*
2  Copyright 2017 Philippe Grandclement
3 
4  This file is part of Kadath.
5 
6  Kadath is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  Kadath is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with Kadath. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef __SCALAR_HPP_
21 #define __SCALAR_HPP_
22 
23 #include "space.hpp"
24 #include "val_domain.hpp"
25 #include <memory>
26 #include "tensor.hpp"
27 
28 using std::unique_ptr;
29 
30 namespace Kadath {
31  //Versions in all space
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&) ;
58 
59  class Vector ;
60 
67  class Scalar : public Tensor {
68  protected:
70  Memory_mapped_array<Val_domain*> val_zones;
71 
72  public:
77  Scalar (const Space&) ;
84  Scalar (const Scalar& so, bool copy=true) ;
85 
92  Scalar (const Tensor& so, bool copy=true);
98  Scalar (const Space& sp, FILE* fd) ;
99 
100 #ifdef TENSOR_MOVE_SEMANTIC
101  Scalar(Scalar &&) noexcept;
102  Scalar & operator=(Tensor &&) noexcept override;
103  Scalar & operator=(Scalar &&) noexcept;
104 #endif //#ifdef TENSOR_MOVE_SEMANTIC
105 
106  ~Scalar () override ;
107 
108  virtual void save (FILE*) const ;
109  public:
113  int get_ndim() const {return ndim ;} ;
117  int get_nbr_domains() const {return ndom ;} ;
122  const Domain* get_domain(int i) const {return val_zones[i]->get_domain() ;} ;
126  const Space& get_space () const {return espace ;} ;
127 
131  virtual string get_class_name () const {return "Scalar" ;} ;
132 
133  public:
134  Val_domain& set_domain (int) ;
135  const Val_domain& operator() (int) const;
136  const Val_domain& at(int) const;
137  Scalar & operator= (const Scalar&) ;
138  Scalar & operator= (const Tensor&) override ;
139  Scalar & operator= (double) ;
140  virtual void annule_hard() ;
141  virtual void annule_hard_coef() ;
142  Scalar der_var (int) const ;
143  Scalar der_abs (int) const ;
144  Scalar der_spher (int) const ;
145  Scalar der_r () const ;
146  Scalar div_r () const ;
147  Scalar div_rsint () const ;
148  Scalar div_1mx2 () const ;
149  Scalar mult_cos_theta () const ;
150  Scalar mult_sin_theta () const ;
151  Scalar mult_cos_phi () const ;
152  Scalar mult_sin_phi () const ;
153  double integrale() const ;
154  Scalar mult_r () const ;
155 
157  Vector grad() const ;
158 
159  public:
163  void set_in_conf() ;
167  void set_in_coef() ;
171  void allocate_conf() ;
175  void allocate_coef() ;
176  void std_base() ;
177  void std_anti_base() ;
178  void std_base(int m) ;
179  void std_base(int l, int m);
180  void std_anti_base(int m) ;
181  void std_base_r_spher() ;
182  void std_base_t_spher() ;
183  void std_base_p_spher() ;
184 
185  void std_base_domain(int) ;
186  void std_anti_base_domain(int) ;
187  void std_base_domain(int, int m) ;
188  void std_base_domain(int d, int l, int m) ;
189  void std_base_r_spher_domain(int) ;
190  void std_base_t_spher_domain(int) ;
191  void std_base_p_spher_domain(int) ;
192  void std_base_x_cart_domain(int) ;
193  void std_base_y_cart_domain(int) ;
194  void std_base_z_cart_domain(int) ;
195 
196  void std_base_rt_spher_domain(int d) ;
197  void std_base_rp_spher_domain(int d) ;
198  void std_base_tp_spher_domain(int d) ;
199  void std_base_xy_cart_domain(int d) ;
200  void std_base_xz_cart_domain(int d) ;
201  void std_base_yz_cart_domain(int d) ;
202 
203  void std_base_r_mtz_domain(int) ;
204  void std_base_t_mtz_domain(int) ;
205  void std_base_p_mtz_domain(int) ;
206 
207 
208  // For critic solution
209  void std_xodd_base() ;
210  void std_todd_base() ;
211  void std_xodd_todd_base() ;
212 
213  void std_base_odd() ;
214 
215  void set_val_inf (double xx) ;
216  void set_val_inf (double xx, int l) ;
217 
218  double integ_volume () const ;
225  double val_point (const Point& xxx, int sens=-1) const ;
232  double val_point_zeronotdef (const Point& xxx, int sens=-1) const ;
233 
239  void import (const Scalar& so) ;
240 
241  public:
242  void coef() const ;
243  void coef_i() const ;
250  void filter_phi (int dom, int ncf) ;
255  static Scalar zero(Space const& espace);
256 
257  void operator+= (const Scalar&) ;
258  void operator-= (const Scalar&) ;
259  void operator*= (const Scalar&) ;
260  void operator/= (const Scalar&) ;
261  void operator+= (double) ;
262  void operator-= (double) ;
263  void operator*= (double) ;
264  void operator/= (double) ;
265 
266  friend ostream& operator<< (ostream& o, const Scalar&) ;
267  friend class Space ;
268  friend class Space_spheric ;
269 
270  friend Scalar operator+ (const Scalar&) ;
271  friend Scalar operator- (const Scalar&) ;
272  friend Scalar operator+ (const Scalar&, const Scalar&) ;
273  friend Scalar operator+ (const Scalar&, double) ;
274  friend Scalar operator+ (double, const Scalar&) ;
275  friend Scalar operator- (const Scalar&, const Scalar&) ;
276  friend Scalar operator- (const Scalar&, double) ;
277  friend Scalar operator- (double, const Scalar&) ;
278  friend Scalar operator* (const Scalar&, const Scalar&) ;
279  friend Scalar operator* (const Scalar&, double) ;
280  friend Scalar operator* (double, const Scalar&) ;
281  friend Scalar operator/ (const Scalar&, const Scalar&) ;
282  friend Scalar operator/ (const Scalar&, double) ;
283  friend Scalar operator/ (double, const Scalar&) ;
284  friend Scalar pow (const Scalar&, int) ;
285  friend Scalar pow (const Scalar&, double) ;
286  friend Scalar sqrt (const Scalar&) ;
287  friend Scalar exp (const Scalar&) ;
288  friend Scalar sin (const Scalar&) ;
289  friend Scalar cos (const Scalar&) ;
290  friend double diffmax (const Scalar&, const Scalar&) ;
291 
292  friend Scalar operator+(const Tensor&, const Scalar&) ;
293  friend Scalar operator+(const Scalar&, const Tensor&) ;
294  friend Scalar operator-(const Tensor&, const Scalar&) ;
295  friend Scalar operator-(const Scalar&, const Tensor&) ;
296  friend Tensor operator*(const Scalar&, const Tensor&) ;
297  friend Tensor operator*(const Tensor&, const Scalar&) ;
298  friend Tensor operator/(const Tensor&, const Scalar&) ;
299  } ;
300 
301  void des_coupe (const Scalar& uu, const Point& x0,
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) ;
305 
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) ;
310 
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) ;
312 
313 
314  /*=====================================================================================================
315  *= Inlined methods definitions for the Scalar class :
316  *=====================================================================================================*/
317 
318 
319  inline Scalar::Scalar (const Space& sp) : Tensor{sp}, val_zones{ndom} {
320  for (int l=0 ; l<ndom ; l++)
321  val_zones[l] = new Val_domain{sp.get_domain(l)} ;
322  cmp[0] = this ;
323  }
324 
325  inline Scalar::Scalar(const Scalar& so, bool copie) : Tensor{so.espace}, val_zones{ndom} {
326  for (int l=0 ; l<ndom ; l++)
327  val_zones[l] = new Val_domain{*so.val_zones[l], copie} ;
328  cmp[0] = this ;
329 
330  if (so.parameters)
331  set_parameters() = so.get_parameters() ;
332  }
333 
334  inline Scalar::Scalar (const Tensor& so, bool copie) : Tensor{so.espace}, val_zones{ndom} {
335 
336  assert (so.valence==0) ;
337  for (int l=0 ; l<ndom ; l++)
338  val_zones[l] = new Val_domain{*so.cmp[0]->val_zones[l], copie} ;
339  cmp[0] = this ;
340 
341  if (so.parameters)
342  set_parameters() = so.get_parameters() ;
343  }
344 
345  inline Scalar::Scalar (const Space& sp, FILE* fd) : Tensor{sp}, val_zones{ndom} {
346  for (int l=0 ; l<ndom ; l++)
347  val_zones[l] = new Val_domain{sp.get_domain(l), fd} ;
348  cmp[0] = this ;
349  }
350 
351 #ifdef TENSOR_MOVE_SEMANTIC
352  inline Scalar::Scalar(Scalar && so) noexcept : Tensor{std::move(so)}, val_zones{std::move(so.val_zones)}
353  {
354  cmp[0]=this;
355  assert(so.cmp.get_data() == nullptr);
356  }
357 
358  inline Scalar & Scalar::operator=(Scalar && so) noexcept
359  {
360  this->do_move(std::move(so),false);
361  val_zones.swap(so.val_zones);
362 // std::swap(cmp[0],so.cmp[0]);
363  assert(cmp[0] == this && so.cmp[0] == &so);
364  return *this;
365  }
366 #endif //#ifdef TENSOR_MOVE_SEMANTIC
367 
368  inline Scalar::~Scalar () {
369  for(auto & v : val_zones) safe_delete(v);
370  if(!cmp.empty()) cmp[0] = nullptr ;
371  }
372 
373  inline Scalar & Scalar::operator= (double xx) {
374  for (int i=0 ; i<ndom ; i++)
375  set_domain(i) = xx ;
376  return *this;
377  }
378 
379  inline void Scalar::annule_hard() {
380  for (int i=0 ; i<ndom ; i++)
381  set_domain(i).annule_hard() ;
382  }
383 
384  inline void Scalar::annule_hard_coef() {
385  for (int i=0 ; i<ndom ; i++)
387  }
388 
389  inline void Scalar::set_in_conf() {
390  for (int l=0 ; l<ndom ; l++)
391  val_zones[l]->set_in_conf() ;
392  }
393 
394  inline void Scalar::set_in_coef() {
395  for (int l=0 ; l<ndom ; l++)
396  val_zones[l]->set_in_coef() ;
397  }
398 
399  inline void Scalar::std_base() {
400  if (!is_m_quant_affected()) {
401  for (int l=0 ; l<ndom ; l++)
402  val_zones[l]->std_base() ;
403  }
404  else {
405  for (int l=0 ; l<ndom ; l++)
407  }
408  }
409 
410  inline void Scalar::std_anti_base() {
411  for (int l=0 ; l<ndom ; l++)
412  val_zones[l]->std_anti_base() ;
413  }
414 
415  inline void Scalar::std_base(int m) {
416  for (int l=0 ; l<ndom ; l++)
417  val_zones[l]->std_base(m) ;
418  }
419 
420  inline void Scalar::std_anti_base(int m) {
421  for (int l=0 ; l<ndom ; l++)
422  val_zones[l]->std_anti_base(m) ;
423  }
424 
425  inline void Scalar::std_base_r_spher() {
426  for (int l=0 ; l<ndom ; l++)
428  }
429 
430  inline void Scalar::std_base_t_spher() {
431  for (int l=0 ; l<ndom ; l++)
433  }
434 
435  inline void Scalar::std_base_p_spher() {
436  for (int l=0 ; l<ndom ; l++)
438  }
439 
440  inline void Scalar::std_base_domain(int d) {
441  val_zones[d]->std_base() ;
442  }
443 
444  inline void Scalar::std_anti_base_domain(int d) {
445  val_zones[d]->std_anti_base() ;
446  }
447 
448  inline void Scalar::std_base_domain(int d, int m) {
449  val_zones[d]->std_base(m) ;
450  }
451 
452  inline void Scalar::std_base_x_cart_domain(int d) {
453  val_zones[d]->std_base_x_cart() ;
454  }
455 
456  inline void Scalar::std_base_y_cart_domain(int d) {
457  val_zones[d]->std_base_y_cart() ;
458  }
459 
460  inline void Scalar::std_base_z_cart_domain(int d) {
461  val_zones[d]->std_base_z_cart() ;
462  }
463 
464  inline void Scalar::std_base_r_spher_domain(int d) {
465  val_zones[d]->std_base_r_spher() ;
466  }
467 
468  inline void Scalar::std_base_t_spher_domain(int d) {
469  val_zones[d]->std_base_t_spher() ;
470  }
471 
472  inline void Scalar::std_base_p_spher_domain(int d) {
473  val_zones[d]->std_base_p_spher() ;
474  }
475 
476  inline void Scalar::std_base_xy_cart_domain(int d) {
477  val_zones[d]->std_base_xy_cart() ;
478  }
479 
480  inline void Scalar::std_base_xz_cart_domain(int d) {
481  val_zones[d]->std_base_xz_cart() ;
482  }
483 
484  inline void Scalar::std_base_yz_cart_domain(int d) {
485  val_zones[d]->std_base_yz_cart() ;
486  }
487 
488  inline void Scalar::std_base_rt_spher_domain(int d) {
489  val_zones[d]->std_base_rt_spher() ;
490  }
491 
492  inline void Scalar::std_base_rp_spher_domain(int d) {
493  val_zones[d]->std_base_rp_spher() ;
494  }
495 
496  inline void Scalar::std_base_tp_spher_domain(int d) {
497  val_zones[d]->std_base_tp_spher() ;
498  }
499 
500  inline void Scalar::std_xodd_base() {
501  val_zones[0]->std_xodd_base() ;
502  for (int l=1 ; l<ndom ; l++)
503  val_zones[l]->std_base() ;
504  }
505 
506  inline void Scalar::std_todd_base() {
507  for (int l=0 ; l<ndom ; l++)
508  val_zones[l]->std_todd_base() ;
509  }
510 
512  val_zones[0]->std_xodd_todd_base() ;
513  for (int l=1 ; l<ndom ; l++)
514  val_zones[l]->std_todd_base() ;
515  }
516 
517  inline void Scalar::std_base_odd () {
518  for (int l=0 ; l<ndom ; l++)
519  val_zones[l]->std_base_odd() ;
520  }
521 
522  inline void Scalar::std_base_r_mtz_domain(int d) {
523  val_zones[d]->std_base_r_mtz() ;
524  }
525 
526  inline void Scalar::std_base_t_mtz_domain(int d) {
527  val_zones[d]->std_base_t_mtz() ;
528  }
529 
530  inline void Scalar::std_base_p_mtz_domain(int d) {
531  val_zones[d]->std_base_p_mtz() ;
532  }
533 
534 
535  inline void Scalar::allocate_conf() {
536  for (int l=0 ; l<ndom ; l++)
537  val_zones[l]->allocate_conf() ;
538  }
539 
540  inline void Scalar::allocate_coef() {
541  for (int l=0 ; l<ndom ; l++)
542  val_zones[l]->allocate_coef() ;
543  }
544 
545 
546  inline const Val_domain& Scalar::operator() (int i) const {
547  assert ((i>=0) && (i<ndom)) ;
548  return (*val_zones[i]) ;
549  }
550  inline const Val_domain& Scalar::at(int i) const {
551  return operator()(i);
552  }
553 
554 
555  inline Val_domain& Scalar::set_domain (int l) {
556  assert ((l>=0) && (l<ndom)) ;
557  return *val_zones[l] ;
558  }
559 
560  inline void Scalar::set_val_inf(double x) {
561  val_zones[ndom-1]->get_domain()->set_val_inf(*val_zones[ndom-1], x) ;
562  }
563 
564  inline void Scalar::set_val_inf(double x, int l) {
565  val_zones[l]->get_domain()->set_val_inf(*val_zones[l], x) ;
566  }
567 
568  inline void Scalar::coef() const {
569  // Boucles sur les domaines
570  for (int l=0; l<ndom; l++)
571  val_zones[l]->coef() ;
572  }
573 
574  inline void Scalar::coef_i() const {
575  // Boucles sur les domaines
576  for (int l=0; l<ndom; l++)
577  val_zones[l]->coef_i() ;
578  }
579 
580  inline Scalar Scalar::zero(Space const& espace)
581  {
582  Scalar res(espace);
583  res = 0.0;
584  return res;
585  }
586 }
587 #endif
Abstract class that implements the fonctionnalities common to all the type of domains.
Definition: space.hpp:60
int get_m_quant() const
Returns .
Definition: tensor.hpp:747
The class Point is used to store the coordinates of a point.
Definition: point.hpp:30
The class Scalar does not really implements scalars in the mathematical sense but rather tensorial co...
Definition: scalar.hpp:67
void std_anti_base_domain(int)
Sets the standard, anti-symetric, basis of decomposition, in a given Domain.
Definition: scalar.hpp:444
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.
Definition: scalar.hpp:435
int get_ndim() const
Definition: scalar.hpp:113
friend Scalar cos(const Scalar &)
Operator cosine.
Definition: scalar_math.cpp:69
void std_base_rp_spher_domain(int d)
Sets the basis for the component of a 2-tensor in orthonormal spherical coordinates,...
Definition: scalar.hpp:492
void std_xodd_todd_base()
Sets the basis for an odd function in and (Critic case).
Definition: scalar.hpp:511
const Domain * get_domain(int i) const
Definition: scalar.hpp:122
void std_xodd_base()
Sets the basis for an odd function in (Critic case).
Definition: scalar.hpp:500
Scalar der_r() const
Returns the radial derivative.
Definition: scalar.cpp:165
Val_domain & set_domain(int)
Read/write of a particular Val_domain.
Definition: scalar.hpp:555
const Space & get_space() const
Definition: scalar.hpp:126
Scalar & operator=(const Scalar &)
Assignement to another Scalar.
Definition: scalar.cpp:31
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...
Definition: scalar.hpp:379
void operator*=(const Scalar &)
Operator *=.
Definition: scalar_math.cpp:33
void std_base_odd()
Sets the basis in odd polynomials.
Definition: scalar.hpp:517
void filter_phi(int dom, int ncf)
Sets to zero all the coefficients above a given order, for the coefficients, in a gicen Domain.
Definition: scalar.cpp:130
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.
Definition: scalar.hpp:560
void std_base_r_spher()
Sets the basis for the radial component of a vector in orthonormal spherical coordinates.
Definition: scalar.hpp:425
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.
Definition: scalar.hpp:476
double integrale() const
Returns the integral in the whole space.
Definition: scalar.cpp:173
void set_in_conf()
Destroys the values in the coefficient space.
Definition: scalar.hpp:389
void operator+=(const Scalar &)
Operator +=.
Definition: scalar_math.cpp:23
void std_base_z_cart_domain(int)
Sets the basis for the Z-component of a vector in Cartesian coordinates, in a given Domain.
Definition: scalar.hpp:460
void std_base_t_spher()
Sets the basis for the component of a vector in orthonormal spherical coordinates.
Definition: scalar.hpp:430
void operator-=(const Scalar &)
Operator -=.
Definition: scalar_math.cpp:28
void std_base_y_cart_domain(int)
Sets the basis for the Y-component of a vector in Cartesian coordinates, in a given Domain.
Definition: scalar.hpp:456
void std_base_rt_spher_domain(int d)
Sets the basis for the component of a 2-tensor in orthonormal spherical coordinates,...
Definition: scalar.hpp:488
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&#160;in the MTZ context,...
Definition: scalar.hpp:522
Scalar mult_cos_theta() const
Returns the multiplication by .
Scalar mult_sin_theta() const
Returns the multiplication by .
static Scalar zero(Space const &espace)
Definition: scalar.hpp:580
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 /=.
Definition: scalar_math.cpp:38
Memory_mapped_array< Val_domain * > val_zones
Pointers on the various Val_domain describing the field in each Domain.
Definition: scalar.hpp:70
friend ostream & operator<<(ostream &o, const Scalar &)
Display.
Definition: scalar.cpp:181
friend Scalar sin(const Scalar &)
Operator sine.
Definition: scalar_math.cpp:62
void coef_i() const
Computes the values in the configuration space.
Definition: scalar.hpp:574
void std_base_p_mtz_domain(int)
Sets the basis for the component of a vector in orthonormal coordinates in the MTZ context,...
Definition: scalar.hpp:530
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,...
Definition: scalar.hpp:464
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.
Definition: scalar.hpp:484
void allocate_coef()
Allocates the values in the coefficient space and destroys the values in the configuration space.
Definition: scalar.hpp:540
const Val_domain & at(int) const
Read only of a particular Val_domain.
Definition: scalar.hpp:550
virtual string get_class_name() const
Gives the class of the tensor.
Definition: scalar.hpp:131
void std_anti_base()
Sets the standard, anti-symetric, basis of decomposition.
Definition: scalar.hpp:410
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.
Definition: scalar.cpp:149
Scalar der_spher(int) const
Returns the derivative with respect to one particular absolute Cartesian coordinate.
Definition: scalar.cpp:157
void std_base_t_mtz_domain(int)
Sets the basis for the component of a vector in orthonormal coordinates in the MTZ context,...
Definition: scalar.hpp:526
int get_nbr_domains() const
Definition: scalar.hpp:117
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.
Definition: scalar.hpp:480
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.
Definition: scalar.cpp:96
void std_base_tp_spher_domain(int d)
Sets the basis for the component of a 2-tensor in orthonormal spherical coordinates,...
Definition: scalar.hpp:496
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,...
Definition: scalar.hpp:472
friend Scalar pow(const Scalar &, int)
Operator power (integer version)
friend Scalar operator+(const Scalar &)
Operator + (unitary version)
Definition: scalar_math.cpp:77
void coef() const
Computes the coefficients.
Definition: scalar.hpp:568
void set_in_coef()
Destroys the values in the configuration space.
Definition: scalar.hpp:394
void std_todd_base()
Sets the basis for an odd function in (Critic case).
Definition: scalar.hpp:506
void std_base_domain(int)
Sets the standard basis of decomposition, in a given Domain.
Definition: scalar.hpp:440
void allocate_conf()
Allocates the values in the configuration space and destroys the values in the coefficients space.
Definition: scalar.hpp:535
~Scalar() override
Destructor.
Definition: scalar.hpp:368
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.
Definition: scalar.cpp:62
double integ_volume() const
Definition: scalar.cpp:191
virtual void annule_hard_coef()
Sets the value to zero everywhere in the coefficient space(the logical state of the Val_domain is NOT...
Definition: scalar.hpp:384
void std_base_x_cart_domain(int)
Sets the basis for the X-component of a vector in Cartesian coordinates, in a given Domain.
Definition: scalar.hpp:452
Scalar der_var(int) const
Returns the derivative with respect to one particular numerical coordinate.
Definition: scalar.cpp:142
virtual void save(FILE *) const
Saving function.
Definition: scalar.cpp:26
friend Scalar operator-(const Scalar &)
Operator - (unitary version)
Definition: scalar_math.cpp:82
void std_base()
Sets the standard basis of decomposition.
Definition: scalar.hpp:399
void std_base_t_spher_domain(int)
Sets the basis for the component of a vector in orthonormal spherical coordinates,...
Definition: scalar.hpp:468
The Space_spheric class fills the space with one nucleus, several shells and a compactified domain,...
Definition: spheric.hpp:1350
The Space class is an ensemble of domains describing the whole space of the computation.
Definition: space.hpp:1362
const Domain * get_domain(int i) const
returns a pointer on the domain.
Definition: space.hpp:1385
Tensor handling.
Definition: tensor.hpp:149
int ndim
The dimension/.
Definition: tensor.hpp:156
const Scalar & operator()() const
Read only for a Scalar.
int ndom
The number of Domain.
Definition: tensor.hpp:155
int valence
Valence of the tensor (0 = scalar, 1 = vector, etc...)
Definition: tensor.hpp:157
Param_tensor parameters
Possible additional parameters relevant for the current Tensor.
Definition: tensor.hpp:181
Param_tensor & set_parameters()
Read/write of the parameters.
Definition: tensor.hpp:314
Memory_mapped_array< Scalar * > cmp
Array of size n_comp of pointers onto the components.
Definition: tensor.hpp:179
const Param_tensor & get_parameters() const
Returns a pointer on the possible additional parameter.
Definition: tensor.hpp:311
const Space & espace
The Space.
Definition: tensor.hpp:154
bool is_m_quant_affected() const
Checks whether the additional parameter is affected (used for boson stars for instance).
Definition: tensor.hpp:326
Class for storing the basis of decompositions of a field and its values on both the configuration and...
Definition: val_domain.hpp:69
void annule_hard_coef()
Sets all the arrays to zero in the coefficient space (the logical state is NOT set to zero).
Definition: val_domain.cpp:165
void annule_hard()
Sets all the arrays to zero (the logical state is NOT set to zero).
Definition: val_domain.cpp:159
A class derived from Tensor to deal specificaly with objects of valence 1 (and so also 1-forms).
Definition: vector.hpp:41