Debian Codegraph @

School05/Thursday/Sol_two_grids/sphere.C

raw
1 #include "type_parite.h"
2 #include "nbr_spx.h"
3 #include "grilles.h"
4 #include "map.h"
5 #include "graphique.h"
6 #include "monopole.h"
7 #include "utilitaires.h"
8
9 int main() {
10
11 // THE GRID
12 int nz_W = 6 ;
13 int nz_H = 5 ;
14 int nt = 5 ;
15 int np = 4 ;
16 int nr = 33 ;
17 int typet = SYM ;
18 int typep = SYM ;
19
20 bool compact = true ;
21 Mg3d grid_W (nz_W, nr, nt, np, typet, typep, compact) ;
22 Mg3d grid_H (nz_H, nr, nt, np, typet, typep, compact) ;
23
24 double beta ;
25 cout << "Beta ? " << endl ;
26 cin >> beta ;
27
28 // THE MAPPING AFFINE
29 double r_lim = 0.1 ;
30 double* bounds = new double[nz_W+1] ;
31
32 bounds[0] = 0 ;
33 bounds[1] = r_lim ;
34 for (int i=2 ; i<nz_W ; i++)
35 bounds[i] = 2*bounds[i-1] ;
36 bounds[nz_W] = __infinity ;
37
38 Map_af mp_W (grid_W, bounds) ;
39 delete [] bounds ;
40
41 r_lim = (beta>5) ? 1./beta : 1. ;
42 bounds = new double[nz_H+1] ;
43
44 bounds[0] = 0 ;
45 bounds[1] = r_lim ;
46 for (int i=2 ; i<nz_H ; i++)
47 bounds[i] = 2*bounds[i-1] ;
48 bounds[nz_H] = __infinity ;
49
50 Map_af mp_H (grid_H, bounds) ;
51 delete [] bounds ;
52
53
54 // The Monopole :
55 double precis = 1e-10 ;
56 int itemax = 1000 ;
57 double relax = 0.2 ;
58
59 Monopole champs(mp_W, mp_H, beta) ;
60 champs.solve_config(precis, itemax, relax) ;
61
62 cout.precision (14) ;
63 cout << "Parameter a = " << champs.give_a() << endl ;
64 cout << "Parameter b = " << champs.give_b() << endl ;
65 cout << "Energy = " << champs.energy() << endl ;
66
67 // Some plots
68 //des_profile (champs.get_big_W(), 0, 1.1*mp_W.val_r (nz_W-1,-1, 0,0), 0, 0, "W") ;
69 //des_profile (champs.get_big_H(), 0, 1.1*mp_H.val_r (nz_H-1,-1, 0,0) , 0, 0, "H") ;
70
71 return 0 ;
72 }