LORENE
bhole_pseudo_viriel.C
1 /*
2  * Copyright (c) 2000-2001 Philippe Grandclement
3  *
4  * This file is part of LORENE.
5  *
6  * LORENE is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * LORENE is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with LORENE; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  */
21 
22 
23 
24 
25 /*
26  * $Id: bhole_pseudo_viriel.C,v 1.6 2016/12/05 16:17:45 j_novak Exp $
27  * $Log: bhole_pseudo_viriel.C,v $
28  * Revision 1.6 2016/12/05 16:17:45 j_novak
29  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
30  *
31  * Revision 1.5 2014/10/13 08:52:40 j_novak
32  * Lorene classes and functions now belong to the namespace Lorene.
33  *
34  * Revision 1.4 2014/10/06 15:12:58 j_novak
35  * Modified #include directives to use c++ syntax.
36  *
37  * Revision 1.3 2005/08/29 15:10:14 p_grandclement
38  * Addition of things needed :
39  * 1) For BBH with different masses
40  * 2) Provisory files for the mixted binaries (Bh and NS) : THIS IS NOT
41  * WORKING YET !!!
42  *
43  * Revision 1.2 2003/10/03 15:58:44 j_novak
44  * Cleaning of some headers
45  *
46  * Revision 1.1.1.1 2001/11/20 15:19:28 e_gourgoulhon
47  * LORENE
48  *
49  * Revision 2.6 2000/12/15 13:52:38 phil
50  * modification critere sans les derivees
51  *
52  * Revision 2.5 2000/12/14 14:09:11 phil
53  * simplification
54  *
55  * Revision 2.4 2000/12/14 10:45:30 phil
56  * ATTENTION : PASSAGE DE PHI A PSI
57  *
58  * Revision 2.3 2000/11/15 18:27:08 phil
59  * retour ancienne version (avec signe)
60  *
61  * Revision 2.2 2000/11/15 15:13:44 phil
62  * *** empty log message ***
63  *
64  * Revision 2.1 2000/11/15 09:45:04 phil
65  * *** empty log message ***
66  *
67  * Revision 2.0 2000/11/15 09:43:49 phil
68  * *** empty log message ***
69  *
70  *
71  * $Header: /cvsroot/Lorene/C++/Source/Bhole_binaire/bhole_pseudo_viriel.C,v 1.6 2016/12/05 16:17:45 j_novak Exp $
72  *
73  */
74 
75 #include <cmath>
76 
77 // Lorene
78 #include "tenseur.h"
79 #include "bhole.h"
80 
81 namespace Lorene {
82 double Bhole::viriel_seul () const{
83 
84  int nz = mp.get_mg()->get_nzone() ;
85 
86  Valeur** devel_psi (psi_auto().asymptot(1)) ;
87  Valeur** devel_n (n_auto().asymptot(1)) ;
88 
89  double erreur = (2*(*devel_psi[1])(nz-1, 0, 0, 0)
90  + (*devel_n[1])(nz-1, 0, 0, 0))/fabs ((*devel_n[1])(nz-1, 0, 0, 0)) ;
91 
92  return erreur ;
93 }
94 
95 
96 double Bhole_binaire::viriel () const{
97 
98  int nz_un = hole1.mp.get_mg()->get_nzone() ;
99  int nz_deux = hole2.mp.get_mg()->get_nzone() ;
100 
101  Valeur** devel_psi_un (hole1.psi_auto().asymptot(1)) ;
102  Valeur** devel_psi_deux (hole2.psi_auto().asymptot(1)) ;
103  Valeur** devel_n_un (hole1.n_auto().asymptot(1)) ;
104  Valeur** devel_n_deux (hole2.n_auto().asymptot(1)) ;
105 
106  double res =
107  (2*(*devel_psi_un[1])(nz_un-1, 0, 0, 0)+
108  2*(*devel_psi_deux[1])(nz_deux-1, 0, 0, 0)+
109  (*devel_n_deux[1])(nz_deux-1, 0, 0, 0) +
110  (*devel_n_un[1])(nz_un-1, 0, 0, 0))
111  / fabs ((*devel_n_deux[1])(nz_deux-1, 0, 0, 0) +
112  (*devel_n_un[1])(nz_un-1, 0, 0, 0)) ;
113 
114  return res ;
115 }
116 
117 }
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
Tenseur psi_auto
Part of generated by the hole.
Definition: bhole.h:290
Values and coefficients of a (real-value) function.
Definition: valeur.h:297
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 .
Map_af & mp
Affine mapping.
Definition: bhole.h:273
Bhole hole1
Black hole one.
Definition: bhole.h:762
int get_nzone() const
Returns the number of domains.
Definition: grilles.h:465
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 .
Tenseur n_auto
Part of N generated by the hole.
Definition: bhole.h:286
Bhole hole2
Black hole two.
Definition: bhole.h:763