| 1 |
/* |
| 2 |
* Solution of the two scalar Poisson equations for rotating stars |
| 3 |
* in Dirac gauge. |
| 4 |
* |
| 5 |
* (see file star_rot_Dirac.h for documentation). |
| 6 |
* |
| 7 |
*/ |
| 8 |
|
| 9 |
/* |
| 10 |
* Copyright (c) 2005 Lap-Ming Lin & Jerome Novak |
| 11 |
* |
| 12 |
* This file is part of LORENE. |
| 13 |
* |
| 14 |
* LORENE is free software; you can redistribute it and/or modify |
| 15 |
* it under the terms of the GNU General Public License version 2 |
| 16 |
* as published by the Free Software Foundation. |
| 17 |
* |
| 18 |
* LORENE is distributed in the hope that it will be useful, |
| 19 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 21 |
* GNU General Public License for more details. |
| 22 |
* |
| 23 |
* You should have received a copy of the GNU General Public License |
| 24 |
* along with LORENE; if not, write to the Free Software |
| 25 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 26 |
* |
| 27 |
*/ |
| 28 |
|
| 29 |
char strot_dirac_solvenq_C[] = "$Header: /cvsroot/Lorene/C++/Source/Star/strot_dirac_solvenq.C,v 1.5 2014/10/13 08:53:40 j_novak Exp $" ; |
| 30 |
|
| 31 |
/* |
| 32 |
* $Id: strot_dirac_solvenq.C,v 1.5 2014/10/13 08:53:40 j_novak Exp $ |
| 33 |
* $Log: strot_dirac_solvenq.C,v $ |
| 34 |
* Revision 1.5 2014/10/13 08:53:40 j_novak |
| 35 |
* Lorene classes and functions now belong to the namespace Lorene. |
| 36 |
* |
| 37 |
* Revision 1.4 2014/10/06 15:13:18 j_novak |
| 38 |
* Modified #include directives to use c++ syntax. |
| 39 |
* |
| 40 |
* Revision 1.3 2005/02/17 17:31:29 f_limousin |
| 41 |
* Change the name of some quantities to be consistent with other classes |
| 42 |
* (for instance nnn is changed to nn, shift to beta, beta to lnq...) |
| 43 |
* |
| 44 |
* Revision 1.2 2005/02/02 09:23:20 lm_lin |
| 45 |
* |
| 46 |
* Correct a mistake in the calculation of log(N). |
| 47 |
* |
| 48 |
* |
| 49 |
* $Header: /cvsroot/Lorene/C++/Source/Star/strot_dirac_solvenq.C,v 1.5 2014/10/13 08:53:40 j_novak Exp $ |
| 50 |
* |
| 51 |
*/ |
| 52 |
|
| 53 |
// C headers |
| 54 |
#include <cmath> |
| 55 |
#include <cassert> |
| 56 |
|
| 57 |
// Lorene headers |
| 58 |
#include "star_rot_dirac.h" |
| 59 |
#include "unites.h" |
| 60 |
|
| 61 |
namespace Lorene { |
| 62 |
void Star_rot_Dirac::solve_logn_f(Scalar& ln_f_new) const { |
| 63 |
|
| 64 |
using namespace Unites ; |
| 65 |
|
| 66 |
//================================================ |
| 67 |
// Source for log(n) containing matter field terms |
| 68 |
//================================================ |
| 69 |
|
| 70 |
Scalar source_logn = qpig* psi4* (ener_euler + s_euler) ; |
| 71 |
|
| 72 |
ln_f_new = source_logn.poisson() ; |
| 73 |
|
| 74 |
} |
| 75 |
|
| 76 |
void Star_rot_Dirac::solve_logn_q(Scalar& ln_q_new) const { |
| 77 |
|
| 78 |
const Metric_flat& mets = mp.flat_met_spher() ; |
| 79 |
const Base_vect_spher& bspher = mp.get_bvect_spher() ; |
| 80 |
|
| 81 |
const Vector& dln_psi = ln_psi.derive_cov(mets) ; // D_i ln(Psi) |
| 82 |
const Vector& dln = logn.derive_cov(mets) ; // D_i ln(N) |
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
//============================================= |
| 87 |
// Source for log(n) containing quadratic terms |
| 88 |
//============================================= |
| 89 |
|
| 90 |
Scalar source_logn = psi4* aa_quad |
| 91 |
- contract(dln.up_down(mets), 0, dln, 0) |
| 92 |
- 2.* contract(dln_psi, 0, logn.derive_con(tgamma), 0) ; |
| 93 |
|
| 94 |
|
| 95 |
Tensor_sym tmp(mp, 2, COV, bspher, 0, 1) ; |
| 96 |
tmp = dln.derive_cov(mets) ; |
| 97 |
tmp.inc_dzpuis() ; //dzpuis 3 -> 4 |
| 98 |
|
| 99 |
source_logn -= contract( hh, 0, 1, tmp+dln*dln, 0, 1 ) ; |
| 100 |
|
| 101 |
ln_q_new = source_logn.poisson() ; |
| 102 |
|
| 103 |
} |
| 104 |
|
| 105 |
void Star_rot_Dirac::solve_qqq(Scalar& q_new) const { |
| 106 |
|
| 107 |
using namespace Unites ; |
| 108 |
|
| 109 |
const Metric_flat& mets = mp.flat_met_spher() ; |
| 110 |
|
| 111 |
// Source for Q |
| 112 |
// ------------ |
| 113 |
|
| 114 |
const Vector& dln_psi = ln_psi.derive_cov(mets) ; // D_i ln(Psi) |
| 115 |
const Vector& dqq = qqq.derive_cov(mets) ; // D_i Q |
| 116 |
const Tensor_sym& dhh = hh.derive_cov(mets) ; // D_k h^{ij} |
| 117 |
const Tensor_sym& dtgam = tgamma.cov().derive_cov(mets) ; |
| 118 |
// D_k {\tilde \gamma}_{ij} |
| 119 |
Scalar source_qq = psi4 * qqq * ( qpig* s_euler + 0.75* aa_quad ) ; |
| 120 |
|
| 121 |
Scalar tmp = contract( hh, 0, 1, dqq.derive_cov(mets), 0, 1 ) ; |
| 122 |
tmp.inc_dzpuis() ; |
| 123 |
|
| 124 |
source_qq -= tmp ; |
| 125 |
|
| 126 |
|
| 127 |
// tmp = \tilde{R}_{*}/4 + 2 D_i ln(Psi) \tilde{D}^i ln(Psi) |
| 128 |
tmp = 0.0625 * contract( dhh, 0, 1, dtgam, 0, 1 ).trace(tgamma) |
| 129 |
- 0.125 * contract( dhh, 0, 1, dtgam, 0, 2 ).trace(tgamma) |
| 130 |
+ 2.* contract( dln_psi, 0, ln_psi.derive_con(tgamma), 0) ; |
| 131 |
|
| 132 |
source_qq += psi2 * ( nn * tmp |
| 133 |
+ 2*contract(dln_psi, 0, nn.derive_con(tgamma), 0) ) ; |
| 134 |
|
| 135 |
|
| 136 |
q_new = source_qq.poisson() + 1. ; |
| 137 |
|
| 138 |
if (q_new.get_etat() == ETATUN) q_new.std_spectral_base() ; |
| 139 |
|
| 140 |
} |
| 141 |
} |