/usr/include/lorene/C++/Include/star.h is in liblorene-dev 0.0.0~cvs20161116+dfsg-1ubuntu4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 | /*
* Definition of Lorene classes Star, Star_bin and Star_bin_xcts
*
*/
/*
* Copyright (c) 2010 Michal Bejger
* Copyright (c) 2004 Francois Limousin
*
* Copyright (c) 2000-2001 Eric Gourgoulhon (for preceding class Etoile)
* Copyright (c) 2000-2001 Keisuke Taniguchi (for preceding class Etoile)
*
* This file is part of LORENE.
*
* LORENE is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* LORENE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LORENE; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef __STAR_H_
#define __STAR_H_
/*
* $Id: star.h,v 1.32 2014/10/13 08:52:36 j_novak Exp $
* $Log: star.h,v $
* Revision 1.32 2014/10/13 08:52:36 j_novak
* Lorene classes and functions now belong to the namespace Lorene.
*
* Revision 1.31 2010/12/09 10:36:42 m_bejger
* Decouple method removed from declaration in Star_bin_xcts
*
* Revision 1.30 2010/10/26 18:47:36 m_bejger
* Modification of Star_bin_xcts::equilibrium, added table fact_resize
*
* Revision 1.29 2010/10/18 19:11:53 m_bejger
* Changes to Star::equilibrium_spher and Star_bin_xcts::equilibrium to allow for calculations with more than one domain in the star
*
* Revision 1.28 2010/06/15 08:17:43 m_bejger
* Method Star_bin_xcts::set_chi_comp() declared
*
* Revision 1.27 2010/05/04 07:53:32 m_bejger
* Class Star_bin_xcts added (initial version)
*
* Revision 1.26 2010/03/29 12:00:25 e_gourgoulhon
* Removed lnq from documentation
* (lnq has to be removed from base class Star; it is meaningfull only
* for Star_bin).
*
* Revision 1.25 2010/01/24 16:07:45 e_gourgoulhon
* New class Star_rot.
*
* Revision 1.24 2007/11/06 16:22:03 j_novak
* The data member stress_euler is now a Sym_tensor instead of a Tensor.
*
* Revision 1.23 2007/06/21 19:48:25 k_taniguchi
* Introduction of a method to compute ray_eq_3pis2.
*
* Revision 1.22 2006/05/31 09:25:47 f_limousin
* Modif. of the size of the different domains
*
* Revision 1.21 2006/04/11 14:26:12 f_limousin
* New version of the code : improvement of the computation of some
* critical sources, estimation of the dirac gauge, helical symmetry...
*
* Revision 1.20 2005/09/15 15:56:28 e_gourgoulhon
* Made the documentation compliant with Doxygen.
*
* Revision 1.19 2005/09/13 19:38:32 f_limousin
* Reintroduction of the resolution of the equations in cartesian coordinates.
*
* Revision 1.18 2005/08/13 16:14:11 m_saijo
* Corrected the document of the total shift vector
*
* Revision 1.17 2005/04/08 12:36:45 f_limousin
* Just to avoid warnings...
*
* Revision 1.16 2005/02/24 16:09:29 f_limousin
* Change the name of some variables (for instance dcov_logn --> dlogn).
* Add also member dlnq but delete dlnpsi_auto and dlogn_auto.
*
* Revision 1.15 2005/02/17 17:28:18 f_limousin
* Change the name of some quantities to be consistent with other classes
* (for instance nnn is changed to nn, shift to beta, beta to lnq...)
*
* Revision 1.14 2005/02/11 18:11:16 f_limousin
* Introduction of a member Map_af in derived class Star_bin.
*
* Revision 1.13 2004/11/11 16:29:48 j_novak
* set_der_0x0 is no longer virtual (to be coherent with Tensor/Scalar classes).
*
* Revision 1.12 2004/11/10 16:31:53 j_novak
* Star is no longer an abstract class (mass_b and mass_g are no longer
* pure virtual). Modified comments to be readable by doxygen.
*
* Revision 1.11 2004/07/21 11:48:30 f_limousin
* Remove function sprod.
*
* Revision 1.10 2004/06/22 12:47:01 f_limousin
* Change qq, qq_auto and qq_comp to beta, beta_auto and beta_comp.
*
* Revision 1.9 2004/05/25 14:48:57 f_limousin
* Add a parameter for the function equilibrium.
*
* Revision 1.8 2004/03/23 09:53:50 f_limousin
* Minor changes
*
* Revision 1.7 2004/02/27 09:41:52 f_limousin
* Scalars ssjm1_logn, ssjm1_qq ... for all metric coefficients have been
* in class Star_bin for the resolution of Poisson equations.
* The class Star is now abstract : the computational routines mass_b()
* and mass_g() = 0.
*
* Revision 1.6 2004/01/22 10:06:33 f_limousin
* Add methods set_logn_comp() and set_shift_auto().
*
* Revision 1.5 2004/01/20 15:26:00 f_limousin
* New class star and star_bin.
*
*
* $Header: /cvsroot/Lorene/C++/Include/star.h,v 1.32 2014/10/13 08:52:36 j_novak Exp $
*
*/
// Headers Lorene
#include "tensor.h"
#include "metric.h"
namespace Lorene {
class Eos ;
//---------------------------//
// base class Star //
//---------------------------//
/**
* Base class for stars. \ingroup (star)
*
* A \c Star is constructed upon (i) a mapping
* (derived class of \c Map), the center of which defines the center of the
* star, and (ii) an equation of state (derived class of \c Eos).
* It contains tensor fields (class \c Tensor) which describe the
* hydrodynamical quantities as well as the gravitational field (spacetime
* metric).
*
* According to the 3+1 formalism, the spacetime metric is written
* \f[
* ds^2 = - N^2 dt^2 + \gamma_{ij} ( dx^i + \beta^i dt )
* (dx^j + \beta^j dt )
* \f]
* where \f$\gamma_{ij}\f$ is the 3-metric, described by a Lorene object of class \c Metric.
*
* The 3+1 formalism introduces two kinds of privileged observers: the
* fluid comoving observer and the Eulerian observer, whose 4-velocity
* is the unit future directed normal to the \e t = const hypersurfaces.
* The hydrodynamical quantities measured by the fluid observer correspond
* to the members \c ent, \c nbar, \c ener, and \c press.
* The hydrodynamical quantities measured by the Eulerian observer correspond
* to the members \c ener_euler, \c s_euler, \c gam_euler, and
* \c u_euler.
*
* \version $Id: star.h,v 1.32 2014/10/13 08:52:36 j_novak Exp $
*/
class Star {
// Data :
// -----
protected:
Map& mp ; ///< Mapping associated with the star
/// Number of domains of \c *mp occupied by the star
int nzet ;
const Eos& eos ; ///< Equation of state of the stellar matter
// Fluid quantities with respect to the fluid frame
// ------------------------------------------------
Scalar ent ; ///< Log-enthalpy
Scalar nbar ; ///< Baryon density in the fluid frame
Scalar ener ; ///< Total energy density in the fluid frame
Scalar press ; ///< Fluid pressure
// Fluid quantities with respect to the Eulerian frame
// ---------------------------------------------------
Scalar ener_euler ; ///< Total energy density in the Eulerian frame
/// Trace of the stress scalar in the Eulerian frame
Scalar s_euler ;
/// Lorentz factor between the fluid and Eulerian observers
Scalar gam_euler ;
/// Fluid 3-velocity with respect to the Eulerian observer
Vector u_euler ;
/** Spatial part of the stress-energy tensor with respect
* to the Eulerian observer.
*/
Sym_tensor stress_euler ;
// Metric potentials
// -----------------
/** Logarithm of the lapse \e N .
* In the Newtonian case,
* this is the Newtonian gravitational potential
* (in units of \f$c^2\f$).
*/
Scalar logn ;
/// Lapse function \e N .
Scalar nn ;
/// Shift vector.
Vector beta ;
// Scalar field \f$\ln Q = \ln(\psi^2 N)\f$
//## to be removed from base class Star
Scalar lnq ;
/// 3-metric
Metric gamma ;
// Derived data :
// ------------
protected:
/// Coordinate radius at \f$\phi=0\f$, \f$\theta=\pi/2\f$.
mutable double* p_ray_eq ;
/// Coordinate radius at \f$\phi=\pi/2\f$, \f$\theta=\pi/2\f$.
mutable double* p_ray_eq_pis2 ;
/// Coordinate radius at \f$\phi=\pi\f$, \f$\theta=\pi/2\f$.
mutable double* p_ray_eq_pi ;
/// Coordinate radius at \f$\phi=3\pi/2\f$, \f$\theta=\pi/2\f$.
mutable double* p_ray_eq_3pis2 ;
/// Coordinate radius at \f$\theta=0\f$.
mutable double* p_ray_pole ;
/** Description of the stellar surface: 2-D \c Itbl containing the
* values of the domain index \e l on the surface at the
* collocation points in \f$(\theta', \phi')\f$
*/
mutable Itbl* p_l_surf ;
/** Description of the stellar surface: 2-D \c Tbl containing the
* values of the radial coordinate \f$\xi\f$ on the surface at the
* collocation points in \f$(\theta', \phi')\f$
*/
mutable Tbl* p_xi_surf ;
mutable double* p_mass_b ; ///< Baryon mass
mutable double* p_mass_g ; ///< Gravitational mass
// Constructors - Destructor
// -------------------------
public:
/** Standard constructor.
*
* @param mp_i Mapping on which the star will be defined
* @param nzet_i Number of domains occupied by the star
* @param eos_i Equation of state of the stellar matter
*
*/
Star(Map& mp_i, int nzet_i, const Eos& eos_i) ;
Star(const Star& ) ; ///< Copy constructor
/** Constructor from a file (see \c sauve(FILE* )).
*
* @param mp_i Mapping on which the star will be defined
* @param eos_i Equation of state of the stellar matter
* @param fich input file (must have been created by the function
* \c sauve)
*/
Star(Map& mp_i, const Eos& eos_i, FILE* fich) ;
virtual ~Star() ; ///< Destructor
// Memory management
// -----------------
protected:
/// Deletes all the derived quantities
virtual void del_deriv() const ;
/// Sets to \c 0x0 all the pointers on derived quantities
virtual void set_der_0x0() const ;
/** Sets to \c ETATNONDEF (undefined state) the hydrodynamical
* quantities relative to the Eulerian observer.
*/
virtual void del_hydro_euler() ;
// Mutators / assignment
// ---------------------
public:
/// Assignment to another \c Star
void operator=(const Star&) ;
/// Read/write of the mapping
Map& set_mp() {return mp; } ;
/// Assignment of the enthalpy field.
void set_enthalpy(const Scalar& ) ;
/** Computes the proper baryon and energy density, as well as
* pressure from the enthalpy.
*/
void equation_of_state() ;
/** Computes the hydrodynamical quantities relative to the Eulerian
* observer from those in the fluid frame (\c nbar, \c ener
* and \c press).
*/
virtual void hydro_euler() ;
/** Computes a spherical static configuration.
*
* @param ent_c [input] central value of the enthalpy
* @param precis [input] threshold in the relative difference between
* the enthalpy fields of two consecutive steps
* to stop the iterative procedure (default value: 1.e-14)
* @param ent_limit [input] : array of enthalpy values to be set
* at the boundaries between the domains; if set to 0x0 (default),
* the initial values will be kept.
*/
virtual void equilibrium_spher(double ent_c, double precis = 1.e-14,
const Tbl* pent_limit = 0x0 ) ;
// Accessors
// ---------
public:
/// Returns the mapping
const Map& get_mp() const {return mp; } ;
/// Returns the number of domains occupied by the star
int get_nzet() const {return nzet; } ;
/// Returns the equation of state
const Eos& get_eos() const {return eos; } ;
/// Returns the enthalpy field
const Scalar& get_ent() const {return ent;} ;
/// Returns the proper baryon density
const Scalar& get_nbar() const {return nbar;} ;
/// Returns the proper total energy density
const Scalar& get_ener() const {return ener;} ;
/// Returns the fluid pressure
const Scalar& get_press() const {return press;} ;
/// Returns the total energy density with respect to the Eulerian observer
const Scalar& get_ener_euler() const {return ener_euler;} ;
/// Returns the trace of the stress tensor in the Eulerian frame
const Scalar& get_s_euler() const {return s_euler;} ;
/// Returns the Lorentz factor between the fluid and Eulerian observers
const Scalar& get_gam_euler() const {return gam_euler;} ;
/// Returns the fluid 3-velocity with respect to the Eulerian observer
const Vector& get_u_euler() const {return u_euler;} ;
/** Returns the spatial part of the stress-energy tensor
* with respect to the Eulerian observer
*/
const Tensor& get_stress_euler() const {return stress_euler;} ;
/** Returns the logarithm of the lapse \e N.
* In the Newtonian case, this is the Newtonian
* gravitational potential (in units of \f$c^2\f$).
*/
const Scalar& get_logn() const {return logn;} ;
/// Returns the lapse function \e N
const Scalar& get_nn() const {return nn;} ;
/// Returns the shift vector \f$\beta^i\f$.
const Vector& get_beta() const {return beta;} ;
// Returns the scalar field \f$\ln Q\f$.
//## to be removed from base class Star
const Scalar& get_lnq() const {return lnq;} ;
/// Returns the 3-metric \f$\gamma\f$.
const Metric& get_gamma() const {return gamma;} ;
// Outputs
// -------
public:
virtual void sauve(FILE* ) const ; ///< Save in a file
/// Display
friend ostream& operator<<(ostream& , const Star& ) ;
protected:
/// Operator >> (virtual function called by the operator <<).
virtual ostream& operator>>(ostream& ) const ;
// Global quantities
// -----------------
public:
/// Coordinate radius at \f$\phi=0\f$, \f$\theta=\pi/2\f$ [r_unit].
double ray_eq() const ;
/// Coordinate radius at \f$\phi=\pi/2\f$, \f$\theta=\pi/2\f$ [r_unit].
double ray_eq_pis2() const ;
/// Coordinate radius at \f$\phi=\pi\f$, \f$\theta=\pi/2\f$ [r_unit].
double ray_eq_pi() const ;
/// Coordinate radius at \f$\phi=3\pi/2\f$, \f$\theta=\pi/2\f$ [r_unit].
double ray_eq_3pis2() const ;
/// Coordinate radius at \f$\theta=0\f$ [r_unit].
double ray_pole() const ;
/** Description of the stellar surface: returns a 2-D \c Itbl
* containing the
* values of the domain index \e l on the surface at the
* collocation points in \f$(\theta', \phi')\f$.
* The stellar surface is defined as the location where
* the enthalpy (member \c ent) vanishes.
*/
virtual const Itbl& l_surf() const ;
/** Description of the stellar surface: returns a 2-D \c Tbl
* containing the values of the radial coordinate \f$\xi\f$
* on the surface at the
* collocation points in \f$(\theta', \phi')\f$.
* The stellar surface is defined as the location where
* the enthalpy (member \c ent) vanishes.
*/
const Tbl& xi_surf() const ;
/// Baryon mass
virtual double mass_b() const = 0 ;
/// Gravitational mass
virtual double mass_g() const = 0 ;
};
ostream& operator<<(ostream& , const Star& ) ;
//---------------------------//
// class Star_bin //
//---------------------------//
/**
* Class for stars in binary system. *** UNDER DEEVELOPMENT *** \ingroup (star)
*
* A \c Star_bin can be construted in two states, represented by
* the \c bool member \c irrotational: (i) irrotational
* (i.e. the fluid motion is irrotational) or (ii) rigidly corotating
* with respect to the orbital motion (synchronized binary).
*
* @version #$Id: star.h,v 1.32 2014/10/13 08:52:36 j_novak Exp $#
*/
class Star_bin : public Star {
// Data :
// -----
protected:
/** \c true for an irrotational star, \c false for a
* corotating one
*/
bool irrotational ;
/** Scalar potential \f$\Psi_0\f$ of the non-translational part of
* fluid 4-velocity (in the irrotational case)
*/
Scalar psi0 ;
/** Gradient of \f$\Psi\f$ (in the irrotational case)
* (Spherical components with respect to the mapping of the star)
*/
Vector d_psi ;
/** Spatial projection of the fluid 3-velocity with respect to
* the co-orbiting observer.
* (Spherical components with respect to the mapping of the star)
*/
Vector wit_w ;
/** Logarithm of the Lorentz factor between the fluid and
* the co-orbiting observer.
*/
Scalar loggam ;
/** 3-vector shift, divided by \e N, of the rotating coordinates,
* \f$\beta^i/N\f$.
* (Spherical components with respect to the mapping of the star)
*/
Vector bsn ;
/// Centrifugal potential
Scalar pot_centri ;
/** Part of the lapse logarithm (gravitational potential at the
* Newtonian limit) generated principally by the star.
*/
Scalar logn_auto ;
/** Part of the lapse logarithm (gravitational potential at the
* Newtonian limit) generated principally by the companion star.
*/
Scalar logn_comp ;
/// Covariant derivative of the total logarithm of the lapse.
Vector dcov_logn ;
/// Contravariant derivative of the total logarithm of the lapse.
Vector dcon_logn ;
/** Scalar field \f$ Q = \psi^2 N \f$ generated principally by the
* star.
*/
Scalar lnq_auto ;
/** Scalar field \f$ Q = \psi^2 N \f$ generated principally by the
* companion star.
*/
Scalar lnq_comp ;
/// Conformal factor \f$\psi^4\f$
Scalar psi4 ;
/// Covariant derivative of the logarithm of the conformal factor
Vector dcov_phi ;
/// Contravariant derivative of the logarithm of the conformal factor
Vector dcon_phi ;
/** Flat metric defined on the mapping (Spherical components
* with respect to the mapping of the star) .
*/
Metric_flat flat ;
/// Conformal metric \f$\tilde \gamma_{ij}\f$
Metric gtilde ;
/** Part of the shift vector generated principally by the star
* (Spherical components with respect to the mapping of the star)
*/
Vector beta_auto ;
/** Part of the shift vector generated principally by the star
* (Spherical components with respect to the mapping of the star)
*/
Vector beta_comp ;
/** Total deviation of the inverse conformal metric
* \f$\tilde \gamma^{ij}\f$ from the inverse flat metric.
*/
Sym_tensor hij ;
/** Deviation of the inverse conformal metric
* \f$\tilde \gamma^{ij}\f$ from the inverse flat metric generated
* principally by the star.
*/
Sym_tensor hij_auto ;
/** Deviation of the inverse conformal metric
* \f$\tilde \gamma^{ij}\f$ from the inverse flat metric generated
* principally by the companion star.
*/
Sym_tensor hij_comp ;
/** Part of the extrinsic curvature tensor \f$\tilde K^{ij}\f$
* generated by \c beta_auto.
* (Spherical components with respect to the mapping of the star)
*/
Sym_tensor tkij_auto ;
/** Part of the extrinsic curvature tensor \f$\tilde K^{ij}\f$
* generated by \c beta_comp.
* (Spherical components with respect to the mapping of the star)
*/
Sym_tensor tkij_comp ;
/** Part of the scalar \f$K_{ij} K^{ij}\f$
* generated by \c beta_auto, i.e.
* \f$K_{ij}^{\rm auto} K^{ij}_{\rm auto}\f$
*/
Scalar kcar_auto ;
/** Part of the scalar \f$K_{ij} K^{ij}\f$
* generated by \c beta_auto and \c beta_comp, i.e.
* \f$K_{ij}^{\rm auto} K^{ij}_{\rm comp}\f$
*/
Scalar kcar_comp ;
/** Effective source at the previous step for the resolution of
* the Poisson equation for \c logn_auto.
*/
Scalar ssjm1_logn ;
/** Effective source at the previous step for the resolution of
* the Poisson equation for \c lnq_auto.
*/
Scalar ssjm1_lnq ;
/** Effective source at the previous step for the resolution of
* the Poisson equation for \c khi. (second scalar equation
* for the resolution of the vectorial poisson equation for the shift)
*/
Scalar ssjm1_khi ;
Vector ssjm1_wbeta ;
/** Effective source at the previous step for the resolution of
* the Poisson equation for \c h00_auto.
*/
Scalar ssjm1_h11 ;
/** Effective source at the previous step for the resolution of
* the Poisson equation for \c h10_auto.
*/
Scalar ssjm1_h21 ;
/** Effective source at the previous step for the resolution of
* the Poisson equation for \c h20_auto.
*/
Scalar ssjm1_h31 ;
/** Effective source at the previous step for the resolution of
* the Poisson equation for \c h11_auto.
*/
Scalar ssjm1_h22 ;
/** Effective source at the previous step for the resolution of
* the Poisson equation for \c h21_auto.
*/
Scalar ssjm1_h32 ;
/** Effective source at the previous step for the resolution of
* the Poisson equation for \c h22_auto.
*/
Scalar ssjm1_h33 ;
/**
* Function used to construct the part \f$lnq_auto\f$ generated by
* the star from the total \f$lnq\f$.
* Mainly this \c Scalar is 1 around the star and 0 around
* the companion
* and the sum of \c decouple for the star and his companion is 1
* everywhere.
*/
Scalar decouple ;
/** \c true if the 3-metric is conformally flat, \c false
* for a more general metric.
*/
bool conf_flat ;
// Derived data :
// ------------
protected:
/// Absolute coordinate X of the barycenter of the baryon density
mutable double* p_xa_barycenter ;
// Constructors - Destructor
// -------------------------
public:
/** Standard constructor.
*
* @param mp_i Mapping on which the star will be defined
* @param nzet_i Number of domains occupied by the star
* @param eos_i Equation of state of the stellar matter
* @param irrot should be \c true for an irrotational star,
* \c false for a corotating one
* @param conf_flat should be \c true for a conformally flat metric
* \c false for a general one
*/
Star_bin(Map& mp_i, int nzet_i, const Eos& eos_i,
bool irrot, bool conf_flat) ;
Star_bin(const Star_bin& ) ; ///< Copy constructor
/** Constructor from a file (see \c sauve(FILE* )).
*
* @param mp_i Mapping on which the star will be defined
* @param eos_i Equation of state of the stellar matter
* @param fich input file (must have been created by the function
* \c sauve)
*/
Star_bin(Map& mp_i, const Eos& eos_i, FILE* fich) ;
virtual ~Star_bin() ; ///< Destructor
// Memory management
// -----------------
protected:
/// Deletes all the derived quantities
virtual void del_deriv() const ;
/// Sets to \c 0x0 all the pointers on derived quantities
virtual void set_der_0x0() const ;
/** Sets to \c ETATNONDEF (undefined state) the hydrodynamical
* quantities relative to the Eulerian observer.
*/
virtual void del_hydro_euler() ;
// Mutators / assignment
// ---------------------
public:
/// Assignment to another \c Star_bin
void operator=(const Star_bin& ) ;
/// Read/write the centrifugal potential
Scalar& set_pot_centri() ;
/** Read/write of the logarithm of the lapse generated
* principally by the companion.
*/
Scalar& set_logn_comp() ;
/// Assignment of a new logn_auto
void set_logn_auto(const Scalar& logn_auto_new) {logn_auto = logn_auto_new ;
return ;}
/// Assignment of a new lnq_auto
void set_lnq_auto(const Scalar& lnq_auto_new) {lnq_auto = lnq_auto_new ;
return ;}
/// Read/write of \f$beta_auto\f$
Vector& set_beta_auto() ;
/// Read/write of \f$beta\f$
Vector& set_beta() ;
/// Write if conformally flat
void set_conf_flat(bool confflat) {conf_flat = confflat ; return ;}
// Accessors
// ---------
public:
/** Returns \c true for an irrotational motion, \c false for
* a corotating one.
*/
bool is_irrotational() const {return irrotational; } ;
/// Returns the non-translational part of the velocity potential
const Scalar& get_psi0() const {return psi0;} ;
/** Returns the covariant derivative of the velocity potential
* (Spherical components with respect to the mapping of the star)
*/
const Vector& get_d_psi() const {return d_psi;} ;
/** Returns the spatial projection of the fluid 3-velocity with
* respect to the co-orbiting observer.
* (Spherical components with respect to the mapping of the star)
*/
const Vector& get_wit_w() const {return wit_w;} ;
/** Returns the logarithm of the Lorentz factor between the fluid and
* the co-orbiting observer.
*/
const Scalar& get_loggam() const {return loggam;} ;
/** Returns the shift vector, divided by \e N, of the rotating
* coordinates, \f$\beta^i/N\f$.
* (Spherical components with respect to the mapping of the star)
*/
const Vector& get_bsn() const {return bsn;} ;
/// Returns the centrifugal potential
const Scalar& get_pot_centri() const {return pot_centri;} ;
/** Returns the part of the lapse logarithm (gravitational potential
* at the Newtonian limit) generated principally by the star.
*/
const Scalar& get_logn_auto() const {return logn_auto;} ;
/** Returns the part of the lapse logarithm (gravitational potential
* at the Newtonian limit) generated principally by the companion star.
*/
const Scalar& get_logn_comp() const {return logn_comp;} ;
/** Returns the part of the shift vector \f$\beta^i\f$ generated
* principally by the star.
* (Spherical components with respect to the mapping of the star)
*/
const Vector& get_beta_auto() const {return beta_auto;} ;
/** Returns the part of the shift vector \f$\beta^i\f$ generated
* principally by the star.
* (Spherical components with respect to the mapping of the star)
*/
const Vector& get_beta_comp() const {return beta_comp;} ;
/** Returns the part of the vector field \f$Q\f$ generated principally
* by the star.
*/
const Scalar& get_lnq_auto() const {return lnq_auto;} ;
/** Returns the part of the vector field \f$Q\f$ generated principally
* by the companion star.
*/
const Scalar& get_lnq_comp() const {return lnq_comp;} ;
/** Returns the covariant derivative of \f$logn\f$.
*/
const Vector& get_dcov_logn() const {return dcov_logn;} ;
/** Returns the contravariant derivative of \f$logn\f$.
*/
const Vector& get_dcon_logn() const {return dcon_logn;} ;
/** Returns the covariant derivative of \f$\Phi\f$
* (logarithm of the conformal factor).
*/
const Vector& get_dcov_phi() const {return dcov_phi;} ;
/** Returns the contravariant derivative of \f$\Phi\f$
* (logarithm of the conformal factor).
*/
const Vector& get_dcon_phi() const {return dcon_phi;} ;
/// Return the conformal factor \f$\psi^4\f$
const Scalar& get_psi4() const {return psi4;} ;
/** Return the flat metric defined on the mapping (Spherical
* components with respect to the mapping of the star)
*/
const Metric& get_flat() const {return flat;} ;
/// Return the conformal 3-metric \f$\tilde \gamma\f$
const Metric& get_gtilde() const {return gtilde;} ;
/** Return the total deviation of the inverse conformal metric
* \f$\tilde \gamma^{ij}\f$ from the inverse flat metric.
*/
const Sym_tensor& get_hij() const {return hij;} ;
/** Return the deviation of the inverse conformal metric
* \f$\tilde \gamma^{ij}\f$ from the inverse flat metric principally
* generated by the star.
*/
const Sym_tensor& get_hij_auto() const {return hij_auto;} ;
/** Return the deviation of the inverse conformal metric
* \f$\tilde \gamma^{ij}\f$ from the inverse flat metric generated
* principally by the companion star.
*/
const Sym_tensor& get_hij_comp() const {return hij_comp;} ;
/** Returns the part of the extrinsic curvature tensor
* \f$\tilde K^{ij}\f$ generated by \c beta_auto.
* (Spherical components with respect to the mapping of the star)
*/
const Sym_tensor& get_tkij_auto() const {return tkij_auto;} ;
/** Returns the part of the extrinsic curvature tensor
* \f$\tilde K^{ij}\f$ generated by \c beta_comp.
* (Spherical components with respect to the mapping of the star)
*/
const Sym_tensor& get_tkij_comp() const {return tkij_comp;} ;
/** Returns the part of
* \f$\tilde K^{ij} \tilde K_{ij}\f$ generated by \c beta_auto.
*/
const Scalar& get_kcar_auto() const {return kcar_auto;} ;
/** Returns the part of
* \f$\tilde K^{ij} \tilde K_{ij}\f$ generated by \c beta_comp.
*/
const Scalar& get_kcar_comp() const {return kcar_comp;} ;
/**
* Returns the function used to construct \c beta_auto
from \c beta.
*/
const Scalar get_decouple() const {return decouple ;}
bool is_conf_flat() const {return conf_flat; } ;
// Outputs
// -------
public:
virtual void sauve(FILE* ) const ; ///< Save in a file
protected:
/// Operator >> (virtual function called by the operator <<).
virtual ostream& operator>>(ostream& ) const ;
// Global quantities
// -----------------
public:
/// Baryon mass
virtual double mass_b() const ;
/// Gravitational mass
virtual double mass_g() const ;
/// Absolute coordinate X of the barycenter of the baryon density,
virtual double xa_barycenter() const ;
// Computational routines
// ----------------------
public:
/** Computes the hydrodynamical quantities relative to the Eulerian
* observer from those in the fluid frame, as well as
* \c wit_w and \c loggam.
*
* The calculation is performed starting from the quantities
* \c ent, \c ener, \c press and \c bsn,
* which are supposed to be up to date.
* From these, the following fields are updated:
* \c gam_euler, \c u_euler, \c ener_euler,
* \c s_euler, \c stress_euler,
* \c wit_w and \c loggam.
*
*/
virtual void hydro_euler() ;
/** Computes metric coefficients from known potentials,
* when the companion is another star.
*
* The calculation is performed starting from the quantities
* \c logn_auto, \c lnq_auto, \c beta_auto,
* \c hij_auto, \c comp.logn_auto, \c comp.lnq_auto,
* \c comp.beta_auto, \c comp.hij_auto
* which are supposed to be up to date.
* From these, the following fields are updated:
* \c logn_comp, \c lnq_comp, \c beta_comp,
* \c hij_comp, \c nn, \c psi4, \c beta,
*
* @param comp companion star.
* @param omega angular velocity with respect to an asymptotically
* inertial observer
*/
void update_metric(const Star_bin& comp, double omega) ;
/** Same as \c update_metric(const Star_bin\& ) but with
* relaxation.
*
* @param comp companion star.
* @param star_prev previous value of the star.
* @param relax relaxation parameter.
* @param omega angular velocity with respect to an asymptotically
* inertial observer
*/
void update_metric(const Star_bin& comp, const Star_bin& star_prev,
double relax, double omega) ;
/** Computes the derivative of metric functions related to the
* companion star.
* @param omega angular velocity with respect to an asymptotically
* inertial observer
*/
void update_metric_der_comp(const Star_bin& comp, double omega) ;
/** Computes the quantities \c bsn and \c pot_centri.
*
* The calculation is performed starting from the quantities
* \c nn, \c beta, \c Q,
* which are supposed to be up to date.
*
* @param omega angular velocity with respect to an asymptotically
* inertial observer
* @param x_axe absolute X coordinate of the rotation axis
*/
void kinematics(double omega, double x_axe) ;
/** Computes the gradient of the total velocity potential \f$\psi\f$.
*
*/
void fait_d_psi() ;
/** Computes \c tkij_auto and \c akcar_auto from
* \c beta_auto, \c nn and \c Q.
* @param omega angular velocity with respect to an asymptotically
* inertial observer
*/
void extrinsic_curvature(double omega) ;
/** Computes an equilibrium configuration.
*
* @param ent_c [input] Central enthalpy
* @param mermax [input] Maximum number of steps
* @param mermax_poisson [input] Maximum number of steps in
* poisson scalar
* @param relax_poisson [input] Relaxation factor in poisson scalar
* @param mermax_potvit [input] Maximum number of steps in
* Map_radial::poisson_compact
* @param relax_potvit [input] Relaxation factor in
* Map_radial::poisson_compact
* @param thres_adapt [input] Threshold on dH/dr for the adaptation
* of the mapping
* @param diff [output] 1-D \c Tbl for the storage of some
* error indicators
*/
void equilibrium(double ent_c, int mermax, int mermax_potvit,
int mermax_poisson, double relax_poisson,
double relax_potvit, double thres_adapt, Tbl& diff,
double om) ;
/** Computes the non-translational part of the velocity scalar potential
* \f$\psi0\f$ by solving the continuity equation.
*
* @param mermax [input] Maximum number of steps in the iteration
* @param precis [input] Required precision: the iteration will
* be stopped when the relative difference
* on \f$\psi0\f$ between two successive steps
* is lower than \c precis.
* @param relax [input] Relaxation factor.
*
* @return Relative error of the resolution obtained by comparing
* the operator acting on the solution with the source.
*/
double velocity_potential(int mermax, double precis, double relax) ;
/** Performs a relaxation on \c ent, \c logn_auto,
* \c lnq_auto, \c beta_auto and \c hij_auto.
*
* @param star_prev [input] star at the previous step.
* @param relax_ent [input] Relaxation factor for \c ent
* @param relax_met [input] Relaxation factor for \c logn_auto,
* \c lnq_auto, \c beta_auto,
* only if \c (mer \% fmer_met == 0).
* @param mer [input] Step number
* @param fmer_met [input] Step interval between metric updates
*/
void relaxation(const Star_bin& star_prev, double relax_ent,
double relax_met, int mer, int fmer_met) ;
/// Test if the gauge conditions we impose are well satisfied
void test_K_Hi() const ;
/// Test of the helical symmetry
void helical(double omega) const ;
friend class Binary ;
};
//---------------------------//
// class Star_bin_xcts //
//---------------------------//
/**
* Class for stars in binary system in eXtended Conformal Thin Sandwich
* formulation. *** UNDER DEEVELOPMENT *** \ingroup (star)
*
* A \c Star_bin_xcts can be construted in two states, represented by
* the \c bool member \c irrotational: (i) irrotational
* (i.e. the fluid motion is irrotational) or (ii) rigidly corotating
* with respect to the orbital motion (synchronized binary).
*
*/
class Star_bin_xcts : public Star {
// Data :
// -----
protected:
/** \c true for an irrotational star, \c false for a
* corotating one
*/
bool irrotational ;
/** Scalar potential \f$\Psi_0\f$ of the non-translational part of
* fluid 4-velocity (in the irrotational case)
*/
Scalar psi0 ;
/** Gradient of \f$\Psi\f$ (in the irrotational case)
* (Spherical components with respect to the mapping of the star)
*/
Vector d_psi ;
/** Spatial projection of the fluid 3-velocity with respect to
* the co-orbiting observer.
* (Spherical components with respect to the mapping of the star)
*/
Vector wit_w ;
/** Logarithm of the Lorentz factor between the fluid and
* the co-orbiting observer.
*/
Scalar loggam ;
/** 3-vector shift, divided by \e N, of the rotating coordinates,
* \f$\beta^i/N\f$.
* (Spherical components with respect to the mapping of the star)
*/
Vector bsn ;
/// Centrifugal potential
Scalar pot_centri ;
/** Scalar field \f$ \chi_{auto} = (N\Psi)_{auto} \f$ generated
* principally by the star.
*/
Scalar chi_auto ;
/** Scalar field \f$ \chi_{comp} = (N\Psi)_{comp} \f$ generated
* principally by the companion star.
*/
Scalar chi_comp ;
/** Scalar field \f$\Psi_{auto}\f$ generated principally by the
* star.
*/
Scalar Psi_auto ;
/** Scalar field \f$\Psi_{comp}\f$ generated principally by the
* companion star.
*/
Scalar Psi_comp ;
/// Total conformal factor \f$\Psi\f$
Scalar Psi ;
/// Total function \f$\chi\f$
Scalar chi ;
/// Conformal factor \f$\psi^4\f$
Scalar psi4 ;
/** Solution for the vector part of the vector Poisson equation
* for \f$\beta^i\f$
*/
Vector w_beta ;
/** Solution for the scalar part of the vector Poisson equation
* for \f$\beta^i\f$
*/
Scalar khi ;
/// Covariant derivative of the conformal factor \f$\Psi\f$
Vector dcov_Psi ;
/// Covariant derivative of the function \f$\chi\f$
Vector dcov_chi ;
///Flat metric defined on the mapping (Spherical components with respect to the mapping of the star) .
Metric_flat flat ;
/** Part of the shift vector generated principally by the star
* (Spherical components with respect to the mapping of the star)
*/
Vector beta_auto ;
/** Part of the shift vector generated principally by the star
* (Spherical components with respect to the mapping of the star)
*/
Vector beta_comp ;
/** Part of the extrinsic curvature tensor \f$\hat{A}^{ij}\f$
* generated by \c beta_auto.
* (Spherical components with respect to the mapping of the star)
*/
Sym_tensor haij_auto ;
/** Part of the extrinsic curvature tensor \f$\hat{A}^{ij}\f$
* generated by \c beta_comp.
* (Spherical components with respect to the mapping of the star)
*/
Sym_tensor haij_comp ;
/** Part of the scalar \f$\hat{A}_{ij}\hat{A}^{ij}\f$
* generated by \c beta_auto, i.e.
* \f$\hat{A}_{ij}^{\rm auto}\hat{A}^{ij}_{\rm auto}\f$
*/
Scalar hacar_auto ;
/** Part of the scalar \f$\hat{A}_{ij}\hat{A}^{ij}\f$
* generated by \c beta_auto and \c beta_comp, i.e.
* \f$\hat{A}_{ij}^{\rm auto}\hat{A}^{ij}_{\rm comp}\f$
*/
Scalar hacar_comp ;
/** Effective source at the previous step for the resolution of
* the Poisson equation for \c \chi_auto.
*/
Scalar ssjm1_chi ;
/** Effective source at the previous step for the resolution of
* the Poisson equation for \c \Psi_auto.
*/
Scalar ssjm1_psi ;
/** Effective source at the previous step for the resolution of
* the Poisson equation for \c khi. (second scalar equation
* for the resolution of the vectorial poisson equation for the shift)
*/
Scalar ssjm1_khi ;
/** Effective source at the previous step for wbeta of
* the vector Poisson equation for \c wbeta (needed for the
* solution of the vector Poisson equation for the shift
* \f$\beta^i\f$)
*/
Vector ssjm1_wbeta ;
// Derived data :
// ------------
protected:
/// Absolute coordinate X of the barycenter of the baryon density
mutable double* p_xa_barycenter ;
// Constructors - Destructor
// -------------------------
public:
/** Standard constructor.
*
* @param mp_i Mapping on which the star will be defined
* @param nzet_i Number of domains occupied by the star
* @param eos_i Equation of state of the stellar matter
* @param irrot should be \c true for an irrotational star,
* \c false for a corotating one
*/
Star_bin_xcts(Map& mp_i, int nzet_i, const Eos& eos_i, bool irrot) ;
Star_bin_xcts(const Star_bin_xcts& ) ; ///< Copy constructor
/** Constructor from a file (see \c sauve(FILE* )).
*
* @param mp_i Mapping on which the star will be defined
* @param eos_i Equation of state of the stellar matter
* @param fich input file (must have been created by the function
* \c sauve)
*/
Star_bin_xcts(Map& mp_i, const Eos& eos_i, FILE* fich) ;
virtual ~Star_bin_xcts() ; ///< Destructor
// Memory management
// -----------------
protected:
/// Deletes all the derived quantities
virtual void del_deriv() const ;
/// Sets to \c 0x0 all the pointers on derived quantities
virtual void set_der_0x0() const ;
/** Sets to \c ETATNONDEF (undefined state) the hydrodynamical
* quantities relative to the Eulerian observer.
*/
virtual void del_hydro_euler() ;
// Mutators / assignment
// ---------------------
public:
/// Assignment to another \c Star_bin_xcts
void operator=(const Star_bin_xcts& ) ;
/// Read/write the centrifugal potential
Scalar& set_pot_centri() ;
/// Read/write the conformal factor \f$\Psi_{auto}\f$
Scalar& set_Psi_auto() ;
/// Read/write the conformal factor \f$\Psi_{comp}\f$
Scalar& set_Psi_comp() ;
/// Read/write the conformal factor \f$\chi_{auto}\f$
Scalar& set_chi_auto() ;
/// Read/write the conformal factor \f$\chi_{comp}\f$
Scalar& set_chi_comp() ;
/// Read/write of \f$\beta_{auto}\f$
Vector& set_beta_auto() ;
/// Read/write of \f$\beta\f$
Vector& set_beta() ;
// Accessors
// ---------
public:
/** Returns \c true for an irrotational motion, \c false for
* a corotating one.
*/
bool is_irrotational() const { return irrotational; } ;
/// Returns the non-translational part of the velocity potential
const Scalar& get_psi0() const {return psi0 ; } ;
/** Returns the covariant derivative of the velocity potential
* (Spherical components with respect to the mapping of the star)
*/
const Vector& get_d_psi() const {return d_psi ; } ;
/** Returns the spatial projection of the fluid 3-velocity with
* respect to the co-orbiting observer.
* (Spherical components with respect to the mapping of the star)
*/
const Vector& get_wit_w() const {return wit_w ; } ;
/** Returns the logarithm of the Lorentz factor between the fluid and
* the co-orbiting observer.
*/
const Scalar& get_loggam() const {return loggam ; } ;
/** Returns the shift vector, divided by \e N, of the rotating
* coordinates, \f$\beta^i/N\f$.
* (Spherical components with respect to the mapping of the star)
*/
const Vector& get_bsn() const {return bsn ; } ;
/// Returns the centrifugal potential
const Scalar& get_pot_centri() const {return pot_centri ; } ;
/** Returns the part of the shift vector \f$\beta^i\f$ generated
* principally by the star (\f$\beta^i_{auto}\f$).
* (Spherical components with respect to the mapping of the star)
*/
const Vector& get_beta_auto() const {return beta_auto ; } ;
/** Returns the part of the shift vector \f$\beta^i\f$ generated
* principally by the companion (\f$\beta^i_{comp}\f$).
* (Spherical components with respect to the mapping of the star)
*/
const Vector& get_beta_comp() const {return beta_comp ; } ;
/** Returns the scalar field \f$\Psi_{auto}\f$ generated principally
* by the star.
*/
const Scalar& get_Psi_auto() const {return Psi_auto ; } ;
/** Returns the scalar field \f$\Psi_{comp}\f$ generated principally
* by the companion star.
*/
const Scalar& get_Psi_comp() const {return Psi_comp ; } ;
/** Returns the scalar field \f$\chi_{auto} = (N\Psi)_{auto}\f$
* generated principally by the star.
*/
const Scalar& get_chi_auto() const {return chi_auto ; } ;
/** Returns the scalar field \f$\chi_{comp} = (N\Psi)_{comp}\f$
* generated principally by the companion star.
*/
const Scalar& get_chi_comp() const {return chi_comp ; } ;
/** Returns the covariant derivative of \f$\chi\f$.
*/
const Vector& get_dcov_chi() const {return dcov_chi ; } ;
/** Returns the covariant derivative of
* the conformal factor \f$\Psi\f$
*/
const Vector& get_dcov_Psi() const {return dcov_Psi ; } ;
/// Return the conformal factor \f$\Psi\f$
const Scalar& get_Psi() const {return Psi ; } ;
/// Return the function \f$\chi\f$
const Scalar& get_chi() const {return chi ; } ;
/// Return the conformal factor \f$\Psi^4\f$
const Scalar& get_psi4() const {return psi4 ; } ;
/** Return the flat metric defined on the mapping (Spherical
* components with respect to the mapping of the star)
*/
const Metric& get_flat() const {return flat ; } ;
/** Returns the part of the extrinsic curvature tensor
* \f$\hat{A}^{ij}\f$ generated by \c beta_auto.
* (Spherical components with respect to the mapping of the star)
*/
const Sym_tensor& get_haij_auto() const {return haij_auto ; } ;
/** Returns the part of the extrinsic curvature tensor
* \f$\hat{A}^{ij}\f$ generated by \c beta_comp.
* (Spherical components with respect to the mapping of the star)
*/
const Sym_tensor& get_haij_comp() const {return haij_comp ; } ;
/** Returns the part of
* \f$\hat{A}^{ij}\hat{A}_{ij}\f$ generated by \c beta_auto.
*/
const Scalar& get_hacar_auto() const {return hacar_auto ; } ;
/** Returns the part of
* \f$\hat{A}^{ij}\hat{A}_{ij}\f$ generated by \c beta_comp.
*/
const Scalar& get_hacar_comp() const {return hacar_comp ; } ;
// Outputs
// -------
public:
virtual void sauve(FILE* ) const ; ///< Save in a file
protected:
/// Operator >> (virtual function called by the operator <<).
virtual ostream& operator>>(ostream& ) const ;
// Global quantities
// -----------------
public:
/// Baryon mass
virtual double mass_b() const ;
/// Gravitational mass
virtual double mass_g() const ;
/// Absolute coordinate X of the barycenter of the baryon density,
virtual double xa_barycenter() const ;
// Computational routines
// ----------------------
public:
/** Computes the hydrodynamical quantities relative to the Eulerian
* observer from those in the fluid frame, as well as
* \c wit_w and \c loggam.
*
* The calculation is performed starting from the quantities
* \c ent, \c ener, \c press and \c bsn,
* which are supposed to be up to date.
* From these, the following fields are updated:
* \c gam_euler, \c u_euler, \c ener_euler,
* \c s_euler, \c stress_euler,
* \c wit_w and \c loggam.
*
*/
virtual void hydro_euler() ;
/** Computes metric coefficients from known potentials,
* when the companion is another star.
*
* The calculation is performed starting from the quantities
* \c Psi_auto, \c chi_auto, \c beta_auto,
* \c comp.Psi_auto, \c comp.chi_auto,
* \c comp.beta_auto
* which are supposed to be up to date.
* From these, the following fields are updated:
* \c Psi_comp, \c chi_comp, \c beta_comp,
* \c nn, \c psi4, \c beta.
*
* @param comp companion star.
* @param omega angular velocity with respect to an asymptotically
* inertial observer
*/
void update_metric(const Star_bin_xcts& comp) ;
/** Same as \c update_metric(const Star_bin_xcts\& ) but with
* relaxation.
*
* @param comp companion star.
* @param star_prev previous value of the star.
* @param relax relaxation parameter.
* @param omega angular velocity with respect to an asymptotically
* inertial observer
*/
void update_metric(const Star_bin_xcts& comp,
const Star_bin_xcts& star_prev,
double relax) ;
/** Computes the derivative of metric functions related to the
* companion star
*/
void update_metric_der_comp(const Star_bin_xcts& comp) ;
/** Computes the quantities \c bsn and \c pot_centri.
*
* The calculation is performed starting from the quantities
* \c nn, \c beta, \c Psi,
* which are supposed to be up to date.
*
* @param omega angular velocity with respect to an asymptotically
* inertial observer
* @param x_axe absolute X coordinate of the rotation axis
*/
void kinematics(double omega, double x_axe) ;
/** Computes the gradient of the total velocity potential \f$\psi\f$.
*
*/
void fait_d_psi() ;
/** Computes \c haij_auto and \c hacar_auto from
* \c beta_auto, \c nn and \c Psi .
*/
void extrinsic_curvature() ;
/** Computes an equilibrium configuration.
*
* @param ent_c [input] Central enthalpy
* @param mermax [input] Maximum number of steps
* @param mermax_poisson [input] Maximum number of steps in
* poisson scalar
* @param relax_poisson [input] Relaxation factor in poisson scalar
* @param mermax_potvit [input] Maximum number of steps in
* Map_radial::poisson_compact
* @param relax_potvit [input] Relaxation factor in
* Map_radial::poisson_compact
* @param thres_adapt [input] Threshold on dH/dr for the adaptation
* of the mapping
* @param fact [input] 1-D \c Tbl for the input of some factors:
* \li \c fact(0) : A resizing factor for the first shell
* @param ent_limit [input] array of enthalpy values to be set at
* the boundaries between the domains; if set to 0x0 (default),
* the initial values will be kept.
* @param diff [output] 1-D \c Tbl for the storage of some
* error indicators
*/
void equilibrium(double ent_c, int mermax, int mermax_potvit,
int mermax_poisson, double relax_poisson,
double relax_potvit, double thres_adapt,
const Tbl& fact, const Tbl* pent_limit,
Tbl& diff) ;
/** Computes the non-translational part of the velocity scalar potential
* \f$\psi0\f$ by solving the continuity equation.
*
* @param mermax [input] Maximum number of steps in the iteration
* @param precis [input] Required precision: the iteration will
* be stopped when the relative difference
* on \f$\psi0\f$ between two successive steps
* is lower than \c precis.
* @param relax [input] Relaxation factor.
*
* @return Relative error of the resolution obtained by comparing
* the operator acting on the solution with the source.
*/
double velocity_potential(int mermax, double precis, double relax) ;
/** Performs a relaxation on \c ent, \c Psi_auto,
* \c chi_auto and \c beta_auto.
*
* @param star_prev [input] star at the previous step.
* @param relax_ent [input] Relaxation factor for \c ent
* @param relax_met [input] Relaxation factor for \c logn_auto,
* \c lnq_auto, \c beta_auto,
* only if \c (mer \% fmer_met == 0).
* @param mer [input] Step number
* @param fmer_met [input] Step interval between metric updates
*/
void relaxation(const Star_bin_xcts& star_prev, double relax_ent,
double relax_met, int mer, int fmer_met) ;
friend class Binary_xcts ;
};
}
#endif
|