20 #include "headcpp.hpp"
21 #include "bispheric.hpp"
23 #include "tensor_impl.hpp"
38 if (bound==INNER_BC) {
50 if ((k==0) || (k%2==1)) {
58 double factor_galerkin ;
61 factor_galerkin = (j%2==1) ? -2. : 2. ;
64 factor_galerkin = -double(4*j+1) ;
65 for (
int jj=1 ; jj<=j ; jj++)
66 factor_galerkin *= -
double(2*jj-1)/double(2*jj) ;
69 cerr <<
"Unknown type of basis in Domain_bispheric_rect::export_tau_boundary" << endl ;
73 pos_galerkin.
set(1) = 0 ;
75 factor_galerkin *
val_boundary (bound, so, pos_galerkin) ;
92 double factor_galerkin ;
95 factor_galerkin = (j%2==1) ? -2. : 2. ;
98 factor_galerkin = -double(4*j+1) ;
99 for (
int jj=1 ; jj<=j ; jj++)
100 factor_galerkin *= -
double(2*jj-1)/double(2*jj) ;
103 cerr <<
"Unknown type of basis in Domain_bispheric_rect::export_tau_boundary" << endl ;
107 pos_galerkin.
set(1) = 0 ;
109 factor_galerkin *
val_boundary (bound, so, pos_galerkin) ;
114 cerr <<
"Unknown base in Domain_bispheric_rect::export_tau_boundary" << endl ;
121 if (bound==ETA_PLUS_BC) {
132 if ((k==0) || (k%2==1)) {
140 double factor_galerkin ;
143 factor_galerkin = (j%2==1) ? -2. : 2. ;
146 factor_galerkin = -double(4*j+1) ;
147 for (
int jj=1 ; jj<=j ; jj++)
148 factor_galerkin *= -
double(2*jj-1)/double(2*jj) ;
151 cerr <<
"Unknown type of basis in Domain_bispheric_rect::export_tau_val_domain_boundary" << endl ;
155 pos_galerkin.
set(1) = 0 ;
157 factor_galerkin *
val_boundary (bound, so, pos_galerkin) ;
174 double factor_galerkin ;
177 factor_galerkin = (j%2==1) ? -2. : 2. ;
180 factor_galerkin = -double(4*j+1) ;
181 for (
int jj=1 ; jj<=j ; jj++)
182 factor_galerkin *= -
double(2*jj-1)/double(2*jj) ;
185 cerr <<
"Unknown type of basis in Domain_bispheric_rect::export_tau_val_domain_boundary" << endl ;
189 pos_galerkin.
set(1) = 0 ;
191 factor_galerkin *
val_boundary (bound, so, pos_galerkin) ;
196 cerr <<
"Unknown base in Domain_bispheric_rect::export_tau_val_domain_boundary" << endl ;
203 if (bound==CHI_ONE_BC) {
206 if ((basep==COS) || ((k!=0) && (k!=
nbr_coefs(2)-1)))
215 if (bound==OUTER_BC) {
220 if ((basep==COS) || ((k!=0) && (k!=
nbr_coefs(2)-1))) {
233 if ((bound!=INNER_BC) && (bound!=ETA_PLUS_BC) && (bound!=CHI_ONE_BC) && (bound!=OUTER_BC)) {
234 cerr <<
"Unknown boundary in Domain_bispheric_rect::export_tau_boundary" << endl ;
252 else for (
int i=0 ; i<n_cmp ; i++) {
253 if ((*p_cmp[i])(0)==1)
255 if ((*p_cmp[i])(0)==2)
257 if ((*p_cmp[i])(0)==3)
263 cerr <<
"Unknown type of vector Domain_bispheric_rect::export_tau_boundary" << endl ;
280 else for (
int i=0 ; i<n_cmp ; i++) {
281 if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==1))
283 if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==2))
285 if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==3))
287 if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==2))
289 if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==3))
291 if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==3))
310 else for (
int i=0 ; i<n_cmp ; i++) {
311 if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==1))
313 if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==2))
315 if (((*p_cmp[i])(0)==1) && ((*p_cmp[i])(1)==3))
317 if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==1))
319 if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==2))
321 if (((*p_cmp[i])(0)==2) && ((*p_cmp[i])(1)==3))
323 if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==1))
325 if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==2))
327 if (((*p_cmp[i])(0)==3) && ((*p_cmp[i])(1)==3))
333 cerr <<
"Unknown type of 2-tensor Domain_bispheric_rect::export_tau_boundary" << endl ;
339 cerr <<
"Valence " << val <<
" not implemented in Domain_bispheric_rect::export_tau_boundary" << 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_boundary(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 on a given boundary It makes use ...
virtual double val_boundary(int, const Val_domain &, const Index &) const
Computes the value of a field at a boundary.
void export_tau_val_domain_boundary(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 It makes use ...
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.