58 #include "type_parite.h" 65 double serie_lindquist_plus (
double rayon,
double distance,
double xa,
double ya,
66 double za,
double precision,
double itemax) {
71 double d_n = distance/2. ;
75 while ((indic == 1) && (conte <= itemax)) {
77 double norme_plus =
sqrt ((xa+d_n)*(xa+d_n)+ya*ya+za*za) ;
79 double terme = c_n * 1./norme_plus ;
80 if (fabs(terme/result) < precision)
83 result = result + terme ;
85 c_n *= rayon/(distance/2. + d_n) ;
86 d_n = distance/2. - rayon*rayon/(distance/2.+d_n) ;
95 double serie_lindquist_moins (
double rayon,
double distance,
double xa,
double ya,
96 double za,
double precision,
double itemax) {
101 double d_n = distance/2. ;
105 while ((indic == 1) && (conte <= itemax)) {
107 double norme_plus =
sqrt ((xa-d_n)*(xa-d_n)+ya*ya+za*za) ;
109 double terme = c_n * 1./norme_plus ;
110 if (fabs(terme/result) < precision)
113 result = result + terme ;
115 c_n *= rayon/(distance/2. + d_n) ;
116 d_n = distance/2. - rayon*rayon/(distance/2.+d_n) ;
125 double adm_serie (
double rayon,
double distance,
double precision) {
129 double d_n = distance/2. ;
135 if (fabs(c_n/result) < precision)
138 c_n *= rayon/(distance/2. + d_n) ;
139 d_n = distance/2. - rayon*rayon/(distance/2.+d_n) ;
144 double bare_serie (
double rayon,
double distance,
double precision) {
148 double d_n = distance/2. ;
155 if (fabs(c_n/result) < precision)
158 c_n *= rayon/(distance/2. + d_n) ;
159 d_n = distance/2. - rayon*rayon/(distance/2.+d_n) ;
165 void set_lindquist (Cmp& psi_un, Cmp& psi_deux,
double rayon,
double precision) {
171 double distance = psi_un.get_mp()->get_ori_x()-psi_deux.get_mp()->get_ori_x() ;
174 Mtbl xa_mtbl_un (psi_un.get_mp()->xa) ;
175 Mtbl ya_mtbl_un (psi_un.get_mp()->ya) ;
176 Mtbl za_mtbl_un (psi_un.get_mp()->za) ;
178 int nz_un = psi_un.get_mp()->get_mg()->get_nzone() ;
179 for (
int l=1 ; l<nz_un ; l++) {
180 int np = psi_un.get_mp()->get_mg()->get_np (l) ;
181 int nt = psi_un.get_mp()->get_mg()->get_nt (l) ;
182 int nr = psi_un.get_mp()->get_mg()->get_nr (l) ;
184 for (
int k=0 ; k<np ; k++)
185 for (
int j=0 ; j<nt ; j++)
186 for (
int i=0 ; i<nr ; i++) {
187 xa = xa_mtbl_un (l, k, j, i) ;
188 ya = ya_mtbl_un (l, k, j, i) ;
189 za = za_mtbl_un (l, k, j, i) ;
191 psi_un.set(l, k, j, i) =
192 serie_lindquist_moins (rayon, distance, xa, ya, za, precision, 30) ;
196 psi_un.set_val_inf (0.5) ;
197 psi_un.std_base_scal() ;
200 Mtbl xa_mtbl_deux (psi_deux.get_mp()->xa) ;
201 Mtbl ya_mtbl_deux (psi_deux.get_mp()->ya) ;
202 Mtbl za_mtbl_deux (psi_deux.get_mp()->za) ;
204 int nz_deux = psi_deux.get_mp()->get_mg()->get_nzone() ;
205 for (
int l=1 ; l<nz_deux ; l++) {
206 int np = psi_deux.get_mp()->get_mg()->get_np (l) ;
207 int nt = psi_deux.get_mp()->get_mg()->get_nt (l) ;
208 int nr = psi_deux.get_mp()->get_mg()->get_nr (l) ;
210 for (
int k=0 ; k<np ; k++)
211 for (
int j=0 ; j<nt ; j++)
212 for (
int i=0 ; i<nr ; i++) {
213 xa = xa_mtbl_deux (l, k, j, i) ;
214 ya = ya_mtbl_deux (l, k, j, i) ;
215 za = za_mtbl_deux (l, k, j, i) ;
217 psi_deux.set(l, k, j, i) =
218 serie_lindquist_plus (rayon, distance, xa, ya, za, precision, 30) ;
221 psi_deux.set_val_inf (0.5) ;
222 psi_deux.std_base_scal() ;
Cmp sqrt(const Cmp &)
Square root.