LORENE
strot_dirac_solveshift.C
1 /*
2  * Solution of the shift equation 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 
30 
31 /*
32  * $Id: strot_dirac_solveshift.C,v 1.4 2016/12/05 16:18:16 j_novak Exp $
33  * $Log: strot_dirac_solveshift.C,v $
34  * Revision 1.4 2016/12/05 16:18:16 j_novak
35  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
36  *
37  * Revision 1.3 2014/10/13 08:53:40 j_novak
38  * Lorene classes and functions now belong to the namespace Lorene.
39  *
40  * Revision 1.2 2005/02/17 17:31:12 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.1 2005/01/31 08:51:48 j_novak
45  * New files for rotating stars in Dirac gauge (still under developement).
46  *
47  *
48  * $Header: /cvsroot/Lorene/C++/Source/Star/strot_dirac_solveshift.C,v 1.4 2016/12/05 16:18:16 j_novak Exp $
49  *
50  */
51 
52 // Lorene headers
53 #include "star_rot_dirac.h"
54 #include "unites.h"
55 
56 namespace Lorene {
57 void Star_rot_Dirac::solve_shift(Vector& beta_new) const {
58 
59  using namespace Unites ;
60 
61  const Metric_flat& mets = mp.flat_met_spher() ;
62 
63  const Vector& dln_psi = ln_psi.derive_cov(mets) ; // D_i ln(Psi)
64  const Vector& dnn = nn.derive_cov(mets) ; // D_i N
65 
66  Vector source_beta = 2.* contract(aa, 1,
67  dnn - 6.*nn * dln_psi, 0) ;
68 
69  source_beta += 2.* nn * ( 2.*qpig* psi4 * j_euler
70  - contract(tgamma.connect().get_delta(), 1, 2,
71  aa, 0, 1) ) ;
72 
73  Vector vtmp = contract(hh, 0, 1,
74  beta.derive_cov(mets).derive_cov(mets), 1, 2)
75  + 0.3333333333333333*
76  contract(hh, 1, beta.divergence(mets).derive_cov(mets), 0) ;
77  vtmp.inc_dzpuis() ; // dzpuis: 3 -> 4
78 
79  source_beta -= vtmp ;
80  source_beta.set(1).set_dzpuis(4) ; //## these components are null
81  source_beta.set(2).set_dzpuis(4) ; //## in axial symmetry
82 
83  Vector_divfree sou_beta_df = source_beta.div_free(mets) ;
84 
85  beta_new = sou_beta_df.poisson() ;
86  beta_new.set(1) = 0 ; //## these components are null
87 
88  beta_new.set(2) = 0 ; //## in axial symmetry
89 
90 
91 
92 }
93 }
Map & mp
Mapping associated with the star.
Definition: star.h:180
const Vector_divfree & div_free(const Metric &) const
Returns the div-free vector in the Helmholtz decomposition.
Definition: vector.C:510
Lorene prototypes.
Definition: app_hor.h:67
Standard units of space, time and mass.
Flat metric for tensor calculation.
Definition: metric.h:261
Sym_tensor_trans hh
is defined by .
Vector beta
Shift vector.
Definition: star.h:228
Tensor field of valence 1.
Definition: vector.h:188
const Tensor_sym & get_delta() const
Returns the tensor which defines the connection with respect to the flat one: is the difference bet...
Definition: connection.h:271
void set_dzpuis(int)
Modifies the dzpuis flag.
Definition: scalar.C:814
Scalar psi4
Conformal factor .
virtual const Connection & connect() const
Returns the connection.
Definition: metric.C:304
const Scalar & divergence(const Metric &) const
The divergence of this with respect to a Metric .
Definition: vector.C:387
Vector_divfree poisson() const
Computes the solution of a vectorial Poisson equation with *this as a source: .
Tenseur contract(const Tenseur &, int id1, int id2)
Self contraction of two indices of a Tenseur .
const Tensor & derive_cov(const Metric &gam) const
Returns the covariant derivative of this with respect to some metric .
Definition: tensor.C:1011
virtual void inc_dzpuis(int inc=1)
Increases by inc units the value of dzpuis and changes accordingly the values in the compactified ext...
Definition: tensor.C:825
Scalar nn
Lapse function N .
Definition: star.h:225
void solve_shift(Vector &shift_new) const
Solution of the shift equation for rotating stars in Dirac gauge.
Scalar & set(int)
Read/write access to a component.
Definition: vector.C:302
Divergence-free vectors.
Definition: vector.h:724
const Vector & derive_cov(const Metric &gam) const
Returns the gradient (1-form = covariant vector) of *this
Definition: scalar_deriv.C:390
Vector j_euler
Momentum density 3-vector with respect to the Eulerian observer.
const Metric_flat & flat_met_spher() const
Returns the flat metric associated with the spherical coordinates and with components expressed in th...
Definition: map.C:324