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 
25 
26 /*
27  * $Id: binhor_viriel.C,v 1.6 2016/12/05 16:17:46 j_novak Exp $
28  * $Log: binhor_viriel.C,v $
29  * Revision 1.6 2016/12/05 16:17:46 j_novak
30  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
31  *
32  * Revision 1.5 2014/10/13 08:52:42 j_novak
33  * Lorene classes and functions now belong to the namespace Lorene.
34  *
35  * Revision 1.4 2014/10/06 15:13:01 j_novak
36  * Modified #include directives to use c++ syntax.
37  *
38  * Revision 1.3 2007/04/13 15:28:55 f_limousin
39  * Lots of improvements, generalisation to an arbitrary state of
40  * rotation, implementation of the spatial metric given by Samaya.
41  *
42  * Revision 1.2 2005/04/08 12:35:07 f_limousin
43  * Just to avoid warnings...
44  *
45  * Revision 1.1 2005/02/11 18:22:06 f_limousin
46  * First version
47  *
48  *
49  * $Header: /cvsroot/Lorene/C++/Source/Bin_hor/binhor_viriel.C,v 1.6 2016/12/05 16:17:46 j_novak Exp $
50  *
51  */
52 
53 #include <cmath>
54 
55 // Lorene
56 #include "tensor.h"
57 #include "isol_hor.h"
58 
59 namespace Lorene {
60 double Single_hor::viriel_seul () const{
61 
62  int nz1 = mp.get_mg()->get_nzone() ;
63 
64  Valeur** devel_psi (psi_auto.asymptot(1)) ;
65  Valeur** devel_n (n_auto.asymptot(1)) ;
66 
67  double erreur = (2*(*devel_psi[1])(nz1-1, 0, 0, 0)
68  + (*devel_n[1])(nz1-1, 0, 0, 0))/fabs ((*devel_n[1])(nz1-1, 0, 0, 0)) ;
69 
70  return erreur ;
71 }
72 
73 
74 double Bin_hor::viriel () const{
75 
76  int nz_un = hole1.mp.get_mg()->get_nzone() ;
77  int nz_deux = hole2.mp.get_mg()->get_nzone() ;
78 
79  Valeur** devel_psi_un (hole1.psi_auto.asymptot(1)) ;
80  Valeur** devel_psi_deux (hole2.psi_auto.asymptot(1)) ;
81  Valeur** devel_n_un (hole1.n_auto.asymptot(1)) ;
82  Valeur** devel_n_deux (hole2.n_auto.asymptot(1)) ;
83 
84  double res =
85  (2*(*devel_psi_un[1])(nz_un-1, 0, 0, 0)+
86  2*(*devel_psi_deux[1])(nz_deux-1, 0, 0, 0)+
87  (*devel_n_deux[1])(nz_deux-1, 0, 0, 0) +
88  (*devel_n_un[1])(nz_un-1, 0, 0, 0))
89  / fabs ((*devel_n_deux[1])(nz_deux-1, 0, 0, 0) +
90  (*devel_n_un[1])(nz_un-1, 0, 0, 0)) ;
91 
92  return res ;
93 }
94 
95 }
Lorene prototypes.
Definition: app_hor.h:67
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
Definition: map.h:777
Single_hor hole1
Black hole one.
Definition: isol_hor.h:1342
Values and coefficients of a (real-value) function.
Definition: valeur.h:297
double viriel() const
Computes the viriel error, that is the difference between the ADM and the Komar masses, calculated by the asymptotic behaviours of respectively and N .
Definition: binhor_viriel.C:74
int get_nzone() const
Returns the number of domains.
Definition: grilles.h:465
Scalar n_auto
Lapse function .
Definition: isol_hor.h:915
Single_hor hole2
Black hole two.
Definition: isol_hor.h:1343
Map_af & mp
Affine mapping.
Definition: isol_hor.h:900
Valeur ** asymptot(int n, const int flag=0) const
Asymptotic expansion at r = infinity.
Scalar psi_auto
Conformal factor .
Definition: isol_hor.h:924
double viriel_seul() const
Computes the viriel error, that is the difference between the ADM and the Komar masses, calculated by the asymptotic behaviours of respectively and N .
Definition: binhor_viriel.C:60