23 char bhole_glob_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Bhole_binaire/bhole_glob.C,v 1.5 2014/10/13 08:52:40 j_novak Exp $" ;
82 #include "utilitaires.h"
83 #include "graphique.h"
115 assert ((orientation_un==0) || (orientation_un==M_PI)) ;
117 assert ((orientation_deux==0) || (orientation_deux==M_PI)) ;
118 int same_orient = (orientation_un == orientation_deux) ? 1 : -1 ;
131 for (
int i=0 ; i<3 ; i++)
154 for (
int i=0 ; i<3 ; i++)
166 return moment_un+same_orient*moment_deux ;
177 assert ((orientation_un==0) || (orientation_un==M_PI)) ;
179 assert ((orientation_deux==0) || (orientation_deux==M_PI)) ;
180 int same_orient = (orientation_un == orientation_deux) ? 1 : -1 ;
184 double* bornes =
new double [nzones+1] ;
186 for (
int i=nzones-1 ; i>0 ; i--) {
187 bornes[i] = courant ;
191 bornes[nzones] = __infinity ;
215 Tenseur shift_tot (shift_un+shift_deux) ;
217 shift_tot.
annule(0, nzones-2) ;
223 Tenseur trace (grad(0, 0)+grad(1, 1)+grad(2, 2)) ;
224 for (
int i=0 ; i<3 ; i++) {
225 k_total.
set(i, i) = grad(i, i)-trace()/3. ;
226 for (
int j=i+1 ; j<3 ; j++)
227 k_total.
set(i, j) = (grad(i, j)+grad(j, i))/2. ;
230 for (
int lig=0 ; lig<3 ; lig++)
231 for (
int col=lig ; col<3 ; col++)
236 for (
int i=0 ; i<3 ; i++)
237 vecteur_un.
set(i) = k_total(0, i) ;
239 Cmp integrant_un (vecteur_un(0)) ;
243 for (
int i=0 ; i<3 ; i++)
244 vecteur_deux.
set(i) = k_total(1, i) ;
246 Cmp integrant_deux (vecteur_deux(0)) ;
269 double pente = 2./(x_un-x_deux) ;
270 double constante = - (x_un+x_deux)/(x_un-x_deux) ;
275 double air_un, theta_un, phi_un ;
276 double air_deux, theta_deux, phi_deux ;
278 double* coloc =
new double[nr] ;
279 double* coef =
new double[nr] ;
280 int* deg =
new int[3] ;
281 deg[0] = 1 ; deg[1] = 1 ; deg[2] = nr ;
283 for (
int i=0 ; i<nr ; i++) {
284 ksi = -
cos (M_PI*i/(nr-1)) ;
285 xabs = (ksi-constante)/pente ;
291 hole2.
psi_auto().val_point (air_deux, theta_deux, phi_deux), 2.) ;
295 cfrcheb(deg, deg, coloc, deg, coef) ;
298 double* som =
new double[nr] ;
300 for (
int i=2 ; i<nr ; i+=2)
301 som[i] = 1./(i+1)-1./(i-1) ;
302 for (
int i=1 ; i<nr ; i+=2)
306 for (
int i=0 ; i<nr ; i++)
307 res += som[i]*coef[i] ;
319 Tbl Bhole_binaire::linear_momentum_systeme_inf()
const {
326 assert ((orientation_un==0) || (orientation_un==M_PI)) ;
328 assert ((orientation_deux==0) || (orientation_deux==M_PI)) ;
329 int same_orient = (orientation_un == orientation_deux) ? 1 : -1 ;
333 double* bornes =
new double [nzones+1] ;
335 for (
int i=nzones-1 ; i>0 ; i--) {
336 bornes[i] = courant ;
340 bornes[nzones] = __infinity ;
347 Tenseur_sym k_total (mapping, 2, CON, mapping.get_bvect_cart()) ;
348 k_total.set_etat_qcq() ;
350 Tenseur shift_un (mapping, 1, CON, mapping.get_bvect_cart()) ;
351 shift_un.set_etat_qcq() ;
353 Tenseur shift_deux (mapping, 1, CON, mapping.get_bvect_cart()) ;
354 shift_deux.set_etat_qcq() ;
364 Tenseur shift_tot (shift_un+shift_deux) ;
365 shift_tot.set_std_base() ;
366 shift_tot.annule(0, nzones-2) ;
369 Tenseur shift_old (shift_tot) ;
370 shift_tot.inc2_dzpuis() ;
371 shift_tot.dec2_dzpuis() ;
372 for (
int i=0 ; i< 3 ; i++)
376 Tenseur grad (shift_tot.gradient()) ;
377 Tenseur trace (grad(0, 0)+grad(1, 1)+grad(2, 2)) ;
378 for (
int i=0 ; i<3 ; i++) {
379 k_total.set(i, i) = grad(i, i)-trace()/3. ;
380 for (
int j=i+1 ; j<3 ; j++)
381 k_total.set(i, j) = (grad(i, j)+grad(j, i))/2. ;
385 for (
int lig=0 ; lig<3 ; lig++)
386 for (
int col=lig ; col<3 ; col++)
387 k_total.set(lig, col).mult_r_zec() ;
389 for (
int comp=0 ; comp<3 ; comp++) {
390 Tenseur vecteur (mapping, 1, CON, mapping.get_bvect_cart()) ;
391 vecteur.set_etat_qcq() ;
392 for (
int i=0 ; i<3 ; i++)
393 vecteur.set(i) = k_total(i, comp) ;
394 vecteur.change_triad (mapping.get_bvect_spher()) ;
395 Cmp integrant (vecteur(0)) ;
397 res.set(comp) = mapping.integrale_surface_infini (integrant)/8/M_PI ;