20 #include "headcpp.hpp"
22 #include "bispheric.hpp"
24 #include "tensor_impl.hpp"
46 cerr <<
"Unknown order in Domain_bispheric_chi_first:export_tau_val_domain" << endl ;
59 for (
int j=0 ; j<
nbr_coefs(1)-forgot_chi ; j++) {
62 for (
int i=0 ; i<
nbr_coefs(0)-order ; i++) {
67 if ((k%2!=1) || (j!=
nbr_coefs(1)-1-forgot_chi)) {
68 if ((k==0) || (k%2==1)) {
70 sec.
set(pos_sec) = (*so.
cf)(pos_cf) ;
76 double factor_galerkin ;
79 factor_galerkin = (j%2==1) ? -2. : 2. ;
82 factor_galerkin = -double(4*j+1) ;
83 for (
int jj=1 ; jj<=j ; jj++)
84 factor_galerkin *= -
double(2*jj-1)/double(2*jj) ;
87 cerr <<
"Unknown type of basis in Domain_bispheric_chi_first::export_tau_val_domain" << endl ;
90 pos_galerkin = pos_cf ;
91 pos_galerkin.
set(1) = 0 ;
92 sec.
set(pos_sec) = (*so.
cf)(pos_cf) + factor_galerkin * (*so.
cf)(pos_galerkin) ;
100 if ((k%2!=1) || (j!=
nbr_coefs(1)-1-forgot_chi)) {
103 sec.
set(pos_sec) = (*so.
cf)(pos_cf) ;
109 double factor_galerkin ;
112 factor_galerkin = (j%2==1) ? -2. : 2. ;
115 factor_galerkin = -double(4*j+1) ;
116 for (
int jj=1 ; jj<=j ; jj++)
117 factor_galerkin *= -
double(2*jj-1)/double(2*jj) ;
120 cerr <<
"Unknown type of basis in Domain_bispheric_chi_first::export_tau_val_domain" << endl ;
123 pos_galerkin = pos_cf ;
124 pos_galerkin.
set(1) = 0 ;
125 sec.
set(pos_sec) = (*so.
cf)(pos_cf) + factor_galerkin * (*so.
cf)(pos_galerkin) ;
130 cerr <<
"Unknown base in Domain_bispheric_chi_first::export_tau_val_domain" << endl ;
156 else for (
int i=0 ; i<n_cmp ; i++) {
157 if ((*p_cmp[i])(0)==1)
159 if ((*p_cmp[i])(0)==2)
161 if ((*p_cmp[i])(0)==3)
167 cerr <<
"Unknown type of vector Domain_bispheric_chi_first::export_tau" << endl ;
184 else for (
int i=0 ; i<n_cmp ; i++) {
185 if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==1))
187 if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==2))
189 if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==3))
191 if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==2))
193 if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==3))
195 if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==3))
213 else for (
int i=0 ; i<n_cmp ; i++) {
214 if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==1))
216 if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==2))
218 if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==3))
220 if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==1))
222 if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==2))
224 if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==3))
226 if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==1))
228 if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==2))
230 if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==3))
236 cerr <<
"Unknown type of 2-tensor Domain_bispheric_chi_first::export_tau" << endl ;
242 cerr <<
"Valence " << val <<
" not implemented in Domain_bispheric_chi_first::export_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.
void export_tau_val_domain(const Val_domain &eq, int order, Array< double > &res, int &pos_res, int ncond) const
Exports a residual equation in the bulk.
virtual void export_tau(const Tensor &, int, int, Array< double > &, int &, const Array< int > &, int n_cmp=-1, Array< int > **p_cmp=0x0) const
Exports all the residual equations corresponding to a tensorial one in the bulk.
Dim_array nbr_coefs
Number of coefficients.
int type_base
Type of colocation point :
Class that gives the position inside a multi-dimensional Array.
int & set(int i)
Read/write of the position in a given dimension.
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.
Class for storing the basis of decompositions of a field and its values on both the configuration and...
bool check_if_zero() const
Check whether the logical state is zero or not.
Array< double > * cf
Pointer on the Array of the values in the coefficients space.
void coef() const
Computes the coefficients.
const Base_spectral & get_base() const
Returns the basis of decomposition.