20 #include "headcpp.hpp"
22 #include "tensor_impl.hpp"
33 for (
int i=0 ; i<
ndom ; i++) {
43 for (
int i=0 ; i<
ndom ; i++) {
50 #ifdef TENSOR_MOVE_SEMANTIC
53 assert(so.valence==0);
54 this->do_move(std::move(so),
false);
55 val_zones.swap(so.cmp[0]->val_zones);
57 assert(cmp[0] ==
this);
63 assert ((sens==+1) || (sens==-1)) ;
65 bool* inside =
new bool[
ndom] ;
66 for (
int l=
ndom-1 ; l>=0 ; l--)
71 for (
int l=
ndom-1 ; l>=0 ; l--)
72 if ((ld==-1) && (inside[l])) ld = l ;
75 for (
int l=0 ; l<
ndom ; l++)
76 if ((ld==-1) && (inside[l])) ld = l ;
78 #ifndef REMOVE_ALL_CHECKS
80 cout <<
"Point " << xx <<
"not found in the computational space..." << endl ;
97 assert ((sens==+1) || (sens==-1)) ;
99 bool* inside =
new bool[
ndom] ;
100 for (
int l=
ndom-1 ; l>=0 ; l--)
105 for (
int l=
ndom-1 ; l>=0 ; l--)
106 if ((ld==-1) && (inside[l])) ld = l ;
109 for (
int l=0 ; l<
ndom ; l++)
110 if ((ld==-1) && (inside[l])) ld = l ;
135 if (pcf(2)+ncf > np-1)
143 Scalar res (*
this,
false) ;
144 for (
int dom=0 ; dom<
ndom ; dom++)
150 Scalar res (*
this,
false) ;
151 for (
int dom=0 ; dom<
ndom ; dom++)
159 Scalar res(*
this,
false) ;
160 for (
int dom(0) ; dom <
ndom ; ++dom)
166 Scalar res (*
this,
false) ;
167 for (
int dom=0 ; dom<
ndom ; dom++)
175 for (
int dom=0 ; dom<
ndom ; dom++)
181 ostream& operator<< (ostream& o,
const Scalar& so) {
183 o <<
"Scalar" << endl ;
184 for (
int l=0 ; l<so.
ndom ; l++) {
185 o <<
"Domain : " << l << endl ;
193 for (
int dom=0 ; dom<
ndom ; dom++)
Dim_array const & get_nbr_coefs() const
Returns the number of coefficients.
virtual bool is_in(const Point &xx, double prec=1e-13) const
Check whether a point lies inside Domain.
Class that gives the position inside a multi-dimensional Array.
bool inc(int increm, int var=0)
Increments the position of the Index.
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...
const Domain * get_domain(int i) const
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.
void filter_phi(int dom, int ncf)
Sets to zero all the coefficients above a given order, for the coefficients, in a gicen Domain.
double integrale() const
Returns the integral in the whole space.
Memory_mapped_array< Val_domain * > val_zones
Pointers on the various Val_domain describing the field in each Domain.
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.
int get_nbr_domains() const
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 coef() const
Computes the coefficients.
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
Scalar der_var(int) const
Returns the derivative with respect to one particular numerical coordinate.
virtual void save(FILE *) const
Saving function.
const Domain * get_domain(int i) const
returns a pointer on the domain.
int ndom
The number of Domain.
int valence
Valence of the tensor (0 = scalar, 1 = vector, etc...)
Memory_mapped_array< Scalar * > cmp
Array of size n_comp of pointers onto the components.
const Space & espace
The Space.
Class for storing the basis of decompositions of a field and its values on both the configuration and...
double & set_coef(const Index &pos)
Read/write the value of the field in the coefficient space.