20 #include "headcpp.hpp"
22 #include "bispheric.hpp"
24 #include "tensor_impl.hpp"
39 if (bound==INNER_BC) {
51 if ((k==0) || (k%2==1)) {
59 double factor_galerkin ;
62 factor_galerkin = (j%2==1) ? -2. : 2. ;
65 factor_galerkin = -double(4*j+1) ;
66 for (
int jj=1 ; jj<=j ; jj++)
67 factor_galerkin *= -
double(2*jj-1)/double(2*jj) ;
70 cerr <<
"Unknown type of basis in Domain_bispheric_rect::export_tau_boundary_one_side" << endl ;
74 pos_galerkin.
set(1) = 0 ;
76 factor_galerkin *
val_boundary (bound, so, pos_galerkin) ;
93 double factor_galerkin ;
96 factor_galerkin = (j%2==1) ? -2. : 2. ;
99 factor_galerkin = -double(4*j+1) ;
100 for (
int jj=1 ; jj<=j ; jj++)
101 factor_galerkin *= -
double(2*jj-1)/double(2*jj) ;
104 cerr <<
"Unknown type of basis in Domain_bispheric_rect::export_tau_boundary_one_side" << endl ;
108 pos_galerkin.
set(1) = 0 ;
110 factor_galerkin *
val_boundary (bound, so, pos_galerkin) ;
115 cerr <<
"Unknown base in Domain_bispheric_rect::export_tau_boundary_one_side" << endl ;
122 if (bound==ETA_PLUS_BC) {
133 if ((k==0) || (k%2==1)) {
141 double factor_galerkin ;
144 factor_galerkin = (j%2==1) ? -2. : 2. ;
147 factor_galerkin = -double(4*j+1) ;
148 for (
int jj=1 ; jj<=j ; jj++)
149 factor_galerkin *= -
double(2*jj-1)/double(2*jj) ;
152 cerr <<
"Unknown type of basis in Domain_bispheric_rect::export_tau_val_domain_boundary_one_side_one_side" << endl ;
156 pos_galerkin.
set(1) = 0 ;
158 factor_galerkin *
val_boundary (bound, so, pos_galerkin) ;
175 double factor_galerkin ;
178 factor_galerkin = (j%2==1) ? -2. : 2. ;
181 factor_galerkin = -double(4*j+1) ;
182 for (
int jj=1 ; jj<=j ; jj++)
183 factor_galerkin *= -
double(2*jj-1)/double(2*jj) ;
186 cerr <<
"Unknown type of basis in Domain_bispheric_rect::export_tau_val_domain_boundary_one_side" << endl ;
190 pos_galerkin.
set(1) = 0 ;
192 factor_galerkin *
val_boundary (bound, so, pos_galerkin) ;
197 cerr <<
"Unknown base in Domain_bispheric_rect::export_tau_val_domain_boundary_one_side" << endl ;
204 if (bound==CHI_ONE_BC) {
207 if ((basep==COS) || ((k!=0) && (k!=
nbr_coefs(2)-1)))
216 if (bound==OUTER_BC) {
221 if ((basep==COS) || ((k!=0) && (k!=
nbr_coefs(2)-1))) {
234 if ((bound!=INNER_BC) && (bound!=ETA_PLUS_BC) && (bound!=CHI_ONE_BC) && (bound!=OUTER_BC)) {
235 cerr <<
"Unknown boundary in Domain_bispheric_rect::export_tau_boundary_one_side" << endl ;
253 else for (
int i=0 ; i<n_cmp ; i++) {
254 if ((*p_cmp[i])(0)==1)
256 if ((*p_cmp[i])(0)==2)
258 if ((*p_cmp[i])(0)==3)
264 cerr <<
"Unknown type of vector Domain_bispheric_rect::export_tau_boundary_one_side" << endl ;
281 else for (
int i=0 ; i<n_cmp ; i++) {
282 if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==1))
284 if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==2))
286 if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==3))
288 if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==2))
290 if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==3))
292 if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==3))
311 else for (
int i=0 ; i<n_cmp ; i++) {
312 if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==1))
314 if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==2))
316 if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==3))
318 if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==1))
320 if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==2))
322 if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==3))
324 if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==1))
326 if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==2))
328 if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==3))
334 cerr <<
"Unknown type of 2-tensor Domain_bispheric_rect::export_tau_boundary_one_side" << endl ;
340 cerr <<
"Valence " << val <<
" not implemented in Domain_bispheric_rect::export_tau_boundary_one_side" << 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 double val_boundary(int, const Val_domain &, const Index &) const
Computes the value of a field at a boundary.
virtual void export_tau_boundary_one_side(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 one tensorial one on a given boundary.
void export_tau_val_domain_boundary_one_side(const Val_domain &eq, int bound, Array< double > &res, int &pos_res, int ncond) const
Exports all the residual equations corresponding to a tensorial one on a given boundary,...
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.
void coef() const
Computes the coefficients.
const Base_spectral & get_base() const
Returns the basis of decomposition.