20 #include "headcpp.hpp"
22 #include "bispheric.hpp"
24 #include "tensor_impl.hpp"
50 cerr <<
"Unknown order in Domain_bispheric_eta_first::export_tau_val_domain" << endl ;
63 for (
int j=0 ; j<
nbr_coefs(1)-forgot_eta ; j++) {
66 for (
int i=0 ; i<
nbr_coefs(0)-forgot_chi ; i++) {
71 if ((k%2!=1) || (i!=
nbr_coefs(0)-1-forgot_chi)) {
72 if ((k==0) || (k%2==1)) {
74 sec.
set(pos_sec) = (*so.
cf)(pos_cf) ;
80 double factor_galerkin ;
83 factor_galerkin = (i%2==1) ? -2. : 2. ;
86 factor_galerkin = -double(4*i+1) ;
87 for (
int ii=1 ; ii<=i ; ii++)
88 factor_galerkin *= -
double(2*ii-1)/double(2*ii) ;
91 cerr <<
"Unknown type of basis in Domain_bispheric_eta_first::export_tau_val_domain" << endl ;
94 pos_galerkin = pos_cf ;
95 pos_galerkin.
set(0) = 0 ;
96 sec.
set(pos_sec) = (*so.
cf)(pos_cf) + factor_galerkin * (*so.
cf)(pos_galerkin) ;
104 if ((k%2!=1) || (i!=
nbr_coefs(0)-1-forgot_chi)) {
107 sec.
set(pos_sec) = (*so.
cf)(pos_cf) ;
113 double factor_galerkin ;
116 factor_galerkin = (i%2==1) ? -2. : 2. ;
119 factor_galerkin = -double(4*i+1) ;
120 for (
int ii=1 ; ii<=i ; ii++)
121 factor_galerkin *= -
double(2*ii-1)/double(2*ii) ;
124 cerr <<
"Unknown type of basis in Domain_bispheric_eta_first::export_tau_val_domain" << endl ;
127 pos_galerkin = pos_cf ;
128 pos_galerkin.
set(0) = 0 ;
129 sec.
set(pos_sec) = (*so.
cf)(pos_cf) + factor_galerkin * (*so.
cf)(pos_galerkin) ;
134 cerr <<
"Unknown base in Domain_bispheric_eta_first::export_tau_val_domain" << endl ;
161 else for (
int i=0 ; i<n_cmp ; i++) {
162 if ((*p_cmp[i])(0)==1)
164 if ((*p_cmp[i])(0)==2)
166 if ((*p_cmp[i])(0)==3)
172 cerr <<
"Unknown type of vector Domain_bispheric_eta_first::export_tau" << endl ;
189 else for (
int i=0 ; i<n_cmp ; i++) {
190 if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==1))
192 if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==2))
194 if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==3))
196 if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==2))
198 if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==3))
200 if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==3))
218 else for (
int i=0 ; i<n_cmp ; i++) {
219 if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==1))
221 if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==2))
223 if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==3))
225 if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==1))
227 if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==2))
229 if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==3))
231 if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==1))
233 if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==2))
235 if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==3))
241 cerr <<
"Unknown type of 2-tensor Domain_bispheric_eta_first::export_tau" << endl ;
247 cerr <<
"Valence " << val <<
" not implemented in Domain_bispheric_eta_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.
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.
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.
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.