| 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/Bin_star/lit_bin.C,v 1.12 2014/10/13 08:53:54 j_novak Exp $" ; |
| 29 |
|
| 30 |
/* |
| 31 |
* $Id: lit_bin.C,v 1.12 2014/10/13 08:53:54 j_novak Exp $ |
| 32 |
* $Log: lit_bin.C,v $ |
| 33 |
* Revision 1.12 2014/10/13 08:53:54 j_novak |
| 34 |
* Lorene classes and functions now belong to the namespace Lorene. |
| 35 |
* |
| 36 |
* Revision 1.11 2014/10/06 15:09:43 j_novak |
| 37 |
* Modified #include directives to use c++ syntax. |
| 38 |
* |
| 39 |
* Revision 1.10 2008/11/14 13:55:44 e_gourgoulhon |
| 40 |
* Added more outputs in the case of more than one domain inside the |
| 41 |
* stars. |
| 42 |
* |
| 43 |
* Revision 1.9 2004/03/25 12:35:37 j_novak |
| 44 |
* now using namespace Unites |
| 45 |
* |
| 46 |
* Revision 1.8 2003/09/18 07:31:49 e_gourgoulhon |
| 47 |
* -- Test of good opening of files |
| 48 |
* -- Suppressed the call to des_explorer_symz |
| 49 |
* -- Enlarged view of log(N) in the z=0 plane |
| 50 |
* |
| 51 |
* Revision 1.7 2003/09/16 09:17:15 e_gourgoulhon |
| 52 |
* Changed the name of the output file "seq.d" to "resformat0.d". |
| 53 |
* |
| 54 |
* Revision 1.6 2003/09/15 15:11:25 e_gourgoulhon |
| 55 |
* Added the creation of file "seq.d" by a call to Binaire::write_global. |
| 56 |
* |
| 57 |
* Revision 1.5 2003/09/08 08:21:43 e_gourgoulhon |
| 58 |
* Added printing out of the virial errors in the relativistic case. |
| 59 |
* |
| 60 |
* Revision 1.4 2003/09/07 22:11:24 e_gourgoulhon |
| 61 |
* Corrected a bug at the end (introduced new vectors tmp_dpsi and |
| 62 |
* tmp_wit for drawings in the irrotational case). |
| 63 |
* |
| 64 |
* Revision 1.3 2003/01/09 11:07:49 j_novak |
| 65 |
* headcpp.h is now compliant with C++ norm. |
| 66 |
* The include files have been ordered, as well as the local_settings_linux |
| 67 |
* |
| 68 |
* Revision 1.2 2002/06/10 10:06:36 f_limousin |
| 69 |
* "void main" changed to "int main". |
| 70 |
* |
| 71 |
* Revision 1.1.1.1 2001/11/20 15:19:31 e_gourgoulhon |
| 72 |
* LORENE |
| 73 |
* |
| 74 |
* Revision 1.17 2001/04/17 11:34:26 eric |
| 75 |
* Modif determination x,y,zdes_min,max (adaptation au cas de |
| 76 |
* deux etoiles differentes). |
| 77 |
* |
| 78 |
* Revision 1.16 2001/03/07 10:58:40 eric |
| 79 |
* Appel de des_explorer_symz (pour dessiner des etoiles completes) |
| 80 |
* Annulation des champs de vitesse dans les zones externes. |
| 81 |
* |
| 82 |
* Revision 1.15 2000/12/20 10:27:21 eric |
| 83 |
* Ajout de la sortie dans le fichier "enthalpy.d" de l'enthalpie pour |
| 84 |
* un examen des valeurs point par point. |
| 85 |
* |
| 86 |
* Revision 1.14 2000/07/07 14:17:30 eric |
| 87 |
* Appel de la nouvelle fonction Binaire::display_poly pour l'affichage |
| 88 |
* des quantites en unites polytropiques. |
| 89 |
* |
| 90 |
* Revision 1.13 2000/07/06 10:23:56 eric |
| 91 |
* Ajout affichage barycentre dans les quantites polytropiques. |
| 92 |
* |
| 93 |
* Revision 1.12 2000/06/22 16:13:14 eric |
| 94 |
* Ameliorations diverses. |
| 95 |
* |
| 96 |
* Revision 1.11 2000/06/21 16:09:39 keisuke |
| 97 |
* Suppress the lines for the boundaries of second domains. |
| 98 |
* |
| 99 |
* Revision 1.10 2000/06/11 15:52:15 keisuke |
| 100 |
* Add a few figures for the baryon density. |
| 101 |
* |
| 102 |
* Revision 1.9 2000/03/22 10:32:18 eric |
| 103 |
* Appel de raccord_c1 sur surf1 et surf2 avant le dessin. |
| 104 |
* |
| 105 |
* Revision 1.8 2000/03/15 13:16:07 eric |
| 106 |
* Changement de l'ordre des dessins. |
| 107 |
* |
| 108 |
* Revision 1.7 2000/03/13 17:05:51 eric |
| 109 |
* Ajout de la verification des equations de constrainte. |
| 110 |
* |
| 111 |
* Revision 1.6 2000/03/08 14:46:18 eric |
| 112 |
* Dessin des quantites relativistes. |
| 113 |
* |
| 114 |
* Revision 1.5 2000/03/02 10:32:04 eric |
| 115 |
* Affichage des mappings. |
| 116 |
* Introduction des champs surf1 et surf2 pour definir les surfaces des |
| 117 |
* etoiles (plutot que de prendre directement l'enthalpie) |
| 118 |
* Dessins de champs de vecteurs. |
| 119 |
* |
| 120 |
* Revision 1.4 2000/02/18 15:50:06 eric |
| 121 |
* Affichage des quantites globales a la fin. |
| 122 |
* |
| 123 |
* Revision 1.3 2000/02/17 19:58:14 eric |
| 124 |
* Modif affichage |
| 125 |
* |
| 126 |
* Revision 1.2 2000/02/12 12:01:30 eric |
| 127 |
* *** empty log message *** |
| 128 |
* |
| 129 |
* Revision 1.1 2000/02/12 11:53:15 eric |
| 130 |
* Initial revision |
| 131 |
* |
| 132 |
* |
| 133 |
* $Header: /cvsroot/Lorene/Codes/Bin_star/lit_bin.C,v 1.12 2014/10/13 08:53:54 j_novak Exp $ |
| 134 |
* |
| 135 |
*/ |
| 136 |
// headers C |
| 137 |
#include <cstdlib> |
| 138 |
#include <cmath> |
| 139 |
#include <cstring> |
| 140 |
|
| 141 |
// headers Lorene |
| 142 |
#include "binaire.h" |
| 143 |
#include "eos.h" |
| 144 |
#include "utilitaires.h" |
| 145 |
#include "graphique.h" |
| 146 |
#include "unites.h" |
| 147 |
|
| 148 |
namespace Lorene { |
| 149 |
// Local prototype |
| 150 |
Cmp raccord_c1(const Cmp& uu, int l1) ; |
| 151 |
} |
| 152 |
//****************************************************************************** |
| 153 |
|
| 154 |
using namespace Lorene ; |
| 155 |
|
| 156 |
int main(int argc, char** argv){ |
| 157 |
|
| 158 |
using namespace Unites ; |
| 159 |
// Identification of all the subroutines called by the code : |
| 160 |
|
| 161 |
// system("ident lit_bin") ; |
| 162 |
|
| 163 |
if (argc < 2) { |
| 164 |
cout << |
| 165 |
"lit_bin : the name of a file containing a binary configuration" |
| 166 |
<< endl << " must be given in argument !" << endl ; |
| 167 |
abort() ; |
| 168 |
} |
| 169 |
|
| 170 |
char* nomresu = argv[1] ; |
| 171 |
cout << "Name of the file to be read : " << nomresu << endl ; |
| 172 |
|
| 173 |
cout << endl << |
| 174 |
"Do you want to draw the boundaries of the various domains (y/n) ? [y]" |
| 175 |
<< endl ; |
| 176 |
char rep ; |
| 177 |
cin.get(rep) ; |
| 178 |
bool draw_bound = !(rep == 'n') ; |
| 179 |
|
| 180 |
|
| 181 |
FILE* fich = fopen(nomresu, "r") ; |
| 182 |
if (fich == 0x0) { |
| 183 |
cout << "Problem in opening the file " << nomresu << " ! " << endl ; |
| 184 |
perror(" reason") ; |
| 185 |
abort() ; |
| 186 |
} |
| 187 |
|
| 188 |
|
| 189 |
int mer ; |
| 190 |
fread(&mer, sizeof(int), 1, fich) ; // mer |
| 191 |
|
| 192 |
Mg3d mg1(fich) ; |
| 193 |
Map_et mp1(mg1, fich) ; |
| 194 |
Eos* peos1 = Eos::eos_from_file(fich) ; |
| 195 |
|
| 196 |
Mg3d mg2(fich) ; |
| 197 |
Map_et mp2(mg2, fich) ; |
| 198 |
Eos* peos2 = Eos::eos_from_file(fich) ; |
| 199 |
|
| 200 |
Binaire star(mp1, *peos1, mp2, *peos2, fich) ; |
| 201 |
|
| 202 |
fclose(fich) ; |
| 203 |
|
| 204 |
bool relativistic = star(1).is_relativistic() ; |
| 205 |
bool irrotational = star(1).is_irrotational() ; |
| 206 |
|
| 207 |
cout << endl << "Grid on which star 1 is defined : " << endl ; |
| 208 |
cout << "=============================== " << endl ; |
| 209 |
cout << *((star(1).get_mp()).get_mg()) << endl ; |
| 210 |
|
| 211 |
cout << endl << "Grid on which star 2 is defined : " << endl ; |
| 212 |
cout << "=============================== " << endl ; |
| 213 |
cout << *((star(2).get_mp()).get_mg()) << endl ; |
| 214 |
|
| 215 |
cout << endl << "Mapping on which star 1 is defined : " << endl ; |
| 216 |
cout << "================================== " << endl ; |
| 217 |
cout << star(1).get_mp() << endl ; |
| 218 |
|
| 219 |
des_map_et(mp1, 0) ; |
| 220 |
des_map_et(mp1, 1) ; |
| 221 |
|
| 222 |
cout << endl << "Mapping on which star 2 is defined : " << endl ; |
| 223 |
cout << "================================== " << endl ; |
| 224 |
cout << star(2).get_mp() << endl ; |
| 225 |
|
| 226 |
for (int i=1; i<=2; i++) { |
| 227 |
(star.set(i)).update_metric(star(3-i)) ; |
| 228 |
} |
| 229 |
|
| 230 |
for (int i=1; i<=2; i++) { |
| 231 |
(star.set(i)).update_metric_der_comp(star(3-i)) ; |
| 232 |
} |
| 233 |
|
| 234 |
for (int i=1; i<=2; i++) { |
| 235 |
(star.set(i)).equation_of_state() ; |
| 236 |
(star.set(i)).kinematics(star.get_omega(), star.get_x_axe()) ; |
| 237 |
(star.set(i)).fait_d_psi() ; |
| 238 |
(star.set(i)).hydro_euler() ; |
| 239 |
} |
| 240 |
|
| 241 |
cout << "Binary system read in file : " << endl ; |
| 242 |
cout << star << endl ; |
| 243 |
star.display_poly(cout) ; // Reduced quantities for polytropic EOS |
| 244 |
|
| 245 |
cout << "ADM mass [M_sol] : " << star.mass_adm() / msol << endl ; |
| 246 |
cout << "Total energy [M_sol c^2] : " |
| 247 |
<< star.total_ener() / msol << endl ; |
| 248 |
cout << "Total angular momentum [M_sol c km] : " |
| 249 |
<< (star.angu_mom())(2) / msol / km << endl ; |
| 250 |
|
| 251 |
if ( relativistic ) { |
| 252 |
cout << "Relative error on the virial theorem : " << endl ; |
| 253 |
cout << " VE(M)= " << star.virial() |
| 254 |
<< " VE(GB)= "<< star.virial_gb() |
| 255 |
<< " VE(FUS)= " << star.virial_fus() << endl ; |
| 256 |
} |
| 257 |
else { |
| 258 |
cout << "Relative error on the virial theorem : " |
| 259 |
<< star.virial() << endl ; |
| 260 |
} |
| 261 |
|
| 262 |
cout << "Relative error in the Hamiltonian constraint : " << endl ; |
| 263 |
cout << star.ham_constr() << endl ; |
| 264 |
|
| 265 |
cout << "Relative error in the momentum constraint : " << endl ; |
| 266 |
cout << " X component : " << star.mom_constr()(0) << endl ; |
| 267 |
cout << " Y component : " << star.mom_constr()(1) << endl ; |
| 268 |
cout << " Z component : " << star.mom_constr()(2) << endl ; |
| 269 |
|
| 270 |
|
| 271 |
ofstream seqfich("resformat0.d") ; |
| 272 |
if ( !seqfich.good() ) { |
| 273 |
cout << "lit_bin : problem with opening the file resformat0.d !" << endl ; |
| 274 |
abort() ; |
| 275 |
} |
| 276 |
star.write_global(seqfich) ; |
| 277 |
seqfich.close() ; |
| 278 |
|
| 279 |
|
| 280 |
if (star(1).get_nzet() > 1) { |
| 281 |
cout.precision(10) ; |
| 282 |
|
| 283 |
for (int ltrans = 0; ltrans < star(1).get_nzet()-1; ltrans++) { |
| 284 |
cout << endl << "Star 1 : values at boundary between domains no. " << ltrans << " and " << ltrans+1 << " for theta = pi/2 and phi = 0 :" << endl ; |
| 285 |
|
| 286 |
double rt1 = star(1).get_mp().val_r(ltrans, 1., M_PI/2, 0.) ; |
| 287 |
double rt2 = star(1).get_mp().val_r(ltrans+1, -1., M_PI/2, 0.) ; |
| 288 |
double diff_rt = (rt2 - rt1)/rt1 ; |
| 289 |
cout << " Coord. r [km] (left, right, rel. diff) : " |
| 290 |
<< rt1 / km << " " << rt2 / km << " " << diff_rt << endl ; |
| 291 |
|
| 292 |
int ntm1 = star(1).get_mp().get_mg()->get_nt(ltrans) - 1; |
| 293 |
int nrm1 = star(1).get_mp().get_mg()->get_nr(ltrans) - 1 ; |
| 294 |
double ent1 = star(1).get_ent()()(ltrans, 0, ntm1, nrm1) ; |
| 295 |
double ent2 = star(1).get_ent()()(ltrans+1, 0, ntm1, 0) ; |
| 296 |
double diff_ent = (ent2-ent1)/ent1 ; |
| 297 |
cout << " Enthalpy (left, right, rel. diff) : " |
| 298 |
<< ent1 << " " << ent2 << " " << diff_ent << endl ; |
| 299 |
|
| 300 |
double press1 = star(1).get_press()()(ltrans, 0, ntm1, nrm1) ; |
| 301 |
double press2 = star(1).get_press()()(ltrans+1, 0, ntm1, 0) ; |
| 302 |
double diff_press = (press2-press1)/press1 ; |
| 303 |
cout << " Pressure (left, right, rel. diff) : " |
| 304 |
<< press1 << " " << press2 << " " << diff_press << endl ; |
| 305 |
|
| 306 |
double nb1 = star(1).get_nbar()()(ltrans, 0, ntm1, nrm1) ; |
| 307 |
double nb2 = star(1).get_nbar()()(ltrans+1, 0, ntm1, 0) ; |
| 308 |
double diff_nb = (nb2-nb1)/nb1 ; |
| 309 |
cout << " Baryon density (left, right, rel. diff) : " |
| 310 |
<< nb1 << " " << nb2 << " " << diff_nb << endl ; |
| 311 |
} |
| 312 |
|
| 313 |
double r_max = 1.2 * star(1).ray_eq() ; |
| 314 |
des_profile(star(1).get_nbar()(), 0., r_max, M_PI/2, 0., "n", "Baryon density") ; |
| 315 |
des_profile(star(1).get_ener()(), 0., r_max, M_PI/2, 0., "e", "Energy density") ; |
| 316 |
des_profile(star(1).get_press()(), 0., r_max, M_PI/2, 0., "p", "Pressure") ; |
| 317 |
// des_profile(star(1).get_ent()(), 0., r_max, M_PI/2, 0., "H", "Enthalpy") ; |
| 318 |
|
| 319 |
} |
| 320 |
|
| 321 |
|
| 322 |
//============================================================== |
| 323 |
// Drawings |
| 324 |
//============================================================== |
| 325 |
|
| 326 |
|
| 327 |
|
| 328 |
// des_explorer_symz(star, "latbin") ; |
| 329 |
|
| 330 |
int nzdes1 = star(1).get_nzet() ; |
| 331 |
|
| 332 |
double ori_x1 = star(1).get_mp().get_ori_x() ; |
| 333 |
double ori_x2 = star(2).get_mp().get_ori_x() ; |
| 334 |
|
| 335 |
double xdes_min = - 1.5 * star(1).ray_eq_pi() + ori_x1 ; |
| 336 |
xdes_min += 0.2 * xdes_min ; |
| 337 |
double xdes_max = 1.5 * star(2).ray_eq_pi() + ori_x2 ; |
| 338 |
xdes_max += 0.2 * fabs(xdes_min) ; |
| 339 |
|
| 340 |
double ydes_min1 = - 4. * star(1).ray_eq_pis2() ; |
| 341 |
double ydes_min2 = - 4. * star(2).ray_eq_pis2() ; |
| 342 |
double ydes_min = (ydes_min1 < ydes_min2) ? ydes_min1 : ydes_min2 ; |
| 343 |
|
| 344 |
double ydes_max1 = 4. * star(1).ray_eq_pis2() ; |
| 345 |
double ydes_max2 = 4. * star(2).ray_eq_pis2() ; |
| 346 |
double ydes_max = (ydes_max1 > ydes_max2) ? ydes_max1 : ydes_max2 ; |
| 347 |
|
| 348 |
double zdes_min1 = - 4. * star(1).ray_pole() ; |
| 349 |
double zdes_min2 = - 4. * star(2).ray_pole() ; |
| 350 |
double zdes_min = (zdes_min1 < zdes_min2) ? zdes_min1 : zdes_min2 ; |
| 351 |
|
| 352 |
double zdes_max1 = 4. * star(1).ray_pole() ; |
| 353 |
double zdes_max2 = 4. * star(2).ray_pole() ; |
| 354 |
double zdes_max = (zdes_max1 > zdes_max2) ? zdes_max1 : zdes_max2 ; |
| 355 |
|
| 356 |
Cmp surf1 = star(1).get_ent()() ; |
| 357 |
Cmp surf1_ext(mp1) ; |
| 358 |
surf1_ext = - 0.2 * surf1(0, 0, 0, 0) ; |
| 359 |
surf1_ext.annule(0, star(1).get_nzet()-1) ; |
| 360 |
surf1.annule(star(1).get_nzet(), mg1.get_nzone()-1) ; |
| 361 |
surf1 = surf1 + surf1_ext ; |
| 362 |
surf1 = raccord_c1(surf1, star(1).get_nzet()) ; |
| 363 |
|
| 364 |
Cmp surf2 = star(2).get_ent()() ; |
| 365 |
Cmp surf2_ext(mp2) ; |
| 366 |
surf2_ext = - 0.2 * surf2(0, 0, 0, 0) ; |
| 367 |
surf2_ext.annule(0, star(2).get_nzet()-1) ; |
| 368 |
surf2.annule(star(2).get_nzet(), mg2.get_nzone()-1) ; |
| 369 |
surf2 = surf2 + surf2_ext ; |
| 370 |
|
| 371 |
surf2 = raccord_c1(surf2, star(2).get_nzet()) ; |
| 372 |
|
| 373 |
char title[80] ; |
| 374 |
char bslash[2] = {92, '\0'} ; // 92 is the ASCII code for backslash |
| 375 |
|
| 376 |
ofstream fent("enthalpy.d") ; |
| 377 |
if ( !fent.good() ) { |
| 378 |
cout << "lit_bin : problem with opening the file enthalpy.d !" << endl ; |
| 379 |
abort() ; |
| 380 |
} |
| 381 |
|
| 382 |
fent << "Enthalpy field at the boundary of last inner domain of star 1 : " |
| 383 |
<< endl ; |
| 384 |
int lzet = star(1).get_nzet() - 1 ; |
| 385 |
for (int k=0; k<mg1.get_np(lzet); k++) { |
| 386 |
fent << "k = " << k << " : " ; |
| 387 |
for (int j=0; j<mg1.get_nt(lzet); j++) { |
| 388 |
fent |
| 389 |
<< " " << star(1).get_ent()()(lzet, k, j, mg1.get_nr(lzet)-1) ; |
| 390 |
} |
| 391 |
fent << endl ; |
| 392 |
} |
| 393 |
|
| 394 |
fent << endl << "enthalpy field of star 1 : " << endl ; |
| 395 |
fent << star(1).get_ent() << endl ; |
| 396 |
fent.close() ; |
| 397 |
|
| 398 |
des_coupe_z(star(1).get_ent()(), 0., 1, |
| 399 |
"Enthalpy (z=0)", &surf1, 1.2, draw_bound ) ; |
| 400 |
|
| 401 |
des_coupe_y(star(1).get_ent()(), 0., 1, |
| 402 |
"Enthalpy (y=0)", &surf1, 1.2, draw_bound ) ; |
| 403 |
|
| 404 |
|
| 405 |
des_profile (star(1).get_ent()(), 0., 2* star(1).ray_eq(), 0., 0., |
| 406 |
"H", "H (theta=0)" ) ; |
| 407 |
|
| 408 |
des_profile (star(1).get_ent()(), 0., 2* star(1).ray_eq(), M_PI/2., M_PI/2., |
| 409 |
"H", "H (theta=pi/2, phi=pi/2)" ) ; |
| 410 |
|
| 411 |
|
| 412 |
//========================================== |
| 413 |
// Metric quantities |
| 414 |
//========================================== |
| 415 |
|
| 416 |
//---------------------------- |
| 417 |
// ln(N) |
| 418 |
//---------------------------- |
| 419 |
|
| 420 |
Tenseur logn1 = - star(1).get_logn_auto() ; |
| 421 |
Tenseur logn2 = - star(2).get_logn_auto() ; |
| 422 |
|
| 423 |
des_coupe_bin_y(logn1(), logn2(), 0, |
| 424 |
xdes_min, xdes_max, zdes_min, zdes_max, |
| 425 |
"ln(N) (y=0)", &surf1, &surf2, draw_bound ) ; |
| 426 |
|
| 427 |
des_coupe_bin_z(logn1(), logn2(), 0, |
| 428 |
xdes_min, xdes_max, ydes_min, ydes_max, |
| 429 |
"ln(N) (z=0)", &surf1, &surf2, draw_bound ) ; |
| 430 |
|
| 431 |
double xdes_min_large = 2 * xdes_min ; |
| 432 |
double xdes_max_large = 2 * xdes_max ; |
| 433 |
double ydes_min_large = 2 * ydes_min ; |
| 434 |
double ydes_max_large = 2 * ydes_max ; |
| 435 |
|
| 436 |
des_coupe_bin_z(logn1(), logn2(), 0, |
| 437 |
xdes_min_large, xdes_max_large, ydes_min_large, ydes_max_large, |
| 438 |
"ln(N) (z=0)", &surf1, &surf2, draw_bound ) ; |
| 439 |
|
| 440 |
des_coupe_bin_x(logn1(), logn2(), |
| 441 |
ori_x1, ydes_min, ydes_max, zdes_min, zdes_max, |
| 442 |
"ln(N) (x=x1)", &surf1, 0x0, draw_bound ) ; |
| 443 |
|
| 444 |
|
| 445 |
if (relativistic) { |
| 446 |
|
| 447 |
//-------------- |
| 448 |
// Shift vector |
| 449 |
//-------------- |
| 450 |
des_vect_bin_z(star(1).get_shift_auto(), star(2).get_shift_auto(), 0., |
| 451 |
-2., 0.5, xdes_min, xdes_max, ydes_min, ydes_max, |
| 452 |
"Shift vector (z=0)", |
| 453 |
&surf1, &surf2, draw_bound ) ; |
| 454 |
|
| 455 |
//---------------------------- |
| 456 |
// Extrinsic curvature tensor |
| 457 |
//---------------------------- |
| 458 |
|
| 459 |
Tenseur tkij1 = star(1).get_tkij_auto() ; |
| 460 |
Tenseur tkij2 = star(2).get_tkij_auto() ; |
| 461 |
|
| 462 |
// Division by r^2 in the external compactified domain in order to get |
| 463 |
// A^2 K^{ij} : |
| 464 |
tkij1.dec2_dzpuis() ; |
| 465 |
tkij2.dec2_dzpuis() ; |
| 466 |
|
| 467 |
char debtit[] = {'A', 92, 'u', '2', 92, 'd', ' ', 'K', 92, 'u', '\0'} ; |
| 468 |
|
| 469 |
strcpy(title, debtit) ; |
| 470 |
strcat(title, "xx") ; |
| 471 |
strcat(title, bslash) ; |
| 472 |
strcat(title, "d (z=0)") ; |
| 473 |
|
| 474 |
des_coupe_bin_z(tkij1(0, 0), tkij2(0, 0), 0, |
| 475 |
xdes_min, xdes_max, ydes_min, ydes_max, |
| 476 |
title, &surf1, &surf2, draw_bound ) ; |
| 477 |
|
| 478 |
strcpy(title, debtit) ; |
| 479 |
strcat(title, "xy") ; |
| 480 |
strcat(title, bslash) ; |
| 481 |
strcat(title, "d (z=0)") ; |
| 482 |
|
| 483 |
des_coupe_bin_z(tkij1(0, 1), tkij2(0, 1), 0, |
| 484 |
xdes_min, xdes_max, ydes_min, ydes_max, |
| 485 |
title, &surf1, &surf2, draw_bound ) ; |
| 486 |
|
| 487 |
strcpy(title, debtit) ; |
| 488 |
strcat(title, "xz") ; |
| 489 |
strcat(title, bslash) ; |
| 490 |
strcat(title, "d (y=0)") ; |
| 491 |
|
| 492 |
des_coupe_bin_y(tkij1(0, 2), tkij2(0, 2), 0, |
| 493 |
xdes_min, xdes_max, ydes_min, ydes_max, |
| 494 |
title, &surf1, &surf2, draw_bound ) ; |
| 495 |
|
| 496 |
strcpy(title, debtit) ; |
| 497 |
strcat(title, "yy") ; |
| 498 |
strcat(title, bslash) ; |
| 499 |
strcat(title, "d (z=0)") ; |
| 500 |
|
| 501 |
des_coupe_bin_z(tkij1(1, 1), tkij2(1, 1), 0, |
| 502 |
xdes_min, xdes_max, ydes_min, ydes_max, |
| 503 |
title, &surf1, &surf2, draw_bound ) ; |
| 504 |
|
| 505 |
strcpy(title, debtit) ; |
| 506 |
strcat(title, "yz") ; |
| 507 |
strcat(title, bslash) ; |
| 508 |
strcat(title, "d (y=0)") ; |
| 509 |
|
| 510 |
des_coupe_bin_y(tkij1(1, 2), tkij2(1, 2), 0, |
| 511 |
xdes_min, xdes_max, ydes_min, ydes_max, |
| 512 |
title, &surf1, &surf2, draw_bound ) ; |
| 513 |
|
| 514 |
strcpy(title, debtit) ; |
| 515 |
strcat(title, "zz") ; |
| 516 |
strcat(title, bslash) ; |
| 517 |
strcat(title, "d (z=0)") ; |
| 518 |
|
| 519 |
des_coupe_bin_z(tkij1(2, 2), tkij2(2, 2), 0, |
| 520 |
xdes_min, xdes_max, ydes_min, ydes_max, |
| 521 |
title, &surf1, &surf2, draw_bound ) ; |
| 522 |
|
| 523 |
|
| 524 |
//---------------------------- |
| 525 |
// Term A^2 K_ij K^ij |
| 526 |
//---------------------------- |
| 527 |
|
| 528 |
Tenseur akcar1 = star(1).get_akcar_auto() ; |
| 529 |
Tenseur akcar2 = star(2).get_akcar_auto() ; |
| 530 |
|
| 531 |
// Division by r^4 in the external compactified domain in order to get |
| 532 |
// A^2 K_ij K^{ij} : |
| 533 |
akcar1.dec2_dzpuis() ; |
| 534 |
akcar1.dec2_dzpuis() ; |
| 535 |
akcar2.dec2_dzpuis() ; |
| 536 |
akcar2.dec2_dzpuis() ; |
| 537 |
|
| 538 |
char title1[80] ; |
| 539 |
strcpy(title1, debtit) ; |
| 540 |
strcat(title1, "ij") ; |
| 541 |
strcat(title1, bslash) ; |
| 542 |
strcat(title1, "d K") ; |
| 543 |
strcat(title1, bslash) ; |
| 544 |
strcat(title1, "dij") ; |
| 545 |
strcat(title1, bslash) ; |
| 546 |
|
| 547 |
strcpy(title, title1) ; |
| 548 |
strcat(title, "u (x=x1)") ; |
| 549 |
|
| 550 |
des_coupe_bin_x(akcar1(), akcar2(), ori_x1, |
| 551 |
ydes_min, ydes_max, zdes_min, zdes_max, |
| 552 |
title, &surf1, 0x0, draw_bound ) ; |
| 553 |
|
| 554 |
strcpy(title, title1) ; |
| 555 |
strcat(title, "u (y=0)") ; |
| 556 |
|
| 557 |
des_coupe_bin_y(akcar1(), akcar2(), 0, |
| 558 |
xdes_min, xdes_max, zdes_min, zdes_max, |
| 559 |
title, &surf1, &surf2, draw_bound ) ; |
| 560 |
|
| 561 |
strcpy(title, title1) ; |
| 562 |
strcat(title, "u (z=0)") ; |
| 563 |
|
| 564 |
des_coupe_bin_z(akcar1(), akcar2(), 0, |
| 565 |
xdes_min, xdes_max, ydes_min, ydes_max, |
| 566 |
title, &surf1, &surf2, draw_bound ) ; |
| 567 |
|
| 568 |
//---------------------------- |
| 569 |
// beta = ln(AN) |
| 570 |
//---------------------------- |
| 571 |
|
| 572 |
Tenseur beta1 = - star(1).get_beta_auto() ; |
| 573 |
Tenseur beta2 = - star(2).get_beta_auto() ; |
| 574 |
|
| 575 |
des_coupe_bin_x(beta1(), beta2(), |
| 576 |
ori_x1, ydes_min, ydes_max, zdes_min, zdes_max, |
| 577 |
"ln(AN) (x=x1)", &surf1, 0x0, draw_bound ) ; |
| 578 |
|
| 579 |
des_coupe_bin_y(beta1(), beta2(), 0, |
| 580 |
xdes_min, xdes_max, zdes_min, zdes_max, |
| 581 |
"ln(AN) (y=0)", &surf1, &surf2, draw_bound ) ; |
| 582 |
|
| 583 |
des_coupe_bin_z(beta1(), beta2(), 0, |
| 584 |
xdes_min, xdes_max, ydes_min, ydes_max, |
| 585 |
"ln(AN) (z=0)", &surf1, &surf2, draw_bound ) ; |
| 586 |
|
| 587 |
} |
| 588 |
|
| 589 |
//========================================== |
| 590 |
// Hydro quantities |
| 591 |
//========================================== |
| 592 |
|
| 593 |
|
| 594 |
des_coupe_bin_z(star(1).get_nbar()(), star(2).get_nbar()(), 0, |
| 595 |
xdes_min, xdes_max, ydes_min, ydes_max, |
| 596 |
"Baryon density (z=0)", |
| 597 |
&surf1, &surf2, draw_bound ) ; |
| 598 |
|
| 599 |
des_coupe_bin_y(star(1).get_nbar()(), star(2).get_nbar()(), 0, |
| 600 |
xdes_min, xdes_max, zdes_min, zdes_max, |
| 601 |
"Baryon density (y=0)", |
| 602 |
&surf1, &surf2, draw_bound ) ; |
| 603 |
|
| 604 |
des_coupe_z(star(1).get_nbar()(), 0., 1, |
| 605 |
"Baryon density (z=0)", &surf1, 1.2, draw_bound ) ; |
| 606 |
|
| 607 |
des_coupe_y(star(1).get_nbar()(), 0., 1, |
| 608 |
"Baryon density (y=0)", &surf1, 1.2, draw_bound ) ; |
| 609 |
|
| 610 |
if (irrotational) { |
| 611 |
Tenseur tmp_draw1 = star(1).get_wit_w() ; |
| 612 |
tmp_draw1.annule(star(1).get_nzet(), mg1.get_nzone()-1) ; |
| 613 |
Tenseur tmp_draw2 = star(2).get_wit_w() ; |
| 614 |
tmp_draw2.annule(star(2).get_nzet(), mg2.get_nzone()-1) ; |
| 615 |
|
| 616 |
des_vect_bin_z(tmp_draw1, tmp_draw2, 0., |
| 617 |
-3., 0.5, xdes_min, xdes_max, ydes_min, ydes_max, |
| 618 |
"Velocity w.r.t corotating frame (z=0)", |
| 619 |
&surf1, &surf2, draw_bound, 40, 40) ; |
| 620 |
} |
| 621 |
|
| 622 |
Tenseur tmp_draw1 = star(1).get_u_euler() ; |
| 623 |
tmp_draw1.annule(star(1).get_nzet(), mg1.get_nzone()-1) ; |
| 624 |
|
| 625 |
Tenseur tmp_draw2 = star(2).get_u_euler() ; |
| 626 |
tmp_draw2.annule(star(2).get_nzet(), mg2.get_nzone()-1) ; |
| 627 |
|
| 628 |
des_coupe_vect_x(tmp_draw1, mp1.get_ori_x(), -1., 0.5, nzdes1, |
| 629 |
"U (x=x1)", &surf1, 1.2, draw_bound ) ; |
| 630 |
|
| 631 |
des_vect_bin_z(tmp_draw1, tmp_draw2, 0., |
| 632 |
-2., 0.5, xdes_min, xdes_max, ydes_min, ydes_max, |
| 633 |
"U (z=0)", &surf1, &surf2, draw_bound, 40, 40) ; |
| 634 |
|
| 635 |
if (irrotational) { |
| 636 |
Tenseur tmp_dpsi = star(1).get_d_psi() ; |
| 637 |
tmp_dpsi.annule(star(1).get_nzet(), mg1.get_nzone()-1) ; |
| 638 |
des_coupe_vect_z(tmp_dpsi, 0, -1., 0.5, nzdes1, |
| 639 |
"Grad(psi) (z=0)", &surf1, 1.2, draw_bound ) ; |
| 640 |
|
| 641 |
des_coupe_z(star(1).get_psi0()(), 0., 1, |
| 642 |
"psi0 (z=0)", &surf1, 1.2, draw_bound ) ; |
| 643 |
|
| 644 |
Tenseur d_psi0 = star(1).get_psi0().gradient() ; |
| 645 |
//## d_psi0.change_triad(star.get_ref_triad()) ; |
| 646 |
|
| 647 |
des_coupe_vect_z(d_psi0, 0, -3., 0.5, nzdes1, "Grad(psi0) (z=0)", |
| 648 |
&surf1, 1.2, draw_bound ) ; |
| 649 |
|
| 650 |
Tenseur tmp_wit = star(1).get_wit_w() ; |
| 651 |
tmp_wit.annule(star(1).get_nzet(), mg1.get_nzone()-1) ; |
| 652 |
des_coupe_vect_z(tmp_wit, 0, -3., 0.5, nzdes1, "W (z=0)", |
| 653 |
&surf1, 1.2, draw_bound ) ; |
| 654 |
|
| 655 |
} |
| 656 |
|
| 657 |
// Cleaning |
| 658 |
// -------- |
| 659 |
|
| 660 |
delete peos1 ; |
| 661 |
delete peos2 ; |
| 662 |
|
| 663 |
return EXIT_SUCCESS ; |
| 664 |
|
| 665 |
} |