160void Bhole_binaire::coal (
double precis,
double relax,
int nbre_ome,
double seuil_search,
double m1,
double m2,
const int sortie) {
162 assert (
omega == 0) ;
163 int nz1 =
hole1.mp.get_mg()->get_nzone() ;
164 int nz2 =
hole1.mp.get_mg()->get_nzone() ;
167 double distance =
hole1.mp.get_ori_x()-
hole2.mp.get_ori_x() ;
169 double scale_linear = (
hole1.rayon +
hole2.rayon)/2.*distance ;
172 double angulaire =
sqrt((
hole1.rayon+
hole2.rayon)/distance/distance/distance) ;
177 char name_iteration[40] ;
178 char name_correction[40] ;
179 char name_viriel[40] ;
181 char name_linear[40] ;
183 char name_error_m1[40] ;
184 char name_error_m2[40] ;
188 sprintf(name_iteration,
"ite.dat") ;
189 sprintf(name_correction,
"cor.dat") ;
190 sprintf(name_viriel,
"vir.dat") ;
191 sprintf(name_ome,
"ome.dat") ;
192 sprintf(name_linear,
"linear.dat") ;
193 sprintf(name_axe,
"axe.dat") ;
194 sprintf(name_error_m1,
"error_m1.dat") ;
195 sprintf(name_error_m2,
"error_m2.dat") ;
196 sprintf(name_r1,
"r1.dat") ;
197 sprintf(name_r2,
"r2.dat") ;
199 ofstream fiche_iteration(name_iteration) ;
200 fiche_iteration.precision(8) ;
202 ofstream fiche_correction(name_correction) ;
203 fiche_correction.precision(8) ;
205 ofstream fiche_viriel(name_viriel) ;
206 fiche_viriel.precision(8) ;
208 ofstream fiche_ome(name_ome) ;
209 fiche_ome.precision(8) ;
211 ofstream fiche_linear(name_linear) ;
212 fiche_linear.precision(8) ;
214 ofstream fiche_axe(name_axe) ;
215 fiche_axe.precision(8) ;
217 ofstream fiche_error_m1 (name_error_m1) ;
218 fiche_error_m1.precision(8) ;
220 ofstream fiche_error_m2 (name_error_m2) ;
221 fiche_error_m2.precision(8) ;
223 ofstream fiche_r1 (name_r1) ;
224 fiche_r1.precision(8) ;
226 ofstream fiche_r2 (name_r2) ;
227 fiche_r2.precision(8) ;
230 cout <<
"OMEGA AUGMENTE A LA MAIN." << endl ;
232 for (
int pas = 0 ; pas <nbre_ome ; pas ++) {
234 homme += angulaire/nbre_ome ;
237 Cmp shift_un_old (
hole1.get_shift_auto()(0)) ;
238 Cmp shift_deux_old (
hole2.get_shift_auto()(0)) ;
248 for (
int i=1 ; i<nz1 ; i++)
249 if (diff_un(i) > erreur)
250 erreur = diff_un(i) ;
253 for (
int i=1 ; i<nz2 ; i++)
254 if (diff_deux(i) > erreur)
255 erreur = diff_deux(i) ;
257 double error_viriel =
viriel() ;
258 double error_linear = linear_momentum_systeme_inf()(1)/scale_linear ;
259 double error_m1 = 1.-
sqrt(
hole1.area()/16./M_PI)/m1 ;
260 double error_m2 = 1.-
sqrt(
hole2.area()/16./M_PI)/m2 ;
261 double r1 =
hole1.mp.val_r(0, 1, 0, 0) ;
262 double r2 =
hole2.mp.val_r(0, 1, 0, 0) ;
265 fiche_iteration << conte <<
" " << erreur << endl ;
266 fiche_correction << conte <<
" " <<
hole1.get_regul() <<
" " <<
hole2.get_regul() << endl ;
267 fiche_viriel << conte <<
" " << error_viriel << endl ;
268 fiche_ome << conte <<
" " << homme << endl ;
269 fiche_linear << conte <<
" " << error_linear << endl ;
270 fiche_axe << conte <<
" " << pos_axe << endl ;
271 fiche_error_m1 << conte <<
" " << error_m1 << endl ;
272 fiche_error_m2 << conte <<
" " << error_m2 << endl ;
273 fiche_r1 << conte <<
" " << r1 << endl ;
274 fiche_r2 << conte <<
" " << r2 << endl ;
277 cout <<
"PAS TOTAL : " << conte <<
" DIFFERENCE : " << erreur << endl ;
282 cout <<
"OMEGA VARIABLE" << endl ;
288 Cmp shift_un_old (
hole1.get_shift_auto()(0)) ;
289 Cmp shift_deux_old (
hole2.get_shift_auto()(0)) ;
299 for (
int i=1 ; i<nz1 ; i++)
300 if (diff_un(i) > erreur)
301 erreur = diff_un(i) ;
304 for (
int i=1 ; i<nz2 ; i++)
305 if (diff_deux(i) > erreur)
306 erreur = diff_deux(i) ;
308 double error_viriel =
viriel() ;
309 double error_linear = linear_momentum_systeme_inf()(1)/scale_linear ;
310 double error_m1 = 1.-
sqrt(
hole1.area()/16./M_PI)/m1 ;
311 double error_m2 = 1.-
sqrt(
hole2.area()/16./M_PI)/m2 ;
312 double r1 =
hole1.mp.val_r(0, 1, 0, 0) ;
313 double r2 =
hole2.mp.val_r(0, 1, 0, 0) ;
316 fiche_iteration << conte <<
" " << erreur << endl ;
317 fiche_correction << conte <<
" " <<
hole1.regul <<
" " <<
hole2.regul << endl ;
318 fiche_viriel << conte <<
" " << error_viriel << endl ;
319 fiche_ome << conte <<
" " <<
omega << endl ;
320 fiche_linear << conte <<
" " << error_linear << endl ;
321 fiche_axe << conte <<
" " << pos_axe << endl ;
322 fiche_error_m1 << conte <<
" " << error_m1 << endl ;
323 fiche_error_m2 << conte <<
" " << error_m2 << endl ;
324 fiche_r1 << conte <<
" " << r1 << endl ;
325 fiche_r2 << conte <<
" " << r2 << endl ;
329 if (erreur <= seuil_search)
332 double scaling_ome =
pow((2-error_viriel)/(2-2*error_viriel), 1.) ;
335 double scaling_axe =
pow((2-error_linear)/(2-2*error_linear), 0.1) ;
336 set_pos_axe (pos_axe*scaling_axe) ;
338 double scaling_r1 =
pow((2-error_m1)/(2-2*error_m1), 0.1) ;
339 hole1.mp.homothetie_interne(scaling_r1) ;
341 double scaling_r2 =
pow((2-error_m2)/(2-2*error_m2), 0.1) ;
342 hole2.mp.homothetie_interne(scaling_r2) ;
345 cout <<
"PAS TOTAL : " << conte <<
" DIFFERENCE : " << erreur << endl ;
351 fiche_iteration.close() ;
352 fiche_correction.close() ;
353 fiche_viriel.close() ;
355 fiche_linear.close() ;
357 fiche_error_m1.close() ;
358 fiche_error_m2.close() ;
void coal(double precis, double relax, int nbre_ome, double search_ome, double m1, double m2, const int sortie=0)
Solves the equation for a particular angular velocity, the systeme being initialized to Misner-Lindqu...