20 #include "headcpp.hpp"
22 #include "utilities.hpp"
23 #include "spheric.hpp"
25 #include "tensor_impl.hpp"
27 #include "term_eq.hpp"
29 Array<double> mat_inv_leg_even (
int,
int) ;
30 Array<double> mat_inv_leg_odd (
int,
int) ;
31 Array<double> mat_leg_even (
int,
int) ;
32 Array<double> mat_leg_odd (
int,
int) ;
46 cerr <<
"Domain_shell::bc_waves_tensor only defined with respect to second order tensor (i.e. valence must be 2)" << endl ;
51 cerr <<
"Domain_shell::bc_waves_tensor only defined with respect to a symmetric tensor" << endl ;
55 cerr <<
"Domain_shell::bc_waves_tensor only defined with respect to Cartesian tensorial basis" << endl ;
72 for (
int m=0 ; m<nbrm ; m++)
73 for (
int l=0 ; l<nbrl ; l++) {
85 Tensor res (gamma,
false) ;
112 for (
int k=0 ; k<kkmax ; k+=2) {
119 int jmin = (mm%2==0) ?
int(mm/2) : int((mm-1)/2) ;
120 int jmax = (mm%2==0) ? jjmax : jjmax-1 ;
121 for (
int j=jmin ; j<jmax ; j++) {
123 int ll = (mm%2==0) ? 2*j : 2*j+1 ;
126 double Rxx, Rxy, Ryy, Rzz, Ixx, Ixy, Iyy, Izz ;
134 Ixx = ((k==kkmax-1) || (k==0)) ? 0 :
multipoles_sym (k+1, j, OUTER_BC, gamma(1,1)(dom-1).
der_r(), passage_even) ;
135 Ixy = ((k==kkmax-1) || (k==0)) ? 0 :
multipoles_sym (k+1, j, OUTER_BC, gamma(1,2)(dom-1).
der_r(), passage_even) ;
136 Iyy = ((k==kkmax-1) || (k==0)) ? 0 :
multipoles_sym (k+1, j, OUTER_BC, gamma(2,2)(dom-1).
der_r(), passage_even) ;
137 Izz = ((k==kkmax-1) || (k==0)) ? 0 :
multipoles_sym (k+1, j, OUTER_BC, gamma(3,3)(dom-1).
der_r(), passage_even) ;
145 Ixx = ((k==kkmax-1) || (k==0)) ? 0 :
multipoles_sym (k+1, j, OUTER_BC, gamma(1,1)(dom).
der_r(), passage_even) ;
146 Ixy = ((k==kkmax-1) || (k==0)) ? 0 :
multipoles_sym (k+1, j, OUTER_BC, gamma(1,2)(dom).
der_r(), passage_even) ;
147 Iyy = ((k==kkmax-1) || (k==0)) ? 0 :
multipoles_sym (k+1, j, OUTER_BC, gamma(2,2)(dom).
der_r(), passage_even) ;
148 Izz = ((k==kkmax-1) || (k==0)) ? 0 :
multipoles_sym (k+1, j, OUTER_BC, gamma(3,3)(dom).
der_r(), passage_even) ;
151 double RV1 = Rxx-2*Ixy-Ryy ;
152 double RV2 = Rxx+2*Ixy-Ryy ;
153 double RV3 = Rxx+Ryy ;
156 double IV1 = Ixx+2*Rxy-Iyy ;
157 double IV2 = Ixx-2*Rxy-Iyy ;
158 double IV3 = Ixx+Iyy ;
161 double RA1, RA2, RA3, RA6, IA1, IA2, IA3, IA6 ;
164 RA1 = RV1 / (*dRsh[(mm+2)*nbrl+ll])(ppp) ;
165 RA2 = RV2 / (*dRsh[abs(mm-2)*nbrl+ll])(ppp) ;
166 RA3 = RV3 / (*dRsh[mm*nbrl+ll])(ppp) ;
167 RA6 = RV6 / (*dRsh[mm*nbrl+ll])(ppp) ;
169 IA1 = IV1 / (*dIsh[(mm+2)*nbrl+ll])(ppp) ;
170 IA2 = IV2 / (*dIsh[abs(mm-2)*nbrl+ll])(ppp) ;
171 IA3 = IV3 / (*dIsh[mm*nbrl+ll])(ppp) ;
172 IA6 = IV6 / (*dIsh[mm*nbrl+ll])(ppp) ;
175 RA1 = RV1 / (*dRsh[(mm+2)*nbrl+ll])(ppp_last) ;
176 RA2 = RV2 / (*dRsh[abs(mm-2)*nbrl+ll])(ppp_last) ;
177 RA3 = RV3 / (*dRsh[mm*nbrl+ll])(ppp_last) ;
178 RA6 = RV6 / (*dRsh[mm*nbrl+ll])(ppp_last) ;
180 IA1 = IV1 / (*dIsh[(mm+2)*nbrl+ll])(ppp_last) ;
181 IA2 = IV2 / (*dIsh[abs(mm-2)*nbrl+ll])(ppp_last) ;
182 IA3 = IV3 / (*dIsh[mm*nbrl+ll])(ppp_last) ;
183 IA6 = IV6 / (*dIsh[mm*nbrl+ll])(ppp_last) ;
187 Val_domain Rfxx (0.25*RA1*(*Rsh[(mm+2)*nbrl+ll]) + 0.25*RA2*(*Rsh[abs(mm-2)*nbrl+ll])
188 + 0.5*RA3*(*Rsh[mm*nbrl+ll])) ;
190 Val_domain Ifxx (0.25*IA1*(*Ish[(mm+2)*nbrl+ll]) + 0.25*IA2*(*Ish[abs(mm-2)*nbrl+ll])
191 + 0.5*IA3*(*Ish[mm*nbrl+ll])) ;
193 Val_domain Rfxy (0.25*IA1*(*Ish[(mm+2)*nbrl+ll]) - 0.25*IA2*(*Ish[abs(mm-2)*nbrl+ll])) ;
195 Val_domain Ifxy (-0.25*RA1*(*Rsh[(mm+2)*nbrl+ll]) + 0.25*RA2*(*Rsh[abs(mm-2)*nbrl+ll])) ;
197 Val_domain Rfyy (-0.25*RA1*(*Rsh[(mm+2)*nbrl+ll]) - 0.25*RA2*(*Rsh[abs(mm-2)*nbrl+ll])
198 + 0.5*RA3*(*Rsh[mm*nbrl+ll])) ;
200 Val_domain Ifyy (-0.25*IA1*(*Ish[(mm+2)*nbrl+ll]) - 0.25*IA2*(*Ish[abs(mm-2)*nbrl+ll])
201 + 0.5*IA3*(*Ish[mm*nbrl+ll])) ;
220 posradial.
set(0) = i ;
223 for (
int inds=0 ; inds<
nbr_coefs(1) ; inds++) {
225 posylm.
set(1) = inds ;
235 if ((k!=kkmax-1) && (k!=0)) {
250 for (
int k=0 ; k<kkmax ; k+=2)
258 int jmin = (mm%2==0) ?
int(mm/2) : int((mm+1)/2) ;
260 for (
int j=jmin ; j<jmax ; j++) {
262 int ll = (mm%2==0) ? 2*j+1 : 2*j ;
264 double Rxz, Ryz, Ixz, Iyz ;
270 Ixz = ((k==kkmax-1) || (k==0)) ? 0 :
multipoles_asym (k+1, j, OUTER_BC, gamma(1,3)(dom-1).
der_r(), passage_odd) ;
271 Iyz = ((k==kkmax-1) || (k==0)) ? 0 :
multipoles_asym (k+1, j, OUTER_BC, gamma(2,3)(dom-1).
der_r(), passage_odd) ;
277 Ixz = ((k==kkmax-1) || (k==0)) ? 0 :
multipoles_asym (k+1, j, OUTER_BC, gamma(1,3)(dom).
der_r(), passage_odd) ;
278 Iyz = ((k==kkmax-1) || (k==0)) ? 0 :
multipoles_asym (k+1, j, OUTER_BC, gamma(2,3)(dom).
der_r(), passage_odd) ;
281 double RV4 = Rxz - Iyz ;
282 double RV5 = Rxz + Iyz ;
283 double IV4 = Ixz + Ryz ;
284 double IV5 = Ixz - Ryz ;
286 double RA4, RA5, IA4, IA5 ;
289 RA4 = RV4 / (*dRsh[(mm+1)*nbrl+ll])(ppp) ;
290 RA5 = RV5 / (*dRsh[abs(mm-1)*nbrl+ll])(ppp) ;
291 IA4 = IV4 / (*dIsh[(mm+1)*nbrl+ll])(ppp) ;
292 IA5 = IV5 / (*dIsh[abs(mm-1)*nbrl+ll])(ppp) ;
295 RA4 = RV4 / (*dRsh[(mm+1)*nbrl+ll])(ppp_last) ;
296 RA5 = RV5 / (*dRsh[abs(mm-1)*nbrl+ll])(ppp_last) ;
297 IA4 = IV4 / (*dIsh[(mm+1)*nbrl+ll])(ppp_last) ;
298 IA5 = IV5 / (*dIsh[abs(mm-1)*nbrl+ll])(ppp_last) ;
302 Val_domain Rfxz (0.5*RA4*(*Rsh[(mm+1)*nbrl+ll]) + 0.5*RA5*(*Rsh[abs(mm-1)*nbrl+ll])) ;
303 Val_domain Ifxz (0.5*IA4*(*Ish[(mm+1)*nbrl+ll]) + 0.5*IA5*(*Ish[abs(mm-1)*nbrl+ll])) ;
305 Val_domain Rfyz (0.5*IA4*(*Ish[(mm+1)*nbrl+ll]) - 0.5*IA5*(*Ish[abs(mm-1)*nbrl+ll])) ;
306 Val_domain Ifyz (-0.5*RA4*(*Rsh[(mm+1)*nbrl+ll]) + 0.5*RA5*(*Rsh[abs(mm-1)*nbrl+ll])) ;
316 posradial.
set(0) = i ;
320 for (
int inds=0 ; inds<
nbr_coefs(1) ; inds++) {
322 posylm.
set(1) = inds ;
329 if ((k!=kkmax-1) && (k!=0)) {
341 for (
int i=0 ; i<nbrm*nbrl ; i++) {
int get_basis(int nd) const
Read only the basis in a given domain.
virtual Val_domain der_r(const Val_domain &) const
Compute the radial derivative of a scalar field.
virtual double multipoles_asym(int, int, int, const Val_domain &, const Array< double > &) const
Extraction of a given multipole, at some boundary, for a anti-symmetric scalar function.
virtual double multipoles_sym(int, int, int, const Val_domain &, const Array< double > &) const
Extraction of a given multipole, at some boundary, for a symmetric scalar function.
Term_eq bc_waves(const Term_eq &gamma, const Term_eq &omega) const
Gives an matching of the spatial metric, based on homogeneous solutions of outgoing waves.
Dim_array nbr_coefs
Number of coefficients.
Val_domain const & get_radius() const
Returns the generalized radius.
Dim_array nbr_points
Number of colocation points.
Class that gives the position inside a multi-dimensional Array.
int & set(int i)
Read/write of the position in a given dimension.
bool inc(int increm, int var=0)
Increments the position of the Index.
Val_domain & set_domain(int)
Read/write of a particular Val_domain.
virtual void std_base()
Sets the standard spectal bases of decomposition for each component.
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.
virtual Array< int > indices(int pos) const
Gives the values of the indices corresponding to a location in the array used for storage of the comp...
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...
double & set_coef(const Index &pos)
Read/write the value of the field in the coefficient space.
void allocate_coef()
Allocates the values in the coefficient space and destroys the values in the configuration space.
void std_base()
Sets the standard basis of decomposition.
void coef() const
Computes the coefficients.
Array< double > get_coef() const