Debian Codegraph @

Codes/Bin_star_xcts/xlit_bin.C

raw
1 /*
2 * Reads a file containing a binary configuration (class Binary_xcts) and
3 * performs various tests and plots.
4 *
5 */
6
7 /*
8 * Copyright (c) 2010 Michal Bejger
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 version 2
14 * as published by the Free Software Foundation.
15 *
16 * LORENE is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with LORENE; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 *
25 */
26
27 char lit_bin_C[] = "$Header: /cvsroot/Lorene/Codes/Bin_star_xcts/xlit_bin.C,v 1.3 2014/10/13 08:53:55 j_novak Exp $" ;
28
29 /*
30 * $Id: xlit_bin.C,v 1.3 2014/10/13 08:53:55 j_novak Exp $
31 * $Log: xlit_bin.C,v $
32 * Revision 1.3 2014/10/13 08:53:55 j_novak
33 * Lorene classes and functions now belong to the namespace Lorene.
34 *
35 * Revision 1.2 2014/10/06 15:09:43 j_novak
36 * Modified #include directives to use c++ syntax.
37 *
38 * Revision 1.1 2011/03/29 13:45:54 m_bejger
39 * Renaming lit_bin.C to xlit_bin.C in order to avoid confusion with previous codes
40 *
41 * Revision 1.6 2011/03/25 10:01:17 m_bejger
42 * Curvature tensor plots corrected
43 *
44 * Revision 1.5 2010/12/09 10:49:37 m_bejger
45 * *** empty log message ***
46 *
47 * Revision 1.4 2010/07/20 19:58:41 m_bejger
48 * Correcting diagnostic plots of logn_auto
49 *
50 * Revision 1.3 2010/06/04 19:51:26 m_bejger
51 * Minor corrections
52 *
53 * Revision 1.2 2010/05/03 13:39:14 m_bejger
54 * File handler fixed
55 *
56 * Revision 1.1 2010/04/29 15:10:47 m_bejger
57 * First version: not working properly
58 *
59 *
60 * $Header: /cvsroot/Lorene/Codes/Bin_star_xcts/xlit_bin.C,v 1.3 2014/10/13 08:53:55 j_novak Exp $
61 *
62 */
63
64 // headers C
65 #include <cstdlib>
66 #include <cmath>
67 #include <cstring>
68
69 // headers Lorene
70 #include "unites.h"
71 #include "binary_xcts.h"
72 #include "eos.h"
73 #include "utilitaires.h"
74 #include "graphique.h"
75 #include "cmp.h"
76 #include "tenseur.h"
77 #include "nbr_spx.h"
78
79 namespace Lorene {
80 // Local prototype
81 Cmp raccord_c1(const Cmp& uu, int l1) ;
82 }
83 //******************************************************************************
84
85 using namespace Lorene ;
86
87 int main(int argc, char** argv){
88
89 // Identification of all the subroutines called by the code :
90 // system("ident lit_bin") ;
91
92 if (argc < 2) {
93 cout <<
94 "lit_bin : the name of a file containing a binary configuration"
95 << endl << " must be given in argument !" << endl ;
96 abort() ;
97 }
98
99 char* nomresu = argv[1] ;
100
101 cout << "Name of the file to be read : " << nomresu << endl ;
102
103 bool draw_bound = true ;
104 using namespace Unites ;
105
106 FILE* fich = fopen(nomresu, "r") ;
107 if (fich == 0x0) {
108 cout << "Problem in opening the file " << nomresu << " ! " << endl ;
109 perror(" reason") ;
110 abort() ;
111 }
112
113 int mer ;
114 int f_status = fread(&mer, sizeof(int), 1, fich) ; // mer
115
116 Mg3d mg1(fich) ;
117 Map_et mp1(mg1, fich) ;
118 Eos* peos1 = Eos::eos_from_file(fich) ;
119
120 Mg3d mg2(fich) ;
121 Map_et mp2(mg2, fich) ;
122 Eos* peos2 = Eos::eos_from_file(fich) ;
123
124 Binary_xcts star(mp1, *peos1, mp2, *peos2, fich) ;
125
126 fclose(fich) ;
127
128 bool irrotational = star(1).is_irrotational() ;
129
130 cout << endl << "Grid on which star 1 is defined : " << endl ;
131 cout << "=============================== " << endl ;
132 cout << *((star(1).get_mp()).get_mg()) << endl ;
133
134 cout << endl << "Grid on which star 2 is defined : " << endl ;
135 cout << "=============================== " << endl ;
136 cout << *((star(2).get_mp()).get_mg()) << endl ;
137
138 cout << endl << "Mapping on which star 1 is defined : " << endl ;
139 cout << "================================== " << endl ;
140 cout << star(1).get_mp() << endl ;
141
142 cout << endl << "Mapping on which star 2 is defined : " << endl ;
143 cout << "================================== " << endl ;
144 cout << star(2).get_mp() << endl ;
145
146 for (int i=1; i<=2; i++)
147 (star.set(i)).update_metric(star(3-i)) ;
148
149 for (int i=1; i<=2; i++)
150 (star.set(i)).update_metric_der_comp(star(3-i)) ;
151
152 for (int i=1; i<=2; i++) {
153
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 // Writing of resformat.d
161 ofstream seqfich("resformat.d") ;
162 if ( !seqfich.good() ) {
163 cout << "coal : problem with opening the file resformat.d !" << endl ;
164 abort() ;
165 }
166
167 star.write_global(seqfich) ;
168 seqfich.close() ;
169
170 // Some printings
171 cout.precision(6) ;
172 cout << "Central gamma determinant : "
173 << ((star(1).get_gamma()).determinant()).val_grid_point(0,0,0,0) << endl ;
174 cout << "Central value of N : "
175 << (star(1).get_nn()).val_grid_point(0,0,0,0) << endl ;
176 cout << "Central value of Psi^4 : "
177 << (star(1).get_psi4()).val_grid_point(0,0,0,0) << endl ;
178 // cout << "Central value of Psi_auto : "
179 // << (star(1).get_Psi_auto()).val_grid_point(0,0,0,0) << endl ;
180 // cout << "Central value of Psi_comp : "
181 // << (star(1).get_Psi_comp()).val_grid_point(0,0,0,0) << endl ;
182
183 cout << "Star(1) mass_bar = " << (star(1).mass_b())/msol << endl ;
184 cout << "mass_adm_vol = " << star.mass_adm_vol()/msol << endl ;
185 cout << "mass_kom vol = " << star.mass_kom_vol()/msol << endl ;
186 cout << "mass_adm = " << star.mass_adm()/msol << endl ;
187 cout << "mass_kom = " << star.mass_kom()/msol << endl ;
188 cout << "d = " << star.separation() << endl ;
189 cout << "ray_eq = " << star(1).ray_eq() << endl ;
190 cout << "ray_eq_pi = " << star(1).ray_eq_pi() << endl ;
191 cout << "R = " << (star(1).ray_eq() + star(1).ray_eq_pi())/2. << endl ;
192 cout << "d_milieu = " << star.separation()/2. + (star(1).ray_eq_pi()
193 - star(1).ray_eq())/2. << endl ;
194 cout << "d/R = " << (star.separation() + (star(1).ray_eq_pi()
195 - star(1).ray_eq()))/(star(1).ray_eq() + star(1).ray_eq_pi())
196 << endl ;
197
198 arrete() ;
199
200 cout << "Binary system read in file : " << endl ;
201 cout << star << endl ;
202
203 star.display_poly(cout) ; // Reduced quantities for polytropic EOS
204
205 //////////////////////////////////////////////////////////
206 // Plot of different fields along X, Y and Z axis //
207 //////////////////////////////////////////////////////////
208
209 Vector beta (star(1).get_beta()) ;
210 beta.change_triad(star(1).get_mp().get_bvect_cart()) ;
211 Scalar beta_y_aux (beta(2)) ;
212
213 Scalar logn_aux (star(1).get_logn()) ;
214 Scalar psi_aux (star(1).get_Psi()) ;
215 psi_aux.std_spectral_base() ;
216
217 // Construction of an auxiliar grid and mapping
218 int nz = star(1).get_mp().get_mg()->get_nzone() ;
219 assert (nz >= 4);
220 double* bornes = new double [nz+1] ;
221 double r_in = 0.95 * (-star(1).get_mp().get_ori_x()-star(1).ray_eq()) ;
222 double r_ext = 1.05 * (-star(1).get_mp().get_ori_x()+star(1).ray_eq_pi()) ;
223
224 bornes[0] = 0 ;
225 bornes[1] = r_in ;
226 bornes[2] = r_ext ;
227 for (int l=3; l<nz; l++)
228 bornes[l] = r_ext * pow(2., l-2) ;
229 bornes[nz] = __infinity ;
230
231 Map_af mapping (*(star(1).get_mp().get_mg()), bornes) ;
232 delete [] bornes ;
233
234 // Importation of fields
235 // ----------------------
236
237 assert (star(1).get_mp().get_rot_phi() == 0) ;
238
239 Scalar logn (mapping) ;
240 logn.import(logn_aux) ;
241 logn.std_spectral_base() ;
242
243 Scalar psi (mapping) ;
244 psi.import(psi_aux) ;
245 psi.std_spectral_base() ;
246
247 Scalar beta_y (mapping) ;
248 beta_y.import(beta_y_aux) ;
249 beta_y.std_spectral_base() ;
250
251 if (star(1).get_nzet() > 1) {
252 cout.precision(10) ;
253
254 for (int ltrans = 0; ltrans < star(1).get_nzet()-1; ltrans++) {
255 cout << endl << "Star 1 : values at boundary between domains no. "
256 << ltrans << " and " << ltrans+1 << " for theta = pi/2 and phi = 0 :" << endl ;
257
258 double rt1 = star(1).get_mp().val_r(ltrans, 1., M_PI/2, 0.) ;
259 double rt2 = star(1).get_mp().val_r(ltrans+1, -1., M_PI/2, 0.) ;
260 double diff_rt = (rt2 - rt1)/rt1 ;
261 cout << " Coord. r [km] (left, right, rel. diff) : "
262 << rt1 / km << " " << rt2 / km << " " << diff_rt << endl ;
263
264 int ntm1 = star(1).get_mp().get_mg()->get_nt(ltrans) - 1;
265 int nrm1 = star(1).get_mp().get_mg()->get_nr(ltrans) - 1 ;
266 double ent1 = star(1).get_ent().val_grid_point(ltrans, 0, ntm1, nrm1) ;
267 double ent2 = star(1).get_ent().val_grid_point(ltrans+1, 0, ntm1, 0) ;
268 double diff_ent = (ent2-ent1)/ent1 ;
269 cout << " Enthalpy (left, right, rel. diff) : "
270 << ent1 << " " << ent2 << " " << diff_ent << endl ;
271
272 double press1 = star(1).get_press().val_grid_point(ltrans, 0, ntm1, nrm1) ;
273 double press2 = star(1).get_press().val_grid_point(ltrans+1, 0, ntm1, 0) ;
274 double diff_press = (press2-press1)/press1 ;
275 cout << " Pressure (left, right, rel. diff) : "
276 << press1 << " " << press2 << " " << diff_press << endl ;
277
278 double nb1 = star(1).get_nbar().val_grid_point(ltrans, 0, ntm1, nrm1) ;
279 double nb2 = star(1).get_nbar().val_grid_point(ltrans+1, 0, ntm1, 0) ;
280 double diff_nb = (nb2-nb1)/nb1 ;
281 cout << " Baryon density (left, right, rel. diff) : "
282 << nb1 << " " << nb2 << " " << diff_nb << endl ;
283 }
284
285 double r_max = 1.2 * star(1).ray_eq() ;
286 des_profile(star(1).get_nbar(), 0., r_max, M_PI/2, 0., "n", "Baryon density") ;
287 des_profile(star(1).get_ener(), 0., r_max, M_PI/2, 0., "e", "Energy density") ;
288 des_profile(star(1).get_press(), 0., r_max, M_PI/2, 0., "p", "Pressure") ;
289 des_profile(star(1).get_ent(), 0., r_max, M_PI/2, 0., "H", "Enthalpy") ;
290
291 }
292
293
294 //==============================================================
295 // Drawings
296 //==============================================================
297
298 int nzdes1 = star(1).get_nzet() ;
299
300 double ori_x1 = star(1).get_mp().get_ori_x() ;
301 double ori_x2 = star(2).get_mp().get_ori_x() ;
302
303 double xdes_min = - 1.5 * star(1).ray_eq_pi() + ori_x1 ;
304 xdes_min += 0.2 * xdes_min ;
305 double xdes_max = 1.5 * star(2).ray_eq_pi() + ori_x2 ;
306 xdes_max += 0.2 * fabs(xdes_min) ;
307
308 double ydes_min1 = - 4. * star(1).ray_eq_pis2() ;
309 double ydes_min2 = - 4. * star(2).ray_eq_pis2() ;
310 double ydes_min = (ydes_min1 < ydes_min2) ? ydes_min1 : ydes_min2 ;
311
312 double ydes_max1 = 4. * star(1).ray_eq_pis2() ;
313 double ydes_max2 = 4. * star(2).ray_eq_pis2() ;
314 double ydes_max = (ydes_max1 > ydes_max2) ? ydes_max1 : ydes_max2 ;
315
316 double zdes_min1 = - 4. * star(1).ray_pole() ;
317 double zdes_min2 = - 4. * star(2).ray_pole() ;
318 double zdes_min = (zdes_min1 < zdes_min2) ? zdes_min1 : zdes_min2 ;
319
320 double zdes_max1 = 4. * star(1).ray_pole() ;
321 double zdes_max2 = 4. * star(2).ray_pole() ;
322 double zdes_max = (zdes_max1 > zdes_max2) ? zdes_max1 : zdes_max2 ;
323
324 Cmp surf1 (star(1).get_ent()) ;
325 Cmp surf1_ext(mp1) ;
326 surf1_ext = - 0.2 * surf1(0, 0, 0, 0) ;
327 surf1_ext.annule(0, star(1).get_nzet()-1) ;
328 surf1.annule(star(1).get_nzet(), mg1.get_nzone()-1) ;
329 surf1 = surf1 + surf1_ext ;
330 surf1 = raccord_c1(surf1, star(1).get_nzet()) ;
331
332 Cmp surf2 (star(2).get_ent()) ;
333 Cmp surf2_ext(mp2) ;
334 surf2_ext = - 0.2 * surf2(0, 0, 0, 0) ;
335 surf2_ext.annule(0, star(2).get_nzet()-1) ;
336 surf2.annule(star(2).get_nzet(), mg2.get_nzone()-1) ;
337 surf2 = surf2 + surf2_ext ;
338
339 surf2 = raccord_c1(surf2, star(2).get_nzet()) ;
340
341 char title[80] ;
342 char bslash[2] = {92,'\0'} ; // 92 is the ASCII code for backslash
343
344 ofstream fent("enthalpy.d") ;
345 if ( !fent.good() ) {
346 cout << "lit_bin : problem with opening the file enthalpy.d !" << endl ;
347 abort() ;
348 }
349
350
351 fent << "Enthalpy field at the boundary of last inner domain of star 1 : "
352 << endl ;
353 int lzet = star(1).get_nzet() - 1 ;
354 for (int k=0; k<mg1.get_np(lzet); k++) {
355 fent << "k = " << k << " : " ;
356 for (int j=0; j<mg1.get_nt(lzet); j++) {
357 fent << " " << star(1).get_ent().val_grid_point(lzet, k, j, mg1.get_nr(lzet)-1) ;
358 }
359 fent << endl ;
360 }
361
362
363 fent << endl << "enthalpy field of star 1 : " << endl ;
364 fent << star(1).get_ent() << endl ;
365 fent.close() ;
366
367 Scalar ent1 (star(1).get_ent()) ;
368
369 Scalar Psi1 (star(1).get_Psi()) ;
370 Scalar chi1 (star(1).get_chi()) ;
371
372 Scalar Psi2 (star(2).get_Psi()) ;
373 Scalar chi2 (star(2).get_chi()) ;
374
375 Scalar Psi1_auto (star(1).get_Psi_auto()) ;
376 Scalar Psi2_auto (star(2).get_Psi_auto()) ;
377
378 Scalar chi1_auto (star(1).get_chi_auto()) ;
379 Scalar chi2_auto (star(2).get_chi_auto()) ;
380
381 des_coupe_z(Psi1_auto, 0., 1,
382 "Psi1_auto (z=0)", &surf1, 5., draw_bound ) ;
383
384 // des_profile (Psi1_auto, 0., 15* star(1).ray_eq(), M_PI/2., 0.,
385 // "Psi1_auto", "Psi1_auto (theta=pi/2, phi=0)" ) ;
386
387 // des_profile (Psi1_comp, 0., 15* star(1).ray_eq(), M_PI/2., 0.,
388 // "Psi1_comp", "Psi1_comp (theta=pi/2, phi=0)" ) ;
389
390 des_profile (Psi1, 0., 15* star(1).ray_eq(), M_PI/2., 0.,
391 "Psi1", "Psi1 (theta=pi/2, phi=0)" ) ;
392
393 // des_profile (chi1_auto, 0., 15* star(1).ray_eq(), M_PI/2., 0.,
394 // "chi1_auto", "chi1_auto (theta=pi/2, phi=0)" ) ;
395
396 // des_profile (chi1_comp, 0., 15* star(1).ray_eq(), M_PI/2., 0.,
397 // "chi1_comp", "chi1_comp (theta=pi/2, phi=0)" ) ;
398
399 des_profile (chi1, 0., 15* star(1).ray_eq(), M_PI/2., 0.,
400 "chi1", "chi1 (theta=pi/2, phi=0" ) ;
401
402 des_coupe_z(ent1, 0., 1,
403 "Enthalpy (z=0)", &surf1, 1.2, draw_bound ) ;
404
405 des_coupe_y(ent1, 0., 1,
406 "Enthalpy (y=0)", &surf1, 1.2, draw_bound ) ;
407
408 des_profile (ent1, 0., 2* star(1).ray_eq(), 0., 0.,
409 "H", "H (theta=0)" ) ;
410
411 des_profile (ent1, 0., 2* star(1).ray_eq(), M_PI/2., M_PI/2.,
412 "H", "H (theta=pi/2, phi=pi/2)" ) ;
413
414
415
416 //==========================================
417 // Metric quantities
418 //==========================================
419
420 //----------------------------
421 // ln(N)
422 //----------------------------
423
424 Scalar logn1 (log((chi1_auto + 1.)/(Psi1_auto + 1.))) ;
425 Scalar logn2 (log((chi2_auto + 1.)/(Psi2_auto + 1.))) ;
426
427 logn1.std_spectral_base() ;
428 logn2.std_spectral_base() ;
429
430 cout << "logn xz plane" << endl ;
431
432 des_coupe_bin_y(logn1, logn2, 0,
433 xdes_min, xdes_max, zdes_min, zdes_max,
434 "ln(N) (y=0)", &surf1, &surf2, draw_bound ) ;
435
436 cout << "logn xy plane" << endl ;
437
438 des_coupe_bin_z(logn1, logn2, 0,
439 xdes_min, xdes_max, ydes_min, ydes_max,
440 "ln(N) (z=0)", &surf1, &surf2, draw_bound ) ;
441
442 double xdes_min_large = 2 * xdes_min ;
443 double xdes_max_large = 2 * xdes_max ;
444 double ydes_min_large = 2 * ydes_min ;
445 double ydes_max_large = 2 * ydes_max ;
446
447 des_coupe_bin_z(logn1, logn2, 0,
448 xdes_min_large, xdes_max_large, ydes_min_large, ydes_max_large,
449 "ln(N) (z=0)", &surf1, &surf2, draw_bound ) ;
450
451 des_coupe_bin_x(logn1, logn2,
452 ori_x1, ydes_min, ydes_max, zdes_min, zdes_max,
453 "ln(N) (x=x1)", &surf1, 0x0, draw_bound ) ;
454
455 //--------------
456 // Shift vector
457 //--------------
458
459 double dmax ;
460 dmax = 8. * star(1).ray_eq() ;
461
462 Vector beta1 (star(1).get_beta_auto()) ;
463 Vector beta2 (star(2).get_beta_auto()) ;
464
465 beta1.change_triad(star(1).get_mp().get_bvect_cart()) ;
466 beta2.change_triad(star(2).get_mp().get_bvect_cart()) ;
467 beta2.change_triad(star(1).get_mp().get_bvect_cart()) ;
468
469 Tenseur tmp_beta1 (star(1).get_mp(), 1, CON, star(1).get_mp().get_bvect_cart()) ;
470 tmp_beta1.set_etat_qcq() ;
471 Cmp tmp_beta11 (beta1(1)) ;
472 Cmp tmp_beta12 (beta1(2)) ;
473 Cmp tmp_beta13 (beta1(3)) ;
474 tmp_beta1.set(0) = tmp_beta11 ;
475 tmp_beta1.set(1) = tmp_beta12 ;
476 tmp_beta1.set(2) = tmp_beta13 ;
477
478 Tenseur tmp_beta2 (star(2).get_mp(), 1, CON, star(1).get_mp().get_bvect_cart()) ;
479 tmp_beta2.set_etat_qcq() ;
480 Cmp tmp_beta21 (beta2(1)) ;
481 Cmp tmp_beta22 (beta2(2)) ;
482 Cmp tmp_beta23 (beta2(3)) ;
483 tmp_beta2.set(0) = tmp_beta21 ;
484 tmp_beta2.set(1) = tmp_beta22 ;
485 tmp_beta2.set(2) = tmp_beta23 ;
486
487 cout << "shift_x xy plane" << endl ;
488 des_coupe_bin_z(tmp_beta11, tmp_beta21, 0., -dmax, dmax, -dmax, dmax,
489 "shift_x (z=0)" , &surf1, &surf2, draw_bound) ;
490 cout << "shift_y xy plane" << endl ;
491 des_coupe_bin_z(tmp_beta12, tmp_beta22, 0., -dmax, dmax, -dmax, dmax,
492 "shift_y (z=0)" , &surf1, &surf2, draw_bound) ;
493 cout << "shift_y xz plane" << endl ;
494 des_coupe_bin_y(tmp_beta12, tmp_beta22, 0., -dmax, dmax, -dmax, dmax,
495 "shift_y (y=0)" , &surf1, &surf2, draw_bound) ;
496
497 cout << "shift xy plane" << endl ;
498
499 des_vect_bin_z(tmp_beta1, tmp_beta2, 0.,
500 -2., 0.5, xdes_min, xdes_max, ydes_min, ydes_max,
501 "Shift vector (z=0)",
502 &surf1, &surf2, draw_bound ) ;
503
504 //----------------------------
505 // Extrinsic curvature tensor
506 //----------------------------
507
508 Tensor tkij1 (star(1).get_haij_auto()) ;
509 Tensor tkij2 (star(2).get_haij_auto()) ;
510
511 // Division by r^2 in the external compactified domain
512 // in order to get \hat{A}^{ij} :
513 tkij1.dec_dzpuis(2) ;
514 tkij2.dec_dzpuis(2) ;
515
516 char debtit[] = {'A', 92, 'u', '\0'} ;
517
518 //-----------------------------------
519 cout << "\\hat{A}^xx (z=0)" << endl ;
520 strcpy(title, debtit) ;
521 strcat(title, "xx") ;
522 strcat(title, bslash) ;
523 strcat(title, "d (z=0)") ;
524
525 des_coupe_bin_z(tkij1(1, 1), tkij2(1, 1), 0,
526 xdes_min, xdes_max, ydes_min, ydes_max,
527 title, &surf1, &surf2, draw_bound ) ;
528
529 //-----------------------------------
530 cout << "\\hat{A}^xy (z=0)" << endl ;
531 strcpy(title, debtit) ;
532 strcat(title, "xy") ;
533 strcat(title, bslash) ;
534 strcat(title, "d (z=0)") ;
535
536 des_coupe_bin_z(tkij1(1, 2), tkij2(1, 2), 0,
537 xdes_min, xdes_max, ydes_min, ydes_max,
538 title, &surf1, &surf2, draw_bound ) ;
539
540 //-----------------------------------
541 cout << "\\hat{A}^xz (y=0)" << endl ;
542 strcpy(title, debtit) ;
543 strcat(title, "xz") ;
544 strcat(title, bslash) ;
545 strcat(title, "d (y=0)") ;
546
547 des_coupe_bin_y(tkij1(1, 3), tkij2(1, 3), 0,
548 xdes_min, xdes_max, zdes_min, zdes_max,
549 title, &surf1, &surf2, draw_bound ) ;
550
551 //-----------------------------------
552 cout << "\\hat{A}^yy (z=0)" << endl ;
553 strcpy(title, debtit) ;
554 strcat(title, "yy") ;
555 strcat(title, bslash) ;
556 strcat(title, "d (z=0)") ;
557
558 des_coupe_bin_z(tkij1(2, 2), tkij2(2, 2), 0,
559 xdes_min, xdes_max, ydes_min, ydes_max,
560 title, &surf1, &surf2, draw_bound ) ;
561
562 //-----------------------------------
563 cout << "\\hat{A}^yz (y=0)" << endl ;
564 strcpy(title, debtit) ;
565 strcat(title, "yz") ;
566 strcat(title, bslash) ;
567 strcat(title, "d (y=0)") ;
568
569 des_coupe_bin_y(tkij1(2, 3), tkij2(2, 3), 0,
570 xdes_min, xdes_max, zdes_min, zdes_max,
571 title, &surf1, &surf2, draw_bound ) ;
572
573 //-----------------------------------
574 cout << "\\hat{A}^zz (z=0)" << endl ;
575 strcpy(title, debtit) ;
576 strcat(title, "zz") ;
577 strcat(title, bslash) ;
578 strcat(title, "d (z=0)") ;
579
580 des_coupe_bin_z(tkij1(3, 3), tkij2(3, 3), 0,
581 xdes_min, xdes_max, ydes_min, ydes_max,
582 title, &surf1, &surf2, draw_bound ) ;
583
584 //----------------------------
585 // \hat{A}_ij \hat{A}^ij term
586 //----------------------------
587
588 Tenseur hacar1 ( star(1).get_hacar_auto() ) ;
589 Tenseur hacar2 ( star(2).get_hacar_auto() ) ;
590
591 // Division by r^4 in the external compactified domain
592 // in order to get \hat{A}_ij \hat{A}^{ij} :
593 hacar1.dec2_dzpuis() ;
594 hacar1.dec2_dzpuis() ;
595 hacar2.dec2_dzpuis() ;
596 hacar2.dec2_dzpuis() ;
597
598 char title1[80] ;
599 strcpy(title1, debtit) ;
600 strcat(title1, "ij") ;
601 strcat(title1, bslash) ;
602 strcat(title1, "d A") ;
603 strcat(title1, bslash) ;
604 strcat(title1, "dij") ;
605 strcat(title1, bslash) ;
606
607 strcpy(title, title1) ;
608 strcat(title, "u (x=x1)") ;
609
610 des_coupe_bin_x(hacar1(), hacar2(), ori_x1,
611 ydes_min, ydes_max, zdes_min, zdes_max,
612 title, &surf1, 0x0, draw_bound ) ;
613
614 strcpy(title, title1) ;
615 strcat(title, "u (y=0)") ;
616
617 des_coupe_bin_y(hacar1(), hacar2(), 0,
618 xdes_min, xdes_max, zdes_min, zdes_max,
619 title, &surf1, &surf2, draw_bound ) ;
620
621 strcpy(title, title1) ;
622 strcat(title, "u (z=0)") ;
623
624 des_coupe_bin_z(hacar1(), hacar2(), 0,
625 xdes_min, xdes_max, ydes_min, ydes_max,
626 title, &surf1, &surf2, draw_bound ) ;
627
628
629 //==========================================
630 // Hydro quantities
631 //==========================================
632
633 Cmp nbar1 (star(1).get_nbar()) ;
634 Cmp nbar2 (star(2).get_nbar()) ;
635
636 cout << "nbar xy plane" << endl ;
637 des_coupe_bin_z(nbar1, nbar2, 0,
638 xdes_min, xdes_max, ydes_min, ydes_max,
639 "Baryon density (z=0)",
640 &surf1, &surf2, draw_bound ) ;
641
642 //cout << "nbar xz plane" << endl ;
643 //des_coupe_bin_y(nbar1, nbar2, 0,
644 // xdes_min, xdes_max, zdes_min, zdes_max,
645 // "Baryon density (y=0)",
646 // &surf1, &surf2, draw_bound ) ;
647
648 //des_coupe_z(nbar1, 0., 1,
649 // "Baryon density (z=0)", &surf1, 1.2, draw_bound ) ;
650
651 des_coupe_y(nbar1, 0., 1,
652 "Baryon density (y=0)", &surf1, 1.2, draw_bound ) ;
653
654 if (irrotational) {
655 Vector tmp_draw_1 = star(1).get_wit_w() ;
656 tmp_draw_1.annule(star(1).get_nzet(), mg1.get_nzone()-1) ;
657 Vector tmp_draw_2 = star(2).get_wit_w() ;
658 tmp_draw_2.annule(star(2).get_nzet(), mg2.get_nzone()-1) ;
659
660 tmp_draw_1.change_triad(star(1).get_mp().get_bvect_cart()) ;
661 tmp_draw_2.change_triad(star(2).get_mp().get_bvect_cart()) ;
662 tmp_draw_2.change_triad(star(1).get_mp().get_bvect_cart()) ;
663
664 Tenseur tmp_draw1 (star(1).get_mp(), 1, CON, star(1).get_mp().get_bvect_cart()) ;
665 tmp_draw1.set_etat_qcq() ;
666 Cmp tmp_draw11 (tmp_draw_1(1)) ;
667 Cmp tmp_draw12 (tmp_draw_1(2)) ;
668 Cmp tmp_draw13 (tmp_draw_1(3)) ;
669 tmp_draw1.set(0) = tmp_draw11 ;
670 tmp_draw1.set(1) = tmp_draw12 ;
671 tmp_draw1.set(2) = tmp_draw13 ;
672
673 Tenseur tmp_draw2 (star(2).get_mp(), 1, CON, star(1).get_mp().get_bvect_cart()) ;
674 tmp_draw2.set_etat_qcq() ;
675 Cmp tmp_draw21 (tmp_draw_2(1)) ;
676 Cmp tmp_draw22 (tmp_draw_2(2)) ;
677 Cmp tmp_draw23 (tmp_draw_2(3)) ;
678 tmp_draw2.set(0) = tmp_draw21 ;
679 tmp_draw2.set(1) = tmp_draw22 ;
680 tmp_draw2.set(2) = tmp_draw23 ;
681
682
683 des_vect_bin_z(tmp_draw1, tmp_draw2, 0.,
684 -3., 0.5, xdes_min, xdes_max, ydes_min, ydes_max,
685 "Velocity w.r.t corotating frame (z=0)",
686 &surf1, &surf2, draw_bound, 40, 40) ;
687 }
688
689 Vector tmp_draw_1 = star(1).get_u_euler() ;
690 tmp_draw_1.annule(star(1).get_nzet(), mg1.get_nzone()-1) ;
691
692 Vector tmp_draw_2 = star(2).get_u_euler() ;
693 tmp_draw_2.annule(star(2).get_nzet(), mg2.get_nzone()-1) ;
694
695 tmp_draw_1.change_triad(star(1).get_mp().get_bvect_cart()) ;
696 tmp_draw_2.change_triad(star(2).get_mp().get_bvect_cart()) ;
697 tmp_draw_2.change_triad(star(1).get_mp().get_bvect_cart()) ;
698
699 Tenseur tmp_draw1 (star(1).get_mp(), 1, CON, star(1).get_mp().get_bvect_cart()) ;
700 tmp_draw1.set_etat_qcq() ;
701 Cmp tmp_draw11 (tmp_draw_1(1)) ;
702 Cmp tmp_draw12 (tmp_draw_1(2)) ;
703 Cmp tmp_draw13 (tmp_draw_1(3)) ;
704 tmp_draw1.set(0) = tmp_draw11 ;
705 tmp_draw1.set(1) = tmp_draw12 ;
706 tmp_draw1.set(2) = tmp_draw13 ;
707
708 Tenseur tmp_draw2 (star(2).get_mp(), 1, CON, star(1).get_mp().get_bvect_cart()) ;
709 tmp_draw2.set_etat_qcq() ;
710 Cmp tmp_draw21 (tmp_draw_2(1)) ;
711 Cmp tmp_draw22 (tmp_draw_2(2)) ;
712 Cmp tmp_draw23 (tmp_draw_2(3)) ;
713 tmp_draw2.set(0) = tmp_draw21 ;
714 tmp_draw2.set(1) = tmp_draw22 ;
715 tmp_draw2.set(2) = tmp_draw23 ;
716
717
718 des_coupe_vect_x(tmp_draw1, mp1.get_ori_x(), -1., 0.5, nzdes1,
719 "U (x=x1)", &surf1, 1.2, draw_bound ) ;
720
721 cout << "fluid velocity xy plane" << endl ;
722 des_vect_bin_z(tmp_draw1, tmp_draw2, 0.,
723 -2., 0.5, xdes_min, xdes_max, ydes_min, ydes_max,
724 "U (z=0)", &surf1, &surf2, draw_bound, 40, 40) ;
725
726 if (irrotational) {
727 Vector tmp_dpsii = star(1).get_d_psi() ;
728 tmp_dpsii.annule(star(1).get_nzet(), mg1.get_nzone()-1) ;
729
730 tmp_dpsii.change_triad(star(1).get_mp().get_bvect_cart()) ;
731
732 Tenseur tmp_dpsi (star(1).get_mp(), 1, CON, star(1).get_mp().get_bvect_cart()) ;
733 tmp_dpsi.set_etat_qcq() ;
734 Cmp tmp_dpsi1 (tmp_dpsii(1)) ;
735 Cmp tmp_dpsi2 (tmp_dpsii(2)) ;
736 Cmp tmp_dpsi3 (tmp_dpsii(3)) ;
737 tmp_dpsi.set(0) = tmp_dpsi1 ;
738 tmp_dpsi.set(1) = tmp_dpsi2 ;
739 tmp_dpsi.set(2) = tmp_dpsi3 ;
740
741
742 des_coupe_vect_z(tmp_dpsi, 0, -1., 0.5, nzdes1,
743 "Grad(psi) (z=0)", &surf1, 1.2, draw_bound ) ;
744
745 Cmp psi00 (star(1).get_psi0()) ;
746 des_coupe_z(psi00, 0., 1,
747 "psi0 (z=0)", &surf1, 1.2, draw_bound ) ;
748
749 Tenseur psi000 (psi00) ;
750 Tenseur d_psi0 = psi000.gradient() ;
751 //## d_psi0.change_triad(star.get_ref_triad()) ;
752
753 des_coupe_vect_z(d_psi0, 0, -3., 0.5, nzdes1, "Grad(psi0) (z=0)",
754 &surf1, 1.2, draw_bound ) ;
755
756 Vector tmp_witt = star(1).get_wit_w() ;
757 tmp_witt.annule(star(1).get_nzet(), mg1.get_nzone()-1) ;
758
759 tmp_witt.change_triad(star(1).get_mp().get_bvect_cart()) ;
760
761 Tenseur tmp_wit (star(1).get_mp(), 1, CON, star(1).get_mp().get_bvect_cart()) ;
762 tmp_wit.set_etat_qcq() ;
763 Cmp tmp_wit1 (tmp_witt(1)) ;
764 Cmp tmp_wit2 (tmp_witt(2)) ;
765 Cmp tmp_wit3 (tmp_witt(3)) ;
766 tmp_wit.set(0) = tmp_wit1 ;
767 tmp_wit.set(1) = tmp_wit2 ;
768 tmp_wit.set(2) = tmp_wit3 ;
769
770 des_coupe_vect_z(tmp_wit, 0, -3., 0.5, nzdes1, "W (z=0)",
771 &surf1, 1.2, draw_bound ) ;
772
773 }
774
775 // Cleaning
776 // --------
777
778 delete peos1 ;
779 delete peos2 ;
780
781 return EXIT_SUCCESS ;
782
783 }