20 #include "headcpp.hpp"
22 #include "bispheric.hpp"
24 #include "tensor_impl.hpp"
26 #include "exceptions.hpp"
45 if ((pos(2)%2==1) && (pos(0)==
nbr_coefs(0)-1))
48 if ((pos(2)!=0) && (pos(2)%2==0) && (pos(0)==0))
53 if ((pos(2)==0) || (pos(2)==
nbr_coefs(2)-1))
56 if ((pos(2)%2==1) && (pos(0)==
nbr_coefs(0)-1))
59 if ((pos(2)%2==0) && (pos(0)==0))
63 cerr <<
"Unknwon phi basis in Domain_bispheric_eta_first::export_tau_one_coef_val_domain" << endl ;
71 if ((pos(2)%2==0) && (pos(2)!=0)) {
72 Index pos_galerkin (pos) ;
73 pos_galerkin.
set(0) = 0 ;
78 valreg = (pos(0)%2==0) ? -1 : 1 ;
82 for (
int i=1 ; i<pos(0) ; i++)
83 valreg *= -
double(2*i+1)/double(2*i+2) ;
86 std::string where {
"Domain_bispheric_eta_first::affecte_one_coef_val_domain (in file "};
87 where += std::string{__FILE__} +
" at line " + std::string{__LINE__} +
") ";
88 cerr <<
"Unknown base in "<< where <<
"(base code = "<< basechi <<
")." << endl ;
89 throw Unknown_base_error{basechi,where} ;
91 so.
cf->
set(pos_galerkin) = valreg ;
95 so.
cf->
set(pos) = 0. ;
126 cerr <<
"Unknown type of vector Domain_bispheric_eta_first::affecte_tau_one_coef" << endl ;
157 cerr <<
"Unknown type of 2-tensor Domain_bispheric_eta_first::affecte_tau_one_coef" << endl ;
163 cerr <<
"Valence " << val <<
" not implemented in Domain_bispheric_eta_first::affecte_tau" << endl ;
reference set(const Index &pos)
Read/write of an element.
Bases_container bases_1d
Arrays containing the various basis of decomposition.
int get_basis(int nd) const
Read only the basis in a given domain.
virtual void affecte_tau_one_coef(Tensor &, int, int, int &) const
Sets at most one coefficient of a Tensor to 1.
void affecte_tau_one_coef_val_domain(Val_domain &so, int cc, int &pos_cf) const
Sets at most one coefficient of a Val_domain to 1.
Dim_array nbr_coefs
Number of coefficients.
Class that gives the position inside a multi-dimensional Array.
int & set(int i)
Read/write of the position in a given dimension.
bool inc(int increm, int var=0)
Increments the position of the Index.
Val_domain & set_domain(int)
Read/write of a particular Val_domain.
const Domain * get_domain(int i) const
returns a pointer on the domain.
Scalar & set(const Array< int > &ind)
Returns the value of a component (read/write version).
const Base_tensor & get_basis() const
Returns the vectorial basis (triad) on which the components are defined.
int get_n_comp() const
Returns the number of stored components.
int get_valence() const
Returns the valence.
const Space & get_space() const
Returns the Space.
Class for storing the basis of decompositions of a field and its values on both the configuration and...
void set_zero()
Sets the Val_domain to zero (logical state to zero and arrays destroyed).
void allocate_coef()
Allocates the values in the coefficient space and destroys the values in the configuration space.
Array< double > * cf
Pointer on the Array of the values in the coefficients space.
bool is_zero
Indicator used for null fields (for speed issues).
const Base_spectral & get_base() const
Returns the basis of decomposition.