Debian Codegraph @

Codes/Binary_star/lit_bin.C

raw
1 /*
2 * Reads a file containing a binary configuration (class Binary) and
3 * performs various plots.
4 *
5 */
6
7 /*
8 * Copyright (c) 1999-2003 Eric Gourgoulhon
9 *
10 * This file is part of LORENE.
11 *
12 * LORENE is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * LORENE is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with LORENE; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
26 */
27
28 char lit_bin_C[] = "$Header: /cvsroot/Lorene/Codes/Binary_star/lit_bin.C,v 1.5 2014/10/13 08:53:55 j_novak Exp $" ;
29
30 /*
31 * $Id: lit_bin.C,v 1.5 2014/10/13 08:53:55 j_novak Exp $
32 * $Log: lit_bin.C,v $
33 * Revision 1.5 2014/10/13 08:53:55 j_novak
34 * Lorene classes and functions now belong to the namespace Lorene.
35 *
36 * Revision 1.4 2014/10/06 15:09:41 j_novak
37 * Modified #include directives to use c++ syntax.
38 *
39 * Revision 1.3 2005/09/14 17:13:28 f_limousin
40 * Plot of fields along X, Y and Z_axis
41 *
42 * Revision 1.2 2005/09/13 19:47:28 f_limousin
43 * Reintroduction of the resolution of the equations in cartesian coordinates.
44 *
45 * Revision 1.1 2004/09/16 12:14:47 f_limousin
46 * *** empty log message ***
47 *
48 *
49 * $Header: /cvsroot/Lorene/Codes/Binary_star/lit_bin.C,v 1.5 2014/10/13 08:53:55 j_novak Exp $
50 *
51 */
52 // headers C
53 #include <cstdlib>
54 #include <cmath>
55 #include <cstring>
56
57 // headers Lorene
58 #include "unites.h"
59 #include "binary.h"
60 #include "eos.h"
61 #include "utilitaires.h"
62 #include "graphique.h"
63 #include "cmp.h"
64 #include "tenseur.h"
65 #include "nbr_spx.h"
66
67 namespace Lorene {
68 // Local prototype
69 Cmp raccord_c1(const Cmp& uu, int l1) ;
70 }
71 //******************************************************************************
72
73 using namespace Lorene ;
74
75 int main(int argc, char** argv){
76
77 // Identification of all the subroutines called by the code :
78
79 // system("ident lit_bin") ;
80
81 if (argc < 2) {
82 cout <<
83 "lit_bin : the name of a file containing a binary configuration"
84 << endl << " must be given in argument !" << endl ;
85 abort() ;
86 }
87
88 char* nomresu = argv[1] ;
89
90 //char* nomresu = "resu.d" ;
91 cout << "Name of the file to be read : " << nomresu << endl ;
92
93 cout << endl <<
94 "Do you want to draw the boundaries of the various domains (y/n) ? [y]"
95 << endl ;
96 char rep ;
97 cin.get(rep) ;
98
99 bool draw_bound = !(rep == 'n') ;
100
101 using namespace Unites ;
102
103 FILE* fich = fopen(nomresu, "r") ;
104 if (fich == 0x0) {
105 cout << "Problem in opening the file " << nomresu << " ! " << endl ;
106 perror(" reason") ;
107 abort() ;
108 }
109
110 int mer ;
111 fread(&mer, sizeof(int), 1, fich) ; // mer
112
113 Mg3d mg1(fich) ;
114 Map_et mp1(mg1, fich) ;
115 Eos* peos1 = Eos::eos_from_file(fich) ;
116
117 Mg3d mg2(fich) ;
118 Map_et mp2(mg2, fich) ;
119 Eos* peos2 = Eos::eos_from_file(fich) ;
120
121 Binary star(mp1, *peos1, mp2, *peos2, fich) ;
122
123 fclose(fich) ;
124
125 bool irrotational = star(1).is_irrotational() ;
126
127 cout << endl << "Grid on which star 1 is defined : " << endl ;
128 cout << "=============================== " << endl ;
129 cout << *((star(1).get_mp()).get_mg()) << endl ;
130
131 cout << endl << "Grid on which star 2 is defined : " << endl ;
132 cout << "=============================== " << endl ;
133 cout << *((star(2).get_mp()).get_mg()) << endl ;
134
135 cout << endl << "Mapping on which star 1 is defined : " << endl ;
136 cout << "================================== " << endl ;
137 cout << star(1).get_mp() << endl ;
138
139 cout << endl << "Mapping on which star 2 is defined : " << endl ;
140 cout << "================================== " << endl ;
141 cout << star(2).get_mp() << endl ;
142
143 star.fait_decouple() ;
144
145 for (int i=1; i<=2; i++) {
146 (star.set(i)).update_metric(star(3-i), star.get_omega()) ;
147 }
148
149 for (int i=1; i<=2; i++) {
150 (star.set(i)).update_metric_der_comp(star(3-i), star.get_omega()) ;
151 }
152
153 for (int i=1; i<=2; i++) {
154 (star.set(i)).equation_of_state() ;
155 (star.set(i)).kinematics(star.get_omega(), star.get_x_axe()) ;
156 (star.set(i)).fait_d_psi() ;
157 (star.set(i)).hydro_euler() ;
158 }
159
160
161 // Writing of resformat.d
162 ofstream seqfich("resformat.d") ;
163 if ( !seqfich.good() ) {
164 cout << "coal : problem with opening the file resformat.d !" << endl ;
165 abort() ;
166 }
167 star.write_global(seqfich) ;
168 seqfich.close() ;
169
170 // Some printings
171 cout.precision(6) ;
172 cout << "mass_bar = " << star(1).mass_b()/msol << endl ;
173 cout << "mass_vol = " << star.mass_adm_vol()/msol << endl ;
174 cout << "mass_adm = " << star.mass_adm()/msol << endl ;
175 cout << "d = " << star.separation() << endl ;
176 cout << "ray_eq = " << star(1).ray_eq() << endl ;
177 cout << "ray_eq_pi = " << star(1).ray_eq_pi() << endl ;
178 cout << "R = " << (star(1).ray_eq() + star(1).ray_eq_pi())/2. << endl ;
179 cout << "d_milieu = " << star.separation()/2. + (star(1).ray_eq_pi()
180 - star(1).ray_eq())/2.
181 << endl ;
182 cout << "d/R = " << (star.separation() + (star(1).ray_eq_pi()
183 - star(1).ray_eq()))/(star(1).ray_eq() + star(1).ray_eq_pi())
184 << endl ;
185 // abort() ;
186
187
188 cout << "Binary system read in file : " << endl ;
189 cout << star << endl ;
190 star.display_poly(cout) ; // Reduced quantities for polytropic EOS
191
192 cout << "ADM mass [M_sol] : " << star.mass_adm() / msol << endl ;
193
194 //////////////////////////////////////////////////////////
195 // Plot of different fields along X, Y and Z axis //
196 //////////////////////////////////////////////////////////
197
198 Vector beta (star(1).get_beta()) ;
199 beta.change_triad(star(1).get_mp().get_bvect_cart()) ;
200 Scalar beta_y_aux (beta(2)) ;
201
202 Scalar logn_aux (star(1).get_logn()) ;
203 Scalar psi_aux (pow(star(1).get_psi4(), 0.25)) ;
204 psi_aux.std_spectral_base() ;
205
206 Sym_tensor gtilde (star(1).get_gtilde().cov()) ;
207 Sym_tensor flat (star(1).get_flat().cov()) ;
208 Sym_tensor hij_aux (gtilde-flat) ;
209 hij_aux.change_triad(star(1).get_mp().get_bvect_cart()) ;
210
211 Sym_tensor hij1(hij_aux) ;
212 Sym_tensor gtilde2 (star(2).get_gtilde().cov()) ;
213 Sym_tensor flat2 (star(2).get_flat().cov()) ;
214 Sym_tensor hij2 (gtilde2-flat2) ;
215 hij2.change_triad(star(2).get_mp().get_bvect_cart()) ;
216
217
218 Cmp hxx (hij_aux(1,1)) ;
219 Cmp hxy (hij_aux(2,1)) ;
220 Cmp hxz (hij_aux(3,1)) ;
221 Cmp hyy (hij_aux(2,2)) ;
222 Cmp hyz (hij_aux(3,2)) ;
223 Cmp hzz (hij_aux(3,3)) ;
224
225 Cmp hxx1 (hij1(1,1)) ;
226 Cmp hxy1 (hij1(2,1)) ;
227 Cmp hxz1 (hij1(3,1)) ;
228 Cmp hyy1 (hij1(2,2)) ;
229 Cmp hyz1 (hij1(3,2)) ;
230 Cmp hzz1 (hij1(3,3)) ;
231 Cmp hxx2 (hij2(1,1)) ;
232 Cmp hxy2 (hij2(2,1)) ;
233 Cmp hxz2 (hij2(3,1)) ;
234 Cmp hyy2 (hij2(2,2)) ;
235 Cmp hyz2 (hij2(3,2)) ;
236 Cmp hzz2 (hij2(3,3)) ;
237
238 ofstream fich_xaxis("metric_xaxis.d") ;
239 fich_xaxis.precision(6) ;
240 ofstream fich_yaxis("metric_yaxis.d") ;
241 fich_yaxis.precision(6) ;
242 ofstream fich_zaxis("metric_zaxis.d") ;
243 fich_zaxis.precision(6) ;
244 ofstream fich_xaxis_all("metric_xaxis_all.d") ;
245 fich_xaxis_all.precision(6) ;
246 ofstream fich_yaxis_all("metric_yaxis_all.d") ;
247 fich_yaxis_all.precision(6) ;
248 ofstream fich_zaxis_all("metric_zaxis_all.d") ;
249 fich_zaxis_all.precision(6) ;
250
251
252 // Construction of an auxiliar grid and mapping
253 int nz = star(1).get_mp().get_mg()->get_nzone() ;
254 assert (nz >= 4);
255 double* bornes = new double [nz+1] ;
256 double r_in = 0.95 * (-star(1).get_mp().get_ori_x()-star(1).ray_eq()) ;
257 double r_ext = 1.05 * (-star(1).get_mp().get_ori_x()+star(1).ray_eq_pi()) ;
258
259 bornes[0] = 0 ;
260 bornes[1] = r_in ;
261 bornes[2] = r_ext ;
262 for (int l=3; l<nz; l++)
263 bornes[l] = r_ext * pow(2., l-2) ;
264 bornes[nz] = __infinity ;
265
266 Map_af mapping (*(star(1).get_mp().get_mg()), bornes) ;
267 delete [] bornes ;
268
269 // Importation of fields
270 // ----------------------
271
272 assert (star(1).get_mp().get_rot_phi() == 0) ;
273
274 Scalar logn (mapping) ;
275 logn.import(logn_aux) ;
276 logn.std_spectral_base() ;
277
278 Scalar psi (mapping) ;
279 psi.import(psi_aux) ;
280 psi.std_spectral_base() ;
281
282 Scalar beta_y (mapping) ;
283 beta_y.import(beta_y_aux) ;
284 beta_y.std_spectral_base() ;
285
286 Sym_tensor hij(mapping, COV, mapping.get_bvect_cart()) ;
287 hij_aux.change_triad(star(1).get_mp().get_bvect_cart()) ;
288
289 hij.set(1,1).import(hij_aux(1,1)) ;
290 hij.set(2,1).import(hij_aux(2,1)) ;
291 hij.set(3,1).import(hij_aux(3,1)) ;
292 hij.set(2,2).import(hij_aux(2,2)) ;
293 hij.set(3,2).import(hij_aux(3,2)) ;
294 hij.set(3,3).import(hij_aux(3,3)) ;
295 hij.std_spectral_base() ;
296
297 // h_{ij} along X_axis
298 // ---------------------
299
300 double fact = star.get_omega() * f_unit / M_PI / c_si * 10000 ;
301 double n1 = 5000. ;
302
303 double ii ;
304 fich_xaxis << "# x/lambda hxx hyy hzz " << endl ;
305 for (int i=1; i<n1; i++){
306 ii = 7.*i/n1 ;
307 fich_xaxis << pow(10, ii - 2)* r_ext * fact << " "
308 << hij(1,1).val_point(pow(10, ii - 2)* r_ext, M_PI/2, M_PI)
309 << " "
310 << hij(2,2).val_point(pow(10, ii - 2)* r_ext, M_PI/2, M_PI)
311 << " "
312 << hij(3,3).val_point(pow(10, ii - 2)* r_ext, M_PI/2, M_PI)
313 << " " << 0 << endl ;
314 }
315
316 // h_{ij} along Y_axis
317 // ---------------------
318
319 n1 = 5000. ;
320
321 fich_yaxis << "# x/lambda hxx hyy hzz " << endl ;
322 for (int i=1; i<n1; i++){
323 ii = 7.*i/n1 ;
324 fich_yaxis << pow(10, ii - 2)* r_ext * fact << " "
325 << hij(1,1).val_point(pow(10, ii - 2)* r_ext, M_PI/2, M_PI/2)
326 << " "
327 << hij(2,2).val_point(pow(10, ii - 2)* r_ext, M_PI/2, M_PI/2)
328 << " "
329 << hij(3,3).val_point(pow(10, ii - 2)* r_ext, M_PI/2, M_PI/2)
330 << " " << 0 << endl ;
331 }
332
333 // h_{ij} along Z_axis
334 // ---------------------
335
336 n1 = 5000. ;
337
338 fich_zaxis << "# x/lambda hxx hyy hzz " << endl ;
339 for (int i=1; i<n1; i++){
340 ii = 7.*i/n1 ;
341 fich_zaxis << pow(10, ii - 2)* r_ext * fact << " "
342 << hij(1,1).val_point(pow(10, ii - 2)* r_ext, 0., 0.)
343 << " "
344 << hij(2,2).val_point(pow(10, ii - 2)* r_ext, 0., 0.)
345 << " "
346 << hij(3,3).val_point(pow(10, ii - 2)* r_ext, 0., 0.)
347 << " " << 0 << endl ;
348 }
349
350
351 // All fields along X_axis
352 // ---------------------
353
354 n1 = 5000. ;
355
356 fich_xaxis_all << "# x/lambda psi-1 beta_y hxx hyy hzz "
357 << endl ;
358 for (int i=1; i<n1; i++){
359 ii = 7.*i/n1 ;
360 fich_xaxis_all << pow(10, ii - 2)* r_ext * fact << " "
361 << psi.val_point(pow(10, ii - 2)* r_ext, M_PI/2, M_PI) - 1
362 << " "
363 << beta_y.val_point(pow(10, ii - 2)* r_ext, M_PI/2, M_PI)
364 << " "
365 << hij(1,1).val_point(pow(10, ii - 2)* r_ext, M_PI/2, M_PI)
366 << " "
367 << hij(2,2).val_point(pow(10, ii - 2)* r_ext, M_PI/2, M_PI)
368 << " "
369 << hij(3,3).val_point(pow(10, ii - 2)* r_ext, M_PI/2, M_PI)
370 << " " << 0 << endl ;
371 }
372
373 // All fields along Y_axis
374 // ---------------------
375
376 n1 = 5000. ;
377
378 fich_yaxis_all << "# x/lambda psi-1 beta_y hxx hyy hzz "
379 << endl ;
380 for (int i=1; i<n1; i++){
381 ii = 7.*i/n1 ;
382 fich_yaxis_all << pow(10, ii - 2)* r_ext * fact << " "
383 << psi.val_point(pow(10, ii - 2)* r_ext, M_PI/2, M_PI/2) - 1
384 << " "
385 << beta_y.val_point(pow(10, ii - 2)* r_ext, M_PI/2, M_PI/2)
386 << " "
387 << hij(1,1).val_point(pow(10, ii - 2)* r_ext, M_PI/2, M_PI/2)
388 << " "
389 << hij(2,2).val_point(pow(10, ii - 2)* r_ext, M_PI/2, M_PI/2)
390 << " "
391 << hij(3,3).val_point(pow(10, ii - 2)* r_ext, M_PI/2, M_PI/2)
392 << " " << 0 << endl ;
393 }
394
395 // All fields along Z_axis
396 // ---------------------
397
398 n1 = 5000. ;
399
400 fich_zaxis_all << "# x/lambda psi-1 beta_y hxx hyy hzz "
401 << endl ;
402 for (int i=1; i<n1; i++){
403 ii = 7.*i/n1 ;
404 fich_zaxis_all << pow(10, ii - 2)* r_ext * fact << " "
405 << psi.val_point(pow(10, ii - 2)* r_ext, 0., 0.) - 1
406 << " "
407 << beta_y.val_point(pow(10, ii - 2)* r_ext, 0., 0.)
408 << " "
409 << hij(1,1).val_point(pow(10, ii - 2)* r_ext, 0., 0.)
410 << " "
411 << hij(2,2).val_point(pow(10, ii - 2)* r_ext, 0., 0.)
412 << " "
413 << hij(3,3).val_point(pow(10, ii - 2)* r_ext, 0., 0.)
414 << " " << 0 << endl ;
415 }
416
417
418
419 fich_xaxis.close() ;
420 fich_yaxis.close() ;
421 fich_zaxis.close() ;
422 fich_xaxis_all.close() ;
423 fich_yaxis_all.close() ;
424 fich_zaxis_all.close() ;
425
426 arrete() ;
427
428 //==============================================================
429 // Drawings
430 //==============================================================
431
432 int nzdes1 = star(1).get_nzet() ;
433
434 double ori_x1 = star(1).get_mp().get_ori_x() ;
435 double ori_x2 = star(2).get_mp().get_ori_x() ;
436
437 double xdes_min = - 1.5 * star(1).ray_eq_pi() + ori_x1 ;
438 xdes_min += 0.2 * xdes_min ;
439 double xdes_max = 1.5 * star(2).ray_eq_pi() + ori_x2 ;
440 xdes_max += 0.2 * fabs(xdes_min) ;
441
442 double ydes_min1 = - 4. * star(1).ray_eq_pis2() ;
443 double ydes_min2 = - 4. * star(2).ray_eq_pis2() ;
444 double ydes_min = (ydes_min1 < ydes_min2) ? ydes_min1 : ydes_min2 ;
445
446 double ydes_max1 = 4. * star(1).ray_eq_pis2() ;
447 double ydes_max2 = 4. * star(2).ray_eq_pis2() ;
448 double ydes_max = (ydes_max1 > ydes_max2) ? ydes_max1 : ydes_max2 ;
449
450 double zdes_min1 = - 4. * star(1).ray_pole() ;
451 double zdes_min2 = - 4. * star(2).ray_pole() ;
452 double zdes_min = (zdes_min1 < zdes_min2) ? zdes_min1 : zdes_min2 ;
453
454 double zdes_max1 = 4. * star(1).ray_pole() ;
455 double zdes_max2 = 4. * star(2).ray_pole() ;
456 double zdes_max = (zdes_max1 > zdes_max2) ? zdes_max1 : zdes_max2 ;
457
458 Cmp surf1 (star(1).get_ent()) ;
459 Cmp surf1_ext(mp1) ;
460 surf1_ext = - 0.2 * surf1(0, 0, 0, 0) ;
461 surf1_ext.annule(0, star(1).get_nzet()-1) ;
462 surf1.annule(star(1).get_nzet(), mg1.get_nzone()-1) ;
463 surf1 = surf1 + surf1_ext ;
464 surf1 = raccord_c1(surf1, star(1).get_nzet()) ;
465
466 Cmp surf2 (star(2).get_ent()) ;
467 Cmp surf2_ext(mp2) ;
468 surf2_ext = - 0.2 * surf2(0, 0, 0, 0) ;
469 surf2_ext.annule(0, star(2).get_nzet()-1) ;
470 surf2.annule(star(2).get_nzet(), mg2.get_nzone()-1) ;
471 surf2 = surf2 + surf2_ext ;
472
473 surf2 = raccord_c1(surf2, star(2).get_nzet()) ;
474
475 char title[80] ;
476 char bslash[2] = {92, '\0'} ; // 92 is the ASCII code for backslash
477
478 ofstream fent("enthalpy.d") ;
479 if ( !fent.good() ) {
480 cout << "lit_bin : problem with opening the file enthalpy.d !" << endl ;
481 abort() ;
482 }
483
484 fent << "Enthalpy field at the boundary of last inner domain of star 1 : "
485 << endl ;
486 int lzet = star(1).get_nzet() - 1 ;
487 for (int k=0; k<mg1.get_np(lzet); k++) {
488 fent << "k = " << k << " : " ;
489 for (int j=0; j<mg1.get_nt(lzet); j++) {
490 fent << " " << star(1).get_ent().val_grid_point(lzet, k, j, mg1.get_nr(lzet)-1) ;
491 }
492 fent << endl ;
493 }
494
495
496 fent << endl << "enthalpy field of star 1 : " << endl ;
497 fent << star(1).get_ent() << endl ;
498 fent.close() ;
499
500 Cmp ent1 (star(1).get_ent()) ;
501 /*
502 des_coupe_z(ent1, 0., 1,
503 "Enthalpy (z=0)", &surf1, 1.2, draw_bound ) ;
504
505 des_coupe_y(ent1, 0., 1,
506 "Enthalpy (y=0)", &surf1, 1.2, draw_bound ) ;
507
508
509 des_profile (ent1, 0., 2* star(1).ray_eq(), 0., 0.,
510 "H", "H (theta=0)" ) ;
511
512 des_profile (ent1, 0., 2* star(1).ray_eq(), M_PI/2., M_PI/2.,
513 "H", "H (theta=pi/2, phi=pi/2)" ) ;
514
515 */
516
517 //==========================================
518 // Metric quantities
519 //==========================================
520
521 //----------------------------
522 // ln(N)
523 //----------------------------
524
525 Cmp logn1 (- star(1).get_logn_auto()) ;
526 Cmp logn2 (- star(2).get_logn_auto()) ;
527
528
529 cout << "logn xz plane" << endl ;
530
531 des_coupe_bin_y(logn1, logn2, 0,
532 xdes_min, xdes_max, zdes_min, zdes_max,
533 "ln(N) (y=0)", &surf1, &surf2, draw_bound ) ;
534
535 cout << "logn xy plane" << endl ;
536
537 des_coupe_bin_z(logn1, logn2, 0,
538 xdes_min, xdes_max, ydes_min, ydes_max,
539 "ln(N) (z=0)", &surf1, &surf2, draw_bound ) ;
540 /*
541 double xdes_min_large = 2 * xdes_min ;
542 double xdes_max_large = 2 * xdes_max ;
543 double ydes_min_large = 2 * ydes_min ;
544 double ydes_max_large = 2 * ydes_max ;
545
546 des_coupe_bin_z(logn1, logn2, 0,
547 xdes_min_large, xdes_max_large, ydes_min_large, ydes_max_large,
548 "ln(N) (z=0)", &surf1, &surf2, draw_bound ) ;
549
550 des_coupe_bin_x(logn1, logn2,
551 ori_x1, ydes_min, ydes_max, zdes_min, zdes_max,
552 "ln(N) (x=x1)", &surf1, 0x0, draw_bound ) ;
553 */
554 //--------------
555 // Shift vector
556 //--------------
557
558 double dmax ;
559 dmax = 8. * star(1).ray_eq() ;
560
561 Vector beta1 (star(1).get_beta_auto()) ;
562 Vector beta2 (star(2).get_beta_auto()) ;
563
564 beta1.change_triad(star(1).get_mp().get_bvect_cart()) ;
565 beta2.change_triad(star(2).get_mp().get_bvect_cart()) ;
566 beta2.change_triad(star(1).get_mp().get_bvect_cart()) ;
567
568 Tenseur tmp_beta1 (star(1).get_mp(), 1, CON, star(1).get_mp().get_bvect_cart()) ;
569 tmp_beta1.set_etat_qcq() ;
570 Cmp tmp_beta11 (beta1(1)) ;
571 Cmp tmp_beta12 (beta1(2)) ;
572 Cmp tmp_beta13 (beta1(3)) ;
573 tmp_beta1.set(0) = tmp_beta11 ;
574 tmp_beta1.set(1) = tmp_beta12 ;
575 tmp_beta1.set(2) = tmp_beta13 ;
576
577 Tenseur tmp_beta2 (star(2).get_mp(), 1, CON, star(1).get_mp().get_bvect_cart()) ;
578 tmp_beta2.set_etat_qcq() ;
579 Cmp tmp_beta21 (beta2(1)) ;
580 Cmp tmp_beta22 (beta2(2)) ;
581 Cmp tmp_beta23 (beta2(3)) ;
582 tmp_beta2.set(0) = tmp_beta21 ;
583 tmp_beta2.set(1) = tmp_beta22 ;
584 tmp_beta2.set(2) = tmp_beta23 ;
585
586 cout << "shift_x xy plane" << endl ;
587 des_coupe_bin_z(tmp_beta11, tmp_beta21, 0., -dmax, dmax, -dmax, dmax,
588 "shift_x (z=0)" , &surf1, &surf2, draw_bound) ;
589 cout << "shift_y xy plane" << endl ;
590 des_coupe_bin_z(tmp_beta12, tmp_beta22, 0., -dmax, dmax, -dmax, dmax,
591 "shift_y (z=0)" , &surf1, &surf2, draw_bound) ;
592 cout << "shift_y xz plane" << endl ;
593 des_coupe_bin_y(tmp_beta12, tmp_beta22, 0., -dmax, dmax, -dmax, dmax,
594 "shift_y (y=0)" , &surf1, &surf2, draw_bound) ;
595
596
597 cout << "shift xy plane" << endl ;
598
599 des_vect_bin_z(tmp_beta1, tmp_beta2, 0.,
600 -2., 0.5, xdes_min, xdes_max, ydes_min, ydes_max,
601 "Shift vector (z=0)",
602 &surf1, &surf2, draw_bound ) ;
603
604
605 //---------------------------
606 // Conformal factor psi4
607 //---------------------------
608 /*
609 Cmp lnq1 (star(1).get_lnq_auto()) ;
610 Cmp lnq2 (star(2).get_lnq_auto()) ;
611
612 Cmp log_psi1 = 0.5*(lnq1 - logn1) ;
613 Cmp log_psi2 = 0.5*(lnq2 - logn2) ;
614
615 cout << "log_psi xz plane" << endl ;
616 des_coupe_bin_y(log_psi1, log_psi2, 0,
617 xdes_min, xdes_max, zdes_min, zdes_max,
618 "log_psi (y=0)", &surf1, &surf2, draw_bound ) ;
619
620 cout << "log_psi xy plane" << endl ;
621 des_coupe_bin_z(log_psi1, log_psi2, 0,
622 xdes_min, xdes_max, zdes_min, zdes_max,
623 "log_psi (z=0)", &surf1, &surf2, draw_bound ) ;
624 */
625
626
627 //---------------------------
628 // Metric coefficients hij
629 //---------------------------
630
631 cout << "hxx-hyy xy plane" << endl ;
632 des_coupe_bin_z(hxx1- hyy1, hxx2-hyy2, 0., -dmax, dmax, -dmax, dmax,
633 "hxx-hyy (z=0)" , &surf1, &surf2, draw_bound, 20) ;
634 cout << "hxx-hyy xz plane" << endl ;
635 des_coupe_bin_y(hxx1- hyy1, hxx2-hyy2, 0., -dmax, dmax, -dmax, dmax,
636 "hxx-hyy (y=0)" , &surf1, &surf2, draw_bound, 20) ;
637 cout << "hxx-hzz xy plane" << endl ;
638 des_coupe_bin_z(hxx1- hzz1, hxx2-hzz2, 0., -dmax, dmax, -dmax, dmax,
639 "hxx-hzz (z=0)" , &surf1, &surf2, draw_bound, 20) ;
640 cout << "hxx-hzz xz plane" << endl ;
641 des_coupe_bin_y(hxx1- hzz1, hxx2-hzz2, 0., -dmax, dmax, -dmax, dmax,
642 "hxx-hzz (y=0)" , &surf1, &surf2, draw_bound, 20) ;
643
644
645 cout << "hxx xy plane" << endl ;
646 des_coupe_bin_z(hxx1, hxx2, 0., -dmax, dmax, -dmax, dmax,
647 "hxx (z=0)" , &surf1, &surf2, draw_bound, 20) ;
648 cout << "hxy xy plane" << endl ;
649 des_coupe_bin_z(hxy1, hxy2, 0., -dmax, dmax, -dmax, dmax,
650 "hxy (z=0)", &surf1, &surf2, draw_bound, 20) ;
651 cout << "hyy xy plane" << endl ;
652 des_coupe_bin_z(hyy1, hyy2, 0., -dmax, dmax, -dmax, dmax,
653 "hyy (z=0)", &surf1, &surf2, draw_bound, 20) ;
654 cout << "hzz xy plane" << endl ;
655 des_coupe_bin_z(hzz1, hzz2, 0., -dmax, dmax, -dmax, dmax,
656 "hzz (z=0)", &surf1, &surf2, draw_bound, 20) ;
657
658 cout << "hxx xz plane" << endl ;
659 des_coupe_bin_y(hxx1, hxx2, 0., -dmax, dmax, -dmax, dmax,
660 "hxx (y=0)", &surf1, &surf2, draw_bound, 20) ;
661 cout << "hxz xz plane" << endl ;
662 des_coupe_bin_y(hxz1, hxz2, 0., -dmax, dmax, -dmax, dmax,
663 "hxz (y=0)", &surf1, &surf2, draw_bound, 20) ;
664 cout << "hyy xz plane" << endl ;
665 des_coupe_bin_y(hyy1, hyy2, 0., -dmax, dmax, -dmax, dmax,
666 "hyy (y=0)", &surf1, &surf2, draw_bound, 20) ;
667 cout << "hzz xz plane" << endl ;
668 des_coupe_bin_y(hzz1, hzz2, 0., -dmax, dmax, -dmax, dmax,
669 "hzz (y=0)", &surf1, &surf2, draw_bound, 20) ;
670
671
672 //----------------------------
673 // Extrinsic curvature tensor
674 //----------------------------
675
676 Tensor tkij1 (star(1).get_tkij_auto()) ;
677 Tensor tkij2 (star(2).get_tkij_auto()) ;
678 tkij1.change_triad(mp1.get_bvect_cart()) ;
679 tkij2.change_triad(mp2.get_bvect_cart()) ;
680 tkij2.change_triad(mp1.get_bvect_cart()) ;
681
682 // Division by r^2 in the external compactified domain in order to get
683 // A^2 K^{ij} :
684 tkij1.dec_dzpuis(2) ;
685 tkij2.dec_dzpuis(2) ;
686
687 char debtit[] = {'K', 92, 'u', '\0'} ;
688
689 strcpy(title, debtit) ;
690 strcat(title, "xx") ;
691 strcat(title, bslash) ;
692 strcat(title, "d (z=0)") ;
693
694 Cmp tmp11 (tkij1(1, 1)) ;
695 Cmp tmp21 (tkij2(1, 1)) ;
696
697 cout << "K^xx (z=0)" << endl ;
698
699 des_coupe_bin_z(tmp11, tmp21, 0,
700 xdes_min, xdes_max, ydes_min, ydes_max,
701 title, &surf1, &surf2, draw_bound ) ;
702
703 strcpy(title, debtit) ;
704 strcat(title, "xy") ;
705 strcat(title, bslash) ;
706 strcat(title, "d (z=0)") ;
707
708 Cmp tmp12 (tkij1(1, 2)) ;
709 Cmp tmp22 (tkij2(1, 2)) ;
710
711 cout << "K^xy (z=0)" << endl ;
712
713 des_coupe_bin_z(tmp12, tmp22, 0,
714 xdes_min, xdes_max, ydes_min, ydes_max,
715 title, &surf1, &surf2, draw_bound ) ;
716
717 strcpy(title, debtit) ;
718 strcat(title, "xz") ;
719 strcat(title, bslash) ;
720 strcat(title, "d (y=0)") ;
721
722 Cmp tmp13 (tkij1(1, 3)) ;
723 Cmp tmp23 (tkij2(1, 3)) ;
724
725 des_coupe_bin_x(tmp13, tmp23, 0,
726 xdes_min, xdes_max, ydes_min, ydes_max,
727 title, &surf1, &surf2, draw_bound ) ;
728
729 strcpy(title, debtit) ;
730 strcat(title, "yy") ;
731 strcat(title, bslash) ;
732 strcat(title, "d (z=0)") ;
733
734
735 cout << "K^yy (z=0)" << endl ;
736
737 Cmp tmp14 (tkij1(2, 2)) ;
738 Cmp tmp24 (tkij2(2, 2)) ;
739
740 des_coupe_bin_z(tmp14, tmp24, 0,
741 xdes_min, xdes_max, ydes_min, ydes_max,
742 title, &surf1, &surf2, draw_bound ) ;
743
744 strcpy(title, debtit) ;
745 strcat(title, "yz") ;
746 strcat(title, bslash) ;
747 strcat(title, "d (y=0)") ;
748
749 Cmp tmp15 (tkij1(2, 3)) ;
750 Cmp tmp25 (tkij2(2, 3)) ;
751
752 des_coupe_bin_y(tmp15, tmp25, 0,
753 xdes_min, xdes_max, ydes_min, ydes_max,
754 title, &surf1, &surf2, draw_bound ) ;
755
756 strcpy(title, debtit) ;
757 strcat(title, "zz") ;
758 strcat(title, bslash) ;
759 strcat(title, "d (z=0)") ;
760
761 Cmp tmp16 (tkij1(3, 3)) ;
762 Cmp tmp26 (tkij2(3, 3)) ;
763
764 des_coupe_bin_z(tmp16, tmp26, 0,
765 xdes_min, xdes_max, ydes_min, ydes_max,
766 title, &surf1, &surf2, draw_bound ) ;
767
768
769 //==========================================
770 // Hydro quantities
771 //==========================================
772
773 Cmp nbar1 (star(1).get_nbar()) ;
774 Cmp nbar2 (star(2).get_nbar()) ;
775
776 cout << "nbar xy plane" << endl ;
777 des_coupe_bin_z(nbar1, nbar2, 0,
778 xdes_min, xdes_max, ydes_min, ydes_max,
779 "Baryon density (z=0)",
780 &surf1, &surf2, draw_bound ) ;
781
782 cout << "nbar xz plane" << endl ;
783 des_coupe_bin_y(nbar1, nbar2, 0,
784 xdes_min, xdes_max, zdes_min, zdes_max,
785 "Baryon density (y=0)",
786 &surf1, &surf2, draw_bound ) ;
787
788 des_coupe_z(nbar1, 0., 1,
789 "Baryon density (z=0)", &surf1, 1.2, draw_bound ) ;
790
791 des_coupe_y(nbar1, 0., 1,
792 "Baryon density (y=0)", &surf1, 1.2, draw_bound ) ;
793
794 if (irrotational) {
795 Vector tmp_draw_1 = star(1).get_wit_w() ;
796 tmp_draw_1.annule(star(1).get_nzet(), mg1.get_nzone()-1) ;
797 Vector tmp_draw_2 = star(2).get_wit_w() ;
798 tmp_draw_2.annule(star(2).get_nzet(), mg2.get_nzone()-1) ;
799
800 tmp_draw_1.change_triad(star(1).get_mp().get_bvect_cart()) ;
801 tmp_draw_2.change_triad(star(2).get_mp().get_bvect_cart()) ;
802 tmp_draw_2.change_triad(star(1).get_mp().get_bvect_cart()) ;
803
804 Tenseur tmp_draw1 (star(1).get_mp(), 1, CON, star(1).get_mp().get_bvect_cart()) ;
805 tmp_draw1.set_etat_qcq() ;
806 Cmp tmp_draw11 (tmp_draw_1(1)) ;
807 Cmp tmp_draw12 (tmp_draw_1(2)) ;
808 Cmp tmp_draw13 (tmp_draw_1(3)) ;
809 tmp_draw1.set(0) = tmp_draw11 ;
810 tmp_draw1.set(1) = tmp_draw12 ;
811 tmp_draw1.set(2) = tmp_draw13 ;
812
813 Tenseur tmp_draw2 (star(2).get_mp(), 1, CON, star(1).get_mp().get_bvect_cart()) ;
814 tmp_draw2.set_etat_qcq() ;
815 Cmp tmp_draw21 (tmp_draw_2(1)) ;
816 Cmp tmp_draw22 (tmp_draw_2(2)) ;
817 Cmp tmp_draw23 (tmp_draw_2(3)) ;
818 tmp_draw2.set(0) = tmp_draw21 ;
819 tmp_draw2.set(1) = tmp_draw22 ;
820 tmp_draw2.set(2) = tmp_draw23 ;
821
822
823 des_vect_bin_z(tmp_draw1, tmp_draw2, 0.,
824 -3., 0.5, xdes_min, xdes_max, ydes_min, ydes_max,
825 "Velocity w.r.t corotating frame (z=0)",
826 &surf1, &surf2, draw_bound, 40, 40) ;
827 }
828
829 Vector tmp_draw_1 = star(1).get_u_euler() ;
830 tmp_draw_1.annule(star(1).get_nzet(), mg1.get_nzone()-1) ;
831
832 Vector tmp_draw_2 = star(2).get_u_euler() ;
833 tmp_draw_2.annule(star(2).get_nzet(), mg2.get_nzone()-1) ;
834
835 tmp_draw_1.change_triad(star(1).get_mp().get_bvect_cart()) ;
836 tmp_draw_2.change_triad(star(2).get_mp().get_bvect_cart()) ;
837 tmp_draw_2.change_triad(star(1).get_mp().get_bvect_cart()) ;
838
839 Tenseur tmp_draw1 (star(1).get_mp(), 1, CON, star(1).get_mp().get_bvect_cart()) ;
840 tmp_draw1.set_etat_qcq() ;
841 Cmp tmp_draw11 (tmp_draw_1(1)) ;
842 Cmp tmp_draw12 (tmp_draw_1(2)) ;
843 Cmp tmp_draw13 (tmp_draw_1(3)) ;
844 tmp_draw1.set(0) = tmp_draw11 ;
845 tmp_draw1.set(1) = tmp_draw12 ;
846 tmp_draw1.set(2) = tmp_draw13 ;
847
848 Tenseur tmp_draw2 (star(2).get_mp(), 1, CON, star(1).get_mp().get_bvect_cart()) ;
849 tmp_draw2.set_etat_qcq() ;
850 Cmp tmp_draw21 (tmp_draw_2(1)) ;
851 Cmp tmp_draw22 (tmp_draw_2(2)) ;
852 Cmp tmp_draw23 (tmp_draw_2(3)) ;
853 tmp_draw2.set(0) = tmp_draw21 ;
854 tmp_draw2.set(1) = tmp_draw22 ;
855 tmp_draw2.set(2) = tmp_draw23 ;
856
857
858 des_coupe_vect_x(tmp_draw1, mp1.get_ori_x(), -1., 0.5, nzdes1,
859 "U (x=x1)", &surf1, 1.2, draw_bound ) ;
860
861 cout << "fluid velocity xy plane" << endl ;
862 des_vect_bin_z(tmp_draw1, tmp_draw2, 0.,
863 -2., 0.5, xdes_min, xdes_max, ydes_min, ydes_max,
864 "U (z=0)", &surf1, &surf2, draw_bound, 40, 40) ;
865
866 if (irrotational) {
867 Vector tmp_dpsii = star(1).get_d_psi() ;
868 tmp_dpsii.annule(star(1).get_nzet(), mg1.get_nzone()-1) ;
869
870 tmp_dpsii.change_triad(star(1).get_mp().get_bvect_cart()) ;
871
872 Tenseur tmp_dpsi (star(1).get_mp(), 1, CON, star(1).get_mp().get_bvect_cart()) ;
873 tmp_dpsi.set_etat_qcq() ;
874 Cmp tmp_dpsi1 (tmp_dpsii(1)) ;
875 Cmp tmp_dpsi2 (tmp_dpsii(2)) ;
876 Cmp tmp_dpsi3 (tmp_dpsii(3)) ;
877 tmp_dpsi.set(0) = tmp_dpsi1 ;
878 tmp_dpsi.set(1) = tmp_dpsi2 ;
879 tmp_dpsi.set(2) = tmp_dpsi3 ;
880
881
882 des_coupe_vect_z(tmp_dpsi, 0, -1., 0.5, nzdes1,
883 "Grad(psi) (z=0)", &surf1, 1.2, draw_bound ) ;
884
885 Cmp psi00 (star(1).get_psi0()) ;
886 des_coupe_z(psi00, 0., 1,
887 "psi0 (z=0)", &surf1, 1.2, draw_bound ) ;
888
889 Tenseur psi000 (psi00) ;
890 Tenseur d_psi0 = psi000.gradient() ;
891 //## d_psi0.change_triad(star.get_ref_triad()) ;
892
893 des_coupe_vect_z(d_psi0, 0, -3., 0.5, nzdes1, "Grad(psi0) (z=0)",
894 &surf1, 1.2, draw_bound ) ;
895
896 Vector tmp_witt = star(1).get_wit_w() ;
897 tmp_witt.annule(star(1).get_nzet(), mg1.get_nzone()-1) ;
898
899 tmp_witt.change_triad(star(1).get_mp().get_bvect_cart()) ;
900
901 Tenseur tmp_wit (star(1).get_mp(), 1, CON, star(1).get_mp().get_bvect_cart()) ;
902 tmp_wit.set_etat_qcq() ;
903 Cmp tmp_wit1 (tmp_witt(1)) ;
904 Cmp tmp_wit2 (tmp_witt(2)) ;
905 Cmp tmp_wit3 (tmp_witt(3)) ;
906 tmp_wit.set(0) = tmp_wit1 ;
907 tmp_wit.set(1) = tmp_wit2 ;
908 tmp_wit.set(2) = tmp_wit3 ;
909
910 des_coupe_vect_z(tmp_wit, 0, -3., 0.5, nzdes1, "W (z=0)",
911 &surf1, 1.2, draw_bound ) ;
912
913 }
914
915 // Cleaning
916 // --------
917
918 delete peos1 ;
919 delete peos2 ;
920
921 return EXIT_SUCCESS ;
922
923 }