20 #include "headcpp.hpp"
21 #include "spheric_symphi.hpp"
22 #include "array_math.hpp"
24 #include "tensor_impl.hpp"
37 double fact_t, fact_r, fact_rt ;
61 cerr <<
"Unknow phi basis in Domain_nucleus_symphi::affecte_tau_val_domain" << endl ;
69 for (
int k=kmin ; k<=kmax ; k++) {
88 cerr <<
"Unknow phi basis in Domain_nucleus_symphi::affecte_tau_val_domain" << endl ;
104 if ((mquant==0) && (lquant==0)) {
105 so.
cf->
set(pos_cf) += values(conte) ;
108 else if (mquant==0) {
112 pos_gal_r.
set(0) = 0 ;
115 fact_r = - pow(-1, i) ;
119 for (
int t=0 ; t<i ; t++)
120 fact_r *= -
double(2*t+1)/double(2*t+2) ;
124 cerr <<
"Strange base in Domain_nucleus_symphi::affecte_tau_val_domain" << endl ;
128 so.
cf->
set(pos_cf) += values(conte) ;
129 so.
cf->
set(pos_gal_r) += fact_r*values(conte) ;
133 else if ((j!=0) && (i!=0)) {
136 pos_gal_r.
set(0) = 0 ;
138 pos_gal_t.
set(1) = 0 ;
139 pos_gal_rt = pos_cf ;
140 pos_gal_rt.
set(0) = 0 ;
141 pos_gal_rt.
set(1) = 0 ;
144 fact_r = -pow(-1, i) ;
146 fact_rt = pow(-1, i) ;
150 for (
int t=0 ; t<i ; t++)
151 l0 *= -
double(2*t+1)/double(2*t+2) ;
158 cerr <<
"Strange base in Domain_nucleus_symphi::affecte_tau_val_domain" << endl ;
161 so.
cf->
set(pos_cf) += values(conte) ;
162 so.
cf->
set(pos_gal_r) += fact_r*values(conte) ;
163 so.
cf->
set(pos_gal_t) += fact_t*values(conte) ;
164 so.
cf->
set(pos_gal_rt) += fact_rt*values(conte) ;
171 if ((k==0) && (lquant<=1)) {
172 so.
cf->
set(pos_cf) += values(conte) ;
176 if ((mquant==0) && (i!=0)) {
178 pos_gal_r.
set(0) = 0 ;
181 fact_r = - (2*i+1) * pow(-1, i) ;
185 for (
int t=0 ; t<i ; t++)
186 fact_r *= -
double(2*t+3)/double(2*t+2) ;
190 cerr <<
"Strange base in Domain_nucleus_symphi::affecte_tau_val_domain" << endl ;
193 so.
cf->
set(pos_cf) += values(conte) ;
194 so.
cf->
set(pos_gal_r) += fact_r*values(conte) ;
197 else if ((j!=0) && (i!=0)) {
200 pos_gal_r.
set(0) = 0 ;
202 pos_gal_t.
set(1) = 0 ;
203 pos_gal_rt = pos_cf ;
204 pos_gal_rt.
set(0) = 0 ;
205 pos_gal_rt.
set(1) = 0 ;
208 fact_r = -pow(-1, i)*(2*i+1) ;
210 fact_rt = pow(-1, i)*(2*i+1) ;
214 for (
int t=0 ; t<i ; t++)
215 l0 *= -
double(2*t+3)/double(2*t+2) ;
222 cerr <<
"Strange base in Domain_nucleus_symphi::affecte_tau_val_domain" << endl ;
225 so.
cf->
set(pos_cf) += values(conte) ;
226 so.
cf->
set(pos_gal_r) += fact_r*values(conte) ;
227 so.
cf->
set(pos_gal_t) += fact_t*values(conte) ;
228 so.
cf->
set(pos_gal_rt) += fact_rt*values(conte) ;
237 if ((mquant<=1) && (lquant==0)) {
238 so.
cf->
set(pos_cf) += values(conte) ;
242 if ((mquant<=1) && (i!=0)) {
245 pos_gal_r.
set(0) = 0 ;
248 fact_r = - pow(-1, i) ;
252 for (
int t=0 ; t<i ; t++)
253 fact_r *= -
double(2*t+1)/double(2*t+2) ;
257 cerr <<
"Strange base in Domain_nucleus_symphi::affecte_tau_val_domain" << endl ;
260 so.
cf->
set(pos_cf) += values(conte) ;
261 so.
cf->
set(pos_gal_r) += fact_r*values(conte) ;
266 if ((j!=1) && (i!=0)) {
269 pos_gal_r.
set(0) = 0 ;
271 pos_gal_t.
set(1) = 1 ;
272 pos_gal_rt = pos_cf ;
273 pos_gal_rt.
set(0) = 0 ;
274 pos_gal_rt.
set(1) = 1 ;
277 fact_r = -pow(-1, i) ;
279 fact_rt = pow(-1, i)*j ;
283 for (
int t=0 ; t<i ; t++)
284 l0 *= -
double(2*t+1)/double(2*t+2) ;
291 cerr <<
"Strange base in Domain_nucleus_symphi::affecte_tau_val_domain" << endl ;
294 so.
cf->
set(pos_cf) += values(conte) ;
295 so.
cf->
set(pos_gal_r) += fact_r*values(conte) ;
296 so.
cf->
set(pos_gal_t) += fact_t*values(conte) ;
297 so.
cf->
set(pos_gal_rt) += fact_rt*values(conte) ;
307 if ((mquant<=1) && (lquant<=1)) {
308 so.
cf->
set(pos_cf) += values(conte) ;
312 if ((mquant<=1) && (i!=0)) {
314 pos_gal_r.
set(0) = 0 ;
317 fact_r = - (2*i+1) * pow(-1, i) ;
321 for (
int t=0 ; t<i ; t++)
322 fact_r *= -
double(2*t+3)/double(2*t+2) ;
326 cerr <<
"Strange base in Domain_nucleus_symphi::affecte_tau_val_domain" << endl ;
329 so.
cf->
set(pos_cf) += values(conte) ;
330 so.
cf->
set(pos_gal_r) += fact_r*values(conte) ;
333 else if ((j!=0) && (i!=0)) {
336 pos_gal_r.
set(0) = 0 ;
338 pos_gal_t.
set(1) = 0 ;
339 pos_gal_rt = pos_cf ;
340 pos_gal_rt.
set(0) = 0 ;
341 pos_gal_rt.
set(1) = 0 ;
344 fact_r = -pow(-1, i)*(2*i+1) ;
346 fact_rt = pow(-1, i)*(2*i+1)*(2*j+1) ;
350 for (
int t=0 ; t<i ; t++)
351 l0 *= -
double(2*t+3)/double(2*t+2) ;
354 fact_rt = l0*(2*j+1) ;
358 cerr <<
"Strange base in Domain_nucleus_symphi::affecte_tau_val_domain" << endl ;
361 so.
cf->
set(pos_cf) += values(conte) ;
362 so.
cf->
set(pos_gal_r) += fact_r*values(conte) ;
363 so.
cf->
set(pos_gal_t) += fact_t*values(conte) ;
364 so.
cf->
set(pos_gal_rt) += fact_rt*values(conte) ;
371 cerr <<
"Unknow theta basis in Domain_nucleus_symphi::affecte_tau_val_domain" << endl ;
400 cerr <<
"Unknown type of vector Domain_nucleus_symphi::affecte_tau" << endl ;
431 cerr <<
"Unknown type of 2-tensor Domain_nucleus_symphi::affecte_tau" << endl ;
437 cerr <<
"Valence " << val <<
" not implemented in Domain_nucleus_symphi::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.
void affecte_tau_val_domain(Val_domain &so, const Array< double > &cf, int &pos_cf) const
Affects some coefficients to a Val_domain.
virtual void affecte_tau(Tensor &, int, const Array< double > &, int &) const
Affects some coefficients to a Tensor.
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.
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 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.
const Base_spectral & get_base() const
Returns the basis of decomposition.