Debian Codegraph @

Codes/Test/Compobj/test_compobj.C

raw
1 /*
2 * Test code for classes Compobj, Compobj_QI, Star_QI and Boson_star
3 *
4 * (see files compobj.h and boson_star.h for documentation).
5 *
6 */
7
8 /*
9 * Copyright (c) 2012 Claire Some, Eric Gourgoulhon
10 *
11 * This file is part of LORENE.
12 *
13 * LORENE is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2
15 * as published by the Free Software Foundation.
16 *
17 * LORENE is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with LORENE; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
26 */
27
28 char test_compobj_C[] = "$Header: /cvsroot/Lorene/Codes/Test/Compobj/test_compobj.C,v 1.5 2014/10/13 08:54:00 j_novak Exp $" ;
29
30 /*
31 * $Id: test_compobj.C,v 1.5 2014/10/13 08:54:00 j_novak Exp $
32 * $Log: test_compobj.C,v $
33 * Revision 1.5 2014/10/13 08:54:00 j_novak
34 * Lorene classes and functions now belong to the namespace Lorene.
35 *
36 * Revision 1.4 2012/11/22 16:05:42 c_some
37 * Added test for class Boson_star
38 *
39 * Revision 1.3 2012/11/21 14:51:26 c_some
40 * Added test for class Star_QI
41 *
42 * Revision 1.2 2012/11/20 16:30:21 c_some
43 * Added test for class Compobj_QI
44 *
45 * Revision 1.1 2012/11/15 16:20:52 c_some
46 * New class Compobj
47 *
48 *
49 * $Header: /cvsroot/Lorene/Codes/Test/Compobj/test_compobj.C,v 1.5 2014/10/13 08:54:00 j_novak Exp $
50 *
51 */
52
53 // C++ headers
54
55 // C headers
56
57 // Lorene headers
58 #include "boson_star.h"
59 #include "nbr_spx.h"
60
61
62 using namespace Lorene ;
63
64 int main() {
65
66 // Number of domains
67 int nz = 3 ;
68
69 // Number of coefficients for the spectral expansions (the same in each domain)
70 int nr = 9 ;
71 int nt = 7 ;
72 int np = 1 ;
73
74 // Setup of a multi-domain grid (Lorene class Mg3d)
75 // ------------------------------------------------
76
77 int symmetry_theta = SYM ; // symmetry with respect to the equatorial plane
78 int symmetry_phi = SYM ; // symmetry with respect to phi --> phi + pi
79 bool compact = true ; // external domain is compactified
80
81 Mg3d mgrid(nz, nr, nt, np, symmetry_theta, symmetry_phi, compact) ;
82
83 cout << mgrid << endl ;
84
85 // Setup of an affine mapping : grid --> physical space (Lorene class Map_af)
86 // --------------------------------------------------------------------------
87
88 double r_limits[] = {0, 1., 2., __infinity} ;
89 Map_af map(mgrid, r_limits) ;
90
91 cout << map << endl ;
92
93 // Construction of the compact object :
94 // ----------------------------------
95
96 Compobj star(map) ;
97
98 cout << "star :" << star << endl ;
99 cout << endl << "**************************************************************************" << endl ;
100
101 Compobj_QI compqi(map) ;
102
103 cout << "compqi :" << compqi << endl ;
104 cout << endl << "**************************************************************************" << endl ;
105
106 Star_QI starqi(map) ;
107
108 cout << "starqi :" << starqi << endl ;
109 cout << endl << "**************************************************************************" << endl ;
110
111
112 Boson_star bostar(map) ;
113
114 cout << "bostar :" << bostar << endl ;
115
116 }