LORENE
binhor_viriel.C
1 /*
2  * Copyright (c) 2005 Francois Limousin
3  * Jose Luis Jaramillo
4  *
5  * This file is part of LORENE.
6  *
7  * LORENE is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * LORENE is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with LORENE; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20  *
21  */
22 
23 
24 char binhor_viriel_C[] = "$Header: /cvsroot/Lorene/C++/Source/Bin_hor/binhor_viriel.C,v 1.5 2014/10/13 08:52:42 j_novak Exp $" ;
25 
26 /*
27  * $Id: binhor_viriel.C,v 1.5 2014/10/13 08:52:42 j_novak Exp $
28  * $Log: binhor_viriel.C,v $
29  * Revision 1.5 2014/10/13 08:52:42 j_novak
30  * Lorene classes and functions now belong to the namespace Lorene.
31  *
32  * Revision 1.4 2014/10/06 15:13:01 j_novak
33  * Modified #include directives to use c++ syntax.
34  *
35  * Revision 1.3 2007/04/13 15:28:55 f_limousin
36  * Lots of improvements, generalisation to an arbitrary state of
37  * rotation, implementation of the spatial metric given by Samaya.
38  *
39  * Revision 1.2 2005/04/08 12:35:07 f_limousin
40  * Just to avoid warnings...
41  *
42  * Revision 1.1 2005/02/11 18:22:06 f_limousin
43  * First version
44  *
45  *
46  * $Header: /cvsroot/Lorene/C++/Source/Bin_hor/binhor_viriel.C,v 1.5 2014/10/13 08:52:42 j_novak Exp $
47  *
48  */
49 
50 #include <cmath>
51 
52 // Lorene
53 #include "tensor.h"
54 #include "isol_hor.h"
55 
56 namespace Lorene {
57 double Single_hor::viriel_seul () const{
58 
59  int nz1 = mp.get_mg()->get_nzone() ;
60 
61  Valeur** devel_psi (psi_auto.asymptot(1)) ;
62  Valeur** devel_n (n_auto.asymptot(1)) ;
63 
64  double erreur = (2*(*devel_psi[1])(nz1-1, 0, 0, 0)
65  + (*devel_n[1])(nz1-1, 0, 0, 0))/fabs ((*devel_n[1])(nz1-1, 0, 0, 0)) ;
66 
67  return erreur ;
68 }
69 
70 
71 double Bin_hor::viriel () const{
72 
73  int nz_un = hole1.mp.get_mg()->get_nzone() ;
74  int nz_deux = hole2.mp.get_mg()->get_nzone() ;
75 
76  Valeur** devel_psi_un (hole1.psi_auto.asymptot(1)) ;
77  Valeur** devel_psi_deux (hole2.psi_auto.asymptot(1)) ;
78  Valeur** devel_n_un (hole1.n_auto.asymptot(1)) ;
79  Valeur** devel_n_deux (hole2.n_auto.asymptot(1)) ;
80 
81  double res =
82  (2*(*devel_psi_un[1])(nz_un-1, 0, 0, 0)+
83  2*(*devel_psi_deux[1])(nz_deux-1, 0, 0, 0)+
84  (*devel_n_deux[1])(nz_deux-1, 0, 0, 0) +
85  (*devel_n_un[1])(nz_un-1, 0, 0, 0))
86  / fabs ((*devel_n_deux[1])(nz_deux-1, 0, 0, 0) +
87  (*devel_n_un[1])(nz_un-1, 0, 0, 0)) ;
88 
89  return res ;
90 }
91 
92 }
Lorene::Valeur
Values and coefficients of a (real-value) function.
Definition: valeur.h:287
Lorene::Single_hor::n_auto
Scalar n_auto
Lapse function .
Definition: isol_hor.h:915
Lorene::Bin_hor::viriel
double viriel() const
Computes the viriel error, that is the difference between the ADM and the Komar masses,...
Definition: binhor_viriel.C:71
Lorene::Bin_hor::hole1
Single_hor hole1
Black hole one.
Definition: isol_hor.h:1342
Lorene
Lorene prototypes.
Definition: app_hor.h:64
Lorene::Map::get_mg
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
Definition: map.h:765
Lorene::Single_hor::mp
Map_af & mp
Affine mapping.
Definition: isol_hor.h:900
Lorene::Scalar::asymptot
Valeur ** asymptot(int n, const int flag=0) const
Asymptotic expansion at r = infinity.
Definition: scalar_asymptot.C:63
Lorene::Single_hor::viriel_seul
double viriel_seul() const
Computes the viriel error, that is the difference between the ADM and the Komar masses,...
Definition: binhor_viriel.C:57
Lorene::Single_hor::psi_auto
Scalar psi_auto
Conformal factor .
Definition: isol_hor.h:924
Lorene::Mg3d::get_nzone
int get_nzone() const
Returns the number of domains.
Definition: grilles.h:448
Lorene::Bin_hor::hole2
Single_hor hole2
Black hole two.
Definition: isol_hor.h:1343