Debian Codegraph @

Codes/Bin_star/asymptot.C

raw
1 /*
2 * Subroutine for analysis of asymptotic behavior of a Cmp
3 *
4 */
5
6 /*
7 * Copyright (c) 2002 Francois Limousin
8 *
9 * This file is part of LORENE.
10 *
11 * LORENE is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2
13 * as published by the Free Software Foundation.
14 *
15 * LORENE is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with LORENE; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
24 */
25 char asymptot_C[] = "$Header: /cvsroot/Lorene/Codes/Bin_star/asymptot.C,v 1.5 2014/10/13 08:53:53 j_novak Exp $" ;
26
27 /*
28 * $Id: asymptot.C,v 1.5 2014/10/13 08:53:53 j_novak Exp $
29 * $Log: asymptot.C,v $
30 * Revision 1.5 2014/10/13 08:53:53 j_novak
31 * Lorene classes and functions now belong to the namespace Lorene.
32 *
33 * Revision 1.4 2014/10/06 15:09:42 j_novak
34 * Modified #include directives to use c++ syntax.
35 *
36 * Revision 1.3 2004/03/25 12:35:36 j_novak
37 * now using namespace Unites
38 *
39 * Revision 1.2 2003/01/09 11:07:48 j_novak
40 * headcpp.h is now compliant with C++ norm.
41 * The include files have been ordered, as well as the local_settings_linux
42 *
43 * Revision 1.1 2002/06/18 14:07:26 f_limousin
44 * Analysis of asymptotic behavior of binary NS and BH
45 *
46 *
47 *
48 * $Header: /cvsroot/Lorene/Codes/Bin_star/asymptot.C,v 1.5 2014/10/13 08:53:53 j_novak Exp $
49 *
50 */
51
52 // Headers standard du C
53 // (par exemple definit la macro EXIT_SUCCESS)
54 #include <cstdlib>
55 #include <cstdio>
56
57
58 // Headers Lorene
59 #include "tenseur.h"
60 #include "bhole.h"
61 #include "binaire.h"
62 #include "eos.h"
63 #include "utilitaires.h"
64 #include "graphique.h"
65 #include "nbr_spx.h"
66
67 #include "unites.h"
68
69 namespace Lorene {
70
71 void asymptot(const Cmp& nn, const char* coment, bool graphics, ostream& fich) {
72
73 using namespace Unites ;
74
75 // Multi-grid
76 const Mg3d& mg = *( nn.get_mp()->get_mg() ) ;
77 int nz = mg.get_nzone() ;
78 int nzm1 = nz - 1 ; // index of the last domain
79
80 // Number of coefficients
81 int np = mg.get_np(nzm1) ;
82 int nt = mg.get_nt(nzm1) ;
83
84 // Asymptotic behavior of N :
85 Valeur** nn_asymp = nn.asymptot(3,1) ;
86
87
88 fich << "Asymptotic behavior of " << coment << endl << endl ;
89
90 for (int i=0; i<4; i++) {
91 // Value (on the angular grid) containing the coef of 1/r^i
92 Valeur& nn_i = *(nn_asymp[i]) ;
93
94 // Computation of spectral expansions
95 nn_i.coef() ;
96
97 cout << "Spectral coefficients of " << coment << " (1/r^" << i
98 << ") : " << endl ;
99
100 nn_i.affiche_seuil(cout,0,4,1e-5) ;
101
102 fich << "Spectral coefficients of " << coment << " (1/r^" << i
103 << ") : " << endl ;
104
105
106 double nni_max = 0. ;
107 for (int k=0; k<np+1; k++) {
108 if (k==1) continue ;
109 for (int j=0; j<nt; j++) {
110 double cf = (*nn_i.c_cf)(nzm1,k,j,0) ;
111 if (fabs(cf) > fabs (nni_max)) {
112 nni_max = fabs(cf) ;
113 }
114 }
115 }
116
117 fich << "nn" << i << "_max =" << nni_max << endl ;
118 //fich << "nn" << i << "_min =" << nni_min << endl ;
119
120 if ( nni_max > 1e-3 ) {
121 for (int k=0; k<np+1; k++) {
122 if (k==1) continue ;
123 for (int j=0; j<nt; j++) {
124 double cf = (*nn_i.c_cf)(nzm1,k,j,0) ;
125 if ( fabs(cf) > 0.01 * nni_max && nni_max !=0) {
126 fich << "k= " << k << " j= " << j << " : " << cf << endl ;
127 }
128 }
129 }
130 }
131
132 if (graphics && i==3) {
133 des_coef_theta(nn_i, 1, 0, 0, 1e-10) ;
134 des_coef_theta(nn_i, 1, 2, 0, 1e-10) ;
135 des_coef_theta(nn_i, 1, 4, 0, 1e-10) ;
136
137 des_coef_theta(nn_i, 1, 6, 0, 1e-10) ;
138 des_coef_theta(nn_i, 1, 8, 0, 1e-10) ;
139
140 des_coef_phi(nn_i, 1, 0, 0, 1e-10) ;
141 des_coef_phi(nn_i, 1, 1, 0, 1e-10) ;
142 des_coef_phi(nn_i, 1, 2, 0, 1e-10) ;
143 des_coef_phi(nn_i, 1, 3, 0, 1e-10) ;
144 des_coef_phi(nn_i, 1, 4, 0, 1e-10) ;
145
146 }
147 fich << endl ;
148
149 //double mass_nn = - nn_i(nz -1,0,0,0) / ggrav ;
150 //double mass_nn_sol = mass_nn / msol ;
151 //cout << "Mass read from lapse : " << mass_nn_sol << " M_sol" << endl ;
152
153 //nn_3.ylm() ; // Spherical harmonics
154
155 }
156 fich << "------------------------------------------------------------------------" << endl ;
157
158 }
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174 }